Skip to content

Commit

Permalink
fix: add option to provide gitea user
Browse files Browse the repository at this point in the history
Signed-off-by: Janos Miko <[email protected]>
  • Loading branch information
janosmiko committed Feb 25, 2023
1 parent 6fcd37f commit 49e5c92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Available Environment Variables (find example values in [config.yaml.sample](con
|---------------------------------------|---------------------------------------------------------------|--------------------|
| `DEBUG` | Enable debug mode | `false` |
| `GITEA_BASE_URL` | Gitea baseURL in `https://[email protected]` format. | `""` |
| `GITEA_USER` | Gitea admin username | `""` |
| `GITEA_TOKEN` | Gitea admin user token | `""` |
| `LDAP_URL` | LDAP connection URL | `""` |
| `LDAP_PORT` | LDAP connection port | `389` |
Expand Down
2 changes: 2 additions & 0 deletions deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
value: "true"
- name: GITEA_BASE_URL
value: https://[email protected]
- name: GITEA_USER
value: ""
- name: GITEA_TOKEN
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewGiteaClient() (*GiteaClient, error) {
return nil, err
}

user := urlpkg.UserPassword("", viper.GetString("GITEA_TOKEN"))
user := urlpkg.UserPassword(viper.GetString("GITEA_USER"), viper.GetString("GITEA_TOKEN"))
u.User = user

gtc, err = gitea.NewClient(u.String())
Expand Down

0 comments on commit 49e5c92

Please sign in to comment.