mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Add installer build scripts and configuration
This commit is contained in:
parent
fb3a8582a2
commit
3420290ea9
22 changed files with 1377 additions and 7 deletions
40
installer/scripts/templates/postinstall.sh
Normal file
40
installer/scripts/templates/postinstall.sh
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
INSTALL_DIR="/Library/Application Support/AikidoSafety"
|
||||
LAUNCHD_PLIST="/Library/LaunchDaemons/dev.aikido.safe-chain.plist"
|
||||
LOG_DIR="/var/log/aikido-safe-chain"
|
||||
|
||||
echo "Installing Aikido Safe Chain Agent..."
|
||||
|
||||
# Create log directory
|
||||
mkdir -p "$LOG_DIR"
|
||||
chmod 755 "$LOG_DIR"
|
||||
|
||||
# Install certificate to system keychain
|
||||
echo "Installing CA certificate to system keychain..."
|
||||
security add-trusted-cert -d -r trustRoot \
|
||||
-k /Library/Keychains/System.keychain \
|
||||
"$INSTALL_DIR/certs/ca-cert.pem" || true
|
||||
|
||||
# Configure system proxy
|
||||
echo "Configuring system proxy settings..."
|
||||
"$INSTALL_DIR/bin/node" "$INSTALL_DIR/agent/configure-proxy.js" --install || {
|
||||
echo "Warning: Failed to configure system proxy. You may need to configure manually."
|
||||
}
|
||||
|
||||
# Load and start the LaunchDaemon
|
||||
echo "Starting Aikido Safe Chain Agent..."
|
||||
launchctl load -w "$LAUNCHD_PLIST" || {
|
||||
echo "Warning: Failed to start agent. You may need to restart your computer."
|
||||
}
|
||||
|
||||
echo "Aikido Safe Chain Agent installed successfully!"
|
||||
echo ""
|
||||
echo "The agent is now running in the background and will protect"
|
||||
echo "all package installations on this system."
|
||||
echo ""
|
||||
echo "To uninstall, run:"
|
||||
echo " sudo bash '$INSTALL_DIR/uninstall.sh'"
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue