Skip to content

Instantly share code, notes, and snippets.

@ArrEssJay
Last active April 22, 2018 07:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ArrEssJay/d8cb0c87400a4aab59772138eca4d026 to your computer and use it in GitHub Desktop.
Save ArrEssJay/d8cb0c87400a4aab59772138eca4d026 to your computer and use it in GitHub Desktop.
ngrok / ngrok2 systemd script + config
# /lib/systemd/system/ngrok.service.d/env.conf
[Service]
#which tunnel, or all?
Environment="TUNNEL=--all"
#log format
Environment="LOG_FORMAT=logfmt"
#log level
Environment="LOG_LEVEL=info"
#log file
Environment="LOG=/var/log/ngrok.log"
#ngrok2 config file (for tunnels/certs etc.)
Environment="CONFIG=/home/ubuntu/.ngrok2/ngrok.yml"
# Ubuntu: /lib/systemd/system/ngrok.service
# Config (env.conf) placed in ngrok.service.d will be read automatically
# YMMV on other distributions
[Service]
PrivateTmp=true
Type=simple
StandardOutput=journal
StandardError=journal
ExecStart=/usr/local/bin/ngrok start ${TUNNEL} --log-format ${LOG_FORMAT} --log-level ${LOG_LEVEL} --log ${LOG} --config ${CONFIG}
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment