mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2026-04-07 15:53:29 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e399b8590 | |||
| 28baa2ed00 | |||
| 58c95879cc | |||
| af0a72eb67 |
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -9,9 +9,9 @@
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/cmd/q3rcon-proxy/main.go",
|
||||
"program": "${workspaceFolder}/cmd/q3rcon-proxy/",
|
||||
"env": {
|
||||
"Q3RCON_PROXY": "28961:28960",
|
||||
"Q3RCON_PORTS_MAPPING": "28961:28960",
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -55,6 +55,14 @@ func main() {
|
||||
Sources: cli.EnvVars("Q3RCON_LOGLEVEL"),
|
||||
},
|
||||
},
|
||||
Before: func(ctx context.Context, cmd *cli.Command) (context.Context, error) {
|
||||
logLevel, err := log.ParseLevel(cmd.String("loglevel"))
|
||||
if err != nil {
|
||||
return ctx, fmt.Errorf("invalid log level: %w", err)
|
||||
}
|
||||
log.SetLevel(logLevel)
|
||||
return ctx, nil
|
||||
},
|
||||
Action: func(_ context.Context, cmd *cli.Command) error {
|
||||
errChan := make(chan error)
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func getEnvInt(key string) (int, error) {
|
||||
s := os.Getenv(key)
|
||||
if s == "" {
|
||||
return 0, nil
|
||||
}
|
||||
v, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
4
debian/q3rcon-proxy.service
vendored
4
debian/q3rcon-proxy.service
vendored
@@ -6,9 +6,9 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=gameservers
|
||||
Environment="Q3RCON_PROXY=20000:28960;20001:28961;20002:28962"
|
||||
Environment="Q3RCON_PORTS_MAPPING=20000:28960;20001:28961;20002:28962"
|
||||
Environment="Q3RCON_HOST=0.0.0.0"
|
||||
Environment="Q3RCON_DEBUG=0"
|
||||
Environment="Q3RCON_LOGLEVEL=info"
|
||||
|
||||
ExecStart=/usr/local/bin/q3rcon-proxy
|
||||
Restart=always
|
||||
|
||||
Reference in New Issue
Block a user