Skip to content

Commit 8c7f2fb

Browse files
committed
Fix: misnamed environment variable and improve the enable-ssl command in Makefile
1 parent 9c0bf82 commit 8c7f2fb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ gen-certs:
218218
-e STATE=${NGINX_SSL_STATE} \
219219
-e LOCALITY=${NGINX_SSL_LOCALITY} \
220220
-e ORGANIZATION=${NGINX_SSL_ORGANIZATION} \
221-
-e ORGANIZATIONAL_UNIT=${SSL_UNIT} \
221+
-e ORGANIZATIONAL_UNIT=${NGINX_SSL_UNIT} \
222222
-e EMAIL=${NGINX_SSL_EMAIL} \
223223
-e CERT_EXPIRY=${NGINX_SSL_DAYS} \
224224
-e KEY_SIZE=${NGINX_SSL_KEY_SIZE} \
@@ -228,9 +228,10 @@ gen-certs:
228228

229229
enable-ssl:
230230
@echo "${BLUE}Enabling SSL in Nginx configuration...${NC}"
231-
@sed -i 's/# server {/server {/' etc/nginx/default.conf
232-
@sed -i 's/# \(.*ssl.*\)/\1/' etc/nginx/default.conf
233-
@sed -i 's/# \(.*443.*\)/\1/' etc/nginx/default.conf
231+
@docker run --rm \
232+
-v $(PWD)/etc/nginx:/etc/nginx \
233+
alpine:latest \
234+
sh -c 'apk add --no-cache sed && sed -i "/^# server {/,/^# }/ s/^# //" /etc/nginx/default.template.conf && sed -i "/^#[[:space:]]*$$/s/^#//" /etc/nginx/default.template.conf'
234235
@$(MAKE) restart
235236
@echo "${GREEN}SSL has been enabled. Access your site at https://${NGINX_HOST}:3000${NC}"
236237

0 commit comments

Comments
 (0)