Skip to content

feat: add oauth support for self-hosted Gitea - #1101

Merged
qwqcode merged 4 commits into
ArtalkJS:masterfrom
MWTJC:MWTJC-patch-gitea-selfhosted
Oct 28, 2026
Merged

qwqcode merged 4 commits into
ArtalkJS:masterfrom
MWTJC:MWTJC-patch-gitea-selfhosted

Conversation

@MWTJC

@MWTJC MWTJC commented Aug 2, 2025 •

Copy link
Copy Markdown
Contributor

Add auth.gitea.site_url for self-hosted Gitea. Leave it empty to keep using gitea.com. The URL supports HTTP, HTTPS, ports, and subpaths. The login callback path stays unchanged.

Accounts from different Gitea servers stay separate, even when user IDs, names, or emails match. Existing gitea.com accounts keep their current bindings. No new dependencies or database fields are needed.

The change includes configuration templates, environment variables, dashboard support, documentation, and tests. Full Go tests and static analysis passed. Tests also passed with race detection for authentication, configuration, and request handlers. Login tests use a local server that simulates Gitea. We did not test a live Gitea instance.

@Heerozh

Heerozh commented Oct 1, 2025 •

Copy link
Copy Markdown

很需要此功能,➕1

另不是domain,而是直接设置url是否可以?内网gitea可能在http下,而且这样也能支持sub-path如http://localhost:8080/subpath/...

@MWTJC

MWTJC commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

很需要此功能,➕1

另不是domain,而是直接设置url是否可以?内网gitea可能在http下,而且这样也能支持sub-path如http://localhost:8080/subpath/...

你说得对

@qwqcode
qwqcode force-pushed the MWTJC-patch-gitea-selfhosted branch from 7fd1625 to 4928deb Compare October 28, 2026 15:35
@pull-request-size pull-request-size Bot added size/L and removed size/S labels Oct 28, 2026
@qwqcode
qwqcode force-pushed the MWTJC-patch-gitea-selfhosted branch from 4928deb to 2032ccc Compare October 28, 2026 15:46
@qwqcode

qwqcode commented Oct 28, 2026

Copy link
Copy Markdown
Member

Thanks for contributing support for self-hosted Gitea. I updated the PR to reuse auth.gitea with one optional field, site_url. Leaving it empty keeps gitea.com as the default. Custom ports and paths are supported.

I also separated accounts across Gitea servers to prevent matching user IDs, names, or emails from linking unrelated accounts. Existing gitea.com accounts keep working. Configuration, documentation, and tests are included.

I plan to merge. Thanks

@qwqcode
qwqcode merged commit 070bbce into ArtalkJS:master Oct 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants