Commit Graph
11 Commits
Author SHA1 Message Date
Lunny Xiaoandbircni 3258717d62 fix(api): show the name of a type in the reference, document the gmail app password (#541)
Two unrelated but small fixes, closes #258 and closes #32.

**The reference does not name its types (#258)**

Since the api reference is rendered from the openapi 3.0 document, a field of type `ReviewStateType` is rendered as the bare string enum the `$ref` points at: starlight-openapi dereferences everything and the schema has no `title`, so the name of the type is nowhere on the page. Searching the current reference for `ReviewStateType` returns nothing, which is what the issue reports (the plugin also has no route for `components/schemas`, so there is no page per type either).

`normalizeSchema()` now titles every named schema of an openapi 3.0 document with its own name, which the plugin renders next to the type of a field:

- before: `state` · `string` · Allowed values: APPROVED …
- after: `state` · `ReviewStateType` · `string` · Allowed values: APPROVED …

The go doc comments start with the name of the type, so the description would repeat it ("ChangeFilesOptions — ChangeFilesOptions options for creating …"); a leading `<name> ` is stripped from the description.

For the record, how the three generations of documents describe that type:

| Versions | Type name | Allowed values |
| --- | --- | --- |
| 1.22 – 1.25 (swagger, `ReviewStateType` definition without `enum`) | shown | missing |
| 1.26 – 1.27 (swagger, enum inlined upstream) | missing | shown |
| 1.27, next (openapi 3.0, with this change) | shown | shown |

The released swagger documents are frozen, so 1.22 – 1.26 keep what they have; from 1.27 on the reference answers the question the issue asks.

**Gmail needs an app password (#32)**

The configuration in the guide is still correct after Google turned off password-only access, because it already asks for an app password. What was missing is why there is no alternative: Gitea's mailer authenticates with `CRAM-MD5`, `PLAIN` or `LOGIN` and has no XOAUTH2, so "Sign in with Google" is not an option. Added that, together with the two things people run into — an app password needs 2-step verification and a Workspace administrator can disable app passwords for the domain — and the `587` + `smtp+starttls` variant.

Verified by building the api and the next docs: the type names show up on the operation pages, the descriptions are not duplicated, and 1.26 and older are unchanged. `pnpm check` passes.

<!-- cloudflare-preview --> Preview: https://pr-541.docs-gitea-com.pages.dev

---------

Co-authored-by: bircni <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/541
Reviewed-by: bircni <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2026-09-12 11:27:21 +00:00
kairosys-dev ffc8c044a3 Correct port 465 for SMTPS, not 587 for STARTTLS (#295)
The SMTPS protocol uses port 465, not 587. Port 587 is instead used for STARTTLS.
Helps getting administrators stuck in cryptic errors such as:

Failed to send a testing email to "[email protected]": could not initiate SMTP session: tls: first record does not look like a TLS handshake

Reviewed-on: https://gitea.com/gitea/docs/pulls/295
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: kairosys-dev <[email protected]>
Co-committed-by: kairosys-dev <[email protected]>
2025-11-11 19:35:01 +00:00
ChristopherHX fa11851d67 Fix formatting of email setup (#249)
Sorry I incorrectly used the :::note syntax in one PR merged recently, missing `:::` to end the quote

CC @lunny

Picture of the bug I introduced appended.

Reviewed-on: https://gitea.com/gitea/docs/pulls/249
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-18 03:10:58 +00:00
ChristopherHXandLunny Xiao f9ff184ee3 Mention smtp+starttls not only in the config cheat sheet (#247)
I almost entered STARTTLS under PROTOCOLS, better to mention the correct solution without needing to check the config cheat sheet.

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/247
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-16 17:48:45 +00:00
ChristopherHXandLunny Xiao cbbf31f1d5 Provide a hint for ENABLE_NOTIFY_MAIL in email setup (#246)
* some people like me might wonder why the email-setup didn't work

While reviewing https://github.com/go-gitea/gitea/pull/34982#pullrequestreview-3013995449, I enabled the mailer the first time and found this solution in the debugger not in the docs.

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/246
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-16 17:48:12 +00:00
talltechy 06c7f7f975 docs: Add ProtonMail SMTP configuration instructions (#93)
#### Summary
This pull request adds detailed instructions for configuring ProtonMail's SMTP server in the `email-setup.md` documentation. The new section provides step-by-step guidance on generating SMTP tokens and configuring the `app.ini` file for ProtonMail.

#### Changes
- Added a new section under the "ProtonMail" heading in `email-setup.md`.
- Included instructions for generating SMTP tokens in ProtonMail settings.
- Provided an example configuration for the `app.ini` file to use ProtonMail's SMTP server.

Reviewed-on: https://gitea.com/gitea/docs/pulls/93
Reviewed-by: Lunny Xiao <[email protected]>
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: talltechy <[email protected]>
Co-committed-by: talltechy <[email protected]>
2024-11-12 19:36:54 +00:00
Lunny Xiao 7dc54af200 Remove unnecessary meta data on markdown files (#12)
Reviewed-on: https://gitea.com/gitea/docs/pulls/12
2024-06-28 19:50:37 +00:00
Lunny Xiao 9a8396aa29 Fix broken links (#1)
- Always use a relative markdown link so that we can jump even if we edit it in local env or read it in code hosting server.

Reviewed-on: https://gitea.com/gitea/docs/pulls/1
2024-06-14 05:53:15 +00:00
Lunny Xiao b4dddf8804 Use docusaurus warning/note syntax instead markdown 2024-06-07 18:03:08 +08:00
Lunny Xiao c88deee1a6 Some small improvements 2024-06-06 22:49:46 +08:00
Lunny Xiao b9e0a85c9b Use a formal docusaurus i18n structure 2024-06-06 20:44:06 +08:00