mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-11-02 00:23:01 +00:00
Add fields related to registration to the config
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/go-ini/ini"
|
||||
)
|
||||
|
||||
// See https://mycorrhiza.lesarbr.es/hypha/configuration/fields
|
||||
type Config struct {
|
||||
WikiName string
|
||||
NaviTitleIcon string
|
||||
@@ -30,6 +31,10 @@ type Network struct {
|
||||
type Authorization struct {
|
||||
UseFixedAuth bool
|
||||
FixedAuthCredentialsPath string
|
||||
|
||||
UseRegistration bool
|
||||
RegistrationCredentialsPath string
|
||||
LimitRegistration uint64
|
||||
}
|
||||
|
||||
func ReadConfigFile(path string) {
|
||||
@@ -49,6 +54,10 @@ func ReadConfigFile(path string) {
|
||||
Authorization: Authorization{
|
||||
UseFixedAuth: false,
|
||||
FixedAuthCredentialsPath: "",
|
||||
|
||||
UseRegistration: false,
|
||||
RegistrationCredentialsPath: "",
|
||||
LimitRegistration: 0,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -60,6 +69,7 @@ func ReadConfigFile(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
// Map the struct to the global variables
|
||||
SiteName = cfg.WikiName
|
||||
SiteNavIcon = cfg.NaviTitleIcon
|
||||
HomePage = cfg.HomeHypha
|
||||
@@ -70,4 +80,7 @@ func ReadConfigFile(path string) {
|
||||
GeminiCertPath = cfg.GeminiCertificatePath
|
||||
UseFixedAuth = cfg.UseFixedAuth
|
||||
FixedCredentialsPath = cfg.FixedAuthCredentialsPath
|
||||
UseRegistration = cfg.UseRegistration
|
||||
RegistrationCredentialsPath = cfg.RegistrationCredentialsPath
|
||||
LimitRegistration = cfg.LimitRegistration
|
||||
}
|
||||
|
||||
@@ -22,11 +22,14 @@ var (
|
||||
URL string
|
||||
GeminiCertPath string
|
||||
|
||||
UseFixedAuth bool
|
||||
FixedCredentialsPath string
|
||||
|
||||
WikiDir string
|
||||
ConfigFilePath string
|
||||
|
||||
UseFixedAuth bool
|
||||
FixedCredentialsPath string
|
||||
UseRegistration bool
|
||||
RegistrationCredentialsPath string
|
||||
LimitRegistration uint64
|
||||
)
|
||||
|
||||
// LettersNumbersOnly keeps letters and numbers only in the given string.
|
||||
|
||||
Reference in New Issue
Block a user