Skip to content

Commit 40fc556

Browse files
committed
Services restart script
1 parent 5c517bc commit 40fc556

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

deploy/nginx/nginx-frontend-standalone.conf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,23 @@
88
# # or merge this server block into /etc/nginx and use the stock unit instead.
99
# chgrp -R nginx /var/www/Node-Script/artifacts/game-client/dist/public
1010
# chmod -R g+rX /var/www/Node-Script/artifacts/game-client/dist/public
11-
# # SELinux: setsebool -P httpd_can_network_connect 1
11+
# # SELinux (proxy to Node): setsebool -P httpd_can_network_connect 1
1212
#
1313
# Edit paths below if the deploy root is not /var/www/Node-Script
14+
#
15+
# If root= is under /home/... and Nginx logs "Permission denied" (13) for index.html:
16+
# 1) Path + execute bits: the nginx worker (user "nginx") must be able to *traverse* every
17+
# directory from / down to dist/public. A home dir of mode 700 (e.g. /home/adept) blocks
18+
# everyone but the owner — chgrp on dist/public is not enough. Fix one of:
19+
# - Best: move the app to e.g. /var/www/... (see WorkingDirectory in game-api.service).
20+
# - Or: usermod -aG adept nginx and chmod 750 /home/adept
21+
# (or at least o+x on /home, /home/adept, and any parent that is not group-readable;
22+
# group membership + 750 is cleaner than 711 on home for everyone).
23+
# 2) SELinux: if getenforce is Enforcing, files may be home_t. Either:
24+
# - semanage fcontext -a -t httpd_sys_content_t '/home/adept/node_app/artifacts/game-client/dist/public(/.*)?'
25+
# restorecon -RFv .../public
26+
# - or, if policy allows: setsebool -P httpd_read_user_content 1
27+
# and/or: setsebool -P httpd_enable_homedirs 1
1428

1529
user nginx;
1630
worker_processes auto;

deploy/restart-workspace.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# Restart workspace services after a deploy. Intended to run as root.
3+
#
4+
# One-time on the server:
5+
# sudo install -m 755 -o root -g root deploy/restart-workspace.sh /usr/local/bin/restart-workspace.sh
6+
#
7+
# Sudoers for the CI/deploy user (use visudo), allow only this script, no password:
8+
# deploy ALL=(ALL) NOPASSWD: /usr/local/bin/restart-workspace.sh
9+
#
10+
# GitHub Actions secret DEPLOY_COMMAND:
11+
# sudo /usr/local/bin/restart-workspace.sh
12+
#
13+
# If you change systemd unit files under /etc/systemd/system/, run once on the server:
14+
# sudo systemctl daemon-reload
15+
16+
set -euo pipefail
17+
18+
systemctl restart game-api
19+
systemctl reload game-frontend

0 commit comments

Comments
 (0)