Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2: Changed chmod entrypoint.sh from 755 to 700 for improved se… #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ ENV CERTBOT_DOMAIN="" \
CLOUDFLARE_API_TOKEN="" \
RENEWAL_INTERVAL=43200

COPY --chmod=755 entrypoint.sh /entrypoint.sh
COPY --chmod=700 entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
9 changes: 8 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/sh

# Permissions must be created after volumes have been mounted; otherwise, windows file system permissions will override
# the permissions set within the container.
mkdir -p /etc/letsencrypt/accounts /var/log/letsencrypt /var/lib/letsencrypt
chmod 755 /etc/letsencrypt /var/lib/letsencrypt
chmod 700 /etc/letsencrypt/accounts /var/log/letsencrypt

cat << "EOF"
____________________
< Certbot, activate! >
Expand Down Expand Up @@ -39,7 +45,8 @@ run_certbot() {
--key-type "$CERTBOT_KEY_TYPE" \
--email "$CERTBOT_EMAIL" \
--agree-tos \
--non-interactive
--non-interactive \
--strict-permissions
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Error: certbot command failed with exit code $exit_code"
Expand Down