mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-12-06 00:18:07 +00:00
Remove some unused stuff
This commit is contained in:
@@ -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
|
|
||||||
@@ -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
|
|
||||||
7
flag.go
7
flag.go
@@ -28,11 +28,6 @@ func printHelp() {
|
|||||||
flag.PrintDefaults()
|
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.
|
// parseCliArgs parses CLI options and sets several important global variables. Call it early.
|
||||||
func parseCliArgs() {
|
func parseCliArgs() {
|
||||||
var createAdminName string
|
var createAdminName string
|
||||||
@@ -74,7 +69,7 @@ func createAdminCommand(name string) {
|
|||||||
user.InitUserDatabase()
|
user.InitUserDatabase()
|
||||||
log.SetOutput(wr)
|
log.SetOutput(wr)
|
||||||
|
|
||||||
handle := syscall.Stdin
|
handle /*rug*/ := syscall.Stdin
|
||||||
if !term.IsTerminal(handle) {
|
if !term.IsTerminal(handle) {
|
||||||
log.Fatal("error: not a terminal")
|
log.Fatal("error: not a terminal")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func RecentChangesJSON(opts FeedOptions) (string, error) {
|
|||||||
type revisionGroup []Revision
|
type revisionGroup []Revision
|
||||||
|
|
||||||
func newRevisionGroup(rev Revision) revisionGroup {
|
func newRevisionGroup(rev Revision) revisionGroup {
|
||||||
return revisionGroup([]Revision{rev})
|
return []Revision{rev}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (grp *revisionGroup) addRevision(rev Revision) {
|
func (grp *revisionGroup) addRevision(rev Revision) {
|
||||||
|
|||||||
24
l18n/l18n.go
24
l18n/l18n.go
@@ -105,27 +105,6 @@ func FromRequest(r *http.Request) *Localizer {
|
|||||||
return New(base.String(), "en")
|
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
|
// GetWithLocale returns a localized string for the provided key in a specific
|
||||||
// locale with optional replacements executed on the string.
|
// locale with optional replacements executed on the string.
|
||||||
func (t Localizer) GetWithLocale(locale, key string, replacements ...*Replacements) 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)
|
- feeds (it seems diffcult to pull locale here)
|
||||||
We do not translate:
|
We do not translate:
|
||||||
- stdout traces (logging is English-only)
|
- stdout traces (logging is English-only)
|
||||||
|
|
||||||
|
bouncepaw:
|
||||||
|
- more error messages
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -105,8 +105,11 @@ func (user *User) CanProceed(route string) bool {
|
|||||||
defer user.RUnlock()
|
defer user.RUnlock()
|
||||||
|
|
||||||
right := groupRight[user.Group]
|
right := groupRight[user.Group]
|
||||||
minimalRight := minimalRights[route]
|
minimalRight, specified := minimalRights[route]
|
||||||
|
|
||||||
|
if !specified {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return right >= minimalRight
|
return right >= minimalRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
// Package web contains web handlers and initialization stuff.
|
// 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
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
Reference in New Issue
Block a user