Skip to content

Commit

Permalink
fix: update ssl cert path
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhermeasper committed Apr 28, 2024
1 parent beb2e75 commit d099f9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash

MARQUINHOS_PATH="/etc/marquinhos"
source "$MARQUINHOS_PATH/marquinhos-api.conf"
source "/etc/marquinhos/marquinhos-api.conf"

DESTINATION_DIR="$1"

cp "$MARQUINHOS_PATH/server.crt" "$DESTINATION_DIR"
cp "$MARQUINHOS_PATH/server.key" "$DESTINATION_DIR"
cp "/etc/ssl/certificate.crt" "$DESTINATION_DIR"
cp "/etc/ssl/private.key" "$DESTINATION_DIR"

chmod 744 "$DESTINATION_DIR/server.key"
chmod 744 "$DESTINATION_DIR/server.crt"
chmod 744 "$DESTINATION_DIR/certificate.crt"
chmod 744 "$DESTINATION_DIR/private.key"

service=$(cat << EOF
[Unit]
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ mongoConnection().then(() => {
if (process.env.NODE_ENV === 'production') {
const httpsServer = https.createServer(
{
key: fs.readFileSync('server.key').toString(),
cert: fs.readFileSync('server.crt').toString(),
key: fs.readFileSync('private.key').toString(),
cert: fs.readFileSync('certificate.crt').toString(),
},
app,
);
Expand Down

0 comments on commit d099f9f

Please sign in to comment.