diff --git a/assets/config.ini b/assets/config.ini deleted file mode 100644 index c4c3b3d..0000000 --- a/assets/config.ini +++ /dev/null @@ -1,18 +0,0 @@ -WikiName = My wiki -NaviTitleIcon = 🐑 -UseSiblingHyphaeSidebar = false - -[Hyphae] -HomeHypha = home -UserHypha = u -HeaderLinksHypha = header-links - -[Network] -HTTPPort = 8080 -URL = https://wiki - -[Authorization] -UseAuth = true - -AllowRegistration = true -RegistrationLimit = 10 diff --git a/assets/devconfig.ini b/assets/devconfig.ini deleted file mode 100644 index 3269421..0000000 --- a/assets/devconfig.ini +++ /dev/null @@ -1,18 +0,0 @@ -WikiName = Mycorrhiza (dev) -NaviTitleIcon = 🧑‍💻 -UseSiblingHyphaeSidebar = false - -[Hyphae] -HomeHypha = home -UserHypha = u -HeaderLinksHypha = header-links - -[Network] -HTTPPort = 1737 -URL = http://localhost:1737 - -[Authorization] -UseAuth = true - -AllowRegistration = true -RegistrationLimit = 3 diff --git a/flag.go b/flag.go index a4cae5d..b3dc935 100644 --- a/flag.go +++ b/flag.go @@ -28,11 +28,6 @@ func printHelp() { flag.PrintDefaults() } -// CreateUserCommand is parameters for admin creation flag. Only a single parameter, though. -type CreateUserCommand struct { - name string -} - // parseCliArgs parses CLI options and sets several important global variables. Call it early. func parseCliArgs() { var createAdminName string @@ -74,7 +69,7 @@ func createAdminCommand(name string) { user.InitUserDatabase() log.SetOutput(wr) - handle := syscall.Stdin + handle /*rug*/ := syscall.Stdin if !term.IsTerminal(handle) { log.Fatal("error: not a terminal") } diff --git a/history/feed.go b/history/feed.go index 18b7001..d48c5a1 100644 --- a/history/feed.go +++ b/history/feed.go @@ -49,7 +49,7 @@ func RecentChangesJSON(opts FeedOptions) (string, error) { type revisionGroup []Revision func newRevisionGroup(rev Revision) revisionGroup { - return revisionGroup([]Revision{rev}) + return []Revision{rev} } func (grp *revisionGroup) addRevision(rev Revision) { diff --git a/l18n/l18n.go b/l18n/l18n.go index 3389553..67b347b 100644 --- a/l18n/l18n.go +++ b/l18n/l18n.go @@ -105,27 +105,6 @@ func FromRequest(r *http.Request) *Localizer { return New(base.String(), "en") } -// SetLocales changes locales used by the localizer. -func (t Localizer) SetLocales(locale, fallback string) Localizer { - t.Locale = locale - t.FallbackLocale = fallback - return t -} - -// SetLocale changes the preferred locale used by the localizer. The fallback -// locale is kept unchanged. -func (t Localizer) SetLocale(locale string) Localizer { - t.Locale = locale - return t -} - -// SetFallbackLocale changes the fallback locale used by the localizer. The -// preferred locale is kept unchanged. -func (t Localizer) SetFallbackLocale(fallback string) Localizer { - t.FallbackLocale = fallback - return t -} - // GetWithLocale returns a localized string for the provided key in a specific // locale with optional replacements executed on the string. func (t Localizer) GetWithLocale(locale, key string, replacements ...*Replacements) string { @@ -248,4 +227,7 @@ func getLocalizationKey(locale string, key string) string { - feeds (it seems diffcult to pull locale here) We do not translate: - stdout traces (logging is English-only) + +bouncepaw: +- more error messages */ diff --git a/user/user.go b/user/user.go index 886c081..26b0ffe 100644 --- a/user/user.go +++ b/user/user.go @@ -105,8 +105,11 @@ func (user *User) CanProceed(route string) bool { defer user.RUnlock() right := groupRight[user.Group] - minimalRight := minimalRights[route] + minimalRight, specified := minimalRights[route] + if !specified { + return false + } return right >= minimalRight } diff --git a/web/web.go b/web/web.go index 212d0e2..6d6045b 100644 --- a/web/web.go +++ b/web/web.go @@ -1,6 +1,4 @@ // Package web contains web handlers and initialization stuff. -// -// It exports just one function: Init. Call it if you want to have web capabilities. package web import (