Skip to content

Instantly share code, notes, and snippets.

@twinkfrag
Created September 10, 2018 10:26
Show Gist options
  • Save twinkfrag/0dbe3629712aadfc2f25595478983317 to your computer and use it in GitHub Desktop.
Save twinkfrag/0dbe3629712aadfc2f25595478983317 to your computer and use it in GitHub Desktop.
OAuth2_proxy service with socket
## OAuth2 Proxy Config File
## https://github.com/bitly/oauth2_proxy
## /etc/oauth2_proxy.cfg
http_address = "unix:///run/socket/oauth2_proxy.socket"
upstreams = [ "file:///dev/null" ]
email_domains = [ "*" ]
# Systemd service file for oauth2_proxy daemon
# /etc/systemd/system/oauth2_proxy.service
#
# Date: Feb 9, 2016
# Author: Srdjan Grubor <[email protected]>
[Unit]
Description=oauth2_proxy daemon service
After=syslog.target network.target
[Service]
# www-data group and user need to be created before using these lines
User=www-data
Group=www-data
ExecStartPre=/bin/mkdir -p /run/socket; /bin/rm -f /run/socket/oauth2_proxy.socket
ExecStart=/usr/local/bin/oauth2_proxy -config=/etc/oauth2_proxy.cfg
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
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