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