4 Commits

Author SHA1 Message Date
1e300e0049 Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2 (#4)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.2)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-17 20:08:50 +02:00
a4052850a1 docs simplifications 2023-05-07 11:26:20 +02:00
9fdbbce5ea Update README.md 2023-05-07 11:15:47 +02:00
213ace7f97 Update README.md to mention Decap 2023-05-07 10:57:13 +02:00
5 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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"

View File

@ -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
View File

@ -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
View File

@ -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=