made registration disableable

This commit is contained in:
2026-06-07 02:08:49 +02:00
parent a31c516e8f
commit b93d9382ac
4 changed files with 170 additions and 27 deletions

View File

@@ -9,10 +9,11 @@ import (
)
type Config struct {
Port string `yaml:"port"`
DatabasePath string `yaml:"database_path"`
CertificatePath string `yaml:"certificate_path"`
PrivateKeyPath string `yaml:"private_key_path"`
Port string `yaml:"port"`
DatabasePath string `yaml:"database_path"`
CertificatePath string `yaml:"certificate_path"`
PrivateKeyPath string `yaml:"private_key_path"`
AllowRegistration bool `yaml:"allow_registration"`
}
const configPath = "./appdata/config.yaml"
@@ -34,10 +35,11 @@ func CheckIfExists() error {
}
defaultConfig := Config{
Port: "8080",
DatabasePath: "./appdata/database.db",
CertificatePath: "./appdata/cert.pem",
PrivateKeyPath: "./appdata/key.pem",
Port: "8080",
DatabasePath: "./appdata/database.db",
CertificatePath: "./appdata/cert.pem",
PrivateKeyPath: "./appdata/key.pem",
AllowRegistration: true,
}
data, err := yaml.Marshal(defaultConfig)