This commit is contained in:
parent
3edc477069
commit
e6bef22494
|
@ -62,6 +62,16 @@ NPM_VERSION=$(npm --version)
|
||||||
echo "✅ Node.js $NODE_VERSION installed"
|
echo "✅ Node.js $NODE_VERSION installed"
|
||||||
echo "✅ npm $NPM_VERSION installed"
|
echo "✅ npm $NPM_VERSION installed"
|
||||||
|
|
||||||
|
# Create system-wide symlinks for Node.js and npm
|
||||||
|
echo "🔗 Creating system-wide Node.js symlinks..."
|
||||||
|
NODE_PATH=$(which node)
|
||||||
|
NPM_PATH=$(which npm)
|
||||||
|
|
||||||
|
sudo ln -sf "$NODE_PATH" /usr/local/bin/node
|
||||||
|
sudo ln -sf "$NPM_PATH" /usr/local/bin/npm
|
||||||
|
|
||||||
|
echo "✅ Node.js symlinks created"
|
||||||
|
|
||||||
# Install npm dependencies
|
# Install npm dependencies
|
||||||
echo "📦 Installing npm dependencies..."
|
echo "📦 Installing npm dependencies..."
|
||||||
if ! npm install; then
|
if ! npm install; then
|
||||||
|
@ -197,10 +207,8 @@ if [ -z "$PRIVATE_KEY" ]; then
|
||||||
echo "🔑 Initializing daemon to generate keypair..."
|
echo "🔑 Initializing daemon to generate keypair..."
|
||||||
# Create a simple init script that generates keypair
|
# Create a simple init script that generates keypair
|
||||||
sudo -u "$DAEMON_USER" bash -c "
|
sudo -u "$DAEMON_USER" bash -c "
|
||||||
export NVM_DIR=\"$HOME/.nvm\"
|
|
||||||
[ -s \"\$NVM_DIR/nvm.sh\" ] && \. \"\$NVM_DIR/nvm.sh\"
|
|
||||||
cd \"$INSTALL_DIR\"
|
cd \"$INSTALL_DIR\"
|
||||||
node -e \"
|
/usr/local/bin/node -e \"
|
||||||
const { generateSecretKey, getPublicKey } = require('nostr-tools/pure');
|
const { generateSecretKey, getPublicKey } = require('nostr-tools/pure');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
|
const config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
|
||||||
|
|
|
@ -6,10 +6,11 @@ Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=superball
|
User=superball-thrower
|
||||||
Group=superball
|
Group=superball-thrower
|
||||||
WorkingDirectory=/path/to/thrower_daemon
|
WorkingDirectory=/opt/superball-thrower
|
||||||
ExecStart=/usr/bin/node daemon.js /etc/superball/config.json
|
ExecStart=/usr/local/bin/node daemon.js
|
||||||
|
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
|
@ -21,7 +22,7 @@ NoNewPrivileges=true
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
ReadWritePaths=/var/log/superball
|
ReadWritePaths=/var/log/superball-thrower /opt/superball-thrower
|
||||||
ProtectKernelTunables=true
|
ProtectKernelTunables=true
|
||||||
ProtectKernelModules=true
|
ProtectKernelModules=true
|
||||||
ProtectControlGroups=true
|
ProtectControlGroups=true
|
||||||
|
|
Loading…
Reference in New Issue