mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Use cloudflare turnstile.
This commit is contained in:
@@ -29,8 +29,8 @@ type ServerConfig struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
filepath := filepath.Join(utils.GetStoragePath(), "config.json")
|
||||
if _, err := os.Stat(filepath); os.IsNotExist(err) {
|
||||
p := filepath.Join(utils.GetStoragePath(), "config.json")
|
||||
if _, err := os.Stat(p); os.IsNotExist(err) {
|
||||
config = &ServerConfig{
|
||||
MaxUploadingSizeInMB: 20 * 1024, // 20GB
|
||||
MaxFileSizeInMB: 8 * 1024, // 8GB
|
||||
@@ -42,7 +42,7 @@ func init() {
|
||||
ServerDescription: "Nysoure is a file sharing service.",
|
||||
}
|
||||
} else {
|
||||
data, err := os.ReadFile(filepath)
|
||||
data, err := os.ReadFile(p)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -96,3 +96,7 @@ func ServerName() string {
|
||||
func ServerDescription() string {
|
||||
return config.ServerDescription
|
||||
}
|
||||
|
||||
func CloudflareTurnstileSecretKey() string {
|
||||
return config.CloudflareTurnstileSecretKey
|
||||
}
|
||||
|
Reference in New Issue
Block a user