Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add creation OAuth APP from cli and with ENVIRONMENT VARS #8764

Open
toni-moreno opened this issue Oct 31, 2019 · 13 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@toni-moreno
Copy link

Description

We have to automate the Gitea + Drone Install , but , we can not automate the setup process because of gitea needs to setup OAuth APP from WebUI As described in (https://docs.drone.io/installation/providers/gitea/) )

On Docker environments the best way is with environment vars (not sure how to do it ) but really useful on this use case.

@zeripath
Copy link
Contributor

zeripath commented Nov 1, 2019

Would my pr #7287 be sufficient for this?

@techknowlogick
Copy link
Member

@zeripath I dont think so because that would just configure app.ini settings. This request is to setup an OAuth2 provider using env vars. I would prefer to add it via CLI, just like we did for other OAuth app/LDAP management.

@lunny
Copy link
Member

lunny commented Nov 2, 2019

OAuth2 Provider is enabled by default. I think he means create an OAuth2 application via commandline and return ClientID and ClientSecret with suitable console format.

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Nov 2, 2019
@lukasmrtvy
Copy link

Not sure if API/CLI commands are enough in this case. ( Unattended install of gitea and drone - integrated ), but its definetly must have feature of course for future generic usage.

Something like GITEA_OAUTH2_PROVIDER_ID, GITEA_OAUTH2_PROVIDER_SECRET and GITEA_OAUTH2_PROVIDER_REPLYURL vars ( for precreating oauth application ) should be enough to deploy both applications at the same time ( integration at deploy time ).
Of course GITEA_USERNAME and GITEA_PASSWORD vars would be also superb to implement.

Other options like docker exec -it gitea gitea admin oauth2 app create... or curl -X POST http:https://gitea/api/v1/user/application '{"id": ...}', that needs output parsing and use it as input for another container ( drone in this case ) are not best way how to do it.

@lukasmrtvy
Copy link

Proposal #9210

@danielchg
Copy link

is there any update on this issue?

@everflux
Copy link

Is this available through the CLI as well? (For unattended setup - it is important that the clientid/secret can be supplied/specified instead of randomly generated. )

@gramakri
Copy link
Contributor

Per https://docs.gitea.io/en-us/command-line/#admin , gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE is an example

@lunny
Copy link
Member

lunny commented Dec 20, 2022

I think this has been resolved.

@lunny lunny closed this as completed Dec 20, 2022
@maxkratz
Copy link

Per https://docs.gitea.io/en-us/command-line/#admin , gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE is an example

This command can be used to add a new authentication source, but OP wants to add an oauth2 application. Can this be done with the CLI?

@lunny
Copy link
Member

lunny commented Dec 31, 2022

Per https://docs.gitea.io/en-us/command-line/#admin , gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE is an example

This command can be used to add a new authentication source, but OP wants to add an oauth2 application. Can this be done with the CLI?

Not yet.

@maxkratz
Copy link

Not yet.

Thank you for your fast response. In this case, I suggest to re-open this issue.

@lunny lunny reopened this Dec 31, 2022
@everflux
Copy link

everflux commented Mar 7, 2024

It would be really great, if this could be addressed as manual setup takes a lot of time and is error prone when setting up multiple instances for trainings or demos. (So an ENV approach is preferred to CLI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

9 participants