Skip to content

Commit

Permalink
Move ufw to tna-run
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Nov 7, 2024
1 parent 4e4f82d commit 23b95f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docker/tna-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,10 @@ RUN set -eux; \
rm -rfv /var/lib/apt/lists/*

# ==========================================
# Update the firewall rule to allow only for
# HTTPS, then create an SSL certificate that
# we can use locally in nginx to secure this
# container
# Generate an SSL cert we can use locally in
# nginx to secure this container
# ==========================================
RUN ufw allow 'Nginx HTTPS'; \
mkdir /etc/nginx/ssl; \
RUN mkdir /etc/nginx/ssl; \
openssl req -x509 -noenc -newkey rsa:2048 -keyout /etc/nginx/ssl/key.pem -out /etc/nginx/ssl/req.pem -days 90 -subj "/C=GB/ST=London/L=Kew/O=The National Archives/OU=Digital/CN=localhost"

# ==========================================
Expand Down
3 changes: 3 additions & 0 deletions docker/tna-python/bin/tna-run
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ then
exit 1
fi

# Change the firewall rules to only allow HTTPS traffic
ufw allow 'Nginx HTTPS'

# Convert $ENVIRONMENT to lowercase
ENVIRONMENT=$(echo "$ENVIRONMENT" | tr '[:upper:]' '[:lower:]')

Expand Down

0 comments on commit 23b95f8

Please sign in to comment.