Skip to content

Commit

Permalink
logging to bolt service
Browse files Browse the repository at this point in the history
  • Loading branch information
raianand committed Feb 14, 2024
1 parent 23220d8 commit f8b0f51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/bolt_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Restart=always
Environment="BOLT_MODE=${mode}"
Environment="BOLT_ALLOW_HTTP=${allow_http}"
Environment="BOLT_DEFAULT_POLICY=${default_policy}"
StandardOutput=file:/home/mitmproxyuser/mitmproxy.log
StandardError=file:/home/mitmproxyuser/mitmproxy-error.log
[Install]
WantedBy=multi-user.target
Expand Down
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ async function run() {

fs.writeFileSync('bolt.service', await boltService(mode, allow_http, default_policy))

await exec('sudo touch /home/mitmproxyuser/mitmproxy.log')
await exec('sudo touch /home/mitmproxyuser/mitmproxy-error.log')
await exec('sudo chown mitmproxyuser:mitmproxyuser /home/mitmproxyuser/mitmproxy.log /home/mitmproxyuser/mitmproxy-error.log')
await exec('sudo cp bolt.service /etc/systemd/system/')
await exec('sudo chown root:root /etc/systemd/system/bolt.service')
await exec('sudo systemctl daemon-reload')
Expand Down

0 comments on commit f8b0f51

Please sign in to comment.