mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 09:48:10 -05:00
trying to get bootstrapping working
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# Load environment variables from prod.env.example
|
# Load environment variables from prod.env.example
|
||||||
if [ -f prod.env ]; then
|
if [ -f prod.env ]; then
|
||||||
source prod.env
|
source test.env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rest of the script...
|
# Rest of the script...
|
||||||
@@ -41,7 +41,7 @@ fi
|
|||||||
echo "### Creating dummy certificate for $domains ..."
|
echo "### Creating dummy certificate for $domains ..."
|
||||||
path="/etc/letsencrypt/live/$domains"
|
path="/etc/letsencrypt/live/$domains"
|
||||||
mkdir -p "$data_path/conf/live/$domains"
|
mkdir -p "$data_path/conf/live/$domains"
|
||||||
docker compose run --rm --entrypoint "\
|
docker compose -f docker-compose.yml -f test-compose.yml run --rm --entrypoint "\
|
||||||
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
|
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
|
||||||
-keyout '$path/privkey.pem' \
|
-keyout '$path/privkey.pem' \
|
||||||
-out '$path/fullchain.pem' \
|
-out '$path/fullchain.pem' \
|
||||||
@@ -50,11 +50,11 @@ echo
|
|||||||
|
|
||||||
|
|
||||||
echo "### Starting nginx ..."
|
echo "### Starting nginx ..."
|
||||||
docker compose up -d nginx
|
docker compose -f docker-compose.yml -f test-compose.yml up -d nginx
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "### Deleting dummy certificate for $domains ..."
|
echo "### Deleting dummy certificate for $domains ..."
|
||||||
docker compose run --rm --entrypoint "\
|
docker compose -f docker-compose.yml -f test-compose.yml run --rm --entrypoint "\
|
||||||
rm -Rf /etc/letsencrypt/live/$domains && \
|
rm -Rf /etc/letsencrypt/live/$domains && \
|
||||||
rm -Rf /etc/letsencrypt/archive/$domains && \
|
rm -Rf /etc/letsencrypt/archive/$domains && \
|
||||||
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
||||||
@@ -77,7 +77,7 @@ esac
|
|||||||
# Enable staging mode if needed
|
# Enable staging mode if needed
|
||||||
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
||||||
|
|
||||||
docker compose run --rm --entrypoint "\
|
docker compose -f docker-compose.yml -f test-compose.yml run --rm --entrypoint "\
|
||||||
certbot certonly --webroot -w /var/www/certbot \
|
certbot certonly --webroot -w /var/www/certbot \
|
||||||
$staging_arg \
|
$staging_arg \
|
||||||
$email_arg \
|
$email_arg \
|
||||||
@@ -88,4 +88,4 @@ docker compose run --rm --entrypoint "\
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
echo "### Reloading nginx ..."
|
echo "### Reloading nginx ..."
|
||||||
docker compose exec nginx nginx -s reload
|
docker compose -f docker-compose.yml -f test-compose.yml exec nginx nginx -s reload
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name account.${DOMAIN_NAME} api.${DOMAIN_NAME} admin.${DOMAIN_NAME} www.${DOMAIN_NAME} ${DOMAIN_NAME};
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/certbot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
@@ -49,25 +58,6 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
server_name socket.${DOMAIN_NAME};
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://backend:4005;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache_bypass $http_upgrade;
|
|
||||||
access_log off;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
@@ -84,16 +74,3 @@ server {
|
|||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
server_name media.${DOMAIN_NAME};
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://backend:3005/audio$request_uri;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
include /etc/nginx/proxy.conf;
|
|
||||||
access_log off;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user