mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-15 01:28:50 +00:00
refactor: update installation script to use user home directory
- Changed the installation directory from `/opt/debros` to the user's home directory for improved flexibility. - Updated systemd service configurations to reflect the new installation path for both node and gateway services. - Ensured that read/write paths are aligned with the new installation directory.
This commit is contained in:
parent
2cbc3034e8
commit
6ec4f7f903
@ -16,7 +16,7 @@ YELLOW='\033[1;33m'
|
|||||||
NOCOLOR='\033[0m'
|
NOCOLOR='\033[0m'
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
INSTALL_DIR="/opt/debros"
|
INSTALL_DIR="$HOME"
|
||||||
REPO_URL="https://github.com/DeBrosOfficial/network.git"
|
REPO_URL="https://github.com/DeBrosOfficial/network.git"
|
||||||
MIN_GO_VERSION="1.21"
|
MIN_GO_VERSION="1.21"
|
||||||
NODE_PORT="4001"
|
NODE_PORT="4001"
|
||||||
@ -412,8 +412,8 @@ Wants=network-online.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=debros
|
User=debros
|
||||||
Group=debros
|
Group=debros
|
||||||
WorkingDirectory=/opt/debros/src
|
WorkingDirectory=$INSTALL_DIR/src
|
||||||
ExecStart=/opt/debros/bin/node --config bootstrap.yaml
|
ExecStart=$INSTALL_DIR/bin/node --config bootstrap.yaml
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
@ -424,7 +424,7 @@ NoNewPrivileges=yes
|
|||||||
PrivateTmp=yes
|
PrivateTmp=yes
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
ProtectHome=yes
|
ProtectHome=yes
|
||||||
ReadWritePaths=/opt/debros
|
ReadWritePaths=$INSTALL_DIR
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@ -441,7 +441,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Creating debros-gateway.service..."
|
log "Creating debros-gateway.service..."
|
||||||
cat > /tmp/debros-gateway.service << 'EOF'
|
cat > /tmp/debros-gateway.service << EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=DeBros Gateway (HTTP/WebSocket)
|
Description=DeBros Gateway (HTTP/WebSocket)
|
||||||
After=debros-node.service
|
After=debros-node.service
|
||||||
@ -451,8 +451,8 @@ Wants=debros-node.service
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=debros
|
User=debros
|
||||||
Group=debros
|
Group=debros
|
||||||
WorkingDirectory=/opt/debros/src
|
WorkingDirectory=$INSTALL_DIR/src
|
||||||
ExecStart=/opt/debros/bin/gateway
|
ExecStart=$INSTALL_DIR/bin/gateway
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
@ -463,7 +463,7 @@ NoNewPrivileges=yes
|
|||||||
PrivateTmp=yes
|
PrivateTmp=yes
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
ProtectHome=yes
|
ProtectHome=yes
|
||||||
ReadWritePaths=/opt/debros
|
ReadWritePaths=$INSTALL_DIR
|
||||||
|
|
||||||
# Allow binding to privileged ports (80, 443) for ACME TLS
|
# Allow binding to privileged ports (80, 443) for ACME TLS
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user