diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:56:26 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:56:26 +0900 |
| commit | a8f2594e8dcb741fb942092cbc53d64cf93132ef (patch) | |
| tree | c694b162e9c33d9f805b3c473a9d042f27ac63b7 /worker/main.go | |
| parent | 01fafac46390e540f4d8766d53177a69da7e64ae (diff) | |
| parent | c04691e046910f0e419370472abcf0a3c615d6b7 (diff) | |
| download | phperkaigi-2025-albatross-a8f2594e8dcb741fb942092cbc53d64cf93132ef.tar.gz phperkaigi-2025-albatross-a8f2594e8dcb741fb942092cbc53d64cf93132ef.tar.zst phperkaigi-2025-albatross-a8f2594e8dcb741fb942092cbc53d64cf93132ef.zip | |
Merge branch 'feat/security'
Diffstat (limited to 'worker/main.go')
| -rw-r--r-- | worker/main.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/worker/main.go b/worker/main.go index 8134a56..ac65305 100644 --- a/worker/main.go +++ b/worker/main.go @@ -3,6 +3,7 @@ package main import ( "log" "net/http" + "os" echojwt "github.com/labstack/echo-jwt/v4" "github.com/labstack/echo/v4" @@ -10,6 +11,11 @@ import ( ) func main() { + jwtSecret := os.Getenv("ALBATROSS_JWT_SECRET") + if jwtSecret == "" { + log.Fatal("ALBATROSS_JWT_SECRET is not set") + } + if err := prepareDirectories(); err != nil { log.Fatal(err) } @@ -20,7 +26,7 @@ func main() { e.Use(middleware.Recover()) e.Use(echojwt.WithConfig(echojwt.Config{ - SigningKey: []byte("TODO"), + SigningKey: []byte(jwtSecret), })) e.POST("/api/swiftc", handleSwiftCompile) |
