morbidick.ansible-role-oauth2-proxy

OAuth2-proxy Ansible角色

构建状态

这是一个用于安装和配置 oauth2 proxy 的Ansible角色。

变量

oauth2_proxy_version                     : "v7.1.3"
oauth2_user                              : "oauth2"
oauth2_dir                               : "/opt/oauth2_proxy"
oauth2_tmp_dir                           : "/opt/oauth2_proxy/tmp"
oauth2_log_dir                           : "/var/log/oauth2-proxy/"
oauth2_config_path                       : "/etc/oauth2_proxy/oauth2_config.cfg"
oauth2_init_system                       : "systemd" # 可以是 `systemd`、`sysv` 或 `no` (无设置)

# 所有选项请参见 https://raw.githubusercontent.com/pusher/oauth2_proxy/master/contrib/oauth2_proxy.cfg.example
oauth2_proxy_config                      :
    http_address                         : "127.0.0.1:5000"
    upstreams                            : [ "127.0.0.1:6060" ]
    provider                             : "github"
    email_domains                        : "*"
    cookie_secure                        : false
    cookie_domain                        : "localhost:5000"
    cookie_secret                        : "{{ 'COOK_SECRET' | b64encode }}"
    client_id                            : "你的_CLIENT_ID"
    client_secret                        : "CLIENT_SECRET"

oauth2_config_cmdline_args               : "-github-org='MYCoolOrg'"

开发

你可以使用 Vagrantfile 进行本地测试,只需安装Vagrant和VirtualBox,然后执行以下命令。

vagrant up
vagrant provision

要测试针对Github的oauth2流程,可以在你的 个人资料 中创建一个新的OAuth应用,主页设置为 http://127.0.0.1:5000,回调网址设置为 http://127.0.0.1:5000/oauth2/callback。在 tests/role.yml 中用提供的github令牌替换 client_idclient_secret。然后在浏览器中打开 127.0.0.1:5000

许可

MIT

关于项目

An ansible role to install oauth2 proxy

安装
ansible-galaxy install morbidick.ansible-role-oauth2-proxy
许可证
mit
下载
2k
拥有者
mostly web dev, freelancer with @madways