mirror of
https://github.com/denyskon/teabag
synced 2025-04-02 05:10:23 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1e300e0049 | |||
a4052850a1 | |||
9fdbbce5ea | |||
213ace7f97 |
24
README.md
24
README.md
@ -1,4 +1,4 @@
|
||||
# Teabag - Static CMS OAuth Provider for Gitea
|
||||
# teabag - [Static CMS](https://github.com/StaticJsCMS/static-cms)/[Decap](https://github.com/decaporg/decap-cms) OAuth provider for Gitea
|
||||
|
||||
This is a lightweight Go server for handling OAuth flows with Gitea.
|
||||
|
||||
@ -34,12 +34,14 @@ services:
|
||||
- TEABAG_GITEA_BASE_URL=https://gitea.company.com
|
||||
- TEABAG_GITEA_AUTH_URI=login/oauth/authorize
|
||||
- TEABAG_GITEA_TOKEN_URI=login/oauth/access_token
|
||||
- TEABAG_GITEA_USER_URI=api/v1/user
|
||||
- TEABAG_CALLBACK_URI=http://oauth.example.com:3000/callback
|
||||
- TEABAG_GITEA_USER_URI=login/oauth/userinfo
|
||||
- TEABAG_CALLBACK_URI=https://oauth.example.com/callback
|
||||
ports:
|
||||
- "3000:3000"
|
||||
```
|
||||
|
||||
**It is stronly recommended not to transfer credentials over http. Please use a reverse proxy infront of teabag.**
|
||||
|
||||
## Config
|
||||
|
||||
The service needs some minimal configuration set before it can run.
|
||||
@ -61,19 +63,19 @@ PORT=3000 # The port to serve on
|
||||
SESSION_SECRET=super-secret # Used with OAuth provider sessions
|
||||
```
|
||||
|
||||
For the Gitea connector, there are some required settings:
|
||||
There are some required settings to connect to Gitea:
|
||||
|
||||
```bash
|
||||
# OAuth Key and Secret generated on Gitea
|
||||
# OAuth key and Ssecret generated on Gitea
|
||||
GITEA_KEY=<KEY>
|
||||
GITEA_SECRET=<SECRET>
|
||||
# URL of the Gitea instance
|
||||
GITEA_BASE_URL=https://gitea.company.com
|
||||
# endpoint URIs (for Gitea, see https://docs.gitea.io/en-us/oauth2-provider/)
|
||||
# URL of Gitea instance
|
||||
GITEA_BASE_URL=https://gitea.example.com
|
||||
# endpoint URIs (see https://docs.gitea.com/development/oauth2-provider/)
|
||||
GITEA_AUTH_URI=login/oauth/authorize
|
||||
GITEA_TOKEN_URI=login/oauth/access_token
|
||||
GITEA_USER_URI=api/v1/user
|
||||
# Callback URL for the SCM, where it will redirect the user after they authorise. This needs to match what was given when creating the OAuth application.
|
||||
GITEA_USER_URI=login/oauth/userinfo
|
||||
# callback URL, where users will be redirected after they authorise. Must contain the public URL of your teabag instance. This needs to match what was given when creating the OAuth application in Gitea.
|
||||
CALLBACK_URI=http://localhost:3000/callback
|
||||
```
|
||||
|
||||
@ -82,5 +84,3 @@ You can also provide the config using environment variables. For that you need t
|
||||
### Credits
|
||||
|
||||
Fork of https://github.com/donskifarrell/scm-oauth-provider
|
||||
|
||||
Inspiration taken from https://github.com/igk1972/netlify-cms-oauth-provider-go
|
@ -11,7 +11,7 @@ services:
|
||||
- TEABAG_GITEA_BASE_URL=https://gitea.company.com
|
||||
- TEABAG_GITEA_AUTH_URI=login/oauth/authorize
|
||||
- TEABAG_GITEA_TOKEN_URI=login/oauth/access_token
|
||||
- TEABAG_GITEA_USER_URI=api/v1/user
|
||||
- TEABAG_CALLBACK_URI=http://oauth.example.com:3000/callback
|
||||
- TEABAG_GITEA_USER_URI=login/oauth/userinfo
|
||||
- TEABAG_CALLBACK_URI=https://oauth.example.com/callback
|
||||
ports:
|
||||
- "3000:3000"
|
2
env/teabag.env.example
vendored
2
env/teabag.env.example
vendored
@ -4,7 +4,7 @@ SESSION_SECRET=super-secret
|
||||
|
||||
GITEA_KEY=
|
||||
GITEA_SECRET=
|
||||
GITEA_BASE_URL=https://gitea.yourcompany.com
|
||||
GITEA_BASE_URL=https://gitea.example.com
|
||||
GITEA_AUTH_URI=
|
||||
GITEA_TOKEN_URI=
|
||||
GITEA_USER_URI=
|
||||
|
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ require (
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/gorilla/sessions v1.2.1
|
||||
github.com/markbates/goth v1.77.0
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
github.com/sirupsen/logrus v1.9.2
|
||||
github.com/spf13/viper v1.15.0
|
||||
)
|
||||
|
||||
|
4
go.sum
4
go.sum
@ -177,8 +177,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
|
||||
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
||||
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||
|
Reference in New Issue
Block a user