diff --git a/.env.example b/.env.example index 44d3888..37af88a 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,10 @@ # REST API configuration REST_API_URL= +# Auth configuration - required in production +AUTH_ORIGIN= +AUTH_SECRET= + # Google configuration GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= @@ -8,6 +12,3 @@ GOOGLE_REFRESH_TOKEN_URL= # .NET backend runs locally on HTTPS (must be set to 0), for production must be set to 1 NODE_TLS_REJECT_UNAUTHORIZED= - -# Authorization secret -AUTH_SECRET= diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d0c96b3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: SSH into the server, Github pull and update Docker setup + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script_stop: true + script: | + cd /usr/local/team07/presentation-web/frontend + git checkout main + git pull + docker compose down --rmi all + docker compose build --no-cache + docker compose up -d diff --git a/nuxt.config.ts b/nuxt.config.ts index 04b9d80..9578688 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,7 +4,7 @@ export default defineNuxtConfig({ devtools: { enabled: true }, auth: { enableGlobalAppMiddleware: process.env.VERCEL_ENV !== 'preview', - origin: process.env.NODE_ENV === 'production' ? 'https://frontend-tag.vercel.app' : 'http://localhost:3000', + origin: process.env.AUTH_ORIGIN ?? 'http://localhost:3000', }, runtimeConfig: { restApiUrl: process.env.REST_API_URL, diff --git a/package.json b/package.json index 46d5a51..c923416 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@nuxt/content": "^2.9.0", "copy-to-clipboard": "^3.3.3", "md-to-pdf": "^5.2.4", - "next-auth": "~4.22.5" + "next-auth": "4.21.1" }, "husky": { "hooks": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9c1c61..dd3390f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ dependencies: specifier: ^5.2.4 version: 5.2.4(typescript@5.2.2) next-auth: - specifier: ~4.22.5 - version: 4.22.5(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + specifier: 4.21.1 + version: 4.21.1(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) devDependencies: '@bg-dev/nuxt-naiveui': @@ -51,7 +51,7 @@ devDependencies: version: 6.8.1(ts-node@10.9.1)(webpack@5.89.0) '@sidebase/nuxt-auth': specifier: ^0.5.0 - version: 0.5.0(next-auth@4.22.5) + version: 0.5.0(next-auth@4.21.1) commitlint-config-gitmoji: specifier: ^2.3.1 version: 2.3.1 @@ -2779,14 +2779,14 @@ packages: - zenObservable dev: false - /@sidebase/nuxt-auth@0.5.0(next-auth@4.22.5): + /@sidebase/nuxt-auth@0.5.0(next-auth@4.21.1): resolution: {integrity: sha512-Zq0laKbRjX3luAJrkSTYE9gkLttFO5LiWB9qq5xiYQGmtKxY9cu8sk9KeUVZ3z6shjEqHdtwM5FFCKGGvwVALA==} peerDependencies: next-auth: ^4.21.1 dependencies: '@nuxt/kit': 3.7.4 defu: 6.1.2 - next-auth: 4.22.5(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + next-auth: 4.21.1(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) nitropack: 2.6.3 requrl: 3.0.2 ufo: 1.3.1 @@ -9040,8 +9040,8 @@ packages: engines: {node: '>= 0.4.0'} dev: false - /next-auth@4.22.5(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-zPVEpqDp4cx1y0HbonCSrz2sA4qw0grTMd/S0PezUKXvDzmVemtsJnfNK/xo5pO2sz5ilM541+EVCTp9QoRLbA==} + /next-auth@4.21.1(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-NYkU4jAPSVxWhCblE8dDFAnKM7kOoO/QEobQ0RoEVP9Wox99A3PKHwOAsWhSg8ahJG/iKIWk2Bo1xHvsS4R39Q==} peerDependencies: next: ^12.2.5 || ^13 nodemailer: ^6.6.5