Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/push-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
workflow_dispatch:
push:
branches:
- main
# - main
- disabled_github_action

env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }}
Expand Down Expand Up @@ -43,15 +44,15 @@ jobs:
run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)"
id: version

- name: Build with tag and push image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
run: |
docker build \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .

docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
# - name: Build with tag and push image
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
# IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
# run: |
# docker build \
# -t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \
# -t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .

# docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
# docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ COPY --from=base /build/refresh-service refresh-service

ENV CIRCUITS_FOLDER_PATH=/app/keys

ENTRYPOINT ["/app/refresh-service"]
# Wrapper
COPY entrypoint.sh /entrypoint.sh
RUN chmod 0755 /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/app/refresh-service"]
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

SRC="/shared/env/app.env"
DST="/app/.env"

if [ -f "$SRC" ]; then
cp "$SRC" "$DST"
chmod 0400 "$DST" || true
fi

exec "$@"
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ require (
github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 // indirect
github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e // indirect
github.com/iden3/merkletree-proof v1.0.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.6 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
Expand Down
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/0xPolygonID/refresh-service/server"
"github.com/0xPolygonID/refresh-service/service"
"github.com/iden3/go-schema-processor/v2/loaders"
"github.com/joho/godotenv"
"github.com/kelseyhightower/envconfig"
"github.com/piprate/json-gold/ld"
"github.com/pkg/errors"
Expand Down Expand Up @@ -72,6 +73,11 @@ func (c *Config) getSupportedIssuers() map[string]string {

func main() {
var cfg Config

if err := godotenv.Load(); err != nil {
log.Printf("Error loading .env file: %v", err)
}

if err := envconfig.Process("", &cfg); err != nil {
log.Fatalf("failed init config: %v", err)
}
Expand Down
Loading