1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-04 18:19:54 +00:00

Remove some unused stuff

This commit is contained in:
Timur Ismagilov 2022-02-20 13:11:29 +03:00
parent dea370c71d
commit 4ab9a88437
7 changed files with 9 additions and 67 deletions

View File

@ -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

View File

@ -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

View File

@ -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")
}

View File

@ -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) {

View File

@ -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
*/

View File

@ -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
}

View File

@ -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 (