百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

gate

> 编程语言
开源

gate 是一个静态文件服务器和反向代理,集成了 OAuth2 帐户认证。使用 gate,您可以将私有资源的访问权限授予特定用户或组。

184 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

gate 是一个静态文件服务器和反向代理,集成了 OAuth2 帐户认证。使用 gate,您可以将私有资源的访问权限授予特定用户或组。

"gate" for your private resources

gate is a static file server and reverse proxy integrated with OAuth2 account authentication.

With gate, you can safely serve your private resources based on whether or not request user is a member of your company's Google Apps or GitHub organizations.

Usage

  1. Download binary or go get
  2. rename config_sample.yml to config.yml
  3. edit config.yml to fit your environment
  4. run gate

Example config

…

Authentication Strategy

gate now supports Google Apps and GitHub to authenticate users.

Example config for Google

yaml
auth:
  info:
    service: google
    client_id: your client id
    client_secret: your client secret
    redirect_url: https://yourapp.example.com/oauth2callback

# restrict user request. (optional)
restrictions:
  - yourdomain.com    # domain of your Google App
  - [email protected] # specific email address

Example config for GitHub

Unlike the example of Google Apps above, if the service is GitHub, gate uses whether request user is a member of organization designated like below:

yaml
auth:
  info:
    service: github
    client_id: your client id
    client_secret: your client secret
    redirect_url: https://yourapp.example.com/oauth2callback

# restrict user request. (optional)
restrictions:
  - foo_organization
  - bar_organization

github:e support

GitHub Enterprise is also supported. To authenticate via github enterprise, add api endpoint information to config like following:

yaml
auth:
  info:
    service: github
    client_id: your client id
    client_secret: your client secret
    redirect_url: https://yourapp.example.com/oauth2callback
    endpoint: https://github.yourcompany.com
    api_endpoint: https://github.yourcompany.com/api

Name Based Virtual Host

An example of "Name Based Viatual Host" setting.

yaml
auth:
  session:
    # authentication key for cookie store
    key: secret123
    # domain of virtual hosts base host
    cookie_domain: gate.example.com

# proxy definitions
proxy:
  - path: /
    host: elasticsearch.gate.example.com
    dest: http://127.0.0.1:9200

  - path: /
    host: influxdb.gate.example.com
    dest: http://127.0.0.1:8086

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言