mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-07 14:49:59 +00:00
boxdd: Add insecure mode
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sagernet/sing/common/json"
|
||||
"github.com/sagernet/tailscale/atomicfile"
|
||||
)
|
||||
|
||||
const securitySettingsFileName = "security.json"
|
||||
|
||||
type securitySettings struct {
|
||||
InsecureModeEnabled bool `json:"insecure_mode_enabled"`
|
||||
}
|
||||
|
||||
func saveSecuritySettings(directory string, settings securitySettings) error {
|
||||
content, err := json.Marshal(settings)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return atomicfile.WriteFile(filepath.Join(directory, securitySettingsFileName), content, 0o600)
|
||||
}
|
||||
Reference in New Issue
Block a user