fix: root-only server, no deploy user

This commit is contained in:
Kirill
2026-05-14 20:40:34 +05:00
parent 434859b606
commit a577cec9a9
2 changed files with 4 additions and 8 deletions
+3 -7
View File
@@ -17,13 +17,10 @@ node --version # ожидается >= 22
npm --version
```
## 2. Пользователь и каталоги
## 2. Каталоги
```bash
useradd --create-home --shell /bin/bash deploy
mkdir -p /opt/craftshop/server/uploads /opt/craftshop/www
chown -R deploy:deploy /opt/craftshop
chmod 755 /opt/craftshop /opt/craftshop/server /opt/craftshop/www
```
## 3. systemd unit
@@ -36,8 +33,8 @@ After=network.target
[Service]
Type=simple
User=deploy
Group=deploy
User=root
Group=root
WorkingDirectory=/opt/craftshop/server
EnvironmentFile=-/opt/craftshop/server/.env
ExecStart=/usr/bin/node src/index.js
@@ -127,7 +124,6 @@ ADMIN_EMAIL=<твой email>
CORS_ORIGIN=https://<твой-домен>
IS_DEFAULT_CODE_ENABLED=false
ENV
chown deploy:deploy /opt/craftshop/server/.env
chmod 600 /opt/craftshop/server/.env
```