flag for config location, adjusted .service
This commit is contained in:
@@ -6,12 +6,15 @@ After=network.target
|
|||||||
DynamicUser=yes
|
DynamicUser=yes
|
||||||
ExecStart=/opt/csgowtfd/csgowtfd
|
ExecStart=/opt/csgowtfd/csgowtfd
|
||||||
WorkingDirectory=/var/lib/csgowtfd
|
WorkingDirectory=/var/lib/csgowtfd
|
||||||
|
RuntimeDirectory=csgowtfd
|
||||||
|
StateDirectory=csgowtfd
|
||||||
|
ConfigurationDirectory=csgowtfd
|
||||||
|
|
||||||
|
# more hardening
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
PrivateTmp=yes
|
PrivateTmp=yes
|
||||||
PrivateDevices=yes
|
PrivateDevices=yes
|
||||||
DevicePolicy=closed
|
DevicePolicy=closed
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=read-only
|
|
||||||
ProtectControlGroups=yes
|
ProtectControlGroups=yes
|
||||||
ProtectKernelModules=yes
|
ProtectKernelModules=yes
|
||||||
ProtectKernelTunables=yes
|
ProtectKernelTunables=yes
|
||||||
|
3
main.go
3
main.go
@@ -36,6 +36,7 @@ var (
|
|||||||
demoParser = &csgo.DemoParser{}
|
demoParser = &csgo.DemoParser{}
|
||||||
firstHK = true
|
firstHK = true
|
||||||
rL ratelimit.Limiter
|
rL ratelimit.Limiter
|
||||||
|
configFlag = flag.String("config", "config.yaml", "Set config to use")
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlayerResponse struct {
|
type PlayerResponse struct {
|
||||||
@@ -360,7 +361,7 @@ func main() {
|
|||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
confStr, err := os.ReadFile("config.yaml")
|
confStr, err := os.ReadFile(*configFlag)
|
||||||
utils.Check(err)
|
utils.Check(err)
|
||||||
|
|
||||||
err = yaml.Unmarshal(confStr, &conf)
|
err = yaml.Unmarshal(confStr, &conf)
|
||||||
|
Reference in New Issue
Block a user