diff options
| -rw-r--r-- | .env | 4 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | go.mod | 3 | ||||
| -rw-r--r-- | go.sum | 2 |
5 files changed, 18 insertions, 2 deletions
@@ -0,0 +1,4 @@ +OAUTH_CLIENT_ID=client_id +OAUTH_CLIENT_SECRET=client_secret +OAUTH_REDIRECT_URL=http://localhost:8080/session/callback +OIDC_ISSUER=https://gitlab.com @@ -1 +1,2 @@ /sparkled +.env.local @@ -12,6 +12,8 @@ clean: setup: @mise install + @go install tool + @command -v godotenv build: sparkled @@ -31,10 +33,14 @@ build-builder-image: @docker build --target build --tag $(IMAGE_TAG) . run: clean build - BIND_ADDR=:8080 ./sparkled + @godotenv -f .env.local,.env ./sparkled run-image: build-image - @docker run -p 8080:80 -it $(IMAGE_TAG) + @if [ -f ".env.local" ]; then \ + docker run --env BIND_ADDR=:http --env-file .env.local -p 8080:80 -it $(IMAGE_TAG); \ + else \ + docker run --env BIND_ADDR=:http --env-file .env -p 8080:80 -it $(IMAGE_TAG); \ + fi sh-image: build-builder-image @docker run -it $(IMAGE_TAG) /bin/sh @@ -36,6 +36,7 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/jsonapi v1.0.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/klauspost/compress v1.17.4 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.9 // indirect @@ -71,3 +72,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +tool github.com/joho/godotenv/cmd/godotenv @@ -55,6 +55,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= |
