Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Kioubit committed Jul 30, 2024
1 parent ceb0548 commit 479e426
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
flapalerted:
image: ghcr.io/kioubit/flapalerted:latest
container_name: flapalerted
restart: always
ports:
- "8699"
- "1790"
environment:
- FA_ASN=4242423914
logging:
options:
max-size: "100M"
max-file: "2"
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"
)

var Version = "v3.13.2"
var Version = "v3.13.3"

func main() {
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{})))
Expand All @@ -40,11 +40,11 @@ func main() {

// Support environment variables
flag.VisitAll(func(f *flag.Flag) {
env := os.Getenv(strings.ToUpper(f.Name))
env := os.Getenv(strings.ToUpper("FA_" + f.Name))
if env != "" {
err := flag.Set("FA_"+f.Name, env)
err := flag.Set(f.Name, env)
if err != nil {
fmt.Println("Invalid environment variable value for", strings.ToUpper(f.Name))
fmt.Println("Invalid value for the environment variable value", strings.ToUpper("FA_"+f.Name))
os.Exit(1)
}
}
Expand Down

0 comments on commit 479e426

Please sign in to comment.