Open toni-moreno opened 4 years ago
Would my pr #7287 be sufficient for this?
@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.
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.
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://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.
is there any update on this issue?
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. )
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
I think this has been resolved.
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?
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 exampleThis 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.
Not yet.
Thank you for your fast response. In this case, I suggest to re-open this issue.
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)
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.