mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-06 11:36:44 +03:00
Address Copilot suggestions for LXC installer improvements
This commit is contained in:
@@ -75,7 +75,28 @@ If you prefer to set up manually or the automatic script doesn't work for your e
|
||||
5. Create a systemd service manually:
|
||||
```bash
|
||||
nano /etc/systemd/system/gitea-mirror.service
|
||||
# Add the service configuration as shown in the setup-lxc.sh script
|
||||
# Add the service configuration as shown below:
|
||||
|
||||
[Unit]
|
||||
Description=Gitea Mirror
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/gitea-mirror
|
||||
ExecStart=/root/.bun/bin/bun dist/server/entry.mjs
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=gitea-mirror
|
||||
Group=gitea-mirror
|
||||
Environment=NODE_ENV=production
|
||||
Environment=HOST=0.0.0.0
|
||||
Environment=PORT=4321
|
||||
Environment=DATABASE_URL=file:data/gitea-mirror.db
|
||||
Environment=JWT_SECRET=your-secure-secret-key
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable gitea-mirror.service
|
||||
|
||||
@@ -122,6 +122,11 @@ JWT_SECRET=${JWT_SECRET:-$(openssl rand -hex 32)}
|
||||
|
||||
# Create systemd service
|
||||
echo -e "${BLUE}Step 6/7: Creating systemd service...${NC}"
|
||||
|
||||
# Store Bun path in a variable for better maintainability
|
||||
BUN_PATH=$(command -v bun)
|
||||
echo -e "${GREEN}Using Bun from: $BUN_PATH${NC}"
|
||||
|
||||
cat >/etc/systemd/system/gitea-mirror.service <<SERVICE
|
||||
[Unit]
|
||||
Description=Gitea Mirror
|
||||
@@ -130,7 +135,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=$INSTALL_DIR
|
||||
ExecStart=$(command -v bun) dist/server/entry.mjs
|
||||
ExecStart=$BUN_PATH dist/server/entry.mjs
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=$SERVICE_USER
|
||||
|
||||
Reference in New Issue
Block a user