Last active
February 10, 2019 10:15
-
-
Save matthewcosgrove/d92e088ed3608cefe4509816f51663c7 to your computer and use it in GitHub Desktop.
Excerpt taken from https://github.com/matthewcosgrove/subsonic-deployment/blob/master/operators/pre-start-script.yml. Also see https://stackoverflow.com/a/25903579/752167 and https://unix.stackexchange.com/a/405254/308152
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 'EOF' vs EOF with escaping --> https://stackoverflow.com/a/25903579/752167 and https://unix.stackexchange.com/a/405254/308152 | |
| cat <<EOF >/etc/nginx/conf.d/subsonic-proxy.conf | |
| server { | |
| listen 80; | |
| server_name $SUBSONIC_SERVER_DOMAIN; | |
| location / { | |
| proxy_pass http://127.0.0.1:4040; | |
| proxy_set_header Host \$http_host; | |
| proxy_set_header X-Real-IP \$remote_addr; | |
| proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto \$scheme; | |
| } | |
| } | |
| EOF | |
| cat <<EOF >/etc/systemd/system/dropbox-keep-alive.service | |
| [Unit] | |
| Description=Dropbox Keep Alive Service | |
| After=network.target | |
| [Service] | |
| ExecStart=/bin/sh -c '/usr/local/bin/dropbox.py start' | |
| ExecStop=/bin/sh -c '/usr/local/bin/dropbox.py stop' | |
| PIDFile=${UBUNTU_USER_HOME_DIR}/.dropbox/dropbox.pid | |
| User=jumpbox | |
| Group=jumpbox | |
| Type=forking | |
| Restart=on-failure | |
| RestartSec=5 | |
| StartLimitInterval=60s | |
| StartLimitBurst=3 | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment