diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 22df58d..e4ac6d5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -128,14 +128,14 @@ jobs: echo "## Do not edit this file directly. It is auto-generated by the script." > argocd/deployment/deployment.yml sed "s|__TAG__|${{ gitea.ref_name }}|g" argocd/template/deployment.yml >> argocd/deployment/deployment.yml -# - name: 💾✅ Commit Updated Manifest -# uses: EndBug/add-and-commit@v9 -# with: -# new_branch: ${{ gitea.ref_name }}-deploy -# add: argocd/deployment/deployment.yml -# author_name: "GitHub Action 🤖" -# author_email: gitia@siteworxpro.com -# message: "📝🔄 Update deployment manifest with new image tags" + - name: 💾✅ Commit Updated Manifest + uses: EndBug/add-and-commit@v9 + with: + new_branch: ${{ gitea.ref_name }}-deploy + add: argocd/deployment/deployment.yml + author_name: "GitHub Action 🤖" + author_email: gitia@siteworxpro.com + message: "📝🔄 Update deployment manifest with new image tags" - name: 🚀✨ Create Pull Request uses: peter-evans/create-pull-request@v7 diff --git a/backend/main.go b/backend/main.go index fcafee0..109d754 100644 --- a/backend/main.go +++ b/backend/main.go @@ -16,10 +16,12 @@ import ( "github.com/labstack/echo/v4/middleware" "github.com/labstack/gommon/log" "net/http" + "strings" ) const ( - Port Env.EnvironmentVariable = "PORT" + Port Env.EnvironmentVariable = "PORT" + CorsOrigin Env.EnvironmentVariable = "CORS_ORIGIN" ) type ( @@ -45,11 +47,14 @@ func main() { e.Logger.SetLevel(log.DEBUG) + corsOriginS := CorsOrigin.GetEnvString("http://localhost:5173,http://127.0.0.1:5173") + corsOrigin := strings.Split(corsOriginS, ",") + e.Use(database.CreateDatabaseMiddleware()) e.Use(middleware.Recover()) e.Use(middleware.Logger()) e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ - AllowOrigins: []string{"http://localhost:5173", "http://127.0.0.1:5173"}, + AllowOrigins: corsOrigin, AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE"}, })) diff --git a/docker-compose.yml b/docker-compose.yml index ad14422..309b0e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ services: frontend: - image: scr.siteworxpro.com/reloading-manager/frontend:v0.0.14 + image: scr.siteworxpro.com/reloading-manager/frontend:v0.0.16 ports: - "80:80" backend: - image: scr.siteworxpro.com/reloading-manager/backend:v0.0.14 + image: scr.siteworxpro.com/reloading-manager/backend:v0.0.16 environment: DB_HOST: 192.168.1.30 DB_DATABASE: loading