Skip to content

fix(gitea): add write:repository scope to Gitea OAuth#124

Open
AminDhouib wants to merge 1 commit into
canaryfrom
port/upr-4413
Open

fix(gitea): add write:repository scope to Gitea OAuth#124
AminDhouib wants to merge 1 commit into
canaryfrom
port/upr-4413

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Ports Dokploy#4413 by @lamualfa.

Gitea's repo OAuth scope maps to read:repository only, so creating webhooks (POST /api/v1/repos/{owner}/{repo}/hooks) fails with the current scopes. This adds write:repository to the Gitea OAuth scope in all three locations:

  • apps/dokploy/pages/api/providers/gitea/authorize.ts — server-side OAuth authorize URL
  • apps/dokploy/utils/gitea-utils.ts — client-side OAuth URL builder
  • packages/server/src/db/schema/gitea.tsgitea.scopes column default

Scope of this port: only the OAuth scope fix. Upstream's PR also introduces an auto-webhook-creation feature (createGiteaWebhook plus wiring in the application/compose routers); that larger change is intentionally not included here. No DB migration is included — the .default() change requires none (upstream ships no migration either, and the column is not read when building the OAuth request).

Gitea's `repo` scope maps to read:repository only, so creating webhooks via POST /api/v1/repos/{owner}/{repo}/hooks fails without write:repository. Add write:repository to all three Gitea OAuth scope locations: the authorize endpoint, the client-side OAuth URL builder, and the gitea table default scopes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants