Skip to content

Commit

Permalink
prueba
Browse files Browse the repository at this point in the history
  • Loading branch information
paulasuarezp committed Jun 29, 2024
1 parent 0af55bf commit d7764b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/TFG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ jobs:
PAYPAL_CLIENT_ID=${{ secrets.PAYPAL_CLIENT_ID }}
PAYPAL_CLIENT_SECRET=${{ secrets.PAYPAL_CLIENT_SECRET }}
PAYPAL_TOKEN=${{ secrets.PAYPAL_TOKEN }}
SSL_CERT=${{ secrets.SSL_CERT }}
SSL_PRIVKEY=${{ secrets.SSL_PRIVKEY }}
NODE_ENV=production
deploy:
Expand Down Expand Up @@ -100,13 +98,6 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
export MONGO_URI=${{ secrets.MONGO_URI }}
export TOKEN_SECRET=${{ secrets.TOKEN_SECRET }}
export PAYPAL_CLIENT_ID=${{ secrets.PAYPAL_CLIENT_ID }}
export PAYPAL_CLIENT_SECRET=${{ secrets.PAYPAL_CLIENT_SECRET }}
export PAYPAL_TOKEN=${{ secrets.PAYPAL_TOKEN }}
export SSL_CERT=${{ secrets.SSL_CERT }}
export SSL_PRIVKEY=${{ secrets.SSL_PRIVKEY }}
sudo docker-compose stop
sudo docker-compose rm -f
sudo docker-compose pull
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ services:
- PAYPAL_CLIENT_ID=${PAYPAL_CLIENT_ID}
- PAYPAL_CLIENT_SECRET=${PAYPAL_CLIENT_SECRET}
- PAYPAL_TOKEN=${PAYPAL_TOKEN}
- SSL_CERT=/src/certs/fullchain.pem
- SSL_PRIVKEY=/src/certs/privkey.pem
volumes:
- ./certs:/src/certs
webapp:
image: ghcr.io/paulasuarezp/webapp:latest
ports:
Expand Down
5 changes: 3 additions & 2 deletions restapi/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as dotenv from 'dotenv';
import fs from 'fs';
import http from 'http';
import https from 'https';
import mongoose from 'mongoose';
Expand All @@ -17,8 +18,8 @@ const mongoURI: string = process.env.NODE_ENV === 'test' ? process.env.TEST_MONG
let httpsOptions = {};
if (process.env.NODE_ENV === 'production') {
httpsOptions = {
key: process.env.SSL_PRIVKEY,
cert: process.env.SSL_CERT
key: process.env.SSL_PRIVKEY ? fs.readFileSync('./certs/privkey.pem') : null,
cert: process.env.SSL_CERT ? fs.readFileSync('./certs/fullchain.pem') : null,
};
}

Expand Down

0 comments on commit d7764b4

Please sign in to comment.