Gitea: [Feature Request] Add creation OAuth APP from cli and with ENVIRONMENT VARS

Created on 31 Oct 2019  路  6Comments  路  Source: go-gitea/gitea

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.

kinproposal

Most helpful comment

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.

All 6 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fastidious picture Fastidious  路  3Comments

thehowl picture thehowl  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

kifirkin picture kifirkin  路  3Comments