single db with prefixes, dump/restore, blacklisting on user deletion

This commit is contained in:
ston1th 2018-09-23 23:56:12 +02:00
commit d4971cda89
20 changed files with 264 additions and 163 deletions

View file

@ -19,6 +19,14 @@ var reservedUsers = []string{
"wiki",
}
// Parts taken from strings.TrimPrefix
func hasTrimPrefix(s, prefix string) (string, bool) {
if len(s) >= len(prefix) && s[0:len(prefix)] == prefix {
return s[len(prefix):], true
}
return s, false
}
func reservedUser(username string) bool {
for _, v := range reservedUsers {
if username == v {