Initial commit

This commit is contained in:
2025-12-03 15:42:58 +00:00
commit e7128e8652
13 changed files with 162 additions and 0 deletions

25
bin/init-letsencrypt.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
DOMAIN="apidocs.nxs.solutions"
EMAIL="info@nxs.solutions"
STAGING=0 # Set to 1 for testing (to avoid rate limits)
# Ensure required directories exist
if [ ! -d "data/certbot/conf" ]; then
mkdir -p data/certbot/conf
fi
if [ ! -d "data/certbot/www" ]; then
mkdir -p data/certbot/www
fi
# Run Certbot to get initial certificate
docker compose run --rm certbot certonly --webroot \
--webroot-path=/var/www/certbot \
--email "$EMAIL" \
-d "$DOMAIN" -d "www.$DOMAIN" \
--rsa-key-size 4096 \
--agree-tos \
--noninteractive \
$([ "$STAGING" -eq 1 ] && echo "--staging")
# Reload Nginx to use the new certificate
docker compose exec nginx nginx -s reload