mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-20 07:24:57 +02:00
Compare commits
4 Commits
node_js_ve
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc70bc1327 | ||
|
|
32bee2c7a7 | ||
|
|
5039e0fd17 | ||
|
|
980dd572ab |
@@ -35,7 +35,8 @@ function update_script() {
|
|||||||
msg_ok "Stopped Databasus"
|
msg_ok "Stopped Databasus"
|
||||||
|
|
||||||
msg_info "Backing up Configuration"
|
msg_info "Backing up Configuration"
|
||||||
cp /opt/databasus/.env /opt/databasus.env.bak
|
cp /.env /opt/databasus.env.bak
|
||||||
|
chmod 600 /opt/databasus.env.bak
|
||||||
msg_ok "Backed up Configuration"
|
msg_ok "Backed up Configuration"
|
||||||
|
|
||||||
msg_info "Ensuring Database Clients"
|
msg_info "Ensuring Database Clients"
|
||||||
@@ -84,11 +85,18 @@ function update_script() {
|
|||||||
msg_ok "Updated Databasus"
|
msg_ok "Updated Databasus"
|
||||||
|
|
||||||
msg_info "Restoring Configuration"
|
msg_info "Restoring Configuration"
|
||||||
cp /opt/databasus.env.bak /opt/databasus/.env
|
cp /opt/databasus.env.bak /.env
|
||||||
rm -f /opt/databasus.env.bak
|
rm -f /opt/databasus.env.bak
|
||||||
chown postgres:postgres /opt/databasus/.env
|
chmod 600 /.env
|
||||||
msg_ok "Restored Configuration"
|
msg_ok "Restored Configuration"
|
||||||
|
|
||||||
|
if ! grep -q "EnvironmentFile=/.env" /etc/systemd/system/databasus.service; then
|
||||||
|
msg_info "Updating Service"
|
||||||
|
sed -i 's|EnvironmentFile=.*|EnvironmentFile=/.env|' /etc/systemd/system/databasus.service
|
||||||
|
$STD systemctl daemon-reload
|
||||||
|
msg_ok "Updated Service"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Starting Databasus"
|
msg_info "Starting Databasus"
|
||||||
$STD systemctl start databasus
|
$STD systemctl start databasus
|
||||||
msg_ok "Started Databasus"
|
msg_ok "Started Databasus"
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ ENCRYPTION_KEY=$(openssl rand -hex 32)
|
|||||||
# Install goose for migrations
|
# Install goose for migrations
|
||||||
$STD go install github.com/pressly/goose/v3/cmd/goose@latest
|
$STD go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||||
ln -sf /root/go/bin/goose /usr/local/bin/goose
|
ln -sf /root/go/bin/goose /usr/local/bin/goose
|
||||||
cat <<EOF >/opt/databasus/.env
|
cat <<EOF >/.env
|
||||||
# Environment
|
# Environment
|
||||||
ENV_MODE=production
|
ENV_MODE=production
|
||||||
|
|
||||||
@@ -109,8 +109,7 @@ DATA_DIR=/databasus-data/data
|
|||||||
BACKUP_DIR=/databasus-data/backups
|
BACKUP_DIR=/databasus-data/backups
|
||||||
LOG_DIR=/databasus-data/logs
|
LOG_DIR=/databasus-data/logs
|
||||||
EOF
|
EOF
|
||||||
chown postgres:postgres /opt/databasus/.env
|
chmod 600 /.env
|
||||||
chmod 600 /opt/databasus/.env
|
|
||||||
msg_ok "Configured Databasus"
|
msg_ok "Configured Databasus"
|
||||||
|
|
||||||
msg_info "Configuring Valkey"
|
msg_info "Configuring Valkey"
|
||||||
@@ -148,7 +147,7 @@ Requires=postgresql.service valkey.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/opt/databasus
|
WorkingDirectory=/opt/databasus
|
||||||
EnvironmentFile=/opt/databasus/.env
|
EnvironmentFile=/.env
|
||||||
ExecStart=/opt/databasus/databasus
|
ExecStart=/opt/databasus/databasus
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
Reference in New Issue
Block a user