diff options
author | Gusted <postmaster@gusted.xyz> | 2024-04-04 19:39:20 +0200 |
---|---|---|
committer | Gusted <postmaster@gusted.xyz> | 2024-04-04 19:39:20 +0200 |
commit | 396b5394967fcb944dd8e46ee377604582746699 (patch) | |
tree | 6af618701afe4ff36ed87428e91c637c9b4192f7 | |
parent | Merge pull request '[RELEASE] v1.21.10-0 release notes' (#3026) from earl-war... (diff) | |
download | forgejo-396b5394967fcb944dd8e46ee377604582746699.tar.xz forgejo-396b5394967fcb944dd8e46ee377604582746699.zip |
[CHORE] Remove Gitea specific files
- Removal of `docs`, this contains Gitea documentation which is not used
by Forgejo.
- Removal of `CHANGELOG.md` this contains only Gitea commits of
releases, instead `RELEASE-NOTES.md` should be used instead which also
contains Forgejo commits.
228 files changed, 0 insertions, 35607 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ae87638f1c..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8355 +0,0 @@ -# Changelog - -This changelog goes through all the changes that have been made in each release -without substantial changes to our git log; to see the highlights of what has -been added to each release, please refer to the [blog](https://blog.gitea.com). - -## [1.21.0](https://github.com/go-gitea/gitea/releases/tag/v1.21.0) - 2023-11-14 - -* BREAKING - * Restrict certificate type for builtin SSH server (#26789) - * Refactor to use urfave/cli/v2 (#25959) - * Move public asset files to the proper directory (#25907) - * Remove commit status running and warning to align GitHub (#25839) (partially reverted: Restore warning commit status (#27504) (#27529)) - * Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413) - * Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412) -* FEATURES - * User details page (#26713) - * Chore(actions): support cron schedule task (#26655) - * Support rebuilding issue indexer manually (#26546) - * Allow to archive labels (#26478) - * Add disable workflow feature (#26413) - * Support `.git-blame-ignore-revs` file (#26395) - * Pre-register OAuth2 applications for git credential helpers (#26291) - * Add `Retry` button when creating a mirror-repo fails (#26228) - * Artifacts retention and auto clean up (#26131) - * Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974) - * Implement auto-cancellation of concurrent jobs if the event is push (#25716) - * Newly pushed branches hints on repository home page (#25715) - * Display branch commit status (#25608) - * Add direct serving of package content (#25543) - * Add commits dropdown in PR files view and allow commit by commit review (#25528) - * Allow package cleanup from admin page (#25307) - * Batch delete issue and improve tippy opts (#25253) - * Show branches and tags that contain a commit (#25180) - * Add actor and status dropdowns to run list (#25118) - * Allow Organisations to have a E-Mail (#25082) - * Add codeowners feature (#24910) - * Actions Artifacts support uploading multiple files and directories (#24874) - * Support configuration variables on Gitea Actions (#24724) - * Support downloading raw task logs (#24451) -* API - * Unify two factor check (#27915) (#27929) - * Fix package webhook (#27839) (#27855) - * Fix/upload artifact error windows (#27802) (#27840) - * Fix bad method call when deleting user secrets via API (#27829) (#27831) - * Do not force creation of _cargo-index repo on publish (#27266) (#27765) - * Delete repos of org when purge delete user (#27273) (#27728) - * Fix org team endpoint (#27721) (#27727) - * Api: GetPullRequestCommits: return file list (#27483) (#27539) - * Don't let API add 2 exclusive labels from same scope (#27433) (#27460) - * Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304) - * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251) - * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163) - * Allow empty Conan files (#27092) - * Fix token endpoints ignore specified account (#27080) - * Reduce usage of `db.DefaultContext` (#27073) (#27083) (#27089) (#27103) (#27262) (#27265) (#27347) (#26076) - * Make SSPI auth mockable (#27036) - * Extract auth middleware from service (#27028) - * Add `RemoteAddress` to mirrors (#26952) - * Feat(API): add routes and functions for managing user's secrets (#26909) - * Feat(API): add secret deletion functionality for repository (#26808) - * Feat(API): add route and implementation for creating/updating repository secret (#26766) - * Add Upload URL to release API (#26663) - * Feat(API): update and delete secret for managing organization secrets (#26660) - * Feat: implement organization secret creation API (#26566) - * Add API route to list org secrets (#26485) - * Set commit id when ref used explicitly (#26447) - * PATCH branch-protection updates check list even when checks are disabled (#26351) - * Add file status for API "Get a single commit from a repository" (#16205) (#25831) - * Add API for changing Avatars (#25369) -* BUGFIXES - * Fix viewing wiki commit on empty repo (#28040) (#28044) - * Enable system users for comment.LoadPoster (#28014) (#28032) - * Fixed duplicate attachments on dump on windows (#28019) (#28031) - * Fix wrong xorm Delete usage(backport for 1.21) (#28002) - * Add word-break to repo description in home page (#27924) (#27957) - * Fix rendering assignee changed comments without assignee (#27927) (#27952) - * Add word break to release title (#27942) (#27947) - * Fix JS NPE when viewing specific range of PR commits (#27912) (#27923) - * Show correct commit sha when viewing single commit diff (#27916) (#27921) - * Fix 500 when deleting a dismissed review (#27903) (#27910) - * Fix DownloadFunc when migrating releases (#27887) (#27890) - * Fix http protocol auth (#27875) (#27876) - * Refactor postgres connection string building (#27723) (#27869) - * Close all hashed buffers (#27787) (#27790) - * Fix label render containing invalid HTML (#27752) (#27762) - * Fix duplicate project board when hitting `enter` key (#27746) (#27751) - * Fix `link-action` redirect network error (#27734) (#27749) - * Fix sticky diff header background (#27697) (#27712) - * Always delete existing scheduled action tasks (#27662) (#27688) - * Support allowed hosts for webhook to work with proxy (#27655) (#27675) - * Fix poster is not loaded in get default merge message (#27657) (#27666) - * Improve dropdown button alignment and fix hover bug (#27632) (#27637) - * Improve retrying index issues (#27554) (#27634) - * Fix 404 when deleting Docker package with an internal version (#27615) (#27630) - * Backport manually for a tmpl issue in v1.21 (#27612) - * Don't show Link to TOTP if not set up (#27585) (#27588) - * Fix data-race bug when accessing task.LastRun (#27584) (#27586) - * Fix attachment download bug (#27486) (#27571) - * Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551) - * Improve dropdown's behavior when there is a search input in menu (#27526) (#27534) - * Fix panic in storageHandler (#27446) (#27479) - * When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442) - * Fix pr template (#27436) (#27440) - * Fix git 2.11 error when checking IsEmpty (#27393) (#27397) - * Allow get release download files and lfs files with oauth2 token format (#26430) (#27379) - * Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375) - * Absolute positioned checkboxes overlay floated elements (#26870) (#27366) - * Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365) - * Fix repo count in org action settings (#27245) (#27353) - * Add logs for data broken of comment review (#27326) (#27345) - * Fix the approval count of PR when there is no protection branch rule (#27272) (#27343) - * Fix Bug in Issue Config when only contact links are set (#26521) (#27334) - * Improve issue history dialog and make poster can delete their own history (#27323) (#27327) - * Fix orphan check for deleted branch (#27310) (#27321) - * Fix protected branch icon location (#26576) (#27317) - * Fix yaml test (#27297) (#27303) - * Fix some animation bugs (#27287) (#27294) - * Fix incorrect change from #27231 (#27275) (#27282) - * Add missing public user visibility in user details page (#27246) (#27250) - * Fix EOL handling in web editor (#27141) (#27234) - * Fix issues on action runners page (#27226) (#27233) - * Quote table `release` in sql queries (#27205) (#27218) - * Fix release URL in webhooks (#27182) (#27185) - * Fix review request number and add more tests (#27104) (#27168) - * Fix the variable regexp pattern on web page (#27161) (#27164) - * Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124) - * Fix NPE when editing OAuth2 applications (#27078) - * Fix the incorrect route path in the user edit page. (#27007) - * Fix the secret regexp pattern on web page (#26910) - * Allow users with write permissions for issues to add attachments with API (#26837) - * Make "link-action" backend code respond correct JSON content (#26680) - * Use line-height: normal by default (#26635) - * Fix NPM packages name validation (#26595) - * Rewrite the DiffFileTreeItem and fix misalignment (#26565) - * Return empty when searching issues with no repos (#26545) - * Explain SearchOptions and fix ToSearchOptions (#26542) - * Add missing triggers to update issue indexer (#26539) - * Handle base64 decoding correctly to avoid panic (#26483) - * Avoiding accessing undefined mentionValues (#26461) - * Fix incorrect redirection in new issue using references (#26440) - * Fix the bug when getting files changed for `pull_request_target` event (#26320) - * Remove IsWarning in tmpl (#26120) - * Fix loading `LFS_JWT_SECRET` from wrong section (#26109) - * Fixing redirection issue for logged-in users (#26105) - * Improve "gitea doctor" sub-command and fix "help" commands (#26072) - * Fix the truncate and alignment problem for some admin tables (#26042) - * Update minimum password length requirements (#25946) - * Do not "guess" the file encoding/BOM when using API to upload files (#25828) - * Restructure issue list template, styles (#25750) - * Fix `ref` for workflows triggered by `pull_request_target` (#25743) - * Fix issues indexer document mapping (#25619) - * Use JSON response for "user/logout" (#25522) - * Fix migrate page layout on mobile (#25507) - * Link to existing PR when trying to open a new PR on the same branches (#25494) - * Do not publish docker release images on `-dev` tags (#25471) - * Support `pull_request_target` event (#25229) - * Modify the content format of the Feishu webhook (#25106) -* ENHANCEMENTS - * Render email addresses as such if followed by punctuation (#27987) (#27992) - * Show error toast when file size exceeds the limits (#27985) (#27986) - * Fix citation error when the file size is larger than 1024 bytes (#27958) (#27965) - * Remove action runners on user deletion (#27902) (#27908) - * Remove set tabindex on view issue (#27892) (#27896) - * Reduce margin/padding on flex-list items and divider (#27872) (#27874) - * Change katex limits (#27823) (#27868) - * Clean up template locale usage (#27856) (#27857) - * Add dedicated class for empty placeholders (#27788) (#27792) - * Add gap between diff boxes (#27776) (#27781) - * Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764) - * Enable followCursor for language stats bar (#27713) (#27739) - * Improve diff tree spacing (#27714) (#27719) - * Feed UI Improvements (#27356) (#27717) - * Improve feed icons and feed merge text color (#27498) (#27716) - * [FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715) - * Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693) - * Fix required checkboxes in issue forms (#27592) (#27692) - * Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661) - * Cleanup repo details icons/labels (#27644) (#27654) - * Keep filter when showing unfiltered results on explore page (#27192) (#27589) - * Show manual cron run's last time (#27544) (#27577) - * Revert "Fix pr template (#27436)" (#27567) - * Increase queue length (#27555) (#27562) - * Avoid run change title process when the title is same (#27467) (#27558) - * Remove max-width and add hide text overflow (#27359) (#27550) - * Add hover background to wiki list page (#27507) (#27521) - * Fix mermaid flowchart margin issue (#27503) (#27516) - * Refactor system setting (#27000) (#27452) - * Fix missing `ctx` in new_form.tmpl (#27434) (#27438) - * Add Index to `action.user_id` (#27403) (#27425) - * Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408) - * Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407) - * Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402) - * Hide archived labels when filtering by labels on the issue list (#27115) (#27381) - * Highlight user details link (#26998) (#27376) - * Add protected branch name description (#27257) (#27351) - * Improve tree not found page (#26570) (#27346) - * Add Index to `comment.dependent_issue_id` (#27325) (#27340) - * Improve branch list UI (#27319) (#27324) - * Fix divider in subscription page (#27298) (#27301) - * Add missed return to actions view fetch (#27289) (#27293) - * Backport ctx locale refactoring manually (#27231) (#27259) (#27260) - * Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253) - * Use mask-based fade-out effect for `.new-menu` (#27181) (#27243) - * Cleanup locale function usage (#27227) (#27240) - * Fix z-index on markdown completion (#27237) (#27239) - * Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228) - * Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210) - * Fix: text decorator on issue sidebar menu label (#27206) (#27209) - * Fix dropdown icon position (#27175) (#27177) - * Add index to `issue_user.issue_id` (#27154) (#27158) - * Increase auth provider icon size on login page (#27122) - * Remove a `gt-float-right` and some unnecessary helpers (#27110) - * Change green buttons to primary color (#27099) - * Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095) - * Use `print` instead of `printf` (#27093) - * Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067) - * Search branches (#27055) - * Display all user types and org types on admin management UI (#27050) - * Ui correction in mobile view nav bar left aligned items. (#27046) - * Chroma color tweaks (#26978) - * Move some functions to service layer (#26969) - * Improve "language stats" UI (#26968) - * Replace `util.SliceXxx` with `slices.Xxx` (#26958) - * Refactor dashboard/feed.tmpl (#26956) - * Move repository deletion to service layer (#26948) - * Fix the missing repo count (#26942) - * Improve hint when uploading a too large avatar (#26935) - * Extract common code to new template (#26933) - * Move createrepository from module to service layer (#26927) - * Move notification interface to services layer (#26915) - * Move feed notification service layer (#26908) - * Move ui notification to service layer (#26907) - * Move indexer notification to service layer (#26906) - * Move mail notification logic to service layer (#26905) - * Extract common code to new template (#26903) - * Show queue's active worker number (#26896) - * Fix media description render for orgmode (#26895) - * Remove CSS `has` selector and improve various styles (#26891) - * Relocate the `RSS user feed` button (#26882) - * Refactor "shortsha" (#26877) - * Refactor `og:description` to limit the max length (#26876) - * Move web/api context related testing function into a separate package (#26859) - * Redable error on S3 storage connection failure (#26856) - * Improve opengraph previews (#26851) - * Add more descriptive error on forgot password page (#26848) - * Show always repo count in header (#26842) - * Remove "TODO" tasks from CSS file (#26835) - * Render code blocks in repo description (#26830) - * Minor dashboard tweaks, fix flex-list margins (#26829) - * Remove polluted `.ui.right` (#26825) - * Display archived labels specially when listing labels (#26820) - * Remove polluted ".ui.left" style (#26809) - * Make it posible to customize nav text color via css var (#26807) - * Refactor lfs requests (#26783) - * Improve flex list item padding (#26779) - * Remove fomantic `text` module (#26777) - * Remove fomantic `item` module (#26775) - * Remove redundant nil check in `WalkGitLog` (#26773) - * Reduce some allocations in type conversion (#26772) - * Refactor some CSS styles and simplify code (#26771) - * Unify `border-radius` behavior (#26770) - * Improve modal dialog UI (#26764) - * Allow "latest" to be used in release vTag when downloading file (#26748) - * Adding hint `Archived` to archive label. (#26741) - * Move `modules/mirror` to `services` (#26737) - * Add "dir=auto" for input/textarea elements by default (#26735) - * Add auth-required to config.json for Cargo http registry (#26729) - * Simplify helper CSS classes and avoid abuse (#26728) - * Make web context initialize correctly for different cases (#26726) - * Focus editor on "Write" tab click (#26714) - * Remove incorrect CSS helper classes (#26712) - * Fix review bar misalignment (#26711) - * Add reverseproxy auth for API back with default disabled (#26703) - * Add default label in branch select list (#26697) - * Improve Image Diff UI (#26696) - * Fixed text overflow in dropdown menu (#26694) - * [Refactor] getIssueStatsChunk to move inner function into own one (#26671) - * Remove fomantic loader module (#26670) - * Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658) - * Improve some flex layouts (#26649) - * Improve the branch selector tab UI (#26631) - * Improve show role (#26621) - * Remove avatarHTML from template helpers (#26598) - * Allow text selection in actions step header (#26588) - * Improve translation of milestone filters (#26569) - * Add optimistic lock to ActionRun table (#26563) - * Update team invitation email link (#26550) - * Differentiate better between user settings and admin settings (#26538) - * Check disabled workflow when rerun jobs (#26535) - * Improve deadline icon location in milestone list page (#26532) - * Improve repo sub menu (#26531) - * Fix the display of org level badges (#26504) - * Rename `Sync2` -> `Sync` (#26479) - * Fix stderr usages (#26477) - * Remove fomantic transition module (#26469) - * Refactor tests (#26464) - * Refactor project templates (#26448) - * Fall back to esbuild for css minify (#26445) - * Always show usernames in reaction tooltips (#26444) - * Use correct pull request commit link instead of a generic commit link (#26434) - * Refactor "editorconfig" (#26391) - * Make `user-content-* ` consistent with github (#26388) - * Remove unnecessary template helper repoAvatar (#26387) - * Remove unnecessary template helper DisableGravatar (#26386) - * Use template context function for avatar rendering (#26385) - * Rename code_langauge.go to code_language.go (#26377) - * Use more `IssueList` instead of `[]*Issue` (#26369) - * Do not highlight `#number` in documents (#26365) - * Fix display problems of members and teams unit (#26363) - * Fix 404 error when remove self from an organization (#26362) - * Improve CLI and messages (#26341) - * Refactor backend SVG package and add tests (#26335) - * Add link to job details and tooltip to commit status in repo list in dashboard (#26326) - * Use yellow if an approved review is stale (#26312) - * Remove commit load branches and tags in wiki repo (#26304) - * Add highlight to selected repos in milestone dashboard (#26300) - * Delete `issue_service.CreateComment` (#26298) - * Do not show Profile README when repository is private (#26295) - * Tweak actions menu (#26278) - * Start using template context function (#26254) - * Use calendar icon for `Joined on...` in profiles (#26215) - * Add 'Show on a map' button to Location in profile, fix layout (#26214) - * Render plaintext task list items for markdown files (#26186) - * Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181) - * Release attachments duplicated check (#26176) - * De-emphasize issue sidebar buttons (#26171) - * Fixing the align of commit stats in commit_page template. (#26161) - * Allow editing push mirrors after creation (#26151) - * Move web JSON functions to web context and simplify code (#26132) - * Refactor improve NoBetterThan (#26126) - * Improve clickable area in repo action view page (#26115) - * Add context parameter to some database functions (#26055) - * Docusaurus-ify (#26051) - * Improve text for empty issue/pr description (#26047) - * Categorize admin settings sidebar panel (#26030) - * Remove redundant "RouteMethods" method (#26024) - * Refactor and enhance issue indexer to support both searching, filtering and paging (#26012) - * Add a link to OpenID Issuer URL in WebFinger response (#26000) - * Fix UI for release tag page / wiki page / subscription page (#25948) - * Support copy protected branch from template repository (#25889) - * Improve display of Labels/Projects/Assignees sort options (#25886) - * Fix margin on the new/edit project page. (#25885) - * Show image size on view page (#25884) - * Remove ref name in PR commits page (#25876) - * Allow the use of alternative net.Listener implementations by downstreams (#25855) - * Refactor "Content" for file uploading (#25851) - * Add error info if no user can fork the repo (#25820) - * Show edit title button on commits tab of PR, too (#25791) - * Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790) - * Don't stack PR tab menu on small screens (#25789) - * Repository Archived text title center align (#25767) - * Make route middleware/handler mockable (#25766) - * Move issue filters to shared template (#25729) - * Use frontend fetch for branch dropdown component (#25719) - * Add open/closed field support for issue index (#25708) - * Some less naked returns (#25682) - * Fix inconsistent user profile layout across tabs (#25625) - * Get latest commit statuses from database instead of git data on dashboard for repositories (#25605) - * Adding branch-name copy to clipboard branches screen. (#25596) - * Update emoji set to Unicode 15 (#25595) - * Move some files under repo/setting (#25585) - * Add custom ansi colors and CSS variables for them (#25546) - * Add log line anchor for action logs (#25532) - * Use flex instead of float for sort button and search input (#25519) - * Update octicons and use `octicon-file-directory-symlink` (#25453) - * Add toasts to UI (#25449) - * Fine tune project board label colors and modal content background (#25419) - * Import additional secrets via file uri (#25408) - * Switch to ansi_up for ansi rendering in actions (#25401) - * Store and use seconds for timeline time comments (#25392) - * Support displaying diff stats in PR tab bar (#25387) - * Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) - * Refactor: TotalTimes return seconds (#25370) - * Navbar styling rework (#25343) - * Introduce shared template for search inputs (#25338) - * Only show 'Manage Account Links' when necessary (#25311) - * Improve 'Privacy' section in profile settings (#25309) - * Substitute variables in path names of template repos too (#25294) - * Fix tags line no margin see #25255 (#25280) - * Use fetch to send requests to create issues/comments (#25258) - * Change form actions to fetch for submit review box (#25219) - * Improve AJAX link and modal confirm dialog (#25210) - * Reduce unnecessary DB queries for Actions tasks (#25199) - * Disable `Create column` button while the column name is empty (#25192) - * Refactor indexer (#25174) - * Adjust style for action run list (align icons, adjust padding) (#25170) - * Remove duplicated functions when deleting a branch (#25128) - * Make confusable character warning less jarring (#25069) - * Highlight viewed files differently in the PR filetree (#24956) - * Support changing labels of Actions runner without re-registration (#24806) - * Fix duplicate Reviewed-by trailers (#24796) - * Resolve issue with sort icons on admin/users and admin/runners (#24360) - * Split lfs size from repository size (#22900) - * Sync branches into databases (#22743) - * Disable run user change in installation page (#22499) - * Add merge files files to GetCommitFileStatus (#20515) - * Show OpenID Connect and OAuth on signup page (#20242) -* SECURITY - * Dont leak private users via extensions (#28023) (#28029) - * Expanded minimum RSA Keylength to 3072 (#26604) -* TESTING - * Add user secrets API integration tests (#27832) (#27852) - * Add tests for db indexer in indexer_test.go (#27087) - * Speed up TestEventSourceManagerRun (#26262) - * Add unit test for user renaming (#26261) - * Add some Wiki unit tests (#26260) - * Improve unit test for caching (#26185) - * Add unit test for `HashAvatar` (#25662) -* TRANSLATION - * Backport translations to v1.21 (#27899) - * Fix issues in translation file (#27699) (#27737) - * Add locale for deleted head branch (#26296) - * Improve multiple strings in en-US locale (#26213) - * Fix broken translations for package documantion (#25742) - * Correct translation wrong format (#25643) -* BUILD - * Dockerfile small refactor (#27757) (#27826) - * Fix build errors on BSD (in BSDMakefile) (#27594) (#27608) - * Fully replace drone with actions (#27556) (#27575) - * Enable markdownlint `no-duplicate-header` (#27500) (#27506) - * Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295) - * Update snap package (#27021) - * Bump go to 1.21 (#26608) - * Bump xgo to go-1.21.x and node to 20 in release-version (#26589) - * Add template linting via djlint (#25212) -* DOCS - * Change default size of issue/pr attachments and repo file (#27946) (#28017) - * Remove `known issue` section in Gitea Actions Doc (#27930) (#27938) - * Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119) - * Update brew installation documentation since gitea moved to brew core package (#27070) - * Actions are no longer experimental, so enable them by default (#27054) - * Add a documentation note for Windows Service (#26938) - * Add sparse url in cargo package guide (#26937) - * Update nginx recommendations (#26924) - * Update backup instructions to align with archive structure (#26902) - * Expanding documentation in queue.go (#26889) - * Update info regarding internet connection for build (#26776) - * Docs: template variables (#26547) - * Update index doc (#26455) - * Update zh-cn documentation (#26406) - * Fix typos and grammer problems for actions documentation (#26328) - * Update documentation for 1.21 actions (#26317) - * Doc update swagger doc for POST /orgs/{org}/teams (#26155) - * Doc sync authentication.md to zh-cn (#26117) - * Doc guide the user to create the appropriate level runner (#26091) - * Make organization redirect warning more clear (#26077) - * Update blog links (#25843) - * Fix default value for LocalURL (#25426) - * Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194) -* MISC - * Replace deprecated `elliptic.Marshal` (#26800) - * Add elapsed time on debug for slow git commands (#25642) - -## [1.20.5](https://github.com/go-gitea/gitea/releases/tag/v1.20.5) - 2023-10-03 - -* ENHANCEMENTS - * Fix z-index on markdown completion (#27237) (#27242 & #27238) - * Use secure cookie for HTTPS sites (#26999) (#27013) -* BUGFIXES - * Fix git 2.11 error when checking IsEmpty (#27393) (#27396) - * Allow get release download files and lfs files with oauth2 token format (#26430) (#27378) - * Fix orphan check for deleted branch (#27310) (#27320) - * Quote table `release` in sql queries (#27205) (#27219) - * Fix release URL in webhooks (#27182) (#27184) - * Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) (#27156) - * fix pagination for followers and following (#27127) (#27138) - * Fix issue templates when blank isses are disabled (#27061) (#27082) - * Fix context cache bug & enable context cache for dashabord commits' authors(#26991) (#27017) - * Fix INI parsing for value with trailing slash (#26995) (#27001) - * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27249) - * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27167 & #27162) - * Fix bug of review request number (#27406) (#27104) -* TESTING - * services/wiki: Close() after error handling (#27129) (#27137) -* DOCS - * Improve actions docs related to `pull_request` event (#27126) (#27145) -* MISC - * Add logs for data broken of comment review (#27326) (#27344) - * Load reviewer before sending notification (#27063) (#27064) - -## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08 - -* SECURITY - * Check blocklist for emails when adding them to account (#26812) (#26831) -* ENHANCEMENTS - * Add `branch_filter` to hooks API endpoints (#26599) (#26632) - * Fix incorrect "tabindex" attributes (#26733) (#26734) - * Use line-height: normal by default (#26635) (#26708) - * Fix unable to display individual-level project (#26198) (#26636) -* BUGFIXES - * Fix wrong review requested number (#26784) (#26880) - * Avoid double-unescaping of form value (#26853) (#26863) - * Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled (#26813) (#26847) - * Sync tags when adopting repos (#26816) (#26834) - * Fix verifyCommits error when push a new branch (#26664) (#26810) - * Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806) - * Fix some slice append usages (#26778) (#26798) - * Add fix incorrect can_create_org_repo for org owner team (#26683) (#26791) - * Fix bug for ctx usage (#26763) - * Make issue template field template access correct template data (#26698) (#26709) - * Use correct minio error (#26634) (#26639) - * Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) - * Set errwriter for urfave/cli v1 (#26616) - * Fix reopen logic for agit flow pull request (#26399) (#26613) - * Fix context filter has no effect in dashboard (#26695) (#26811) - * Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785) (#26790) - * Fix Page Not Found error (#26768) - -## [1.20.3](https://github.com/go-gitea/gitea/releases/tag/v1.20.3) - 2023-08-20 - -* BREAKING - * Fix the wrong derive path (#26271) (#26318) -* SECURITY - * Fix API leaking Usermail if not logged in (#25097) (#26350) -* FEATURES - * Add ThreadID parameter for Telegram webhooks (#25996) (#26480) -* ENHANCEMENTS - * Add minimum polyfill to support "relative-time-element" in PaleMoon (#26575) (#26578) - * Fix dark theme highlight for "NameNamespace" (#26519) (#26527) - * Detect ogg mime-type as audio or video (#26494) (#26505) - * Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498) - * Move dropzone progress bar to bottom to show filename when uploading (#26492) (#26497) - * Remove last newline from config file (#26468) (#26471) - * Minio: add missing region on client initialization (#26412) (#26438) - * Add pull request review request webhook event (#26401) (#26407) - * Fix text truncate (#26354) (#26384) - * Fix incorrect color of selected assignees when create issue (#26324) (#26372) - * Display human-readable text instead of cryptic filemodes (#26352) (#26358) - * Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345) - * Fix the topic validation rule and suport dots (#26286) (#26303) - * Fix due date rendering the wrong date in issue (#26268) (#26274) - * Don't autosize textarea in diff view (#26233) (#26244) - * Fix commit compare style (#26209) (#26226) - * Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211) -* BUGFIXES - * Use "input" event instead of "keyup" event for migration form (#26602) (#26605) - * Do not use deprecated log config options by default (#26592) (#26600) - * Fix "issueReposQueryPattern does not match query" (#26556) (#26564) - * Sync repo's IsEmpty status correctly (#26517) (#26560) - * Fix project filter bugs (#26490) (#26558) - * Use `hidden` over `clip` for text truncation (#26520) (#26522) - * Set "type=button" for editor's toolbar buttons (#26510) (#26518) - * Fix NuGet search endpoints (#25613) (#26499) - * Fix storage path logic especially for relative paths (#26441) (#26481) - * Close stdout correctly for "git blame" (#26470) (#26473) - * Check first if minio bucket exists before trying to create it (#26420) (#26465) - * Avoiding accessing undefined tributeValues #26461 (#26462) - * Call git.InitSimple for runRepoSyncReleases (#26396) (#26450) - * Add transaction when creating pull request created dirty data (#26259) (#26437) - * Fix wrong middleware sequence (#26428) (#26436) - * Fix admin queue page title and fix CI failures (#26409) (#26421) - * Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405) - * Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) - * Fix incorrect CLI exit code and duplicate error message (#26346) (#26347) - * Prevent newline errors with Debian packages (#26332) (#26342) - * Fix bug with sqlite load read (#26305) (#26339) - * Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330) - * Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316) - * Clarify the logger's MODE config option (#26267) (#26281) - * Use shared template for webhook icons (#26242) (#26246) - * Fix pull request check list is limited (#26179) (#26245) - * Fix attachment clipboard copy on insecure origin (#26224) (#26231) - * Fix access check for org-level project (#26182) (#26223) -* MISC - * Improve profile readme rendering (#25988) (#26453) - * [docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357) - * Upgrade x/net to 0.13.0 (#26301) - -## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/v1.20.2) - 2023-07-29 - -* ENHANCEMENTS - * Calculate MAX_WORKERS default value by CPU number (#26177) (#26183) - * Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154) -* BUGFIXES - * Fix allowed user types setting problem (#26200) (#26206) - * Fix handling of plenty Nuget package versions (#26075) (#26173) - * Fix UI regression of asciinema player (#26159) (#26162) - * Fix LFS object list style (#26133) (#26147) - * Fix allowed user types setting problem (#26200) (#26206) - * Prevent primary key update on migration (#26192) (#26199) - * Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158) - * Fix bugs in LFS meta garbage collection (#26122) (#26157) - * Update xorm version (#26128) (#26150) - * Remove "misc" scope check from public API endpoints (#26134) (#26149) - * Fix CLI allowing creation of access tokens with existing name (#26071) (#26144) - * Fix incorrect router logger (#26137) (#26143) - * Improve commit graph alignment and truncating (#26112) (#26127) - * Avoid writing config file if not installed (#26107) (#26113) - * Fix escape problems in the branch selector (#25875) (#26103) - * Fix handling of Debian files with trailing slash (#26087) (#26098) - * Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089) - * Use stderr as fallback if the log file can't be opened (#26074) (#26083) - * Increase table cell horizontal padding (#26140) (#26142) - * Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124) - * Fix duplicated url prefix on issue context menu (#26066) (#26067) - -## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/v1.20.1) - 2023-07-22 - -* SECURITY - * Disallow dangerous URL schemes (#25960) (#25964) -* ENHANCEMENTS - * Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972) - * Make pending commit status yellow again (#25935) (#25968) -* BUGFIXES - * Fix version in rpm repodata/primary.xml.gz (#26009) (#26048) - * Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013) - * ParseScope with owner/repo always sets owner to zero (#25987) (#25989) - * Fix SSPI auth panic (#25955) (#25969) - * Avoid creating directories when loading config (#25944) (#25957) - * Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937) - * Ignore `runs-on` with expressions when warning no matched runners (#25917) (#25933) - * Avoid opening/closing PRs which are already merged (#25883) (#25903) -* DOCS - * RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020) - * Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019) - * Update path related documents (#25417) (#25982) -* MISC - * Adding remaining enum for migration repo model type. (#26021) (#26034) - * Fix the route for pull-request's authors (#26016) (#26018) - * Fix commit status color on dashboard repolist (#25993) (#25998) - * Avoid hard-coding height in language dropdown menu (#25986) (#25997) - * Add shutting down notice (#25920) (#25922) - * Fix incorrect milestone count when provide a keyword (#25880) (#25904) - -## [1.20.0](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) - 2023-07-16 - -* BREAKING - * Fix WORK_DIR for docker (root) image (#25738) (#25811) - * Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604) - * Refactor path & config system (#25330) (#25416) - * Fix all possible setting error related storages and added some tests (#23911) (#25244) - * Use a separate admin page to show global stats, remove `actions` stat (#25062) - * Remove the service worker (#25010) - * Remove meta tags `theme-color` and `default-theme` (#24960) - * Use `[git.config]` for reflog cleaning up (#24958) - * Allow all URL schemes in Markdown links by default (#24805) - * Redesign Scoped Access Tokens (#24767) - * Fix team members API endpoint pagination (#24754) - * Rewrite logger system (#24726) - * Increase default LFS auth timeout from 20m to 24h (#24628) - * Rewrite queue (#24505) - * Remove unused setting `time.FORMAT` (#24430) - * Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) - * Correct the access log format (#24085) - * Reserve ".png" suffix for user/org names (#23992) - * Prefer native parser for SSH public key parsing (#23798) - * Editor preview support for external renderers (#23333) - * Add Gitea Profile Readmes (#23260) - * Refactor `ctx` in templates (#23105) -* SECURITY - * Test if container blob is accessible before mounting (#22759) (#25784) - * Set type="password" on all auth_token fields (#22175) -* FEATURES - * Add button on diff header to copy file name, misc diff header tweaks (#24986) - * API endpoint for changing/creating/deleting multiple files (#24887) - * Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860) - * Add up and down arrows to selected lookup repositories (#24727) - * Add Go package registry (#24687) - * Add status indicator on main home screen for each repo (#24638) - * Support for status check pattern (#24633) - * Implement Cargo HTTP index (#24452) - * Add Debian package registry (#24426) - * Add the ability to pin Issues (#24406) - * Add follow organization and fix the logic of following page (#24345) - * Allow `webp` images as avatars (#24248) - * Support upload `outputs` and use `needs` context on Actions (#24230) - * Allow adding new files to an empty repo (#24164) - * Make wiki title supports dashes and improve wiki name related features (#24143) - * Add monospace toggle button to textarea (#24034) - * Use auto-updating, natively hoverable, localized time elements (#23988) - * Add ntlm authentication support for mail (#23811) - * Add CLI command to register runner tokens (#23762) - * Add Alpine package registry (#23714) - * Expand/Collapse all changed files (#23639) - * Add unset default project column (#23531) - * Add activity feeds API (#23494) - * Add RPM registry (#23380) - * Add meilisearch support (#23136) - * Add API for License templates (#23009) - * Add admin API email endpoints (#22792) - * Add user rename endpoint to admin api (#22789) - * Add API for gitignore templates (#22783) - * Implement actions artifacts (#22738) - * Add RSS Feeds for branches and files (#22719) - * Display when a repo was archived (#22664) - * Add Swift package registry (#22404) - * Add CRAN package registry (#22331) - * Add user webhooks (#21563) - * Implement systemd-notify protocol (#21151) - * Implement Issue Config (#20956) - * Add API to manage issue dependencies (#17935) -* API - * Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571) - * Fix `Permission` in API returned repository struct (#25388) (#25441) - * Add API for Label templates (#24602) - * Filters for GetAllCommits (#24568) - * Add ability to specify '--not' from GetAllCommits (#24409) - * Support uploading file to empty repo by API (#24357) - * Add absent repounits to create/edit repo API (#23500) - * Add login name and source id for admin user searching API (#23376) - * Create a branch directly from commit on the create branch API (#22956) -* ENHANCEMENTS - * Make `add line comment` buttons focusable (#25894) (#25896) - * Always pass 6-digit hex color to monaco (#25780) (#25782) - * Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764) - * Hide `add file` button for pull mirrors (#25748) (#25751) - * Allow/fix review (approve/reject) of empty PRs (#25690) (#25732) - * Fix tags header and pretty format numbers (#25624) (#25694) - * Actions list enhancements (#25601) (#25678) - * Fix show more for image on diff page (#25672) (#25673) - * Prevent SVG shrinking (#25652) (#25669) - * Fix UI misalignment on user setting page (#25629) (#25656) - * Use css on labels (#25626) (#25636) - * Read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602) - * Redirect to package after version deletion (#25594) (#25599) - * Reduce table padding globally (#25568) (#25577) - * Change `Regenerate Secret` button display (#25534) (#25541) - * Fix rerun icon on action view component (#25531) (#25536) - * Move some regexp out of functions (#25430) (#25445) - * Diff page enhancements (#25398) (#25437) - * Various UI fixes (#25264) (#25431) - * Fix label list divider (#25312) (#25372) - * Fix UI on mobile view (#25315) (#25340) - * When viewing a file, hide the add button (#25320) (#25339) - * Show if File is Executable (#25287) (#25300) - * Fix edit OAuth application width (#25262) (#25263) - * Use flex to align SVG and text (#25163) (#25260) - * Revert overflow: overlay (revert #21850) (#25231) (#25239) - * Use inline SVG for built-in OAuth providers (#25171) (#25234) - * Change access token UI to select dropdowns (#25109) (#25230) - * Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211) - * Minor arc-green color tweaks (#25175) (#25205) - * Button and color enhancements (#24989) (#25176) - * Fix mobile navbar and misc cleanups (#25134) (#25169) - * Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161) - * Improve notification icon and navbar (#25111) (#25124) - * Add details summary for vertical menus in settings to allow toggling (#25098) - * Don't display `select all issues` checkbox when no issues are available (#25086) - * Use RepositoryList instead of []*Repository (#25074) - * Add ability to set multiple redirect URIs in OAuth application UI (#25072) - * Use git command instead of the ini package to remove the `origin` remote (#25066) - * Remove cancel button from branch protection form (#25063) - * Show file tree by default (#25052) - * Add Progressbar to Milestone Page (#25050) - * Minor UI improvements: logo alignment, auth map editor, auth name display (#25043) - * Allow for PKCE flow without client secret + add docs (#25033) - * Refactor INI package (first step) (#25024) - * Various style fixes (#25008) - * Fix delete user account modal (#25004) - * Refactor diffFileInfo / DiffTreeStore (#24998) - * Add user level action runners (#24995) - * Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988) - * Add step start time to `ViewStepLog` (#24980) - * Add dark mode to API Docs (#24971) - * Display file mode for new file and file mode changes (#24966) - * Make the 500 page load themes (#24953) - * Show `bot` label next to username when rendering autor link if the user is a bot (#24943) - * Repo list improvements, fix bold helper classes (#24935) - * Improve queue and logger context (#24924) - * Improve RunMode / dev mode (#24886) - * Improve some Forms (#24878) - * Add show timestamp/seconds and fullscreen options to action page (#24876) - * Fix double border and adjust width for user profile page (#24870) - * Improve Actions CSS (#24864) - * Fix `@font-face` overrides (#24855) - * Remove `In your repositories` link in milestones dashboard (#24853) - * Fix missing yes/no in delete time log modal (#24851) - * Show new pull request button also on subdirectories and files (#24842) - * Make environment-to-ini support loading key value from file (#24832) - * Support wildcard in email domain allow/block list (#24831) - * Use `CommentList` instead of `[]*Comment` (#24828) - * Add RTL rendering support to Markdown (#24816) - * Rework notifications list (#24812) - * Mute repo names in dashboard repo list (#24811) - * Fix max width and margin of comment box on conversation page (#24809) - * Some refactors for issues stats (#24793) - * Rework label colors (#24790) - * Fix OAuth login loading state (#24788) - * Remove duplicated issues options and some more refactors (#24787) - * Decouple the different contexts from each other (#24786) - * Remove background on user dashboard filter bar (#24779) - * Improve and fix bugs surrounding reactions (#24760) - * Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758) - * Fix WEBP image copying (#24743) - * Rework OAuth login buttons, swap github logo to monocolor (#24740) - * Consolidate the two review boxes into one (#24738) - * Unification of registration fields order (#24737) - * Refactor Pull Mirror and fix out-of-sync bugs (#24732) - * Improvements for action detail page (#24718) - * Fix flash of unstyled content in action view page (#24712) - * Don't filter action runs based on state (#24711) - * Optimize actions list by removing an unnecessary `git` call (#24710) - * Support no label/assignee filter and batch clearing labels/assignees (#24707) - * Add icon support for safari (#24697) - * Use standard HTTP library to serve files (#24693) - * Improve button-ghost, remove tertiary button (#24692) - * Only hide tooltip tippy instances (#24688) - * Support migrating storage for actions log via command line (#24679) - * Remove highlight in repo list (#24675) - * Add markdown preview to Submit Review Textarea (#24672) - * Update pin and add pin-slash (#24669) - * Improve empty notifications display (#24668) - * Support SSH for go get (#24664) - * Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) - * Only show one tippy at a time (#24648) - * Notification list enhancements, fix striped tables on dark theme (#24639) - * Improve queue & process & stacktrace (#24636) - * Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) - * Remove fluid on compare diff page (#24627) - * Add a tooltip to the job rerun button (#24617) - * Attach a tooltip to the action status icon (#24614) - * Make the actions control button look like an actual button (#24611) - * Remove unnecessary code (#24610) - * Make repo migration cancelable and fix various bugs (#24605) - * Improve updating Actions tasks (#24600) - * Attach a tooltip to the action control button (#24595) - * Make repository response support HTTP range request (#24592) - * Improve Gitea's web context, decouple "issue template" code into service package (#24590) - * Modify luminance calculation and extract related functions into single files (#24586) - * Simplify template helper functions (#24570) - * Split "modules/context.go" to separate files (#24569) - * Add org visibility label to non-organization's dashboard (#24558) - * Update LDAP filters to include both username and email address (#24547) - * Review fixes and enhancements (#24526) - * Display warning when user try to rename default branch (#24512) - * Fix color for transfer related buttons when having no permission to act (#24510) - * Rework button coloring, add focus and active colors (#24507) - * New webhook trigger for receiving Pull Request review requests (#24481) - * Add goto issue id function (#24479) - * Fix incorrect webhook time and use relative-time to display it (#24477) - * RSS icon fixes (#24476) - * Replace `N/A` with `-` everywhere (#24474) - * Pass 'not' to commit count (#24473) - * Enhance stylelint rule config, remove dead CSS (#24472) - * Remove `font-awesome` and fomantic `icon` module (#24471) - * Improve "new-menu" (#24465) - * Remove fomantic breadcrumb module (#24463) - * Improve template system and panic recovery (#24461) - * Make Issue/PR/projects more compact, misc CSS tweaks (#24459) - * Replace remaining fontawesome dropdown icons with SVG (#24455) - * Remove all direct references to font-awesome (#24448) - * Move links out of translation (#24446) - * Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442) - * Hide 'Mirror Settings' when unneeded, improve hints (#24433) - * Add "Updated" column for admin repositories list (#24429) - * Improve issue list filter (#24425) - * Rework header bar on issue, pull requests and milestone (#24420) - * Improve template helper (#24417) - * Make repo size style matches others (commits/branches/tags) (#24408) - * Support markdown editor for issue template (#24400) - * Improve commit date in commit graph (#24399) - * Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393) - * Merge setting.InitXXX into one function with options (#24389) - * Move `Rename branch` from repo settings page to the page of branches list (#24380) - * Improve protected branch setting page (#24379) - * Display 'Unknown' when runner.version is empty (#24378) - * Display owner of a runner as a tooltip instead of static text (#24377) - * Fix incorrect last online time in runner_edit.tmpl (#24376) - * Fix unclear `IsRepositoryExist` logic (#24374) - * Add custom helm repo name generated from url (#24363) - * Replace placeholders in licenses (#24354) - * Add rerun workflow button and refactor to use SVG octicons (#24350) - * Fix runner button height (#24338) - * Restore bold on repolist (#24337) - * Improve RSS (#24335) - * Refactor "route" related code, fix Safari cookie bug (#24330) - * Alert error message if open dependencies are included in the issues that try to batch close (#24329) - * Add missed column title in runner management page (#24328) - * Automatically select the org when click create repo from org dashboard (#24325) - * Modify width of ui container, fine tune css for settings pages and org header (#24315) - * Fix config list overflow and layout (#24312) - * Improve some modal action buttons (#24289) - * Move code from module to service (#24287) - * Sort users and orgs on explore by recency by default (#24279) - * Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) - * Show workflow config error on file view also (#24267) - * Improve template helper functions: string/slice (#24266) - * Use more specific test methods (#24265) - * Add `DumpVar` helper function to help debugging templates (#24262) - * Limit avatar upload to valid image files (#24258) - * Improve emoji and mention matching (#24255) - * Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246) - * Refactor config provider (#24245) - * Improve test logger (#24235) - * Default show closed actions list if all actions was closed (#24234) - * Add missing badges in user profile for /projects and /packages (#24232) - * Add repository counter badge to repository tab (#24205) - * Move secrets and runners settings to actions settings (#24200) - * Require at least one unit to be enabled (#24189) - * Use same action status svg icons on actions list as on action page (#24178) - * Use secondary pointing menu for tabs on user/organization home page (#24162) - * Improve Wiki TOC (#24137) - * Refactor locale number (#24134) - * Localize activity heatmap (except tooltip) (#24131) - * Fix duplicate modals when clicking on "remove all" repository button (#24129) - * Add runner check in repo action page (#24124) - * Support triggering workflows by wiki related events (#24119) - * Refactor cookie (#24107) - * Remove untranslatable `on_date` key (#24106) - * Refactor delete_modal_actions template and use it for project column related actions (#24097) - * Improve git log for debugging (#24095) - * Add option to search for users is active join a team (#24093) - * Add PDF rendering via PDFObject (#24086) - * Refactor web route (#24080) - * Make HTML template functions support context (#24056) - * Refactor rename user and rename organization (#24052) - * Localize milestone related time strings (#24051) - * Expand selected file when clicking file tree (#24041) - * Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040) - * Add placeholder and aria attributes to release and wiki edit page (#24031) - * Add new user types `reserved`, `bot`, and `remote` (#24026) - * Allow adding SSH keys even if SSH server is disabled (#24025) - * Use a general approach to access custom/static/builtin assets (#24022) - * Update github.com/google/go-github to v52 (#24004) - * Replace tribute with text-expander-element for textarea (#23985) - * Group template helper functions, remove `Printf`, improve template error messages (#23982) - * Drop "unrolled/render" package (#23965) - * Add job.duration in web ui (#23963) - * Tweak pull request branch delete ui (#23951) - * Merge template functions "dict/Dict/mergeinto" (#23932) - * Use a general Eval function for expressions in templates. (#23927) - * Clean template/helper.go (#23922) - * Actions: Use default branch as ref when a branch/tag delete occurs (#23910) - * Add tooltips for MD editor buttons and add `muted` class for buttons (#23896) - * Improve markdown editor: width, height, preferred (#23895) - * Make Release Download URLs predictable (#23891) - * Remove fomantic ".link" selector and styles (#23888) - * Added close/open button to details page of milestone (#23877) - * Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) - * Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) - * Make first section on home page full width (#23854) - * Use different SVG for pending and running actions (#23836) - * Display image size for multiarch container images (#23821) - * Improve action log display with control chars (#23820) - * Fix dropdown direction behavior (#23806) - * Fix incorrect/Improve error handle in edit user page (#23805) - * Use clippie module to copy to clipboard (#23801) - * Make minio package support legacy MD5 checksum (#23768) - * Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) - * Refactor docs (#23752) - * Fix markup background, improve wiki rendering (#23750) - * Make label templates have consistent behavior and priority (#23749) - * Improve LoadUnitConfig to handle invalid or duplicate units (#23736) - * Append `(comment)` when a link points at a comment rather than the whole issue (#23734) - * Clean some legacy files and move some build files (#23699) - * Refactor repo commit list (#23690) - * Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) - * Add aria attributes to interactive time tooltips. (#23661) - * Fix long project name display in issue list and in related dropdown (#23653) - * Use data-tooltip-content for tippy tooltip (#23649) - * Fix new issue/pull request btn margin when it is next to sort (#23647) - * Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626) - * Allow new file and edit file preview if it has editable extension (#23624) - * Replace a few fontawesome icons with svg (#23602) - * `Publish Review` buttons should indicate why they are disabled (#23598) - * Convert issue list checkboxes to native (#23596) - * Set opaque background on markup and images (#23578) - * Use a general approach to show tooltip, fix temporary tooltip bug (#23574) - * Improve `<SvgIcon>` to make it output `svg` node and optimize performance (#23570) - * Enable color for consistency checks diffs (#23563) - * Fix dropdown icon misalignment when using fomantic icon (#23558) - * Decouple the issue-template code from comment_tab.tmpl (#23556) - * Remove `id="comment-form"` dead code, fix tag (#23555) - * Diff improvements (#23553) - * Sort Python package descriptors by version to mimic PyPI format (#23550) - * Use a general approch to improve a11y for all checkboxes and dropdowns. (#23542) - * Fix long name ui issues and label ui issue (#23541) - * Return `repository` in npm package metadata endpoint (#23539) - * Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538) - * Remove stars in dashboard repo list (#23530) - * Update mini-css-extract-plugin, remove postcss (#23520) - * Change `Close` to either `Close issue` or `Close pull request` (#23506) - * Fix theme-auto loading (#23504) - * Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) - * Display the version of runner in the runner list (#23490) - * Replace Less with CSS (#23481) - * Fix `.locale.Tr` function not found in delete modal (#23468) - * Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) - * Add project type descriptions in issue badge and improve project icons (#23437) - * Use context for `RepositoryList.LoadAttributes` (#23435) - * Refactor branch/tag selector to Vue SFC (#23421) - * Keep (add if not existing) xmlns attribute for generated SVG images (#23410) - * Refactor dashboard repo list to Vue SFC (#23405) - * Add workflow error notification in ui (#23404) - * Refactor branch/tag selector dropdown (first step) (#23394) - * Reduce duplicate and useless code in options (#23369) - * Convert `<div class="button">` to `<button class="button">` (#23337) - * Add path prefix to ObjectStorage.Iterator (#23332) - * Improve cache context (#23330) - * Move pidfile creation from setting to web cmd package (#23285) - * Fix tags view (#23243) - * Add commit info in action page (#23210) - * Support paste treepath when creating a new file or updating the file name (#23209) - * Allow skipping forks and mirrors from being indexed (#23187) - * Use context parameter in services/repository (#23186) - * Hide target selector if tag exists when creating new release (#23171) - * Improve FindProjects (#23085) - * Clean Path in Options (#23006) - * Add margin top to the top of branches (#23002) - * Remove unnecessary and incorrect `find('.menu').toggle()` (#22987) - * Improve GetBoards and getDefaultBoard (#22981) - * Improve squash merge commit author and co-author with private emails (#22977) - * Add --quiet option to gitea dump (#22969) - * Add pagination for dashboard and user activity feeds (#22937) - * Handle files starting with colons in WalkGitLog (#22935) - * Add "Reviewed by you" filter for pull requests (#22927) - * Parse external request id from request headers, and print it in access log (#22906) - * Replace `repo.namedBlob` by `git.TreeEntry`. (#22898) - * Pull Requests: add button to compare force pushed commits (#22857) - * Fix pull request update showing too many commits with multiple branches (#22856) - * Require approval to run actions for fork pull request (#22803) - * Projects: rename Board to Column in interface and improve consistency (#22767) - * Add user visibility in dashboard navbar (#22747) - * Add .livemd as a markdown extension (#22730) - * Clean up WebAuthn javascript code and remove JQuery code (#22697) - * Merge message template support for rebase without merge commit (#22669) - * Show editorconfig warnings when viewing a malformed editorconfig (#21257) - * Npm packages: set repository link based on the url in package.json (#20379) -* BUGFIXES - * Add support for different Maven POM encoding (#25873) (#25890) - * Fix incorrect repo url when changed the case of ownername (#25733) (#25881) - * Fix empty project displayed in issue sidebar (#25802) (#25854) - * Show correct SSL Mode on "install page" (#25818) (#25838) - * Fix the error message when the token is incorrect (#25701) (#25836) - * Fix incorrect oldest sort in project list (#25806) (#25835) - * For API attachments, use API URL (#25639) (#25814) - * Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809) - * Make "install page" respect environment config (#25648) (#25799) - * Fix activity type match in `matchPullRequestEvent` (#25746) (#25796) - * Fix notification list bugs (#25781) (#25787) - * Revert package access change from #23879 (#25707) (#25785) - * Check `ctx.Written()` for `GetActionIssue` (#25698) (#25711) - * Fix position of org follow button (#25688) (#25692) - * Fix the nil pointer when assigning issues to projects (#25665) (#25677) - * Log the real reason when authentication fails (but don't show the user) (#25414) (#25660) - * Fix bug when change user name (#25637) (#25646) - * Make "cancel" buttons have proper type in modal forms (#25618) (#25641) - * Use AfterCommitId to get commit for Viewed functionality (#25529) (#25612) - * Fix bug of branches API with tests(#25578) (#25579) - * Fix content holes in Actions task logs file (#25560) (#25566) - * Fix bugs related to notification endpoints (#25548) (#25562) - * Add Adopt repository event and handler (#25497) (#25518) - * Improve wiki sidebar and TOC (#25460) (#25477) - * Make "dismiss" content shown correctly (#25461) (#25465) - * Change default email domain for LDAP users (#25425) (#25434) - * Fix missing commit message body when the message has leading newlines (#25418) (#25422) - * Fix LDAP sync when Username Attribute is empty (#25278) (#25379) - * Fetch all git data for embedding correct version in docker image (#25361) (#25373) - * Fix incorrect actions ref_name (#25358) (#25367) - * Write absolute AppDataPath to app.ini when installing (#25331) (#25347) - * Fix incorrect config argument position for builtin SSH server (#25341) - * Remove EasyMDE focus outline on text (#25328) (#25332) - * Fix displayed RPM repo url (#25310) (#25313) - * Fix index generation parallelly failure (#25235) (#25269) - * Fix panic when migrating a repo from GitHub with issues (#25246) (#25247) - * Fix task list checkbox toggle to work with YAML front matter (#25184) (#25227) - * Fix compatible for webhook ref type (#25195) (#25223) - * Hide limited users if viewed by anonymous ghost (#25214) (#25220) - * Do not overwrite the log mode when installing (#25203) (#25209) - * Fix fullscreen for action (#25200) (#25207) - * Add `WithPullRequest` for `actionsNotifier` (#25144) (#25197) - * Fix `MilestoneIDs` when querying issues (#25125) (#25141) - * Fix incorrect git ignore rule and add missing license files (#25135) (#25138) - * Remove incorrect element ID on "post-install" page (#25104) (#25129) - * Fix 500 error caused by notifications without an issue such as repo transfers (#25101) - * Help to recover from corrupted levelqueue (#24912) - * Fix 500 error when select `No assignee` filter in issue list page (#24854) - * Add validations.required check to dropdown field (#24849) - * Reenable creating default webhooks. (#24626) - * Fix incorrect user visibility (#24557) - * Fix commits pushed with deploy keys not shown in dashboard (#24521) - * Check length of `LogIndexes` in case it is outdated (#24516) - * Fix incorrect CurrentUser check for docker rootless (#24441) - * Fix some mistakes when using `ignSignIn` (#24415) - * Fix incorrect CORS response in Http Git handler (#24303) - * Fix issue attachment handling (#24202) - * Make mention autocomplete case insensitive in new markdown editor (#24190) - * Use 1.18's aria role for dropdown menus (#24144) - * Fix internal sever error when visiting a PR that bound to the deleted team (#24127) - * Add migration to fix external unit access mode of owner/admin team (#24117) - * Show friendly 500 error page to users and developers (#24110) - * Fix meilisearch not working when searching across multiple repositories (#24109) - * Fix math and mermaid rendering bugs (#24049) - * Remove "inverted" class on creating new label and cancel buttons (#24030) - * Allow repo admins too to delete the repo (#23940) - * Disable editing tags (#23883) - * Fix review conversation reply (#23846) - * Fix incorrect CORS failure detection logic (#23844) - * Remove incorrect HTML self close tag (#23748) - * Fix incorrect `toggle` buttons (#23676) - * Introduce path Clean/Join helper functions (#23495) - * Fix missed migration in #22235 (#23482) - * Do not store user projects as organization projects (#23353) - * Fix incorrect display for comment context menu (#23343) - * Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245) - * Fix submit button won't refresh in New Repository Fork page (#22994) - * Remove stars when repo goes private (#19904) -* TESTING - * Add unit test for repository collaboration (#25640) (#25658) - * Add missing test case and fix typo in tests (#24915) - * Kd/fix redis unit test (#24650) - * Add owner team permission check test (#24096) - * Test renderReadmeFile (#23185) - * Add default owner team to privated_org and limited_org in unit test (#23109) - * Speed up HasUserStopwatch & GetActiveStopwatch (#23051) - * Remove all package data after tests (#22984) -* TRANSLATION - * Backport locales to v1.20 (#25899) - * Translate untranslated string in issues list (#25759) (#25761) - * Remove broken translations (#25737) - * Show correct naming for 1 comment (#25704) (#25712) - * Add Chinese documentations for Actions (#24902) - * Change `valid_until` translation to `valid_until_date` and include placeholder for the date (#24563) - * Change `add_on` translation to `added_on` and include placeholder for the date (#24562) - * Change `join_on` translation to `joined_on` and include placeholder for the date (#24550) - * Use double quotes consistently in en-US (#24141) - * Clarify Gitea/Crowdin locale behaviors, add tests for LocaleStore, fix some strings with semicolons (#23819) - * Update localization.zh-cn.md (#23448) - * Fix grammar in error message (#23273) -* BUILD - * Correct permissions for `.ssh` and `authorized_keys` (#25721) (#25730) - * Upgrade snap to node 20 (#24990) - * Use Go 1.20 for next release (#24859) - * Ignore build for docs only (#24761) - * Update cron-translations.yml (#24708) - * Update to Alpine 3.18 (#24700) - * Check latest version on CI (#24556) - * Upgrade to Node 20 on CI, enable actions cancellation (#24524) - * Mark `/templates/swagger/v1_json.tmpl` as generated file (#24306) - * Enable forbidigo linter (#24278) - * Introduce lint-md and compliance-docs pipeline (#24021) - * Add eslint-plugin-custom-elements (#23991) - * Update eslints for Vue 3 (#23935) - * Improve backport-locales.go (#23807) - * Don't run unnecessary steps when only docs changed (#23103) -* DOCS - * Docs: rootless docker ssh's default port is 2222 (#25771) (#25772) - * Add documentation about supported workflow trigger events (#25582) (#25589) - * Document creating an API key from the CLI (#25504) - * Use the new download domain replace the old (#25405) (#25409) - * Add Exoscale to installation on cloud provider docs (#25342) (#25346) - * Improve some documents: release version, logging, NFS lock (#25202) (#25204) - * Change branch name from master to main in some documents' links (#25126) (#25140) - * Introduce how to configure cache when starting a Runner with Docker (#25077) - * Docs: remove an extraneous whitespace (#24949) - * Update Asciidoc markup example with safe defaults (#24920) - * Fix \<empty\> in administration/config-cheat-sheet.en-us.md (#24905) - * Rename docs packages title from xxx Packages Repository -> xxx Package Registry (#24895) - * Replace `drone exec` to `act_runner exec` in test README.md (#24791) - * Update packages overview page (#24730) - * Docs for creating a user to run Gitea on Fedora/RHEL/CentOS (#24725) - * Move actions as usage's subdirectory and update comparsion zh-cn version (#24719) - * Document `redis-cluster` explicitly in config (#24717) - * Improve reverse-proxy document and fix nginx config bug (#24616) - * Fix broken `README` link (#24546) - * Update `CONTRIBUTING.md` (#24492) - * Docs for Gitea Actions (#24405) - * Zh-cn support on doc pages (#24166) - * Fix https setup doc zh-cn (#24015) - * Adjust some documentations titles (#23941) - * More specific and unique feed name for NuGet install command template. (#23889) - * Clarify that Gitea requires JavaScript (#23677) - * Rename develop -> development, contribute -> contributing, administer -> administration (#23662) - * Update PR documentation (#23620) - * Add package registry architecture overview (#23445) - * Add gradle samples in maven doc of packages (#23374) - * Improve the frontend guideline (#23298) - * Add document for `webcomponents` (#23261) - * Add Gitea Community Code of Conduct (#23188) - * Avoid Hugo from adding quote to actions url (#23097) - * Improve reverse proxies documentation (#23068) - * Docs: HTTPS configuration for zh-cn (#23039) -* MISC - * Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567) (#25576) - * Align language menu icon and fit the footer area (#25556) (#25563) - * Fix sub-command log level (#25537) (#25553) - * Fix admin-dl-horizontal (#25512) (#25535) - * Fix input `line-height` cutting off `g` (#25334) (#25533) - * Clarify the reason why the user can't add a new email if there is a pending activation (#25509) (#25514) - * Improve loadprojects for issue list (#25468) (#25493) - * Use "utf8mb4" for MySQL by default (#25432) - * Show outdated comments in files changed tab (#24936) (#25428) - * Avoid polluting config file when "save" (#25395) (#25406) - * Fix blank dir message when uploading files from web editor (#25391) (#25400) - * Fix issue filters on mobile view (#25368) (#25371) - * Avoid polluting the config (#25345) (#25354) - * Fix action runner last online state on edit page (#25337) - * Remove fomantic inverted variations (#25286) (#25289) - * Show OAuth2 errors to end users (#25261) (#25271) - * Fix profile render when the README.md size is larger than 1024 bytes (#25270) - * Fix strange UI behavior of cancelling dismiss review modal (#25172) - * Update js dependencies (#25137) (#25151) - * Fix swagger documentation for multiple files API endpoint (#25110) - * Fix link to customizing-gitea (#25056) - * Add Link to Stars and Forks Page to Repo List (#24931) - * Improve confusable character string (#24911) - * Fix install page context, make the install page tests really test (#24858) - * Add gitea manager reload-templates command (#24843) - * Create pull request for base after editing file, if not enabled on fork (#24841) - * Fix video width overflow in markdown, and other changes to match img (#24834) - * Support Copy Link for video attachments (#24833) - * Improve accessibility when (re-)viewing files (#24817) - * Update JS dependencies (#24815) - * Bump vm2 from 3.9.17 to 3.9.18 (#24742) - * Add IsErrRepoFilesAlreadyExist check when fork repo (#24678) - * Fix typo in act-runner file (#24652) - * Do not send "registration success email" for external auth sources (#24632) - * Filter get single commit (#24613) - * Make diff view full width again (#24598) - * Add permission check for moving issue action in project view page (#24589) - * Revert "Prevent a user with a different email from accepting the team invite" (#24531) - * Temporarily disable PATs until next release (#24527) - * Clean up polluted styles and remove dead CSS code (#24497) - * Faster git.GetDivergingCommits (#24482) - * Fix test delivery button in repo webhook settings page (#24478) - * Use globally shared HTMLRender (#24436) - * Changelog 1.19.2 (#24365) (#24403) - * Fix layouts of admin table / adapt repo / email test (#24370) - * Gitea Actions add `base_ref`, `head_ref`, `api_url`, `ref_type` fields (#24356) - * Fix 404 error when leaving the last private org team (#24322) - * Improve External Wiki in Repo Header (#24304) - * Updated upgrade script that is informing user that Gitea service has to be running in order to upgrade it (#24260) - * Add run status in action view page (#24223) - * Update JS dependencies (#24218) - * Bump vm2 from 3.9.15 to 3.9.16 (#24089) - * Update github.com/google/go-github to v51 (#23946) - * Show visibility status of email in own profile (#23900) - * Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) - * Add self to maintainers (#23644) - * Upgrade to npm lockfile v3 and explicitely set it (#23561) - * Improve indices for `action` table (#23532) - * Update JS dependencies, Require Node.js 16 (#23528) - * Add init file for Ubuntu (#23362) - * Update go.mod dependencies (#23126) - * Use minio/sha256-simd for accelerated SHA256 (#23052) - * More detailed branch delete message (#22696) - * Add tooltips to `Hide comment type` settings where necessary (#21306) - -## [1.19.4](https://github.com/go-gitea/gitea/releases/tag/v1.19.4) - 2023-07-04 - -* SECURITY - * Fix open redirect check for more cases (#25143) (#25155) -* API - * Return `404` in the API if the requested webhooks were not found (#24823) (#24830) - * Fix `organization` field being `null` in `GET /api/v1/teams/{id}` (#24694) (#24696) -* ENHANCEMENTS - * Set `--font-weight-bold` to 600 (#24840) - * Make mailer SMTP check have timed context (#24751) (#24759) - * Do not select line numbers when selecting text from the action run logs (#24594) (#24596) -* BUGFIXES - * Fix bug when change user name (#25637) (#25645) - * Fix task list checkbox toggle to work with YAML front matter (#25184) (#25236) - * Hide limited users if viewed by anonymous ghost (#25214) (#25224) - * Add `WithPullRequest` for `actionsNotifier` (#25144) (#25196) - * Fix parallelly generating index failure with Mysql (#24567) (#25081) - * GitLab migration: Sanitize response for reaction list (#25054) (#25059) - * Fix users cannot visit issue attachment bug (#25019) (#25027) - * Fix missing reference prefix of commits when sync mirror repository (#24994) - * Only validate changed columns when update user (#24867) (#24903) - * Make DeleteIssue use correct context (#24885) - * Fix topics deleted via API not being deleted in org page (#24825) (#24829) - * Fix Actions being enabled accidentally (#24802) (#24810) - * Fix missed table name on iterate lfs meta objects (#24768) (#24774) - * Fix safari cookie session bug (#24772) - * Respect original content when creating secrets (#24745) (#24746) - * Fix Pull Mirror out-of-sync bugs (#24732) (#24733) - * Fix run list broken when trigger user deleted (#24706) (#24709) - * Fix issues list page multiple selection update milestones (#24660) (#24663) - * Fix: release page for empty or non-existing target (#24659) - * Fix close org projects (#24588) (#24591) - * Refresh the refernce of the closed PR when reopening (#24231) (#24587) - * Fix the permission of team's `Actions` unit issue (#24536) (#24545) - * Bump go.etcd.io/bbolt and blevesearch deps (#23062) (#24519) - * Fix new wiki page mirror (#24518) - * Match unqualified references when syncing pulls as well (#23070) -* DOCS - * Change branch name from master to main in some documents' links (#25126) (#25139) - * Remove unnecessary content on docs (#24976) (#25001) - * Unify doc links to use paths relative to doc folder (#24979) (#25000) - * Fix docs documenting invalid `@every` for `OLDER_THAN` cron settings (#24695) (#24698) -* MISC - * Merge different languages for language stats (#24900) (#24921) - * Hiding Secrets options when Actions feature is disabled (#24792) - * Improve decryption failure message (#24573) (#24575) - * Makefile: Use portable !, not GNUish -not, with find(1). (#24565) (#24572) - -## [1.19.3](https://github.com/go-gitea/gitea/releases/tag/1.19.3) - 2023-05-03 - -* SECURITY - * Use golang 1.20.4 to fix CVE-2023-24539, CVE-2023-24540, and CVE-2023-29400 -* ENHANCEMENTS - * Enable whitespace rendering on selection in Monaco (#24444) (#24485) - * Improve milestone filter on issues page (#22423) (#24440) -* BUGFIXES - * Fix api error message if fork exists (#24487) (#24493) - * Fix user-cards format (#24428) (#24431) - * Fix incorrect CurrentUser check for docker rootless (#24435) - * Getting the tag list does not require being signed in (#24413) (#24416) - -## [1.19.2](https://github.com/go-gitea/gitea/releases/tag/1.19.2) - 2023-04-26 - -* SECURITY - * Require repo scope for PATs for private repos and basic authentication (#24362) (#24364) - * Only delete secrets belonging to its owner (#24284) (#24286) -* API - * Fix typo in API route (#24310) (#24332) - * Fix access token issue on some public endpoints (#24194) (#24259) -* ENHANCEMENTS - * Fix broken clone script on an empty archived repo (#24339) (#24348) - * Fix Monaco IOS keyboard button (#24341) (#24347) - * Don't set meta `theme-color` by default (#24340) (#24346) - * Wrap too long push mirror addresses (#21120) (#24334) - * Add --font-weight-bold and set previous bold to 601 (#24307) (#24331) - * Unify nightly naming across binaries and docker images (#24116) (#24308) - * Fix footer display (#24251) (#24269) - * Fix label color, fix divider in dropdown (#24215) (#24244) - * Vertical widths of containers removed (#24184) (#24211) - * Use correct locale key for forks page (#24172) (#24175) - * Sort repo topic labels by name (#24123) (#24153) - * Highlight selected file in the PR file tree (#23947) (#24126) -* BUGFIXES - * Fix auth check bug (#24382) (#24387) - * Add tags list for repos whose release setting is disabled (#23465) (#24369) - * Fix wrong error info in RepoRefForAPI (#24344) (#24351) - * Fix no edit/close/delete button in org repo project view page (#24349) - * Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035) (#24333) - * Remove org users who belong to no teams (#24247) (#24313) - * Fix bug when deleting wiki with no code write permission (#24274) (#24295) - * Handle canceled workflow as a warning instead of a fail (#24282) (#24292) - * Load reviewer for comments when dismissing a review (#24281) (#24288) - * Show commit history for closed/merged PRs (#24238) (#24261) - * Fix owner team access mode value in team_unit table (#24224) - * Fix issue attachment handling (#24202) (#24221) - * Fix incorrect CORS default values (#24206) (#24217) - * Fix template error in pull request with deleted head repo (#24192) (#24216) - * Don't list root repository on compare page if pulls not allowed (#24183) (#24210) - * Fix calReleaseNumCommitsBehind (#24148) (#24197) - * Fix Org edit page bugs: renaming detection, maxlength (#24161) (#24171) - * Update redis library to support redis v7 (#24114) (#24156) - * Use 1.18's aria role for dropdown menus (#24144) (#24155) - * Fix 2-dot direct compare to use the right base commit (#24133) (#24150) - * Fix incorrect server error content in RunnersList (#24118) (#24121) - * Fix mismatch between hook events and github event types (#24048) (#24091) -* BUILD - * Support converting varchar to nvarchar for mssql database (#24105) (#24168) - -## [1.19.1](https://github.com/go-gitea/gitea/releases/tag/v1.19.1) - 2023-04-12 - -* BREAKING - * Rename actions unit to `repo.actions` and add docs for it (#23733) (#23881) -* ENHANCEMENTS - * Add card type to org/user level project on creation, edit and view (#24043) (#24066) - * Refactor commit status for Actions jobs (#23786) (#24060) - * Show errors for KaTeX and mermaid on the preview tab (#24009) (#24019) - * Show protected branch rule names again (#23907) (#24018) - * Adjust sticky PR header to cover background (#23956) (#23999) - * Discolor pull request tab labels (#23950) (#23987) - * Treat PRs with agit flow as fork PRs when triggering actions. (#23884) (#23967) - * Left-align review comments (#23937) - * Fix image border-radius (#23886) (#23930) - * Scroll collapsed file into view (#23702) (#23929) - * Fix code view (diff) broken layout (#23096) (#23918) - * Org pages style fixes (#23901) (#23914) - * Fix user profile description rendering (#23882) (#23902) - * Fix review box viewport overflow issue (#23800) (#23898) - * Prefill input values in OAuth settings as intended (#23829) (#23871) - * CSS color tweaks (#23828) (#23842) - * Fix incorrect visibility dropdown list in add/edit user page (#23804) (#23833) - * Add CSS rules for basic colored labels (#23774) (#23777) - * Add creation time in tag list page (#23693) (#23773) - * Fix br display for packages curls (#23737) (#23764) - * Fix issue due date edit toggle bug (#23723) (#23758) - * Improve commit graph page UI alignment (#23751) (#23754) - * Use GitHub Actions compatible globbing for `branches`, `tag`, `path` filter (#22804) (#23740) - * Redirect to project again after editing it (#23326) (#23739) - * Remove row clicking from notification table (#22695) (#23706) - * Remove conflicting CSS rules on notifications, improve notifications table (#23565) (#23621) - * Fix diff tree height and adjust target file style (#23616) -* BUGFIXES - * Improve error logging for LFS (#24072) (#24082) - * Fix custom mailer template on Windows platform (#24081) - * Update the value of `diffEnd` when clicking the `Show More` button in the DiffFileTree (#24069) (#24078) - * Make label templates have consistent behavior and priority (#23749) - * Fix accidental overwriting of LDAP team memberships (#24050) (#24065) - * Fix branch protection priority (#24045) (#24061) - * Use actions job link as commit status URL instead of run link (#24023) (#24032) - * Add actions support to package auth verification (#23729) (#24028) - * Fix protected branch for API (#24013) (#24027) - * Do not escape space between PyPI repository URL and package name… (#23981) (#24008) - * Fix redirect bug when creating issue from a project (#23971) (#23997) - * Set `ref` to fully-formed of the tag when trigger event is `release` (#23944) (#23989) - * Use Get/Set instead of Rename when regenerating session ID (#23975) (#23983) - * Ensure RSS icon is present on all repo tabs (#23904) (#23973) - * Remove `Repository.getFilesChanged` to fix Actions `paths` and `paths-ignore` filter (#23920) (#23969) - * Delete deleted release attachments immediately from storage (#23913) (#23958) - * Use ghost user if package creator does not exist (#23822) (#23915) - * User/Org Feed render description as per web (#23887) (#23906) - * Fix `cases.Title` crash for concurrency (#23885) (#23903) - * Convert .Source.SkipVerify to $cfg.SkipVerify (#23839) (#23899) - * Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) (#23878) - * Fix JS error when changing PR's target branch (#23862) (#23864) - * Fix 500 error if there is a name conflict when editing authentication source (#23832) (#23852) - * Fix closed PR also triggers Webhooks and actions (#23782) (#23834) - * Fix checks for `needs` in Actions (#23789) (#23831) - * Fix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790) (#23825) - * Fix cancel button in the page of project edit not work (#23655) (#23813) - * Don't apply the group filter when listing LDAP group membership if it is empty (#23745) (#23788) - * Fix profile page email display, respect settings (#23747) (#23756) - * Fix project card preview select and template select (#23684) (#23731) - * Check LFS/Packages settings in dump and doctor command (#23631) (#23730) - * Add git dashes separator to some "log" and "diff" commands (#23606) (#23720) - * Create commit status when event is `pull_request_sync` (#23683) (#23691) - * Fix incorrect `HookEventType` of pull request review comments (#23650) (#23678) - * Fix incorrect `show-modal` and `show-panel` class (#23660) (#23663) - * Improve workflow event triggers (#23613) (#23648) - * Introduce path Clean/Join helper functions, partially backport&refactor (#23495) (#23607) - * Fix pagination on `/notifications/watching` (#23564) (#23603) - * Fix submodule is nil panic (#23588) (#23601) - * Polyfill the window.customElements (#23592) (#23595) - * Avoid too long names for actions (#23162) (#23190) -* TRANSLATION - * Backport locales (with manual fixes) (#23808, #23634, #24083) -* BUILD - * Hardcode the path to docker images (#23955) (#23968) -* DOCS - * Update documentation to explain which projects allow Gitea to host static pages (#23993) (#24058) - * Merge `push to create`, `open PR from push`, and `push options` docs articles into one (#23744) (#23959) - * Fix code blocks in the cheat sheet (#23664) (#23669) -* MISC - * Do not crash when parsing an invalid workflow file (#23972) (#23976) - * Remove assertion debug code for show/hide refactoring (#23576) (#23868) - * Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) (#23791) - * Make minio package support legacy MD5 checksum (#23768) (#23770) - * Improve template error reporting (#23396) (#23600) - -## [1.19.0](https://github.com/go-gitea/gitea/releases/tag/v1.19.0) - 2023-03-19 - -* BREAKING - * Add loading yaml label template files (#22976) (#23232) - * Make issue and code search support camel case for Bleve (#22829) - * Repositories: by default disable all units except code and pulls on forks (#22541) - * Support template for merge message description (#22248) - * Remove ONLY_SHOW_RELEVANT_REPOS setting (#21962) - * Implement actions (#21937) - * Remove deprecated DSA host key from Docker Container (#21522) - * Improve valid user name check (#20136) -* SECURITY - * Return 404 instead of 403 if user can not access the repo (#23155) (#23158) - * Support scoped access tokens (#20908) -* FEATURES - * Add support for commit cross references (#22645) - * Scoped labels (#22585) - * Add Chef package registry (#22554) - * Support asciicast files as new markup (#22448) - * cgo cross-compile for freebsd (#22397) - * Add cron method to gc LFS MetaObjects (#22385) - * Add new captcha: cloudflare turnstile (#22369) - * Enable `@<user>`- completion popup on the release description textarea (#22359) - * make /{username}.png redirect to user/org avatar (#22356) - * Add Conda package registry (#22262) - * Support org/user level projects (#22235) - * Add Mermaid copy button (#22225) - * Add user secrets (#22191) - * Secrets storage with SecretKey encrypted (#22142) - * Preview images for Issue cards in Project Board view (#22112) - * Add support for incoming emails (#22056) - * Add Cargo package registry (#21888) - * Add option to prohibit fork if user reached maximum limit of repositories (#21848) - * Add attention blocks within quote blocks for `Note` and `Warning` (#21711) - * Add Feed for Releases and Tags (#21696) - * Add package registry cleanup rules (#21658) - * Add "Copy" button to file view of raw text (#21629) - * Allow disable sitemap (#21617) - * Add package registry quota limits (#21584) - * Map OIDC groups to Orgs/Teams (#21441) - * Keep languages defined in .gitattributes (#21403) - * Add Webhook authorization header (#20926) - * Supports wildcard protected branch (#20825) - * Copy citation file content, in APA and BibTex format, on repo home page (#19999) -* API - * Match api migration behavior to web behavior (#23552) (#23573) - * Purge API comment (#23451) (#23452) - * User creation API: allow custom "created" timestamps (#22549) - * Add `updated_at` field to PullReview API object (#21812) - * Add API management for issue/pull and comment attachments (#21783) - * Add API endpoint to get latest release (#21267) - * Support system hook API (#14537) -* ENHANCEMENTS - * Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) - * Fix sticky header in diff view (#23554) (#23568) - * Refactor merge/update git command calls (#23366) (#23544) - * Fix review comment context menu clipped bug (#23523) (#23543) - * Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540) - * Increase horizontal page padding (#23507) (#23537) - * Use octicon-verified for gpg signatures (#23529) (#23536) - * Make time tooltips interactive (#23526) (#23527) - * Replace Less with CSS (#23508) - * Fix 'View File' button in code search (#23478) (#23483) - * Convert GitHub event on actions and fix some pull_request events. (#23037) (#23471) - * Support reflogs (#22451) (#23438) - * Fix actions frontend bugs (pagination, long name alignment) and small simplify (#23370) (#23436) - * Scoped label display and documentation tweaks (#23430) (#23433) - * Add missing tabs to org projects page (#22705) (#23412) - * Fix and move "Use this template" button (#23398) (#23408) - * Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397) (#23403) - * Rename `canWriteUnit` to `canWriteProjects` (#23386) (#23399) - * Refactor and tidy-up the merge/update branch code (#22568) (#23365) - * Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) - * Fix incorrect project links and use symlink icon for org-wide projects (#23325) (#23336) - * Fix PR view misalignment caused by long name file (#23321) (#23335) - * Scoped labels: don't require holding alt key to remove (#23303) (#23331) - * Add context when rendering labels or emojis (#23281) (#23319) - * Change interactiveBorder to fix popup preview (#23169) (#23314) - * Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311) - * update to mermaid v10 (#23178) (#23299) - * Fix code wrap for unbroken lines (#23268) (#23293) - * Use async await to fix empty quote reply at first time (#23168) (#23256) - * Fix switched citation format (#23250) (#23253) - * Allow `<video>` in MarkDown (#22892) (#23236) - * Order pull request conflict checking by recently updated, for each push (#23220) (#23225) - * Fix Fomantic UI's `touchstart` fastclick, always use `click` for click events (#23065) (#23195) - * Add word-break to sidebar-item-link (#23146) (#23180) - * Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177) - * Fix height for sticky head on large screen on PR page (#23111) (#23123) - * Change style to improve whitespaces trimming inside inline markdown code (#23093) (#23120) - * Avoid warning for system setting when start up (#23054) (#23116) - * Add accessibility to the menu on the navbar (#23059) (#23095) - * Improve accessibility for issue comments (#22612) (#23083) - * Remove delete button for review comment (#23036) - * Remove dashes between organization member avatars on hover (#23034) - * Use `gt-relative` class instead of the ambiguous `gt-pr` class (#23008) - * handle deprecated settings (#22992) - * Add scopes to API to create token and display them (#22989) - * Improve PR Review Box UI (#22986) - * Improve issues.LoadProject (#22982) - * Add all units to the units permission list in org team members sidebar (#22971) - * Rename `GetUnits` to `LoadUnits` (#22970) - * Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) - * Rename "People" to "Members" in organization page and use a better icon (#22960) - * Fix avatar misalignment (#22955) - * Sort issues and pulls by recently updated in user and organization home (#22925) - * Add `title` to PR file tree items (#22918) - * First step to refactor the `.hide` to `.gt-hidden` (#22916) - * Add tooltip to issue reference (#22913) - * Always show the `command line instructions` button even if there are conflicts (#22909) - * Fix dark-colored description text in arc-green theme (#22908) - * Remove Fomantic-UI's `.hidden` CSS class for menu elements (#22895) - * Move helpers to be prefixed with `gt-` (#22879) - * Move `IsReadmeFile*` from `modules/markup/` to `modules/util` (#22877) - * Highlight focused diff file (#22870) - * Add some headings to repo views (#22869) - * Fix milestone title font problem (#22863) - * Pull Requests: setting to allow edits by maintainers by default, tweak UI (#22862) - * Introduce customized HTML elements, fix incorrect AppUrl usages in templates (#22861) - * Add `/$count` endpoints for NuGet v2 (#22855) - * Remove Fomantic-UI's `.hidden` CSS class for checkbox elements (#22851) - * Fix notification and stopwatch empty states (#22845) - * Always go full width in PR view (#22844) - * Improve AppUrl/ROOT_URL checking (#22836) - * Fix style of actions rerun button (#22835) - * Fix more HTMLURL in templates (#22831) - * Fix inconsistent Filter Project name in issue list (#22827) - * include build info in Prometheus metrics (#22819) - * Make clone URL use current page's host (#22808) - * Refactor legacy strange git operations (#22756) - * Improve error report when user passes a private key (#22726) - * set user dashboard org visibility to basic (#22706) - * Fix diff UI for unexpandable items (#22700) - * Remove 'primary' class from tab counter labels (#22687) - * Add more events details supports for actions (#22680) - * Refactor git command package to improve security and maintainability (#22678) - * Use relative url in actions view (#22675) - * set user visibility class to basic (#22674) - * Add repository setting to enable/disable releases unit (#22671) - * Remove label color from global issue filters (#22660) - * Fix poor alignment of organization description on organization home page (#22656) - * Small refactor for loading PRs (#22652) - * Allow setting access token scope by CLI (#22648) - * Improve accessibility of navigation bar and footer (#22635) - * Fixes accessibility behavior of Watching, Staring and Fork buttons (#22634) - * Fixes accessibility of empty repository commit status (#22632) - * Pull request yaml template support for including commit body in a field (#22629) - * Show migration validation error (#22619) - * set org visibility class to basic in header (#22605) - * Fix cache-control header clearing comment text when editing issue (#22604) - * Add ARIA support for Fomantic UI checkboxes (#22599) - * Add templates to customize text when creating and migrating repositories (#22597) - * Allow setting `redirect_to` cookie on OAuth login (#22594) - * Improve checkbox accessibility a bit by adding the title attribute (#22593) - * Allow issue templates to not render title (#22589) - * Webhooks: for issue close/reopen action, add commit ID that caused it (#22583) - * Fix missing title and filter in issue sidebar project menu (#22557) - * Issues: support setting issue template field values with query (#22545) - * Issues: add Project filter to issues list and search (#22544) - * Pull Requests: add color to approved/reject icon in pull requests list (#22543) - * Mute all links in issue timeline (#22533) - * Dropzone: Add "Copy link" button for new uploads (#22517) - * Support importing comment types (#22510) - * Load asciicast css async (#22502) - * Move delete user to service (#22478) - * Change use of Walk to WalkDir to improve disk performance (#22462) - * Add reply hint to mail text (#22459) - * fix wrong theme class when logged out if default theme is changed (#22408) - * Refactor the setting to make unit test easier (#22405) - * Improve utils of slices (#22379) - * Use context parameter in models/git (#22367) - * Always reuse transaction (#22362) - * Fix unstable emoji sort (#22346) - * Add context cache as a request level cache (#22294) - * Reminder for no more logs to console (#22282) - * Support estimated count with multiple schemas (#22276) - * Move `convert` package to services (#22264) - * Use dynamic package type list (#22263) - * Hide file borders on sticky diff box (#22217) - * Improve notification and stopwatch styles (#22169) - * Fixed Project view .board-column height for tall screens. (#22108) - * Use multi reader instead to concat strings (#22099) - * Use git command instead of exec.Cmd in blame (#22098) - * Fix autofilled text visibility in dark mode (#22088) - * Rename almost all Ctx functions (#22071) - * Rename actions to operations on UI (#22067) - * refactor bind functions based on generics (#22055) - * Support disabling database auto migration (#22053) - * remove duplicated read file code (#22042) - * Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) - * Skip initing disabled storages (#21985) - * Add doctor command for full GC of LFS (#21978) - * Util type to parse ref name (#21969) - * Replace fmt.Sprintf with hex.EncodeToString (#21960) - * Use random bytes to generate access token (#21959) - * Add index for access_token (#21908) - * Move all remaining colors into CSS variables (#21903) - * Webhook list enhancements (#21893) - * Embed Matrix icon as SVG (#21890) - * Remove useless "Cancel" buttons (#21872) - * fix(web): keep the pages of the navigation in the center (#21867) - * fix(web): reduce page jitter on browsers that support overlay scrollbar (#21850) - * Improvements for Content Copy (#21842) - * Tweak katex options (#21828) - * Show syntax lexer name in file view/blame (#21814) - * Remove `href="javascript:;"` in "save topics (Done)" button (#21813) - * Render number of commits in repo page in a user friendly way (#21786) - * Adjust clone timeout error to suggest increasing timeout (#21769) - * Update message of reach_limit_of_creation (#21757) - * Allow detect whether it's in a database transaction for a context.Context (#21756) - * Add configuration for CORS allowed headers (#21747) - * Move svg html render to modules/svg (#21716) - * Release and Tag List tweaks (#21712) - * Remove template previewer (#21701) - * Clean up formatting on install page (#21668) - * Configure update checker on installation page (#21655) - * Merge db.Iterate and IterateObjects (#21641) - * Add option to enable CAPTCHA validation for login (#21638) - * Allow disable RSS/Atom feed (#21622) - * Use CSS color-scheme instead of invert (#21616) - * Localize time units on activity heatmap (#21570) - * Fix UI column width, button overflow Fomantic's grid (#21559) - * feat: notify doers of a merge when automerging (#21553) - * Split migrations folder (#21549) - * feat: add button to quickly clear merge message (#21548) - * Add `context.Context` to more methods (#21546) - * Add index for hook_task table (#21545) - * Allow disable code tab (#20805) -* BUGFIXES - * Fix template error when reference Project (#23584) - * Fix dropdown icon misalignment when using fomantic icon (#23558) (#23577) - * Fix diff detail buttons wrapping, use tippy for review box (#23271) (#23546) - * Handle missing `README` in create repos API (#23387) (#23510) - * Disable sending email after push a commit to a closed PR (#23462) (#23492) - * Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450) (#23486) - * Fix due date being wrong on issue list (#23475) (#23477) - * Remove wrongly added column on migration test fixtures (#23456) (#23470) - * Make branches list page operations remember current page (#23420) (#23460) - * Fix missing commit status in PR which from forked repo (#23351) (#23453) - * Show edit/close/delete button on organization wide repositories (#23388) (#23429) - * Preserve file size when creating attachments (#23406) (#23426) - * Fix broken Chroma CSS styles (#23174) (#23402) - * Fix incorrect NotFound conditions in org/projects.go (#23384) (#23395) - * Set `X-Gitea-Debug` header once (#23361) (#23381) - * Pass context to avatar for projects view (#23359) (#23378) - * Fix panic when getting notes by ref (#23372) (#23377) - * Do not recognize text files as audio (#23355) (#23368) - * Fix adding of empty class name (#23352) (#23360) - * Fix various ImageDiff/SVG bugs (#23312) (#23358) - * Fix incorrect display for comment context menu (#23343) (#23344) - * Remove unnecessary space on link (#23334) (#23340) - * Fix incorrect redirect link of delete org project (#23327) (#23339) - * Fix cannot reopen after pushing commits to a closed PR (#23189) (#23324) - * Fix broken code editor diff preview (#23307) (#23320) - * Support sanitising the URL by removing extra slashes in the URL (#21333) (#23300) - * Avoid panic caused by broken payload when creating commit status (#23216) (#23294) - * Fill head commit to in payload when notifying push commits for mirroring (#23215) (#23292) - * Fix various bugs for "install" page (#23194) (#23286) - * Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23279) - * Revert relative links to absolute links in mail templates (#23267) (#23269) - * Fix commit retrieval by tag (#21804) (#23266) - * Use correct README link to render the README (#23152) (#23264) - * Close the temp file when dumping database to make the temp file can be deleted on Windows (#23249) (#23251) - * Use the correct selector to hide the checkmark of selected labels on clear (#23224) (#23228) - * Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) (#23205) - * Properly flush unique queues on startup (#23154) (#23201) - * Pass `--global` when calling `git config --get`, for consistency with `git config --set` (#23157) (#23199) - * Make `gitea serv` respect git binary home (#23138) (#23197) - * Change button text for commenting and closing an issue at the same time (#23135) (#23182) - * Fix DBConsistency checks on MSSQL (#23132) (#23134) - * Show empty repos in Admin Repository Management page (#23114) (#23130) - * Redirect to the commit page after applying patch (#23056) (#23127) - * Fix nil context in RenderMarkdownToHtml (#23092) (#23108) - * Make issue meta dropdown support Enter, confirm before reloading (#23014) (#23102) - * Fix SyncOnCommit always return false in API of push_mirrors (#23088) (#23100) - * Fix commit name in Apply Patch page (#23086) (#23099) - * Fix some more hidden problems (#23074) (#23075) - * Bump golang.org/x/net from 0.4.0 to 0.7.0 (#22980) - * Get rules by id when editing branch protection rule (#22932) - * Fix panic when call api (/repos/{owner}/{repo}/pulls/{index}/files) (#22921) - * Increase Content field size of gpg_import_key to MEDIUMTEXT (#22897) - * Fix hidden commit status on multiple checks (#22889) - * Fix update by rebase being wrongly disabled by protected base branch (#22825) - * Make issue title edit buttons focusable and fix incorrect ajax requests (#22807) - * Fix rerun button of Actions (#22798) - * remove update language in ProfilePost (#22748) - * Do not overwrite empty DefaultBranch (#22708) - * Fix ref to trigger Actions (#22679) - * Fix time to NotifyPullRequestSynchronized (#22650) - * Show all projects, not just repo projects and open/closed projects (#22640) - * Project links should use parent link methods (#22587) - * Fix group filter for ldap source sync (#22506) - * Check quota limits for container uploads (#22450) - * Fix halfCommitter and WithTx (#22366) - * Attempt to fix TestExportUserGPGKeys (#22159) - * Fix heatmap first color being unused (#22157) - * Fix scroll over mermaid frame (#21925) - * Move migration test fixtures to the correct directories (#21901) - * fix(web): add `alt` for logo in home page (#21887) - * Fix webhook attachment text is not set in review comment (#21763) - * Alter package_version.metadata_json to LONGTEXT (#21667) - * Ensure that Webhook tasks are not double delivered (#21558) -* TESTING - * Make CI use a dummy password hasher for all tests (#22983) - * Disable test for incoming email (#22686) - * Move fuzz tests into tests/fuzz (#22376) - * Test views of LFS files (#22196) - * Specify ID in `TestAPITeam` (#22192) - * verify nodeinfo response by schema (#22137) - * Skip GitHub migration tests if the API token is undefined (#21824) - * Add a simple test for external renderer (#20033) -* TRANSLATION - * Use "Title Case" for text "Reference in new issue" (#22936) -* BUILD - * Wrap unless-check in docker manifests (#23079) (#23081) - * Adjust manifest to prevent tagging latest on rcs (#22811) - * update to build with go1.20 (#22732) - * Add Bash and Zsh completion scripts (#22646) - * Add Contributed backport command (#22643) - * Remove deprecated packages & staticcheck fixes (#22012) - * Update to Alpine 3.17 (#21904) - * Fix webpack license warning (#21815) -* DOCS - * Update documentation for the new YAML label file format (#23020) (#23341) - * Update hacking-on-gitea-zh_cn documentation (#23315) (#23323) - * Add basic documentation for labels, including scoped labels (#23304) (#23309) - * Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305) - * Fix secrets overview page missing from docs sidebar (#23143) (#23145) - * Add some guidelines for refactoring (#22880) - * Explain that the no-access team unit does not affect public repositories (#22661) - * Fix incorrect Redis URL snippets in the example app.ini (#22573) - * docs: add swagger.json file location to FAQ (#22489) - * Update index.de-de.md (#22363) - * Update Gmail mailer configuration (#22291) - * Add missed reverse proxy authentication documentation (#22250) - * Add plural definitions for German translations (#21802) - * Attempt clarify AppWorkPath etc. (#21656) - * Add some documentation to packages (#21648) -* MISC - * Use `<nav>` instead of `<div>` in the global navbar (#23125) (#23533) - * Do not create commit graph for temporary repos (#23219) (#23229) - * Update button is shown when a Pull Request is marked WIP - Issue #21740 (#22683) - * Add main landmark to templates and adjust titles (#22670) - * Fix error on account activation with wrong passwd (#22609) - * Update JS dependencies (#22538) - * Display unreferenced packages total size in package admin panel (#22498) - * Mobile fix for Project view: Add delay to Sortable.js on mobile, to ensure scrolling is possible. (#22152) - * Update chroma to v2.4.0 (#22000) - * Hide collapse icon in diff with no lines (#21094) - -## [1.18.5](https://github.com/go-gitea/gitea/releases/tag/v1.18.5) - 2023-02-21 - -* ENHANCEMENTS - * Hide 2FA status from other members in organization members list (#22999) (#23023) -* BUGFIXES - * Add force_merge to merge request and fix checking mergable (#23010) (#23032) - * Use `--message=%s` for git commit message (#23028) (#23029) - * Render access log template as text instead of HTML (#23013) (#23025) - * Fix the Manually Merged form (#23015) (#23017) - * Use beforeCommit instead of baseCommit (#22949) (#22996) - * Display attachments of review comment when comment content is blank (#23035) (#23046) - * Return empty url for submodule tree entries (#23043) (#23048) - -## [1.18.4](https://github.com/go-gitea/gitea/releases/tag/1.18.4) - 2023-02-20 - -* SECURITY - * Provide the ability to set password hash algorithm parameters (#22942) (#22943) - * Add command to bulk set must-change-password (#22823) (#22928) -* ENHANCEMENTS - * Use import of OCI structs (#22765) (#22805) - * Fix color of tertiary button on dark theme (#22739) (#22744) - * Link issue and pull requests status change in UI notifications directly to their event in the timelined view. (#22627) (#22642) -* BUGFIXES - * Notify on container image create (#22806) (#22965) - * Fix blame view missing lines (#22826) (#22929) - * Fix incorrect role labels for migrated issues and comments (#22914) (#22923) - * Fix PR file tree folders no longer collapsing (#22864) (#22872) - * Escape filename when assemble URL (#22850) (#22871) - * Fix isAllowed of escapeStreamer (#22814) (#22837) - * Load issue before accessing index in merge message (#22822) (#22830) - * Improve trace logging for pulls and processes (#22633) (#22812) - * Fix restore repo bug, clarify the problem of ForeignIndex (#22776) (#22794) - * Add default user visibility to cli command "admin user create" (#22750) (#22760) - * Escape path for the file list (#22741) (#22757) - * Fix bugs with WebAuthn preventing sign in and registration. (#22651) (#22721) - * Add missing close bracket in imagediff (#22710) (#22712) - * Move code comments to a standalone file and fix the bug when adding a reply to an outdated review appears to not post(#20821) (#22707) - * Fix line spacing for plaintext previews (#22699) (#22701) - * Fix wrong hint when deleting a branch successfully from pull request UI (#22673) (#22698) - * Fix README TOC links (#22577) (#22677) - * Fix missing message in git hook when pull requests disabled on fork (#22625) (#22658) - * Improve checkIfPRContentChanged (#22611) (#22644) - * Prevent duplicate labels when importing more than 99 (#22591) (#22598) - * Don't return duplicated users who can create org repo (#22560) (#22562) -* BUILD - * Upgrade golangcilint to v1.51.0 (#22764) -* MISC - * Use proxy for pull mirror (#22771) (#22772) - * Use `--index-url` in PyPi description (#22620) (#22636) - -## [1.18.3](https://github.com/go-gitea/gitea/releases/tag/v1.18.3) - 2023-01-23 - -* SECURITY - * Prevent multiple `To` recipients (#22566) (#22569) -* BUGFIXES - * Truncate commit summary on repo files table. (#22551) (#22552) - * Mute all links in issue timeline (#22534) - -## [1.18.2](https://github.com/go-gitea/gitea/releases/tag/v1.18.2) - 2023-01-19 - -* BUGFIXES - * Fix issue not auto-closing when it includes a reference to a branch (#22514) (#22521) - * Fix invalid issue branch reference if not specified in template (#22513) (#22520) - * Fix 500 error viewing pull request when fork has pull requests disabled (#22512) (#22515) - * Reliable selection of admin user (#22509) (#22511) - * Set disable_gravatar/enable_federated_avatar when offline mode is true (#22479) (#22496) -* BUILD - * cgo cross-compile for freebsd (#22397) (#22519) - -## [1.18.1](https://github.com/go-gitea/gitea/releases/tag/v1.18.1) - 2023-01-17 - -* API - * Add `sync_on_commit` option for push mirrors api (#22271) (#22292) -* BUGFIXES - * Update `github.com/zeripath/zapx/v15` (#22485) - * Fix pull request API field `closed_at` always being `null` (#22482) (#22483) - * Fix container blob mount (#22226) (#22476) - * Fix error when calculating repository size (#22392) (#22474) - * Fix Operator does not exist bug on explore page with ONLY_SHOW_RELEVANT_REPOS (#22454) (#22472) - * Fix environments for KaTeX and error reporting (#22453) (#22473) - * Remove the netgo tag for Windows build (#22467) (#22468) - * Fix migration from GitBucket (#22477) (#22465) - * Prevent panic on looking at api "git" endpoints for empty repos (#22457) (#22458) - * Fix PR status layout on mobile (#21547) (#22441) - * Fix wechatwork webhook sends empty content in PR review (#21762) (#22440) - * Remove duplicate "Actions" label in mobile view (#21974) (#22439) - * Fix leaving organization bug on user settings -> orgs (#21983) (#22438) - * Fixed colour transparency regex matching in project board sorting (#22092) (#22437) - * Correctly handle select on multiple channels in Queues (#22146) (#22428) - * Prepend refs/heads/ to issue template refs (#20461) (#22427) - * Restore function to "Show more" buttons (#22399) (#22426) - * Continue GCing other repos on error in one repo (#22422) (#22425) - * Allow HOST has no port (#22280) (#22409) - * Fix omit avatar_url in discord payload when empty (#22393) (#22394) - * Don't display stop watch top bar icon when disabled and hidden when click other place (#22374) (#22387) - * Don't lookup mail server when using sendmail (#22300) (#22383) - * Fix gravatar disable bug (#22337) - * Fix update settings table on install (#22326) (#22327) - * Fix sitemap (#22272) (#22320) - * Fix code search title translation (#22285) (#22316) - * Fix due date rendering the wrong date in issue (#22302) (#22306) - * Fix get system setting bug when enabled redis cache (#22298) - * Fix bug of DisableGravatar default value (#22297) - * Fix key signature error page (#22229) (#22230) -* TESTING - * Remove test session cache to reduce possible concurrent problem (#22199) (#22429) -* MISC - * Restore previous official review when an official review is deleted (#22449) (#22460) - * Log STDERR of external renderer when it fails (#22442) (#22444) - -## [1.18.0](https://github.com/go-gitea/gitea/releases/tag/v1.18.0) - 2022-12-29 - -* SECURITY - * Remove ReverseProxy authentication from the API (#22219) (#22251) - * Support Go Vulnerability Management (#21139) - * Forbid HTML string tooltips (#20935) -* BREAKING - * Rework mailer settings (#18982) - * Remove U2F support (#20141) - * Refactor `i18n` to `locale` (#20153) - * Enable contenthash in filename for dynamic assets (#20813) -* FEATURES - * Add color previews in markdown (#21474) - * Allow package version sorting (#21453) - * Add support for Chocolatey/NuGet v2 API (#21393) - * Add API endpoint to get changed files of a PR (#21177) - * Add filetree on left of diff view (#21012) - * Support Issue forms and PR forms (#20987) - * Add support for Vagrant packages (#20930) - * Add support for `npm unpublish` (#20688) - * Add badge capabilities to users (#20607) - * Add issue filter for Author (#20578) - * Add KaTeX rendering to Markdown. (#20571) - * Add support for Pub packages (#20560) - * Support localized README (#20508) - * Add support mCaptcha as captcha provider (#20458) - * Add team member invite by email (#20307) - * Added email notification option to receive all own messages (#20179) - * Switch Unicode Escaping to a VSCode-like system (#19990) - * Add user/organization code search (#19977) - * Only show relevant repositories on explore page (#19361) - * User keypairs and HTTP signatures for ActivityPub federation using go-ap (#19133) - * Add sitemap support (#18407) - * Allow creation of OAuth2 applications for orgs (#18084) - * Add system setting table with cache and also add cache supports for user setting (#18058) - * Add pages to view watched repos and subscribed issues/PRs (#17156) - * Support Proxy protocol (#12527) - * Implement sync push mirror on commit (#19411) -* API - * Allow empty assignees on pull request edit (#22150) (#22214) - * Make external issue tracker regexp configurable via API (#21338) - * Add name field for org api (#21270) - * Show teams with no members if user is admin (#21204) - * Add latest commit's SHA to content response (#20398) - * Add allow_rebase_update, default_delete_branch_after_merge to repository api response (#20079) - * Add new endpoints for push mirrors management (#19841) -* ENHANCEMENTS - * Add setting to disable the git apply step in test patch (#22130) (#22170) - * Multiple improvements for comment edit diff (#21990) (#22007) - * Fix button in branch list, avoid unexpected page jump before restore branch actually done (#21562) (#21928) - * Fix flex layout for repo list icons (#21896) (#21920) - * Fix vertical align of committer avatar rendered by email address (#21884) (#21918) - * Fix setting HTTP headers after write (#21833) (#21877) - * Color and Style enhancements (#21784, #21799) (#21868) - * Ignore line anchor links with leading zeroes (#21728) (#21776) - * Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734) (#21738) - * Use CSS color-scheme instead of invert (#21616) (#21623) - * Respect user's locale when rendering the date range in the repo activity page (#21410) - * Change `commits-table` column width (#21564) - * Refactor git command arguments and make all arguments to be safe to be used (#21535) - * CSS color enhancements (#21534) - * Add link to user profile in markdown mention only if user exists (#21533, #21554) - * Add option to skip index dirs (#21501) - * Diff file tree tweaks (#21446) - * Localize all timestamps (#21440) - * Add `code` highlighting in issue titles (#21432) - * Use Name instead of DisplayName in LFS Lock (#21415) - * Consolidate more CSS colors into variables (#21402) - * Redirect to new repository owner (#21398) - * Use ISO date format instead of hard-coded English date format for date range in repo activity page (#21396) - * Use weighted algorithm for string matching when finding files in repo (#21370) - * Show private data in feeds (#21369) - * Refactor parseTreeEntries, speed up tree list (#21368) - * Add GET and DELETE endpoints for Docker blob uploads (#21367) - * Add nicer error handling on template compile errors (#21350) - * Add `stat` to `ToCommit` function for speed (#21337) - * Support instance-wide OAuth2 applications (#21335) - * Record OAuth client type at registration (#21316) - * Add new CSS variables --color-accent and --color-small-accent (#21305) - * Improve error descriptions for unauthorized_client (#21292) - * Case-insensitive "find files in repo" (#21269) - * Consolidate more CSS rules, fix inline code on arc-green (#21260) - * Log real ip of requests from ssh (#21216) - * Save files in local storage as group readable (#21198) - * Enable fluid page layout on medium size viewports (#21178) - * File header tweaks (#21175) - * Added missing headers on user packages page (#21172) - * Display image digest for container packages (#21170) - * Skip dirty check for team forms (#21154) - * Keep path when creating a new branch (#21153) - * Remove fomantic image module (#21145) - * Make labels clickable in the comments section. (#21137) - * Sort branches and tags by date descending (#21136) - * Better repo API unit checks (#21130) - * Improve commit status icons (#21124) - * Limit length of repo description and repo url input fields (#21119) - * Show .editorconfig errors in frontend (#21088) - * Allow poster to choose reviewers (#21084) - * Remove black labels and CSS cleanup (#21003) - * Make e-mail sanity check more precise (#20991) - * Use native inputs in whitespace dropdown (#20980) - * Enhance package date display (#20928) - * Display total blob size of a package version (#20927) - * Show language name on hover (#20923) - * Show instructions for all generic package files (#20917) - * Refactor AssertExistsAndLoadBean to use generics (#20797) - * Move the official website link at the footer of gitea (#20777) - * Add support for full name in reverse proxy auth (#20776) - * Remove useless JS operation for relative time tooltips (#20756) - * Replace some icons with SVG (#20741) - * Change commit status icons to SVG (#20736) - * Improve single repo action for issue and pull requests (#20730) - * Allow multiple files in generic packages (#20661) - * Add option to create new issue from /issues page (#20650) - * Background color of private list-items updated (#20630) - * Added search input field to issue filter (#20623) - * Increase default item listing size `ISSUE_PAGING_NUM` to 20 (#20547) - * Modify milestone search keywords to be case insensitive again (#20513) - * Show hint to link package to repo when viewing empty repo package list (#20504) - * Add Tar ZSTD support (#20493) - * Make code review checkboxes clickable (#20481) - * Add "X-Gitea-Object-Type" header for GET `/raw/` & `/media/` API (#20438) - * Display project in issue list (#20434) - * Prepend commit message to template content when opening a new PR (#20429) - * Replace fomantic popup module with tippy.js (#20428) - * Allow to specify colors for text in markup (#20363) - * Allow access to the Public Organization Member lists with minimal permissions (#20330) - * Use default values when provided values are empty (#20318) - * Vertical align navbar avatar at middle (#20302) - * Delete cancel button in repo creation page (#21381) - * Include login_name in adminCreateUser response (#20283) - * fix: icon margin in user/settings/repos (#20281) - * Remove blue text on migrate page (#20273) - * Modify milestone search keywords to be case insensitive (#20266) - * Move some files into models' sub packages (#20262) - * Add tooltip to repo icons in explore page (#20241) - * Remove deprecated licenses (#20222) - * Webhook for Wiki changes (#20219) - * Share HTML template renderers and create a watcher framework (#20218) - * Allow enable LDAP source and disable user sync via CLI (#20206) - * Adds a checkbox to select all issues/PRs (#20177) - * Refactor `i18n` to `locale` (#20153) - * Disable status checks in template if none found (#20088) - * Allow manager logging to set SQL (#20064) - * Add order by for assignee no sort issue (#20053) - * Take a stab at porting existing components to Vue3 (#20044) - * Add doctor command to write commit-graphs (#20007) - * Add support for authentication based on reverse proxy email (#19949) - * Enable spellcheck for EasyMDE, use contenteditable mode (#19776) - * Allow specifying SECRET_KEY_URI, similar to INTERNAL_TOKEN_URI (#19663) - * Rework mailer settings (#18982) - * Add option to purge users (#18064) - * Add author search input (#21246) - * Make rss/atom identifier globally unique (#21550) -* BUGFIXES - * Auth interface return error when verify failure (#22119) (#22259) - * Use complete SHA to create and query commit status (#22244) (#22257) - * Update bleve and zapx to fix unaligned atomic (#22031) (#22218) - * Prevent panic in doctor command when running default checks (#21791) (#21807) - * Load GitRepo in API before deleting issue (#21720) (#21796) - * Ignore line anchor links with leading zeroes (#21728) (#21776) - * Set last login when activating account (#21731) (#21755) - * Fix UI language switching bug (#21597) (#21749) - * Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734) (#21738) - * Allow local package identifiers for PyPI packages (#21690) (#21727) - * Deal with markdown template without metadata (#21639) (#21654) - * Fix opaque background on mermaid diagrams (#21642) (#21652) - * Fix repository adoption on Windows (#21646) (#21650) - * Sync git hooks when config file path changed (#21619) (#21626) - * Fix 500 on PR files API (#21602) (#21607) - * Fix `Timestamp.IsZero` (#21593) (#21603) - * Fix viewing user subscriptions (#21482) - * Fix mermaid-related bugs (#21431) - * Fix branch dropdown shifting on page load (#21428) - * Fix default theme-auto selector when nologin (#21346) - * Fix and improve incorrect error messages (#21342) - * Fix formatted link for PR review notifications to matrix (#21319) - * Center-aligning content of WebAuthN page (#21127) - * Remove follow from commits by file (#20765) - * Fix commit status popup (#20737) - * Fix init mail render logic (#20704) - * Use correct page size for link header pagination (#20546) - * Preserve unix socket file (#20499) - * Use tippy.js for context popup (#20393) - * Add missing parameter for error in log message (#20144) - * Do not allow organisation owners add themselves as collaborator (#20043) - * Rework file highlight rendering and fix yaml copy-paste (#19967) - * Improve code diff highlight, fix incorrect rendered diff result (#19958) -* TESTING - * Improve OAuth integration tests (#21390) - * Add playwright tests (#20123) -* BUILD - * Switch to building with go1.19 (#20695) - * Update JS dependencies, adjust eslint (#20659) - * Add more linters to improve code readability (#19989) - -## [1.17.4](https://github.com/go-gitea/gitea/releases/tag/v1.17.4) - 2022-12-21 - -* SECURITY - * Do not allow Ghost access to limited visible user/org (#21849) (#21875) - * Fix package access for admins and inactive users (#21580) (#21592) -* ENHANCEMENTS - * Fix button in branch list, avoid unexpected page jump before restore branch actually done (#21562) (#21927) - * Fix vertical align of committer avatar rendered by email address (#21884) (#21919) - * Fix setting HTTP headers after write (#21833) (#21874) - * Ignore line anchor links with leading zeroes (#21728) (#21777) - * Enable Monaco automaticLayout (#21516) -* BUGFIXES - * Do not list active repositories as unadopted (#22034) (#22167) - * Correctly handle moved files in apply patch (#22118) (#22136) - * Fix condition for is_internal (#22095) (#22131) - * Fix permission check on issue/pull lock (#22114) - * Fix sorting admin user list by last login (#22081) (#22106) - * Workaround for container registry push/pull errors (#21862) (#22069) - * Fix issue/PR numbers (#22037) (#22045) - * Handle empty author names (#21902) (#22028) - * Fix ListBranches to handle empty case (#21921) (#22025) - * Fix enabling partial clones on 1.17 (#21809) - * Prevent panic in doctor command when running default checks (#21791) (#21808) - * Upgrade golang.org/x/crypto (#21792) (#21794) - * Init git module before database migration (#21764) (#21766) - * Set last login when activating account (#21731) (#21754) - * Add HEAD fix to gitea doctor (#21352) (#21751) - * Fix UI language switching bug (#21597) (#21748) - * Remove semver compatible flag and change pypi to an array of test cases (#21708) (#21729) - * Allow local package identifiers for PyPI packages (#21690) (#21726) - * Fix repository adoption on Windows (#21646) (#21651) - * Sync git hooks when config file path changed (#21619) (#21625) - * Added check for disabled Packages (#21540) (#21614) - * Fix `Timestamp.IsZero` (#21593) (#21604) - * Fix issues count bug (#21600) - * Support binary deploy in npm packages (#21589) - * Update milestone counters when issue is deleted (#21459) (#21586) - * SessionUser protection against nil pointer dereference (#21581) - * Case-insensitive NuGet symbol file GUID (#21409) (#21575) - * Suppress `ExternalLoginUserNotExist` error (#21504) (#21572) - * Prevent Authorization header for presigned LFS urls (#21531) (#21569) - * Update binding to fix bugs (#21560) - * Fix generating compare link (#21519) (#21530) - * Ignore error when retrieving changed PR review files (#21487) (#21524) - * Fix incorrect notification commit url (#21479) (#21483) - * Display total commit count in hook message (#21400) (#21481) - * Enforce grouped NuGet search results (#21442) (#21480) - * Return 404 when user is not found on avatar (#21476) (#21477) - * Normalize NuGet package version on upload (#22186) (#22201) -* MISC - * Check for zero time instant in TimeStamp.IsZero() (#22171) (#22173) - * Fix warn in database structs sync (#22111) - * Allow for resolution of NPM registry paths that match upstream (#21568) (#21723) - -## [1.17.3](https://github.com/go-gitea/gitea/releases/tag/v1.17.3) - 2022-10-15 - -* SECURITY - * Sanitize and Escape refs in git backend (#21464) (#21463) - * Bump `golang.org/x/text` (#21412) (#21413) - * Update bluemonday (#21281) (#21287) -* ENHANCEMENTS - * Fix empty container layer history and UI (#21251) (#21278) - * Use en-US as fallback when using other default language (#21200) (#21256) - * Make the vscode clone link respect transport protocol (#20557) (#21128) -* BUGFIXES - * Do DB update after merge in hammer context (#21401) (#21416) - * Add Num{Issues,Pulls} stats checks (#21404) (#21414) - * Stop logging CheckPath returns error: context canceled (#21064) (#21405) - * Parse OAuth Authorization header when request omits client secret (#21351) (#21374) - * Ignore port for loopback redirect URIs (#21293) (#21373) - * Set SemverCompatible to false for Conan packages (#21275) (#21366) - * Tag list should include draft releases with existing tags (#21263) (#21365) - * Fix linked account translation (#21331) (#21334) - * Make NuGet service index publicly accessible (#21242) (#21277) - * Foreign ID conflicts if ID is 0 for each item (#21271) (#21272) - * Use absolute links in feeds (#21229) (#21265) - * Prevent invalid behavior for file reviewing when loading more files (#21230) (#21234) - * Respect `REQUIRE_SIGNIN_VIEW` for packages (#20873) (#21232) - * Treat git object mode 40755 as directory (#21195) (#21218) - * Allow uppercase ASCII alphabet in PyPI package names (#21095) (#21217) - * Fix limited user cannot view himself's profile (#21212) - * Fix template bug of admin monitor (#21209) - * Fix reaction of issues (#21185) (#21196) - * Fix CSV diff for added/deleted files (#21189) (#21193) - * Fix pagination limit parameter problem (#21111) -* TESTING - * Fix missing m.Run() in TestMain (#21341) -* BUILD - * Use Go 1.19 fmt for Gitea 1.17, sync emoji data (#21239) - -## [1.17.2](https://github.com/go-gitea/gitea/releases/tag/v1.17.2) - 2022-09-06 - -* SECURITY - * Double check CloneURL is acceptable (#20869) (#20892) - * Add more checks in migration code (#21011) (#21050) -* ENHANCEMENTS - * Fix hard-coded timeout and error panic in API archive download endpoint (#20925) (#21051) - * Improve arc-green code theme (#21039) (#21042) - * Enable contenthash in filename for dynamic assets (#20813) (#20932) - * Don't open new page for ext wiki on same repository (#20725) (#20910) - * Disable doctor logging on panic (#20847) (#20898) - * Remove calls to load Mirrors in user.Dashboard (#20855) (#20897) - * Update codemirror to 5.65.8 (#20875) - * Rework repo buttons (#20602, #20718) (#20719) -* BUGFIXES - * Ensure delete user deletes all comments (#21067) (#21068) - * Delete unreferenced packages when deleting a package version (#20977) (#21060) - * Redirect if user does not exist on admin pages (#20981) (#21059) - * Set uploadpack.allowFilter etc on gitea serv to enable partial clones with ssh (#20902) (#21058) - * Fix 500 on time in timeline API (#21052) (#21057) - * Fill the specified ref in webhook test payload (#20961) (#21055) - * Add another index for Action table on postgres (#21033) (#21054) - * Fix broken insecureskipverify handling in redis connection uris (#20967) (#21053) - * Add Dev, Peer and Optional dependencies to npm PackageMetadataVersion (#21017) (#21044) - * Do not add links to Posters or Assignees with ID < 0 (#20577) (#21037) - * Fix modified due date message (#20388) (#21032) - * Fix missed sort bug (#21006) - * Fix input.value attr for RequiredClaimName/Value (#20946) (#21001) - * Change review buttons to icons to make space for text (#20934) (#20978) - * Fix download archiver of a commit (#20962) (#20971) - * Return 404 NotFound if requested attachment does not exist (#20886) (#20941) - * Set no-tags in git fetch on compare (#20893) (#20936) - * Allow multiple metadata files for Maven packages (#20674) (#20916) - * Increase Content field size of gpg_key and public_key to MEDIUMTEXT (#20896) (#20911) - * Fix mirror address setting not working (#20850) (#20904) - * Fix push mirror address backend get error Address cause setting page display error (#20593) (#20901) - * Fix panic when an invalid oauth2 name is passed (#20820) (#20900) - * In PushMirrorsIterate and MirrorsIterate if limit is negative do not set it (#20837) (#20899) - * Ensure that graceful start-up is informed of unused SSH listener (#20877) (#20888) - * Pad GPG Key ID with preceding zeroes (#20878) (#20885) - * Fix SQL Query for `SearchTeam` (#20844) (#20872) - * Fix the mode of custom dir to 0700 in docker-rootless (#20861) (#20867) - * Fix UI mis-align for PR commit history (#20845) (#20859) - -## [1.17.1](https://github.com/go-gitea/gitea/releases/tag/1.17.1) - 2022-08-17 - -* SECURITY - * Correctly escape within tribute.js (#20831) (#20832) -* ENHANCEMENTS - * Add support for NuGet API keys (#20721) (#20734) - * Display project in issue list (#20583) - * Add disable download source configuration (#20548) (#20579) - * Add username check to doctor (#20140) (#20671) - * Enable Wire 2 for Internal SSH Server (#20616) (#20617) -* BUGFIXES - * Use the total issue count for UI (#20785) (#20827) - * Add proxy host into allow list (#20798) (#20819) - * Add missing translation for queue flush workers (#20791) (#20792) - * Improve comment header for mobile (#20781) (#20789) - * Fix git.Init for doctor sub-command (#20782) (#20783) - * Check webhooks slice length before calling xorm (#20642) (#20768) - * Remove manual rollback for failed generated repositories (#20639) (#20762) - * Use correct field name in npm template (#20675) (#20760) - * Keep download count on Container tag overwrite (#20728) (#20735) - * Fix v220 migration to be compatible for MSSQL 2008 r2 (#20702) (#20707) - * Use request timeout for git service rpc (#20689) (#20693) - * Send correct NuGet status codes (#20647) (#20677) - * Use correct context to get package content (#20673) (#20676) - * Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) (#20663) - * Add default commit messages to PR for squash merge (#20618) (#20645) - * Fix package upload for files >32mb (#20622) (#20635) - * Fix the new-line copy-paste for rendered code (#20612) - * Clean up and fix clone button script (#20415 & #20600) (#20599) - * Fix default merge style (#20564) (#20565) - * Add repository condition for issue count (#20454) (#20496) - * Make branch icon stand out more (#20726) (#20774) - * Fix loading button with invalid form (#20754) (#20759) - * Fix SecToTime edge-cases (#20610) (#20611) - * Executable check always returns true for windows (#20637) (#20835) - * Check issue labels slice length before calling xorm Insert (#20655) (#20836) - * Fix owners cannot create organization repos bug (#20841) (#20854) - * Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) (#20848) - -## [1.17.0](https://github.com/go-gitea/gitea/releases/tag/v1.17.0) - 2022-07-30 - -* BREAKING - * Require go1.18 for Gitea 1.17 (#19918) - * Make AppDataPath absolute against the AppWorkPath if it is not (#19815) - * Nuke the incorrect permission report on /api/v1/notifications (#19761) - * Refactor git module, make Gitea use internal git config (#19732) - * Remove `RequireHighlightJS` field, update plantuml example. (#19615) - * Increase minimal required git version to 2.0 (#19577) - * Add a directory prefix `gitea-src-VERSION` to release-tar-file (#19396) - * Use "main" as default branch name (#19354) - * Make cron task no notice on success (#19221) - * Add pam account authorization check (#19040) - * Show messages for users if the ROOT_URL is wrong, show JavaScript errors (#18971) - * Refactor mirror code & fix StartToMirror (#18904) - * Remove deprecated SSH ciphers from default (#18697) - * Add the possibility to allow the user to have a favicon which differs from the main logo (#18542) - * Update reserved usernames list (#18438) - * Support custom ACME provider (#18340) - * Change initial TrustModel to committer (#18335) - * Update HTTP status codes (#18063) - * Upgrade Alpine from 3.13 to 3.15 (#18050) - * Restrict email address validation (#17688) - * Refactor Router Logger (#17308) -* SECURITY - * Use git.HOME_PATH for Git HOME directory (#20114) (#20293) - * Add write check for creating Commit Statuses (#20332) (#20333) - * Remove deprecated SSH ciphers from default (#18697) -* FEDERATION - * Return statistic information for nodeinfo (#19561) - * Add Webfinger endpoint (#19462) - * Store the foreign ID of issues during migration (#18446) -* FEATURES - * Automatically render wiki TOC (#19873) - * Adding button to link accounts from user settings (#19792) - * Allow set default merge style while creating repo (#19751) - * Auto merge pull requests when all checks succeeded (#9307 & #19648) - * Improve reviewing PR UX (#19612) - * Add support for rendering console output with colors (#19497) - * Add Helm Chart registry (#19406) - * Add Goroutine stack inspector to admin/monitor (#19207) - * RSS/Atom support for Orgs & Repos (#17714 & #19055) - * Add button for issue deletion (#19032) - * Allow to mark files in a PR as viewed (#19007) - * Add Index to comment for migrations and mirroring (#18806) - * Add health check endpoint (#18465) - * Add packagist webhook (#18224) - * Add "Allow edits from maintainer" feature (#18002) - * Add apply-patch, basic revert and cherry-pick functionality (#17902) - * Add Package Registry (#16510) - * Add LDAP group sync to Teams (#16299) - * Pause queues (#15928) - * Added auto-save whitespace behavior if it changed manually (#15566) - * Find files in repo (#15028) - * Provide configuration to allow camo-media proxying (#12802) -* API - * Add endpoint to serve blob or LFS file content (#19689) - * Add endpoint to check if team has repo access (#19540) - * More commit info (#19252) - * Allow to create file on empty repo (#19224) - * Allow removing issues (#18879) - * Add endpoint to query collaborators permission for a repository (#18761) - * Return primary language and repository language stats API URL (#18396) - * Implement http signatures support for the API (#17565) -* ENHANCEMENTS - * Make notification bell more prominent on mobile (#20108, #20236, #20251) (#20269) - * Adjust max-widths for the repository file table (#20243) (#20247) - * Display full name (#20171) (#20246) - * Add dbconsistency checks for Stopwatches (#20010) - * Add fetch.writeCommitGraph to gitconfig (#20006) - * Add fgprof pprof profiler (#20005) - * Move agit dependency (#19998) - * Empty log queue on flush and close (#19994) - * Remove tab/TabName usage where it's not needed (#19973) - * Improve file header on mobile (#19945) - * Move issues related files into models/issues (#19931) - * Add breaking email restrictions checker in doctor (#19903) - * Improve UX on modal for deleting an access token (#19894) - * Add alt text to logo (#19892) - * Move some code into models/git (#19879) - * Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) - * Make user profile image show full image on mobile (#19840) - * Replace blue button and label classes with primary (#19763) - * Remove fomantic progress module (#19760) - * Allows repo search to match against "owner/repo" pattern strings (#19754) - * Move org functions (#19753) - * Move almost all functions' parameter db.Engine to context.Context (#19748) - * Show source/target branches on PR's list (#19747) - * Use http.StatusTemporaryRedirect(307) when serve avatar directly (#19739) - * Add doctor orphan check for orphaned pull requests without an existing base repo (#19731) - * Make Ctrl+Enter (quick submit) work for issue comment and wiki editor (#19729) - * Update go-chi/cache to utilize Ping() (#19719) - * Improve commit list/view on mobile (#19712) - * Move some repository related code into sub package (#19711) - * Use a better OlderThan for DeleteInactiveUsers (#19693) - * Introduce eslint-plugin-jquery (#19690) - * Tidy up `<head>` template (#19678) - * Calculate filename hash only once (#19654) - * Simplify `IsVendor` (#19626) - * Add "Reference" section to Issue view sidebar (#19609) - * Only set CanColorStdout / CanColorStderr to true if the stdout/stderr is a terminal (#19581) - * Use for a repo action one database transaction (#19576) - * Simplify loops to copy (#19569) - * Added X-Mailer header to outgoing emails (#19562) - * use middleware to open gitRepo (#19559) - * Mute link in diff header (#19556) - * Improve UI on mobile (#19546) - * Fix Pull Request comment filename word breaks (#19535) - * Permalink files In PR diff (#19534) - * PullService lock via pullID (#19520) - * Make repository file list useable on mobile (#19515) - * more context for models (#19511) - * Refactor readme file renderer (#19502) - * By default force vertical tabs on mobile (#19486) - * Github style following followers (#19482) - * Improve action table indices (#19472) - * Use horizontal tabs for repo header on mobile (#19468) - * pass gitRepo down since its used for main repo and wiki (#19461) - * Admin should not delete himself (#19423) - * Use queue instead of memory queue in webhook send service (#19390) - * Simplify the code to get issue count (#19380) - * Add commit status popup to issuelist (#19375) - * Add RSS Feed buttons to Repo, User and Org pages (#19370) - * Add logic to switch between source/rendered on Markdown (#19356) - * Move some helper files out of models (#19355) - * Move access and repo permission to models/perm/access (#19350) - * Disallow selecting the text of buttons (#19330) - * Allow custom redirect for landing page (#19324) - * Remove dependent on session auth for api/v1 routers (#19321) - * Never use /api/v1 from Gitea UI Pages (#19318) - * Remove legacy unmaintained packages, refactor to support change default locale (#19308) - * Move milestone to models/issues/ (#19278) - * Configure OpenSSH log level via Environment in Docker (#19274) - * Move reaction to models/issues/ (#19264) - * Make git.OpenRepository accept Context (#19260) - * Move some issue methods as functions (#19255) - * Show last cron messages on monitor page (#19223) - * New cron task: delete old system notices (#19219) - * Add Redis Sentinel Authentication Support (#19213) - * Add auto logging of goroutine pid label (#19212) - * Set OpenGraph title to DisplayName in profile pages (#19206) - * Add pprof labels in processes and for lifecycles (#19202) - * Let web and API routes have different auth methods group (#19168) - * Move init repository related functions to modules (#19159) - * Feeds: render markdown to html (#19058) - * Allow users to self-request a PR review (#19030) - * Allow render HTML with css/js external links (#19017) - * Fix script compatiable with OpenWrt (#19000) - * Support ignore all santize for external renderer (#18984) - * Add note to GPG key response if user has no keys (#18961) - * Improve Stopwatch behavior (#18930) - * Improve mirror iterator (#18928) - * Uncapitalize errors (#18915) - * Prevent Stats Indexer reporting error if repo dir missing (#18870) - * Refactor SecToTime() function (#18863) - * Replace deprecated String.prototype.substr() with String.prototype.slice() (#18796) - * Move deletebeans into models/db (#18781) - * Fix display time of milestones (#18753) - * Add config option to disable "Update branch by rebase" (#18745) - * Display template path of current page in dev mode (#18717) - * Add number in queue status to monitor page (#18712) - * Change git.cmd to RunWithContext (#18693) - * Refactor i18n, use Locale to provide i18n/translation related functions (#18648) - * Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552) - * Move organization related structs into sub package (#18518) - * Warn at startup if the provided `SCRIPT_TYPE` is not on the PATH (#18467) - * Use `CryptoRandomBytes` instead of `CryptoRandomString` (#18439) - * Use explicit jQuery import, remove unused eslint globals (#18435) - * Allow to filter repositories by language in explore, user and organization repositories lists (#18430) - * Use base32 for 2FA scratch token (#18384) - * Unexport var git.GlobalCommandArgs (#18376) - * Don't underline commit status icon on hover (#18372) - * Always use git command but not os.Command (#18363) - * Switch to non-deprecation setting (#18358) - * Set the LastModified header for raw files (#18356) - * Refactor jwt.StandardClaims to RegisteredClaims (#18344) - * Enable deprecation error for v1.17.0 (#18341) - * Refactor httplib (#18338) - * Limit max-height of CodeMirror editors for issue comment and wiki (#18271) - * Validate migration files (#18203) - * Format with gofumpt (#18184) - * Allow custom default merge message with .gitea/default_merge_message/<merge_style>_TEMPLATE.md (#18177) - * Prettify number of issues (#17760) - * Add a "admin user generate-access-token" subcommand (#17722) - * Custom regexp external issues (#17624) - * Add smtp password to install page (#17564) - * Add config options to hide issue events (#17414) - * Prevent double click new issue/pull/comment button (#16157) - * Show issue assignee on project board (#15232) -* BUGFIXES - * WebAuthn CredentialID field needs to be increased in size (#20530) (#20555) - * Ensure that all unmerged files are merged when conflict checking (#20528) (#20536) - * Stop logging EOFs and exit(1)s in ssh handler (#20476) (#20529) - * Add labels to two buttons that were missing them (#20419) (#20524) - * Fix ROOT_URL detection for URLs without trailing slash (#20502) (#20503) - * Dismiss prior pull reviews if done via web in review dismiss (#20197) (#20407) - * Allow RSA 2047 bit keys (#20272) (#20396) - * Add missing return for when topic isn't found (#20351) (#20395) - * Fix commit status icon when in subdirectory (#20285) (#20385) - * Initialize cron last (#20373) (#20384) - * Set target on create release with existing tag (#20381) (#20382) - * Update xorm.io/xorm to fix a interpreting db column sizes issue on 32bit systems (#20371) (#20372) - * Make sure `repo_dir` is an empty directory or doesn't exist before 'dump-repo' (#20205) (#20370) - * Prevent context deadline error propagation in GetCommitsInfo (#20346) (#20361) - * Correctly handle draft releases without a tag (#20314) (#20335) - * Prevent "empty" scrollbars on Firefox (#20294) (#20308) - * Refactor SSH init code, fix directory creation for TrustedUserCAKeys file (#20299) (#20306) - * Bump goldmark to v1.4.13 (#20300) (#20301) - * Do not create empty ".ssh" directory when loading config (#20289) (#20298) - * Fix NPE when using non-numeric (#20277) (#20278) - * Store read access in access for team repositories (#20275) (#20276) - * EscapeFilter the group dn membership (#20200) (#20254) - * Only show Followers that current user can access (#20220) (#20252) - * Update Bluemonday to v1.0.19 (#20199) (#20209) - * Refix indices on actions table (#20158) (#20198) - * Check if project has the same repository id with issue when assign project to issue (#20133) (#20188) - * Fix remove file on initial comment (#20127) (#20128) - * Catch the error before the response is processed by goth (#20000) (#20102) - * Dashboard feed respect setting.UI.FeedPagingNum again (#20094) (#20099) - * Alter hook_task TEXT fields to LONGTEXT (#20038) (#20041) - * Respond with a 401 on git push when password isn't changed yet (#20026) (#20027) - * Return 404 when tag is broken (#20017) (#20024) - * Alter hook_task TEXT fields to LONGTEXT (#20038) (#20041) - * Respond with a 401 on git push when password isn't changed yet (#20026) (#20027) - * Return 404 when tag is broken (#20017) (#20024) - * Write Commit-Graphs in RepositoryDumper (#20004) - * Use DisplayName() instead of FullName in Oauth Provider (#19991) - * Don't buffer doctor logger (#19982) - * Always try to fetch repo for mirrors (#19975) - * Uppercase first languages letters (#19965) - * Fix cli command restore-repo: "units" should be parsed as StringSlice (#19953) - * Ensure minimum mirror interval is reported on settings page (#19895) - * Exclude Archived repos from Dashboard Milestones (#19882) - * gitconfig: set safe.directory = * (#19870) - * Prevent NPE on update mirror settings (#19864) - * Only return valid stopwatches to the EventSource (#19863) - * Prevent NPE whilst migrating if there is a team request review (#19855) - * Fix inconsistency in doctor output (#19836) - * Fix release tag for webhook (#19830) - * Add title attribute to dependencies in sidebar (#19807) - * Estimate Action Count in Statistics (#19775) - * Do not update user stars numbers unless fix is specified (#19750) - * Improved ref comment link when origin is body/title (#19741) - * Fix nodeinfo caching and prevent NPE if cache non-existent (#19721) - * Fix duplicate entry error when add team member (#19702) - * Fix sending empty notifications (#19589) - * Update image URL for Discord webhook (#19536) - * Don't let repo clone URL overflow (#19517) - * Allow commit status popup on /pulls page (#19507) - * Fix two UI bugs: JS error in imagediff.js, 500 error in diff/compare.tmpl (#19494) - * Fix logging of Transfer API (#19456) - * Fix panic in teams API when requesting members (#19360) - * Refactor CSRF protection modules, make sure CSRF tokens can be up-to-date. (#19337) - * An attempt to sync a non-mirror repo must give 400 (Bad Request) (#19300) - * Move checks for pulls before merge into own function (#19271) - * Fix `contrib/upgrade.sh` (#19222) - * Set the default branch for repositories generated from templates (#19136) - * Fix EasyMDE error when input Enter (#19004) - * Don't clean up hardcoded `tmp` (#18983) - * Delete related notifications on issue deletion too (#18953) - * Fix trace log to show value instead of pointers (#18926) - * Fix behavior or checkbox submission. (#18851) - * Add `ContextUser` (#18798) - * Fix some mirror bugs (#18649) - * Quote MAKE to prevent path expansion with space error (#18622) - * Preserve users if restoring a repository on the same Gitea instance (#18604) - * Fix non-ASCII search on database (#18437) - * Automatically pause queue if index service is unavailable (#15066) -* TESTING - * Allow postgres integration tests to run over unix pipe (#19875) - * Prevent intermittent NPE in queue tests (#19301) - * Add test for importing pull requests in gitea uploader for migrations (#18752) - * Remove redundant comparison in repo dump/restore (#18660) - * More repo dump/restore tests, including pull requests (#18621) - * Add test coverage for original author conversion during migrations (#18506) -* TRANSLATION - * Update issue_no_dependencies description (#19112) - * Refactor webhooks i18n (#18380) -* BUILD - * Use alpine 3.16 (#19797) - * Require node 14.0 (#19451) -* DOCS - * Update documents (git/fomantic/db, etc) (#19868) - * Update the ROOT documentation and error messages (#19832) - * Update document to use FHS `/usr/local/bin/gitea` instead of `/app/...` for Docker (#19794) - * Update documentation to disable duration settings with -1 instead of 0 (#19647) - * Add warning to set SENDMAIL_ARGS to -- (#19102) - * Update nginx reverse proxy docs (#18922) - * Add example to render html files (#18736) - * Make SSH passtrough documentation better (#18687) - * Changelog 1.16.0 & 1.15.11 (#18468 & #18455) (#18470) - * Update the SSH passthrough documentation (#18366) - * Add `contrib/upgrade.sh` (#18286) -* MISC - * Fix aria for logo (#19955) - * In code search, get code unit accessible repos in one (main) query (#19764) - * Add tooltip to pending PR comments (#19662) - * Improve sync performance for pull-mirrors (#19125) - * Improve dashboard's repo list performance (#18963) - * Avoid database lookups for `DescriptionHTML` (#18924) - * Remove CodeMirror dependencies (#18911) - * Disable unnecessary mirroring elements (#18527) - * Disable unnecessary OpenID/OAuth2 elements (#18491) - * Disable unnecessary GitHooks elements (#18485) - * Change some logging levels (#18421) - * Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) - * Use correct translation key for errors (#18342) - -## [1.16.9](https://github.com/go-gitea/gitea/releases/tag/v1.16.9) - 2022-07-12 - -* SECURITY - * Add write check for creating Commit status (#20332) (#20334) - * Check for permission when fetching user controlled issues (#20133) (#20196) -* BUGFIXES - * Hide notify mail setting ui if not enabled (#20138) (#20337) - * Add write check for creating Commit status (#20332) (#20334) - * Only show Followers that current user can access (#20220) (#20253) - * Release page show all tags in compare dropdown (#20070) (#20071) - * Fix permission check for delete tag (#19985) (#20001) - * Only log non ErrNotExist errors in git.GetNote (#19884) (#19905) - * Use exact search instead of fuzzy search for branch filter dropdown (#19885) (#19893) - * Set Setpgid on child git processes (#19865) (#19881) - * Import git from alpine 3.16 repository as 2.30.4 is needed for `safe.directory = '*'` to work but alpine 3.13 has 2.30.3 (#19876) - * Ensure responses are context.ResponseWriters (#19843) (#19859) - * Fix incorrect usage of `Count` function (#19850) - * Fix raw endpoint PDF file headers (#19825) (#19826) - * Make WIP prefixes case insensitive, e.g. allow `Draft` as a WIP prefix (#19780) (#19811) - * Don't return 500 on NotificationUnreadCount (#19802) - * Prevent NPE when cache service is disabled (#19703) (#19783) - * Detect truncated utf-8 characters at the end of content as still representing utf-8 (#19773) (#19774) - * Fix doctor pq: syntax error at or near "." quote user table name (#19765) (#19770) - * Fix bug with assigneees (#19757) - -## [1.16.8](https://github.com/go-gitea/gitea/releases/tag/v1.16.8) - 2022-05-16 - -* ENHANCEMENTS - * Add doctor check/fix for bogus action rows (#19656) (#19669) - * Make .cs highlighting legible on dark themes. (#19604) (#19605) -* BUGFIXES - * Fix oauth setting list bug (#19681) - * Delete user related oauth stuff on user deletion too (#19677) (#19680) - * Fix new release from tags list UI (#19670) (#19673) - * Prevent NPE when checking repo units if the user is nil (#19625) (#19630) - * GetFeeds must always discard actions with dangling repo_id (#19598) (#19629) - * Call MultipartForm.RemoveAll when request finishes (#19606) (#19607) - * Avoid MoreThanOne error when creating a branch whose name conflicts with other ref names (#19557) (#19591) - * Fix sending empty notifications (#19589) (#19590) - * Ignore DNS error when doing migration allow/block check (#19566) (#19567) - * Fix issue overview for teams (#19652) (#19653) - -## [1.16.7](https://github.com/go-gitea/gitea/releases/tag/v1.16.7) - 2022-05-02 - -* SECURITY - * Escape git fetch remote (#19487) (#19490) -* BUGFIXES - * Don't overwrite err with nil (#19572) (#19574) - * On Migrations, only write commit-graph if wiki clone was successful (#19563) (#19568) - * Respect DefaultUserIsRestricted system default when creating new user (#19310) (#19560) - * Don't error when branch's commit doesn't exist (#19547) (#19548) - * Support `hostname:port` to pass host matcher's check (#19543) (#19544) - * Prevent intermittent race in attribute reader close (#19537) (#19539) - * Fix 64-bit atomic operations on 32-bit machines (#19531) (#19532) - * Prevent dangling archiver goroutine (#19516) (#19526) - * Fix migrate release from github (#19510) (#19523) - * When view _Siderbar or _Footer, just display once (#19501) (#19522) - * Fix blame page select range error and some typos (#19503) - * Fix name of doctor fix "authorized-keys" in hints (#19464) (#19484) - * User specific repoID or xorm builder conditions for issue search (#19475) (#19476) - * Prevent dangling cat-file calls (goroutine alternative) (#19454) (#19466) - * RepoAssignment ensure to close before overwrite (#19449) (#19460) - * Set correct PR status on 3way on conflict checking (#19457) (#19458) - * Mark TemplateLoading error as "UnprocessableEntity" (#19445) (#19446) - -## [1.16.6](https://github.com/go-gitea/gitea/releases/tag/v1.16.6) - 2022-04-20 - -* ENHANCEMENTS - * Only request write when necessary (#18657) (#19422) - * Disable service worker by default (#18914) (#19342) -* BUGFIXES - * When dumping trim the standard suffices instead of a random suffix (#19440) (#19447) - * Fix DELETE request for non-existent public key (#19443) (#19444) - * Don't panic on ErrEmailInvalid (#19441) (#19442) - * Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git clients (#19430) (#19438) - * Warn on SSH connection for incorrect configuration (#19317) (#19437) - * Search Issues via API, dont show 500 if filter result in empty list (#19244) (#19436) - * When updating mirror repo intervals by API reschedule next update too (#19429) (#19433) - * Fix nil error when some pages are rendered outside request context (#19427) (#19428) - * Fix double blob-hunk on diff page (#19404) (#19405) - * Don't allow merging PR's which are being conflict checked (#19357) (#19358) - * Fix middleware function's placements (#19377) (#19378) - * Fix invalid CSRF token bug, make sure CSRF tokens can be up-to-date (#19338) - * Restore user autoregistration with email addresses (#19261) (#19312) - * Move checks for pulls before merge into own function (#19271) (#19277) - * Granular webhook events in editHook (#19251) (#19257) - * Only send webhook events to active system webhooks and only deliver to active hooks (#19234) (#19248) - * Use full output of git show-ref --tags to get tags for PushUpdateAddTag (#19235) (#19236) - * Touch mirrors on even on fail to update (#19217) (#19233) - * Hide sensitive content on admin panel progress monitor (#19218 & #19226) (#19231) - * Fix clone url JS error for the empty repo page (#19209) - * Bump goldmark to v1.4.11 (#19201) (#19203) -* TESTING - * Prevent intermittent failures in RepoIndexerTest (#19225 #19229) (#19228) -* BUILD - * Revert the minimal golang version requirement from 1.17 to 1.16 and add a warning in Makefile (#19319) -* MISC - * Performance improvement for add team user when org has more than 1000 repositories (#19227) (#19289) - * Check go and nodejs version by go.mod and package.json (#19197) (#19254) - -## [1.16.5](https://github.com/go-gitea/gitea/releases/tag/v1.16.5) - 2022-03-23 - -* BREAKING - * Bump to build with go1.18 (#19120 et al) (#19127) -* SECURITY - * Prevent redirect to Host (2) (#19175) (#19186) - * Try to prevent autolinking of displaynames by email readers (#19169) (#19183) - * Clean paths when looking in Storage (#19124) (#19179) - * Do not send notification emails to inactive users (#19131) (#19139) - * Do not send activation email if manual confirm is set (#19119) (#19122) -* ENHANCEMENTS - * Use the new/choose link for New Issue on project page (#19172) (#19176) -* BUGFIXES - * Fix showing issues in your repositories (#18916) (#19191) - * Fix compare link in active feeds for new branch (#19149) (#19185) - * Redirect .wiki/* ui link to /wiki (#18831) (#19184) - * Ensure deploy keys with write access can push (#19010) (#19182) - * Ensure that setting.LocalURL always has a trailing slash (#19171) (#19177) - * Cleanup protected branches when deleting users & teams (#19158) (#19174) - * Use IterateBufferSize whilst querying repositories during adoption check (#19140) (#19160) - * Fix NPE /repos/issues/search when not signed in (#19154) (#19155) - * Use custom favicon when viewing static files if it exists (#19130) (#19152) - * Fix the editor height in review box (#19003) (#19147) - * Ensure isSSH is set whenever DISABLE_HTTP_GIT is set (#19028) (#19146) - * Fix wrong scopes caused by empty scope input (#19029) (#19145) - * Make migrations SKIP_TLS_VERIFY apply to git too (#19132) (#19141) - * Handle email address not exist (#19089) (#19121) -* MISC - * Update json-iterator to allow compilation with go1.18 (#18644) (#19100) - * Update golang.org/x/crypto (#19097) (#19098) - -## [1.16.4](https://github.com/go-gitea/gitea/releases/tag/v1.16.4) - 2022-03-14 - -* SECURITY - * Restrict email address validation (#17688) (#19085) - * Fix lfs bug (#19072) (#19080) -* ENHANCEMENTS - * Improve SyncMirrors logging (#19045) (#19050) -* BUGFIXES - * Refactor mirror code & fix `StartToMirror` (#18904) (#19075) - * Update the webauthn_credential_id_sequence in Postgres (#19048) (#19060) - * Prevent 500 when there is an error during new auth source post (#19041) (#19059) - * If rendering has failed due to a net.OpError stop rendering (attempt 2) (#19049) (#19056) - * Fix flag validation (#19046) (#19051) - * Add pam account authorization check (#19040) (#19047) - * Ignore missing comment for user notifications (#18954) (#19043) - * Set `rel="nofollow noindex"` on new issue links (#19023) (#19042) - * Upgrading binding package (#19034) (#19035) - * Don't show context cancelled errors in attribute reader (#19006) (#19027) - * Fix update hint bug (#18996) (#19002) -* MISC - * Fix potential assignee query for repo (#18994) (#18999) - -## [1.16.3](https://github.com/go-gitea/gitea/releases/tag/v1.16.3) - 2022-03-02 - -* SECURITY - * Git backend ignore replace objects (#18979) (#18980) -* ENHANCEMENTS - * Adjust error for already locked db and prevent level db lock on malformed connstr (#18923) (#18938) -* BUGFIXES - * Set max text height to prevent overflow (#18862) (#18977) - * Fix newAttachmentPaths deletion for DeleteRepository() (#18973) (#18974) - * Accounts with WebAuthn only (no TOTP) now exist ... fix code to handle that case (#18897) (#18964) - * Send 404 on `/{org}.gpg` (#18959) (#18962) - * Fix admin user list pagination (#18957) (#18960) - * Fix lfs management setting (#18947) (#18946) - * Fix login with email panic when email is not exist (#18942) - * Update go-org to v1.6.1 (#18932) (#18933) - * Fix `<strong>` html in translation (#18929) (#18931) - * Fix page and missing return on unadopted repos API (#18848) (#18927) - * Allow adminstrator teams members to see other teams (#18918) (#18919) - * Don't treat BOM escape sequence as hidden character. (#18909) (#18910) - * Correctly link URLs to users/repos with dashes, dots or underscores (… (#18908) - * Fix redirect when using lowercase repo name (#18775) (#18902) - * Fix migration v210 (#18893) (#18892) - * Fix team management UI (#18887) (18886) - * BeforeSourcePath should point to base commit (#18880) (#18799) -* TRANSLATION - * Backport locales from master (#18944) -* MISC - * Don't update email for organisation (#18905) (#18906) - -## [1.16.2](https://github.com/go-gitea/gitea/releases/tag/v1.16.2) - 2022-02-24 - -* ENHANCEMENTS - * Show fullname on issue edits and gpg/ssh signing info (#18828) - * Immediately Hammer if second kill is sent (#18823) (#18826) - * Allow mermaid render error to wrap (#18791) -* BUGFIXES - * Fix ldap user sync missed email in email_address table (#18786) (#18876) - * Update assignees check to include any writing team and change org sidebar (#18680) (#18873) - * Don't report signal: killed errors in serviceRPC (#18850) (#18865) - * Fix bug where certain LDAP settings were reverted (#18859) - * Update go-org to 1.6.0 (#18824) (#18839) - * Fix login with email for ldap users (#18800) (#18836) - * Fix bug for get user by email (#18834) - * Fix panic in EscapeReader (#18820) (#18821) - * Fix ldap loginname (#18789) (#18804) - * Remove redundant call to UpdateRepoStats during migration (#18591) (#18794) - * In disk_channel queues synchronously push to disk on shutdown (#18415) (#18788) - * Fix template bug of LFS lock (#18784) (#18787) - * Attempt to fix the webauthn migration again - part 3 (#18770) (#18771) - * Send mail to issue/pr assignee/reviewer also when OnMention is set (#18707) (#18765) - * Fix a broken link in commits_list_small.tmpl (#18763) (#18764) - * Increase the size of the webauthn_credential credential_id field (#18739) (#18756) - * Prevent dangling GetAttribute calls (#18754) (#18755) - * Fix isempty detection of git repository (#18746) (#18750) - * Fix source code line highlighting on external tracker (#18729) (#18740) - * Prevent double encoding of branch names in delete branch (#18714) (#18738) - * Always set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo (#18713) (#18737) - * Fix forked repositories missed tags (#18719) (#18735) - * Fix release typo (#18728) (#18731) - * Separate the details links of commit-statuses in headers (#18661) (#18730) - * Update object repo with the migrated repository (#18684) (#18726) - * Fix bug for version update hint (#18701) (#18705) - * Fix issue with docker-rootless shimming script (#18690) (#18699) - * Let `MinUnitAccessMode` return correct perm (#18675) (#18689) - * Prevent security failure due to bad APP_ID (#18678) (#18682) - * Restart zero worker if there is still work to do (#18658) (#18672) - * If rendering has failed due to a net.OpError stop rendering (#18642) (#18645) -* TESTING - * Ensure git tag tests and others create test repos in tmpdir (#18447) (#18767) -* BUILD - * Reduce CI go module downloads, add make targets (#18708, #18475, #18443) (#18741) -* MISC - * Put buttons back in org dashboard (#18817) (#18825) - * Various Mermaid improvements (#18776) (#18780) - * C preprocessor colors improvement (#18671) (#18696) - * Fix the missing i18n key for update checker (#18646) (#18665) - -## [1.16.1](https://github.com/go-gitea/gitea/releases/tag/v1.16.1) - 2022-02-06 - -* SECURITY - * Update JS dependencies, fix lint (#18389) (#18540) -* ENHANCEMENTS - * Add dropdown icon to label set template dropdown (#18564) (#18571) -* BUGFIXES - * comments on migrated issues/prs must link to the comment ID (#18630) (#18637) - * Stop logging an error when notes are not found (#18626) (#18635) - * Ensure that blob-excerpt links work for wiki (#18587) (#18624) - * Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620) - * Ensure commit-statuses box is sized correctly in headers (#18538) (#18606) - * Prevent merge messages from being sorted to the top of email chains (#18566) (#18588) - * Prevent panic on prohibited user login with oauth2 (#18562) (#18563) - * Collaborator trust model should trust collaborators (#18539) (#18557) - * Detect conflicts with 3way merge (#18536) (#18537) - * In docker rootless use $GITEA_APP_INI if provided (#18524) (#18535) - * Add `GetUserTeams` (#18499) (#18531) - * Fix review excerpt (#18502) (#18530) - * Fix for AvatarURL database type (#18487) (#18529) - * Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505) - * Fix OAuth Source Edit Page (#18495) (#18503) - * Use "read" value for General Access (#18496) (#18500) - * Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472) (#18473) -* BUILD - * Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551) (#18569) -* DOCS - * Update 1.16.0 changelog to set #17846 as breaking (#18533) (#18534) - -## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30 - -* BREAKING - * Remove golang vendored directory (#18277) - * Paginate releases page & set default page size to 10 (#16857) - * Use shadowing script for docker (#17846) - * Only allow webhook to send requests to allowed hosts (#17482) -* SECURITY - * Disable content sniffing on `PlainTextBytes` (#18359) (#18365) - * Only view milestones from current repo (#18414) (#18417) - * Sanitize user-input on file name (#17666) - * Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605) -* FEATURES - * Add/update SMTP auth providers via cli (#18197) - * Support webauthn (#17957) - * Team permission allow different unit has different permission (#17811) - * Implement Well-Known URL for password change (#17777) - * Add support for ssh commit signing (#17743) - * Allow Loading of Diffs that are too large (#17739) - * Add copy button to markdown code blocks (#17638) - * Add .gitattribute assisted language detection to blame, diff and render (#17590) - * Add `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568) - * Add Reindex buttons to repository settings page (#17494) - * Make SSL cipher suite configurable (#17440) - * Add groups scope/claim to OIDC/OAuth2 Provider (#17367) - * Add simple update checker to Gitea (#17212) - * Migrated Repository will show modifications when possible (#17191) - * Create pub/priv keypair for federation (#17071) - * Make LDAP be able to skip local 2FA (#16954) - * Add nodeinfo endpoint for federation purposes (#16953) - * Save and view issue/comment content history (#16909) - * Use git attributes to determine generated and vendored status for language stats and diffs (#16773) - * Add migrate from Codebase (#16768) - * Add migration from GitBucket (#16767) - * Add OAuth2 introspection endpoint (#16752) - * Add proxy settings and support for migration and webhook (#16704) - * Add microsoft oauth2 providers (#16544) - * Send registration email on user autoregistration (#16523) - * Defer Last Commit Info (#16467) - * Support unprotected file patterns (#16395) - * Add migrate from OneDev (#16356) - * Add option to update pull request by `rebase` (#16125) - * Add RSS/Atom feed support for user actions (#16002) - * Add support for corporate WeChat webhooks (#15910) - * Add a simple way to rename branch like gh (#15870) - * Add bundle download for repository (#14538) - * Add agit flow support in gitea (#14295) -* API - * Add MirrorUpdated field to Repository API type (#18267) - * Adjust Fork API to allow setting a custom repository name (#18066) - * Add API to manage repo tranfers (#17963) - * Add API to get file commit history (#17652) - * Add API to get issue/pull comments and events (timeline) (#17403) - * Add API to get/edit wiki (#17278) - * Add API for get user org permissions (#17232) - * Add HTML urls to notification API (#17178) - * Add API to get commit diff/patch (#17095) - * Respond with updated notifications in API (#17064) - * Add API to fetch git notes (#16649) - * Generalize list header for API (#16551) - * Add API Token Cache (#16547) - * Allow Token API calls be authorized using the reverse-proxy header (#15119) -* ENHANCEMENTS - * Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319) - * Return nicer error if trying to pull from non-existent user (#18288) - * Show pull link for agit pull request also (#18235) - * Enable partial clone by default (#18195) - * Added replay of webhooks (#18191) - * Show OAuth callback error message (#18185) - * Increase Salt randomness (#18179) - * Add MP4 as default allowed attachment type (#18170) - * Include folders into size cost (#18158) - * Remove `/email2user` endpoint (#18127) - * Handle invalid issues (#18111) - * Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069) - * Support open compare page directly (#17975) - * Prefer "Hiragino Kaku Gothic ProN" in system-ui-ja (#17954) - * Clean legacy SimpleMDE code (#17926) - * Refactor install page (db type) (#17919) - * Improve interface when comparing a branch which has created a pull request (#17911) - * Allow default branch to be inferred on compare page (#17908) - * Display issue/comment role even if repo archived (#17907) - * Always set a message-id on mails (#17900) - * Change `<a>` elements to underline on hover (#17898) - * Render issue references in file table (#17897) - * Handle relative unix socket paths (#17836) - * Move accessmode into models/perm (#17828) - * Fix some org style problems (#17807) - * Add List-Unsubscribe header (#17804) - * Create menus for organization pages (#17802) - * Switch archive URL code back to href attributes (#17796) - * Refactor "refs/*" string usage by using constants (#17784) - * Allow forks to org if you can create repos (#17783) - * Improve install code to avoid low-level mistakes. (#17779) - * Improve ellipsis buttons (#17773) - * Add restrict and no-user-rc to authorized_keys (#17772) - * Add copy Commit ID button in commits list (#17759) - * Make `bind` error more readable (#17750) - * Fix navbar on project view (#17749) - * More pleasantly handle broken or missing git repositories (#17747) - * Use `*PushUpdateOptions` as receiver (#17724) - * Remove unused `user` paramater (#17723) - * Better builtin avatar generator (#17707) - * Cleanup and use global style on popups (#17674) - * Move user/org deletion to services (#17673) - * Added comment for changing issue ref (#17672) - * Allow admins to change user avatars (#17661) - * Only set `data-path` once for each file in diff pages (#17657) - * Add icon to vscode clone link (#17641) - * Add download button for file viewer (#17640) - * Add pagination to fork list (#17639) - * Use a standalone struct name for Organization (#17632) - * Minor readability patch. (#17627) - * Add context support for GetUserByID (#17602) - * Move merge-section to `> .content` (#17582) - * Remove NewSession method from db.Engine interface (#17577) - * Move unit into models/unit/ (#17576) - * Restrict GetDeletedBranchByID to the repositories deleted branches (#17570) - * Refactor commentTags functionality (#17558) - * Make Repo Code Indexer an Unique Queue (#17515) - * Simplify Gothic to use our session store instead of creating a different store (#17507) - * Add settings to allow different SMTP envelope from address (#17479) - * Properly determine CSV delimiter (#17459) - * Hide label comments if labels were added and removed immediately (#17455) - * Tune UI alignment for nav bar notification icon, avatar image, issue label (#17438) - * Add appearance section in settings (#17433) - * Move key forms before list and add cancel button (#17432) - * When copying executables to the docker chmod them (#17423) - * Remove deprecated `extendDefaultPlugins` method of svgo (#17399) - * Fix the click behavior for <tr> and <td> with [data-href] (#17388) - * Refactor update checker to use AppState (#17387) - * Improve async/await usage, and sort init calls in `index.js` (#17386) - * Use a variable but a function for IsProd because of a slight performance increment (#17368) - * Frontend refactor, PascalCase to camelCase, remove unused code (#17365) - * Hide command line merge instructions when user can't push (#17339) - * Move session to models/login (#17338) - * Sync gitea app path for git hooks and authorized keys when starting (#17335) - * Make the Mirror Queue a queue (#17326) - * Add "Copy branch name" button to pull request page (#17323) - * Fix repository summary on mobile (#17322) - * Split `index.js` to separate files (#17315) - * Show direct match on top for user search (#17303) - * Frontend refactor: move Vue related code from `index.js` to `components` dir, and remove unused codes. (#17301) - * Upgrade chi to v5 (#17298) - * Disable form autofill (#17291) - * Improve behavior of "Fork" button (#17288) - * Open markdown image links in new window (#17287) - * Add hints for special Wiki pages (#17283) - * Move add deploy key form before the list and add a cancel button (#17228) - * Allow adding multiple issues to a project (#17226) - * Add metrics to get issues by repository (#17225) - * Add specific event type to header (#17222) - * Redirect on project after issue created (#17211) - * Reference in new issue modal: dont pre-populate issue title (#17208) - * Always set a unique Message-ID header (#17206) - * Add projects and project boards in exposed metrics (#17202) - * Add metrics to get issues by label (#17201) - * Add protection to disable Gitea when run as root (#17168) - * Don't return binary file changes in raw PR diffs by default (#17158) - * Support sorting for project board issuses (#17152) - * Force color-adjust for markdown checkboxes (#17146) - * Add option to copy line permalink (#17145) - * Move twofactor to models/login (#17143) - * Multiple tokens support for migrating from github (#17134) - * Unify issue and PR subtitles (#17133) - * Make Requests Processes and create process hierarchy. Associate OpenRepository with context. (#17125) - * Fix problem when database id is not increment as expected (#17124) - * Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123) - * Re-allow clipboard copy on non-https sites (#17118) - * DBContext is just a Context (#17100) - * Move login related structs and functions to models/login (#17093) - * Add SkipLocal2FA option to pam and smtp sources (#17078) - * Move db related basic functions to models/db (#17075) - * Fixes username tagging in "Reference in new issue" (#17074) - * Use light/dark theme based on system preference (#17051) - * Always emit the configuration path (#17036) - * Add `AbsoluteListOptions` (#17028) - * Use common sessioner for API and Web (#17027) - * Fix overflow label in small view (#17020) - * Report the associated filter if there is an error in LDAP (#17014) - * Add "new issue" btn on project (#17001) - * Add doctor dbconsistency check for release and attachment (#16978) - * Disable Fomantic's CSS tooltips (#16974) - * Add Cache-Control to avatar redirects (#16973) - * Make mirror feature more configurable (#16957) - * Add skip and limit to git.GetTags (#16897) - * Remove ParseQueueConnStr as it is unused (#16878) - * Remove unused Fomantic sidebar module (#16853) - * Allow LDAP Sources to provide Avatars (#16851) - * Remove Dashboard/Home button from the navbar (#16844) - * Use conditions but not repo ids as query condition (#16839) - * Add user settings key/value DB table (#16834) - * Add buttons to allow loading of incomplete diffs (#16829) - * Add information for migrate failure (#16803) - * Add EdDSA JWT signing algorithm (#16786) - * Add user status filter to admin user management page (#16770) - * Add Option to synchronize Admin & Restricted states from OIDC/OAuth2 along with Setting Scopes (#16766) - * Do not use thin scrollbars on Firefox (#16738) - * Download LFS in git and web workflow from minio/s3 directly (SERVE_DIRECT) (#16731) - * Compute proper foreground color for labels (#16729) - * Add edit button to wiki sidebar and footer (#16719) - * Fix migration svg color (#16715) - * Add link to vscode to repo header (#16664) - * Add filter by owner and team to issue/pulls search endpoint (#16662) - * Kanban colored boards (#16647) - * Allow setting X-FRAME-OPTIONS (#16643) - * Separate open and closed issue in metrics (#16637) - * Support direct comparison (git diff a..b) as well merge comparison (a…b) (#16635) - * Add setting to OAuth handlers to skip local 2FA authentication (#16594) - * Make PR merge options more intuitive (#16582) - * Show correct text when comparing commits on empty pull request (#16569) - * Pre-fill suggested New File 'name' and 'content' with Query Params (#16556) - * Add an abstract json layout to make it's easier to change json library (#16528) - * Make Mermaid.js limit configurable (#16519) - * Improve 2FA autofill (#16473) - * Add modals to Organization and Team remove/leave (#16471) - * Show tag name on dashboard items list (#16466) - * Change default cron schedules from @every 24h to @midnight (#16431) - * Prevent double sanitize (#16386) - * Replace `list.List` with slices (#16311) - * Add configuration option to restrict users by default (#16256) - * Move login out of models (#16199) - * Support pagination of organizations on user settings pages (#16083) - * Switch migration icon to svg (#15954) - * Add left padding for chunk header of split diff view (#13397) - * Allow U2F 2FA without TOTP (#11573) -* BUGFIXES - * GitLab reviews may not have the updated_at field set (#18450) (#18461) - * Fix detection of no commits when the default branch is not master (#18422) (#18423) - * Fix broken oauth2 authentication source edit page (#18412) (#18419) - * Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404) - * Fix restore without topic failure (#18387) (#18400) - * Fix commit's time (#18375) (#18392) - * Fix partial cloning a repo (#18373) (#18377) - * Stop trimming preceding and suffixing spaces from editor filenames (#18334) - * Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386) - * Fix mime-type detection for HTTP server (#18370) (#18371) - * Stop trimming preceding and suffixing spaces from editor filenames (#18334) - * Restore propagation of ErrDependenciesLeft (#18325) - * Fix PR comments UI (#18323) - * Use indirect comparison when showing pull requests (#18313) - * Replace satori/go.uuid with gofrs/uuid (#18311) - * Fix commit links on compare page (#18310) - * Don't show double error response in git hook (#18292) - * Handle missing default branch better in owner/repo/branches page (#18290) - * Fix CheckRepoStats and reuse it during migration (#18264) - * Prevent underline hover on cards (#18259) - * Don't delete branch if other PRs with this branch are open (#18164) - * Require codereview to have content (#18156) - * Allow admin to associate missing LFS objects for repositories (#18143) - * When attempting to subscribe other user to issue report why access denied (#18091) - * Add option to convert CRLF to LF line endings for sendmail (#18075) - * Only create pprof files for gitea serv if explicitly asked for (#18068) - * Abort merge if head has been updated before pressing merge (#18032) - * Improve TestPatch to use git read-tree -m and implement git-merge-one-file functionality (#18004) - * Use JSON module instead of stdlib json (#18003) - * Fixed issue merged/closed wording (#17973) - * Return nicer error for ForcePrivate (#17971) - * Fix overflow in commit graph (#17947) - * Prevent services/mailer/mailer_test.go tests from deleteing data directory (#17941) - * Use disable_form_autofill on Codebase and Gitbucket (#17936) - * Fix a panic in NotifyCreateIssueComment (caused by string truncation) (#17928) - * Fix markdown URL parsing (#17924) - * Apply CSS Variables to all message elements (#17920) - * Improve checkBranchName (#17901) - * Update chi/middleware to chi/v5/middleware (#17888) - * Fix position of label color picker colors (#17866) - * Fix ListUnadoptedRepositories incorrect total count (#17865) - * Remove whitespace inside rendered code `<td>` (#17859) - * Make Co-committed-by and co-authored-by trailers optional (#17848) - * Fix value of User.IsRestricted when oauth2 user registration (#17839) - * Use new OneDev /milestones endpoint (#17782) - * Prevent deadlock in TestPersistableChannelQueue (#17717) - * Simplify code for writing SHA to name-rev (#17696) - * Fix database deadlock when update issue labels (#17649) - * Add warning for BIDI characters in page renders and in diffs (#17562) - * Fix ipv6 parsing for builtin ssh server (#17561) - * Multiple Escaping Improvements (#17551) - * Fixes #16559 - Do not trim leading spaces for tab delimited (#17442) - * Show client-side error if wiki page is empty (#17415) - * Fix context popup error (#17398) - * Stop sanitizing full name in API (#17396) - * Fix issue close/comment buttons on mobile (#17317) - * Fix navbar UI (#17235) - * Fix problem when database id is not increment as expected (#17229) - * Open the DingTalk link in browser (#17084) - * Remove heads pointing to missing old refs (#17076) - * Fix commit status index problem (#17061) - * Handle broken references in mirror sync (#17013) - * Fix for create repo page layout (#17012) - * Improve LDAP synchronization efficiency (#16994) - * Add repo_id for attachment (#16958) - * Clean-up HookPreReceive and restore functionality for pushing non-standard refs (#16705) - * Remove duplicate csv import in modules/csv/csv.go (#16631) - * Improve SMTP authentication and Fix user creation bugs (#16612) - * Fixed emoji alias not parsed in links (#16221) - * Calculate label URL on API (#16186) -* TRANSLATION - * Fix mispelling of starred as stared (#17465) - * Re-separate the color translation strings (#17390) - * Enable Malayalam, Greek, Persian, Hungarian & Indonesian by default (#16998) -* BUILD - * Add lockfile-check (#18285) - * Don't store assets modified time into generated files (#18193) -* MISC - * Update JS dependencies (#17611) - -## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29 - -* SECURITY - * Only view milestones from current repo (#18414) (#18418) -* BUGFIXES - * Fix broken when no commits and default branch is not master (#18422) (#18424) - * Fix commit's time (#18375) (#18409) - * Fix restore without topic failure (#18387) (#18401) - * Fix mermaid import in 1.15 (it uses ESModule now) (#18382) - * Update to go/text 0.3.7 (#18336) -* MISC - * Upgrade EasyMDE to 2.16.1 (#18278) (#18279) - -## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14 - -* BUGFIXES - * Fix inconsistent PR comment counts (#18260) (#18261) - * Fix release link broken (#18252) (#18253) - * Fix update user from site administration page bug (#18250) (#18251) - * Set HeadCommit when creating tags (#18116) (#18173) - * Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152) - * Fix purple color in suggested label colors (#18241) (#18242) -* SECURITY - * Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206) - -## [1.15.9](https://github.com/go-gitea/gitea/releases/tag/v1.15.9) - 2021-12-30 - -* BUGFIXES - * Fix wrong redirect on org labels (#18128) (#18134) - * Fix: unstable sort skips/duplicates issues across pages (#18094) (#18095) - * Revert "Fix delete u2f keys bug (#18042)" (#18107) - * Migrating wiki don't require token, so we should move it out of the require form (#17645) (#18104) - * Prevent NPE if gitea uploader fails to open url (#18080) (#18101) - * Reset locale on login (#17734) (#18100) - * Correctly handle failed migrations (#17575) (#18099) - * Instead of using routerCtx just escape the url before routing (#18086) (#18098) - * Quote references to the user table in consistency checks (#18072) (#18073) - * Add NotFound handler (#18062) (#18067) - * Ensure that git repository is closed before transfer (#18049) (#18057) - * Use common sessioner for API and web routes (#18114) -* TRANSLATION - * Fix code search result hint on zh-CN (#18053) - -## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-20 - -* BUGFIXES - * Move POST /{username}/action/{action} to simply POST /{username} (#18045) (#18046) - * Fix delete u2f keys bug (#18040) (#18042) - * Reset Session ID on login (#18018) (#18041) - * Prevent off-by-one error on comments on newly appended lines (#18029) (#18035) - * Stop printing 03d after escaped characters in logs (#18030) (#18034) - * Reset locale on login (#18023) (#18025) - * Fix reset password email template (#17025) (#18022) - * Fix outType on gitea dump (#18000) (#18016) - * Ensure complexity, minlength and isPwned are checked on password setting (#18005) (#18015) - * Fix rename notification bug (#18011) - * Prevent double decoding of % in url params (#17997) (#18001) - * Prevent hang in git cat-file if the repository is not a valid repository (Partial #17991) (#17992) - * Prevent deadlock in create issue (#17970) (#17982) -* TESTING - * Use non-expiring key. (#17984) (#17985) - -## [1.15.7](https://github.com/go-gitea/gitea/releases/tag/v1.15.7) - 2021-12-01 - -* ENHANCEMENTS - * Only allow webhook to send requests to allowed hosts (#17482) (#17510) - * Fix login redirection links (#17451) (#17473) -* BUGFIXES - * Fix database inconsistent when admin change user email (#17549) (#17840) - * Use correct user on releases (#17806) (#17818) - * Fix commit count in tag view (#17698) (#17790) - * Fix close issue but time watcher still running (#17643) (#17761) - * Fix Migrate Description (#17692) (#17727) - * Fix bug when project board get open issue number (#17703) (#17726) - * Return 400 but not 500 when request archive with wrong format (#17691) (#17700) - * Fix bug when read mysql database max lifetime (#17682) (#17690) - * Fix database deadlock when update issue labels (#17649) (#17665) - * Fix bug on detect issue/comment writer (#17592) - * Remove appSubUrl from pasted images (#17572) (#17588) - * Make `ParsePatch` more robust (#17573) (#17580) - * Fix stats upon searching issues (#17566) (#17578) - * Escape issue titles in comments list (#17555) (#17556) - * Fix zero created time bug on commit api (#17546) (#17547) - * Fix database keyword quote problem on migration v161 (#17522) (#17523) - * Fix email with + when active (#17518) (#17520) - * Stop double encoding blame commit messages (#17498) (#17500) - * Quote the table name in CountOrphanedObjects (#17487) (#17488) - * Run Migrate in Install rather than just SyncTables (#17475) (#17486) -* BUILD - * Fix golangci-lint warnings (#17598 et al) (#17668) -* MISC - * Preserve color when inverting emojis (#17797) (#17799) - -## [1.15.6](https://github.com/go-gitea/gitea/releases/tag/v1.15.6) - 2021-10-28 - -* BUGFIXES - * Prevent panic in serv.go with Deploy Keys (#17434) (#17435) - * Fix CSV render error (#17406) (#17431) - * Read expected buffer size (#17409) (#17430) - * Ensure that restricted users can access repos for which they are members (#17460) (#17464) - * Make commit-statuses popup show correctly (#17447) (#17466) -* TESTING - * Add integration tests for private.NoServCommand and private.ServCommand (#17456) (#17463) - -## [1.15.5](https://github.com/go-gitea/gitea/releases/tag/v1.15.5) - 2021-10-21 - -* SECURITY - * Upgrade Bluemonday to v1.0.16 (#17372) (#17374) - * Ensure correct SSH permissions check for private and restricted users (#17370) (#17373) -* BUGFIXES - * Prevent NPE in CSV diff rendering when column removed (#17018) (#17377) - * Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH (#17281) (#17376) - * Don't panic if we fail to parse U2FRegistration data (#17304) (#17371) - * Ensure popup text is aligned left (backport for 1.15) (#17343) - * Ensure that git daemon export ok is created for mirrors (#17243) (#17306) - * Disable core.protectNTFS (#17300) (#17302) - * Use pointer for wrappedConn methods (#17295) (#17296) - * AutoRegistration is supposed to be working with disabled registration (backport) (#17292) - * Handle duplicate keys on GPG key ring (#17242) (#17284) - * Fix SVG side by side comparison link (#17375) (#17391) - -## [1.15.4](https://github.com/go-gitea/gitea/releases/tag/v1.15.4) - 2021-10-08 - -* BUGFIXES - * Raw file API: don't try to interpret 40char filenames as commit SHA (#17185) (#17272) - * Don't allow merged PRs to be reopened (#17192) (#17271) - * Fix incorrect repository count on organization tab of dashboard (#17256) (#17266) - * Fix unwanted team review request deletion (#17257) (#17264) - * Fix broken Activities link in team dashboard (#17255) (#17258) - * API pull's head/base have correct permission(#17214) (#17245) - * Fix strange behavior of DownloadPullDiffOrPatch in incorrect index (#17223) (#17227) - * Upgrade xorm to v1.2.5 (#17177) (#17188) - * Fix missing repo link in issue/pull assigned emails (#17183) (#17184) - * Fix bug of get context user (#17169) (#17172) - * Nicely handle missing user in collaborations (#17049) (#17166) - * Add Horizontal scrollbar to inner menu on Chrome (#17086) (#17164) - * Fix wrong i18n keys (#17150) (#17153) - * Fix Archive Creation: correct transaction ending (#17151) - * Prevent panic in Org mode HighlightCodeBlock (#17140) (#17141) - * Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136) (#17137) -* ENHANCEMENT - * Check user instead of organization when creating a repo from a template via API (#16346) (#17195) -* TRANSLATION - * v1.15 fix Sprintf format 'verbs' in locale files (#17187) - -## [1.15.3](https://github.com/go-gitea/gitea/releases/tag/v1.15.3) - 2021-09-19 - -* ENHANCEMENTS - * Add fluid to ui container class to remove margin (#16396) (#16976) - * Add caller to cat-file batch calls (#17082) (#17089) -* BUGFIXES - * Render full plain readme. (#17083) (#17090) - * Upgrade xorm to v1.2.4 (#17059) - * Fix bug of migrate comments which only fetch one page (#17055) (#17058) - * Do not show issue context popup on external issues (#17050) (#17054) - * Decrement Fork Num when converting from Fork (#17035) (#17046) - * Correctly rollback in ForkRepository (#17034) (#17045) - * Fix missing close in WalkGitLog (#17008) (#17009) - * Add prefix to SVG id/class attributes (#16997) (#17000) - * Fix bug of migrated repository not index (#16991) (#16996) - * Skip AllowedUserVisibilityModes validation on update user if it is an organisation (#16988) (#16990) - * Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977) - * Fix issue with issue default mail template (#16956) (#16975) - * Ensure that rebase conflicts are handled in updates (#16952) (#16960) - * Prevent panic on diff generation (#16950) (#16951) - -## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03 - -* BUGFIXES - * Add unique constraint back into issue_index (#16938) - * Close storage objects before cleaning (#16934) (#16942) - -## [1.15.1](https://github.com/go-gitea/gitea/releases/tag/v1.15.1) - 2021-09-02 - -* BUGFIXES - * Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) (#16923) - * Prevent leave changes dialogs due to autofill fields (#16912) (#16920) - * Ignore review comment when ref commit is missed (#16905) (#16919) - * Fix wrong attachment removal (#16915) (#16917) - * Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913) - * Correctly return the number of Repositories for Organizations (#16807) (#16911) - * Test if LFS object is accessible (#16865) (#16904) - * Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900) - * Fix dump and restore respository (#16698) (#16898) - * Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895) - * Fix wiki raw commit diff/patch view (#16891) (#16892) - * Ensure wiki repos are all closed (#16886) (#16888) - * List limited and private orgs if authenticated on API (#16866) (#16879) - * Simplify split diff view generation and remove JS dependency (#16775) (#16863) - * Ensure that the default visibility is set on the user create page (#16845) (#16862) - * In Render tolerate not being passed a context (#16842) (#16858) - * Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848) - * Report the correct number of pushes on the feeds (#16811) (#16822) - * Add primary_key to issue_index (#16813) (#16820) - * Prevent NPE on empty commit (#16812) (#16819) - * Fix branch pagination error (#16805) (#16816) - * Add missing return to handleSettingRemoteAddrError (#16794) (#16795) - * Remove spurious / from issues.opened_by (#16793) - * Ensure that template compilation panics are sent to the logs (#16788) (#16792) - * Update caddyserver/certmagic (#16789) (#16790) - -## [1.15.0](https://github.com/go-gitea/gitea/releases/tag/v1.15.0) - 2021-08-21 - -* BREAKING - * Make app.ini permissions more restrictive (#16266) - * Refactor Webhook + Add X-Hub-Signature (#16176) - * Add asymmetric JWT signing (#16010) - * Clean-up the settings hierarchy for issue_indexer queue (#16001) - * Change default queue settings to be low go-routines (#15964) - * Improve assets handler middleware (#15961) - * Rename StaticUrlPrefix to AssetUrlPrefix (#15779) - * Use a generic markup class to display externally rendered files and diffs (#15735) - * Add frontend testing, require node 12 (#15315) - * Move (custom) assets into subpath `/assets` (#15219) - * Use level config in log section when sub log section not set level (#15176) - * Links in markdown should be absolute to the repository not the server (#15088) - * Upgrade to the latest version of golang-jwt (#16590) (#16606) - * Set minimum supported version of go to 1.16 (#16710) -* SECURITY - * Encrypt LDAP bind password in db with SECRET_KEY (#15547) - * Remove random password in Dockerfiles (#15362) - * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606) - * Correctly create of git-daemon-export-ok files (#16508) (#16514) - * Don't show private user's repo in explore view (#16550) (#16554) - * Update node tar dependency to 6.1.6 (#16622) (#16623) -* FEATURES - * Update Go-Git to take advantage of LargeObjectThreshold (#16316) - * Support custom mime type mapping for text files (#16304) - * Link to previous blames in file blame page (#16259) - * Add LRU mem cache implementation (#16226) - * Localize Email Templates (#16200) - * Make command in authorized keys a template (#16003) - * Add possibility to make branch in branch page (#15960) - * Add email headers (#15939) - * Make tasklist checkboxes clickable (#15791) - * Add selecting tags on the compare page (#15723) - * Add cron job to delete old actions from database (#15688) - * On open repository open common cat file batch and batch-check (#15667) - * Add tag protection (#15629) - * Add push to remote mirror repository (#15157) - * Add Image Diff for SVG files (#14867) - * Add dashboard milestone search and repo milestone search by name. (#14866) - * Add LFS Migration and Mirror (#14726) - * Improve notifications for WIP draft PR's (#14663) - * Disable Stars config option (#14653) - * GPG Key Ownership verification with Signed Token (#14054) - * OAuth2 auto-register (#5123) -* API - * Return updated repository when changing repository using API (#16420) - * Let branch/tag name be a valid ref to get CI status (#16400) - * Add endpoint to get commits of PR (#16300) - * Allow COMMENT reviews to not specify a body (#16229) - * Add subject-type filter to list notification API endpoints (#16177) - * ListReleases add filter for draft and pre-releases (#16175) - * ListIssues add more filters (#16174) - * Issue Search Add filter for MilestoneNames (#16173) - * GET / SET User Settings (#16169) - * Expose repo.GetReviewers() & repo.GetAssignees() (#16168) - * User expose counters (#16167) - * Add repoGetTag (#16166) - * Add repoCreateTag (#16165) - * Creating a repo from a template repo via API (#15958) - * Add Active and ProhibitLogin to API (#15689) - * Add Location, Website and Description to API (#15675) - * Expose resolver via API (#15167) - * Swagger AccessToken fixes (#16574) (#16597) - * Set AllowedHeaders on API CORS handler (#16524) (#16618) -* ENHANCEMENTS - * Support HTTP/2 in Let's Encrypt (#16371) - * Introduce NotifySubjectType (#16320) - * Add forge emojies (#16296) - * Implemented head_commit for webhooks (#16282) - * Upgrade Gliderlabs SSH to 0.3.3 and add FailedConnectionCallback (#16278) - * Add previous/next buttons to review comments (#16273) - * Review comments: break-word for long file names (#16272) - * Add configuration to restrict allowed user visibility modes (#16271) - * Add scroll-margin-top to account for sticky header (#16269) - * Add --quiet and --verbose to gitea web to control initial logging (#16260) - * Use gitea logging module for git module (#16243) - * Add tests for all webhooks (#16214) - * Add button to delete undeleted repositories from failed migrations (#16197) - * Speed up git diff highlight generation (#16180) - * Add OpenID claims "profile" and "email". (#16141) - * Reintroduce squash merge default comment as a config setting (#16134) - * Add sanitizer rules per renderer (#16110) - * Improve performance of dashboard list orgs (#16099) - * Refactor assert statements in tests (#16089) - * Add sso.Group, context.Auth, context.APIAuth to allow auth special routes (#16086) - * Remove unnecessary goroutine (#16080) - * Add attachments for PR reviews (#16075) - * Make the github migration less rate limit waiting to get comment per page from repository but not per issue (#16070) - * Add Visible modes function from Organisation to Users too (#16069) - * Add checkbox to delete pull branch after successful merge (#16049) - * Make commit info cancelable (#16032) - * Make modules/context.Context a context.Context (#16031) - * Unified custom config creation (#16012) - * Make sshd_config more flexible regarding connections (#16009) - * Append to existing trailers in generated squash commit message (#15980) - * Always store primary email address into email_address table and also the state (#15956) - * Load issue/PR context popup data only when needed (#15955) - * Remove remaining fontawesome usage in templates (#15952) - * Remove fomantic accordion module (#15951) - * Small refactoring of modules/private (#15947) - * Double the avatar size factor (#15941) - * Add curl to rootless docker image (#15908) - * Replace clipboard.js with async clipboard api (#15899) - * Allow custom highlight mapping beyond file extensions (#15808) - * Add trace logging to SSO methods (#15803) - * Refactor routers directory (#15800) - * Allow only internal registration (#15795) - * Add a new internal hook to save ssh log (#15787) - * Respect default merge message syntax when parsing item references (#15772) - * OAuth2 login: Set account link to "login" as default behavior (#15768) - * Use single shared random string generation function (#15741) - * Hold the event source when there are no listeners (#15725) - * Code comments improvements (#15722) - * Provide OIDC compliant user info endpoint (#15721) - * Fix webkit calendar icon color on arc-green (#15713) - * Improve Light Chroma style (#15699) - * Only use boost workers for leveldb shadow queues (#15696) - * Add compare tag dropdown to releases page (#15695) - * Add caret styling CSS (#15651) - * Remove x-ua-compatible meta tag (#15640) - * Refactor of link creation (#15619) - * Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index (#15599) - * Rewrite of the LFS server (#15523) - * Display more repository type on admin repository management (#15440) - * Remove usage of some JS globals (#15378) - * SHA in merged commit comment should be rendered ui sha (#15376) - * Add well-known config for OIDC (#15355) - * Use route rather than use thus reducing the number of stack frames (#15301) - * Code Formats, Nits & Unused Func/Var deletions (#15286) - * Let package git depend on setting but not opposite (#15241) - * Fixed sanitize errors (#15240) - * response simple text message for not html request when 404 (#15229) - * Remove file-loader dependency (#15196) - * Refactor renders (#15175) - * Add mimetype mapping settings (#15133) - * Add Status Updates whilst Gitea migrations are occurring (#15076) - * Reload locales in initialisation if needed by utilizing i18n.Reset (#15073) - * Counterwork seemingly unclickable repo button labels (#15064) - * Add DefaultMergeStyle option to repository (#14789) - * Added support for gopher URLs. (#14749) - * Rework repository archive (#14723) - * Add links to toggle WIP status (#14677) - * Add Tabular Diff for CSV files (#14661) - * Use milestone deadline when sorting issues (#14551) -* BUGFIXES - * Fix invalid params and typo of email templates (#16394) - * Fix activation of primary email addresses (#16385) - * Fix calculation for finalPage in repo-search component (#16382) - * Specify user in rootless container numerically (#16361) - * Detect encoding changes while parsing diff (#16330) - * Fix U2F error reasons always hidden (#16327) - * Prevent zombie processes (#16314) - * Escape reference to `user` table in models.SearchEmails (#16313) - * Fix default push instructions on empty repos (#16302) - * Fix modified files list in webhooks when there is a space (#16288) - * Fix webhook commits wrong hash on HEAD reset (#16283) - * Fuzzer finds an NPE due to incorrect URLPrefix (#16249) - * Don't WARN log UserNotExist errors on ExternalUserLogin failure (#16238) - * Do not show No match found for tribute (#16231) - * Fix "Copy Link" for pull requests (#16230) - * Fix diff expansion is missing final line in a file (#16222) - * Fix private repo permission problem (#16142) - * Fix not able to update local created non-urlencoded wiki pages (#16139) - * More efficiently parse shas for shaPostProcessor (#16101) - * Fix `doctor --run check-db-consistency --fix` with label fix (#16094) - * Prevent webhook action buttons from shifting (#16087) - * Change default TMPDIR path in rootless containers (#16077) - * Fix typo and add TODO notice (#16064) - * Use git log name-status in get last commit (#16059) - * Fix 500 Error with branch and tag sharing the same name (#16040) - * Fix get tag when migration (#16014) - * Add custom emoji support (#16004) - * Use filepath.ToSlash and Join in indexer defaults and queues (#15971) - * Add permission check for ``GenerateRepository`` (#15946) - * Ensure settings for Service and Mailer are read on the install page (#15943) - * Fix layout of milestone view (#15927) - * Unregister non-matching serviceworkers (#15834) - * Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693) - * Attachment support repository route (#15580) - * Fix missing icons and colorpicker when mounted on suburl (#15501) - * Create a session on ReverseProxy and ensure that ReverseProxy users cannot change username (#15304) - * Prevent double-login for Git HTTP and LFS and simplify login (#15303) - * Resolve Object { type: "error", data: undefined } in stopwatch.js (#15278) - * Fix heatmap activity (#15252) - * Remove vendored copy of fomantic-dropdown (#15193) - * Update repository size on cron gc task (#15177) - * Add NeedPostProcess for Parser interface to improve performance of csv parser and some external parser (#15153) - * Add code block highlight to orgmode back (#14222) - * Remove User.GetOrganizations() (#14032) - * Restore Accessibility for Dropdown (#16576) (#16617) - * Pass down SignedUserName down to AccessLogger context (#16605) (#16616) - * Fix table alignment in markdown (#16596) (#16602) - * Fix 500 on first wiki page (#16586) (#16598) - * Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570) - * Upgrade levelqueue to v0.4.0 (#16560) (#16561) - * Handle too long PR titles correctly (#16517) (#16549) - * Fix data race in bleve indexer (#16474) (#16509) - * Restore CORS on git smart http protocol (#16496) (#16506) - * Fix race in log (#16490) (#16505) - * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498) - * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480) - * Update notification table with only latest data (#16445) (#16469) - * Fix crash following ldap authentication update (#16447) (#16448) - * Fix direct creation of external users on admin page (partial #16612) (#16613) - * Prevent 500 on draft releases without tag (#16634) (#16636) - * Restore creation of git-daemon-export-ok files (#16508) (#16514) - * Fix data race in bleve indexer (#16474) (#16509) - * Restore CORS on git smart http protocol (#16496) (#16506) - * Fix race in log (#16490) (#16505) - * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498) - * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480) - * Update notification table with only latest data (#16445) (#16469) - * Fix crash following ldap authentication update (#16447) (#16448) - * Restore compatibility with SQLServer 2008 R2 in migrations (#16638) - * Fix direct creation of external users on admin page (#16613) - * Fix go-git implementation of GetNote when passed a non-existent commit (#16658) (#16659) - * Fix NPE in fuzzer (#16680) (#16682) - * Set issue_index when finishing migration (#16685) (#16687) - * Skip patch download when no patch file exists (#16356) (#16681) - * Ensure empty lines are copiable and final new line too (#16678) (#16692) - * Fix wrong user in OpenID response (#16736) (#16741) - * Do not use thin scrollbars on Firefox (#16738) (#16745) - * Recreate Tables should Recreate indexes on MySQL (#16718) (#16739) - * Keep attachments on tasklist update (#16750) (#16757) -* TESTING - * Bump `postgres` and `mysql` versions (#15710) - * Add tests for clone from wiki (#15513) - * Fix Benchmark tests, remove a broken one & add two new (#15250) - * Create Proper Migration tests (#15116) -* TRANSLATION - * Use a special name for update default branch on repository setting (#15893) - * Fix mirror_lfs source string in en-US locale (#15369) -* BUILD - * Upgrade xorm to v1.1.1 (#16339) - * Disable legal comments in esbuild (#15929) - * Switch to Node 16 to build fronted (#15804) - * Use esbuild to minify CSS (#15756) - * Use binary version of revive linter (#15739) - * Fix: npx webpack make: *** [Makefile:699: public/js/index.js] Error -… (#15465) - * Stop packaging node_modules in release tarballs (#15273) - * Introduce esbuild on webpack (#14578) -* DOCS - * Update queue workers documentation (#15999) - * Comment out app.example.ini (#15807) - * Improve logo customization docs (#15754) - * Add some response status on api docs (#15399) - * Rework Token API comments (#15162) - * Add better errors for disabled account recovery (#15117) -* MISC - * Remove utf8 option from installation page (#16126) - * Use Wants= over Requires= in systemd file (#15897) - -## [1.14.7](https://github.com/go-gitea/gitea/releases/tag/v1.14.7) - 2021-09-02 - -* BUGFIXES - * Add missing gitRepo close at GetDiffRangeWithWhitespaceBehavior (Partial #16894) (#16896) - * Fix wiki raw commit diff/patch view (#16891) (#16893) - * Ensure wiki repos are all closed (#16886) (#16889) - * Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16849) - * Recreate Tables should Recreate indexes on MySQL (#16718) (#16740) - -## [1.14.6](https://github.com/go-gitea/gitea/releases/tag/v1.14.6) - 2021-08-04 - -* SECURITY - * Bump github.com/markbates/goth from v1.67.1 to v1.68.0 (#16538) (#16540) - * Switch to maintained JWT lib (#16532) (#16535) - * Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607) -* BUGFIXES - * Add basic edit ldap auth test & actually fix #16252 (#16465) (#16495) - * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16481) - -## [1.14.5](https://github.com/go-gitea/gitea/releases/tag/v1.14.5) - 2021-07-16 - -* SECURITY - * Hide mirror passwords on repo settings page (#16022) (#16355) - * Update bluemonday to v1.0.15 (#16379) (#16380) -* BUGFIXES - * Retry rename on lock induced failures (#16435) (#16439) - * Validate issue index before querying DB (#16406) (#16410) - * Fix crash following ldap authentication update (#16447) (#16449) -* ENHANCEMENTS - * Redirect on bad CSRF instead of presenting bad page (#14937) (#16378) - -## [1.14.4](https://github.com/go-gitea/gitea/releases/tag/v1.14.4) - 2021-07-06 - -* BUGFIXES - * Fix relative links in postprocessed images (#16334) (#16340) - * Fix list_options GetStartEnd (#16303) (#16305) - * Fix API to use author for commits instead of committer (#16276) (#16277) - * Handle misencoding of login_source cfg in mssql (#16268) (#16275) - * Fixed issues not updated by commits (#16254) (#16261) - * Improve efficiency in FindRenderizableReferenceNumeric and getReference (#16251) (#16255) - * Use html.Parse rather than html.ParseFragment (#16223) (#16225) - * Fix milestone counters on new issue (#16183) (#16224) - * reqOrgMembership calls need to be preceded by reqToken (#16198) (#16219) - -## [1.14.3](https://github.com/go-gitea/gitea/releases/tag/v1.14.3) - 2021-06-18 - -* SECURITY - * Encrypt migration credentials at rest (#15895) (#16187) - * Only check access tokens if they are likely to be tokens (#16164) (#16171) - * Add missing SameSite settings for the i_like_gitea cookie (#16037) (#16039) - * Fix setting of SameSite on cookies (#15989) (#15991) -* API - * Repository object only count releases as releases (#16184) (#16190) - * EditOrg respect RepoAdminChangeTeamAccess option (#16184) (#16190) - * Fix overly strict edit pr permissions (#15900) (#16081) -* BUGFIXES - * Run processors on whole of text (#16155) (#16185) - * Class `issue-keyword` is being incorrectly stripped off spans (#16163) (#16172) - * Fix language switch for install page (#16043) (#16128) - * Fix bug on getIssueIDsByRepoID (#16119) (#16124) - * Set self-adjusting deadline for connection writing (#16068) (#16123) - * Fix http path bug (#16117) (#16120) - * Fix data URI scramble (#16098) (#16118) - * Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs (#16067) (#16097) - * git migration: don't prompt interactively for clone credentials (#15902) (#16082) - * Fix case change in ownernames (#16045) (#16050) - * Don't manipulate input params in email notification (#16011) (#16033) - * Remove branch URL before IssueRefURL (#15968) (#15970) - * Fix layout of milestone view (#15927) (#15940) - * GitHub Migration, migrate draft releases too (#15884) (#15888) - * Close the gitrepo when deleting the repository (#15876) (#15887) - * Upgrade xorm to v1.1.0 (#15869) (#15885) - * Fix blame row height alignment (#15863) (#15883) - * Fix error message when saving generated LOCAL_ROOT_URL config (#15880) (#15882) - * Backport Fix LFS commit finder not working (#15856) (#15874) - * Stop calling WriteHeader in Write (#15862) (#15873) - * Add timeout to writing to responses (#15831) (#15872) - * Return go-get info on subdirs (#15642) (#15871) - * Restore PAM user autocreation functionality (#15825) (#15867) - * Fix truncate utf8 string (#15828) (#15854) - * Fix bound address/port for caddy's certmagic library (#15758) (#15848) - * Upgrade unrolled/render to v1.1.1 (#15845) (#15846) - * Queue manager FlushAll can loop rapidly - add delay (#15733) (#15840) - * Tagger can be empty, as can Commit and Author - tolerate this (#15835) (#15839) - * Set autocomplete off on branches selector (#15809) (#15833) - * Add missing error to Doctor log (#15813) (#15824) - * Move restore repo to internal router and invoke from command to avoid open the same db file or queues files (#15790) (#15816) -* ENHANCEMENTS - * Removable media support to snap package (#16136) (#16138) - * Move sans-serif fallback font higher than emoji fonts (#15855) (#15892) -* DOCKER - * Only write config in environment-to-ini if there are changes (#15861) (#15868) - * Only offer hostcertificates if they exist (#15849) (#15853) - -## [1.14.2](https://github.com/go-gitea/gitea/releases/tag/v1.14.2) - 2021-05-09 - -* API - * Make change repo settings work on empty repos (#15778) (#15789) - * Add pull "merged" notification subject status to API (#15344) (#15654) -* BUGFIXES - * Ensure that ctx.Written is checked after issues(...) calls (#15797) (#15798) - * Use pulls in commit graph unless pulls are disabled (#15734 & #15740 & #15774) (#15775) - * Set GIT_DIR correctly if it is not set (#15751) (#15769) - * Fix bug where repositories appear unadopted (#15757) (#15767) - * Not show `ref-in-new-issue` pop when issue was disabled (#15761) (#15765) - * Drop back to use IsAnInteractiveSession for SVC (#15749) (#15762) - * Fix setting version table in dump (#15753) (#15759) - * Fix close button change on delete in simplemde area (#15737) (#15747) - * Defer closing the gitrepo until the end of the wrapped context functions (#15653) (#15746) - * Fix some ui bug about draft release (#15137) (#15745) - * Only log Error on getLastCommitStatus error to let pull list still be visible (#15716) (#15715) - * Move tooltip down to allow selection of Remove File on error (#15672) (#15714) - * Fix setting redis db path (#15698) (#15708) - * Fix DB session cleanup (#15697) (#15700) - * Fixed several activation bugs (#15473) (#15685) - * Delete references if repository gets deleted (#15681) (#15684) - * Fix orphaned objects deletion bug (#15657) (#15683) - * Delete protected branch if repository gets removed (#15658) (#15676) - * Remove spurious set name from eventsource.sharedworker.js (#15643) (#15652) - * Not update updated uinx for `git gc` (#15637) (#15641) - * Fix commit graph author link (#15627) (#15630) - * Fix webhook timeout bug (#15613) (#15621) - * Resolve panic on failed interface conversion in migration v156 (#15604) (#15610) - * Fix missing storage init (#15589) (#15598) - * If the default branch is not present do not report error on stats indexing (#15546 & #15583) (#15594) - * Fix lfs management find (#15537) (#15578) - * Fix NPE on view commit with notes (#15561) (#15573) - * Fix bug on commit graph (#15517) (#15530) - * Send size to /avatars if requested (#15459) (#15528) - * Prevent migration 156 failure if tag commit missing (#15519) (#15527) -* ENHANCEMENTS - * Display conflict-free merge messages for pull requests (#15773) (#15796) - * Exponential Backoff for ByteFIFO (#15724) (#15793) - * Issue list alignment tweaks (#15483) (#15766) - * Implement delete release attachments and update release attachments' name (#14130) (#15666) - * Add placeholder text to deploy key textarea (#15575) (#15576) - * Project board improvements (#15429) (#15560) - * Repo branch page: label size, PR ref, new PR button alignment (#15363) (#15365) -* MISC - * Fix webkit calendar icon color on arc-green (#15713) (#15728) - * Performance improvement for last commit cache and show-ref (#15455) (#15701) - * Bump unrolled/render to v1.1.0 (#15581) (#15608) - * Add ETag header (#15370) (#15552) - -## [1.14.1](https://github.com/go-gitea/gitea/releases/tag/v1.14.1) - 2021-04-15 - -* BUGFIXES - * Fix bug clone wiki (#15499) (#15502) - * Github Migration ignore rate limit, if not enabled (#15490) (#15495) - * Use subdir for URL (#15446) (#15493) - * Query the DB for the hash before inserting in to email_hash (#15457) (#15491) - * Ensure review dismissal only dismisses the correct review (#15477) (#15489) - * Use index of the supported tags to choose user lang (#15452) (#15488) - * Fix wrong file link in code search page (#15466) (#15486) - * Quick template fix for built-in SSH server in admin config (#15464) (#15481) - * Prevent superfluous response.WriteHeader (#15456) (#15476) - * Fix ambiguous argument error on tags (#15432) (#15474) - * Add created_unix instead of expiry to migration (#15458) (#15463) - * Fix repository search (#15428) (#15442) - * Prevent NPE on avatar direct rendering if federated avatars disabled (#15434) (#15439) - * Fix wiki clone urls (#15430) (#15431) - * Fix dingtalk icon url at webhook (#15417) (#15426) - * Standardise icon on projects PR page (#15387) (#15408) -* ENHANCEMENTS - * Add option to skip LFS/attachment files for `dump` (#15407) (#15492) - * Clone panel fixes (#15436) - * Use semantic dropdown for code search query type (#15276) (#15364) -* BUILD - * Build go-git variants for windows (#15482) (#15487) - * Lock down build-images dependencies (Partial #15479) (#15480) -* MISC - * Performance improvement for list pull requests (#15447) (#15500) - * Fix potential copy lfs records failure when fork a repository (#15441) (#15485) - -## [1.14.0](https://github.com/go-gitea/gitea/releases/tag/v1.14.0) - 2021-04-11 - -* SECURITY - * Respect approved email domain list for externally validated user registration (#15014) - * Add reverse proxy configuration support for remote IP address detection (#14959) - * Ensure validation occurs on clone addresses too (#14994) - * Fix several render issues highlighted during fuzzing (#14986) -* BREAKING - * Fix double 'push tag' action feed (#15078) (#15083) - * Remove possible resource leak (#15067) (#15082) - * Handle unauthorized user events gracefully (#15071) (#15074) - * Restore Access.log following migration to Chi framework (Stops access logging of /api/internal routes) (#14475) - * Migrate from Macaron to Chi framework (#14293) - * Deprecate building for mips (#14174) - * Consolidate Logos and update README header (#14136) - * Inline manifest.json (#14038) - * Store repository data in data path if not previously set (#13991) - * Rename "gitea" png to "logo" (#13974) - * Standardise logging of failed authentication attempts in internal SSH (#13962) - * Add markdown support in organization description (#13549) - * Improve users management through the CLI (#6001) (#10492) -* FEATURES - * Create a new issue with reference to lines of code from file view (#14863) - * Repository transfer has to be confirmed, if user can not create repo for new owner (#14792) - * Allow blocking some email domains from registering an account (#14667) - * Create a new issue based on reference to an issue comment (#14366) - * Add support to migrate from gogs (#14342) - * Add pager to the branches page (#14202) - * Minimal OpenID Connect implementation (#14139) - * Display current stopwatch in navbar (#14122) - * Display SVG files as images instead of text (#14101) - * Disable SSH key deletion of externally managed Keys (#13985) - * Add support for ed25519_sk and ecdsa_sk SSH keys (#13462) - * Add support for Mastodon OAuth2 provider (#13293) - * Add gitea sendmail command (#13079) - * Create DB session provider(based on xorm) (#13031) - * Add dismiss review feature (#12674) - * Make manual merge autodetection optional and add manual merge as merge method (#12543) - * Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244) - * Create Rootless Docker image (#10154) -* API - * Speedup issue search (#15179) (#15192) - * Get pull, return head branch sha, even if deleted (#14931) - * Export LFS & TimeTracking function status (#14753) - * Show Gitea version in swagger (#14654) - * Fix PATCH /repos/{owner}/{repo} panic (#14637) - * Add Restricted Field to User (#14630) - * Add support for ref parameter to get raw file API (#14602) - * Add affected files of commits to commit struct (#14579) - * Fix CJK fonts again and misc. font issues (#14575) - * Add delete release by tag & delete tag (#14563) & (#13358) - * Add pagination to ListBranches (#14524) - * Add signoff option in commit form (#14516) - * GetRelease by tag only return release (#14397) - * Add MirrorInterval to the API (#14163) - * Make BasicAuth Prefix case insensitive (#14106) - * Add user filter to issueTrackedTimes, enable usage for issue managers (#14081) - * Add ref to create/edit issue options & deprecated assignee (#13992) - * Add Ref to Issue (#13946) - * Expose default theme in meta and API (#13809) - * Send error message when CSRF token is missing (#13676) - * List, Check, Add & delete endpoints for repository teams (#13630) - * Admin EditUser: Make FullName, Email, Website & Location optional (#13562) - * Add more filters to issues search (#13514) - * Add review request api (#11355) -* BUGFIXES - * Fix delete nonexist oauth application 500 and prevent deadlock (#15384) (#15396) - * Always set the merge base used to merge the commit (#15352) (#15385) - * Upgrade to bluemonday 1.0.7 (#15379) (#15380) - * Turn RepoRef and RepoAssignment back into func(*Context) (#15372) (#15377) - * Move FCGI req.URL.Path fix-up to the FCGI listener (#15292) (#15361) - * Show diff on rename with diff changes (#15338) (#15339) - * Fix handling of logout event (#15323) (#15337) - * Fix CanCreateRepo check (#15311) (#15321) - * Fix xorm log stack level (#15285) (#15316) - * Fix bug in Wrap (#15302) (#15309) - * Drop the event source if we are unauthorized (#15275) (#15280) - * Backport Fix graph pagination (#15225) (#15249) - * Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15200) - * should run RetrieveRepoMetas() for empty pr (#15187) (#15190) - * Move setting to enable closing issue via commit in non default branch to repo settings (#14965) - * Show correct issues for team dashboard (#14952) - * Ensure that new pull request button works on forked forks owned by owner of the root and reduce ambiguity (#14932) - * Only allow issue labels from owner repository or organization (#14928) - * Fix alignment of People and Teams right arrow on org homepage (#14924) - * Fix overdue marking of closed issues and milestones (#14923) - * Prevent panic when empty MilestoneID in repo/issue/list (#14911) - * Fix migration context data (#14910) - * Handle URLs with trailing slash (#14852) - * Add CORS config on to /login/oauth/access_token endpoint (#14850) - * Make searching issues by keyword case insensitive on DB (#14848) - * Prevent use of double sub-path and incorrect asset path in manifest (#14827) - * Fix link account ui (#14763) - * Fix preview status switch button on wiki editor (#14742) - * Fix github download on migration (#14703) - * Fix svg spacing (#14638) - * Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623) - * Truncated organizations name (#14615) - * Exclude the current dump file from the dump (#14606) - * Use OldRef instead of CommitSHA for DeleteBranch comments (#14604) - * Ensure memcache caching works when TTL greater than 30 days (#14592) - * Remove NULs byte arrays passed to PostProcess (#14587) - * Restore detection of branches are equal on compare page (#14586) - * Fix incorrect key name so registerManualConfirm works (#14455) - * Fix close/reopen with comment (#14436) - * Allow passcode invalid error to appear (#14371) - * Escape branch names in compare url (#14364) - * Label and milestone webhooks on issue/pull creation (#14363) - * Handle NotifyCreateRef as create branch in feeds (#14245) - * Prevent clipping input text in Chrome + Segoe UI Font (#14179) - * Fix UI on edit auth source page (#14137) - * Fix git.parseTagData (#14105) - * Refactor get tag to remove unnecessary steps (#14058) - * Fix integrations test error with space in CURDIR path (#14056) - * Dropdown triangle fixes (#14028) - * Fix label of --id in admin delete user (#14005) - * Cause NotifyMigrateRepository to emit a repo create webhook (#14004) - * Update HEAD to match defaultBranch in template generation (#13948) - * Fix action avatar loading (#13909) - * Fix issue participants (#13893) - * Fix avatar template error (#13833) - * Fix review request notification email links when external issue tracker is enabled (#13723) - * Fix blame line alignment (#13542) - * Include OriginalAuthor in Reaction constraint (#13505) - * Comments on review should have the same sha (#13448) - * Fix whitespace rendering in diff (#13415) - * Fixed git args duplication (#13411) - * Fix bug on release publisherid migrations (#13410) - * Fix --port setting (#13288) - * Keep database transactions not too big (#13254) - * Git version check, ignore pre-releases constraints (#13234) - * Handle and propagate errors when checking if paths are Dirs, Files or Exist (#13186) - * Update Mirror IsEmpty status on synchronize (#13185) - * Use GO variable in go-check target (#13146) (#13147) -* ENHANCEMENTS - * UI style improvements - * Dropzone styling improvements (#15291) (#15374) - * Add size to Save function (#15264) (#15270) - * Monaco improvements (#15333) (#15345) - * Support .mailmap in code activity stats (#15009) - * Sort release attachments by name (#15008) - * Add ui.explore settings to control view of explore pages (#14094) - * Make internal SSH server host key path configurable (#14918) - * Hide resync all ssh principals when using internal ssh server (#14904) - * Add SameSite setting for cookies (#14900) - * Move Bleve and Elastic code indexers to use a common cat-file --batch (#14781) - * Add environment-to-ini to docker image (#14762) - * Add preview support for wiki editor when disable simpleMDE (#14757) - * Add easyMDE(simpleMDE) support for release content editor (#14744) - * Organization removal confirmation using name not password (#14738) - * Make branch names in PR description clickable (#14716) - * Add Password Algorithm option to install page (#14701) - * Add fullTextSearch to dropdowns by default (#14694) - * Fix truncated organization names (#14655) - * Whitespace in commits (#14650) - * Sort / move project boards (#14634) - * Make fileheader sticky in diffs (#14616) - * Add helper descriptions on new repo page (#14591) - * Move the stopwatches to the eventsource stream (#14588) - * Add Content-Length header to HEAD requests (#14542) - * Add Image Diff options in Diff view (#14450) - * Improve Description in new/ edit Project template (#14429) - * Allow ssh-keygen on Windows to detect ssh key type (#14413) - * Display error if twofaSecret cannot be retrieved (#14372) - * Sort issue search results by revelance (#14353) - * Implement ghost comment mitigation (#14349) - * Upgrade blevesearch dependency to v2.0.1 (#14346) - * Add edit, delete and reaction support to code review comments on issue page (#14339) - * Merge default and system webhooks under one menu (#14244) - * Add option for administrator to reset user 2FA (#14243) - * Add option to change username to the admin panel (#14229) - * Check for 'main' as potential default branch name (#14193) - * Project: show referenced PRs in issue cards (#14183) - * Use caddy's certmagic library for extensible/robust ACME handling (#14177) - * CLI support for OAuth sources custom icons (#14166) - * Custom icons for OAuth sources (#14161) - * Team dashboards (#14159) - * KanBan: be able to set default board (#14147) - * Disable Fomantic's custom scrollbars (#14109) - * Add UI to delete tracked times (#14100) - * Rework heatmap permissions (#14080) - * Issue and pull request filters on organization dashboard (#14072) - * Fix webhook list styling (#14001) - * Show dropdown with all statuses for commit (#13977) - * Show status check for merged PRs (#13975) - * Diff stat improvements (#13954) - * Report permissions denied in internal SSH (#13953) - * Markdown task list improvements (#13952) - * Heatmap days clickable (#13935) - * chore: use octicon-mirror for feeds display (#13928) - * Move diff split code into own template file (#13919) - * Markdown: Enable wrapping in code blocks and a color tweak (#13894) - * Do not reload page after adding comments in Pull Request reviews (#13877) - * Add pull request manually merge instruction (#13840) - * add thumbnail preview section to issue attachments (#13826) - * Move Repo APIFormat to convert package (#13787) - * Move notification APIFormat (#13783) - * Swap swagger-ui with swagger-ui-dist (#13777) - * User Settings: Ignore empty language codes & validate (#13755) - * Improve migrate page and add card CSS (#13751) - * Add block on official review requests branch protection (#13705) - * Add review requested filter on pull request overview (#13701) - * Use chronological commit order in default squash message (#13696) - * Clickable links in pull request (and issue) titles (#13695) - * Support shortened commit SHAs in URLs (#13686) - * Use native git variants by default with go-git variants as build tag (#13673) - * Don't render dropdown when only 1 merge style is available (#13670) - * Move webhook type from int to string (#13664) - * Direct avatar rendering (#13649) - * Verify password for local-account activation (#13631) - * Prevent clone protocol button flash on page load (#13626) - * Remove fetch request from heatmap (#13623) - * Refactor combine label comments with tests (#13619) - * Move metrics from macaron to chi (#13601) - * Issue and Pulls lists rework (#13594) - * HTTP cache rework and enable caching for storage assets (#13569) - * Use mount but not register for chi routes (#13555) - * Use monaco for the git hook editor (#13552) - * Make heatmap colors more distinct (#13533) - * Lazy-load issue reviewers and assignees avatars (#13526) - * Change search and filter icons to SVG (#13473) - * Create tag on ui (#13467) - * updateSize when create a repo with init commit (#13441) - * Added title and action buttons to Project view page (#13437) - * Override fomantic monospace fonts and set size (#13435) - * Rework focused comment styling (#13434) - * Tags cleanup (#13428) - * Various style tweaks (#13418) - * Refactor push update (#13381) - * Comment box tweaks and SVG dropdown triangles (#13376) - * Various style fixes (#13372) - * Change repo home page icons to SVG (#13364) - * Use CSS Vars for primary color (#13361) - * Refactor image paste code (#13354) - * Switch from SimpleMDE to EasyMDE (#13333) - * Group Label Changed Comments in timeline (#13304) - * Make the logger an interface (#13294) - * Fix PR/Issue titles on mobile (#13292) - * Rearrange the order of the merged by etc. in locale (#13284) - * Replace footer and modal icons with SVG (#13245) - * Issues overview should not show issues from archived repos (#13220) - * Show stale label for stale code comment which is marked as resolved (#13213) - * Use CSS Variables for fonts, remove postcss-loader (#13204) - * Add mentionable teams to tributeValues and change team mention rules to gh's style (#13198) - * Move install pages out of main macaron routes (#13195) - * Update outdated label to use Fomantic UI style (#13181) - * Added option to disable webhooks (#13176) - * Change order of possible-owner organizations to alphabetical (#13160) - * Log IP on SSH authentication failure for Built-in SSH server (#13150) - * Added option to disable migrations (#13114) - * New "Add Mirror" Button in the Organization view (#13105) - * Manually approve new registration (#13083) - * Cron job to cleanup hook_task table (#13080) - * Use the headline comment of pull-request as the squash commit's message (#13071) - * Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL (#12999) - * Slightly simplify the queue settings code to help reduce the risk of problems (#12976) - * Add precise search type for Elastic Search (#12869) - * Move APIFormat functions into convert package (#12856) - * Multiple GitGraph improvements: Exclude PR heads, Add branch/PR links, Show only certain branches, (#12766) - * Add TrN for repository limit (#12492) - * Refactor doctor (#12264) - * Add the tag list page to the release page (#12096) - * Redirect on changed user and org name (#11649) - * load U2F js only on pages which need it (#11585) - * Make archival asynchronous (#11296) - * Introduce go chi web framework as frontend of macaron, so that we can move routes from macaron to chi step by step (#7420) - * Improve vfsgen to not unzip bindata files but send to browser directly (#7109) - * Enhance release list (#6025) -* DOCS - * Swagger show models by default (#14880) - * Add missing repo.projects unit into swagger (#14876) - * Update docs and comments to remove macaron (#14491) - * Issue template addition: Are you using Gitea behind CloudFlare? (#14098) - * Generate man pages (#13901) - * Reformat/fine-tune docs (#13897) - * Added Table of Contents to long documentation pages (#13890) - * Add docs command (#13429) - * Update external-renderers.en-us.md (#13165) -* MISC - * Add builds for apple M1 (darwin arm64) (#14951) - * Migrate to use jsoniter instead of encoding/json (#14841) - * Reduce make verbosity (#13803) - * Add git command error directory on log (#13194) - -## [1.13.7](https://github.com/go-gitea/gitea/releases/tag/v1.13.7) - 2021-04-07 - -* SECURITY - * Update to bluemonday-1.0.6 (#15294) (#15298) - * Clusterfuzz found another way (#15160) (#15169) -* API - * Fix wrong user returned in API (#15139) (#15150) -* BUGFIXES - * Add 'fonts' into 'KnownPublicEntries' (#15188) (#15317) - * Speed up `enry.IsVendor` (#15213) (#15246) - * Response 404 for diff/patch of a commit that not exist (#15221) (#15238) - * Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15201) -* MISC - * Add size to Save function (#15264) (#15271) - -## [1.13.6](https://github.com/go-gitea/gitea/releases/tag/v1.13.6) - 2021-03-23 - -* SECURITY - * Fix bug on avatar middleware (#15124) (#15125) - * Fix another clusterfuzz identified issue (#15096) (#15114) -* API - * Fix nil exeption for get pull reviews API #15104 (#15106) -* BUGFIXES - * Fix markdown rendering in milestone content (#15056) (#15092) - -## [1.13.5](https://github.com/go-gitea/gitea/releases/tag/v1.13.5) - 2021-03-21 - -* SECURITY - * Update to goldmark 1.3.3 (#15059) (#15061) - * Another clusterfuzz spotted issue (#15032) (#15034) -* API - * Fix set milestone on PR creation (#14981) (#15001) - * Prevent panic when editing forked repos by API (#14960) (#14963) -* BUGFIXES - * Fix bug when upload on web (#15042) (#15055) - * Delete Labels & IssueLabels on Repo Delete too (#15039) (#15051) - * Fix postgres ID sequences broken by recreate-table (#15015) (#15029) - * Fix several render issues (#14986) (#15013) - * Make sure sibling images get a link too (#14979) (#14995) - * Fix Anchor jumping with escaped query components (#14969) (#14977) - * Fix release mail html template (#14976) - * Fix excluding more than two labels on issues list (#14962) (#14973) - * Don't mark each comment poster as OP (#14971) (#14972) - * Add "captcha" to list of reserved usernames (#14930) - * Re-enable import local paths after reversion from #13610 (#14925) (#14927) - -## [1.13.4](https://github.com/go-gitea/gitea/releases/tag/v1.13.4) - 2021-03-07 - -* SECURITY - * Fix issue popups (#14898) (#14899) -* BUGFIXES - * Fix race in LFS ContentStore.Put(...) (#14895) (#14913) - * Fix a couple of issues with a feeds (#14897) (#14903) - * When transfering repository and database transaction failed, rollback the renames (#14864) (#14902) - * Fix race in local storage (#14888) (#14901) - * Fix 500 on pull view page if user is not loged in (#14885) (#14886) -* DOCS - * Fix how lfs data path is set (#14855) (#14884) - -## [1.13.3](https://github.com/go-gitea/gitea/releases/tag/v1.13.3) - 2021-03-04 - -* BREAKING - * Turn default hash password algorithm back to pbkdf2 from argon2 until we find a better one (#14673) (#14675) -* BUGFIXES - * Fix paging of file commit logs (#14831) (#14879) - * Print useful error if SQLite is used in settings but not supported (#14476) (#14874) - * Fix display since time round (#14226) (#14873) - * When Deleting Repository only explicitly close PRs whose base is not this repository (#14823) (#14842) - * Set HCaptchaSiteKey on Link Account pages (#14834) (#14839) - * Fix a couple of CommentAsPatch issues. (#14804) (#14820) - * Disable broken OAuth2 providers at startup (#14802) (#14811) - * Repo Transfer permission checks (#14792) (#14794) - * Fix double alert in oauth2 application edit view (#14764) (#14768) - * Fix broken spans in diffs (#14678) (#14683) - * Prevent race in PersistableChannelUniqueQueue.Has (#14651) (#14676) - * HasPreviousCommit causes recursive load of commits unnecessarily (#14598) (#14649) - * Do not assume all 40 char strings are SHA1s (#14624) (#14648) - * Allow org labels to be set with issue templates (#14593) (#14647) - * Accept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989) (#14607) - * Fix bug about ListOptions and stars/watchers pagnation (#14556) (#14573) - * Fix GPG key deletion during account deletion (#14561) (#14569) - -## [1.13.2](https://github.com/go-gitea/gitea/releases/tag/v1.13.2) - 2021-01-31 - -* SECURITY - * Prevent panic on fuzzer provided string (#14405) (#14409) - * Add secure/httpOnly attributes to the lang cookie (#14279) (#14280) -* API - * If release publisher is deleted use ghost user (#14375) -* BUGFIXES - * Internal ssh server respect Ciphers, MACs and KeyExchanges settings (#14523) (#14530) - * Set the name Mapper in migrations (#14526) (#14529) - * Fix wiki preview (#14515) - * Update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2 (#14497) - * ChangeUserName: rename user files back on DB issue (#14447) - * Fix lfs preview bug (#14428) (#14433) - * Ensure timeout error is shown on u2f timeout (#14417) (#14431) - * Fix Deadlock & Delete affected reactions on comment deletion (#14392) (#14425) - * Use path not filepath in routers/editor (#14390) (#14396) - * Check if label template exist first (#14384) (#14389) - * Fix migration v141 (#14387) (#14388) - * Use Request.URL.RequestURI() for fcgi (#14347) - * Use ServerError provided by Context (#14333) (#14345) - * Fix edit-label form init (#14337) - * Fix mailIssueCommentBatch for pull request (#14252) (#14296) - * Render links for commit hashes followed by comma (#14224) (#14227) - * Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221) - * Fix avatar bugs (#14217) (#14220) - * Ensure that schema search path is set with every connection on postgres (#14131) (#14216) - * Fix dashboard issues labels filter bug (#14210) (#14214) - * When visit /favicon.ico but the static file is not exist return 404 but not continue to handle the route (#14211) (#14213) - * Fix branch selector on new issue page (#14194) (#14207) - * Check for notExist on profile repository page (#14197) (#14203) - -## [1.13.1](https://github.com/go-gitea/gitea/releases/tag/v1.13.1) - 2020-12-29 - -* SECURITY - * Hide private participation in Orgs (#13994) (#14031) - * Fix escaping issue in diff (#14153) (#14154) -* BUGFIXES - * Fix bug of link query order on markdown render (#14156) (#14171) - * Drop long repo topics during migration (#14152) (#14155) - * Ensure that search term and page are not lost on adoption page-turn (#14133) (#14143) - * Fix storage config implementation (#14091) (#14095) - * Fix panic in BasicAuthDecode (#14046) (#14048) - * Always wait for the cmd to finish (#14006) (#14039) - * Don't use simpleMDE editor on mobile devices for 1.13 (#14029) - * Fix incorrect review comment diffs (#14002) (#14011) - * Trim the branch prefix from action.GetBranch (#13981) (#13986) - * Ensure template renderer is available before storage handler (#13164) (#13982) - * Whenever the password is updated ensure that the hash algorithm is too (#13966) (#13967) - * Enforce setting HEAD in wiki to master (#13950) (#13961) - * Fix feishu webhook caused by API changed (#13938) - * Fix Quote Reply button on review diff (#13830) (#13898) - * Fix Pull Merge when tag with same name as base branch exist (#13882) (#13896) - * Fix mermaid chart size (#13865) - * Fix branch/tag notifications in mirror sync (#13855) (#13862) - * Fix crash in short link processor (#13839) (#13841) - * Update font stack to bootstrap's latest (#13834) (#13837) - * Make sure email recipients can see issue (#13820) (#13827) - * Reply button is not removed when deleting a code review comment (#13824) - * When reinitialising DBConfig reset the database use flags (#13796) (#13811) -* ENHANCEMENTS - * Add emoji in label to project boards (#13978) (#14021) - * Send webhook when tag is removed via Web UI (#14015) (#14019) - * Use Process Manager to create own Context (#13792) (#13793) -* API - * GetCombinedCommitStatusByRef always return json & swagger doc fixes (#14047) - * Return original URL of Repositories (#13885) (#13886) - -## [1.13.0](https://github.com/go-gitea/gitea/releases/tag/v1.13.0) - 2020-12-01 - -* SECURITY - * Add Allow-/Block-List for Migrate & Mirrors (#13610) (#13776) - * Prevent git operations for inactive users (#13527) (#13536) - * Disallow urlencoded new lines in git protocol paths if there is a port (#13521) (#13524) - * Mitigate Security vulnerability in the git hook feature (#13058) - * Disable DSA ssh keys by default (#13056) - * Set TLS minimum version to 1.2 (#12689) - * Use argon as default password hash algorithm (#12688) -* BREAKING - * Set RUN_MODE prod by default (#13765) (#13767) - * Don't replace underscores in auto-generated IDs in goldmark (#12805) - * Add Primary Key to Topic and RepoTopic tables (#12639) - * Disable password complexity check default (#12557) - * Change PIDFile default from /var/run/gitea.pid to /run/gitea.pid (#12500) - * Add extension Support to Attachments (allow all types for releases) (#12465) - * Remove IE11 Support (#11470) -* FEATURES - * Adopt repositories (#12920) - * Check passwords against HaveIBeenPwned (#12716) - * Gitea 2 Gitea migration (#12657) - * Support storing Avatars in minio (#12516) - * Allow addition of gpg keyring with multiple keys (#12487) - * Add email notify for new release (#12463) - * Add Access-Control-Expose-Headers (#12446) - * UserProfile Page: Render Description (#12415) - * Add command to recreate tables (#12407) - * Add mermaid JS renderer (#12334) - * Add ssh certificate support (#12281) - * Add spent time to referenced issue in commit message (#12220) - * Initial support for push options (#12169) - * Provide option to unlink a fork (#11858) - * Show exact tag for commit on diff view (#11846) - * Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777) - * Issue templates directory (#11450) - * Add a storage layer for attachments (#11387) - * Add hide activity option (#11353) - * Add push commits history comment on PR time-line (#11167) - * Support elastic search for code search (#10273) - * Kanban board (#8346) -* API - * If User is Admin, show 500 error message on PROD mode too (#13115) - * Add Timestamp to Tag list API (#13026) - * Return sample message for login error in api context (#12994) - * Add IsTemplate option in create repo ui and api (#12942) - * GetReleaseByID return 404 if not found (#12933) - * Get release by tags endpoint (#12932) - * NotificationSubject show Issue/Pull State (#12901) - * Expose its limitation settings (#12714) - * Add Created & Updated to Milestone (#12662) - * Milestone endpoints accept names too (#12649) - * Expose Attachment Settings in the API (#12514) - * Add Issue and Repo info to StopWatch (#12458) - * Add cron running API (#12421) - * Add Update Pull HeadBranch Function (#12419) - * Add TOTP header to Swagger Documentation (#12402) - * Delete Token accept names too (#12366) - * Add name filter for GetMilestoneList (#12336) - * Fixed count of filtered issues when api request. (#12275) - * Do not override API issue pagination with UI settings (#12068) - * Expose useful General Repo settings settings (#11758) - * Return error when trying to create Mirrors but Mirrors are globally disabled (#11757) - * Provide diff and patch API endpoints (#11751) - * Allow to create closed milestones (#11745) - * Add language Statistics endpoint (#11737) - * Add Endpoint to get GetGeneralUI Settings (#11735) & (#11854) - * Issue/Pull expose IsLocked Property on API (#11708) - * Add endpoint for Branch Creation (#11607) - * Add pagination headers on endpoints that support total count from database (#11145) -* BUGFIXES - * Fix bogus http requests on diffs (#13760) (#13761) - * Show 'owner' tag for real owner (#13689) (#13743) - * Validate email before inserting/updating (#13475) (#13666) - * Fix issue/pull request list assignee filter (#13647) (#13651) - * Gitlab migration support for subdirectories (#13563) (#13591) - * Fix logic for preferred license setting (#13550) (#13557) - * Add missed sync branch/tag webhook (#13538) (#13556) - * Migration won't fail on non-migrated reactions (#13507) - * Fix Italian language file parsing error (#13156) - * Show outdated comments in pull request (#13148) (#13162) - * Fix parsing of pre-release git version (#13169) (#13172) - * Fix diff skipping lines (#13154) (#13155) - * When handling errors in storageHandler check underlying error (#13178) (#13193) - * Fix size and clickable area on file table back link (#13205) (#13207) - * Add better error checking for inline html diff code (#13251) - * Fix initial commit page & binary munching problem (#13249) (#13258) - * Fix migrations from remote Gitea instances when configuration not set (#13229) (#13273) - * Store task errors following migrations and display them (#13246) (#13287) - * Fix bug isEnd detection on getIssues/getPullRequests (#13299) (#13301) - * When the git ref is unable to be found return broken pr (#13218) (#13303) - * Ensure topics added using the API are added to the repository (#13285) (#13302) - * Fix avatar autogeneration (#13233) (#13282) - * Add migrated pulls to pull request task queue (#13331) (#13334) - * Issue comment reactions should also check pull type on API (#13349) (#13350) - * Fix links to repositories in /user/setting/repos (#13360) (#13362) - * Remove obsolete change of email on profile page (#13341) (#13347) - * Fix scrolling to resolved comment anchors (#13343) (#13371) - * Storage configuration support `[storage]` (#13314) (#13379) - * When creating line diffs do not split within an html entity (#13357) (#13375) (#13425) (#13427) - * Fix reactions on code comments (#13390) (#13401) - * Add missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13424) - * Replies to outdated code comments should also be outdated (#13217) (#13433) - * Fix panic bug in handling multiple references in commit (#13486) (#13487) - * Prevent panic on git blame by limiting lines to 4096 bytes at most (#13470) (#13491) - * Show original author's reviews on pull summary box (#13127) - * Update golangci-lint to version 1.31.0 (#13102) - * Fix line break for MS teams webhook (#13081) - * Fix Issue & Pull Request comment headers on mobile (#13039) - * Avoid setting the CONN_STR in queues unless it is meant to be set (#13025) - * Remove code-view class from diff view (#13011) - * Fix the color of PR comment hyperlinks. (#13009) - * (Re)Load issue labels when changing them (#13007) - * Fix Media links in org files not liked to media files (#12997) - * Always return a list from GetCommitsFromIDs (#12981) - * Only set the user password if the password field would have been shown (#12980) - * Fix admin/config page (#12979) - * Changed width of commit signature avatar (#12961) - * Completely quote AppPath and CustomConf paths (#12955) - * Fix handling of migration errors (#12928) - * Fix anonymous GL migration (#12862) - * Fix git open close bug (#12834) - * Fix markdown meta parsing (#12817) - * Add default storage configurations (#12813) - * Show PR settings on empty repos (#12808) - * Disable watch and star if not signed in (#12807) - * Whilst changing the character set to utf8mb4 we should set ROW_FORMAT=dynamic too (#12804) - * Set opengraph attributes on org pages (#12803) - * Return error when creating gitlabdownloader failed (#12790) - * Add migration for password algorithm change (#12784) - * Compare SSH_DOMAIN when parsing submodule URLs (#12753) - * Fix editor.commit_empty_file_text locale string (#12744) - * Fix wrong poster message for code comment on Pull view (#11721) - * Escape failed highlighted files (#12685) - * Ensure that all migration requests are cancellable (#12669) - * Ensure RepoPath is lowercased in gitea serv (#12668) - * Do not disable commit changes button on repost (#12644) - * Dark theme for line numbers in blame view (#12632) - * Fix message when deleting last owner from an organization (#12628) - * Use shellquote to unpack arguments to gitea serv (#12624) - * Fix signing.wont_sign.%!s(<nil>) if Require Signing commits but not signed in. (#12581) - * Set utf8mb4 as the default charset on MySQL if CHARSET is unset (#12563) - * Set context for running CreateArchive to that of the request (#12555) - * Prevent redirect back to /user/events (#12462) - * Re-attempt to delete temporary upload if the file is locked by another process (#12447) - * Mirror System Notice reports are too frequent (#12438) - * Do not show arrows on comment diffs on pull comment pages (#12434) - * Fix milestone links (#12405) - * Increase size of the language column in language_stat (#12396) - * Use transaction in V102 migration (#12395) - * Only use --exclude on name-rev with git >= 2.13 (#12347) - * Add action feed for new release (#12324) - * Set NoAutoTime when updating is_archived (#12266) - * Support Force-update in Mirror and improve Tracing in mirror (#12242) - * Avoid sending "0 new commits" webhooks (#12212) - * Fix U2F button icon (#12167) - * models/repo_sign.go: break out of loops (#12159) - * Ensure that git commit tree continues properly over the page (#12142) - * Rewrite GitGraph.js (#12137) - * Fix repo API listing stability (#12057) - * Add team support for review request (#12039) - * Fix 500 error on repos with no tags (#11870) - * Fix nil pointer in default issue mail template (#11862) - * Fix commit search in all branches (#11849) - * Don't consider tag refs as valid for branch name (#11847) - * Don't add same line code comment box twice (#11837) - * Fix visibility of forked public repos from private orgs (#11717) - * Fix chardet test and add ordering option (#11621) - * Fix number of files, total additions, and deletions on Diff pages (#11614) - * Properly handle and return empty string for dangling commits in GetBranchName (#11587) - * Include query in sign in redirect (#11579) - * Fix Enter not working in SimpleMDE (#11564) - * Fix bug about can't skip commits base on base branch (#11555) -* ENHANCEMENTS - * Only Return JSON for responses (#13511) (#13565) - * Use existing analyzer module for language detection for highlighting (#13522) (#13551) - * Return the full rejection message and errors in flash errors (#13221) (#13237) - * Remove PAM from auth dropdown when unavailable (#13276) (#13281) - * Add HostCertificate to sshd_config in Docker image (#13143) - * Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124) - * Improve error feedback for duplicate deploy keys (#13112) - * Set appropriate `autocomplete` attributes on password fields (#13078) - * Adding visual cue for "Limited" & "Private" organizations. (#13040) - * Fix Pull Request merge buttons on mobile (#13035) - * Gitea serv, hooks, manager and the like should always display Fatals (#13032) - * CSS tweaks to warning/error segments and misc fixes (#13024) - * Fix formatting of branches ahead-behind on narrow windows (#12989) - * Add config option to make create-on-push repositories public by default (#12936) - * Disable migration items when mirror is selected (#12918) - * Add the checkbox quick button to the comment tool bar also (#12885) - * Support GH enterprise (#12863) - * Simplify CheckUnitUser logic (#12854) - * Fix background of signed-commits on arc-green of timeline commits (#12837) - * Move git update-server-info to hooks (#12826) - * Add ui style for "Open a blank issue" button (#12824) - * Use a simple format for the big number on ui (#12822) - * Make SVG size argument optional (#12814) - * Add placeholder text for bio profile text form (#12792) - * Set language via AJAX (#12785) - * Show git-pull-request icon for closed pull request (#12742) - * Migrate version parsing library to hashicorp/go-version (#12719) - * Only use async pre-empt hack if go < 1.15 (#12718) - * Inform user about meaning of an hourglass on reviews (#12713) - * Add a migrate service type switch page (#12697) - * Migrations: Gitlab Add Reactions Support for Issues & MergeRequests (#12695) - * Remove duplicate logic in initListSubmits (#12660) - * Set avatar image dimensions (#12654) - * Rename models.ProtectedBranchRepoID/PRID to models.EnvRepoID/PRID and ensure EnvPusherEmail is set (#12646) - * Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752) - * Add postgres schema to the search_path on database connection (#12634) - * Git migration UX improvements (#12619) - * Add link to home page on swagger ui (#12601) - * hCaptcha Support (#12594) - * OpenGraph: use repo avatar if exist (#12586) - * Reaction picker display improvements (#12576) - * Fix emoji replacements, make emoji images consistent (#12567) - * Increase clickable area on files table links (#12553) - * Set z-index for sticky diff box lower (#12537) - * Report error if API merge is not allowed (#12528) - * LFS support to be stored on minio (#12518) - * Show 2FA info on Admin Pannel: Users List (#12515) - * Milestone Issue/Pull List: Add octicons type (#12499) - * Make dashboard newsfeed list length a configurable item (#12469) - * Add placeholder text for send testing email button in admin/config (#12452) - * Add SVG favicon (#12437) - * In issue comments, put issue participants also in completion list when hitting @ (#12433) - * Collapse Swagger UI tags by default (#12428) - * Detect full references to issues and pulls in commit messages (#12399) - * Allow common redis and leveldb connections (#12385) - * Don't use legacy method to send Matrix Webhook (#12348) - * Remove padding/border-radius on image diffs (#12346) - * Render the git graph on the server (#12333) - * Fix clone panel in wiki position not always align right (#12326) - * Rework 'make generate-images' (#12316) - * Refactor webhook payload convertion (#12310) - * Move jquery-minicolors to npm/webpack (#12305) - * Support use nvarchar for all varchar columns when using mssql (#12269) - * Update Octicons to v10 (#12240) - * Disable search box autofocus (#12229) - * Replace code fold icons with octicons (#12222) - * Ensure syntax highlighting is the same inside diffs (#12205) - * Auto-init repo on license, .gitignore select (#12202) - * Default to showing closed Issues/PR list when there are only closed issues/PRs (#12200) - * Enable cloning via Git Wire Protocol v2 over HTTP (#12170) - * Direct SVG rendering (#12157) - * Improve arc-green code colors (#12111) - * Allow admin to merge pr with protected file changes (#12078) - * Show description on individual milestone view (#12055) - * Update the wiki repository remote origin while update the mirror repository's Clone From URL (#12053) - * Server-side syntax highlighting for all code (#12047) - * Use Fomantic's fluid padded for blame full width (#12023) - * Use custom SVGs for commit signing lock icon (#12017) - * Make tabs smaller (#12003) - * Fix sticky diff stats container (#12002) - * Move fomantic and jQuery to main webpack bundle (#11997) - * Use enry language type to detect special languages (#11974) - * Use only first line of commit when creating referenced comment (#11960) - * Rename custom/conf/app.ini.sample to custom/conf/app.example.ini for better syntax light on editor (#11926) - * Fix double divider on issue sidebar (#11919) - * Shorten markdown heading anchors links (#11903) - * Add org avatar on top of internal repo icon (#11895) - * Use label to describe repository type (#11891) - * Make repository size unclickable on repo summary bar (#11887) - * Rework blame template and styling (#11885) - * Fix icon alignment for show/hide outdated link on resolved conversation (#11881) - * Vertically align review icons on repository sidebar (#11880) - * Better align items using flex within review request box (#11879) - * Only write to global gitconfig if necessary (#11876) - * Disable all typographic replacements in markdown renderer (#11871) - * Improve label edit buttons labels (#11841) - * Use crispEdges rendering for octicon-internal-repo (#11801) - * Show update branch item in merge box when it's necessary (#11761) - * Add compare link to releases (#11752) - * Allow site admin to disable mirrors (#11740) - * Export monaco editor on window.codeEditors (#11739) - * Add configurable Trust Models (#11712) - * Show full GPG commit status on PR commit history (#11702) - * Fix align issues and decrease avatar size on PR timeline (#11689) - * Replace jquery-datetimepicker with native date input (#11684) - * Change Style of Tags on Comments (#11668) - * Fix missing styling for shabox on PR commit history (#11625) - * Apply padding to approval icons on PR list (#11622) - * Fix message wrapping on PR commit list (#11616) - * Right-align status icon on pull request commit history (#11594) - * Add missing padding for multi-commit list on PR view (#11593) - * Do not show avatar for "{{user}} added X commits" (#11591) - * Fix styling and padding for commit list on PR view (#11588) - * Style code review comment for arc-green (#11572) - * Use default commit message for wiki edits (#11550) - * Add internal-repo octicon for public repos of private org (#11529) - * Fix dropzone color on arc-green (#11514) - * Insert ui divider directly in templates instead of from inside heatmap vue component (#11508) - * Move tributejs to npm/webpack (#11497) - * Fix text-transform on wiki revisions page (#11486) - * Do not show lock icon on repo list for public repos in private org (#11445) - * Include LFS when calculating repo size (#11060) - * Add check for LDAP group membership (#10869) - * When starting new stopwatch stop previous if it is still running (#10533) - * Add queue for code indexer (#10332) - * Move all push update operations to a queue (#10133) - * Cache last commit when pushing for big repository (#10109) - * Change/remove a branch of an open issue (#9080) - * Sortable Tables Header By Click (#7980) -* TESTING - * Use community codecov drone plugin (#12468) - * Add more tests for diff highlighting (#12467) - * Don't put integration test data outside of test folder (#11746) - * Add debug option to hooks (#11624) - * Log slow tests (#11487) -* TRANSLATION - * Translate two small lables on commit statuse list (#12821) - * Make issues.force_push_codes message shorter (#11575) -* BUILD - * Bump min required golang to 1.13 (#12717) - * Add 'make watch' (#12636) - * Extract Swagger CSS to its own file (#12616) - * Update eslint config (#12609) - * Avoid unnecessary system-ui expansion (#12522) - * Make the default PID file compile-time settable (#12485) - * Add 'watch-backend' (#12330) - * Detect version of sed in Makefile (#12319) - * Update gitea-vet to v0.2.1 (#12282) - * Add logic to build stable and edge builds for gitea snap (#12052) - * Fix missing CGO_EXTRA_FLAGS build arg for docker (#11782) - * Alpine 3.12 (#11720) - * Enable stylelint's shorthand-property-no-redundant-values (#11436) -* DOCS - * Change default log configuration (#13088) - * Add automatic JS license generation (#11810) - * Remove page size limit comment from swagger (#11806) - * Narrow down Edge version in browser support docs (#11640) - -## [1.12.5](https://github.com/go-gitea/gitea/releases/tag/v1.12.5) - 2020-10-01 - -* BUGFIXES - * Allow U2F with default settings for gitea in subpath (#12990) (#13001) - * Prevent empty div when editing comment (#12404) (#12991) - * On mirror update also update address in DB (#12964) (#12967) - * Allow extended config on cron settings (#12939) (#12943) - * Open transaction when adding Avatar email-hash pairs to the DB (#12577) (#12940) - * Fix internal server error from ListUserOrgs API (#12910) (#12915) - * Update only the repository columns that need updating (#12900) (#12912) - * Fix panic when adding long comment (#12892) (#12894) - * Add size limit for content of comment on action ui (#12881) (#12890) - * Convert User expose ID each time (#12855) (#12883) - * Support slashes in release tags (#12864) (#12882) - * Add missing information to CreateRepo API endpoint (#12848) (#12867) - * On Migration respect old DefaultBranch (#12843) (#12858) - * Fix notifications page links (#12838) (#12853) - * Stop cloning unnecessarily on PR update (#12839) (#12852) - * Escape more things that are passed through str2html (#12622) (#12850) - * Remove double escape on labels addition in comments (#12809) (#12810) - * Fix "only mail on mention" bug (#12775) (#12789) - * Fix yet another bug with diff file names (#12771) (#12776) - * RepoInit Respect AlternateDefaultBranch (#12746) (#12751) - * Fix Avatar Resize (resize algo NearestNeighbor -> Bilinear) (#12745) (#12750) -* ENHANCEMENTS - * gitea dump: include version & Check InstallLock (#12760) (#12762) - -## [1.12.4](https://github.com/go-gitea/gitea/releases/tag/v1.12.4) - 2020-09-02 - -* SECURITY - * Escape provider name in oauth2 provider redirect (#12648) (#12650) - * Escape Email on password reset page (#12610) (#12612) - * When reading expired sessions - expire them (#12686) (#12690) -* ENHANCEMENTS - * StaticRootPath configurable at compile time (#12371) (#12652) -* BUGFIXES - * Fix to show an issue that is related to a deleted issue (#12651) (#12692) - * Expire time acknowledged for cache (#12605) (#12611) - * Fix diff path unquoting (#12554) (#12575) - * Improve HTML escaping helper (#12562) - * models: break out of loop (#12386) (#12561) - * Default empty merger list to those with write permissions (#12535) (#12560) - * Skip SSPI authentication attempts for /api/internal (#12556) (#12559) - * Prevent NPE on commenting on lines with invalidated comments (#12549) (#12550) - * Remove hardcoded ES indexername (#12521) (#12526) - * Fix bug preventing transfer to private organization (#12497) (#12501) - * Keys should not verify revoked email addresses (#12486) (#12495) - * Do not add prefix on http/https submodule links (#12477) (#12479) - * Fix ignored login on compare (#12476) (#12478) - * Fix incorrect error logging in Stats indexer and OAuth2 (#12387) (#12422) - * Upgrade google/go-github to v32.1.0 (#12361) (#12390) - * Render emoji's of Commit message on feed-page (#12373) - * Fix handling of diff on unrelated branches when Git 2.28 used (#12370) - -## [1.12.3](https://github.com/go-gitea/gitea/releases/tag/v1.12.3) - 2020-07-28 - -* BUGFIXES - * Don't change creation date when updating Release (#12343) (#12351) - * Show 404 page when release not found (#12328) (#12332) - * Fix emoji detection in certain cases (#12320) (#12327) - * Reduce emoji size (#12317) (#12327) - * Fix double-indirection bug in logging IDs (#12294) (#12308) - * Link to pull list page on sidebar when view pr (#12256) (#12263) - * Extend Notifications API and return pinned notifications by default (#12164) (#12232) - -## [1.12.2](https://github.com/go-gitea/gitea/releases/tag/v1.12.2) - 2020-07-11 - -* BUGFIXES - * When deleting repository decrese user repository count in cache (#11954) (#12188) - * Return full commit message instead of summary in commits API (#12186) (#12187) - * Properly set HEAD when a repo is created with a default branch that is not named 'master' (#12135) (#12182) - * Ensure GPG Subkeys are verified (#12155) (#12168) - * Fix failing to cache last commit with key being to long (#12151) (#12161) - * Multiple small admin dashboard fixes (#12153) (#12156) - * Remove spurious logging of " Delete all repository archives" at startup (#12139) (#12148) - * Fix repository setup instructions when default branch is not named 'master' (#12122) (#12147) - * Move EventSource to SharedWorker (#12095) (#12130) - * Fix ui bug in wiki commit page (#12089) (#12125) - * Fix gitgraph branch continues after merge (#12044) (#12105) - * Set the base url when migrating from Gitlab using access token or username without password (#11852) (#12104) - * Ensure BlameReaders close at end of request (#12102) (#12103) - * Fix panic when adding review comment (#12058) -* ENHANCEMENTS - * Disable dropzone's timeout for file uploads (#12024) (#12032) - -## [1.12.1](https://github.com/go-gitea/gitea/releases/tag/v1.12.1) - 2020-06-21 - -* BUGFIXES - * Handle multiple merges in gitgraph.js (#11996) (#12000) - * Add serviceworker.js to KnownPublicEntries (#11992) (#11994) - * For language detection do not try to analyze big files by content (#11971) (#11975) -* ENHANCEMENTS - * Fix scrollable header on dropdowns (#11893) (#11965) - -## [1.11.8](https://github.com/go-gitea/gitea/releases/tag/v1.11.8) - 2020-06-21 - -* BUGFIXES - * Really fix __webpack_public_path__ for 1.11 (#11961) - -## [1.12.0](https://github.com/go-gitea/gitea/releases/tag/v1.12.0) - 2020-06-17 - -* BREAKING - * When using API CreateRelease set created_unix to the tag commit time (#11218) - * Enable ENABLE_HARD_LINE_BREAK by default for rendering markdown (#11162) - * Fix sanitizer config - multiple rules (#11133) - * Remove check on username when using AccessToken authentication for the API (#11015) - * Return 404 from Contents API when items don't exist (#10323) - * Notification API should always return a JSON object with the current count of notifications (#10059) - * Remove migration support from versions earlier than 1.6.0 (#10026) -* SECURITY - * Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) (#11662) -* FEATURES - * Improve config logging when WrappedQueue times out (#11174) - * Add branch delete to API (#11112) - * Use markdown frontmatter to provide Table of contents, language and frontmatter rendering (#11047) - * Add a way to mark Conversation (code comment) resolved (#11037) - * Handle yaml frontmatter in markdown (#11016) - * Cache PullRequest Divergence (#10914) - * Make `gitea admin auth list` formatting configurable (#10844) - * Add Matrix webhook (#10831) - * Add Organization Wide Labels (#10814) - * Allow to set protected file patterns for files that can not be changed under no conditions (#10806) - * Option to set default branch at repository creation (#10803) - * Add request review from specific reviewers feature in pull request (#10756) - * Add NextCloud oauth (#10562) - * System-wide webhooks (#10546) - * Relax sanitization as per https://github.com/jch/html-pipeline (#10527) - * Use media links for img in post-process (#10515) - * Add API endpoints to manage OAuth2 Application (list/create/delete) (#10437) - * Render READMEs in docs/ .gitea or .github from root (#10361) - * Add feishu webhook support (#10229) - * Cache last commit to accelerate the repository directory page visit (#10069) - * Implement basic app.ini and path checks to doctor cmd (#10064) - * Make WorkerPools and Queues flushable (#10001) - * Implement "embedded" command to extract static resources (#9982) - * Add API endpoint for repo transfer (#9947) - * Make archive prefixing configurable with a global setting (#9943) - * Add Unique Queue infrastructure and move TestPullRequests to this (#9856) - * Issue/PR Context Popups (#9822) - * Add "Update Branch" button to Pull Requests (#9784) - * Add require signed commit for protected branch (#9708) - * Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532) - * Add API notification endpoints (#9488) - * Issue search support elasticsearch (#9428) - * Add API branch protection endpoint (#9311) - * Add a new command doctor to check if some wrong configurations on gitea instance (#9095) - * Add support for migrating from Gitlab (#9084) - * Add support for database schema in PostgreSQL (#8819) - * Add setting to set default and global disabled repository units. (#8788) - * Language statistics bar for repositories (#8037) - * Restricted users (#6274) -* BUGFIXES - * Fix commenting on non-utf8 encoded files (#11916) (#11950) - * Use google/uuid to instead satori/go.uuid (#11943) (#11946) - * Align show/hide outdated button on code review block (#11932) (#11944) - * Update to go-git v5.1.0 (#11936) (#11941) - * Use ID or Where to instead directly use Get when load object from database (#11925) (#11934) - * Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) (#11915) - * Invalidate comments when file is shortened (#11882) (#11884) - * Rework api/user/repos for pagination (#11827) (#11877) - * Handle more pathological branch and tag names (#11843) (#11863) - * Add doctor check to set IsArchived false if it is null (partial #11853) (#11859) - * Prevent panic on empty HOST for mysql (#11850) (#11856) - * Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836) - * Fix reply octicon (#11821) (#11822) - * Honor DEFAULT_PAGING_NUM for API (#11805) (#11813) - * Ensure rejected push to refs/pull/index/head fails nicely (#11724) (#11809) - * In File Create/Update API return 404 if Branch does not exist (#11791) (#11795) - * Fix doer of rename repo (#11789) (#11794) - * Initialize SimpleMDE when making a code comment (#11749) (#11785) - * Fix timezone on issue deadline (#11697) (#11784) - * Fix to allow comment poster to edit or delete his own comments (#11671) (#11774) - * Show full 500 error in API when Gitea in dev mode (#11641) (#11753) - * Add missing templates for Matrix system webhooks (#11729) (#11748) - * Fix verification of subkeys of default gpg key (#11713) (#11747) - * Fix styling for commiter on diff view (#11715) (#11744) - * Properly truncate system notices (#11714) (#11742) - * Handle expected errors in FileCreate & FileUpdate API (#11643) (#11718) - * Fix missing authorization check on pull for public repos of private/limited org (#11656) (#11682) - * Doctor check & fix db consistency (#11111) (#11676) - * Exclude generated files from language statistics (#11653) (#11670) - * Return json on 500 error from API (#11574) (#11659) - * When must change password only show Signout (#11600) (#11637) - * Backport various styling fixes (#11619) - * Fix wrong milestone in webhook message (#11596) (#11611) - * Fix serviceworker output file and misc improvements (#11562) (#11610) - * When initialising repositories ensure that the user doing the creation is the initializer (#11601) (#11608) - * Prevent empty query parameter being set on dashboard (#11561) (#11604) - * Fix images in wiki edit preview (#11546) (#11602) - * Prevent (caught) panic on login (#11590) (#11597) - * Prevent transferring repos to invisible orgs (#11517) (#11549) - * Move serviceworker to workbox and fix SSE interference (#11538) (#11547) - * API PullReviewComment HTMLPullURL should return the HTMLURL (#11501) (#11533) - * Fix repo-list private and total count bugs (#11500) (#11532) - * Fix form action template substitutions on admin pages (backport #11519) (#11531) - * Fix a bug where the reaction emoji doesn't disappear. (#11489) (#11530) - * TrimSpace when reading InternalToken from a file (#11502) (#11524) - * Fix selected line color in arc-green (#11492) (#11520) - * Make localstorage read ssh or https correctly (#11483) (#11490) - * Check branch protection on IsUserAllowedToUpdate (#11448) - * Fix margin on attached segment headers when they are separated by other element (#11425) - * Fix webhook template when validation errors occur (#11421) - * Fix NPE in template due to missing signing key on commit page (#11392) - * Restore active background to Register button on Register page (#11390) - * Fix hook failure due to relative LFS_CONTENT_PATH (#11362) - * Correctly set the organization num repos (#11339) - * Prevent 500 with badly formed task list (#11328) - * Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327) - * Handle panics that percolate up to the graceful module (#11291) - * Don't allow registration via the web form, when AllowOnlyExternalRegistration is True (#11248) - * Patch fomantic-ui to workaround build issue (#11244) - * Prevent panic during wrappedConn close at hammertime (#11219) - * On logout force redirect to start page (#11202) - * Fix creation of Organization repos by Users with max created personal repos (#11183) - * Add option to increase provided OAuth2 token maximum size (#11180) - * Log the indexer path on failure (#11172) - * Ensure that relative paths in edit preview work (#11143) - * Make API EditIssue and EditPullRequest issue notifications (#11123) - * Send 404 immediately for known public requests (#11117) - * Remove nil inserts in models (#11096) - * Add GetReviews() to RetryDownloader (#11093) - * Remove nonexistent serviceworker entries (#11091) - * Simplify and fix GetApprovalCounts (#11086) - * Fix wiki revision template and simplify some tmpl conditions (#11080) - * Make branch parameter optional for /api/v1/repos/{owner}/{repo}/contents/{filepath} (#11067) - * Align review-item svg octicons (#11065) - * Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997) - * Users should not be able to prohibit their own login (#10970) - * Fix scrollbar issues in dropdowns (#10897) - * Change the order of issues.closed_by to list opening user first (#10876) - * Allow site admin to check /api/v1/orgs endpoints (#10867) - * Avoid logging []byte in queue failures - convert to string first (#10865) - * Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863) - * Fix assignees double load bug (#10856) - * Handle push rejection in branch and upload (#10854) - * In authorized_keys use double-quote for windows compatibility (#10841) - * Fix milestone template (#10824) - * log.Fatal on failure to listen to SSH port (#10795) - * Fix forked repo has no icon and language stat. (#10791) - * Fix tag/release deletion (#10663) - * Fix webhook migration (#10641) - * Migration for deleting orphaned dependencies (#10617) - * Add migration to fix the old broken merge-bases (#10604) - * Update templates for Go 1.14 (#10596) - * Remove unnecessary parentheses in wiki/view template (#10583) - * Change default value of DefaultCommandExecutionTimeout to match docs (#10581) - * Handle panic in indexer initialisation better (#10534) - * Set correct content_type value for Gogs/Gitea webhooks (#9504) (#10456) - * Fixed wrong AppSubUrl in multiple templates (#10447) - * Fix profile page CSS (#10406) - * Inject SVG sprite via ajax (#10320) - * Fix migration information update bug when linked github account (#10310) - * Allow admin to check org membership by API for other users (#10201) - * Fix topics dropdown (#10167) - * Ensure DeleteUser is not allowed to Delete Orgs and visa versa (#10134) - * Fix IsErrPullClosed (#10093) - * Accept punctuation after simple+cross repository issue references (#10091) - * On merge of already closed PR redirect back to the pulls page (#10010) - * Fix crowdin update script (#9969) - * Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch (#9927) - * Add option to prevent LDAP from deactivating everything on empty search (#9879) - * Fix admin handling at merge of PR (#9749) - * err_admin_name_pattern_not_allowed String Clarification (#9731) - * Fix wrong original git service type on a migrated repository (#9693) - * Fix ref links in issue overviews for tags (#8742) -* ENHANCEMENTS - * Fix search form button overlap (#11840) (#11864) - * Make tabular menu styling consistent for arc-green (#11570) (#11798) - * Add option to API to update PullRequest base branch (#11666) (#11796) - * Increase maximum SQLite variables count to 32766 (#11696) (#11783) - * Update emoji dataset with skin tone variants (#11678) (#11763) - * Add logging to long migrations (#11647) (#11691) - * Change language statistics to save size instead of percentage (#11681) (#11690) - * Allow different HardBreaks settings for documents and comments (#11515) (#11599) - * Fix alignment for commits on dashboard (#11595) (#11680) - * Default MSSQL port 0 to allow automatic detection by default (#11642) (#11673) - * Handle expected errors in AddGPGkey API (#11644) (#11661) - * Close EventSource before unloading the page (#11539) (#11557) - * Ensure emoji render with regular font-weight (#11541) (#11545) - * Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11542) - * Tweak reaction buttons (#11516) - * Use more toned colors for selected line (#11493) (#11511) - * Increase width for authors on commit view (#11441) - * Hide archived repos by default in repo-list (#11440) - * Better styling for code review comment textarea (#11428) - * Support view individual commit for wiki pages (#11415) - * Fix yellow background on active elements in code review (#11414) - * Better styling for code review comment form (#11413) - * Change install description on homepage (#11395) - * Ensure search action button is coalesced to adjacent input (#11385) - * Switch code editor to Monaco (#11366) - * Add paging and archive/private repository filtering to dashboard list (#11321) - * Changed image of openid-connect logo for better look on arc-green theme (#11312) - * Load Repo Topics on blame view too (#11307) - * Change the style in admin notice content view from `<p>` to `<pre>` (#11301) - * Allow log.xxx.default to set logging settings for the default logger only (#11292) - * Automatically attempt auto recovery of broken disk queues (Update lunny/levelqueue to 0.3.0) (#11285) - * Make sendmail a Process and have default timeout (#11256) - * Check value of skip-repository flag in dump command (#11254) - * Fix submit review form (#11252) - * Allow unauthenticated users to compare (#11240) - * Add EventSource support (#11235) - * Refactor Milestone related (#11225) - * Add pull review API endpoints (#11224) - * Add a 'this' to issue close/reopened messages (#11204) - * When migrating from Gitlab map Approvals to approving Reviews (#11147) - * Improve representation of attachments in issues (#11141) - * Protect default branch against deletion (#11115) - * Add X-Total-Count on /repos/{owner]/{repo}/pulls API endpoint (#11113) - * Fix status label on branches list vertical alignment (#11109) - * Add single release page and latest redirect (#11102) - * Add missing commit states to PR checks template (#11085) - * Change icon on title for merged PR to git-merge (#11064) - * Add MergePull comment type instead of close for merge PR (#11058) - * Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) - * Consolidate author name across timeline (#11053) - * Refactor UpdateOAuth2Application (#11034) - * Support unicode emojis and remove emojify.js (#11032) - * Add git hook "warning" to admin panel (#11030) - * Add flash notify for email preference setting success (#11027) - * Remove package code.gitea.io/gitea/modules/git import out of models (#11025) - * Match arc-green code tag color to code blocks (#11023) - * Move syntax highlighting to web worker (#11017) - * Prevent merge of outdated PRs on protected branches (#11012) - * Add Get/Update for api/v1/user/applications/oauth2 (#11008) - * Upgrade to most recent bluemonday (#11007) - * Tweak code tags in markdown (#11000) - * Reject duplicate AccessToken names (#10994) - * Fix Ctrl-Enter shortcut for issues (#10986) - * Provide `OwnerName` field for README template (#10981) - * Prettify Timeline (#10972) - * Add issue subscription check to API (#10967) - * Use AJAX for notifications table (#10961) - * Adjust label padding (#10957) - * Avoiding directory execution on hook (#10954) (#10955) - * Migrate ActivityHeatmap to Vue SFC (#10953) - * Change merge strategy: do not check write access if user in merge white list (#10951) - * Enable GO111MODULE=on globally in Makefile (#10939) - * API endpoint to get single commit via SHA and Ref (#10915) - * Add accordion to release list and hide non-latest (#10910) - * Split dashboard elements into separate template files (#10885) - * Add more message on sidebar menus (#10872) - * Set MySQL rowtype to dynamic for new tables (#10833) - * Completely fix task-list checkbox styling (#10798) - * Hide gear icon for user who can't use them on sidebar (#10750) - * Refactor Cron and merge dashboard tasks (#10745) - * Change review status icons on pr view style to github style (#10737) - * Make pagination optional for API list notification endpoints (#10714) - * Fix tab indentation in code view (#10671) - * Fix task-list checkbox styling (#10668) - * Multiple LFS improvements (#10667) - * Make PR message on pushes configurable (#10664) - * Move dropzone.js to npm/webpack (#10645) - * Ensure Update button is enabled even when CI has failed (#10640) - * Add restricted user filter to LDAP authentication (#10600) - * Add Yandex OAuth2 provider (#8335) (#10564) - * Make avatar lookup occur at image request (#10540) - * Prevent accidential selection of language stats bar (#10537) - * Add fluid-icon (#10491) - * Inform participants on UI too (#10473) - * Build with go 1.14 (and raise minimum go version to 1.12) (#10467) - * Add max-file-size to LFS (#10463) - * Enable paggination for ListRepoTags API (#10454) - * Update JS dependencies (#10450) - * Show the username as a fallback on feeds if full name is blank (#10438) - * Various dark theme fixes (#10416) - * Display pull request head branch even the branch deleted or repository deleted (#10413) - * Prevent Firefox from using apple-touch-icon (#10402) - * Fix input[type=file] on dark theme (#10382) - * Improve mobile review-box sizing (#10297) - * Notification: queue ui.go notification-service (#10281) - * Add detected file language to code search (#10256) - * Index code and stats only for non-empty repositories (#10251) - * Add Approval Counts to pulls list (#10238) - * Limit label list height on edit issue page (#10216) - * Improve 404 error message (#10214) - * Tweak locale to respect singular conflicting file message in PR list (#10177) - * Fix commit view (#10169) - * Reorganize frontend files and tooling (#10168) - * Allow emoji on popup label (#10166) - * ListIssues add filter for milestones API (#10148) - * Show if a PR has conflicting files on the PR lists (#10130) - * Fix inconsistent label color format in API (#10129) - * Show download count info in release list (#10124) - * Add Octicon SVG spritemap (#10107) - * Update aria-fixed semantic-dropdown to fomantic master (#10096) - * Fix apple-touch-icon, regenerate images (#10065)(#10006) - * Style blockquote for default issue mail template (#10024) - * More expansions in template repositories (#10021) - * Allow list collaborators for users with Read access to repo (#9995) - * Add explicit dimensions to navbar avatar (#9986) - * Remove loadCSS and preload woff2 icon fonts (#9976) - * Fix commit view JS features, reimplement folding (#9968) - * Fix review avatar image (#9962) - * Improve notification pager (#9821) - * Move jquery and jquery-migrate to npm/webpack (#9813) - * Change font to Roboto to support more charsets (#9803) - * Move mailer to use a queue (#9789) - * Issue search on my related repositories (#9758) - * Add "before" query to ListIssueComments and ListRepoIssueComments API (#9685) - * Move tracked time api convert to convert package (#9665) - * Improve PR info in default merge message (#9635) - * Granular webhook events (#9626) - * Add Reviewed-on in commit message (#9623) - * Add top author stats to activity page (#9615) - * Allow repo admin to merge PR regardless of review status (#9611) - * Migrate reactions when migrating repository from github (#9599) - * API orgEditTeam make Fields optional (#9556) - * Move create/fork repository from models to modules/repository (#9489) - * Migrate reviews when migrating repository from github (#9463) - * Times API add filters (#9373) - * Move push commits from models to modules/repository (#9370) - * Add API endpoint to check notifications [Extend #9488] (#9595) - * Add GET /orgs API endpoint (#9560) - * API add/generalize pagination (#9452) - * Make create org repo API call same as github (#9186) -* BUILD - * Turn off go modules for xgo and gxz (#10963) - * Add gitea-vet (#10948) - * Rename scripts to build and add revive command as a new build tool command (#10942) - * Add 'make lint', restructure 'compliance' pipeline (#10861) - * Move JS build dependencies to 'dependencies' (#10763) - * Use whitelist to find go files, run find only once (#10594) - * Move vue and vue-calendar-heatmap to npm/webpack (#10188) - * Move jquery.are-you-sure to npm/webpack (#10063) - * Move highlight.js to npm/webpack (#10011) - * Generate Bindata if TAGS="bindata" and not up-to-date (#10004) - * Move CSS build to webpack (#9983) - * Move fomantic target, update 'make help' (#9945) - * Add css extraction and minification to webpack (#9944) - * Misc webpack tweaks (#9924) - * Make node_modules a order-only prerequisite (#9923) - * Update documentation for the go module era (#9751) - * Move swagger-ui to webpack/npm and update it to 3.24.3 (#9714) - * Use npm to manage fomantic and only build needed components (#9561) -* MISC - * Add gnupg to Dockerfile (#11365) - * Update snapcraft.yaml for core18 and latest features (#11300) - * Update JS dependencies, min Node.js version 10.13 (#11246) - * Change default charset for MySQL on install to utf8mb4 (#10989) - * Return issue subscription status from API subscribe (#10966) - * Fix queue log param (#10733) - * Add warning when using relative path to app.ini (#10104) - -## [1.11.7](https://github.com/go-gitea/gitea/releases/tag/v1.11.7) - 2020-06-18 - -* BUGFIXES - * Use ID or Where to instead directly use Get when load object from database (#11925) (#11935) - * Fix __webpack_public_path__ for 1.11 (#11907) - * Fix verification of subkeys of default gpg key (#11713) (#11902) - * Remove unnecessary parentheses in wiki/view template (#11781) - * Doctor fix xorm.Count nil on sqlite error (#11741) - -## [1.11.6](https://github.com/go-gitea/gitea/releases/tag/v1.11.6) - 2020-05-30 - -* SECURITY - * Fix missing authorization check on pull for public repos of private/limited org (#11656) (#11683) - * Use session for retrieving org teams (#11438) (#11439) -* BUGFIXES - * Return json on 500 error from API (#11574) (#11660) - * Fix wrong milestone in webhook message (#11596) (#11612) - * Prevent (caught) panic on login (#11590) (#11598) - * Fix commit page js error (#11527) - * Use media links for img in post-process (#10515) (#11504) - * Ensure public repositories in private organizations are visible and fix admin organizations list (#11465) (#11475) - * Set correct Content-Type value for Gogs/Gitea webhooks (#9504) (#10456) (#11461) - * Allow all members of private orgs to see public repos (#11442) (#11459) - * Whenever the ctx.Session is updated, release it to save it before sending the redirect (#11456) (#11457) - * Forcibly clean and destroy the session on logout (#11447) (#11451) - * Fix /api/v1/orgs/* endpoints by changing parameter to :org from :orgname (#11381) - * Add tracked time fix to doctor (part of #11111) (#11138) - * Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11544) - * Remove unnecessary parentheses in wiki/revision.tmpl to allow 1.11 to build on go1.14 (#11481) - -## [1.11.5](https://github.com/go-gitea/gitea/releases/tag/v1.11.5) - 2020-05-09 - -* BUGFIXES - * Prevent timer leaks in Workerpool and others (#11333) (#11340) - * Fix tracked time issues (#11349) (#11354) - * Add NotifySyncPushCommits to indexer notifier (#11309) (#11338) - * Allow X in addition to x in tasks (#10979) (#11335) - * When delete tracked time through the API return 404 not 500 (#11319) (#11326) - * Prevent duplicate records in organizations list when creating a repository (#11303) (#11325) - * Manage port in submodule refurl (#11305) (#11323) - * api.Context.NotFound(...) should tolerate nil (#11288) (#11306) - * Show pull request selection even when unrelated branches (#11239) (#11283) - * Repo: milestone: make /milestone/:id endpoint accessible (#11264) (#11282) - * Fix GetContents(): Dont't ignore Executables (#11192) (#11209) - * Fix submodule paths when AppSubUrl is not root (#11098) (#11176) - * Prevent clones and pushes to disabled wiki (#11131) (#11134) - * Remove errant third closing curly-bracket from account.tmpl and send account ID in account.tmpl (#11130) - * On Repo Deletion: Delete related TrackedTimes too (#11110) (#11125) - * Refresh codemirror on show pull comment tab (#11100) (#11122) - * Fix merge dialog on protected branch with missing required statuses (#11074) (#11084) - * Load pr Issue Poster on API too (#11033) (#11039) - * Fix release counter on API repository info (#10968) (#10996) - * Generate Diff and Patch direct from Pull head (#10936) (#10938) - * Fix rebase conflict detection in git 2.26 (#10929) (#10930) -* ENHANCEMENT - * Fix 404 and 500 image size in small size screen (#11043) (#11049) - * Multiple Gitea Doctor improvements (#10943) (#10990) (#10064) (#9095) (#10991) - -## [1.11.4](https://github.com/go-gitea/gitea/releases/tag/v1.11.4) - 2020-04-01 - -* BUGFIXES - * Only update merge_base if not already merged (#10909) - * Fix milestones too many SQL variables bug (#10880) (#10904) - * Protect against NPEs in notifications list (#10879) (#10883) - * Convert plumbing.ErrObjectNotFound to git.ErrNotExist in getCommit (#10862) (#10868) - * Convert plumbing.ErrReferenceNotFound to git.ErrNotExist in GetRefCommitID (#10676) (#10797) - * Account for empty lines in receive-hook message (#10773) (#10784) - * Fix bug on branch API (#10767) (#10775) - * Migrate to go-git/go-git v5.0.0 (#10735) (#10753) - * Fix hiding of fields in authorization source page (#10734) (#10752) - * Prevent default for linkAction (#10742) (#10743) - -## [1.11.3](https://github.com/go-gitea/gitea/releases/tag/v1.11.3) - 2020-03-10 - -* BUGFIXES - * Prevent panic in stopwatch (#10670) (#10673) - * Fix bug on pull view when required status check no ci result (#10648) (#10651) - * Build explicitly with Go 1.13 (#10684) - -## [1.11.2](https://github.com/go-gitea/gitea/releases/tag/v1.11.2) - 2020-03-06 - -* BREAKING - * Various fixes in login sources (#10428) (#10429) -* SECURITY - * Ensure only own addresses are updated (#10397) (#10399) - * Logout POST action (#10582) (#10585) - * Org action fixes and form cleanup (#10512) (#10514) - * Change action GETs to POST (#10462) (#10464) - * Fix admin notices (#10480) (#10483) - * Change admin dashboard to POST (#10465) (#10466) - * Update markbates/goth (#10444) (#10445) - * Update crypto vendors (#10385) (#10398) -* BUGFIXES - * Allow users with write permissions to modify issue descriptions and comments. (#10623) (#10626) - * Handle deleted base branch in PR (#10618) (#10619) - * Delete dependencies when deleting a repository (#10608) (#10616) - * Ensure executable bit is kept on the web editor (#10607) (#10614) - * Update mergebase in pr checker (#10586) (#10605) - * Fix release attachments being deleted while upgrading (#10572) (#10573) - * Fix redirection path if Slack webhook channel is invalid (#10566) - * Fix head.tmpl og:image picture location (#10531) (#10556) - * Fix 404 after activating secondary email (#10547) (#10553) - * Show Signer in commit lists and add basic trust (#10425 & #10511) (#10524) - * Fix potential bugs (#10513) (#10518) - * Use \[:space:\] instead of \\s (#10508) (#10509) - * Avoid mailing users that have explicitly unwatched an issue (#10475) (#10500) - * Handle push rejection message in Merge & Web Editor (#10373) (#10497) - * Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368) (#10493) - * Fix double PR notification from API (#10482) (#10486) - * Show the username as a fallback on feeds if full name is blank (#10461) - * Trigger webhooks on issue label-change via API too (#10421) (#10439) - * Fix git reference type in webhooks (#10427) (#10432) - * Prevent panic on merge to PR (#10403) (#10408) - * Fix wrong num closed issues on repository when close issue via commit… (#10364) (#10380) - * Reading pull attachments should depend on read UnitTypePullRequests (#10346) (#10354) - * Set max-width on review-box comment box (#10348) (#10353) - * Prevent nil pointer in GetPullRequestCommitStatusState (#10342) (#10344) - * Fix protected branch status check settings (#10341) (#10343) - * Truncate long commit message header (#10301) (#10319) - * Set the initial commit status to Success otherwise it will always be Pending (#10317) (#10318) - * Don't manually replace whitespace during render (#10291) (#10315) -* ENHANCEMENT - * Admin page for managing user e-mail activation (#10557) (#10579) - -## [1.11.1](https://github.com/go-gitea/gitea/releases/tag/v1.11.1) - 2020-02-15 - -* BUGFIXES - * Repo name added to automatically generated commit message when merging (#9997) (#10285) - * Fix Workerpool deadlock (#10283) (#10284) - * Divide GetIssueStats query in smaller chunks (#10176) (#10282) - * Fix reply on code review (#10257) - * Stop hanging issue indexer initialisation from preventing shutdown (#10243) (#10249) - * Fix filter label emoji width (#10241) (#10244) - * Fix issue sidebar menus having an infinite height (#10239) (#10240) - * Fix commit between two commits calculation if there is only last commit (#10225) (#10226) - * Only check for conflicts/merging if the PR has not been merged in the interim (#10132) (#10206) - * Blacklist manifest.json & milestones user (#10292) (#10293) - -## [1.11.0](https://github.com/go-gitea/gitea/releases/tag/v1.11.0) - 2020-02-10 - -* BREAKING - * Fix followers and following tabs in profile (#10202) (#10203) - * Make CertFile and KeyFile relative to CustomPath (#9868) (#9874) - * Remove unused endpoints (#9538) - * Prefix all user-generated IDs in markup (#9477) - * Enforce Gitea environment for pushes (#8982) - * Hide some user information via API if user have not enough permissions (#8655) - * Move startpage/homepage translation to crowdin (#8596) -* SECURITY - * Never allow an empty password to validate (#9682) (#9683) - * Prevent redirect to Host (#9678) (#9679) - * Swagger hide search field (#9554) - * Add "search" to reserved usernames (#9063) - * Switch to fomantic-ui (#9374) - * Only serve attachments when linked to issue/release and if accessible by user (#9340) -* FEATURES - * Webhooks should only show sender if it makes sense (#9601) - * Provide Default messages for merges (#9393) - * Add description to labels on create issue (#9392) - * Graceful Queues: Issue Indexing and Tasks (#9363) - * Default NO_REPLY_ADDRESS to DOMAIN (#9325) - * Allow FCGI over unix sockets (#9298) - * Graceful: Xorm, RepoIndexer, Cron and Others (#9282) - * Add API for Reactions (#9220) - * Graceful: Cancel Process on monitor pages & HammerTime (#9213) - * Graceful: Allow graceful restart for unix sockets (#9113) - * Graceful: Allow graceful restart for fcgi (#9112) - * Sign protected branches (#8993) - * Add Graceful shutdown for Windows and hooks for shutdown of goroutines (#8964) - * Add Gitea icon to Emojis (#8950) - * Expand/Collapse Files and Blob Excerpt while Reviewing/Comparing code (#8924) - * Allow Custom Reactions (#8886) - * Close/reopen issues by keywords in titles and comments (#8866) - * Allow incompletely specified Time Formats (#8816) - * Prevent upload (overwrite) of lfs locked file (#8769) - * Template Repositories (#8768) - * Add /milestones endpoint (#8733) - * Make repository management section handle lfs locks (#8726) - * Respect LFS File Lock on UI (#8719) - * Add team option to grant rights for all organization repositories (#8688) - * Enabling and disabling the commit button to prevent empty commits (web editor) (#8590) - * Add setting to disable BASIC authentication (#8586) - * Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) - * Allow Protected Branches to Whitelist Deploy Keys (#8483) - * Push to create repo (#8419) - * Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631) - * Add basic repository lfs management (#7199) -* BUGFIXES - * Fix code-expansion arc-green theme bug (#10180) (#10185) - * Prevent double wait-group decrement (#10170) (#10175) - * Allow emoji on review head comments (#10159) (#10174) - * Fix issue/pull link (#10158) (#10173) - * Fix push-create SSH bugs (#10145) (#10151) - * Prevent DeleteUser API abuse (#10125) (#10128) - * Fix issues/pulls dashboard paging error (#10114) (#10115) - * Add button to revert SimpleMDE to plain textarea (#10099) (#10102) - * Fix branch page pull request title and link error (#10092) (#10097) - * Fix PR API: Only try to get HeadBranch if HeadRepo exist (#10029) (#10088) - * Update topics repo count when deleting repository (#10051) (#10081) - * Show pull icon on pull requests (#10061) (#10062) - * Fix milestone API state parameter unhandled (#10049) (#10052) - * Move to using a temporary repo for pushing new PRs (#10009) (#10042) - * Fix wiki raw view on sub path (#10002) (#10040) - * Ensure that feeds are appropriately restricted (#10018) (#10019) - * Sanitize credentials in mirror form (#9975) (#9991) - * Close related pull requests when deleting head repository or head branch (#9927) (#9974) - * Switch to use -f instead of -F for sendmail (#9961) (#9970) - * Fix file rename/copy not supported by indexer (#9965) (#9967) - * Fix repo indexer not updating upon push (#9957) (#9963) - * Don't convert ellipsis in markdown (#9905) (#9937) - * Fixed repo link in generated comment for cross repository dependency (#9863) (#9935) - * Check if diff actually contains sections when rendering (#9926) (#9933) - * Fix wrong hint when status checking is running on pull request view (#9886) (#9928) - * Fix RocketChat (#9908) (#9921) - * Do not try to recreate ldap user if they are already created (#9900) (#9919) - * Create terminated channel in queue_redis (#9910) (#9911) - * Prevent empty LDAP search result from deactivating all users (#9879) (#9896) - * Fix wrong permissions check when issues/prs shared operations (#9885) (#9889) - * Check user != nil before checking values (#9881) (#9883) - * Allow hyphen in language name (#9873) (#9880) - * Ensure that 2fa is checked on reset-password (#9857) (#9876) - * Fix issues/pulls dependencies problems (#9842) (#9864) - * Fix markdown anchor links (#9673) (#9840) - * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9837) - * Fix download file wrong content-type (#9825) (#9834) - * Fix wrong poster identity on a migrated pull request when submit review (#9827) (#9830) - * Fix database dump when log directory is missing (#9818) (#9819) - * Fix compare (#9808) (#9814) - * Fix push-to-create (#9772) (#9797) - * Fix missing msteam webhook on organization (#9781) (#9794) - * Fix missing unlock in uniquequeue (#9790) (#9791) - * Fix add team on collaborator page when same name as organization (#9778) - * DeleteRepoFile incorrectly handles Delete to new branch (#9769) (#9775) - * Fix milestones page (#9771) - * Fix SimpleMDE quote reply (#9757) (#9768) - * Fix missing updated time on migrated issues and comments (#9744) (#9764) - * Move Errored PRs out of StatusChecking (#9675) (#9726) - * Make hook status printing configurable with delay (#9641) (#9725) - * Fix /repos/issues/search (#9698) (#9724) - * Silence fomantic error regarding tabs (#9713) (#9718) - * Remove unused lock (#9709) (#9710) - * Remove q.lock.Unlock() in setInternal to prevent panic (#9705) (#9706) - * Load milestone in API PR list (#9671) (#9700) - * Don't attempt to close issue if already closed (#9696) (#9699) - * Remove google font call (#9668) (#9681) - * Eliminate horizontal scroll caused by footer (#9674) - * Fix nil reference in repo generation (#9660) (#9666) - * Add HTML URL to API Issues (#9654) (#9661) - * Add PR review webhook to Telegram (#9653) (#9655) - * Use filepath.IsAbs instead of path.IsAbs (#9651) (#9652) - * Disable remove button on repository teams when have access to all (#9640) - * Clean up old references on branch delete (#9614) - * Hide public repos owned by private orgs (#9609) - * Fix access issues on milestone and issue overview pages. (#9603) - * Fix error logged when repos qs is empty (#9591) - * Dont trigger notification twice on issue assignee change (#9582) - * Fix mirror pushed commit actions (#9572) - * Allow only specific columns to be updated on issue via API (#9189) (#9539) - * Fix default avatar for ghost user (#9536) - * Fix download of release attachments with same name (#9529) - * Resolve deprecated INI conversion (#9525) - * Ignore empty avatars during database migration (#9520) - * Fix deleted branch isn't removed when push the branch again (#9516) - * Fix repository issues pagination bug when there are more than one label filter (#9512) - * Fix SetExpr failed (#9506) - * Remove obsolete file private/push_update.go (#9503) - * When recreating hooks, delete them first so they are recreated with the umask (#9502) - * Properly enforce gitea environment for pushes (#9501) - * Fix datarace on repo indexer queue (#9490) - * Add call to load repo prior to redirect in add/remove dependency code (#9484) - * Wrap the code indexer (#9476) - * Use Req.URL.RequestURI() to cope with FCGI urls (#9473) - * Set default ssh.minimum_key_sizes (#9466) - * Fixed issue with paging in /repos/{owner}/{repo}/git/trees/{sha} api (#9459) - * Fix wrong notification on merge (#9450) - * Issue with Migration rule v111 (#9449) - * Trigger webhook when deleting a branch after merging a PR (#9424) - * Add migration to sanitize repository original_url (#9423) - * Use OriginalURL instead of CloneAddr in migration logging (#9418) - * Push update after branch is restored (#9416) - * Fix wrong migration (#9381) - * Fix show repositories filter (#9234) (#9379) - * Fix Slack webhook payload title generation to work with Mattermost (#9378) - * Fix double webhook for new PR (#9375) - * AuthorizedKeysCommand should not query db directly (#9371) - * Fix missed change to GetManager() (#9361) - * Fix cache problem on dashboard (#9358) - * RepoIndexer: DefaultBranch needs to be prefixed by BranchPrefix (#9356) - * Fix protected branch using IssueID (#9348) - * Fix nondeterministic behavior (#9341) - * Fix PR/issue redirects when having external tracker (#9339) - * Remove release attachments which repository has been deleted (#9334) - * Fix issue indexer not triggered when migrating a repository (#9332) - * Add SyncTags to uploader interface (#9326) - * Fix bug that release attachment files not deleted when deleting repository (#9322) - * Only sync tags after all migration release batches are completed (#9319) - * File Edit: Author/Committer interchanged (#9297) - * prebuild CSS/JS before xgo release binaries (#9293) - * Log: Ensure FLAGS=none shows no flags (#9287) - * Make Diff Detail on Pull Request Changed File UI always on Top (#9280) - * Switch CSS minifier to cssnano (#9260) - * Fix latest docker image haven't include static files. (#9252) - * Don't link wiki revision to commit (#9244) - * Change review content column to type text in db (#9229) - * Fixed topic regex pattern and added search by topic links after save (#9219) - * Add language to user API responce (#9215) - * Correct tooltip message blocked by dependencies (#9211) - * Add SimpleMDE and Fix Image Paste for Issue/Comment Editor (#9197) - * Fix panic when diff (#9187) - * Fix #9151 - smtp logger configuration sendTos should be an array (#9154) - * Fix max length check and limit in multiple repo forms (#9148) - * Always Show Password Field on Link Account Sign-in Page (#9147) - * Properly fix displaying virtual session provider in admin panel (#9137) - * Fix race condition on indexer (#9136) - * Fix team links in HTML rendering (#9127) - * Fix race condition in ReplaceSanitizer (#9123) - * Fix what information is shown about user in API (#9115) - * Fix nil context user for template repositories (#9099) - * Hide given credentials for migrated repos. (#9097) - * Fix reCAPTCHA API URL (#9083) - * Fix password checks on admin create/edit user (#9076) - * Update golang.org/x/crypto vendor to use acme v2 (#9056) - * Ensure Written is set in GZIP ProxyResponseWriter (#9018) - * Fix wrong system notice when repository is empty (#9010) - * Fix broken link to branch from issue list (#9003) - * Fix bug when pack js (#8992) - * New review approvals shouldn't require a message (#8991) - * Shadow password correctly for session config (#8984) - * Don't send notification on pending reviews (#8943) - * Fix Notify Create Ref Error on tag creation (#8936) - * Convert EOL to UNIX-style to render MD properly (#8925) - * Migrate temp_repo.go to use git.NewCommand (#8918) - * Fix issue with user.fullname (#8902) - * Add Close() method to gogitRepository (#8901) - * Enable punctuations ending mentions (#8889) - * Fix password complexity check on registration (#8887) - * Fix require external registration password (#8885) - * Fix edit content button on migrated issue content (#8877) - * Fix permission checks for close/reopen from commit (#8875) - * Fix API Bug (fail on empty assignees) (#8873) - * Stop using git count-objects and use raw directory size for repository (#8848) - * Fix count for commit graph last page (#8843) - * Fix to close opened io resources as soon as not needed (#8839) - * Improve notification (#8835) - * Fix new user form for non-local users (#8826) - * Fix: remove duplicated signed commit icons (#8820) - * Fix (open/closed) issue count when label excluded (#8815) - * Fix SSH2 conditional in key parsing code (#8806) - * Fix 500 when edit hook (#8782) - * On windows set core.longpaths true (#8776) - * Fix commit expand button to not go to commit link (#8745) - * Avoid re-issuing redundant cross-references. (#8734) - * Fix milestone close timestamp function (#8728) - * Move webhook codes from service to webhook notification (#8712) - * Show zero lines on the line counter if the file empty (#8700) - * Fix deadline on update issue or PR via API (#8696) - * make call createMilestoneComment on newIssue func (#8678) - * Send tag create and push webhook when release created on UI (#8671) - * Prevent chrome download page as html with alt + click (#8669) - * Fix 500 when getting user as unauthenticated user (#8653) - * Graceful fixes (#8645) - * Add SubURL to redirect path (#8632) (#8634) - * Fix extra columns from `label` table (#8633) - * Add SubURL to redirect path for transferred/renamed repos (#8632) - * Fix bug when migrate from API (#8631) - * Allow to merge if file path contains " or \ (#8629) - * Prevent removal of non-empty emoji panel following selection of duplicate (#8609) - * Ensure default gpg settings not nil and found commits have reference to repo (#8604) - * Set webhook Content-Type for application/x-www-form-urlencoded (#8599) - * Fix #8582 by handling empty repos (#8587) - * Fix of the diff statistics view on pull request's (#8581) - * Fix bug on pull requests when transfer head repository (#8564) - * Fix template error on account page (#8562) - * Allow externalID to be UUID (#8551) - * Fix ignored error on editorconfig api (#8550) - * Fix user avatar name (#8547) - * Ensure that GitRepo is set on Empty repositories (#8539) - * Add missed close in ServeBlobLFS (#8527) - * Fix migrate mirror 500 bug (#8526) - * Fix password complexity regex for special characters (on master) (#8525) -* ENHANCEMENTS - * Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844) (#9855) - * Add a /user/login landing page option (#9622) - * Some more e-mail notification fixes (#9596) - * Add branch protection option to block merge on requested changes. (#9592) - * Add footer extra links template (#9576) - * Fix for a wrong URL in activity page of repository. (#9571) - * Update default issue template (#9568) - * Change markdown rendering from blackfriday to goldmark (#9533) - * Extend file create api with dates (#9464) - * Add ActionCommentPull action (#9456) - * Response for context on retry database connection (#9444) - * Refactor webhooks to reduce code duplication (#9422) - * update couchbase deps for new license (#9419) - * Add .ignore file for search tools (#9417) - * Remove unsued struct (#9405) - * Hide not allowed Reactions (#9387) - * Remove text from action-only webhooks (#9377) - * Move PushToBaseRepo from models to services/pull (#9352) - * Site admin could view org's members (#9346) - * Sleep longer if request speed is over github limitation (#9335) - * Refactor comment (#9330) - * Refactor code indexer (#9313) - * Remove SavePatch and generate patches on the fly (#9302) - * Move some pull request functions from models to services (#9266) - * Update JS dependencies (#9255) - * Show label list on label set (#9251) - * Redirect issue if repo has configured external tracker. (#9247) - * Allow kbd tags (#9245) - * Remove unused comment actions (#9222) - * Fixed errors logging in dump.go (#9218) - * Expose release counter to repo API response (#9214) - * Make consistent links to repository in the Slack/Mattermost notificiations (#9205) - * Expose pull request counter to repo API response (#9202) - * Extend TrackedTimes API (#9200) - * Extend StopWatch API (#9196) - * Move code indexer related code to a new package (#9191) - * Docker: ask s6 to stop all service when gitea stop (#9171) - * Variable expansion in repository templates (#9163) - * Add avatar and issue labels to template repositories (#9149) - * Show single review comments in the PR conversation tab (#9143) - * Extract createComment (#9125) - * Move PushUpdateOptions from models to repofiles (#9124) - * Alternate syntax for cross references (#9116) - * Add USE_SERVICE_WORKER setting (#9110) - * Only show part of members on orgnization dashboard and add paging for orgnization members page (#9092) - * Explore page: Add topic param to pagination (#9077) (#9078) - * Markdown: Sanitizier Configuration (#9075) - * Add password requirement info on error (#9074) - * Allow authors to use act keywords in PR content (#9059) - * Move modules/gzip to gitea.com/macaron/gzip (#9058) - * Branch protection: Possibility to not use whitelist but allow anyone with write access (#9055) - * Context menus for comments, add quote reply (#9043) - * Update branch API endpoint to show effective branch protection. (#9031) - * Move git graph from models to modules/graph (#9027) - * Move merge actions to notification (#9024) - * Move mirror sync actions to notification (#9022) - * Add retry for migration http/https requests (#9019) - * Rewrite delivery of issue and comment mails (#9009) - * Add review comments to mail notifications (#8996) - * Refactor pull request review (#8954) - * Githook highlighter (#8932) - * Add git hooks and webhooks to template repositories; move to services (#8926) - * Only view branch or tag if it match refType requested. (#8899) - * Drop Admin attribute based on LDAP when login (continue #1743) (#8849) - * Add additional periods to activity page (#8829) - * Update go-org to optimize code (#8824) - * Move some actions to notification/action (#8779) - * Webhook support custom proxy (#8760) - * Fix API deadline removal (#8759) - * Mark review comment as invalidated when file is deleted (#8751) - * Move pull list code to a separate file (#8748) - * Move webhook to a standalone package under modules (#8747) - * Multi repo select on issue page (#8741) - * apply exclude label on milestone issue list (#8739) - * Move issue notifications and assignee man (#8713) - * Move issue change content from models to service (#8711) - * Move issue change status from models to service (#8691) - * Move more issue assignee code from models to issue service (#8690) - * Create PR on Current Repository by Default (#8670) - * Improve Open Graph Protocol (#8637) - * Batch hook pre- and post-receive calls (#8602) - * Improve webhooks (#8583) - * Move transfer repository and rename repository on a service package and start action notification (#8573) - * Implement/Fix PR review webhooks (#8570) - * Rewrite markdown rendering to blackfriday v2 and rewrite orgmode rendering to go-org (#8560) - * Move some repositories' operations to a standalone service package (#8557) - * Allow more than 255 characters for tokens in external_login_user table (#8554) - * Move issue label operations to issue service package (#8553) - * Adjust error reporting from merge failures and use LC_ALL=C for git (#8548) - * Mail assignee when issue/pull request is assigned (#8546) - * Allow committing / adding empty files using the web ui (#8420) (#8532) - * Move sync mirror actions to mirror service package (#8518) - * Remove arrows on numeric inputs (#8516) - * Support inline rendering of CUSTOM_URL_SCHEMES (#8496) - * Recalculate repository access only for specific user (#8481) - * Add download button for rull request diff- and patch-file (#8470) - * Add single sign-on support via SSPI on Windows (#8463) - * Move change issue title from models to issue service package (#8456) - * Add included tag on branch view (#8449) - * Make static resouces web browser cache time customized on app.ini (#8442) - * Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426) - * Add pagination to commit graph page (#8360) - * Use templates for issue e-mail subject and body (#8329) - * Move clearlabels from models to issue service (#8326) - * Move AddTestPullRequestTask to pull service package from models (#8324) - * Team permission to create repository in organization (#8312) - * Allows external rendering of other filetypes (#8300) - * Add 'Alt + click' feature to exclude labels (#8199) - * Configurable close and reopen keywords for PRs (#8120) - * Configurable URL for static resources (#7911) - * Unifies commit list in repository commit table and wiki revision page (#7907) - * Allow cross-repository dependencies on issues (#7901) - * Auto-subscribe user to repository when they commit/tag to it (#7657) - * Restore Graceful Restarting & Socket Activation (#7274) - * wiki - add 'write' 'preview' buttons to wiki edit like in issues (#7241) - * Change target branch for pull request (#6488) - * Display PR commits and diffs using base repo rather than forked (#3648) -* TESTING - * Add debug option to serv to help debug problems (#9492) - * Fix the intermittent TestGPGGit failures (#9360) - * Testing: Update postgres sequences (#9304) - * Missed defer prepareTestEnv (#9285) - * Fix "data race" in testlogger (#9159) - * Yet another attempt to fix the intermittent failure of gpg git test (#9146) - * integrations: Fix Dropped Test Errors (#9040) - * services/mirror: fix dropped test errors (#9007) - * Fix intermittent GPG Git test failure (#8968) - * Update Github Migration Tests (#8893) (#8938) - * Update heatmap fixtures to restore tests (#8615) -* TRANSLATION - * Fix Korean locales (#9761) (#9780) - * Fix placeholders in the error message (#9060) - * Fix spelling of admin.users.max_repo_creation (#8934) - * Improve german translation of homepage (#8549) -* BUILD - * Fix webpack polyfills (#9735) (#9738) - * Update gitea.com/macaron to 1.4.0 (#9608) - * Upgrade lato fonts to v16. (#9498) - * Update alpine to 3.11 (#9440) - * Upgrade blevesearch (#9177) - * Remove built js/css files from git (#9114) - * Move semantic.dropdown.custom.js to webpack (#9064) - * Check compiled files during build (#9042) - * Enable lazy-loading of gitgraph.js (#9036) - * Pack web_src/js/draw.js to public/js/index.js (#8975) - * Modernize js and use babel (#8973) - * Move index.js to web_src and use webpack to pack them (#8598) - * Restrict modules/graceful to non-windows build and shim IsChild (#8537) - * Upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (#8501) -* DOCS - * Swagger info corrections (#9441) (#9558) - * Add ALLOW_ONLY_EXTERNAL_REGISTRATION to config cheat sheet (#8986) - * Rephrase comment about RuntimeDirectory option in systemd config (#8912) - * Explicitly indicate the socket unit to use the service unit "gitea.service" (#8804) - * Adjust the must-change-password help (#8755) - * Add notice to docs for migrating from more recent versions of Gogs (#8724) - * Add explicit info about customization of homepage (#8694) - * Change external asciidoctor tool to embedded mode (#8677) - * Add Docker fail2ban configuration (#8642) - * Correct some outdated statements in the contributing guidelines (#8612) - * Basic Design guidelines (describing different parts of the code) (#8601) - * Display Gitea logo in Readme (#8592) - * Fix building from source docs to ref AppWorkPath (#8567) - * Update the provided gitea.service to mention socket activation (#8531) - * Doc added how to setup email (#8520) -* MISC - * Backport Locales [2020-01-14] (#9773) - * Add translatable Powered by Gitea text in footer (#9600) - * Add contrib/environment-to-ini (#9519) - * Remove unnecessary loading of settings in update hook (#9496) - * Update gitignore list (#9437) - * Update license list (#9436) - * Fix background reactions in the arc-green theme (#9421) - * Update and fix chardet import (#9351) - * Ensure LF on checkouts and in editors (#9259) - * Fixed topics margin (#9248) - * Add comment to exported function WindowsServiceName (make revive) (#9241) - * Remove empty lines on issues/pulls page (#9232) - * Fix Add Comment Button's "+" Position (#9140) - * Add first issue comment hashtag (#9052) - * Change some label colors (#9051) - * Fix double scroll in branch dropdown (#9048) - * Add comment highlight when target from url (#9047) - * Update display of reactions to issues and comments (#9038) - * Button tooltip formatting under Branches (#9034) - * Allow setting default branch via API (#9030) - * Update dashboard context for PR reviews (#8995) - * Show repository size in repo home page and settings (#8940) - * Allow to add and remove all repositories to/from team. (#8867) - * Show due date in dashboard issues list (#8860) - * Theme arc-green: reverse heatmap colors (#8840) - * Project files table style update (#8757) - * gitignore debugging file from vscode (#8740) - * Add API for Issue set Subscription (#8729) - * Make 100% width search bar (#8710) - * Update color theme for heatmap (#8709) - * Add margin to title_wip_desc (#8705) - * Improve visibility of "Pending" indicator (#8685) - * Improve accessibility of dropdown menus (#8638) - * Make /users/{username}/repos list private repos the current user has access to (#8621) - * Prevent .code-view from overriding font on icon fonts (#8614) - * Add id references on all issue events to allow internal linking (#8608) - * Upgrade xorm to v0.8.0 (#8536) - * Upgrade gopkg.in/ini.v1 (#8500) - * Update CodeMirror to version 5.49.0 (#8381) - * Wiki editor: enable side-by-side button (#7242) - -## [1.10.6](https://github.com/go-gitea/gitea/releases/tag/v1.10.6) - 2020-03-10 - -This is a re-tag version of v1.10.5 and also explicitly built with Go 1.13. - -WARNING: v1.10.5 is incorrectly tagged targeting 1.12-dev and should __not__ be used. - -## [1.10.5](https://github.com/go-gitea/gitea/releases/tag/v1.10.5) - 2020-03-06 - -* BUGFIXES - * Fix release attachments being deleted while upgrading (#10572) (#10574) - -## [1.10.4](https://github.com/go-gitea/gitea/releases/tag/v1.10.4) - 2020-02-16 - -* FEATURE - * Prevent empty LDAP search from deactivating all users (#9879) (#9890) -* BUGFIXES - * Fix reply on code review (#10261) (#10227) - * Fix branch page pull request title and link error (#10092) (#10098) - * Fix milestone API state parameter unhandled (#10049) (#10053) - * Fix wiki raw view on sub path (#10002) (#10041) - * Fix RocketChat Webhook (#9908) (#9921) (#9925) - * Fix bug about wrong dependencies permissions check and other wrong permissions check (#9884) (Partial backport #9842) - * Ensure that 2fa is checked on reset-password (#9857) (#9877) - -## [1.10.3](https://github.com/go-gitea/gitea/releases/tag/v1.10.3) - 2020-01-17 - -* SECURITY - * Hide credentials when submitting migration (#9102) (#9704) - * Never allow an empty password to validate (#9682) (#9684) - * Prevent redirect to Host (#9678) (#9680) - * Hide public repos owned by private orgs (#9609) (#9616) -* BUGFIXES - * Allow assignee on Pull Creation when Issue Unit is deactivated (#9836) (#9838) - * Fix download file wrong content-type (#9825) (#9835) - * Fix wrong identify poster on a migrated pull request when submit review (#9827) (#9831) - * Fix dump non-exist log directory (#9818) (#9820) - * Fix compare (#9808) (#9815) - * Fix missing msteam webhook on organization (#9781) (#9795) - * Fix add team on collaborator page when same name as organization (#9783) - * Fix cache problem on dashboard (#9358) (#9703) - * Send tag create and push webhook when release created on UI (#8671) (#9702) - * Branches not at ref commit ID should not be listed as Merged (#9614) (#9639) - -## [1.10.2](https://github.com/go-gitea/gitea/releases/tag/v1.10.2) - 2020-01-02 - -* BUGFIXES - * Allow only specific Columns to be updated on Issue via API (#9539) (#9580) - * Add ErrReactionAlreadyExist error (#9550) (#9564) - * Fix bug when migrate from API (#8631) (#9563) - * Use default avatar for ghost user (#9536) (#9537) - * Fix repository issues pagination bug when there are more than one label filter (#9512) (#9528) - * Fix deleted branch not removed when push the branch again (#9516) (#9524) - * Fix missing repository status when migrating repository via API (#9511) - * Trigger webhook when deleting a branch after merging a PR (#9510) - * Fix paging on /repos/{owner}/{repo}/git/trees/{sha} API endpoint (#9482) - * Fix NewCommitStatus (#9434) (#9435) - * Use OriginalURL instead of CloneAddr in migration logging (#9418) (#9420) - * Fix Slack webhook payload title generation to work with Mattermost (#9404) - * DefaultBranch needs to be prefixed by BranchPrefix (#9356) (#9359) - * Fix issue indexer not triggered when migrating a repository (#9333) - * Fix bug that release attachment files not deleted when deleting repository (#9322) (#9329) - * Fix migration releases (#9319) (#9326) (#9328) - * Fix File Edit: Author/Committer interchanged (#9297) (#9300) - -## [1.10.1](https://github.com/go-gitea/gitea/releases/tag/v1.10.1) - 2019-12-05 - -* BUGFIXES - * Fix max length check and limit in multiple repo forms (#9148) (#9204) - * Properly fix displaying virtual session provider in admin panel (#9137) (#9203) - * Upgrade levelqueue to 0.1.0 (#9192) (#9199) - * Fix panic when diff (#9187) (#9193) - * Smtp logger configuration sendTos should be an array (#9154) (#9157) - * Always Show Password Field on Link Account Sign-in Page (#9150) - * Create PR on Current Repository by Default (#8670) (#9141) - * Fix race on indexer (#9136) (#9139) - * Fix reCAPTCHA URL (#9119) - * Hide migrated credentials (#9098) - * Update golang.org/x/crypto vendor to use acme v2 (#9056) (#9085) - * Fix password checks on admin create/edit user (#9076) (#9081) - * Fix add search as a reserved username (#9063) (#9065) - * Fix permission checks for close/reopen from commit (#8875) (#9033) - * Ensure Written is set in GZIP ProxyResponseWriter (#9018) (#9025) - * Fix broken link to branch from issue list (#9003) (#9021) - * Fix wrong system notice when repository is empty (#9020) - * Shadow password correctly for session config (#8984) (#9002) - -## [1.10.0](https://github.com/go-gitea/gitea/releases/tag/v1.10.0) - 2019-11-13 - -* BREAKING - * Fix deadline on update issue or PR via API (#8698) - * Hide some user information via API if user doesn't have enough permission (#8655) (#8657) - * Remove legacy handling of drone token (#8191) - * Change repo search to use exact match for topic search. (#7941) - * Add pagination for admin api get orgs and fix only list public orgs bug (#7742) - * Implement the ability to change the ssh port to match what is in the gitea config (#7286) -* SECURITY - * Fix issue with user.fullname (#8903) - * Ignore mentions for users with no access (#8395) - * Be more strict with git arguments (#7715) - * Extract the username and password from the mirror url (#7651) - * reserve .well-known username (#7637) -* FEATURES - * Org/Members: display 2FA members states + optimize sql requests (#7621) - * SetDefaultBranch on pushing to empty repository (#7610) - * Adds side-by-side diff for images (#6784) - * API method to list all commits of a repository (#6408) - * Password Complexity Checks (#6230) - * Add option to initialize repository with labels (#6061) - * Add additional password hash algorithms (#6023) -* BUGFIXES - * Allow to merge if file path contains " or \ (#8629) (#8771) - * On windows set core.longpaths true (#8776) (#8786) - * Fix 500 when edit hook (#8782) (#8789) - * Fix Checkbox at RepoSettings Protected Branch (#8799) (#8801) - * Fix SSH2 conditional in key parsing code (#8806) (#8810) - * Fix commit expand button to not go to commit link (#8745) (#8825) - * Fix new user form for non-local users (#8826) (#8828) - * Fix to close opened io resources as soon as not needed (#8839) (#8846) - * Fix edit content button on migrated issue content (#8877) (#8884) - * Fix require external registration password (#8885) (#8890) - * Fix password complexity check on registration (#8887) (#8888) - * Update Github Migration Tests (#8896) (#8938) (#8945) - * Enable punctuations ending mentions (#8889) (#8894) - * Add Close() method to gogitRepository (#8901) (#8956) - * Hotfix for review actions and notifications (#8965) - * Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) (#8618) - * Fix milestone close timestamp (#8728) (#8730) - * Fix 500 when getting user as unauthenticated user (#8653) (#8663) - * Fix 'New Issue Missing Milestone Comment' (#8678) (#8681) - * Use AppSubUrl for more redirections (#8647) (#8651) - * Add SubURL to redirect path (#8632) (#8634) - * Fix template error on account page (#8562) (#8622) - * Allow externalID to be UUID (#8551) (#8624) - * Prevent removal of non-empty emoji panel following selection of duplicate (#8609) (#8623) - * Update heatmap fixtures to restore tests (#8615) (#8616) - * Ensure that diff stats can scroll independently of the diff (#8581) (#8621) - * Webhook: set Content-Type for application/x-www-form-urlencoded (#8600) - * Fix #8582 by handling empty repos (#8587) (#8594) - * Fix bug on pull requests when transfer head repository (#8564) (#8569) - * Add missed close in ServeBlobLFS (#8527) (#8542) - * Ensure that GitRepo is set on Empty repositories (#8539) (#8541) - * Fix migrate mirror 500 bug (#8526) (#8530) - * Fix password complexity regex for special characters (#8524) - * Prevent .code-view from overriding font on icon fonts (#8614) (#8627) - * Allow more than 255 characters for tokens in external_login_user table (#8554) - * Fix errors in create org UI regarding team access permission (#8506) - * Fix bug on FindExternalUsersByProvider (#8504) - * Create .ssh dir as necessary (#8486) - * IsBranchExist: return false if provided name is empty (#8485) - * Making openssh listen on SSH_LISTEN_PORT not SSH_PORT (#8477) - * Add check for empty set when dropping indexes during migration (#8471) - * LFS files are relative to LFS content path, ensure that when deleting they are made relative to this (#8455) - * Ensure Request Body Readers are closed in LFS server (#8454) - * Fix template bug on mirror repository setting page (#8438) - * Fix migration v96 to keep issue attachments (#8435) - * Update strk.kbt.io/projects/go/libravatar to latest (#8429) - * Singular form for files that has only one line (#8416) - * Check for either escaped or unescaped wiki filenames (#8408) - * Allow users with explicit read access to give approvals (#8382) - * Fix editor commit to new branch if PR disabled (#8375) - * readd .markdown class to all markup renderers (#8357) - * Upgrade xorm to v0.7.9 to fix some bugs (#8354) - * Fix column name ambiguity in GetUserIssueStats() (#8347) - * Change general form binding to gogs form (#8334) - * Fix pull request commit status in user dashboard list (#8321) - * Fix repo_admin_change_team_access always checked in org settings (#8319) - * Update to github.com/lafriks/xormstore@v1.3.0 (#8317) - * Show correct commit status in PR list (#8316) - * Bugfix for image compare and minor improvements to image compare (#8289) - * Update xorm (#8286) - * Fix API for edit and delete release attachment (#8285) - * Fix nil object access in some conditions when parsing cross references (#8281) - * Fix label count (#8267) - * Only show teams access for organization repositories on collaboration setting page (#8265) - * Test more reserved usernames (#8263) - * Rewrite reference processing code in preparation for opening/closing from comment references (#8261) - * Fix assets key on release webhook (#8253) - * Allow registration when button is hidden (#8237) - * Fix release API URL generation (#8234) - * Fix milestone num_issues (#8221) - * MS Teams webhook misses commit messages (#8209) - * Fix data race (#8204) - * Fix team user api (#8172) - * Fix pull merge 500 error caused by git-fetch breaking behaviors (#8161) - * Make show private icon when repo avatar set (#8144) - * Add reviewers as participants (#8121) - * Fix Go 1.13 private repository go get issue (#8112) - * feat: highlight issue references with : (#8101) - * Make AllowedUsers configurable in sshd_config (#8094) - * Strict name matching for Repository.GetTagID() (#8074) - * Avoid ambiguity of branch/directory names for the git-diff-tree command (#8066) - * Add change title notification for issues (#8061) - * [ssh] fix the config specification in the authorized_keys template (#8031) - * Fix reading git notes from nested trees (#8026) - * Fixes synchronize tags to releases for repository - makes sure we are only getting tag refs (#7990) - * Fix adding default Telegram webhook (#7972) - * Run CORS handler first for /api routes (#7967) - * Abort synchronization from LDAP source if there is some error. (#7960) - * Fix wrong sender when send slack webhook (#7918) - * Fix bug when migrating a private repository (#7917) - * Evaluate emojis in commit messages in list view (#7906) - * Fix upload file type check (#7890) - * lfs/lock: round locked_at timestamp to second (#7872) - * fix non existent milestone with 500 error instead of 404 (#7867) - * gpg/bugfix: Use .ExpiredUnix.IsZero to display green color of forever valid gpg key (#7846) - * Fix duplicate call of webhook (#7821) - * Enable switching to a different source branch when PR already exists (#7819) - * Convert files to utf-8 for indexing (#7814) - * Do not fetch all refs in pull-request compare (#7797) - * Fix multiple bugs with statuses endpoints at API (#7785) - * Restore functionality for early gits (#7775) - * Fix Slack webhook fork message (#7774) - * Rewrite existing repo units if setting is not included in api body (#7763) - * Fix rename failed when rewrite public keys (#7761) - * Fix approvals counting (#7757) - * Add migration step to remove old repo_indexer_status orphaned records (#7746) - * Fix repo_index_status lingering when deleting a repository (#7734) - * Remove camel case tokenization from repo indexer (#7733) - * Fix milestone completness calculation when migrating (#7725) - * Regression: Include "executable" files in the index, as they are not necessarily … (#7718) - * Fixes indexed repos keeping outdated indexes when files grow too large (#7712) - * Skip non-regular files (e.g. submodules) on repo indexing (#7711) - * Fix dropTableColumns sqlite implementation (#7710) - * Update gopkg.in/src-d/go-git.v4 to v4.13.1 (#7705) - * improve branches list performance and fix protected branch icon when no-login (#7695) - * Correct wrong datetime format for git (#7689) - * Move add to hook queue for created repo to outside xorm session. (#7675) - * sugestion to use range .Branches (#7674) - * Fix bug on migrating milestone from github (#7665) - * hide delete/restore button on archived repos (#7658) - * css: use flex to fix floating paginate (#7656) - * Fix syntax highlight initialization (#7617) - * Fix panic on push at - Merging pull request causes 500 error (#7615) - * Make PKCS8, PEM and SSH2 keys work (#7600) - * Fix mistake in arc-green.less split-diff css code. (#7587) - * Handle ErrUserProhibitLogin in http git (#7586) - * Fix bug create/edit wiki pages when code master branch protected (#7580) - * Fixes Malformed URLs in API git/commits response (#7565) - * Fix file header overflow in file and blame views (#7562) - * Improve SSH key parser to handle newlines in keys (#7522) - * Fix empty commits now showing in repo overview (#7521) - * Fix repository's pull request count error (#7518) - * Fix markdown invoke sequence (#7513) - * Remove duplicated webhook trigger (#7511) - * Update User.NumRepos atomically in createRepository (#7493) - * Fix settings page of repo you aren't admin print error - Settings pages giving UnitType error message (#7482) - * Fix redirection after file edit - Handles all redirects for Web UI File CRUD (#7478) - * cmd/serv: actually exit after fatal errors (#7458) - * Fix an issue with some pages throwing 'not defined' js exceptions (#7450) - * fix Dropzone.js integration (#7445) - * Fix regex for issues in commit messages (#7444) - * Diff: Fix indentation on unhighlighted code (#7435) - * Only show "New Pull Request" button if repo allows pulls (#7426) - * Upgrade macaron/captcha to fix random error problem (#7407) - * create class for inline positioned lists (#7393) - * Fetch refs for successful testing for tag (#7388) - * add missing template variable on organisation settings (#7385) - * fix post parameter - on issue list - unset assignee (#7380) - * fix/define autochecked checkboxes on issue list in firefox (#7320) - * only return head: null if source branch was deleted (#6705) -* ENHANCEMENTS - * Add nofollow to sign in links (#8509) - * vendor: update mvdan.cc/xurls/v2 to v2.1.0 (#8495) - * Update milestone issues numbers when save milestone and other code improvements (#8411) - * Add extra user information when migrating release (#8331) - * Require overall success if no context is given for status check (#8318) - * Transaction-aware retry create issue to cope with duplicate keys (#8307) - * Change link on issue milestone (#8246) - * Alwaywas return local url for users avatar (#8245) - * Move some milestone functions to a standalone package (#8213) - * Move create issue comment to comments package (#8212) - * Disable max height property of comment textarea (#8203) - * Add 'Mentioning you' group to /issues page (#8201) - * oauth2 with remote Gitea (#8149) - * Reference issues from pull requests and other issues (#8137) - * Fix webhooks to use proxy from environment (#8116) - * Add merged commit id on pull view when it's merged (#8062) - * Add teams to repo on collaboration page. (#8045) - * Update swagger to 0.20.1 (#8010) - * Make link last commit massages in repository home page and commit tables (#8006) - * Add API endpoint for accessing repo topics (#7963) - * Include description in repository search (#7942) - * Use gitea forked macaron (#7933) - * Fix pull creation with empty changes (#7920) - * Allow token as authorization for accessing attachments (#7909) - * Retry create issue to cope with duplicate keys (#7898) - * Move git diff codes from models to services/gitdiff (#7889) - * migrate gplus to google oauth2 provider (#7885) - * Remove unique filter from repo indexer analyzer. (#7878) - * Detect delimiter in CSV rendering (#7869) - * Import topics during migration (#7851) - * Move CreateReview to modules/pull (#7841) - * vendor: update pdf.js to v2.1.266 (#7834) - * Support SSH_LISTEN_PORT env var in docker app.ini template (#7829) - * Add Ability for User to Customize Email Notification Frequency (#7813) - * Move database settings from models to setting (#7806) - * Display ui time with customize time location (#7792) - * Implement webhook branch filter (#7791) - * Restrict repository indexing by glob match (#7767) - * Api: advanced settings for repository (external wiki, issue tracker etc.) (#7756) - * Update migrated repositories' issues/comments/prs poster id if user has a github external user saved (#7751) - * deps: Upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (#7749) - * Apply emoji on commit graph page (#7743) - * Add a lot of extension to language mappings for syntax highlights (#7741) - * Add SQL execution on log and indexes on table repository and comment (#7740) - * Set DB connection error level to error (#7724) - * Check commit message hashes before making links (#7713) - * remove unnecessary fmt on generate bindata (#7706) - * Fix specific highlighting (CMakeLists.txt ...) (#7686) - * Add file status on API (#7671) - * Add support for DEFAULT_ORG_MEMBER_VISIBLE (#7669) - * Provide links in commit summaries in commits table/view list (#7659) - * Change length of some repository's columns (#7652) - * Move commit repo action from models to repofiles package (#7645) - * fix wrong email when use gitea as OAuth2 provider (#7640) - * [Branch View] add download button (#7604) - * Update to xorm@v0.7.4 (#7596) - * use 403 instead of 401 for ErrUserProhibitLogin (#7591) - * Removed unnecessary conversions (#7557) - * Un-lambda base.FileSize (#7556) - * Added missing error checks in tests (#7554) - * Move create release from models to a standalone package (#7539) - * Make default branch name link to default branch (#7519) - * Added total count of contributions to heatmap (#7517) - * Move mirror to a standalone package from models (#7486) - * Move models.PushUpdate to repofiles.PushUpdate (#7485) - * Include thread related headers in issue/coment mail (#7484) - * Refuse merge until all required status checks success (#7481) - * convert all js var to let/const (#7464) - * Only create branches for opened pull requestes when migrating from github (#7463) - * jQuery 3 (#7425) - * Add notification placeholder (#7409) - * Search Commits via Commit Hash (#7400) - * Move status table to cron package (#7370) - * wiki - page revisions list (#7369) - * Display original author and URL information when showing migrated issues/comments (#7352) - * Refactor filetype is not allowed errors (#7309) - * switch to use gliderlabs/ssh for builtin server (#7250) - * Remove settting dependency on modules/session (#7237) - * Move all mail related codes from models to services/mailer (#7200) - * Support git.PATH entry in app.ini (#6772) - * Support setting cookie domain (#6288) - * Move migrating repository from frontend to backend (#6200) - * Delete releases attachments if release is deleted (#6068) -* TRANSLATION - * Latvian translation for home page (#8468) - * Add home template italian translation (#8352) - * fix misprint (#7452) -* BUILD - * use go 1.13 (#8088) -* MISC - * add file line count info on UI (#8396) - * Make issues page left menu 100% width and add reponame as title attribute (#8359) - * [arc-green] white on hover for active menu items (#8344) - * Move ref (branch or tag) location on issue list page (#8157) - * apply emoji on dashboard issue list labels (#8156) - * 1148: Take up the full width when viewing the diff in split view. (#8114) - * Display description of 'make this repo private' as help text, not as tooltip (#8097) - * Fixes deformed emoji in pull request reviews (#8047) - * Add strike to old header on comment (#8046) - * Add tooltip for the visibility checkbox in /repo/create (#8025) - * Update github.com/lafriks/xormstore and tidy up mod.go (#8020) - * keep blame view buttons sequence consistent with normal view when view a file (#8007) - * Use "Pull Request" instead of "Merge Request" (#8003) - * Move line number to :before attr to hide from search on browser (#8002) - * Changed black color to white for (read) number label on issue list page (#8000) - * [Branch View] show "New Pull Request" Button only if posible (#7977) - * Fix hook problem by only setting the git environment variables if we are passed them (#7854) - * Prevent Commit Status and Message From Overflowing On Branch Page (#7800) - * Fix global search result CSS, misc CSS tweaks (#7789) - * Tweak label border CSS (#7739) - * Fix create menu item widths (#7708) - * [Branch View] Delete duplicate protection symbol (#7624) - * [Branch View] Delete Table Header (#7622) - * [Branch View] icons to buttons (#7602) - * update js dependencies (#7462) - * Add Extra Info to Branches Page (#7461) - * Bump lodash from 4.17.11 to 4.17.14 (#7459) - * wiki history improvements (#7391) - * ui fixes - compare view and archieved repo issues (#7345) - * dark theme scrollbars (#7269) - * wiki - editor - add buttons 'inline code', 'empty checkbox', 'checked checkbox' (#7243) - * Fix Statuses API only shows first 10 statuses: Add paging and extend API GetCommitStatuses (#7141) - -## [1.9.6](https://github.com/go-gitea/gitea/releases/tag/v1.9.6) - 2019-11-13 - -* BUGFIXES - * Allow to merge if file path contains " or \ (#8629) (#8772) - * Fix 500 when edit hook (#8782) (#8790) - * Fix issue with user.fullname (#8904) - * Update Github Migration Test (#8897) (#8946) - * Add Close() method to gogitRepository (#8901) (#8958) - -## [1.9.5](https://github.com/go-gitea/gitea/releases/tag/v1.9.5) - 2019-10-30 - -* BREAKING - * Hide some user information via API if user doesn't have enough permission (#8655) (#8658) -* BUGFIXES - * Fix milestone close timestamp (#8728) (#8731) - * Fix deadline on update issue or PR via API (#8699) - * Fix 'New Issue Missing Milestone Comment' (#8678) (#8682) - * Fix 500 when getting user as unauthenticated user (#8653) (#8662) - * Use AppSubUrl for more redirections (#8647) (#8652) - * Add SubURL to redirect path (#8632) (#8634) (#8640) - * Fix #8582 by handling empty repos (#8587) (#8593) - * Fix bug on pull requests when transfer head repository (#8571) - * Add missed close in ServeBlobLFS (#8527) (#8543) - * Return false if provided branch name is empty for IsBranchExist (#8485) (#8492) - * Create .ssh dir as necessary (#8369) (#8486) (#8489) - * Restore functionality for early gits (#7775) (#8476) - * Add check for empty set when dropping indexes during migration (#8475) - * Ensure Request Body Readers are closed in LFS server (#8454) (#8459) - * Ensure that LFS files are relative to the LFS content path (#8455) (#8458) -* SECURITY - * Ignore mentions for users with no access (#8395) (#8484) -* TESTING - * Update heatmap fixtures to restore tests (#8615) (#8617) - -## [1.9.4](https://github.com/go-gitea/gitea/releases/tag/v1.9.4) - 2019-10-08 - -* BUGFIXES - * Highlight issue references (#8101) (#8404) - * Fix bug when migrating a private repository #7917 (#8403) - * Change general form binding to gogs form (#8334) (#8402) - * Fix editor commit to new branch if PR disabled (#8375) (#8401) - * Fix milestone num_issues (#8221) (#8400) - * Allow users with explicit read access to give approvals (#8398) - * Fix commit status in PR #8316 and PR #8321 (#8339) - * Fix API for edit and delete release attachment (#8290) - * Fix assets on release webhook (#8283) - * Fix release API URL generation (#8239) - * Allow registration when button is hidden (#8238) - * MS Teams webhook misses commit messages (backport v1.9) (#8225) - * Fix data race (#8206) - * Fix pull merge 500 error caused by git-fetch breaking behaviors (#8194) - * Fix the SSH config specification in the authorized_keys template (#8193) - * Fix reading git notes from nested trees (#8189) - * Fix team user api (#8172) (#8188) - * Add reviewers as participants (#8124) -* BUILD - * Use vendored go-swagger (#8087) (#8165) - * Fix version-validation for GO 1.13 (go-macaron/cors) (#8389) -* MISC - * Make show private icon when repo avatar set (#8144) (#8175) - -## [1.9.3](https://github.com/go-gitea/gitea/releases/tag/v1.9.3) - 2019-09-06 - -* BUGFIXES - * Fix go get from a private repository with Go 1.13 (#8100) - * Strict name matching for Repository.GetTagID() (#8082) - * Avoid ambiguity of branch/directory names for the git-diff-tree command (#8070) - * Add change title notification for issues (#8064) - * Run CORS handler first for /api routes (#7967) (#8053) - * Evaluate emojis in commit messages in list view (#8044) - * Fix failed to synchronize tags to releases for repository (#7990) (#7994) - * Fix adding default Telegram webhook (#7972) (#7992) - * Abort synchronization from LDAP source if there is some error (#7965) - * Fix deformed emoji in commit message (#8071) -* ENHANCEMENTS - * Keep blame view buttons sequence consistent with normal view when viewing a file (#8007) (#8009) - -## [1.9.2](https://github.com/go-gitea/gitea/releases/tag/v1.9.2) - 2019-08-22 - -* BUGFIXES - * Fix wrong sender when send slack webhook (#7918) (#7924) - * Upload support text/plain; charset=utf8 (#7899) - * Lfs/lock: round locked_at timestamp to second (#7872) (#7875) - * Fix non existent milestone with 500 error (#7867) (#7873) -* SECURITY - * Fix No PGP signature on 1.9.1 tag (#7874) - * Release built with go 1.12.9 to fix security fixes in golang std lib, ref: https://groups.google.com/forum/#!msg/golang-announce/oeMaeUnkvVE/a49yvTLqAAAJ -* ENHANCEMENTS - * Fix pull creation with empty changes (#7920) (#7926) -* BUILD - * Drone/docker: prepare multi-arch release + provide arm64 image (#7571) (#7884) - -## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14 - -* BREAKING - * Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752) -* SECURITY - * Be more strict with git arguments (#7715) (#7762) - * Release built with go 1.12.8 to fix security fixes in golang std lib, ref: https://groups.google.com/forum/#!topic/golang-nuts/fCQWxqxP8aA -* BUGFIXES - * Fix local runs of ssh-requiring integration tests (#7855) (#7857) - * Fix hook problem (#7856) (#7754) - * Use .ExpiredUnix.IsZero to display green color of forever valid gpg key (#7850) (#7846) - * Do not fetch all refs (#7797) (#7837) - * Fix duplicate call of webhook (#7824) (#7821) - * Enable switching to a different source branch when PR already exists (#7823) - * Rewrite existing repo units if setting is not included in api body (#7811) - * Prevent Commit Status and Message From Overflowing On Branch Page (#7800) (#7808) - * API: fix multiple bugs with statuses endpoints (Backport #7785) (#7807) - * Fix Slack webhook fork message (1.9 release backport) (#7783) - * Fix approvals counting (#7757) (#7777) - * Fix rename failed when rewrite public keys (#7761) (#7769) - * Fix dropTableColumns sqlite implementation (#7710) (#7765) - * Fix repo_index_status lingering when deleting a repository (#7738) - * Fix milestone completness calculation when migrating (#7725) (#7732) - * Fixes indexed repos keeping outdated indexes when files grow too large (#7731) - * Skip non-regular files (e.g. submodules) on repo indexing (#7717) - * Improve branches list performance and fix protected branch icon when no-login (#7695) (#7704) - * Correct wrong datetime format for git (#7689) (#7690) - -## [1.9.0](https://github.com/go-gitea/gitea/releases/tag/v1.9.0) - 2019-07-30 - -* BREAKING - * Better logging (#6038) (#6095) -* SECURITY - * Shadow the password on cache and session config on admin panel (#7300) - * Fix markdown invoke sequence (#7513) (#7560) - * Reserve .well-known username (#7638) - * Do not leak secrets via timing side channel (#7364) - * Ensure that decryption of cookie actually suceeds (#7363) -* FEATURES - * Content API for Creating, Updating, Deleting Files (#6314) - * Enable tls-alpn-01: Use certmanager provided TLSConfig for LetsEncrypt (#7229) - * Add command to convert mysql database from utf8 to utf8mb4 (#7144) - * Fixes #2738 - Adds the /git/tags API endpoint (#7138) - * Compare branches, commits and tags with each other (#6991) - * Show Pull Request button or status of latest PR in branch list (#6990) - * Repository avatars (#6986) - * Show git-notes (#6984) - * Add commit statuses reports on pull request view (#6845) - * Number of commits ahead/behind in branch overview (#6695) - * Add CLI commands to manage LDAP authentication source (#6681) - * Add support for MS Teams webhooks (#6632) - * OAuth2 Grant UI (#6625) - * Add SUBJECT_PREFIX mailer config option (#6605) - * Include custom configuration file in dump (#6516) - * Add API for manipulating Git hooks (#6436) - * Improve migrations to support migrating milestones/labels/issues/comments/pullrequests (#6290) - * Add option to blame files (#5721) - * Implement Default Webhooks (#4299) - * Telegram webhook (#4227) -* BUGFIXES - * Send webhook after commit when creating issue with assignees (#7681) (#7684) - * Upgrade macaron/captcha to fix random error problem (#7407) (#7683) - * Move add to hook queue for created repo to outside xorm session. (#7682) (#7675) - * Show protection symbol if needed on default branch (#7660) (#7668) - * Hide delete/restore button on archived repos (#7660) - * Fix bug on migrating milestone from github (#7665) (#7666) - * Use flex to fix floating paginate (#7656) (#7662) - * Change length of some repository's columns (#7652) (#7655) - * Fix wrong email when use gitea as OAuth2 provider (#7640) (#7647) - * Fix syntax highlight initialization (#7617) (#7626) - * Fix bug create/edit wiki pages when code master branch protected (#7580) (#7623) - * Fix panic on push at #7611 (#7615) (#7618) - * Handle ErrUserProhibitLogin in http git (#7586, #7591) (#7590) - * Fix color of split-diff view in dark theme (#7587) (#7589) - * Fix file header overflow in file and blame views (#7562) (#7579) - * Malformed URLs in API git/commits response (#7565) (#7567) - * Fix empty commits now showing in repo overview (#7521) (#7563) - * Fix repository's pull request count error (#7518) (#7524) - * Remove duplicated webhook trigger (#7511) (#7516) - * Handles all redirects for Web UI File CRUD (#7478) (#7507) - * Fix regex for issues in commit messages (#7444) (#7466) - * cmd/serv: actually exit after fatal errors (#7458) (#7460) - * Fix an issue with some pages throwing 'not defined' js exceptions #7450 (#7453) - * Fix Dropzone.js integration (#7445) (#7448) - * Create class for inline positioned lists (#7439) (#7393) - * Diff: Fix indentation on unhighlighted code (#7435) (#7443) - * jQuery 3 (#7442) (#7425) - * Only show "New Pull Request" button if repo allows pulls (#7426) (#7432) - * Fix vendor references (#7394) (#7396) - * Only return head: null if source branch was deleted (#6705) (#7376) - * Add missing template variable on organisation settings (#7386) (#7385) - * Fix post parameter on issue list which had unset assignee (#7380) (#7383) - * Fix migration tests due to issue 7 being resolved (#7375) (#7381) - * Correctly adjust mirror url (#6593) - * Handle early git version's lack of get-url (#7065) - * Fix icon position in issue view (#7354) - * Cut timeline length with last element on issue view (#7355) - * Fix mirror repository webhooks (#7366) - * Fix api route for hooks (#7346) - * Fix bug conflict between SyncReleasesWithTags and InsertReleases (#7337) - * Fix pull view ui merge section (#7335) - * Fix 7303 - remove unnessesary buttons on archived repos (#7326) - * Fix topic bar to allow prefixes (#7325) - * Fixes #7152 - Allow create/update/delete message to be empty, use default message (#7324) - * Fixes #7238 - Annotated tag commit ID incorrect (#7321) - * Dark theme fixes (#7319) - * Gitea own dark codemirror theme (#7317) - * Fixes #7292 - API File Contents bug (#7301) - * Fix API link header (#7298) - * Fix extra newlines when copying from diff in Firefox (#7288) - * Make diff line-marker non-selectable (#7279) - * Fix Submodule dection in subdir (#7275) - * Fix error log when loading issues caused by a xorm bug (#7271) - * Add .fa icon margin like .octicon (#7258) - * Fix hljs unintenionally highlighting commit links (#7244) - * Only check and config git on web subcommand but not others (#7236) - * Fix migration panic when Head.User is not exist (#7226) - * Only warn on errors in deleting LFS orphaned files during repo deletion (#7213) - * Fix duplicated file on pull request conflicted files (#7211) - * Allow colon between fixing word and issue (#7207) - * Fix overflow issues in repo (#7190) - * API error cleanup (#7186) - * Add error for fork already existing (#7185) - * Fixes diff on merged pull requests (#7171) - * If milestone id is zero don't get it from database (#7169) - * Fix pusher name via ssh push (#7167) - * Fix database lock when use random repository fallback image (#7166) - * Various fixes for issue mail notifications (#7165) - * Allow archived repos to be (un)starred and (un)watched (#7163) - * Fix GCArgs load from ini (#7156) - * Detect noreply email address as user (#7133) - * Avoid arbitrary format strings upon calling fail() function (#7112) - * Validate External Tracker URL Format (#7089) - * Repository avatar fallback configuration (#7087) - * Fix #732: Add LFS objects to base repository on merging (#7082) - * Install page - Handle invalid administrator username better (#7060) - * Workaround for posting single comments in split diff view (#7052) - * Fix possbile mysql invalid connnection error (#7051) - * Fix charset was not saved after installation finished (#7048) - * Handle insecure and ports in go get (#7041) - * Avoid bad database state after failed migration (#7040) - * Fix wrong init dependency on markup extensions (#7038) - * Fix default for allowing new organization creation for new users (#7017) - * Fix content download and /verify LFS handler expecting wrong content-type (#7015) - * Fix missing repo description when migrating (#7000) - * Fix LFS Locks over SSH (#6999) - * Do not attempt to return blob on submodule (#6996) - * Fix U2F for Chrome >= 74 (#6980) - * Fix index produces problem when issues/pulls deleted (#6973) - * Allow collaborators to view repo owned by private org (#6965) - * Stop running hooks on pr merge (#6963) - * Run hooks on merge/edit and cope with protected branches (#6961) - * Webhook Logs show proper HTTP Method, and allow change HTTP method in form (#6953) - * Stop colorizing log files by default (#6949) - * Rotate serv.log, http.log and hook logs and stop stacktracing in these (#6935) - * Fix plain text overflow line wrap (#6915) - * Fix input size for dependency select (#6913) - * Change drone token name to let users know to use oauth2 (#6912) - * Fix syntax highlight in blame view #6895 (#6909) - * Use AppURL for Oauth user link (#6894) - * Fixes #6881 - API users search fix (#6882) - * Fix 404 when send pull request some situation (#6871) - * Enforce osusergo build tag for releases (#6862) - * Fix 500 when reviewer is deleted with integration tests (#6856) - * Fix v85.go (#6851) - * Make dropTableColumns drop columns on sqlite and constraints on all (#6849) - * Fix double-generation of scratch token (#6832) (#6833) - * When mirroring we should set the remote to mirror (#6824) - * Fix the v78 migration "Drop is_bare" on MSSQL #6707 (#6823) - * Change verbose flag in dump command to avoid colliding with global version flag (#6822) - * Fix #6813: Allow git.GetTree to take both commit and tree names (#6816) - * Remove `seen` map from `getLastCommitForPaths` (#6807) - * Show scrollbar only when needed (#6802) - * Restore IsWindows variable assignment (#6722) (#6790) - * Service worker js is a missing comma (#6788) - * Fix team edit API panic (#6780) - * Set user search base field optional in LDAP (simple auth) edit page (#6779) - * Ignore already existing public keys after ldap sync (#6766) - * Fix pulls broken when fork repository deleted (#6754) - * Fix missing return (#6751) - * Fix new team 500 (#6749) - * OAuth2 token can be used in basic auth (#6747) - * Fix org visibility bug when git cloning (#6743) - * Fix bug when sort repos on org home page login with non-admin (#6741) - * Stricter domain name pattern in email regex (#6739) - * Fix admin template error (#6737) - * Drop is_bare IDX only when it exists for MySQL and MariaDB (#6736) - * UI: Detect and restore encoding and BOM in content (#6727) - * Load issue attributes when editing an issue with API (#6723) - * Fix team members API (#6714) - * Unfortunately MemProvider Init does not actually Init properly (#6692) - * Fix partial reversion of #6657 caused by #6314 (#6685) - * Prevent creating empty sessions (#6677) - * Fixes #6659 - Swagger schemes selection default to page's protocol (#6660) - * Update highlight.js to 9.15.6 (#6658) - * Properly escape on the redirect from the web editor (#6657) - * Fix #6655 - Don't EscapePound .Link as it is already escaped (#6656) - * Use ctx.metas for SHA hash links (#6645) - * Fix wrong GPG expire date (#6643) - * upgrade version of lib/pq to v1.1.0 (#6640) - * Fix forking an empty repository (#6637) - * Fix issuer of OTP URI should be URI-encoded. (#6634) - * Return a UserList from /api/v1/admin/users (#6629) - * Add json tags for oauth2 form (#6627) - * Remove extra slash from twitter card (#6619) - * remove bash requirement in makefile (#6617) - * Fix Open Graph og:image link (#6612) - * Fix cross-compile builds (#6609) - * Change commit summary to full message in API (#6591) - * Fix bug user search API pagesize didn't obey ExplorePagingNum (#6579) - * Prevent server 500 on compare branches with no common history (#6555) - * Properly escape release attachment URL (#6512) - * Delete local branch when repo branch is deleted (#6497) - * Fix bug when user login and want to resend register confirmation email (#6482) - * Fix upload attachments (#6481) - * Avoid multi-clicks in oauth2 login (#6467) - * Hacky fix for alignment of the create-organization dialog (#6455) - * Change order that PostProcess Processors are run (#6445) - * Clean up ref name rules (#6437) - * Fix Hook & HookList in Swagger (#6432) - * Fixed unitTypeCode not being used in accessLevelUnit (#6419) - * Display correct error for invalid mirror interval (#6414) - * Don't Unescape redirect_to cookie value (#6399) - * Fix dump table name error and add some test for dump database (#6394) - * Fix migrations 82 to ignore unsynced tags between database and git data and missing is_archived on repository table (#6387) - * Make sure units of a team are returned (#6379) - * Fix bug manifest.json will not request with cookie so that session will created every request (#6372) - * Disable benchmarking during tag events on DroneIO (#6365) - * Comments list performance optimization (#5305) -* ENHANCEMENTS - * Update Drone docker generation to standard format (#7480) (#7496) (#7504) - * Add API Endpoint for Repo Edit (#7006) - * Add state param to milestone listing API (#7131) - * Make captcha and password optional for external accounts (#6606) - * Detect migrating batch size (#7353) - * Fix 7255 - wrap long texts on user profile info (#7333) - * Use commit graph files for listing pages (#7314) - * Add git command line commitgraph support global default true when git version >= 2.18 (#7313) - * Add LFS_START_SERVER option to control git-lfs support (#7281) - * Dark theme markdown fixes (#7260) - * Update go-git to v4.12.0 (#7249) - * Show lfs config on admin panel (#7220) - * Disable same user check for internal SSH (#7215) - * Add LastLogin to the User API (#7196) - * Add missing description of label on API (#7159) - * Use go method to calculate ssh key fingerprint (#7128) - * Enable Rust highlighting (#7125) - * Refactor submodule URL parsing (#7100) - * Change issue mail title. (#7064) - * Use batch insert on migrating repository to make the process faster (#7050) - * Improve github downloader on migrations (#7049) - * When git version >= 2.18, git command could run with git wire protocol version 2 param if enabled (#7047) - * Fix Erlang and Elixir highlight mappings (#7044) - * API Org Visibility (#7028) - * Improve handling of non-square avatars (#7025) - * Bugfix: Align comment label and actions to the right (#7024) - * Change UpdateRepoIndex api to include watchers (#7012) - * Move serv hook functionality & drop GitLogger (#6993) - * Add support of utf8mb4 for mysql (#6992) - * Make webhook http connections resuable (#6976) - * Move xorm logger bridge from log to models so that log module could be a standalone package (#6944) - * Refactor models.NewRepoContext to extract git related codes to modules/git (#6941) - * Remove macaron dependent on models (#6940) - * Add less linter via npx (#6936) - * Remove macaron dependent on modules/log (#6933) - * Remove macaron dependent on models/mail.go (#6931) - * Clean less files (#6921) - * Fix code overflow (#6914) - * Style orgs list in user profile (#6911) - * Improve description of branch protection (fix #6886) (#6906) - * Move sdk structs to modules/structs (#6905) - * update sdk to latest (#6903) - * Escape the commit message on issues update and title in telegram hook (#6901) - * SearchRepositoryByName improvements and unification (#6897) - * Change the color of issues/pulls list, merged is purple and closed is red (#6874) - * Refactor table width to have more info shown in file list (#6867) - * Monitor all git commands; move blame to git package and replace git as a variable (#6864) - * Fix config ui error about cache ttl (#6861) - * Improve localization of git activity stats (#6848) - * Generate access token in admin cli (#6847) - * Update github.com/urfave/cli to version 1.2.0 (#6838) - * Rename LFS_JWT_SECRET cli option to include OAUTH2 as well (#6826) - * internal/ssh: ignore env command totally (#6825) - * Allow Recaptcha service url to be configured (#6820) - * update github.com/mcuadros/go-version to v0.0.0-20190308113854-92cdf37c5b75 (#6815) - * Use modules/git for git commands (#6775) - * Add GET requests to webhook (#6771) - * Move PushUpdate dependency from models to repofiles (#6763) - * Tweak tab text and icon colors (#6760) - * Ignore non-standard refs in git push (#6758) - * Disable web preview for telegram webhook (#6719) - * Show full name if DEFAULT_SHOW_FULL_NAME setting enabled (#6710) - * Reorder file actions (#6706) - * README WordPress the code is overflowing #6679 (#6696) - * Improve issue reference on commit (#6694) - * Handle redirects for git clone commands (#6688) - * Fix one performance/correctness regression in #6478 found on Rails repository. (#6686) - * API OTP Context (#6674) - * Remove local clones & make hooks run on merge/edit/upload (#6672) - * Bump github.com/stretchr/testify from 1.2.2 to 1.3.0 (#6663) - * Bump gopkg.in/src-d/go-git.v4 from 4.8.0 to 4.10.0 (#6662) - * Fix dropdown icon padding (#6651) - * Add more title attributes on shortened names (#6647) - * Update UI for topics labels on projects (#6639) - * Trace Logging on Permission Denied & ColorFormat (#6618) - * Add .gpg url (match github behaviour) (#6610) - * Support for custom GITEA_CUSTOM env var in docker(#6608) - * Show "delete branch" button on closed pull requests (#6570) (#6601) - * Add option to disable refresh token invalidation (#6584) - * Fix new repo dropdown alignment (#6583) - * Fix mail notification when close/reopen issue (#6581) - * Pre-calculate the absolute path of git (#6575) - * Minor CSS cleanup for the navbar (#6553) - * Render SHA1 links as code blocks (#6546) - * Add username flag in create-user command (#6534) - * Unifies pagination template usage (#6531) (#6533) - * Fixes pagination width on mobile view (#5711) (#6532) - * Improve SHA1 link detection (#6526) - * Fixes #6446 - Sort team members and team's repositories (#6525) - * Use stricter boundaries for auto-link detection (#6522) - * Use regular line-height on frontpage entries (#6518) - * Fixes #6514 - New Pull Request on files and pulls pages the same (#6515) - * Make distinction between DisplayName and Username in email templates (#6495) - * Add X-Auto-Response-Suppress header to outgoing messages (#6492) - * Cleaned permission checks for API -> site admin can now do anything (#6483) - * Support search operators for commits search (#6479) - * Improve listing performance by using go-git (#6478) - * Fix repo sub_menu font color in arc-green (#6477) - * Show last commit status in pull request lists (#6465) - * Add signatures to webhooks (#6428) - * Optimize all images in public/img (#6427) - * Add golangci (#6418) - * Make "Ghost" not link to 404 page (#6410) - * Include more variables on admin/config page (#6378) - * Markdown: enable some more extensions (#6362) - * Include repo name in page title tag (#6343) - * Show locale string on timestamp (#6324) - * Handle CORS requests (#6289) - * Improve issue autolinks (#6273) - * Migration Tweaks (#6260) - * Add title attributes to all items in the repo list viewer (#6258) - * Issue indexer queue redis support (#6218) - * Add bio field for user (#6113) - * Make the version within makefile overwriteable (#6080) - * Updates to API 404 responses (#6077) - * Use Go1.11 module (#5743) - * UX + Security current user password reset (#5042) - * Refactor: append, build variable and type switch (#4940) - * Git statistics in Activity tab (#4724) - * Drop the bits argument when generating an ed25519 key (#6504) -* TESTING - * Exclude pull_request from fetch-tags step, fixes #7108 (#7120) - * Refactor and improve git test (#7086) - * Fix TestSearchRepo by waiting till indexing is done (#7004) - * Add mssql migration tests (needs #6823) (#6852) - * Add tests for Org API (#6731) - * Context.ServerError and NotFound should log from their caller (#6550) -* TRANSLATION - * Add french specific rule for translating plural texts (#6846) -* BUILD - * Update mssql driver to last working version 20180314172330-6a30f4e59a44 (#7306) - * Alpine 3.10 (#7256) - * Use vfsgen instead of go-bindata (#7080) - * remove and disable package-lock (#6969) - * add make targets for js and css, add js linter (#6952) - * Added tags pull step to drone config to show correct version hashes i… (#6836) - * Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) - * chore: update drone format to 1.0 (#6602) - * Fix race in integration testlogger (#6556) - * Quieter Integration Tests (#6513) - * Drop the docker Makefile from the image (#6507) - * Add make version on gitea version (#6485) - * Fix #6468 - Uses space match and adds newline for all sed flavors (#6473) - * Move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364) - * Update npm dependencies and various tweaks (#7344) - * Fix updated drone file (#7336) - * Add 'npm' and 'npm-update' make targets and lockfile (#7246) -* DOCS - * Add work path CLI option (#6922) - * Fix logging documentation (#6904) - * Some logging documentation (#6498) - * Fix link to Hacking on Gitea on From-Source doc page (#6471) - * Fix typos in docs command-line examples (#6466) - * Added docker example for backup (#5846) - -## [1.8.3](https://github.com/go-gitea/gitea/releases/tag/v1.8.3) - 2019-06-17 - -* BUGFIXES - * Always set userID on LFS authentication (#7224) (Part of #6993) - * Fix LFS Locks over SSH (#6999) (#7223) - * Fix duplicated file on pull request conflicted files (#7211) (#7214) - * Detect noreply email address as user (#7133) (#7195) - * Don't get milestone from DB if ID is zero (#7169) (#7174) - * Allow archived repos to be (un)starred and (un)watched (#7163) (#7168) - * Fix GCArgs load from ini (#7156) (#7157) - -## [1.8.2](https://github.com/go-gitea/gitea/releases/tag/v1.8.2) - 2019-05-29 - -* BUGFIXES - * Fix possbile mysql invalid connnection error (#7051) (#7071) - * Handle invalid administrator username on install page (#7060) (#7063) - * Disable arm7 builds (#7037) (#7042) - * Fix default for allowing new organization creation for new users (#7017) (#7034) - * SearchRepositoryByName improvements and unification (#6897) (#7002) - * Fix u2f registrationlist ToRegistrations() method (#6980) (#6982) - * Allow collaborators to view repo owned by private org (#6965) (#6968) - * Use AppURL for Oauth user link (#6894) (#6925) - * Escape the commit message on issues update (#6901) (#6902) - * Fix regression for API users search (#6882) (#6885) - * Handle early git version's lack of get-url (#7065) (#7076) - * Fix wrong init dependency on markup extensions (#7038) (#7074) - -## [1.8.1](https://github.com/go-gitea/gitea/releases/tag/v1.8.1) - 2019-05-08 - -* BUGFIXES - * Fix 404 when sending pull requests in some situations (#6871) (#6873) - * Enforce osusergo build tag for releases (#6862) (#6869) - * Don't post process commit summary in templates (#6842) (#6868) - * Fix 500 when reviewer is deleted (#6856) (#6860) - * Fix v78 migration for MSSQL (#6823) (#6854) - * Added tags pull step to drone config to show correct version hashes (#6836) (#6839) - * Fix double-generation of scratch token (#6833) (#6835) - * When mirroring we should set the remote to mirror (#6824) (#6834) - * Show scrollbar only when needed (#6802) (#6803) - * Service worker js is missing a comma (#6788) (#6795) - * Set user search base field optional in LDAP (simple auth) edit page (#6779) (#6789) - * Fix team edit API panic (#6780) (#6785) - * Minor CSS cleanup for the navbar (#6553) (#6781) - * Stricter domain name pattern in email regex (#6739) (#6768) - * Detect and restore encoding and BOM in content (#6727) (#6765) - * Fix org visibility bug when git cloning (#6743) (#6762) - * OAuth2 token can be used in basic auth (#6747) (#6761) - * Fix missing return (#6751) (#6756) - * Fix sorting repos on org home page with non-admin login (#6741) (#6746) - * Drop is_bare IDX only when it exists for MySQL and MariaDB (#6736) (#6744) - * Fix team members API (#6714) (#6729) - * Load issue attributes when editing an issue with API (#6723) (#6725) - * Fix config ui error about cache ttl (#6861) (#6865) - -## [1.8.0](https://github.com/go-gitea/gitea/releases/tag/v1.8.0) - 2019-04-20 - -* SECURITY - * Prevent remote code execution vulnerability with mirror repo URL settings (#6593) (#6594) - * Resolve 2FA bypass on API (#6676) (#6674) - * Prevent the creation of empty sessions for non-logged in users (#6690) (#6677) -* BREAKING - * Add "ghost" and "notifications" to list of reserved user names. (#6208) - * Change sqlite DB path default to data directory (#6198) - * Adds MustChangePassword to user create/edit API (#6193) - * Disable redirect for i18n (#5910) - * Releases API paging (#5831) - * Allow Macaron to be set to log through to gitea.log (#5667) - * Don't close issues via commits on non-default branch (#5622) -* FEATURES - * Add regenerate secret feature for oauth2 (#6291) - * Expose issue stopwatch toggling via API (#5970) - * Add other session providers (#5963) - * Pull request conflict files detection (#5951) - * Integrate OAuth2 Provider (#5378) - * Implement "conversation lock" for issue comments (#5073) - * Feature: Archive repos (#5009) - * Discord Oauth2 support (#4476) - * Allow to set organization visibility (public, internal, private) (#1763) - * Added URL mapping for Release attachments like on github.com (#1707) -* ENHANCEMENTS - * Add support for client basic auth for exchanging access tokens (#6293) - * Add ability to sort issues by due date (#6206) (#6244) - * Style tweaks to issue selection (#6196) - * Increase Username and Orgname MaxSize 35 -> 40 (#6178) - * Coverage profile with multiple packages (#6167) - * Split setting.go to multiple files (#6154) - * Allow labels to contain emoji (#6063) - * Disable git fsck for mirrored repos by default (#6018) - * Add default time out for git operations (#6015) - * Split setting.go as multiple files (#6014) - * Make dashboard navbar and footer full-width (#6013) - * Add lang specific font stacks for CJK (#6007) - * Fix header menu misalignment (#6002) - * Enhance closed PR and Issue status in the list (#6000) - * Make navbar full width (#5998) - * Add option to close issues via commit on a non master branch (#5992) - * Support n as a line highlight prefix (#5987) - * Search for org repos (#3031) (#5986) - * Minor UI tweaks (#5980) - * Use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines (#5976) - * Dashboard tweaks (#5974) - * Fixes for repo topic editor (#5971) - * Display the branch name in the commit view (#5950) - * handle milestone events for issues and PR (#5947) - * Add label names as filter in issue search api (#5946) - * Repo header tweaks (#5945) - * Better support for long repo names (#5932) - * Fix wrapping long code lines (#5927) - * Change GPG Validation colors and remove inline CSS (#5404) (#5896) - * Fix "pulls.blocked_by_approvals" text (#5879) - * Rename reject to 'request changes' (#5858) - * Move input fields to add members to a team and repos to a team (#5853) - * Config option to disable automatic repo watching (#5852) - * New Issue ?body= query (#5851) - * Add API to list tags (#5850) - * Pagination for git tree API (#5838) - * Add InternalTokenURI to load InternalToken from an external file (#5812) - * Allow markdown files to read from the LFS (#5787) - * Add the ability to use multiple labels as filters (#5786) - * Adjust log settings when a user is not found. (#5771) - * Log IP of failed ssh connection (#5766) - * Moved defaults in defaults.go to setting.go (#5764) - * Make DB connect more robust (#5738) - * Add Default Pull Request Title (#5735) - * Refactor repo.isBare to repo.isEmpty #5629 (#5714) - * Add flag to skip repository dumping (#5695) - * Prioritize "readme.md" (#5691) - * Improve "Fork button" for guests by showing a pop up asking them to log in before forking (#5690) - * Allow for user specific themes (#5668) - * Display branch name in delete branch confirmation modal. (#5654) - * New API routes added (#5594) - * Refactor notification for indexer (#5111) - * Refactor mail notification (#5110) - * Show email if the authenticated user owns the profile page being requested for (#4981) - * Optimize pulls merging (#4921) - * Sort Repositories widget by most recently updated (#3963) (#4599) - * Allow markdown table to scroll (#4401) - * Automatically clear stopwatch on merging a PR (#4327) - * Add the Owner Name to differentiate when merging (#3807) - * Add title attributes to all items in the repo list viewer (#6258) (#6650) -* BUGFIXES - * Fix dropdown icon padding (#6651) (#6654) - * Fix wrong GPG expire date (#6643) (#6644) - * Fix forking an empty repository (#6637) (#6653) - * Remove call to EscapePound .Link as it is already escaped (#6656) (#6666) - * Properly escape on the redirect from the web editor (#6657) (#6667) - * Allow resend of confirmation email when logged in (#6482) (#6486) - * Fix mail notification when close/reopen issue (#6581) (#6588) - * Change API commit summary to full message (#6591) (#6592) - * Add option to disable refresh token invalidation (#6584) (#6587) - * Fix bug user search API pagesize didn't obey ExplorePagingNum (#6579) (#6586) - * Fix new repo alignment (#6583) (#6585) - * Prevent server 500 on compare branches with no common history (#6555) (#6558) - * Properly escape release attachment URL (#6512) (#6523) - * Hacky fix for alignment of the create-organization dialog (#6455) (#6462) - * Disable benchmarking during tag events on DroneIO (#6365) (#6366) - * Make sure units of a team are returned (#6379) (#6381) - * Don't Unescape redirect_to cookie value (#6399) (#6401) - * Fix dump table name error and add some test for dump database (#6394) (#6402) - * Fix migration v82 to ignore unsynced tags between database and git data; Add missing is_archived column on repository table (#6387) (#6403) - * Display correct error for invalid mirror interval (#6414) (#6429) - * Clean up ref name rules (#6437) (#6439) - * Fix Hook & HookList in Swagger (#6432) (#6440) - * Change order that PostProcess Processors are run (#6445) (#6447) - * Clean up various use of escape/unescape functions for URL generation (#6334) - * Return 409 when creating repo if it already exists. (#6330) - * Add same changes from issues page to milestone->issues page (#6328) - * Fix ParsePatch function to work with quoted diff --git strings (#6323) - * Fix reported issue in repo description (#6306) - * Use url.PathEscape to escape the branchname (#6304) - * Add robots.txt as reserved username (#6272) - * Replace linkRegex with xurls library (#6261) - * Remove visitLinksForShortLinks features (#6257) - * Add unit types to repo action URL to correctly show 404 when archived (#6247) - * Check organization visibility before everything else (#6234) (#6235) - * Prevent double-close of issues (#6233) - * Override xorm type mapping for U2F counter (#6232) - * Add isAdmin to user API response (#6231) - * Update git vendor to fix wrong release commit id and add migrations (#6224) - * Fix fork button (#6223) - * Fix renames over redirects (#6216) - * Fix display dashboard even if require to change password (#6214) - * Create a repo redirect when transferring ownership (#6210) (#6211) - * Fix issue update race condition (#6194) - * Fix bug when migrate repository 500 when repo is existed (#6188) - * Fix scrollbar always present on page body (#6177) - * Fix bug when set indexer as db and add tests (#6173) - * Modify linkRegex to require http|https (#6171) - * Fix bug user could change private repository to public when force private enabled. (#6156) - * Fix admin list user/org API (#6143) - * Make repo creation for API similar to UI (#6142) - * Make document body a flexbox (#6139) - * Refactor issue indexer, add some testing and fix a bug (#6131) - * Load Issue attributes for API call (#6122) - * Fix bug when update owner team then visit team's repo return 404 (#6119) - * Fix heatmap and repository menu display in Internet Explorer 9+ (#6117) - * Show private organization for admin, fix #6111 (#6112) - * Fix prohibit login check on authorization (#6106) - * Move to ldap.v3 to fix #5928 (#6105) - * Remove use MakeAssigneeList in webhooks to fix deadlock (#6102) - * Allow display of LFS stored Readme.md on directory page (#6073) (#6099) - * Make sure labels are actually returned (#6053) - * Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041) - * After deleting a repo on admin panel, UI should remember the last sort type (#6033) - * Default create repository on organisation on its dashboard (#6026) - * Swagger: Remove spaces in MergePullRequestOption enum (#6016) - * Fix metrics auth token detection (#6006) - * Fix repo header issues (#5995) - * Fix bug when deleting a linked account will removed all (#5989) - * Make organization dropdown scrollable when using mouse wheel (#5988) - * Fix empty ssh key importing in ldap (#5984) - * Admin config page mailertype setting option update (#5973) - * Fix redirect loop during forced password change (#5965) - * Show user who created the repository instead of the organisation in action feed (#5948) - * Remove all CommitStatus when a repo is deleted (#5940) - * Fix ssh deploy and user key constraints (#1357) (#5939) - * Fix log output (#5938) - * Set PusherName and PusherID to owner on deploy key to fix pushing with deploy keys (#5935) - * Fix compare button (#5929) - * Fix bug when read public repo lfs file (#5912) - * Only allow local login if password is non-empty (#5906) - * Recover panic in orgmode.Render if bad orgfile (#4982) (#5903) - * Provide better panic handling (#5902) - * Respect value of REQUIRE_SIGNIN_VIEW (#5901) - * Show a 404 not a 500 if a repo does not exist (#5900) - * Ensure repo is loaded in mailer (Completely fix #5891) (#5895) - * Ensure issue.Poster is loaded in mailIssueCommentToParticipants (#5891) - * Correct footer height if screen-width is to small (fixes #5878) (#5889) - * In gitea serv switch off console logger to fix #5866 (#5887) - * Don't allow pull requests to be created on an archived repository (#5883) - * Support reviews on a deleted file path (#5880) - * Fix compare button on upstream repo leading to 404 (#5877) - * Fix null pointer on not logged in attempt to Sudo (#5872) - * Fix new release creation API to allow empty target (#5870) - * Fix an error while adding a dependency via UI. (#5862) - * Fix failing migration v67 (#5849) - * Fix delete correct temp directory (#5839) - * Make sure .git/info is created before generating .git/info/sparse-che… (#5825) - * Fix topics saving internal error and disable for archived repos (#5821) - * Fix TLS errors when using acme/autocert for local connections (#5820) - * When creating new repository fsck option should be enabled (#5817) - * Request for public keys only if LDAP attribute is set (#5816) - * Fix serving of raw wiki files other than .md (#5814) - * Fix migration 78 error mssql (#5791) - * Disallow empty titles (#5785) - * Fix the v78 migration script (#5776) - * Ensure valid git author names passed in signatures (#5774) - * Fix wrong assumption where a user is always said to have unassigned (her)himself (#5769) - * Upgrade go-sql-driver/mysql to fix invalid connection error (#5748) - * Fixing PostgreSQL dump creation (#5747) - * Add proper CORS preflight origin validation (#5740) - * Disable auto-migrate in docker container (#5730) - * In basic auth check for tokens before call UserSignIn (#5725) - * Pooled and buffered gzip implementation (#5722) - * Ensure that sessions are passed into queries that could use the database to prevent deadlocks (#5718) - * Keep file permissions during database migration (#5707) - * Use correct value for "MSpan Structures Obtained" #4742 (#5706) - * Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) - * Update xorm to fix issue #5659 and #5651 (#5680) - * Fix public will not be reused as public key after deleting as deploy key (#5671) - * When redirecting, clean the path (#5669) - * Don't list an issue on its own dependency list UI. (#5658) - * Fix commit page showing status for current default branch (#5649) (#5650) - * Only count users own actions for heatmap contributions (#5647) - * Fix sqlite deadlock when assigning to a PR (#5640) - * Refactor issue indexer (#5363) -* TESTING - * Run benchmark at tag to track performances (#6035) - * Add test environment for MySQL8 (#5234) -* BUILD - * Use go 1.12 for tests and deprecate go 1.9 (#6186) - * Makefile changes for Windows and easier development (#6103) - * Update bleve dependency to latest master revision (#6100) - * Switch to more recent build of xgo (#6070) - * Add autoprefixer to css build (#6029) - * Update the version of less (#6010) - * Make log mailer for testing (#5893) -* DOCS - * Add more tests and docs for issue indexer, add db indexer type for searching from database (#6144) - * update default value of `--must-change-password` cli flag (#6032) - * Update and expand information about building Gitea (#6019) - * Update U2F Section of app.ini.sample (#5994) - * Update swagger for release API pagination (#5841) - * Added docs for the tree api (#5834) -* MISC - * Add single commit API support (#5843) - * Add missing GET teams endpoints (#5382) - * Migrate database if app.ini found (#5290) - -## [1.7.6](https://github.com/go-gitea/gitea/releases/tag/v1.7.6) - 2019-04-12 - -* SECURITY - * Prevent remote code execution vulnerability with mirror repo URL settings (#6593) (#6595) -* BUGFIXES - * Allow resend of confirmation email when logged in (#6482) (#6487) - -## [1.7.5](https://github.com/go-gitea/gitea/releases/tag/v1.7.5) - 2019-03-27 - -* BUGFIXES - * Fix unitTypeCode not being used in accessLevelUnit (#6419) (#6423) - * Fix bug where manifest.json was being requested without cookies and continuously creating new sessions (#6372) (#6383) - * Fix ParsePatch function to work with quoted diff --git strings (#6323) (#6332) - -## [1.7.4](https://github.com/go-gitea/gitea/releases/tag/v1.7.4) - 2019-03-12 - -* SECURITY - * Fix potential XSS vulnerability in repository description. (#6306) (#6308) -* BUGFIXES - * Fix wrong release commit id (#6224) (#6300) - * Fix panic on empty signed commits (#6292) (#6300) - * Fix organization dropdown not being scrollable when using mouse wheel (#5988) (#6246) - * Fix displaying dashboard even if required to change password (#6214) (#6215) - -## [1.7.3](https://github.com/go-gitea/gitea/releases/tag/v1.7.3) - 2019-02-27 - -* BUGFIXES - * Fix server 500 when trying to migrate to an already existing repository (#6188) (#6197) - * Load Issue attributes for API /repos/{owner}/{repo}/issues/{index} (#6122) (#6185) - * Fix bug whereby user could change private repository to public when force private enabled. (#6156) (#6165) - * Fix bug when update owner team then visit team's repo return 404 (#6119) (#6166) - * Fix heatmap and repository menu display in Internet Explorer 9+ (#6117) (#6137) - * Fix prohibit login check on authorization (#6106) (#6115) - * Fix LDAP protocol error regression by moving to ldap.v3 (#6105) (#6107) - * Fix deadlock in webhook PullRequest (#6102) (#6104) - * Fix redirect loop when password change is required and Gitea is installed as a suburl (#5965) (#6101) - * Fix compare button regression (#5929) (#6098) - * Recover panic in orgmode.Render if bad orgfile (#4982) (#5903) (#6097) - -## [1.7.2](https://github.com/go-gitea/gitea/releases/tag/v1.7.2) - 2019-02-14 - -* BUGFIXES - * Remove all CommitStatus when a repo is deleted (#5940) (#5941) - * Fix notifications on pushing with deploy keys by setting hook environment variables (#5935) (#5944) - * Silence console logger in gitea serv (#5887) (#5943) - * Handle milestone webhook events for issues and PR (#5947) (#5955) - * Show user who created the repository instead of the organization in action feed (#5948) (#5956) - * Fix ssh deploy and user key constraints (#1357) (#5939) (#5966) - * Fix bug when deleting a linked account will removed all (#5989) (#5990) - * Fix empty ssh key importing in ldap (#5984) (#6009) - * Fix metrics auth token detection (#6006) (#6017) - * Create repository on organisation by default on its dashboard (#6026) (#6048) - * Make sure labels are actually returned in API (#6053) (#6059) - * Switch to more recent build of xgo (#6070) (#6072) - * In basic auth check for tokens before call UserSignIn (#5725) (#6083) - -## [1.7.1](https://github.com/go-gitea/gitea/releases/tag/v1.7.1) - 2019-01-31 - -* SECURITY - * Disable redirect for i18n (#5910) (#5916) - * Only allow local login if password is non-empty (#5906) (#5908) - * Fix go-get URL generation (#5905) (#5907) -* BUGFIXES - * Fix TLS errors when using acme/autocert for local connections (#5820) (#5826) - * Request for public keys only if LDAP attribute is set (#5816) (#5819) - * Fix delete correct temp directory (#5840) (#5839) - * Fix an error while adding a dependency via UI (#5862) (#5876) - * Fix null pointer in attempt to Sudo if not logged in (#5872) (#5884) - * When creating new repository fsck option should be enabled (#5817) (#5885) - * Prevent nil dereference in mailIssueCommentToParticipants (#5891) (#5895) (#5894) - * Fix bug when read public repo lfs file (#5913) (#5912) - * Respect value of REQUIRE_SIGNIN_VIEW (#5901) (#5915) - * Fix compare button on upstream repo leading to 404 (#5877) (#5914) -* DOCS - * Added docs for the tree api (#5835) -* MISC - * Include Go toolchain to --version (#5832) (#5830) - -## [1.7.0](https://github.com/go-gitea/gitea/releases/tag/v1.7.0) - 2019-01-22 - -* SECURITY - * Do not display the raw OpenID error in the UI (#5705) (#5712) - * When redirecting clean the path to avoid redirecting to external site (#5669) (#5679) - * Prevent DeleteFilePost doing arbitrary deletion (#5631) -* BREAKING - * Restrict permission check on repositories and fix some problems (#5314) - * Show only opened milestones on issues page milestone filter (#5051) -* FEATURES - * Implement git refs API for listing references (branches, tags and other) (#5354) - * Approvals at Branch Protection (#5350) - * Add raw blob endpoint to get objects by SHA ID (#5334) - * Add api for user to create org (#5268) - * Create AuthorizedKeysCommand (#5236) - * User action heatmap (#5131) - * Refactor heatmap to vue component (#5401) - * Webhook for Pull Request approval/rejection (#5027) - * Add command for migrating database (#4954) - * Search keyword by splitting provided values by , (#4939) - * Create Progressive Web App (#4730) - * Give user a link to create PR after push (#4716) - * Add rebase with merge commit merge style (#3844) (#4052) -* BUGFIXES - * Disallow empty titles (#5785) (#5794) - * Fix sqlite deadlock when assigning to a PR (#5640) (#5642) - * Don't close issues via commits on non-default branch. (#5622) (#5643) - * Fix commit page showing status for current default branch (#5650) (#5653) - * Only count users own actions for heatmap contributions (#5647) (#5655) - * Update xorm to fix issue postgresql dumping issues (#5680) (#5692) - * Use correct value for "MSpan Structures Obtained" (#5706) (#5716) - * Fix bug on modifying sshd username (#5624) - * Delete tags in mirror which are removed for original repo. (#5609) - * Fix wrong text getting saved on editing second comment on an issue. (#5608) - * Fix nil pointer when adding a due date (#5587) - * Fix type mismatch of format string (#5574) - * Fix bug on upload file name (#5571) - * Issue is not overdue when it is on the same date #5566 (#5568) - * Fix indexer reindex bug when gitea restart (#5563) - * Fix table name typo on SQL (#5562) - * Synchronize SSH keys on login with LDAP + Fix SQLite deadlock on ldap ssh key deletion (#5557) - * Fix makefile generate buildstep (#5556) - * Fix nil pointer base branch bug (#5555) - * Fix permission check on api create org (#5523) - * Fix detect force push failure on deletion of protected branches (#5522) - * Fix approvals limitation (#5521) - * Fix bug when a read perm user to edit his issue (#5516) - * Fix adding reaction fail for read permission user (#5515) - * Fixing MSSQL timestamp type (#5511) - * Fix forgot deletion of notification when delete repository (#5506) - * Fix empty wiki (#5504) - * Fix clone wiki failed via ssh (#5503) - * Fix code review on mssql (#5502) - * Fix lfs version check warning log when using ssh protocol (#5501) - * Fix topic name length on database (#5493) - * Ensure that the `closed_at` is set for closed issues (#5449) - * Admin should be able to delete repos via the API even if he is not a member of the organization (#5443) - * Word-Break the WebHook url to prevent a ui-break (#5432) - * Fix forgot removed records when deleting user (#5429) - * Fix repository deletion when there is large number of issues in it (#5426) - * Fix heatmap colors for Chrome/Safari (#5421) - * Fix password variable shadowing (#5405) - * Fix dependent issue searching when gitea is run in subpath (#5392) - * Don't force a password change for the admin user when creating an account via cli (#5391) - * API: '/orgs/:org/repos': return private repos with read access (#5383) - * Don't send assign webhooks when creating issue (#5365) - * Removing Labels via EditPullRequest API (#5348) - * Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341) - * Fix bug when users have serval teams with different units on different repositories (#5307) - * Fix U2F if gitea is configured in subpath (#5302) - * Fix file edit change preview functionality (#5300) - * Update gitignore list (#5258) - * Fixed heatmap not working in mssql (#5248) - * Fixed wrong api request url for instances running in subfolders (#5247) - * Fix compatibility heatmap with mysql 8 (#5232) - * Fix data race on migrate repository (#5224) - * Fix sqlite and mssql lock (#5214) - * Fix sqlite lock (#5210) - * Fix: Accept web-command cli flags if web-command is commited (#5200) - * Fix: Add secret to all webhook's payload where it has been missing (#5199) - * Fix race on updatesize (#5190) - * Fix create team, update team missing units (#5188) - * Fix sqlite lock (#5184 & #5176) - * Fix showing pull request link when delete a branch (#5166) - * Fix JSON result of empty array in heatmap data array (#5154) - * Update build tags for sqlite_unlock notify (#5144) - * This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql (#5136) - * Fix deadlock when sqlite (#5118) - * Add comment replies (#5104) - * Fix home page template regression (#5102) - * Fix regex to support optional end line of old section in diff hunk (#5096) - * LDAP via simple auth separate bind user and search base (#5055) - * Fix markdown image with link (#4675) - * Fix to 3819 - Filtering issues by tags on main screen issues (#3824) -* ENHANCEMENTS - * Delete organization endpoint added (#5601) - * Update Licenses (#5558) - * Support reverse proxy providing email (#5554) - * Add git protocol v2 support via SSH on Docker image (#5520) - * Add tests for api user orgs (#5494) - * Allow link verification for services like Mastodon (#5481) - * Improve team members and repositories settings UI (#5457) - * Remove the required class from optional ssh port in installation page (#5428) - * Explicitly disable Git credential helper (#5367) - * Setting Labels via EditPullRequest API (#5347) - * Implement pasting image from clipboard for browsers that supports that (#5317) - * Milestone issues and pull requests (#5293) - * Support envs on external render commands (#5278) - * Add option to disable automatic mirror syncing. (#5242) - * Remove unused db init on commands serv, update, hooks (#5225) - * Serve audio files using HTML5 audio tag (#5221) - * Pass link prefixes to external markup parsers (#5201) - * Add AutoHead functionality. (#5186) - * Fix emojis not showing in commit messages (#5168) - * Block registration based on email domain (#5157) - * Update vendor/go-sqlite3 (#5133 & #5162) - * Update x/net lib (#5169) - * Show review summary in pull requests (#5132) - * Use type switch (#5122) - * Remove duplicated if bodies (#5121) - * Remove check for negative length (#5120) - * Make switch more clear (#5119) - * Use named const instead of a raw string (#5115) - * Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094) - * Refactor: err != nil check, just return error instead (#5093) - * Add notification interface and refactor UI notifications (#5085) - * Use APP_NAME on home page (#5048) - * Explicitly decide whether to use TLS in mailer's configuration (#5024) - * Generate random password (#5023) - * UX of link account (Step 1) (#5006) - * Make sure argsSet verifies string isn't empty too (#4980) - * Improve performance of dashboard (#4977) - * Keys API changes (#4960) - * Add must-change-password flag to cli for creating a user (#4955) - * Use native go method to get current user rather than environment variable (#4930) - * Make gitea serv use api/internal (#4886) - * Add support for search by uid (#4876) - * Allow to add organization members as collaborators on organization owned repositories (#4748) -* TESTING - * Kill testing processes if the test takes too long (#5174) - * Update outdated Go toolchain version for .drone.yml (#5146) - * Increase the retry limit to 20 times and the interval to 200ms (#5134) - * Retry test-fixtures loading in case of transaction rollback (#5125) - * Added test environment for mssql (#4282) -* BUILD - * Replace lint to revive (#5422) - * Update golang version in Dockerfile (#5246) -* DOCS - * Typo in routers/api/v1/org/org.go fixed. (#5598) - * Update the docs for sqlite_unlock_notify (#5145) - * CN translation of docs part (#5049) - * Kubernetes deployment file (#5046) -* MISC - * Upgrade alpine to 3.8 (#5423) - * Git-Trees API (#5403) - * Only chown directories during docker setup if necessary. Fix #4425 (#5064) - -## [1.6.4](https://github.com/go-gitea/gitea/releases/tag/v1.6.4) - 2019-01-15 - -* BUGFIX - * Fix SSH key now can be reused as public key after deleting as deploy key (#5671) (#5685) - * When redirecting clean the path to avoid redirecting to external site (#5669) (#5703) - * Fix to use correct value for "MSpan Structures Obtained" (#5706) (#5715) - -## [1.6.3](https://github.com/go-gitea/gitea/releases/tag/v1.6.3) - 2019-01-04 - -* SECURITY - * Prevent DeleteFilePost doing arbitrary deletion (#5631) -* BUGFIX - * Fix wrong text getting saved on editing second comment on an issue (#5608) - -## [1.6.2](https://github.com/go-gitea/gitea/releases/tag/v1.6.2) - 2018-12-21 - -* SECURITY - * Sanitize uploaded file names (#5571) (#5573) - * HTMLEncode user added text (#5570) (#5575) -* BUGFIXES - * Fix indexer reindex bug when gitea restart (#5563) (#5564) - * Remove a double slash in the HTTPS redirect with Let's Encrypt (#5537) (#5539) - * Fix bug when a read perm user to edit his issue (#5516) (#5534) - * Detect force push failure on deletion of protected branches (#5522) (#5531) - * Let's Encrypt handler listens on correct port for certificate validation (#5525) (#5527) - * Fix forgot deletion of notification when delete repository (#5506) (#5514) - * Fix undeleted content when deleting user (#5429) (#5509) - * Fix empty wiki (#5504) (#5508) - -## [1.6.1](https://github.com/go-gitea/gitea/releases/tag/v1.6.1) - 2018-12-08 - -* BUGFIXES - * Fix dependent issue searching when gitea is run in subpath (#5392) (#5400) - * API: '/orgs/:org/repos': return private repos with read access (#5393) - * Fix repository deletion when there is large number of issues in it (#5426) (#5434) - * Word-break the WebHook url to prevent a ui-break (#5445) - * Admin should be able to delete repos via the API even if they are not a member of the organization (#5443) (#5447) - * Ensure that the `closed_at` is set for closed (#5450) - * Fix topic name length on database (#5493) (#5495) - -## [1.6.0](https://github.com/go-gitea/gitea/releases/tag/v1.6.0) - 2018-11-22 - -* BREAKING - * Respect email privacy option in user search via API (#4512) - * Simply remove tidb and deps (#3993) - * Swagger.v1.json template (#3572) -* SECURITY - * Add CSRF checking to reqToken and add reqToken to admin API routes (#5272) (#5250) - * Improve URL validation for external wiki and external issues (#4710) - * Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) - * Don't disclose emails of all users when sending out emails (#4664) - * Check that repositories can only be migrated to own user or organizations (#4366) -* FEATURES - * Add comment replies (#5147) (#5104) - * Pull request review/approval and comment on code (#3748) - * Added dependencies for issues (#2196) (#2531) - * Add the ability to have built in themes in Gitea and provide dark theme arc-green (#4198) - * Add sudo functionality to the API (#4809) - * Add oauth providers via cli (#4591) - * Disable merging a WIP Pull request (#4529) - * Force user to change password (#4489) - * Add letsencrypt to Gitea (#4189) - * Add push webhook support for mirrored repositories (#4127) - * Add csv file render support defaultly (#4105) - * Add Recaptcha functionality to Gitea (#4044) -* ENHANCEMENTS - * Fix milestones sorted wrongly (#4987) - * Allow api to create tags for releases if they don't exist (#4890) - * Fix #4877 to follow the OpenID Connect Audiences spec (#4878) - * Enforce token on api routes [fixed critical security issue #4357] (#4840) - * Update legacy branch and tag URLs in dashboard to new format (#4812) - * Slack webhook channel name cannot be empty or just contain an hashtag (#4786) - * Add whitespace handling to PR-comparsion (#4683) - * Make reverse proxy auth optional (#4643) - * MySQL TLS (#4642) - * Make sure to set PR split view when creating/previewing a pull request (#4617) - * Log user in after a successful sign up (#4615) - * Fix typo IsPullReuqestBroken -> IsPullRequestBroken (#4578) - * Allow admin toggle forcing a password change for newly created users (#4563) - * Update jQuery to v1.12.4 (#4551) - * Env var GITEA_PUSHER_EMAIL (#4516) - * Feat(repo): support search repository by topic name (#4505) - * Small improvements to dependency UI (#4503) - * Make max commits in graph configurable (#4498) - * Add valid for lfs oid (#4461) - * Add shortcut to save wiki page (#4452) - * Allow administrator to create repository for any organization (#4368) - * Fix repository last updated time update when delete a user who watched the repo (#4363) - * Switch plaintext scratch tokens to use hash instead (#4331) - * Increase default TOTP secret size to 320 bits (#4287) - * Keep preseeded database password (#4284) - * Implemented hover text showing user FullName (#4261) - * Add ability to delete a token (#4235) - * Fix typos in i18n variable names. (#4080) - * Api: repos/search: add parameters to control the sort order (#3964) - * Add missing path in the Docker app.ini template (#2181) - * Add file name and branch to page title (#4902) - * Offline use of google fonts (#4872) - * Add missing History link to directory listings v2 (#4829) - * Locale for Edit and Remove due date issue (#4802) - * Disable 'May Import Local Repository' when is disabled by setting (Is… (#4780) - * API /admin/users/{username} missing parameter (#4775) - * Display error when adding a user to a team twice (#4746) - * Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 (#4722) - * Focus title input when clicking helper link (#4696) - * Add vendor to user reserved words and format words list according alphabet (#4685) - * Add gitea/issues link to 500 page (#4654) - * Hide home button when landing page is not set to home (#4651) - * Remove link to GitHub issues in 404 template (#4639) - * Cmd/serve: pprof cpu and memory profile dumps to disk (#4560) - * Add flash message after an account has been successfully activated (#4510) - * Prevent html entity escaping on delete branch (#4471) - * Locale for button Edit on protected branch (#4442) - * Update notification icon (#4343) - * Added front-end topics validation (#4316) - * Don't display buttons if there are no system notifications (#4280) - * Issue due date api (#3890) -* BUGFIXES - * dont' send assign webhooks when creating issue (#5365) - * Fix create team, update team missing units (#5188) - * Fix file edit change preview functionality (#5300) - * *ix bug when users have serval teams with different units on different repositories (#5307) - * Fix U2F if gitea is configured in subpath (#5302) - * Fix markdown image with link (#4675) - * Remove maxlines option for file logger (#5282) - * Fix wrong api request url for instances running in subfolders (#5261) (#5247) - * Accept web-command cli flags if web-command is commited (#5245) (#5200) - * Reduce join star, repo_topic, topic tables on repo search, to resolve extra columns problem on MSSQL (#5136) (#5229) - * Fix data race on migrate repository (#5224) (#5230) - * Add secret to all webhook's payload where it has been missing (#5208) (#5199) - * Fix sqlite and MSSQL lock (#5210) (#5223) (#5214) (#5218) (#5176) (#5179) - * Fix race on updatesize (#5190) (#5215) - * Fix filtering issues by tags on main screen issues (#5219) (#3824) - * Fix SQL quoting (#5137) (#5117) - * Fix regex to support optional end line of old section in diff hunk (#5097) (#5096) - * Fix release creation via API (#5076) - * Remove links from topics in edit mode (#5026) - * Fix missing AppSubUrl in few more templates (fixup) (#5021) - * Fix missing AppSubUrl in some templates (#5020) - * Hide outdated comments in file view (#5017) - * Upgrade gopkg.in/testfixtures.v2 (#4999) - * Disable debug routes unless PPROF is enabled in configuration (#4995) - * Fix user menu item styling (#4985) - * Fix layout of the topics editing form (#4971) - * Fix null pointer dereference in ParseCommitWithSignature (#4962) - * Fix url in discord webhook (#4953) - * Detect charset and convert non UTF-8 files for display (#4950) - * Make sure to catch the right error so it is displayed on the UI (#4945) - * Fix(topics): don't redirect to explore page. (#4938) - * Fix bug forget to remove Stopwatch when remove repository (#4928) - * Fix bug when repo remained bare if multiple branches pushed in single push (#4923) - * Fix: Crippled diff (#4726) (#4900) - * Fix trimming of markup section names (#4863) - * Issues api allow pulls and fix #4832 (#4852) - * Do not autocreate directory for new users/orgs (#4828) (#4849) - * Fix redirect with non-ascii branch names (#4764) (#4810) - * Fix missing release title in webhook (#4783) (#4796) - * User shouldn't be able to approve or reject his/her own PR (#4729) - * Make sure to reset commit count in the cache on mirror syncing (#4720) - * Fixed bug where team with admin privelege type doesn't get any unit (#4719) - * Fix incorrect caption of webhook setting (#4701) (#4717) - * Allow WIP marker to contains < or > (#4709) - * Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680) - * Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645) - * Fix custom templates being ignored (#4638) - * Fix starring icon after semantic ui update (#4628) - * Fix Split-View line adjustment (#4622) - * Fix integer constant overflows in tests (#4616) - * Push whitelist now doesn't apply to branch deletion (#4601) (#4607) - * Fix bugs when too many IN variables (#4594) - * Fix failure on creating pull request with assignees (#4419) (#4583) - * Fix panic issue on update avatar email (#4580) (#4581) - * Fix status code label for a successful webhook (#4540) - * An inactive user shouldn't be able to be added as a collaborator (#4535) - * Don't fail silently if trying to add a collaborator twice (#4533) - * Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525) - * Fix out-of-transaction query in removeOrgUser (#4521) (#4522) - * Fix migration from older releases (#4495) - * Accept 'Data:' in commit graph (#4487) - * Update xorm to latest version and fix correct `user` table referencing in sql (#4473) - * Relative URLs for LibreJS page (#4460) - * Redirect to correct page after using scratch token (#4458) - * Fix column droping for MSSQL that need new transaction for that (#4440) - * Replace src with raw to fix image paths (#4377) - * Add default merge options when creating new repository (#4369) - * Fix docker build (#4358) - * Fixes repo membership check in API (#4341) - * Dep upgrade mysql lib (#4161) - * Fix some issues with special chars in branch names (#3767) - * Responsive design fixes (#4508) -* TRANSLATION - * Fix punctuation in English translation (#4958) - * Fix translation (#4355) - -## [1.5.3](https://github.com/go-gitea/gitea/releases/tag/v1.5.3) - 2018-10-31 - -* SECURITY - * Fix remote command execution vulnerability in upstream library (#5177) (#5196) - -## [1.5.2](https://github.com/go-gitea/gitea/releases/tag/v1.5.2) - 2018-10-09 - -* SECURITY - * Enforce token on api routes (#4840) (#4905) -* BUGFIXES - * Remove links from topics in edit mode (#5030) - * Detect charset and convert non UTF-8 files for display (#4950) (#4994) - * Fix layout of the topics editing form (#4971) (#4993) - * Fix null pointer dereference in ParseCommitWithSignature (#4964) - * Fix url in discord webhook (#4951) - * Fix font-cropping UI bug in diff (#4726) (#4929) - * Fix bug forget to remove Stopwatch when remove repository (#4933) - * Fix bug when repo remained bare if multiple branches pushed (#4927) - * Fix redirect with non-ascii branch names (#4764) (#4887) - * Fix issues api allow pulls (#4852) (#4862) - * Fix trimming of markup section names (#4864) - -## [1.5.1](https://github.com/go-gitea/gitea/releases/tag/v1.5.1) - 2018-09-03 - -* SECURITY - * Don't disclose emails of all users when sending out emails (#4784) - * Improve URL validation for external wiki and external issues (#4710) (#4740) - * Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) (#4707) -* BUGFIXES - * Fix missing release title in webhook (#4783) (#4800) - * Make sure to reset commit count in the cache on mirror syncing (#4770) - * Fixed bug where team with admin privelege type doesn't get any unit (#4759) - * Fix failure on creating pull request with assignees (#4583) (#4727) - * Hide org/create menu item in Dashboard if user has no rights (#4678) (#4686) -* TRANSLATION - * Fix incorrect caption of webhook setting (#4701) (#4718) - -## [1.5.0](https://github.com/go-gitea/gitea/releases/tag/v1.5.0) - 2018-08-10 - -* SECURITY - * Check that repositories can only be migrated to own user or organizations (#4366) (#4370) - * Limit uploaded avatar image-size to 4096px x 3072px by default (#4353) - * Do not allow to reuse TOTP passcode (#3878) -* BUGFIXES - * Fix column droping for MSSQL that need new transaction for that (#4440) (#4484) - * Redirect to correct page after using scratch token (#4458) (#4472) - * Replace src with raw to fix image paths (#4377) (#4386) - * Fixes repo membership check in API (#4341) (#4379) - * Add default merge options when adding new repository (#4369) (#4373) - * Fix repository last updated time update when delete a user who watched the repo (#4363) (#4371) - * Fix html entity escaping in branch deletion message (#4471) (#4485) - * Fix out-of-transaction query in removeOrgUser (#4521) (#4524) - * Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) - * Fix panic issue on update avatar email (#4580) (#4590) - * Fix bugs when too many IN variables (#4594) (#4597) - * Push whitelist now doesn't apply to branch deletion (#4601) (#4640) - * Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645) (#4650) -* FEATURES - * Add cli commands to regen hooks & keys (#3979) - * Add support for FIDO U2F (#3971) - * Added user language setting (#3875) - * LDAP Public SSH Keys synchronization (#1844) - * Add topic support (#3711) - * Multiple assignees (#3705) - * Add protected branch whitelists for merging (#3689) - * Global code search support (#3664) - * Add label descriptions (#3662) - * Add issue search via API (#3612) - * Add repository setting to enable/disable health checks (#3607) - * Emoji Autocomplete (#3433) - * Implements generator cli for secrets (#3531) -* ENHANCEMENTS - * Add more webhooks support and refactor webhook templates directory (#3929) - * Add new option to allow only OAuth2/OpenID user registration (#3910) - * Add option to use paged LDAP search when synchronizing users (#3895) - * Symlink icons (#1416) - * Improve release page UI (#3693) - * Add admin dashboard option to run health checks (#3606) - * Add branch link in branch list (#3576) - * Reduce sql query times in retrieveFeeds (#3547) - * Option to enable or disable swagger endpoints (#3502) - * Add missing licenses (#3497) - * Reduce repo indexer disk usage (#3452) - * Enable caching on assets and avatars (#3376) - * Add repository search ordered by stars/forks. Forks column in admin repo list (#3969) - * Add Environment Variables to Docker template (#4012) - * LFS: make HTTP auth period configurable (#4035) - * Add config path as an optionial flag when changing pass via CLI (#4184) - * Refactor User Settings sections (#3900) - * Allow square brackets in external issue patterns (#3408) - * Add Attachment API (#3478) - * Add EnableTimetracking option to app settings (#3719) - * Add config option to enable or disable log executed SQL (#3726) - * Shows total tracked time in issue and milestone list (#3341) -* TRANSLATION - * Improve English grammar and consistency (#3614) -* DEPLOYMENT - * Allow Gitea to run as different USER in Docker (#3961) - * Provide compressed release binaries (#3991) - * Sign release binaries (#4188) - -## [1.4.3](https://github.com/go-gitea/gitea/releases/tag/v1.4.3) - 2018-06-26 - -* SECURITY - * HTML-escape plain-text READMEs (#4192) (#4214) - * Fix open redirect vulnerability on login screen (#4312) (#4312) -* BUGFIXES - * Fix broken monitoring page when running processes are shown (#4203) (#4208) - * Fix delete comment bug (#4216) (#4228) - * Delete reactions added to issues and comments when deleting repository (#4232) (#4237) - * Fix wiki URL encoding bug (#4091) (#4254) - * Fix code tab link when viewing tags (#3908) (#4263) - * Fix webhook type conflation (#4285) (#4285) - -## [1.4.2](https://github.com/go-gitea/gitea/releases/tag/v1.4.2) - 2018-06-04 - -* BUGFIXES - * Adjust z-index for floating labels (#3939) (#3950) - * Add missing token validation on application settings page (#3976) #3978 - * Webhook and hook_task clean up (#4006) - * Fix webhook bug of response info is not displayed in UI (#4023) - * Fix writer cannot read bare repo guide (#4033) (#4039) - * Don't force due date to current time (#3830) (#4057) - * Fix wiki redirects (#3919) (#4065) - * Fix attachment ENABLED (#4064) (#4066) - * Added deletion of an empty line at the end of file (#4054) (#4074) - * Use ResolveReference instead of path.Join (#4073) - * Fix #4081 Check for leading / in base before removing it (#4083) - * Respository's home page not updated after first push (#4075) - -## [1.4.1](https://github.com/go-gitea/gitea/releases/tag/v1.4.1) - 2018-05-03 - -* BREAKING - * Add "error" as reserved username (#3882) (#3886) -* SECURITY - * Do not allow inactive users to access repositories using private key (#3887) (#3889) - * Fix path cleanup in file editor, when initilizing new repository and LFS oids (#3871) (#3873) - * Remove unnecessary allowed safe HTML (#3778) (#3779) - * Correctly check http git access rights for reverse proxy authorized users (#3721) (#3743) -* BUGFIXES - * Fix to use only needed columns from tables to get repository git paths (#3870) (#3883) - * Fix GPG expire time display when time is zero (#3584) (#3884) - * Fix to update only issue last update time when adding a comment (#3855) (#3860) - * Fix repository star count after deleting user (#3781) (#3783) - * Use the active branch for the code tab (#3720) (#3776) - * Set default branch name on first push (#3715) (#3723) - * Show clipboard button if disable HTTP of git protocol (#3773) (#3774) - -## [1.4.0](https://github.com/go-gitea/gitea/releases/tag/v1.4.0) - 2018-03-25 - -* BREAKING - * Drop deprecated GOGS\_WORK\_DIR use (#2946) - * Fix API status code for hook creation (#2814) -* SECURITY - * Escape branch name in dropdown menu (#3691) (#3692) - * Refactor and simplify to correctly validate redirect to URL (#3674) (#3676) - * Fix escaping changed title in comments (#3530) (#3534) - * Escape search query (#3486) (#3488) - * Sanitize logs for mirror sync (#3057) -* FEATURES - * Serve .patch and .diff for pull requests (#3305, #3293) - * Add repo-sync-releases admin command (#3254) - * Support default private when creating or migrating repository (#3239) - * Writable deploy keys (closes #671) (#3225) - * Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188) - * Added progressbar for issues with checkboxes (#1146). (#3171) - * Mention completion for issue editor. (#3136) - * Add 'mark all read' option to notifications (#3097) - * Git LFS lock api (#2938) - * Add reactions to issues/PR and comments (#2856) - * Add dingtalk webhook (#2777) - * Responsive view (#2750) -* BUGFIXES - * Fix wiki inter-links with spaces (#3560) (#3632) - * Fix query protected branch bug (#3563) (#3571) - * Fix remove team member issue (#3566) (#3570) - * Fix the protected branch panic issue (#3567) (#3569) - * If Mirrors repository no content is fetched, updated time should not be changed (#3551) (#3565) - * Bug fix for mirrored repository releases sorted (#3522) (#3555) - * Add issue closed time column to fix activity closed issues list (#3537) (#3540) - * Update markbates/goth library to support OAuth2 with new dropbox API (#3533) (#3539) - * Fixes missing avatars in offline mode (#3471) (#3477) - * Fix synchronization bug in repo indexer (#3455) (#3461) - * Fix rendering of wiki page list if wiki repo contains other files (#3454) (#3463) - * Fix webhook X-GitHub-* headers casing for better compatibility (#3429) - * Add content type and doctype to requests made with go-get (#3426, #3423) - * Fix SQL type error for webhooks (#3424) - * Fix PR merge error (#3421) - * Recognize more characters in crossreferenced repo name (#3413) - * Fix MSSQL bug on org (#3405) - * HTML escape all lines of the search result (#3402) - * Change local copy origin url after repository rename (#3399) - * Force-push to base repo's ref/pull/#/head (#3393) - * Fix bug when a user delete but assigned on issue (#3318) - * Use issue number/index instead of id for API URL. Fix #3297 (#3298) - * Fix repo-transfer-and-team-repo-count bug (#3241) - * Fix always-on SSL Mode checkbox in admin page (#3208) - * Fix source download link when no code unit allowed (#3166) - * Fix org owner cannot be removed if he is not in owner team (#3164) - * Fix run web with -p push failed (#3154) - * Fix gpg tmpl (#3153) - * Fix SSH auth lfs locks (#3152) - * Improvements for supporting UI Location (#3146) - * Fix new pull request link (#3133) - * Fix missing branch in release bug (#3108) - * Allow adding collaborators with (fullname) (#3103) - * Fix repo links (#3093) - * fix lfs url refs + keep path upper/lowercase in db. (#3092) - * Fix redis session failed (#3086) - * Fix bugs in issue dashboard stats (#3073) - * Fix avatar URLs (#3069) - * Fix ref parsing in commit messages (#3067) - * Fix issue list branch link broken (#3061) - * sendmail: correct option to set envelope-sender (#3044) - * Fix missing password length check when change password (#3039) - * Fix git lfs path (#3016) - * Fix API-Endpoint release (#3005) (#3012) - * Set OpenID support on by default when installing new instance (#3010) - * Various wiki bug fixes (#2996) - * Fix go-get, src and raw urls to new scheme (#2978) - * Fix error when add user has full name to team (#2973) - * Fix memcache support when value is returned as string always (#2924) -* ENHANCEMENTS - * Use GiteaServer as the user agent for http requests (#3404) - * Delete indexer DB entries when (re)creating index (#3385) - * Change how merged PR commit info are prepared (#3368) - * Asynchronously populate the repo indexer (#3366) - * Make the default action for the gitea executable that of running the webserver (#3331) - * Templates for extra links in top navbar and repo tool tabs. (#3308) - * Fixed asterisk based tasklist items #3295 (#3296) - * Add more additional template snippets (#3286) - * Open external tracker in blank window, consistently with wiki (#3227) - * Fix repo links on user profile (#3197) - * Enable emoji for wiki view (#3158) - * Small improve on deleting attachements (#3145) - * Reduce overhead of upgrades for users with custom stylesheets/JS (#3051) - * Default log level to Info without hardcoding it in installer (#3041) - * Memory usage improvements (#3013) - * Add fingerprint to ssh key endpoints. (#3009) - * Improve memory usage when reaching diff limits (#2990) - * Expandable commit bodies (#2980) - * Update gitgraph.js to fix blurry commit graph on HiDPI screens (#2957) - * Fix language names (#2955) - * Remove render issue link (#2954) - * Page parameter for repo search API (#2915) - * Apply LANDING\_PAGE config options for logged in users (#2894) - * Enable admin to search by email (#2888) - * Hide add key button if SSH is disabled (#2873) - * Fix comment API paths (#2813) - * Add an option to allow redirect of http port 80 to https. (#1928) -* MISC - * Fix organization profile on mobile devices (#3332) - * Fix guide link for webhooks in repository settings (#3291) (#3292) - * Enable Libravatar by default in new installations (#3287) - * Improve suppressed diff boxes (#3193) - * fix button heights on commits page (#3091) - * Minor copy changes (#3074) - * Sort repos in issues dashboard sidebar (#3072) - * Remove box-shadow from UI, fix dashboard issue (#3065) - * Adjust branch button size (#3063) - * Fix misalignment issue in repo header (#3062) - * Delete a user's public key via admin api (closes #3014) (#3059) - * Dashboard: Fix line height problem in issue titles (#3054) - * Remove duplicate "Max Diff Lines" from config view (#2987) - * Drop unmaintained gogs migration script (#2947) - * App restarts to quickly if it fails to start. (#2945) - * Add owner to delete repo message (#2886) - -## [1.3.1](https://github.com/go-gitea/gitea/releases/tag/v1.3.1) - 2017-12-08 - -* BUGFIXES - * Sanitize logs for mirror sync (#3057, #3082) (#3078) - * Fix missing branch in release bug (#3108) (#3117) - * Fix repo indexer and submodule bug (#3107) (#3110) - * Fix legacy URL redirects (#3100) (#3106) - * Fix redis session failed (#3086) (#3089) - * Fix issue list branch link broken (#3061) (#3070) - * Fix missing password length check when change password (#3039) (#3071) - -## [1.3.0](https://github.com/go-gitea/gitea/releases/tag/v1.3.0) - 2017-11-29 - -* BREAKING - * Make URL scheme unambiguous (#2408) -* FEATURES - * Add branch overiew page (#2108) - * Code/repo search (#2582) - * Add Activity page to repository (#2674) - * Issue Timetracking (#2211) - * Add orgmode document type on file view and readme (#2525) - * Add external markup render support (#2570) - * Implementation of discord webhook (#2402) - * Webhooks for repo creation/deletion (#1663) - * Complete push webhooks (#2530) - * Add possibility to record branch information in an issue (#780) - * Create new branch from branch selection dropdown (#2130) - * Implementation of all repositories of a user from user->settings (#1740) - * Add LFS object verification step after upload (#2868) - * Configurable SSH cipher suite (#913) - * Disable custom Git Hooks globally via configuration file (#2450) - * Sync releases table with tags on push and for mirrors (#2459) -* BUGFIXES - * Fix label comments for French locale (#3017) - * Remove duplicate "Max Diff Lines" from config view (#3001) - * Fix over-escaped characters (#2992) - * Fix go-get, src and raw urls to new scheme (#2986) - * Fix error when add user has full name to team (#2975) - * Fix files/commits of merged PRs (#2970) - * Update golang x/crypto dependencies - Fix SSH transport fail (#2951) - * Fix memcache support when value is returned as string always (#2950) - * Fix issue link rendering in commit messages (#2897) - * Fix adding a new authentication source after selecting OAuth (#2889) - * Fix new branch creation to new url scheme (#2884) - * Allow spaces in username for LDAP users (#2880) - * Fix LFS not returning correct content length when requesting a range … (#2864) - * Fix fork repository cycle to self (#2860) - * Fix click create pull request button 404 (#2859) - * Fix API raw file content access for default branch (#2849) - * Clean repository ROOT directory name with filepath.Clean (#2846) - * Fix API raw requests for commits and tags (#2841) - * Fix order of comments (#2835) - * Issue content should not be updated when closing with comment (#2833) - * Fix ordering in app.ini and fix run mode option (#2829) - * Fix redirect url of legacy commits route (#2825) - * Fix commits page url (#2823) - * Fix wrong translations (#2818) - * Fix dropdown menu position when explore repos (#2808) - * Fix Git LFS object/repo link storage in database and small refactoring (#2803) - * Use relative URLs for avatars on the dashboard (#2800) - * Add checks for commits with missing author and time (#2771) - * Fix emojify image URL (#2769) - * Hide unactive on explore users and some refactors (#2741) - * Fix IE unsupported javascript construction in branch dropdown (#2736) - * Only update mirror last update after successful sync (#2730) - * Fix semantic-ui style conflict with v-cloak (#2722) - * Fixing wrong translation on sort type oldest/latest (#2720) - * Fix PR, milestone and label functionality if issue unit is disabled (#2710) - * Fix plain readme didn't render correctly on repo home page (#2705) - * Fix organization removal from watch table migration (#2703) - * Fix repository search function (#2689) - * fix panic on gogs webhook creation (#2675) - * Fix orgnization user watch repository (#2670) - * GPG key email verification no longer case sensitive (#2661) (#2663) - * Fix index column deletion (#2651) - * table `pull_request` wasn't updated correctly (#2649) - * Fix go get response if only app URL is custom in configuration (#2634) - * Fix doubled issue tab introduced in migration v16 (#2611) - * Rewrite migrations to not depend on future code changes (#2604) - * Fix implementation of repo Home func (#2601) - * Fix translation upload to crowdin (#2599) - * Reduce usage of allcols on update (#2596) - * fix go get subpackage bug (#2584) - * Fix broken migration to add can_push field back to table (#2574) - * fix readme view bug (#2566) - * Fix sending mail with a non-latin display name. #2102 (#2559) - * Restricting access to fork functioanlity to users with Code access (#2534) - * fix updated update on public key (#2514) - * Added bucket name to s3 drone plugin (#2505) - * fixes 500 error on dashboard when using MSSQL (#2504) - * fix wrong rendering of commit detail page (#2503) - * Hotfix: Add time manually adds time in nanoseconds (#2499) - * Remove repository mirrors from "collaborative" list (#2497) - * fix release failed since the wrong token name (#2496) - * Fix slice out of bounds error in mailer (#2479) - * Fix #2470 (#2477) - * fix orgnization webhooks (#2422) - * fix webhook test (#2415) - * fix missing orgnization discord webhook (#2414) - * Fix route handler order (#2409) - * Prevent sending emails and notifications to inactive users (#2384) - * Move themes to plugin directory. Fixes #2372 (#2375) - * fix duplicated feed (#2370) - * Fix missing collabrative repos (#2367) - * Only check at least one email gpg key (#2266) - * don't check minimum key size when disabled (#1754) - * Fix run command race (#1470) - * fix .netrc authentication (#2700) - * Fix so that user can still fork his own repository to his organizations (#2699) - * Fix can_push value to false in protected_branch (#2560) - * Fix copy in email templates (#2801) - * Fix inconsistencies in user settings UI (#2901) - * Fix attachments icon size on zoom in/out (#2853) - * Fix ignored errors in API route (#2850) - * Fix activity css conflit with semantic ui (#2758) - * Fix notifications tabs according to semantic-ui docs (#2733) - * Fix typos in app.ini (#2732) - * Fix duplicated rel attribute (#2549) - * Fix tests code to prevent some runtime errors (#2381) -* ENHANCEMENTS - * Memory usage improvements and lower minimal git requirement to 1.7.2 (#3013) (#3028) - * Set OpenID support on by default when installing new instance (#3010) (#3027) - * Use api.TrackedTime in API (#2807) - * Configurable SSH key exchange algorithm and MAC suite (#2806) - * Add Safari pinned tab icon (#2799) - * Improve force push detect when push (#2798) - * Add wrapping to long diff lines (#2789) - * Link members and repositories count to each page on org home. (#2787) - * Show Sendmail settings on admin config page (#2782) - * Add commit count caching (#2774) - * Use identicon image for default gravatar. (#2767) - * Add default ssh ciphers (#2761) - * Remove manual of unsupported option (#2757) - * Add search mode option to /api/repo/search (#2756) - * Move swagger-ui under /api/v1 (#2746) - * Add support for extra sendmail arguments (#2731) - * Use buffersize to reduce database connection when iterate (#2724) - * Render plain text README.txt monospaced (#2721) - * Integration test for activity page (#2704) - * Merge password and 2fa page on user settings (#2695) - * Allow custom SSH user in UI for built-in SSH server (#2617) (#2678) - * Refactor duplicated code in repo handlers (#2657) - * Replace deprecated Id method with ID (#2655) - * Remove redudant functions and code (#2652) - * hide navbar when only 1 sign-in method is available (#2444) (#2648) - * Change default sort order (#2647) - * Change pull description text (#2075) (#2646) - * Remove direct user adding to organization members (#2641) - * Use session when creating user (#2638) - * Use Semantic UI's Search component for user and repo search (#2636) - * Use AfterLoad instead of AfterSet on Structs (#2628) - * Remove redudant CheckUnit calls in router (#2627) - * Remove repo unit index (#2621) - * Remove redudant issue LoadAttributes() calls (#2614) - * Make indexer code more reusable (#2590) - * Use custom type and constants to hold available order by options (#2572) - * Use named ActionType constants in template helper (#2545) - * Make basic functionality work without JavaScript (#2541) - * Ctrl + Enter to submit forms (#2540) - * Automatically regenerate indexer for incompatible versions (#2524) - * Set default lfs content path to data/lfs (#2521) - * Convert spaces to tabs in footer.tmpl (#2520) - * Sort repository tree entries in natural way (#2506) - * Open external wiki in new window (#2489) - * Use created & updated instead BeforeInsert & BeforeUpdate (#2482) - * Hide branch on pull request view or create UI (#2454) - * improve protected branch to add whitelist support (#2451) - * some refactors for issue and comments (#2419) - * Restructure markup & markdown to prepare for multiple markup language… (#2411) - * Improve issue search (#2387) - * Add UseCompatSSHURI setting (#2356) - * Use custom search for each filter type in dashboard (#2343) - * Failed authentication are now properly logged (#2334) - * Add environment variable support for Docker image (#2201) - * Set session and indexers' data files rel to AppDataPath (#2192) - * Display commit status on landing page of repo (#1784) -* TESTING - * Add integration test for logging out (#2892) - * Integration test for user deleting account (#2891) - * Use different directories for session files in integration tests (#2834) - * Add deleted_branch table fixture (#2832) - * Include HTTP method in test error message (#2815) - * Add repository search unit and integration tests (#2575) - * Expand fixtures (#2571) - * Fix /api/repo/search integration tests (#2550) - * Make integration tests more user-friendly (#2536) - * Fix unit test race condition (#2516) - * Add missing fixture to clean gpg_key table (#2494) - * Hotfix for integration testing (#2473) - * Make repo private to not interfere with other tests (#2467) - * Error message for integration test (#2410) - * Fix "index out of range" runtime error in repo_list tests (#2376) - * Add git clone test on integration test (#1682) -* TRANSLATION - * Fix localization texts that contain semicolon (#2900) - * Fix activity locale (#2709) - * Update translation from crowdin (#2368) -* BUILD - * change the email and name to GitBot account. (#2848) - * Fix removing backslash before quotes in translations (#2831) - * add gitea remote in drone. (#2817) - * add remote name for git push. (#2816) - * Launch Gitea with custom UID/GID for 'git' user (fixes #2286) (#2791) - * Download and pushing translations (#2727) - * Automatic update of translations (#2585) - * Add pre-build step for nodejs stuff (#2581) - * Compress css with nodejs (#2580) - * Remove go version check for make fmt (#2558) - * Fix lint errors (#2547) - * Always run fmt check in CI (#2546) - * Fix fmt errors (#2544) - * add codecov.io service. (#2493) - * Fix some tests : make coverage -> test (#2492) - * Fix fmt error in mailer (#2490) - * Allow changing integration test database connection using env variables (#2484) - * Add changelog config file for generate changelog (#2461) - * Changes for latest DroneCI (#2362) - * Use standard lessc and minify CSS using Node.js (#2337) -* DOCS - * Update screenshots on README (#2910) - * Gogs -> Gitea (#2909) - * Update swagger documentation (#2899) - * Fix typo (#2810) - * Fix Polish language name spelling (#2766) - * Fix Various Grammar Issues and Adjust Unnatural Wording (#2737) - * Add maintainer label for docker file (#2658) - * Link to gitea-specific Vagrant example (#2624) - * add release notes of v1.1.4 (#2463) - * Wrap most paragraphs to 80 columns (#2396) - * Update CONTRIBUTING following #2329 discussion (#2394) - * Update hard-coded version to 1.3.0+dev (#2390) - * Clarify Translation Process. Also fix branch names (#2378) - * Admin grammar fixes and improvements (#2056) -* MISC - * Sync MaxGitDiffLineCharacters with conf/app.ini (#2779) - * Dockerfile: Updated alpine image to 3.6. (#2486) - * Basic VSCode configuration for building and debugging (#2483) - * Added vendor dir for js/css libs; Documented sources (#1484) (#2241) - -## [1.2.3](https://github.com/go-gitea/gitea/releases/tag/v1.2.3) - 2017-11-03 - -* BUGFIXES - * Only require one email when validating GPG key (#2266, #2467, #2663) (#2788) - * Fix order of comments (#2835) (#2839) - -## [1.2.2](https://github.com/go-gitea/gitea/releases/tag/v1.2.2) - 2017-10-26 - -* BUGFIXES - * Add checks for commits with missing author and time (#2771) (#2785) - * Fix sending mail with a non-latin display name (#2559) (#2783) - * Sync MaxGitDiffLineCharacters with conf/app.ini (#2779) (#2780) - * Update vendor git (#2765) (#2772) - * Fix emojify image URL (#2769) (#2773) - -## [1.2.1](https://github.com/go-gitea/gitea/releases/tag/v1.2.1) - 2017-10-16 - -* BUGFIXES - * Fix PR, milestone and label functionality if issue unit is disabled (#2710) (#2714) - * Fix plain readme didn't render correctly on repo home page (#2705) (#2712) - * Fix so that user can still fork his own repository to his organizations (#2699) (#2707) - * Fix .netrc authentication (#2700) (#2708) - * Fix slice out of bounds error in mailer (#2479) (#2696) - -## [1.2.0](https://github.com/go-gitea/gitea/releases/tag/v1.2.0) - 2017-10-10 - -* SECURITY - * Sanitation fix from Gogs (#1461) -* BREAKING - * Rename /forget_password url to /forgot_password (#1219) -* FEATURES - * Logo: Add task to generate images from SVG and change to new logo (#2194) - * Status-API (#1332) - * Show commit status icon in commits table (#1688) - * Additional OAuth2 providers (#1010) - * GPG commit validation (#1150) - * Rework SSH key management UI to add GPG (#1293) - * Implement GPG api (#710) - * Login via OpenID-2.0 (#618) - * Add units to team (#947) - * Batch updates for issues (#926) - * Add Gitea Webhook (#1755) - * API: support '/orgs/:org/repos' (#2047) - * Display all organization from user settings (#1739) - * LDAP user synchronization (#1478) - * Adding #issuecomment to the URL in E-Mail notifications (#1674) - * Add download count field and unit testing for attachment. (#1512) - * Add repo mirror sync API endpoint (#1508) - * Add markup package to prepare for org markup format (#1493) - * Support for custom html meta (#1423) - * Per issue/PR watch/unwatch (#1410) - * Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION (#1369) - * Repo size in admin panel (#1482) - * Show user OpenID URIs in their profile (#1314) - * Add change-password admin command (#1304) - * Only use issue and wiki on repo. (#1297) - * Allow push to init a wiki repo (#1279) -* ENHANCEMENTS - * Make time diff translatable (#2057) - * Smaller watch, star, and fork buttons (#2052) - * Display config file path on admin panel (#2030) - * Only show SSH clone URL if signed in (#2169) (#2170) - * Only show "No Description" to repo admins (#2167) - * Always return valid go-get meta, even if unauthorized (#2010) - * Enable assignee e-mail notification (#2003) - * Let not-logged-in users view releases (#1999) - * No highlighting for .txt files (#1922) - * Make side nav on dashboard stackable (#1778) - * Setting to disable authorized_keys backup (#1856) - * Hide the create organization button (in dashboard/organization section) (#1705) - * LFS: Return 404 for unimplemented endpoints (#1330) - * Show a link to password reset from user settings requiring a password (#862) - * Reserve the "explore" user/org name (#1222) - * Send notifications to partecipants in issue comments (#1217) - * Improve style of user OpenID setting page (#1324) - * Use font-awesome OpenID icon more (#1320) - * Use readonly input form to show the validated OpenID URI (#1308) - * Add captcha support to OpenID based signup (#1307) - * Minor improvements on commit graph UI (#1380) - * Mirror sync interval specified as duration string (#1407) - * Make issue in commit graph "clickable" (#1392) - * Use whole button (commit graph) as link (#1390) - * Autofocus on 2fa passcode fields (#1460) - * Sort on repo size in admin panel (#1654) - * Improve dashboard repo search (#1652) - * Use a better default MAX_GIT_DIFF_LINE_CHARACTERS (#1845) - * Adds Parent property to the repo API (#1687) - * Add configuration option for default permission to create Organizations (#1686) - * Remove sha1 hash display in repository table (#1678) - * Download files to their original filename (#1676) - * Exposes in API the Repo entity's Size and IsBare property (#1668) - * Change two factor code entry box from text to number (#1733) - * Directly show error if user hit repository limit (#1767) - * Generate small and large logos at 4x resolution (#2233) - * Tags listed in releases tab (#2389) (#2424) -* BUGFIXES - * Fix adding branch as protected to not allow pushing to it (#2556) - * Orgs: fix org page title when full name is not defined (#1495) - * Fix double borders on edit page (#1152) (#1153) - * Search bar fixes for #1187 and #1205 (#1207) - * Fix upgrade failed after ever rollback (#1194) - * Fix FCGI (over TCP) support (#1368) - * Backport of migration fixes (#2604) (#2677) - * fix panic on gogs webhook creation (#2675) (#2676) - * Backport: Fixes 500 error on dashboard when using MSSQL (#2504) (#2662) - * Fix go get response if only app URL is custom in configuration (#2634) (#2640) - * Fix deletion of unprotected branches (#2630) - * Backport of 2611 / Fix doubled issue tab introduced in migration v16 (#2622) - * v38 migration used an outdated version of RepoUnit model (#2602) - * fix go get subpackage bug (#2584) (#2589) - * Backport: Sync releases table with tags on push and for mirrors (#2459) (#2554) - * Backport: Restricting access to fork functioanlity to users with Code access (#2542) - * Fix migration from pre-v15 to 1.2.0 (#2460) (#2465) - * Fix migration from pre-v15 to 1.2.0 (#2460) - * fix duplicated feed (#2370) (#2413) - * Fix releases to be counted from database not tags (#2389) - * Fix missing collabrative repos (#2367) (#2382) - * Add more test for login links and fix a bug on action retrieve (#2361) - * Fix SQL condition bug in GetFeeds(..) (#2360) - * fix bug on create repo link on dashboard (#2359) - * Fix order of elements in dashboard html (#2344) - * Fix repo-search template errors for go1.7 (#2336) - * Add missing forks key for dashboard repository component (#2325) - * fix template error on explore repos (#2319) - * Trigger sync webhooks on UI commit (#2302) - * fix 500 error when view an issue which's milestone deleted (#2297) - * Only update needed columns when update user (#2296) - * Fix rendering of external links (#2292) - * Fix and improve dashboard repo UI (#2285) - * Make short link pattern greedy (#2259) - * Temporarily patch go-ini/ini with fork (#2255) - * Convert xorm literal queries to method calls (#2253) - * update code.gitea.io/git in vendor to fix delete branch fails (#2250) - * Replace calls to xorm UseBool with Where (#2237) - * rhel7 has a git version with four digits (1.8.3.1) (#2236) - * Fix internal requests when gitea listens to unix socket or only external IP (#2234) - * Check for access in /repositories/:id (#2227) - * Fixed robots.txt 404 error (#2226) - * Fix counts on issues dashboard (#2215) - * Fix unclosed session bug (#2214) - * Add collaborative repositories to the dashboard (#2205) - * Fix issue updated_unix bug (#2204) - * Fix Commits nil pointer dereference (#2203) - * Fix bare-repo bugs (#2199) - * Fix PR nil-dereference bug (#2195) - * Allow only single fork per user/organization (#2193) - * Fix key usage time update if the key is used in parallel for multiple operations (#2185) - * Only allow token authentication with 2FA enabled (#2184) - * Fix profile update for non-local users (#2178) - * Fix compiling without sqlite and gcc (#2177) - * Make compare button URL aware if current repo is a fork (#2162) (#2163) - * Remove unit types commits and settings (#2161) - * Fix OpenID registration route (#2160) - * Fix repository settings collobration list display (#2151) - * Ignore invalid issue numbers in commit messages. Fixes #2022 (#2150) - * Fix SHA1 hash linking (#2143) - * Fix repo API bug (#2133) - * Use POSIX complaint ! operator in find (#2132) - * Fix GET /users/:username/repos endpoint (#2125) - * Fix username rendering bug (#2122) - * Fix wiki preview links (#2119) - * vendor: update sqlite to fix "database is locked" errors (#2116) - * Fix unchecked error bug (#2110) - * Fix missing-return bug (#2109) - * Fix API for branches with slashes (#2096) - * Fix git hooks update to receive required arguments (#2095) - * upgrade git source code. (#2094) - * Fix SQL bug in models.PullRequests (#2092) - * Don't ignore gravatar error (#2083) - * Fix release display and correct paging (#2080) - * remove unnecessary blank lines and wrong error log (#2079) - * Check for valid renamed usernames (#2077) - * Update git module (#2074) - * Fix org hooks UI (#2072) - * Fix #1271: Call location.reload after XHR finishes (#2071) - * Fix default ghost assignee bug (#2069) - * Fix bug in issue labels API (#2048) - * Load label ID in NewLabels (#2045) - * Fix: `http: multiple response.WriteHeader calls` (#2038) - * Pagination on releases page (#2035) - * repo/editor: fix breadcrumb path cuts parent dirs (#3859) (#2032) - * Fix displaying commits and files of PR created from now deleted fork (#2023) - * Fix #2001 and fix issue comments hidden (#2016) - * Update code.gitea.io/git (#2014) - * Keep sort when switching page (#2013) - * Important: wrong PR merge commit ID saved (#2007) - * Don't show non-comments in comments API (#2001) - * Fix "Dashboard shows deleted comments" (#1995) - * Make branch deletion URL more like GitHub's, fixes #1397 (#1994) - * Fix fast-forward PR bug (#1989) - * Fix GPG email checking to be case insensitive (#1988) - * fix bug for normal user visit public repo (#1984) - * fix collborators lack of units on orgnization repositories (#1968) - * Fix diff of renamed and modified file (#1967) - * Fix uppercase default branch bug (#1965) - * Fix bug in Action.loadRepo() (#1959) - * Fix deleted milestone bug (#1942) - * Fix engine bug in getIssueByID (#1934) - * Switch to keybase go-crypto (for some elliptic curve key) + test (#1925) - * Fix setting.AppPath for integration tests (#1923) - * Fix search by issue type (#1914) - * Fix ghost user bug (#1913) - * Require token before checking membership/ownership (#1905) - * Bug fixes for org member API (#1904) - * A missing / to provide a correct endpoint (#1903) - * Fix 500 in public activity page (#1901) - * Center-aligned login topbar (#1880) - * Migration to fix existing owner team units (#1873) - * Fix paginater length (#1866) - * Fix bug in removeOrgRepo (#1858) - * Display draft releases (#1854) - * Fix 404 for external tracking issues (#1852) - * Update code.gitea.io/git (#1849) - * Fix user profile activity feed (#1848) - * Don't ignore error in getMergeCommit (#1843) - * Fix locking bug in removeOrgRepo (#1842) - * Fix status table race condition (#1835) - * Fix PR template error (#1834) - * Fix pull request compare link (#1832) - * Use ghost users in issues/PRs (#1831) - * Commitless repos should be bare (#1829) - * Update code.gitea.io/git (#1824) - * Fix invalid reference in feeds template (#1820) - * fix bug to deny to add orgnization as a member of an orgnization or team (#1815) - * xxx_active_code_live setting in printed in hours and minutes instead … (#1814) - * Fix deadlock in updateRepository (#1813) - * Give all units to owner team (#1812) - * Fix 500 for GET /teams/:id endpoints (#1811) - * fix bug not to trim space of login username (#1796) - * Fix renaming bug (#1786) - * Fix activity feed (#1779) - * Make navbar scroll on overflow (#1777) - * Delete repo redirects on repo deletion (#1776) - * Fix unloaded owner bug (#1770) - * Admin should always be allowed to create repositories even if hit limit (#1765) - * Update HighlightJS and fix YAML files highlighting (#1764) - * fix: #1757 fix set MAX_CREATION_LIMIT as zero. (#1762) - * fix admin lost permission caused by #947 (#1753) - * More fixes for dashboard search (#1750) - * fixes wrong after field in webhook payload (#1746) - * fix avatar update bug (#1729) - * Fix FOUC on Firefox (#1728) - * Fix changes introduce by update of go-swagger. (#1727) - * Fix #1719 (#1722) - * Correct flash after sending password reset email (#1718) - * Fix and test for delete user (#1713) - * Fix rendering of issue checkboxes (#1709) - * Enforce netgo build tag while cross-compilation (#1690) - * fix bug when push a branch name with / & fix an integration test bug (#1689) - * fix potential sqlite lock (#1680) - * Fix commit sha1 URL rendering in markdown (#1677) - * Fix static files permission under public/ (#1675) - * fix: tag contain character ) will http 500 on release page (#1670) - * Fix CSS for code in wiki markdown (#1660) - * fix multiple readme file rendering and fix #1657 (#1658) - * Add primary key and index to external login user table (#1656) - * fix #1643 and improve integration test (#1645) - * Fix version in Makefile (#1636) - * Handle display of GPG key without end date (#1628) - * fix bug on issue view when not login (#1624) - * bug fixed for API to get user's repos (#1622) - * fix lost text color on button on set as primary email (#1621) - * Add create_at and updated_at in PR json (#1616) - * update git and fix #1133 (#1614) - * fix bug on status API (#1533) - * Do not show empty collaborators segment (#1531) - * Fix markdown rendering (#1530) - * fix go get sub package and add domain on installation to let go get work defaultly (#1518) - * fix #1501 ssh hangs caused by #1461 (#1513) - * Fix empty file download (#1506) - * Fix broken v27 migration - change mirror interval from int to bigint (#1504) - * Do not allow commiting to protected branch from online editor (#1502) - * Add internal routes for ssh hook comands (#1471) - * Fix races within code.gitea.io/git.(*Command).RunInDirTimeoutPipeline (#1465) - * Simple quick fix for #1418 (#1456) - * fix gpg API panic when no verification (#1451) - * fix migrate failed and org dashboard failed on MSSQL database (#1448) - * Optimize and fix autolink function (#1442) (#1444) - * Fix and simplify repo branches (settings) UI (#1435) - * Fix disabled fields in repo settings UI (#1431) - * fixes pull request hanging when it contains normal and LFS files (#1425) - * Fix races in the log module by using syncmap (#1421) - * Add length check for the return string (#1420) - * Fix "Error: No issue number specified" when pushing (#1393) - * Corrected Mirror.NextUpdate not set (#1388) - * fix: remove `str2html` from org full name (#1360) - * Correct broken unaligned load/store in armv5 (#1355) - * Remove href on first/last link when on first/last page (#1345) - * Fix broken table layout (#1344) - * LFS: Fix SSH authentication for trailing arguments (#1328) - * Remove empty file (#1326) - * Fix delete user failed on sqlite (#1321) - * Fix inconsistency in layout (#1316) - * Fix gpg wrong column types (#1303) - * Fix wiki bugs (#1294) - * Fix missing less sources for oauth (#1288) - * Make sure both scripts/ can live side by side (#1264) - * Fix nil-dereference bug (#1258) - * rewrite pre-commit, post-commit and options hooks (fixes #1250) (#1257) - * Commit search appearence fixes (#1254) - * Fix forget migration for wiki hooks (#1227) - * Fix repo settings external tracker failed and check external urls (#1215) - * Fix 500 caused by branches settings introduced by #1198 (#1214) - * fix #1189, commit messages containing a pipe (#1203) - * Bug fixed for delete repo failed (#1193) - * Fix migration failed when authorized_keys is not exist (#1180) - * Fix ini format incomiptable with crowdin (#1177) -* TESTING - * Integration tests for issues API (#2059) - * Add integration tests for signin (#2363) - * Add INTERNAL_TOKEN to integration .ini file (#2346) - * Add public links check (#2323) - * Fix hooks for integration repo (#2216) - * More integration tests for comment API (#2156) - * Cache session cookies in tests (#2128) - * Less verbose integration tests (#2123) - * Fix improper setup for integration tests (#2050) - * Improve integration test helper functions (#2049) - * Add integration test for issue creating (#2002) - * Use testing/benchmark interface (#1993) - * Add integration test for repository migration (#1983) - * Consolidate boilerplate in integration tests (#1979) - * Set console to debug for integration tests (#1976) - * Add pull-create integration test (#1972) - * Coverage reports for integration tests (#1960) - * Add integration test for pull-request merge (#1912) - * Add integration test for file editing (#1907) - * Add integration test for repository forking (#1896) - * Run unused test (#1875) - * Don't recreate database in integration tests (#1697) - * remove sqlite tag when integration test with mysql/postgres and recreate database when init integration test (#1693) - * MySQL, Postgres integration tests in drone (#1638) - * improve integration test to resue models/fixtures and store git repos with tests (#1627) - * Improve govendor testing (#1623) - * Integration test framework (#1290) - * Unit tests for issue_list (#1209) - * Add integration test for signup (#1135) -* TRANSLATION - * update translation from crowdin (#2368) (#2380) - * Small fixes (#2144) - * Missing signed commit display translations (#2134) - * Sync latest translations from crowdin (#2104) - * Add make command update-translations for update translations from crodwin (#2097) - * Fix some mistakes (#1833) - * Improve clarity between is_activated and prohibit_login (#1788) - * Improve grammar (#1775) - * Fix bad grammar and wordiness (#1741) - * Make strings translatable (#1188) (#1198) -* BUILD - * Dockerfile for aarch64 (#1128) (#1130) - * backport from v1.2 branch: add secrets for github release (#2588) (#2598) - * Add secrets for github release to fix drone failed (#2588) - * Backport changes for latest drone (#2586) - * Removing .drone.yml.sig (#2579) - * Fix drone for tags (#2573) (#2576) - * Backport: Remove go version check for make fmt (#2558) (#2561) - * Backport: Fix lint, fmt and integration testing errors (#2553) - * update latest xorm version to vendor (#2353) - * Remove integration test executables on `make clean` (#2340) - * refactor(Makefile): allow overriding default go program (#2310) - * Revert to upstream ini dependency (#2304) - * Use /dev/urandom to create random password (#2298) - * update drone sig file. (#2262) - * go get github.com/wadey/gocovmerge when needed (#2235) - * fix typo (#2145) - * Revert "Reduce number of layer" (#2086) - * Reduce number of layer (#2078) - * Skip sqlite integration in CI (#2058) - * fix golint error and rename func for suggestion. (#1997) - * fix misspell (#1996) - * update drone sig file (#1981) - * send notification if status changed (#1973) - * switch gitter to discord for drone. (#1971) - * Fix missing backslash in Dockerfile.rpi (#1952) - * Don't run 'make release' on PRs (#1908) - * Update code.gitea.io/git (#1892) - * Use production version of vuejs (#1869) - * Add a variable for docker tag (#1825) - * resign drone and fix #1816 (#1819) - * Separate generate swagger + fix sed os specific (#1791) - * Only run coverage on merges/pushes to master (#1783) - * Remove stale rule from Makefile (#1782) - * feat: upgrade drone docker image to support multi-stage build. (#1732) - * Realy don't cache apk index (#1694) - * Limit clone depth when drone-building (#1644) - * Refactor Dockerfile (#1632) - * Check if missing/modified/unused deps in vendor and fix errors (#1468) - * Add GOFLAGS and EXTRA_GOFLAGS (#1438) - * Include formatting check to the `make test` (and thus also `check`) rule (#1366) -* DOCS - * fix wrong changelog title (#2395) - * fix webhook link (#2289) - * Improve swagger doc (#2274) - * Add link to forum in issue template (#2070) - * add missing lfs config on example file (#2039) - * Add discourse link (#2027) - * Fix wording (#2024) - * Fix typo (#1974) - * Swagger docs for list/create forks (#1941) - * Update links to Discord server (#1940) - * [ci skip] update discord badge. (#1930) - * Change join chat from gitter to discord (#1929) - * Update changelog with v1.1.1 (#1926) - * Correct grammar in APIEmpty documentation (#1748) - * Add swagger comment for MirrorSync (#1747) - * Add "Table of Contents" in CONTRIBUTING.md (#1634) - * Fix service description in Debian init file (#1538) - * Use MAINTAINERS file in repository in CONTRIBUTING (#1489) - * Generate swagger json (#1402) - * Changed text when password reset disabled. (#1364) - * Removed email copyright year (#1348) - * Specify that time interval units are seconds (#1311) - * Gitea OpenID-2.0 login has been tested with livejournal.com too (#1306) - * Make wording of commit search more clear (#1291) - * Add notice that LFS mirroring is not supported (#1251) - * Fix typos in models/ and modules/ (#1248) - * Refactor and fix incorrect comment (#1247) - * Fix migration comment (#1241) - * Update locale_en-US.ini (#1235) - * Add LibreJS support (#1201) - * rename OSX to macOS (#1176) - * add mssql to app.ini db config comment (#1172) - * Add MSSQL to issues template (#1171) -* MISC - * Add badge and link to the Matrix room (#2348) - * ignore coverage steps. (#2257) - * Use sqlite3 database as default for Docker image (#2182) - * update drone discord plugin to 0.0.4 version (#1992) - * fix typo (#1990) - * Move 3rd party js/css into `public/vendor` and document sources (#2383) - * Prevent conflicting TOTP accounts by adding AppURL to issuer parameter (#2335) - * Fix variable name typo (#2327) - * Make use of Vue more universal (#2318) - * Remove (almost) server side data rendering from repo-search component (#2317) - * Add OpenID configuration in install page (#2276) - * More tweaks to repo top panel (#2267) - * File path tweaks in UI (#2264) - * Make SHOW_USER_EMAIL also apply to profiles (#2258) - * EnableUnit() -> UnitEnabled() (#2242) - * Prevent selection of diff line numbers (#2240) - * Remove unused variable on makefile (#2225) - * No error log entries for repo 404 (#2200) - * Refactor vue delimeters to use es6 template delimeters (#2171) - * Replace tmp with TMPDIR. (#2152) - * Remove unused files (#2124) - * Improve org error handling (#2117) - * Absolute path for setting.CustomConf (#2085) - * remove deprecated code for Gogs compitable (#2041) - * Refactor session close as xorm already does everything needed internally (#2020) - * SQLite has a query timeout. Hopefully fixes most 'database locked' errors (#1961) - * Use monospace font in githook editor (#1958) - * Fix import order (#1951) - * Gracefully handle bare repositories on API operations. (#1932) - * Fix errors caused by force push (#1927) - * Display URLs in integration test logs (#1924) - * Set TMPDIR enviroment variable for dump command (#1915) - * Cache ctx.User in retrieveFeeds (#1902) - * Make `LocalCopyPath` a setting instead of a hard-coded path (#1881) - * Add check misspelling (#1877) - * Fix misspelled variables (#1874) - * Gofmt (#1868, #1710, #1662) - * Rename misnamed migration (#1867) - * Support CRLF when splitting code lines for display (#1862) - * Add convert less css file step. (#1861) - * Prevent accidential selection of line numbers in code view (#1860) - * Delete Public SSH Key tmp file after calculating fingerprint (#1855) - * Remove annoying difference in button heights. (#1853) - * Only run test coverage on master branch. (#1838) - * Error from mktemp command in MacOS. (#1837) - * Use writeTmpKeyFile in calcFingerprint (#1828) - * ROOT_URL setting use the default as shown in conf/app.ini (#1823) - * Rename RepoCreationNum -> MaxCreationLimit (#1766) - * Add button to admin ui (#1738) - * Correct spelling mistakes (#1703) - * Make openid support default false for compitable with v1.1 (#1650) - * Send mails as HTML as default. Setting for send as plain text. (#1648) - * fix potential lock when sqlite (#1647) - * Optimize png images via Google zopflipng [ci skip] (#1639) - * Upgrade alpine to v3.5 in Dockerfile (#1633) - * remove unused vendor packages (#1620) - * markup: microoptimise for many short filenames in directory (#1534) - * support health check via / and fix #969 (#1520) - * Remove env user salt since no need to use (#1515) - * Drop db operations from hook commands (#1514) - * Better URL validation (#1507) - * Migrate WatchInfo struct to api (#1492) - * refactor: show command help message. (#1486) - * refactor update ssh key use time (#1466) - * Set VERSION from git once, in a variable (#1447) - * Remove unused mutex field (#1440) - * Simplify settings pages with item list (#1389) - * Clean-up PostgreSQL Tests (#1361) - * refactor: remove workaround after the golang 1.7 release. (#1349) - * Delete the useless code (#1335) - * Run "make fmt" with go-1.6 (#1333) - * Refactor admin/auth/new.tmpl (#1277) - * Refactor repo/issue/view_content.tmpl (#1276) - * Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270) - * Cleaner UI for explore page (#1253) (#1255) - * Synced licenses with github repo (#1246) - * Synced gitignores with github repo (#1245) - * Simplify RepositoryList.loadAttributes() (#1211) - * Move user_follow to separate file (#1210) - * Reduce conditionals in signin/signup inner forms (#1138) - -## [1.1.4](https://github.com/go-gitea/gitea/releases/tag/v1.1.4) - 2017-09-04 - -* BUGFIXES - * Fix rendering of external links (#2292) (#2315) - * Fix deleted milestone bug (#1942) (#2300) - * fix 500 error when view an issue which's milestone deleted (#2297) (#2299) - * Fix SHA1 hash linking (#2143) (#2293) - * back port from #1709 (#2291) - -## [1.1.3](https://github.com/go-gitea/gitea/releases/tag/v1.1.3) - 2017-08-03 - -* BUGFIXES - * Fix PR template error (#2008) - * Fix markdown rendering (fix #1530) (#2043) - * Fix missing less sources for oauth (backport #1288) (#2135) - * Don't ignore gravatar error (#2138) - * Fix diff of renamed and modified file (#2136) - * Fix fast-forward PR bug (#2137) - * Fix some security bugs - -## [1.1.2](https://github.com/go-gitea/gitea/releases/tag/v1.1.2) - 2017-06-13 - -* BUGFIXES - * Enforce netgo build tag while cross-compilation (Backport of #1690) (#1731) - * fix update avatar - * fix delete user failed on sqlite (#1321) - * fix bug not to trim space of login username (#1806) - * Backport bugfixes #1220 and #1393 to v1.1 (#1758) - -## [1.1.1](https://github.com/go-gitea/gitea/releases/tag/v1.1.1) - 2017-05-04 - -* BUGFIXES - * Markdown Sanitation Fix [#1646](https://github.com/go-gitea/gitea/pull/1646) - * Fix broken hooks [#1376](https://github.com/go-gitea/gitea/pull/1376) - * Fix migration issue [#1375](https://github.com/go-gitea/gitea/pull/1375) - * Fix Wiki Issues [#1338](https://github.com/go-gitea/gitea/pull/1338) - * Forgotten migration for wiki githooks [#1237](https://github.com/go-gitea/gitea/pull/1237) - * Commit messages can contain pipes [#1218](https://github.com/go-gitea/gitea/pull/1218) - * Verify external tracker URLs [#1236](https://github.com/go-gitea/gitea/pull/1236) - * Allow upgrade after downgrade [#1197](https://github.com/go-gitea/gitea/pull/1197) - * 500 on delete repo with issue [#1195](https://github.com/go-gitea/gitea/pull/1195) - * INI compat with CrowdIn [#1192](https://github.com/go-gitea/gitea/pull/1192) - -## [1.1.0](https://github.com/go-gitea/gitea/releases/tag/v1.1.0) - 2017-03-09 - -* BREAKING - * The SSH keys can potentially break, make sure to regenerate the authorized keys -* FEATURES - * Git LFSv2 support [#122](https://github.com/go-gitea/gitea/pull/122) - * API endpoints for repo watching [#191](https://github.com/go-gitea/gitea/pull/191) - * Search within private repos [#222](https://github.com/go-gitea/gitea/pull/222) - * Hide user email address on explore page [#336](https://github.com/go-gitea/gitea/pull/336) - * Protected branch system [#339](https://github.com/go-gitea/gitea/pull/339) - * Sendmail for mail delivery [#355](https://github.com/go-gitea/gitea/pull/355) - * API endpoints for org webhooks [#372](https://github.com/go-gitea/gitea/pull/372) - * Enabled MSSQL support [#383](https://github.com/go-gitea/gitea/pull/383) - * API endpoints for org teams [#370](https://github.com/go-gitea/gitea/pull/370) - * API endpoints for collaborators [#375](https://github.com/go-gitea/gitea/pull/375) - * Graceful server restart [#416](https://github.com/go-gitea/gitea/pull/416) - * Commitgraph / timeline on commits page [#428](https://github.com/go-gitea/gitea/pull/428) - * API endpoints for repo forks [#509](https://github.com/go-gitea/gitea/pull/509) - * API endpoints for releases [#510](https://github.com/go-gitea/gitea/pull/510) - * Folder jumping [#511](https://github.com/go-gitea/gitea/pull/511) - * Stars tab on profile page [#519](https://github.com/go-gitea/gitea/pull/519) - * Notification system [#523](https://github.com/go-gitea/gitea/pull/523) - * Push and pull through reverse proxy basic auth [#524](https://github.com/go-gitea/gitea/pull/524) - * Search for issues and pull requests [#530](https://github.com/go-gitea/gitea/pull/530) - * API endpoint for stargazers [#597](https://github.com/go-gitea/gitea/pull/597) - * API endpoints for subscribers [#598](https://github.com/go-gitea/gitea/pull/598) - * PID file support [#610](https://github.com/go-gitea/gitea/pull/610) - * Two factor authentication (2FA) [#630](https://github.com/go-gitea/gitea/pull/630) - * API endpoints for org users [#645](https://github.com/go-gitea/gitea/pull/645) - * Release attachments [#673](https://github.com/go-gitea/gitea/pull/673) - * OAuth2 consumer [#679](https://github.com/go-gitea/gitea/pull/679) - * Add ability to fork your own repos [#761](https://github.com/go-gitea/gitea/pull/761) - * Search repository on dashboard [#773](https://github.com/go-gitea/gitea/pull/773) - * Search bar on user profile [#787](https://github.com/go-gitea/gitea/pull/787) - * Track label changes on issue view [#788](https://github.com/go-gitea/gitea/pull/788) - * Allow using custom time format [#798](https://github.com/go-gitea/gitea/pull/798) - * Redirects for renamed repos [#807](https://github.com/go-gitea/gitea/pull/807) - * Track assignee changes on issue view [#808](https://github.com/go-gitea/gitea/pull/808) - * Track title changes on issue view [#841](https://github.com/go-gitea/gitea/pull/841) - * Archive cleanup action [#885](https://github.com/go-gitea/gitea/pull/885) - * Basic Open Graph support [#901](https://github.com/go-gitea/gitea/pull/901) - * Take back control of Git hooks [#1006](https://github.com/go-gitea/gitea/pull/1006) - * API endpoints for user repos [#1059](https://github.com/go-gitea/gitea/pull/1059) -* BUGFIXES - * Fixed counting issues for issue filters [#413](https://github.com/go-gitea/gitea/pull/413) - * Added back default settings for SSH [#500](https://github.com/go-gitea/gitea/pull/500) - * Fixed repo permissions [#513](https://github.com/go-gitea/gitea/pull/513) - * Issues cannot be created with labels [#622](https://github.com/go-gitea/gitea/pull/622) - * Add a reserved wiki paths check to the wiki [#720](https://github.com/go-gitea/gitea/pull/720) - * Update website binding MaxSize to 255 [#722](https://github.com/go-gitea/gitea/pull/722) - * User can see the private activity on public history [#818](https://github.com/go-gitea/gitea/pull/818) - * Wrong pages number which includes private repositories [#844](https://github.com/go-gitea/gitea/pull/844) - * Trim whitespaces for search keyword [#893](https://github.com/go-gitea/gitea/pull/893) - * Don't rewrite non-gitea public keys [#906](https://github.com/go-gitea/gitea/pull/906) - * Use fingerprint to check instead content for public key [#911](https://github.com/go-gitea/gitea/pull/911) - * Fix random avatars [#1147](https://github.com/go-gitea/gitea/pull/1147) -* ENHANCEMENTS - * Refactored process manager [#75](https://github.com/go-gitea/gitea/pull/75) - * Restrict rights to create new orgs [#193](https://github.com/go-gitea/gitea/pull/193) - * Added label and milestone sorting [#199](https://github.com/go-gitea/gitea/pull/199) - * Make minimum password length configurable [#223](https://github.com/go-gitea/gitea/pull/223) - * Speedup conflict checking on pull requests [#276](https://github.com/go-gitea/gitea/pull/276) - * Added button to delete merged pull request branches [#441](https://github.com/go-gitea/gitea/pull/441) - * Improved issue references within markdown [#471](https://github.com/go-gitea/gitea/pull/471) - * Dutch translation for the landingpage [#487](https://github.com/go-gitea/gitea/pull/487) - * Added Gogs migration script [#532](https://github.com/go-gitea/gitea/pull/532) - * Support a .gitea folder for issue templates [#582](https://github.com/go-gitea/gitea/pull/582) - * Enhanced diff-view coloring [#584](https://github.com/go-gitea/gitea/pull/584) - * Added ETag header to avatars [#721](https://github.com/go-gitea/gitea/pull/721) - * Added option to config to disable local path imports [#724](https://github.com/go-gitea/gitea/pull/724) - * Allow custom public files [#782](https://github.com/go-gitea/gitea/pull/782) - * Added pprof endpoint for debugging [#801](https://github.com/go-gitea/gitea/pull/801) - * Added `X-GitHub-*` headers [#809](https://github.com/go-gitea/gitea/pull/809) - * Fill SSH key title automatically [#863](https://github.com/go-gitea/gitea/pull/863) - * Display Git version on admin panel [#921](https://github.com/go-gitea/gitea/pull/921) - * Expose URL field on issue API [#982](https://github.com/go-gitea/gitea/pull/982) - * Statically compile the binaries [#985](https://github.com/go-gitea/gitea/pull/985) - * Embed build tags into version string [#1051](https://github.com/go-gitea/gitea/pull/1051) - * Gitignore support for FSharp and Clojure [#1072](https://github.com/go-gitea/gitea/pull/1072) - * Custom templates for static builds [#1087](https://github.com/go-gitea/gitea/pull/1087) - * Add ProxyFromEnvironment if none set [#1096](https://github.com/go-gitea/gitea/pull/1096) -* MISC - * Replaced remaining Gogs references - * Added more tests on various packages - * Use Crowdin for translations again - * Resolved some XSS attack vectors - * Optimized and reduced number of database queries - -## [1.0.2](https://github.com/go-gitea/gitea/releases/tag/v1.0.2) - 2017-02-21 - -* BUGFIXES - * Fixed issue counter [#882](https://github.com/go-gitea/gitea/pull/882) - * Fixed XSS vulnerability on wiki page [#955](https://github.com/go-gitea/gitea/pull/955) - * Add data dir without session to dump [#587](https://github.com/go-gitea/gitea/pull/587) - * Fixed wiki page renaming [#958](https://github.com/go-gitea/gitea/pull/958) - * Drop default console logger if not required [#960](https://github.com/go-gitea/gitea/pull/960) - * Fixed docker docs link on install page [#972](https://github.com/go-gitea/gitea/pull/972) - * Handle SetModel errors [#957](https://github.com/go-gitea/gitea/pull/957) - * Fixed XSS vulnerability on milestones [#977](https://github.com/go-gitea/gitea/pull/977) - * Fixed XSS vulnerability on alerts [#981](https://github.com/go-gitea/gitea/pull/981) - -## [1.0.1](https://github.com/go-gitea/gitea/releases/tag/v1.0.1) - 2017-01-05 - -* BUGFIXES - * Fixed localized `MIN_PASSWORD_LENGTH` [#501](https://github.com/go-gitea/gitea/pull/501) - * Fixed 500 error on organization delete [#507](https://github.com/go-gitea/gitea/pull/507) - * Ignore empty wiki repo on migrate [#544](https://github.com/go-gitea/gitea/pull/544) - * Proper check access for forking [#563](https://github.com/go-gitea/gitea/pull/563) - * Fix SSH domain on installer [#506](https://github.com/go-gitea/gitea/pull/506) - * Fix missing data rows on admin UI [#580](https://github.com/go-gitea/gitea/pull/580) - * Do not delete tags with releases by default [#579](https://github.com/go-gitea/gitea/pull/579) - * Fix missing session config data on admin UI [#578](https://github.com/go-gitea/gitea/pull/578) - * Properly show the version within footer on the UI [#593](https://github.com/go-gitea/gitea/pull/593) - -## [1.0.0](https://github.com/go-gitea/gitea/releases/tag/v1.0.0) - 2016-12-23 - -* BREAKING - * We have various changes on the API, scripting against API must be updated -* FEATURES - * Show last login for admins [#121](https://github.com/go-gitea/gitea/pull/121) -* BUGFIXES - * Fixed sender of notifications [#2](https://github.com/go-gitea/gitea/pull/2) - * Fixed keyword hijacking vulnerability [#20](https://github.com/go-gitea/gitea/pull/20) - * Fixed non-markdown readme rendering [#95](https://github.com/go-gitea/gitea/pull/95) - * Allow updating draft releases [#169](https://github.com/go-gitea/gitea/pull/169) - * GitHub API compliance [#227](https://github.com/go-gitea/gitea/pull/227) - * Added commit SHA to tag webhook [#286](https://github.com/go-gitea/gitea/issues/286) - * Secured links via noopener [#315](https://github.com/go-gitea/gitea/issues/315) - * Replace tabs with spaces on wiki title [#371](https://github.com/go-gitea/gitea/pull/371) - * Fixed vulnerability on labels and releases [#409](https://github.com/go-gitea/gitea/pull/409) - * Fixed issue comment API [#449](https://github.com/go-gitea/gitea/pull/449) -* ENHANCEMENTS - * Use proper import path for libravatar [#3](https://github.com/go-gitea/gitea/pull/3) - * Integrated DroneCI for tests and builds [#24](https://github.com/go-gitea/gitea/issues/24) - * Integrated dependency manager [#29](https://github.com/go-gitea/gitea/issues/29) - * Embedded bindata optionally [#30](https://github.com/go-gitea/gitea/issues/30) - * Integrated pagination for releases [#73](https://github.com/go-gitea/gitea/pull/73) - * Autogenerate version on every build [#91](https://github.com/go-gitea/gitea/issues/91) - * Refactored Docker container [#104](https://github.com/go-gitea/gitea/issues/104) - * Added short-hash support for downloads [#211](https://github.com/go-gitea/gitea/issues/211) - * Display tooltip for downloads [#221](https://github.com/go-gitea/gitea/issues/221) - * Improved HTTP headers for issue attachments [#270](https://github.com/go-gitea/gitea/pull/270) - * Integrate public as bindata optionally [#293](https://github.com/go-gitea/gitea/pull/293) - * Integrate templates as bindata optionally [#314](https://github.com/go-gitea/gitea/pull/314) - * Inject more ENV variables into custom hooks [#316](https://github.com/go-gitea/gitea/issues/316) - * Correct LDAP login validation [#342](https://github.com/go-gitea/gitea/pull/342) - * Integrate conf as bindata optionally [#354](https://github.com/go-gitea/gitea/pull/354) - * Serve video files in browser [#418](https://github.com/go-gitea/gitea/pull/418) - * Configurable SSH host binding [#431](https://github.com/go-gitea/gitea/issues/431) -* MISC - * Forked from Gogs and renamed to Gitea - * Catching more errors with logs - * Fixed all linting errors - * Made the go linter entirely happy - * Really integrated vendoring diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 271adbb1da..0000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -public/ -templates/swagger/v1_json.tmpl -themes/ -resources/ - -# Temporary lock file while building -/.hugo_build.lock diff --git a/docs/LICENSE b/docs/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/docs/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index d9aa3b80b8..0000000000 --- a/docs/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Gitea: Docs - -[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea) -[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com") - -These docs are ingested by our [docs repo](https://gitea.com/gitea/gitea-docusaurus). - -## Authors - -* [Maintainers](https://github.com/orgs/go-gitea/people) -* [Contributors](https://github.com/go-gitea/docs/graphs/contributors) - -## License - -This project is under the Apache-2.0 License. See the [LICENSE](LICENSE) file -for the full license text. - -## Copyright - -``` -Copyright (c) 2016 The Gitea Authors <https://gitea.io> -``` diff --git a/docs/README_ZH.md b/docs/README_ZH.md deleted file mode 100644 index 7d9003a8ab..0000000000 --- a/docs/README_ZH.md +++ /dev/null @@ -1,22 +0,0 @@ -# Gitea: 文档 - -[![Build Status](http://drone.gitea.io/api/badges/go-gitea/docs/status.svg)](http://drone.gitea.io/go-gitea/docs) -[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea) -[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com") - -https://gitea.com/gitea/gitea-docusaurus - -## 关于我们 - -* [维护者信息](https://github.com/orgs/go-gitea/people) -* [代码贡献者信息](https://github.com/go-gitea/docs/graphs/contributors) - -## 许可证 - -此项目采用 Apache-2.0 许可协议,请参见 [协议文件](LICENSE) 获取更多信息。 - -## 版权声明 - -``` -Copyright (c) 2016 The Gitea Authors <https://gitea.io> -``` diff --git a/docs/content/actions.en-us.md b/docs/content/actions.en-us.md deleted file mode 100644 index d8e33d3784..0000000000 --- a/docs/content/actions.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2023-04-27T14:00:00+08:00" -title: "Actions" -slug: "actions" -sidebar_position: 36 -toc: false -draft: false -menu: - sidebar: - name: "Usage - Actions" - sidebar_position: 31 - identifier: "actions" ---- diff --git a/docs/content/administration.en-us.md b/docs/content/administration.en-us.md deleted file mode 100644 index 416b9e631e..0000000000 --- a/docs/content/administration.en-us.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Administration" -slug: "administration" -sidebar_position: 30 -toc: false -draft: false -menu: - sidebar: - name: "Administration" - sidebar_position: 20 - collapse: true - identifier: "administration" ---- diff --git a/docs/content/administration.zh-cn.md b/docs/content/administration.zh-cn.md deleted file mode 100644 index 262e5f068f..0000000000 --- a/docs/content/administration.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "运维" -slug: "administration" -sidebar_position: 30 -toc: false -draft: false -menu: - sidebar: - name: "运维" - sidebar_position: 20 - identifier: "administration" ---- diff --git a/docs/content/administration/_index.en-us.md b/docs/content/administration/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/administration/_index.en-us.md +++ /dev/null diff --git a/docs/content/administration/_index.zh-cn.md b/docs/content/administration/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/administration/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/administration/adding-legal-pages.en-us.md b/docs/content/administration/adding-legal-pages.en-us.md deleted file mode 100644 index 1ff0c0132d..0000000000 --- a/docs/content/administration/adding-legal-pages.en-us.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -date: "2019-12-28" -title: "Adding Legal Pages" -slug: adding-legal-pages -sidebar_position: 110 -toc: false -draft: false -aliases: - - /en-us/adding-legal-pages -menu: - sidebar: - parent: "administration" - name: "Adding Legal Pages" - identifier: "adding-legal-pages" - sidebar_position: 110 ---- - -Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Policy) to be added to website. Follow these steps to add them to your Gitea instance. - -## Getting Pages - -Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy: - -``` -wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample -``` - -Now you need to edit the page to meet your requirements. In particular you must change the email addresses, web addresses and references to "Your Gitea Instance" to match your situation. - -You absolutely must not place a general ToS or privacy statement that implies that the Gitea project is responsible for your server. - -## Make it Visible - -Create or append to `/path/to/custom/templates/custom/extra_links_footer.tmpl`: - -```go -<a class="item" href="{{AppSubUrl}}/assets/privacy.html">Privacy Policy</a> -``` - -Restart Gitea to see the changes. diff --git a/docs/content/administration/adding-legal-pages.zh-cn.md b/docs/content/administration/adding-legal-pages.zh-cn.md deleted file mode 100644 index 3e18c6e6b0..0000000000 --- a/docs/content/administration/adding-legal-pages.zh-cn.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "添加法律页面" -slug: adding-legal-pages -sidebar_position: 110 -toc: false -draft: false -aliases: - - /zh-cn/adding-legal-pages -menu: - sidebar: - parent: "administration" - name: "添加法律页面" - identifier: "adding-legal-pages" - sidebar_position: 110 ---- - -一些法域(例如欧盟)要求在网站上添加特定的法律页面(例如隐私政策)。按照以下步骤将它们添加到你的 Gitea 实例中。 - -## 获取页面 - -Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策: - -``` -wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample -``` - -现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。 - -请务必不要放置会暗示 Gitea 项目对你的服务器负责的一般服务条款或隐私声明。 - -## 使其可见 - -创建或追加到 `/path/to/custom/templates/custom/extra_links_footer.tmpl` 文件中: - -```go -<a class="item" href="{{AppSubUrl}}/assets/privacy.html">隐私政策</a> -``` - -重启 Gitea 以查看更改。 diff --git a/docs/content/administration/backup-and-restore.en-us.md b/docs/content/administration/backup-and-restore.en-us.md deleted file mode 100644 index d46efecf99..0000000000 --- a/docs/content/administration/backup-and-restore.en-us.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -date: "2017-01-01T16:00:00+02:00" -title: "Backup and Restore" -slug: "backup-and-restore" -sidebar_position: 11 -toc: false -draft: false -aliases: - - /en-us/backup-and-restore -menu: - sidebar: - parent: "administration" - name: "Backup and Restore" - sidebar_position: 11 - identifier: "backup-and-restore" ---- - -# Backup and Restore - -Gitea currently has a `dump` command that will save the installation to a ZIP file. This -file can be unpacked and used to restore an instance. - -## Backup Consistency - -To ensure the consistency of the Gitea instance, it must be shutdown during backup. - -Gitea consists of a database, files and git repositories, all of which change when it is used. For instance, when a migration is in progress, a transaction is created in the database while the git repository is being copied over. If the backup happens in the middle of the migration, the git repository may be incomplete although the database claims otherwise because it was dumped afterwards. The only way to avoid such race conditions is by stopping the Gitea instance during the backups. - -## Backup Command (`dump`) - -Switch to the user running Gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the Gitea installation -directory. There should be some output similar to the following: - -```none -2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories -2016/12/27 22:32:22 Dumping database... -2016/12/27 22:32:22 Packing dump files... -2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip -``` - -Inside the `gitea-dump-1482906742.zip` file, will be the following: - -- `app.ini` - Optional copy of configuration file if originally stored outside the default `custom/` directory -- `custom/` - All config or customization files in `custom/`. -- `data/` - Data directory (APP_DATA_PATH), except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, SQLite file if you are using SQLite. -- `repos/` - Complete copy of the repository directory. -- `gitea-db.sql` - SQL dump of database -- `log/` - Various logs. They are not needed for a recovery or migration. - -Intermediate backup files are created in a temporary directory specified either with the -`--tempdir` command-line parameter or the `TMPDIR` environment variable. - -## Backup the database - -The SQL dump created by `gitea dump` uses XORM and Gitea admins may prefer to use the native the MySQL and PostgreSQL dump tools instead. There are still open issues when using XORM for dumping the database that may cause problems when attempting to restore it. - -```sh -# mysql -mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql -# postgres -pg_dump -U $USER $DATABASE > gitea-db.sql -``` - -### Using Docker (`dump`) - -There are a few caveats for using the `dump` command with Docker. - -The command has to be executed with the `RUN_USER = <OS_USERNAME>` specified in `gitea/conf/app.ini`; and, for the zipping of the backup folder to occur without permission error the command `docker exec` must be executed inside of the `--tempdir`. - -Example: - -```none -docker exec -u <OS_USERNAME> -it -w <--tempdir> $(docker ps -qf 'name=^<NAME_OF_DOCKER_CONTAINER>$') bash -c '/usr/local/bin/gitea dump -c </path/to/app.ini>' -``` - -\*Note: `--tempdir` refers to the temporary directory of the docker environment used by Gitea; if you have not specified a custom `--tempdir`, then Gitea uses `/tmp` or the `TMPDIR` environment variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly. - -The result should be a file, stored in the `--tempdir` specified, along the lines of: `gitea-dump-1482906742.zip` - -## Restore Command (`restore`) - -There is currently no support for a recovery command. It is a manual process that mostly -involves moving files to their correct locations and restoring a database dump. - -Example: - -```sh -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -mv app.ini /etc/gitea/conf/app.ini -mv data/* /var/lib/gitea/data/ -mv log/* /var/lib/gitea/log/ -mv repos/* /var/lib/gitea/gitea-repositories/ -chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea - -# mysql -mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql -# sqlite3 -sqlite3 $DATABASE_PATH <gitea-db.sql -# postgres -psql -U $USER -d $DATABASE < gitea-db.sql - -service gitea restart -``` - -Repository Git Hooks should be regenerated if installation method is changed (eg. binary -> Docker), or if Gitea is installed to a different directory than the previous installation. - -With Gitea running, and from the directory Gitea's binary is located, execute: `./gitea admin regenerate hooks` - -This ensures that application and configuration file paths in repository Git Hooks are consistent and applicable to the current installation. If these paths are not updated, repository `push` actions will fail. - -### Using Docker (`restore`) - -There is also no support for a recovery command in a Docker-based gitea instance. The restore process contains the same steps as described in the previous section but with different paths. - -Example: - -```sh -# open bash session in container -docker exec --user git -it 2a83b293548e bash -# unzip your backup file within the container -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -# restore the gitea data -mv data/* /data/gitea -# restore the repositories itself -mv repos/* /data/git/gitea-repositories/ -# adjust file permissions -chown -R git:git /data -# Regenerate Git Hooks -/usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks -``` - -The default user in the gitea container is `git` (1000:1000). Please replace `2a83b293548e` with your gitea container id or name. - -### Using Docker-rootless (`restore`) - -The restore workflow in Docker-rootless containers differs only in the directories to be used: - -```sh -# open bash session in container -docker exec --user git -it 2a83b293548e bash -# unzip your backup file within the container -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -# restore the app.ini -mv data/conf/app.ini /etc/gitea/app.ini -# restore the gitea data -mv data/* /var/lib/gitea -# restore the repositories itself -mv repos/* /var/lib/gitea/git/gitea-repositories -# adjust file permissions -chown -R git:git /etc/gitea/app.ini /var/lib/gitea -# Regenerate Git Hooks -/usr/local/bin/gitea -c '/etc/gitea/app.ini' admin regenerate hooks -``` diff --git a/docs/content/administration/backup-and-restore.zh-cn.md b/docs/content/administration/backup-and-restore.zh-cn.md deleted file mode 100644 index 98d378d5dc..0000000000 --- a/docs/content/administration/backup-and-restore.zh-cn.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -date: "2018-06-06T09:33:00+08:00" -title: "备份与恢复" -slug: "backup-and-restore" -sidebar_position: 11 -toc: false -draft: false -aliases: - - /zh-cn/backup-and-restore -menu: - sidebar: - parent: "administration" - name: "备份与恢复" - sidebar_position: 11 - identifier: "backup-and-restore" ---- - -# 备份与恢复 - -Gitea 已经实现了 `dump` 命令可以用来备份所有需要的文件到一个zip压缩文件。该压缩文件可以被用来进行数据恢复。 - -## 备份命令 (`dump`) - -先转到git用户的权限: `su git`. 再Gitea目录运行 `./gitea dump`。一般会显示类似如下的输出: - -``` -2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories -2016/12/27 22:32:22 Dumping database... -2016/12/27 22:32:22 Packing dump files... -2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 -2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip -``` - -最后生成的 `gitea-dump-1482906742.zip` 文件将会包含如下内容: - -* `custom` - 所有保存在 `custom/` 目录下的配置和自定义的文件。 -* `data` - 数据目录下的所有内容不包含使用文件session的文件。该目录包含 `attachments`, `avatars`, `lfs`, `indexers`, 如果使用sqlite 还会包含 sqlite 数据库文件。 -* `gitea-db.sql` - 数据库dump出来的 SQL。 -* `gitea-repo.zip` - Git仓库压缩文件。 -* `log/` - Logs文件,如果用作迁移不是必须的。 - -中间备份文件将会在临时目录进行创建,如果您要重新指定临时目录,可以用 `--tempdir` 参数,或者用 `TMPDIR` 环境变量。 - -## Restore Command (`restore`) - -当前还没有恢复命令,恢复需要人工进行。主要是把文件和数据库进行恢复。 - -例如: - -```sh -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -mv data/conf/app.ini /etc/gitea/conf/app.ini -mv data/* /var/lib/gitea/data/ -mv log/* /var/lib/gitea/log/ -mv repos/* /var/lib/gitea/repositories/ -chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea - -# mysql -mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql -# sqlite3 -sqlite3 $DATABASE_PATH <gitea-db.sql -# postgres -psql -U $USER -d $DATABASE < gitea-db.sql - -service gitea restart -``` diff --git a/docs/content/administration/cmd-embedded.en-us.md b/docs/content/administration/cmd-embedded.en-us.md deleted file mode 100644 index b7f6836144..0000000000 --- a/docs/content/administration/cmd-embedded.en-us.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -date: "2020-01-25T21:00:00-03:00" -title: "Embedded data extraction tool" -slug: "cmd-embedded" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /en-us/cmd-embedded -menu: - sidebar: - parent: "administration" - name: "Embedded data extraction tool" - sidebar_position: 20 - identifier: "cmd-embedded" ---- - -# Embedded data extraction tool - -Gitea's executable contains all the resources required to run: templates, images, style-sheets -and translations. Any of them can be overridden by placing a replacement in a matching path -inside the `custom` directory (see [Customizing Gitea](administration/customizing-gitea.md)). - -To obtain a copy of the embedded resources ready for editing, the `embedded` command from the CLI -can be used from the OS shell interface. - -**NOTE:** The embedded data extraction tool is included in Gitea versions 1.12 and above. - -## Listing resources - -To list resources embedded in Gitea's executable, use the following syntax: - -```sh -gitea embedded list [--include-vendored] [patterns...] -``` - -The `--include-vendored` flag makes the command include vendored files, which are -normally excluded; that is, files from external libraries that are required for Gitea -(e.g. [octicons](https://octicons.github.com/), etc). - -A list of file search patterns can be provided. Gitea uses [gobwas/glob](https://github.com/gobwas/glob) -for its glob syntax. Here are some examples: - -- List all template files, in any virtual directory: `**.tmpl` -- List all mail template files: `templates/mail/**.tmpl` -- List all files inside `public/assets/img`: `public/assets/img/**` - -Don't forget to use quotes for the patterns, as spaces, `*` and other characters might have -a special meaning for your command shell. - -If no pattern is provided, all files are listed. - -### Example: Listing all embedded files - -Listing all embedded files with `openid` in their path: - -```sh -$ gitea embedded list '**openid**' -public/assets/img/auth/openid_connect.svg -public/assets/img/openid-16x16.png -templates/user/auth/finalize_openid.tmpl -templates/user/auth/signin_openid.tmpl -templates/user/auth/signup_openid_connect.tmpl -templates/user/auth/signup_openid_navbar.tmpl -templates/user/auth/signup_openid_register.tmpl -templates/user/settings/security_openid.tmpl -``` - -## Extracting resources - -To extract resources embedded in Gitea's executable, use the following syntax: - -```sh -gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...} -``` - -The `--config` option tells Gitea the location of the `app.ini` configuration file if -it's not in its default location. This option is only used with the `--custom` flag. - -The `--destination` option tells Gitea the directory where the files must be extracted to. -The default is the current directory. - -The `--custom` flag tells Gitea to extract the files directly into the `custom` directory. -For this to work, the command needs to know the location of the `app.ini` configuration -file (`--config`) and, depending of the configuration, be ran from the directory where -Gitea normally starts. See [Customizing Gitea](administration/customizing-gitea.md) for details. - -The `--overwrite` flag allows any existing files in the destination directory to be overwritten. - -The `--rename` flag tells Gitea to rename any existing files in the destination directory -as `filename.bak`. Previous `.bak` files are overwritten. - -At least one file search pattern must be provided; see `list` subcomand above for pattern -syntax and examples. - -### Important notice - -Make sure to **only extract those files that require customization**. Files that -are present in the `custom` directory are not upgraded by Gitea's upgrade process. -When Gitea is upgraded to a new version (by replacing the executable), many of the -embedded files will suffer changes. Gitea will honor and use any files found -in the `custom` directory, even if they are old and incompatible. - -### Example: Extracting mail templates - -Extracting mail templates to a temporary directory: - -```sh -$ mkdir tempdir -$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl' -Extracting to tempdir: -tempdir/templates/mail/auth/activate.tmpl -tempdir/templates/mail/auth/activate_email.tmpl -tempdir/templates/mail/auth/register_notify.tmpl -tempdir/templates/mail/auth/reset_passwd.tmpl -tempdir/templates/mail/issue/assigned.tmpl -tempdir/templates/mail/issue/default.tmpl -tempdir/templates/mail/notify/collaborator.tmpl -``` diff --git a/docs/content/administration/cmd-embedded.zh-cn.md b/docs/content/administration/cmd-embedded.zh-cn.md deleted file mode 100644 index a2df1aa2f5..0000000000 --- a/docs/content/administration/cmd-embedded.zh-cn.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "嵌入资源提取工具" -slug: "cmd-embedded" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/cmd-embedded -menu: - sidebar: - parent: "administration" - name: "嵌入资源提取工具" - sidebar_position: 20 - identifier: "cmd-embedded" ---- - -# 嵌入资源提取工具 - -Gitea 的可执行文件包含了运行所需的所有资源:模板、图片、样式表和翻译文件。你可以通过在 `custom` 目录下的相应路径中放置替换文件来覆盖其中的任何资源(详见 [自定义 Gitea 配置](administration/customizing-gitea.md))。 - -要获取嵌入资源的副本以进行编辑,可以使用 CLI 中的 `embedded` 命令,通过操作系统的 shell 执行。 - -**注意:** 嵌入资源提取工具包含在 Gitea 1.12 及以上版本中。 - -## 资源列表 - -要列出嵌入在 Gitea 可执行文件中的资源,请使用以下语法: - -```sh -gitea embedded list [--include-vendored] [patterns...] -``` - -`--include-vendored` 标志使命令包括被供应的文件,这些文件通常被排除在外;即来自外部库的文件,这些文件是 Gitea 所需的(例如 [octicons](https://octicons.github.com/) 等)。 - -可以提供一系列文件搜索模式。Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作为其 glob 语法。以下是一些示例: - -- 列出所有模板文件,无论在哪个虚拟目录下:`**.tmpl` -- 列出所有邮件模板文件:`templates/mail/**.tmpl` -列出 `public/assets/img` 目录下的所有文件:`public/assets/img/**` - -不要忘记为模式使用引号,因为空格、`*` 和其他字符可能对命令行解释器有特殊含义。 - -如果未提供模式,则列出所有文件。 - -### 示例:列出所有嵌入文件 - -列出所有路径中包含 `openid` 的嵌入文件: - -```sh -$ gitea embedded list '**openid**' -public/assets/img/auth/openid_connect.svg -public/assets/img/openid-16x16.png -templates/user/auth/finalize_openid.tmpl -templates/user/auth/signin_openid.tmpl -templates/user/auth/signup_openid_connect.tmpl -templates/user/auth/signup_openid_navbar.tmpl -templates/user/auth/signup_openid_register.tmpl -templates/user/settings/security_openid.tmpl -``` - -## 提取资源 - -要提取嵌入在 Gitea 可执行文件中的资源,请使用以下语法: - -```sh -gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...} -``` - -`--config` 选项用于告知 Gitea `app.ini` 配置文件的位置(如果不在默认位置)。此选项仅在使用 `--custom` 标志时使用。 - -`--destination` 选项用于指定提取文件的目标目录。默认为当前目录。 - -`--custom` 标志告知 Gitea 直接将文件提取到 `custom` 目录中。为使其正常工作,该命令需要知道 `app.ini` 配置文件的位置(通过 `--config` 指定),并且根据配置的不同,需要从 Gitea 通常启动的目录运行。有关详细信息,请参阅 [自定义 Gitea 配置](administration/customizing-gitea.md)。 - -`--overwrite` 标志允许覆盖目标目录中的任何现有文件。 - -`--rename` 标志告知 Gitea 将目标目录中的任何现有文件重命名为 `filename.bak`。之前的 `.bak` 文件将被覆盖。 - -至少需要提供一个文件搜索模式;有关模式的语法和示例,请参阅上述 `list` 子命令。 - -### 重要提示 - -请确保**只提取需要自定义的文件**。位于 `custom` 目录中的文件不会受到 Gitea 的升级过程的影响。当 Gitea 升级到新版本(通过替换可执行文件)时,许多嵌入文件将发生变化。Gitea 将尊重并使用在 `custom` 目录中找到的任何文件,即使这些文件是旧的和不兼容的。 - -### 示例:提取邮件模板 - -将邮件模板提取到临时目录: - -```sh -$ mkdir tempdir -$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl' -Extracting to tempdir: -tempdir/templates/mail/auth/activate.tmpl -tempdir/templates/mail/auth/activate_email.tmpl -tempdir/templates/mail/auth/register_notify.tmpl -tempdir/templates/mail/auth/reset_passwd.tmpl -tempdir/templates/mail/issue/assigned.tmpl -tempdir/templates/mail/issue/default.tmpl -tempdir/templates/mail/notify/collaborator.tmpl -``` diff --git a/docs/content/administration/command-line.en-us.md b/docs/content/administration/command-line.en-us.md deleted file mode 100644 index 5049df35e0..0000000000 --- a/docs/content/administration/command-line.en-us.md +++ /dev/null @@ -1,572 +0,0 @@ ---- -date: "2017-01-01T16:00:00+02:00" -title: "Gitea Command Line" -slug: "command-line" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /en-us/command-line -menu: - sidebar: - parent: "administration" - name: "Command Line" - sidebar_position: 1 - identifier: "command-line" ---- - -# Command Line - -## Usage - -`gitea [global options] command [command or global options] [arguments...]` - -## Global options - -All global options can be placed at the command level. - -- `--help`, `-h`: Show help text and exit. Optional. -- `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`). -- `--work-path path`, `-w path`: Gitea's work path. Optional. (default: the binary's path or `$GITEA_WORK_DIR`) -- `--custom-path path`, `-C path`: Gitea's custom folder path. Optional. (default: `WorkPath`/custom or `$GITEA_CUSTOM`). -- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: `CustomPath`/conf/app.ini). - -NB: The defaults custom-path, config and work-path can also be -changed at build time (if preferred). - -## Commands - -### web - -Starts the server: - -- Options: - - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file. - - `--install-port number`: Port number to run the install page on. Optional. (default: 3000). Overrides configuration file. - - `--pid path`, `-P path`: Pidfile path. Optional. - - `--quiet`, `-q`: Only emit Fatal logs on the console for logs emitted before logging set up. - - `--verbose`: Emit tracing logs on the console for logs emitted before logging is set-up. -- Examples: - - `gitea web` - - `gitea web --port 80` - - `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid` -- Notes: - - Gitea should not be run as root. To bind to a port below 1024, you can use setcap on - Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be - redone every time you update Gitea. - -### admin - -Admin operations: - -- Commands: - - `user`: - - `list`: - - Options: - - `--admin`: List only admin users. Optional. - - Description: lists all users that exist - - Examples: - - `gitea admin user list` - - `delete`: - - Options: - - `--email`: Email of the user to be deleted. - - `--username`: Username of user to be deleted. - - `--id`: ID of user to be deleted. - - One of `--id`, `--username` or `--email` is required. If more than one is provided then all have to match. - - Examples: - - `gitea admin user delete --id 1` - - `create`: - - Options: - - `--name value`: Username. Required. As of Gitea 1.9.0, use the `--username` flag instead. - - `--username value`: Username. Required. New in Gitea 1.9.0. - - `--password value`: Password. Required. - - `--email value`: Email. Required. - - `--admin`: If provided, this makes the user an admin. Optional. - - `--access-token`: If provided, an access token will be created for the user. Optional. (default: false). - - `--must-change-password`: If provided, the created user will be required to choose a newer password after the - initial login. Optional. (default: true). - - `--random-password`: If provided, a randomly generated password will be used as the password of the created - user. The value of `--password` will be discarded. Optional. - - `--random-password-length`: If provided, it will be used to configure the length of the randomly generated - password. Optional. (default: 12) - - Examples: - - `gitea admin user create --username myname --password asecurepassword --email me@example.com` - - `change-password`: - - Options: - - `--username value`, `-u value`: Username. Required. - - `--password value`, `-p value`: New password. Required. - - `--must-change-password`: If provided, the user is required to choose a new password after the login. Optional. - - Examples: - - `gitea admin user change-password --username myname --password asecurepassword` - - `must-change-password`: - - Args: - - `[username...]`: Users that must change their passwords - - Options: - - `--all`, `-A`: Force a password change for all users - - `--exclude username`, `-e username`: Exclude the given user. Can be set multiple times. - - `--unset`: Revoke forced password change for the given users - - `generate-access-token`: - - Options: - - `--username value`, `-u value`: Username. Required. - - `--token-name value`, `-t value`: Token name. Required. - - `--scopes value`: Comma-separated list of scopes. Scopes follow the format `[read|write]:<block>` or `all` where `<block>` is one of the available visual groups you can see when opening the API page showing the available routes (for example `repo`). - - Examples: - - `gitea admin user generate-access-token --username myname --token-name mytoken` - - `gitea admin user generate-access-token --help` - - `regenerate` - - Options: - - `hooks`: Regenerate Git Hooks for all repositories - - `keys`: Regenerate authorized_keys file - - Examples: - - `gitea admin regenerate hooks` - - `gitea admin regenerate keys` - - `auth`: - - `list`: - - Description: lists all external authentication sources that exist - - Examples: - - `gitea admin auth list` - - `delete`: - - Options: - - `--id`: ID of source to be deleted. Required. - - Examples: - - `gitea admin auth delete --id 1` - - `add-oauth`: - - Options: - - `--name`: Application Name. - - `--provider`: OAuth2 Provider. - - `--key`: Client ID (Key). - - `--secret`: Client Secret. - - `--auto-discover-url`: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider). - - `--use-custom-urls`: Use custom URLs for GitLab/GitHub OAuth endpoints. - - `--custom-tenant-id`: Use custom Tenant ID for OAuth endpoints. - - `--custom-auth-url`: Use a custom Authorization URL (option for GitLab/GitHub). - - `--custom-token-url`: Use a custom Token URL (option for GitLab/GitHub). - - `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub). - - `--custom-email-url`: Use a custom Email URL (option for GitHub). - - `--icon-url`: Custom icon URL for OAuth2 login source. - - `--skip-local-2fa`: Allow source to override local 2FA. (Optional) - - `--scopes`: Additional scopes to request for this OAuth2 source. (Optional) - - `--required-claim-name`: Claim name that has to be set to allow users to login with this source. (Optional) - - `--required-claim-value`: Claim value that has to be set to allow users to login with this source. (Optional) - - `--group-claim-name`: Claim name providing group names for this source. (Optional) - - `--admin-group`: Group Claim value for administrator users. (Optional) - - `--restricted-group`: Group Claim value for restricted users. (Optional) - - `--group-team-map`: JSON mapping between groups and org teams. (Optional) - - `--group-team-map-removal`: Activate automatic team membership removal depending on groups. (Optional) - - Examples: - - `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE` - - `update-oauth`: - - Options: - - `--id`: ID of source to be updated. Required. - - `--name`: Application Name. - - `--provider`: OAuth2 Provider. - - `--key`: Client ID (Key). - - `--secret`: Client Secret. - - `--auto-discover-url`: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider). - - `--use-custom-urls`: Use custom URLs for GitLab/GitHub OAuth endpoints. - - `--custom-tenant-id`: Use custom Tenant ID for OAuth endpoints. - - `--custom-auth-url`: Use a custom Authorization URL (option for GitLab/GitHub). - - `--custom-token-url`: Use a custom Token URL (option for GitLab/GitHub). - - `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub). - - `--custom-email-url`: Use a custom Email URL (option for GitHub). - - `--icon-url`: Custom icon URL for OAuth2 login source. - - `--skip-local-2fa`: Allow source to override local 2FA. (Optional) - - `--scopes`: Additional scopes to request for this OAuth2 source. - - `--required-claim-name`: Claim name that has to be set to allow users to login with this source. (Optional) - - `--required-claim-value`: Claim value that has to be set to allow users to login with this source. (Optional) - - `--group-claim-name`: Claim name providing group names for this source. (Optional) - - `--admin-group`: Group Claim value for administrator users. (Optional) - - `--restricted-group`: Group Claim value for restricted users. (Optional) - - Examples: - - `gitea admin auth update-oauth --id 1 --name external-github-updated` - - `add-smtp`: - - Options: - - `--name`: Application Name. Required. - - `--auth-type`: SMTP Authentication Type (PLAIN/LOGIN/CRAM-MD5). Default to PLAIN. - - `--host`: SMTP host. Required. - - `--port`: SMTP port. Required. - - `--force-smtps`: SMTPS is always used on port 465. Set this to force SMTPS on other ports. - - `--skip-verify`: Skip TLS verify. - - `--helo-hostname`: Hostname sent with HELO. Leave blank to send current hostname. - - `--disable-helo`: Disable SMTP helo. - - `--allowed-domains`: Leave empty to allow all domains. Separate multiple domains with a comma (','). - - `--skip-local-2fa`: Skip 2FA to log on. - - `--active`: This Authentication Source is Activated. - Remarks: - `--force-smtps`, `--skip-verify`, `--disable-helo`, `--skip-loca-2fs` and `--active` options can be used in form: - - `--option`, `--option=true` to enable - - `--option=false` to disable - If those options are not specified value would not be changed in `update-smtp` or would use default `false` value in `add-smtp` - - Examples: - - `gitea admin auth add-smtp --name ldap --host smtp.mydomain.org --port 587 --skip-verify --active` - - `update-smtp`: - - Options: - - `--id`: ID of source to be updated. Required. - - other options are shared with `add-smtp` - - Examples: - - `gitea admin auth update-smtp --id 1 --host smtp.mydomain.org --port 587 --skip-verify=false` - - `gitea admin auth update-smtp --id 1 --active=false` - - `add-ldap`: Add new LDAP (via Bind DN) authentication source - - Options: - - `--name value`: Authentication name. Required. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. Required. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. Required. - - `--port value`: The port to use when connecting to the LDAP server. Required. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. Required. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--avatar-attribute value`: The attribute of the user’s LDAP record containing the user’s avatar. - - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. - - `--bind-password value`: The password for the Bind DN, if any. - - `--attributes-in-bind`: Fetch attributes in bind DN context. - - `--synchronize-users`: Enable user synchronization. - - `--page-size value`: Search page size. - - Examples: - - `gitea admin auth add-ldap --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-search-base "ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" --email-attribute mail` - - `update-ldap`: Update existing LDAP (via Bind DN) authentication source - - Options: - - `--id value`: ID of authentication source. Required. - - `--name value`: Authentication name. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. - - `--port value`: The port to use when connecting to the LDAP server. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--avatar-attribute value`: The attribute of the user’s LDAP record containing the user’s avatar. - - `--bind-dn value`: The DN to bind to the LDAP server with when searching for the user. - - `--bind-password value`: The password for the Bind DN, if any. - - `--attributes-in-bind`: Fetch attributes in bind DN context. - - `--synchronize-users`: Enable user synchronization. - - `--page-size value`: Search page size. - - Examples: - - `gitea admin auth update-ldap --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` - - `add-ldap-simple`: Add new LDAP (simple auth) authentication source - - Options: - - `--name value`: Authentication name. Required. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. Required. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. Required. - - `--port value`: The port to use when connecting to the LDAP server. Required. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. Required. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. Required. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--avatar-attribute value`: The attribute of the user’s LDAP record containing the user’s avatar. - - `--user-dn value`: The user’s DN. Required. - - Examples: - - `gitea admin auth add-ldap-simple --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-dn "cn=%s,ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(cn=%s))" --email-attribute mail` - - `update-ldap-simple`: Update existing LDAP (simple auth) authentication source - - Options: - - `--id value`: ID of authentication source. Required. - - `--name value`: Authentication name. - - `--not-active`: Deactivate the authentication source. - - `--security-protocol value`: Security protocol name. - - `--skip-tls-verify`: Disable TLS verification. - - `--host value`: The address where the LDAP server can be reached. - - `--port value`: The port to use when connecting to the LDAP server. - - `--user-search-base value`: The LDAP base at which user accounts will be searched for. - - `--user-filter value`: An LDAP filter declaring how to find the user record that is attempting to authenticate. - - `--admin-filter value`: An LDAP filter specifying if a user should be given administrator privileges. - - `--restricted-filter value`: An LDAP filter specifying if a user should be given restricted status. - - `--username-attribute value`: The attribute of the user’s LDAP record containing the user name. - - `--firstname-attribute value`: The attribute of the user’s LDAP record containing the user’s first name. - - `--surname-attribute value`: The attribute of the user’s LDAP record containing the user’s surname. - - `--email-attribute value`: The attribute of the user’s LDAP record containing the user’s email address. - - `--public-ssh-key-attribute value`: The attribute of the user’s LDAP record containing the user’s public ssh key. - - `--avatar-attribute value`: The attribute of the user’s LDAP record containing the user’s avatar. - - `--user-dn value`: The user’s DN. - - Examples: - - `gitea admin auth update-ldap-simple --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap-simple --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` - -### cert - -Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current -directory and will overwrite any existing files. - -- Options: - - `--host value`: Comma separated hostnames and ips which this certificate is valid for. - Wildcards are supported. Required. - - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options - are P224, P256, P384, P521. - - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is - set. (default: 3072). - - `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`). - - `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s) - - `--ca`: If provided, this cert generates it's own certificate authority. Optional. -- Examples: - - `gitea cert --host git.example.com,example.com,www.example.com --ca` - -### dump - -Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` -in the current directory. - -- Options: - - `--file name`, `-f name`: Name of the dump file with will be created. Optional. (default: gitea-dump-[timestamp].zip). - - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp). - - `--skip-repository`, `-R`: Skip the repository dumping. Optional. - - `--skip-custom-dir`: Skip dumping of the custom dir. Optional. - - `--skip-lfs-data`: Skip dumping of LFS data. Optional. - - `--skip-attachment-data`: Skip dumping of attachment data. Optional. - - `--skip-package-data`: Skip dumping of package data. Optional. - - `--skip-log`: Skip dumping of log data. Optional. - - `--database`, `-d`: Specify the database SQL syntax. Optional (supported arguments: sqlite3, mysql, mssql, postgres). - - `--verbose`, `-V`: If provided, shows additional details. Optional. - - `--type`: Set the dump output format. Optional. (formats: zip, tar, tar.sz, tar.gz, tar.xz, tar.bz2, tar.br, tar.lz4, tar.zst default: zip). -- Examples: - - `gitea dump` - - `gitea dump --verbose` - -### generate - -Generates random values and tokens for usage in configuration file. Useful for generating values -for automatic deployments. - -- Commands: - - `secret`: - - Options: - - `INTERNAL_TOKEN`: Token used for an internal API call authentication. - - `JWT_SECRET`: LFS & OAUTH2 JWT authentication secret (LFS_JWT_SECRET is aliased to this option for backwards compatibility). - - `SECRET_KEY`: Global secret key. - - Examples: - - `gitea generate secret INTERNAL_TOKEN` - - `gitea generate secret JWT_SECRET` - - `gitea generate secret SECRET_KEY` - -### keys - -Provides an SSHD AuthorizedKeysCommand. Needs to be configured in the sshd config file: - -```ini -... -# The value of -e and the AuthorizedKeysCommandUser should match the -# username running Gitea -AuthorizedKeysCommandUser git -AuthorizedKeysCommand /path/to/gitea keys -e git -u %u -t %t -k %k -``` - -The command will return the appropriate authorized_keys line for the -provided key. You should also set the value -`SSH_CREATE_AUTHORIZED_KEYS_FILE=false` in the `[server]` section of -`app.ini`. - -NB: opensshd requires the Gitea program to be owned by root and not -writable by group or others. The program must be specified by an absolute -path. -NB: Gitea must be running for this command to succeed. - -### migrate - -Migrates the database. This command can be used to run other commands before starting the server for the first time. -This command is idempotent. - -### doctor check - -Diagnose and potentially fix problems with the current Gitea instance. -Several checks are run by default, but additional ones can be run: - -- `gitea doctor check --list` - will list all the available checks -- `gitea doctor check --all` - will run all available checks -- `gitea doctor check --default` - will run the default checks -- `gitea doctor check --run [check(s),]...` - will run the named checks - -Some problems can be automatically fixed by passing the `--fix` option. -Extra logging can be set with `--log-file=...`. - -#### doctor recreate-table - -Sometimes when there are migrations the old columns and default values may be left -unchanged in the database schema. This may lead to warning such as: - -``` -2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0 -``` - -You can cause Gitea to recreate these tables and copy the old data into the new table -with the defaults set appropriately by using: - -``` -gitea doctor recreate-table user -``` - -You can ask Gitea to recreate multiple tables using: - -``` -gitea doctor recreate-table table1 table2 ... -``` - -And if you would like Gitea to recreate all tables simply call: - -``` -gitea doctor recreate-table -``` - -It is highly recommended to back-up your database before running these commands. - -### doctor convert - -Converts a MySQL database from utf8 to utf8mb4 or a MSSQL database from varchar to nvarchar. - -### manager - -Manage running server operations: - -- Commands: - - `shutdown`: Gracefully shutdown the running process - - `restart`: Gracefully restart the running process - (not implemented for windows servers) - - `flush-queues`: Flush queues in the running process - - Options: - - `--timeout value`: Timeout for the flushing process (default: 1m0s) - - `--non-blocking`: Set to true to not wait for flush to complete before returning - - `logging`: Adjust logging commands - - Commands: - - `pause`: Pause logging - - Notes: - - The logging level will be raised to INFO temporarily if it is below this level. - - Gitea will buffer logs up to a certain point and will drop them after that point. - - `resume`: Resume logging - - `release-and-reopen`: Cause Gitea to release and re-open files and connections used for logging (Equivalent to sending SIGUSR1 to Gitea.) - - `remove name`: Remove the named logger - - Options: - - `--group group`, `-g group`: Set the group to remove the sublogger from. (defaults to `default`) - - `add`: Add a logger - - Commands: - - `console`: Add a console logger - - Options: - - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode - - `--level value`, `-l value`: Logging level for the new logger - - `--stacktrace-level value`, `-L value`: Stacktrace logging level - - `--flags value`, `-F value`: Flags for the logger - - `--expression value`, `-e value`: Matching expression for the logger - - `--prefix value`, `-p value`: Prefix for the logger - - `--color`: Use color in the logs - - `--stderr`: Output console logs to stderr - only relevant for console - - `file`: Add a file logger - - Options: - - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode - - `--level value`, `-l value`: Logging level for the new logger - - `--stacktrace-level value`, `-L value`: Stacktrace logging level - - `--flags value`, `-F value`: Flags for the logger - - `--expression value`, `-e value`: Matching expression for the logger - - `--prefix value`, `-p value`: Prefix for the logger - - `--color`: Use color in the logs - - `--filename value`, `-f value`: Filename for the logger - - - `--rotate`, `-r`: Rotate logs - - `--max-size value`, `-s value`: Maximum size in bytes before rotation - - `--daily`, `-d`: Rotate logs daily - - `--max-days value`, `-D value`: Maximum number of daily logs to keep - - `--compress`, `-z`: Compress rotated logs - - `--compression-level value`, `-Z value`: Compression level to use - - `conn`: Add a network connection logger - - Options: - - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode - - `--level value`, `-l value`: Logging level for the new logger - - `--stacktrace-level value`, `-L value`: Stacktrace logging level - - `--flags value`, `-F value`: Flags for the logger - - `--expression value`, `-e value`: Matching expression for the logger - - `--prefix value`, `-p value`: Prefix for the logger - - `--color`: Use color in the logs - - `--reconnect-on-message`, `-R`: Reconnect to host for every message - - `--reconnect`, `-r`: Reconnect to host when connection is dropped - - `--protocol value`, `-P value`: Set protocol to use: tcp, unix, or udp (defaults to tcp) - - `--address value`, `-a value`: Host address and port to connect to (defaults to :7020) - - `smtp`: Add an SMTP logger - - Options: - - `--group value`, `-g value`: Group to add logger to - will default to "default" - - `--name value`, `-n value`: Name of the new logger - will default to mode - - `--level value`, `-l value`: Logging level for the new logger - - `--stacktrace-level value`, `-L value`: Stacktrace logging level - - `--flags value`, `-F value`: Flags for the logger - - `--expression value`, `-e value`: Matching expression for the logger - - `--prefix value`, `-p value`: Prefix for the logger - - `--color`: Use color in the logs - - `--username value`, `-u value`: Mail server username - - `--password value`, `-P value`: Mail server password - - `--host value`, `-H value`: Mail server host (defaults to: 127.0.0.1:25) - - `--send-to value`, `-s value`: Email address(es) to send to - - `--subject value`, `-S value`: Subject header of sent emails - - `processes`: Display Gitea processes and goroutine information - - Options: - - `--flat`: Show processes as flat table rather than as tree - - `--no-system`: Do not show system processes - - `--stacktraces`: Show stacktraces for goroutines associated with processes - - `--json`: Output as json - - `--cancel PID`: Send cancel to process with PID. (Only for non-system processes.) - -### dump-repo - -Dump-repo dumps repository data from Git/GitHub/Gitea/GitLab: - -- Options: - - `--git_service service` : Git service, it could be `git`, `github`, `gitea`, `gitlab`, If clone_addr could be recognized, this could be ignored. - - `--repo_dir dir`, `-r dir`: Repository dir path to store the data - - `--clone_addr addr`: The URL will be clone, currently could be a git/github/gitea/gitlab http/https URL. i.e. https://github.com/lunny/tango.git - - `--auth_username lunny`: The username to visit the clone_addr - - `--auth_password <password>`: The password to visit the clone_addr - - `--auth_token <token>`: The personal token to visit the clone_addr - - `--owner_name lunny`: The data will be stored on a directory with owner name if not empty - - `--repo_name tango`: The data will be stored on a directory with repository name if not empty - - `--units <units>`: Which items will be migrated, one or more units should be separated as comma. wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units. - -### restore-repo - -Restore-repo restore repository data from disk dir: - -- Options: - - `--repo_dir dir`, `-r dir`: Repository dir path to restore from - - `--owner_name lunny`: Restore destination owner name - - `--repo_name tango`: Restore destination repository name - - `--units <units>`: Which items will be restored, one or more units should be separated as comma. wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units. - -### actions generate-runner-token - -Generate a new token for a runner to use to register with the server - -- Options: - - `--scope {owner}[/{repo}]`, `-s {owner}[/{repo}]`: To limit the scope of the runner, no scope means the runner can be used for all repos, but you can also limit it to a specific repo or owner - -To register a global runner: - -``` -gitea actions generate-runner-token -``` - -To register a runner for a specific organization, in this case `org`: - -``` -gitea actions generate-runner-token -s org -``` - -To register a runner for a specific repo, in this case `username/test-repo`: - -``` -gitea actions generate-runner-token -s username/test-repo -``` diff --git a/docs/content/administration/command-line.zh-cn.md b/docs/content/administration/command-line.zh-cn.md deleted file mode 100644 index 6e6bcb6082..0000000000 --- a/docs/content/administration/command-line.zh-cn.md +++ /dev/null @@ -1,542 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "Gitea 命令行" -slug: "command-line" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /zh-cn/command-line -menu: - sidebar: - parent: "administration" - name: "Gitea 命令行" - sidebar_position: 1 - identifier: "command-line" ---- - -# 命令行 - -## 用法 - -`gitea [全局选项] 命令 [命令或全局选项] [参数...]` - -## 全局选项 - -所有全局选项均可被放置在命令级别。 - -- `--help`,`-h`:显示帮助文本并退出。可选。 -- `--version`,`-v`:显示版本信息并退出。可选。 (示例:`Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`)。 -- `--custom-path path`,`-C path`:Gitea 自定义文件夹的路径。可选。 (默认值:`AppWorkPath`/custom 或 `$GITEA_CUSTOM`)。 -- `--config path`,`-c path`:Gitea 配置文件的路径。可选。 (默认值:`custom`/conf/app.ini)。 -- `--work-path path`,`-w path`:Gitea 的 `AppWorkPath`。可选。 (默认值:LOCATION_OF_GITEA_BINARY 或 `$GITEA_WORK_DIR`) - -注意:默认的 custom-path、config 和 work-path 也可以在构建时更改(如果需要)。 - -## 命令 - -### web - -启动服务器: - -- 选项: - - `--port number`,`-p number`:端口号。可选。 (默认值:3000)。覆盖配置文件中的设置。 - - `--install-port number`:运行安装页面的端口号。可选。 (默认值:3000)。覆盖配置文件中的设置。 - - `--pid path`,`-P path`:Pid 文件的路径。可选。 - - `--quiet`,`-q`:只在控制台上输出 Fatal 日志,用于在设置日志之前发出的日志。 - - `--verbose`:在控制台上输出跟踪日志,用于在设置日志之前发出的日志。 -- 示例: - - `gitea web` - - `gitea web --port 80` - - `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid` -- 注意: - - Gitea 不应以 root 用户身份运行。要绑定到低于 1024 的端口,您可以在 Linux 上使用 setcap 命令:`sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`。每次更新 Gitea 都需要重新执行此操作。 - -### admin - -管理员操作: - -- 命令: - - `user`: - - `list`: - - 选项: - - `--admin`:仅列出管理员用户。可选。 - - 描述:列出所有现有用户。 - - 示例: - - `gitea admin user list` - - `delete`: - - 选项: - - `--email`:要删除的用户的电子邮件。 - - `--username`:要删除的用户的用户名。 - - `--id`:要删除的用户的ID。 - - 必须提供 `--id`、`--username` 或 `--email` 中的一个。如果提供多个,则所有条件必须匹配。 - - 示例: - - `gitea admin user delete --id 1` - - `create`: - - 选项: - - `--name value`:用户名。必填。自 Gitea 1.9.0 版本起,请改用 `--username` 标志。 - - `--username value`:用户名。必填。Gitea 1.9.0 新增。 - - `--password value`:密码。必填。 - - `--email value`:邮箱。必填。 - - `--admin`:如果提供此选项,将创建一个管理员用户。可选。 - - `--access-token`:如果提供,将为用户创建访问令牌。可选。(默认值:false)。 - - `--must-change-password`:如果提供,创建的用户将在初始登录后需要选择一个新密码。可选。(默认值:true)。 - - `--random-password`:如果提供,将使用随机生成的密码作为创建用户的密码。`--password` 的值将被忽略。可选。 - - `--random-password-length`:如果提供,将用于配置随机生成密码的长度。可选。(默认值:12) - - 示例: - - `gitea admin user create --username myname --password asecurepassword --email me@example.com` - - `change-password`: - - 选项: - - `--username value`,`-u value`:用户名。必填。 - - `--password value`,`-p value`:新密码。必填。 - - 示例: - - `gitea admin user change-password --username myname --password asecurepassword` - - `must-change-password`: - - 参数: - - `[username...]`:需要更改密码的用户 - - 选项: - - `--all`,`-A`:强制所有用户更改密码 - - `--exclude username`,`-e username`:排除给定的用户。可以多次设置。 - - `--unset`:撤销对给定用户的强制密码更改 - - `regenerate`: - - 选项: - - `hooks`:重新生成所有仓库的 Git Hooks。 - - `keys`:重新生成 authorized_keys 文件。 - - 示例: - - `gitea admin regenerate hooks` - - `gitea admin regenerate keys` - - `auth`: - - `list`: - - 描述:列出所有存在的外部认证源。 - - 示例: - - `gitea admin auth list` - - `delete`: - - 选项: - - `--id`:要删除的源的 ID。必填。 - - 示例: - - `gitea admin auth delete --id 1` - - `add-oauth`: - - 选项: - - `--name`:应用程序名称。 - - `--provider`:OAuth2 提供者。 - - `--key`:客户端 ID(Key)。 - - `--secret`:客户端密钥。 - - `--auto-discover-url`:OpenID Connect 自动发现 URL(仅在使用 OpenID Connect 作为提供程序时需要)。 - - `--use-custom-urls`:在 GitLab/GitHub OAuth 端点上使用自定义 URL。 - - `--custom-tenant-id`:在 OAuth 端点上使用自定义租户 ID。 - - `--custom-auth-url`:使用自定义授权 URL(GitLab/GitHub 的选项)。 - - `--custom-token-url`:使用自定义令牌 URL(GitLab/GitHub 的选项)。 - - `--custom-profile-url`:使用自定义配置文件 URL(GitLab/GitHub 的选项)。 - - `--custom-email-url`:使用自定义电子邮件 URL(GitHub 的选项)。 - - `--icon-url`:OAuth2 登录源的自定义图标 URL。 - - `--skip-local-2fa`:允许源覆盖本地 2FA。(可选) - - `--scopes`:请求此 OAuth2 源的附加范围。(可选) - - `--required-claim-name`:必须设置的声明名称,以允许用户使用此源登录。(可选) - - `--required-claim-value`:必须设置的声明值,以允许用户使用此源登录。(可选) - - `--group-claim-name`:提供此源的组名的声明名称。(可选) - - `--admin-group`:管理员用户的组声明值。(可选) - - `--restricted-group`:受限用户的组声明值。(可选) - - `--group-team-map`:组与组织团队之间的 JSON 映射。(可选) - - `--group-team-map-removal`:根据组自动激活团队成员资格的删除。(可选) - - 示例: - - `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE` - - `update-oauth`: - - 选项: - - `--id`:要更新的源的 ID。必填。 - - `--name`:应用程序名称。 - - `--provider`:OAuth2 提供者。 - - `--key`:客户端 ID(Key)。 - - `--secret`:客户端密钥。 - - `--auto-discover-url`:OpenID Connect 自动发现 URL(仅在使用 OpenID Connect 作为提供程序时需要)。 - - `--use-custom-urls`:在 GitLab/GitHub OAuth 端点上使用自定义 URL。 - - `--custom-tenant-id`:在 OAuth 端点上使用自定义租户 ID。 - - `--custom-auth-url`:使用自定义授权 URL(GitLab/GitHub 的选项)。 - - `--custom-token-url`:使用自定义令牌 URL(GitLab/GitHub 的选项)。 - - `--custom-profile-url`:使用自定义配置文件 URL(GitLab/GitHub 的选项)。 - - `--custom-email-url`:使用自定义电子邮件 URL(GitHub 的选项)。 - - `--icon-url`:OAuth2 登录源的自定义图标 URL。 - - `--skip-local-2fa`:允许源覆盖本地 2FA。(可选) - - `--scopes`:请求此 OAuth2 源的附加范围。 - - `--required-claim-name`:必须设置的声明名称,以允许用户使用此源登录。(可选) - - `--required-claim-value`:必须设置的声明值,以允许用户使用此源登录。(可选) - - `--group-claim-name`:提供此源的组名的声明名称。(可选) - - `--admin-group`:管理员用户的组声明值。(可选) - - `--restricted-group`:受限用户的组声明值。(可选) - - 示例: - - `gitea admin auth update-oauth --id 1 --name external-github-updated` - - `add-smtp`: - - 选项: - - `--name`:应用程序名称。必填。 - - `--auth-type`:SMTP 认证类型(PLAIN/LOGIN/CRAM-MD5)。默认为 PLAIN。 - - `--host`:SMTP 主机。必填。 - - `--port`:SMTP 端口。必填。 - - `--force-smtps`:SMTPS 始终在端口 465 上使用。设置此选项以强制在其他端口上使用 SMTPS。 - - `--skip-verify`:跳过 TLS 验证。 - - `--helo-hostname`:发送 HELO 时使用的主机名。留空以发送当前主机名。 - - `--disable-helo`:禁用 SMTP helo。 - - `--allowed-domains`:留空以允许所有域。使用逗号(',')分隔多个域。 - - `--skip-local-2fa`:跳过 2FA 登录。 - - `--active`:启用此认证源。 - 备注: - `--force-smtps`、`--skip-verify`、`--disable-helo`、`--skip-local-2fs` 和 `--active` 选项可以采用以下形式使用: - - `--option`、`--option=true` 以启用选项 - - `--option=false` 以禁用选项 - 如果未指定这些选项,则在 `update-smtp` 中不会更改值,或者在 `add-smtp` 中将使用默认的 `false` 值。 - - 示例: - - `gitea admin auth add-smtp --name ldap --host smtp.mydomain.org --port 587 --skip-verify --active` - - `update-smtp`: - - 选项: - - `--id`:要更新的源的 ID。必填。 - - 其他选项与 `add-smtp` 共享 - - 示例: - - `gitea admin auth update-smtp --id 1 --host smtp.mydomain.org --port 587 --skip-verify=false` - - `gitea admin auth update-smtp --id 1 --active=false` - - `add-ldap`:添加新的 LDAP(通过 Bind DN)认证源 - - 选项: - - `--name value`:认证名称。必填。 - - `--not-active`:停用认证源。 - - `--security-protocol value`:安全协议名称。必填。 - - `--skip-tls-verify`:禁用 TLS 验证。 - - `--host value`:LDAP 服务器的地址。必填。 - - `--port value`:连接到 LDAP 服务器时使用的端口。必填。 - - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。必填。 - - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。必填。 - - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 - - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 - - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 - - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 - - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 - - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。必填。 - - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 - - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 - - `--bind-dn value`:在搜索用户时绑定到 LDAP 服务器的 DN。 - - `--bind-password value`:绑定 DN 的密码(如果有)。 - - `--attributes-in-bind`:在绑定 DN 上下文中获取属性。 - - `--synchronize-users`:启用用户同步。 - - `--page-size value`:搜索页面大小。 - - 示例: - - `gitea admin auth add-ldap --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-search-base "ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" --email-attribute mail` - - `update-ldap`:更新现有的 LDAP(通过 Bind DN)认证源 - - 选项: - - `--id value`:认证源的 ID。必填。 - - `--name value`:认证名称。 - - `--not-active`:停用认证源。 - - `--security-protocol value`:安全协议名称。 - - `--skip-tls-verify`:禁用 TLS 验证。 - - `--host value`:LDAP 服务器的地址。 - - `--port value`:连接到 LDAP 服务器时使用的端口。 - - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 - - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。 - - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 - - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 - - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 - - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 - - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 - - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。 - - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 - - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 - - `--bind-dn value`:在搜索用户时绑定到 LDAP 服务器的 DN。 - - `--bind-password value`:绑定 DN 的密码(如果有)。 - - `--attributes-in-bind`:在绑定 DN 上下文中获取属性。 - - `--synchronize-users`:启用用户同步。 - - `--page-size value`:搜索页面大小。 - - 示例: - - `gitea admin auth update-ldap --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` - - `add-ldap-simple`:添加新的 LDAP(简单身份验证)认证源 - - 选项: - - `--name value`:认证名称。必填。 - - `--not-active`:停用认证源。 - - `--security-protocol value`:安全协议名称。必填。 - - `--skip-tls-verify`:禁用 TLS 验证。 - - `--host value`:LDAP 服务器的地址。必填。 - - `--port value`:连接到 LDAP 服务器时使用的端口。必填。 - - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 - - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。必填。 - - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 - - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 - - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 - - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 - - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 - - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。必填。 - - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 - - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 - - `--user-dn value`:用户的 DN。必填。 - - 示例: - - `gitea admin auth add-ldap-simple --name ldap --security-protocol unencrypted --host mydomain.org --port 389 --user-dn "cn=%s,ou=Users,dc=mydomain,dc=org" --user-filter "(&(objectClass=posixAccount)(cn=%s))" --email-attribute mail` - - `update-ldap-simple`:更新现有的 LDAP(简单身份验证)认证源 - - 选项: - - `--id value`:认证源的 ID。必填。 - - `--name value`:认证名称。 - - `--not-active`:停用认证源。 - - `--security-protocol value`:安全协议名称。 - - `--skip-tls-verify`:禁用 TLS 验证。 - - `--host value`:LDAP 服务器的地址。 - - `--port value`:连接到 LDAP 服务器时使用的端口。 - - `--user-search-base value`:用户帐户将在其中搜索的 LDAP 基础路径。 - - `--user-filter value`:声明如何查找试图进行身份验证的用户记录的 LDAP 过滤器。 - - `--admin-filter value`:指定是否应授予用户管理员特权的 LDAP 过滤器。 - - `--restricted-filter value`:指定是否应将用户设置为受限状态的 LDAP 过滤器。 - - `--username-attribute value`:用户 LDAP 记录中包含用户名的属性。 - - `--firstname-attribute value`:用户 LDAP 记录中包含用户名字的属性。 - - `--surname-attribute value`:用户 LDAP 记录中包含用户姓氏的属性。 - - `--email-attribute value`:用户 LDAP 记录中包含用户电子邮件地址的属性。 - - `--public-ssh-key-attribute value`:用户 LDAP 记录中包含用户公共 SSH 密钥的属性。 - - `--avatar-attribute value`:用户 LDAP 记录中包含用户头像的属性。 - - `--user-dn value`:用户的 DN。 - - 示例: - - `gitea admin auth update-ldap-simple --id 1 --name "my ldap auth source"` - - `gitea admin auth update-ldap-simple --id 1 --username-attribute uid --firstname-attribute givenName --surname-attribute sn` - -### cert - -生成自签名的SSL证书。将输出到当前目录下的`cert.pem`和`key.pem`文件中,并且会覆盖任何现有文件。 - -- 选项: - - `--host value`:逗号分隔的主机名和IP地址列表,此证书适用于这些主机。支持使用通配符。必填。 - - `--ecdsa-curve value`:用于生成密钥的ECDSA曲线。可选。有效选项为P224、P256、P384、P521。 - - `--rsa-bits value`:要生成的RSA密钥的大小。可选。如果设置了--ecdsa-curve,则忽略此选项。(默认值:3072)。 - - `--start-date value`:证书的创建日期。可选。(格式:`Jan 1 15:04:05 2011`)。 - - `--duration value`:证书有效期。可选。(默认值:8760h0m0s) - - `--ca`:如果提供此选项,则证书将生成自己的证书颁发机构。可选。 -- 示例: - - `gitea cert --host git.example.com,example.com,www.example.com --ca` - -### dump - -将所有文件和数据库导出到一个zip文件中。输出文件将保存在当前目录下,类似于`gitea-dump-1482906742.zip`。 - -- 选项: - - `--file name`,`-f name`:指定要创建的导出文件的名称。可选。(默认值:gitea-dump-[timestamp].zip)。 - - `--tempdir path`,`-t path`:指定临时目录的路径。可选。(默认值:/tmp)。 - - `--skip-repository`,`-R`:跳过仓库的导出。可选。 - - `--skip-custom-dir`:跳过自定义目录的导出。可选。 - - `--skip-lfs-data`:跳过LFS数据的导出。可选。 - - `--skip-attachment-data`:跳过附件数据的导出。可选。 - - `--skip-package-data`:跳过包数据的导出。可选。 - - `--skip-log`:跳过日志数据的导出。可选。 - - `--database`,`-d`:指定数据库的SQL语法。可选。 - - `--verbose`,`-V`:如果提供此选项,显示附加详细信息。可选。 - - `--type`:设置导出的格式。可选。(默认值:zip) -- 示例: - - `gitea dump` - - `gitea dump --verbose` - -### generate - -用于在配置文件中生成随机值和令牌。对于自动部署时生成值非常有用。 - -- 命令: - - `secret`: - - 选项: - - `INTERNAL_TOKEN`: 用于内部 API 调用身份验证的令牌。 - - `JWT_SECRET`: 用于 LFS 和 OAUTH2 JWT 身份验证的密钥(LFS_JWT_SECRET 是此选项的别名,用于向后兼容)。 - - `SECRET_KEY`: 全局密钥。 - - 示例: - - `gitea generate secret INTERNAL_TOKEN` - - `gitea generate secret JWT_SECRET` - - `gitea generate secret SECRET_KEY` - -### keys - -提供一个 SSHD AuthorizedKeysCommand。需要在 sshd 配置文件中进行配置: - -```ini -... -# -e 的值和 AuthorizedKeysCommandUser 应与运行 Gitea 的用户名匹配 -AuthorizedKeysCommandUser git -AuthorizedKeysCommand /path/to/gitea keys -e git -u %u -t %t -k %k -``` - -该命令将返回适用于提供的密钥的合适 authorized_keys 行。您还应在 `app.ini` 的 `[server]` 部分设置值 `SSH_CREATE_AUTHORIZED_KEYS_FILE=false`。 - -注意: opensshd 要求 Gitea 程序由 root 拥有,并且不可由组或其他人写入。程序必须使用绝对路径指定。 -注意: Gitea 必须在运行此命令时处于运行状态才能成功。 - -### migrate - -迁移数据库。该命令可用于在首次启动服务器之前运行其他命令。此命令是幂等的。 - -### doctor check - -对 Gitea 实例进行诊断,可以修复一些可修复的问题。 -默认只运行部分检查,额外的检查可以参考: - -- `gitea doctor check --list` - 列出所有可用的检查 -- `gitea doctor check --all` - 运行所有可用的检查 -- `gitea doctor check --default` - 运行默认的检查 -- `gitea doctor check --run [check(s),]...` - 运行指定的名字的检查 - -有些问题可以通过设置 `--fix` 选项进行自动修复。 -额外的日志可以通过 `--log-file=...` 进行设置。 - -#### doctor recreate-table - -有时,在迁移时,旧的列和默认值可能会在数据库模式中保持不变。这可能会导致警告,如下所示: - -``` -2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0 -``` - -您可以通过以下方式让 Gitea 重新创建这些表,并将旧数据复制到新表中,并适当设置默认值: - -``` -gitea doctor recreate-table user -``` - -您可以使用以下方式让 Gitea 重新创建多个表: - -``` -gitea doctor recreate-table table1 table2 ... -``` - -如果您希望 Gitea 重新创建所有表,请直接调用: - -``` -gitea doctor recreate-table -``` - -强烈建议在运行这些命令之前备份您的数据库。 - -### doctor convert - -将现有的 MySQL 数据库从 utf8 转换为 utf8mb4,或者把 MSSQL 数据库从 varchar 转换为 nvarchar。 - -### manager - -管理运行中的服务器操作: - -- 命令: - - `shutdown`: 优雅地关闭运行中的进程 - - `restart`: 优雅地重新启动运行中的进程(对于Windows服务器尚未实现) - - `flush-queues`: 刷新运行中的进程中的队列 - - 选项: - - `--timeout value`: 刷新过程的超时时间(默认值: 1m0s) - - `--non-blocking`: 设置为true,以在返回之前不等待刷新完成 - - `logging`: 调整日志命令 - - 命令: - - `pause`: 暂停日志记录 - - 注意: - - 如果日志级别低于此级别,日志级别将被临时提升为INFO。 - - Gitea将在一定程度上缓冲日志,并在超过该点后丢弃日志。 - - `resume`: 恢复日志记录 - - `release-and-reopen`: 使Gitea释放和重新打开用于日志记录的文件和连接(相当于向Gitea发送SIGUSR1信号)。 - - `remove name`: 删除指定的日志记录器 - - 选项: - - `--group group`, `-g group`: 从中删除子记录器的组(默认为`default`) - - `add`: 添加日志记录器 - - 命令: - - `console`: 添加控制台日志记录器 - - 选项: - - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" - - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 - - `--level value`, `-l value`: 新日志记录器的日志级别 - - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 - - `--flags value`, `-F value`: 日志记录器的标志 - - `--expression value`, `-e value`: 日志记录器的匹配表达式 - - `--prefix value`, `-p value`: 日志记录器的前缀 - - `--color`: 在日志中使用颜色 - - `--stderr`: 将控制台日志输出到stderr - 仅适用于控制台 - - `file`: 添加文件日志记录器 - - 选项: - - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" - - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 - - `--level value`, `-l value`: 新日志记录器的日志级别 - - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 - - `--flags value`, `-F value`: 日志记录器的标志 - - `--expression value`, `-e value`: 日志记录器的匹配表达式 - - `--prefix value`, `-p value`: 日志记录器的前缀 - - `--color`: 在日志中使用颜色 - - `--filename value`, `-f value`: 日志记录器的文件名 - - `--rotate`, `-r`: 轮转日志 - - `--max-size value`, `-s value`: 在轮转之前的最大大小(以字节为单位) - - `--daily`, `-d`: 每天轮转日志 - - `--max-days value`, `-D value`: 保留的每日日志的最大数量 - - `--compress`, `-z`: 压缩轮转的日志 - - `--compression-level value`, `-Z value`: 使用的压缩级别 - - `conn`: 添加网络连接日志记录器 - - 选项: - - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" - - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 - - `--level value`, `-l value`: 新日志记录器的日志级别 - - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 - - `--flags value`, `-F value`: 日志记录器的标志 - - `--expression value`, `-e value`: 日志记录器的匹配表达式 - - `--prefix value`, `-p value`: 日志记录器的前缀 - - `--color`: 在日志中使用颜色 - - `--reconnect-on-message`, `-R`: 对于每个消息重新连接主机 - - `--reconnect`, `-r`: 连接中断时重新连接主机 - - `--protocol value`, `-P value`: 设置要使用的协议:tcp、unix或udp(默认为tcp) - - `--address value`, `-a value`: 要连接到的主机地址和端口(默认为:7020) - - `smtp`: 添加SMTP日志记录器 - - 选项: - - `--group value`, `-g value`: 要添加日志记录器的组 - 默认为"default" - - `--name value`, `-n value`: 新日志记录器的名称 - 默认为模式 - - `--level value`, `-l value`: 新日志记录器的日志级别 - - `--stacktrace-level value`, `-L value`: 堆栈跟踪日志级别 - - `--flags value`, `-F value`: 日志记录器的标志 - - `--expression value`, `-e value`: 日志记录器的匹配表达式 - - `--prefix value`, `-p value`: 日志记录器的前缀 - - `--color`: 在日志中使用颜色 - - `--username value`, `-u value`: 邮件服务器用户名 - - `--password value`, `-P value`: 邮件服务器密码 - - `--host value`, `-H value`: 邮件服务器主机(默认为: 127.0.0.1:25) - - `--send-to value`, `-s value`: 要发送到的电子邮件地址 - - `--subject value`, `-S value`: 发送电子邮件的主题标题 - - `processes`: 显示 Gitea 进程和 Goroutine 信息 - - 选项: - - `--flat`: 以平面表格形式显示进程,而不是树形结构 - - `--no-system`: 不显示系统进程 - - `--stacktraces`: 显示与进程关联的 Goroutine 的堆栈跟踪 - - `--json`: 输出为 JSON 格式 - - `--cancel PID`: 向具有 PID 的进程发送取消命令(仅适用于非系统进程) - -### dump-repo - -`dump-repo` 从 Git/GitHub/Gitea/GitLab 中转储存储库数据: - -- 选项: - - `--git_service service`:Git 服务,可以是 `git`、`github`、`gitea`、`gitlab`。如果 `clone_addr` 可以被识别,则可以忽略此选项。 - - `--repo_dir dir`,`-r dir`:存储数据的存储库目录路径。 - - `--clone_addr addr`:将被克隆的 URL,目前可以是 git/github/gitea/gitlab 的 http/https URL。例如:https://github.com/lunny/tango.git - - `--auth_username lunny`:访问 `clone_addr` 的用户名。 - - `--auth_password <password>`:访问 `clone_addr` 的密码。 - - `--auth_token <token>`:访问 `clone_addr` 的个人令牌。 - - `--owner_name lunny`:如果非空,数据将存储在具有所有者名称的目录中。 - - `--repo_name tango`:如果非空,数据将存储在具有存储库名称的目录中。 - - `--units <units>`:要迁移的项目,一个或多个项目应以逗号分隔。允许的项目有 wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments。如果为空,则表示所有项目。 - -### restore-repo - -`restore-repo` 从磁盘目录中还原存储库数据: - -- 选项: - - `--repo_dir dir`,`-r dir`:还原数据的存储库目录路径。 - - `--owner_name lunny`:还原目标所有者名称。 - - `--repo_name tango`:还原目标存储库名称。 - - `--units <units>`:要还原的项目,一个或多个项目应以逗号分隔。允许的项目有 wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments。如果为空,则表示所有项目。 - -### actions generate-runner-token - -生成一个供 Runner 使用的新令牌,用于向服务器注册。 - -- 选项: - - `--scope {owner}[/{repo}]`,`-s {owner}[/{repo}]`:限制 Runner 的范围,没有范围表示该 Runner 可用于所有仓库,但你也可以将其限制为特定的仓库或所有者。 - -要注册全局 Runner: - -``` -gitea actions generate-runner-token -``` - -要注册特定组织的 Runner,例如 `org`: - -``` -gitea actions generate-runner-token -s org -``` - -要注册特定仓库的 Runner,例如 `username/test-repo`: - -``` -gitea actions generate-runner-token -s username/test-repo -``` diff --git a/docs/content/administration/config-cheat-sheet.en-us.md b/docs/content/administration/config-cheat-sheet.en-us.md deleted file mode 100644 index 44c875761d..0000000000 --- a/docs/content/administration/config-cheat-sheet.en-us.md +++ /dev/null @@ -1,1445 +0,0 @@ ---- -date: "2016-12-26T16:00:00+02:00" -title: "Config Cheat Sheet" -slug: "config-cheat-sheet" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /en-us/config-cheat-sheet -menu: - sidebar: - parent: "administration" - name: "Config Cheat Sheet" - sidebar_position: 30 - identifier: "config-cheat-sheet" ---- - -# Configuration Cheat Sheet - -This is a cheat sheet for the Gitea configuration file. It contains most of the settings -that can be configured as well as their default values. - -Any changes to the Gitea configuration file should be made in `custom/conf/app.ini` -or any corresponding location. When installing from a distribution, this will -typically be found at `/etc/gitea/conf/app.ini`. - -The defaults provided here are best-effort (not built automatically). They are -accurately recorded in [app.example.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) -(s/main/\<tag|release\>). Any string in the format `%(X)s` is a feature powered -by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively. - -In the default values below, a value in the form `$XYZ` refers to an environment variable. (However, see `environment-to-ini`.) Values in the form _`XxYyZz`_ refer to values listed as part of the default configuration. These notation forms will not work in your own `app.ini` file and are only listed here as documentation. - -Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - -**Note:** A full restart is required for Gitea configuration changes to take effect. - -## Default Configuration (non-`app.ini` configuration) - -These values are environment-dependent but form the basis of a lot of values. They will be -reported as part of the default configuration when running `gitea help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up. - -- _`AppPath`_: This is the absolute path of the running gitea binary. -- _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy: - - The `WORK_PATH` option in `app.ini` - - The `--work-path` flag passed to the binary - - The environment variable `$GITEA_WORK_DIR` - - A built-in value set at build time (see building from source) - - Otherwise, it defaults to the directory of the _`AppPath`_ - - If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_ -- _`CustomPath`_: This is the base directory for custom templates and other options. -It is determined by using the first set thing in the following hierarchy: - - The `--custom-path` flag passed to the binary - - The environment variable `$GITEA_CUSTOM` - - A built-in value set at build time (see building from source) - - Otherwise, it defaults to _`AppWorkPath`_`/custom` - - If any of the above are relative paths then they are made absolute against the -the directory of the _`AppWorkPath`_ -- _`CustomConf`_: This is the path to the `app.ini` file. - - The `--config` flag passed to the binary - - A built-in value set at build time (see building from source) - - Otherwise, it defaults to _`CustomPath`_`/conf/app.ini` - - If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_ - -In addition, there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_ - -## Overall (`DEFAULT`) - -- `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title. -- `RUN_USER`: **_current OS username_/`$USER`/`$USERNAME` e.g. git**: The user Gitea will run as. - This should be a dedicated system (non-user) account. Setting this incorrectly will cause Gitea - to not start. -- `RUN_MODE`: **prod**: Application run mode, affects performance and debugging: `dev` or `prod`, default is `prod`. Mode `dev` makes Gitea easier to develop and debug, values other than `dev` are treated as `prod` which is for production use. -- `WORK_PATH`: **_the-work-path_**: The working directory, see the comment of AppWorkPath above. - -## Repository (`repository`) - -- `ROOT`: **%(APP_DATA_PATH)s/gitea-repositories**: Root path for storing all repository data. - A relative path is interpreted as **_`AppWorkPath`_/%(ROOT)s**. -- `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`, - but some users report that only `sh` is available. -- `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Adding `defaults` will place the unnamed charsets at that point. -- `ANSI_CHARSET`: **_empty_**: Default ANSI charset to override non-UTF-8 charsets to. -- `FORCE_PRIVATE`: **false**: Force every new repository to be private. -- `DEFAULT_PRIVATE`: **last**: Default private when creating a new repository. - \[last, private, public\] -- `DEFAULT_PUSH_CREATE_PRIVATE`: **true**: Default private when creating a new repository with push-to-create. -- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, - `-1` means no limit. -- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at - the top of the list. Name must match file name in options/license or custom/options/license. -- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the - HTTP protocol. -- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when - default SSH port is used. -- `GO_GET_CLONE_URL_PROTOCOL`: **https**: Value for the "go get" request returns the repository url as https or ssh - default is https. -- `ACCESS_CONTROL_ALLOW_ORIGIN`: **_empty_**: Value for Access-Control-Allow-Origin header, - default is not to present. **WARNING**: This maybe harmful to you website if you do not - give it a right value. -- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed. -- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user. -- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org. -- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\] -- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. -- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`. -- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository. -- `DISABLE_MIGRATIONS`: **false**: Disable migrating feature. -- `DISABLE_STARS`: **false**: Disable stars feature. -- `DEFAULT_BRANCH`: **main**: Default branch name of all repositories. -- `ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to adopt unadopted repositories -- `ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to delete unadopted repositories -- `DISABLE_DOWNLOAD_SOURCE_ARCHIVES`: **false**: Don't allow download source archive files from UI -- `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT`: **true**: Allow fork repositories without maximum number limit - -### Repository - Editor (`repository.editor`) - -- `LINE_WRAP_EXTENSIONS`: **.txt,.md,.markdown,.mdown,.mkd,.livemd,**: List of file extensions for which lines should be wrapped in the Monaco editor. Separate extensions with a comma. To line wrap files without an extension, just put a comma -- `PREVIEWABLE_FILE_MODES`: **markdown**: Valid file modes that have a preview API associated with them, such as `api/v1/markdown`. Separate the values by commas. The preview tab in edit mode won't be displayed if the file extension doesn't match. - -### Repository - Pull Request (`repository.pull-request`) - -- `WORK_IN_PROGRESS_PREFIXES`: **WIP:,\[WIP\]**: List of prefixes used in Pull Request - title to mark them as Work In Progress. These are matched in a case-insensitive manner. -- `CLOSE_KEYWORDS`: **close**, **closes**, **closed**, **fix**, **fixes**, **fixed**, **resolve**, **resolves**, **resolved**: List of - keywords used in Pull Request comments to automatically close a related issue -- `REOPEN_KEYWORDS`: **reopen**, **reopens**, **reopened**: List of keywords used in Pull Request comments to automatically reopen - a related issue -- `DEFAULT_MERGE_STYLE`: **merge**: Set default merge style for repository creating, valid options: `merge`, `rebase`, `rebase-merge`, `squash`, `fast-forward-only` -- `DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT`: **50**: In the default merge message for squash commits include at most this many commits. Set to `-1` to include all commits -- `DEFAULT_MERGE_MESSAGE_SIZE`: **5120**: In the default merge message for squash commits limit the size of the commit messages. Set to `-1` to have no limit. Only used if `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES` is `true`. -- `DEFAULT_MERGE_MESSAGE_ALL_AUTHORS`: **false**: In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list -- `DEFAULT_MERGE_MESSAGE_MAX_APPROVERS`: **10**: In default merge messages limit the number of approvers listed as `Reviewed-by:`. Set to `-1` to include all. -- `DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY`: **true**: In default merge messages only include approvers who are officially allowed to review. -- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: In default squash-merge messages include the commit message of all commits comprising the pull request. -- `ADD_CO_COMMITTER_TRAILERS`: **true**: Add co-authored-by and co-committed-by trailers to merge commit messages if committer does not match author. -- `TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY`: **false**: PR patches are tested using a three-way merge method to discover if there are conflicts. If this setting is set to **true**, conflicting patches will be retested using `git apply` - This was the previous behaviour in 1.18 (and earlier) but is somewhat inefficient. Please report if you find that this setting is required. -- `RETARGET_CHILDREN_ON_MERGE`: **true**: Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo. - -### Repository - Issue (`repository.issue`) - -- `LOCK_REASONS`: **Too heated,Off-topic,Resolved,Spam**: A list of reasons why a Pull Request or Issue can be locked -- `MAX_PINNED`: **3**: Maximum number of pinned Issues per Repo. Set to 0 to disable pinning Issues. - -### Repository - Upload (`repository.upload`) - -- `ENABLED`: **true**: Whether repository file uploads are enabled -- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (content gets deleted on Gitea restart) -- `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -- `FILE_MAX_SIZE`: **50**: Max size of each file in megabytes. -- `MAX_FILES`: **5**: Max number of files per upload - -### Repository - Release (`repository.release`) - -- `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -- `DEFAULT_PAGING_NUM`: **10**: The default paging number of releases user interface -- For settings related to file attachments on releases, see the `attachment` section. - -### Repository - Signing (`repository.signing`) - -- `SIGNING_KEY`: **default**: \[none, KEYID, default \]: Key to sign with. -- `SIGNING_NAME` & `SIGNING_EMAIL`: if a KEYID is provided as the `SIGNING_KEY`, use these as the Name and Email address of the signer. These should match publicized name and email address for the key. -- `INITIAL_COMMIT`: **always**: \[never, pubkey, twofa, always\]: Sign initial commit. - - `never`: Never sign - - `pubkey`: Only sign if the user has a public key - - `twofa`: Only sign if the user is logged in with twofa - - `always`: Always sign - - Options other than `never` and `always` can be combined as a comma separated list. -- `DEFAULT_TRUST_MODEL`: **collaborator**: \[collaborator, committer, collaboratorcommitter\]: The default trust model used for verifying commits. - - `collaborator`: Trust signatures signed by keys of collaborators. - - `committer`: Trust signatures that match committers (This matches GitHub and will force Gitea signed commits to have Gitea as the committer). - - `collaboratorcommitter`: Trust signatures signed by keys of collaborators which match the committer. -- `WIKI`: **never**: \[never, pubkey, twofa, always, parentsigned\]: Sign commits to wiki. -- `CRUD_ACTIONS`: **pubkey, twofa, parentsigned**: \[never, pubkey, twofa, parentsigned, always\]: Sign CRUD actions. - - Options as above, with the addition of: - - `parentsigned`: Only sign if the parent commit is signed. -- `MERGES`: **pubkey, twofa, basesigned, commitssigned**: \[never, pubkey, twofa, approved, basesigned, commitssigned, always\]: Sign merges. - - `approved`: Only sign approved merges to a protected branch. - - `basesigned`: Only sign if the parent commit in the base repo is signed. - - `headsigned`: Only sign if the head commit in the head branch is signed. - - `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed. - -## Repository - Local (`repository.local`) - -- `LOCAL_COPY_PATH`: **tmp/local-repo**: Path for temporary local repository copies. Defaults to `tmp/local-repo` (content gets deleted on Gitea restart) - -## Repository - MIME type mapping (`repository.mimetype_mapping`) - -Configuration for set the expected MIME type based on file extensions of downloadable files. Configuration presents in key-value pairs and file extensions starts with leading `.`. - -The following configuration set `Content-Type: application/vnd.android.package-archive` header when downloading files with `.apk` file extension. - -```ini -.apk=application/vnd.android.package-archive -``` - -## CORS (`cors`) - -- `ENABLED`: **false**: enable cors headers (disabled by default) -- `ALLOW_DOMAIN`: **\***: list of requesting origins that are allowed, eg: "https://*.example.com" -- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request -- `MAX_AGE`: **10m**: max time to cache response -- `ALLOW_CREDENTIALS`: **false**: allow request with credentials -- `HEADERS`: **Content-Type,User-Agent**: additional headers that are permitted in requests -- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value. - -## UI (`ui`) - -- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page. -- `ISSUE_PAGING_NUM`: **20**: Number of issues that are shown in one page (for all pages that list issues, milestones, projects). -- `MEMBERS_PAGING_NUM`: **20**: Number of members that are shown in organization members. -- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed. -- `FEED_PAGING_NUM`: **20**: Number of items that are displayed in home feed. -- `SITEMAP_PAGING_NUM`: **20**: Number of items that are displayed in a single subsitemap. -- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph. -- `CODE_COMMENT_LINES`: **4**: Number of line of codes shown for a code comment. -- `DEFAULT_THEME`: **gitea-auto**: \[gitea-auto, gitea-light, gitea-dark\]: Set the default theme for the Gitea installation. -- `SHOW_USER_EMAIL`: **true**: Whether the email of the user should be shown in the Explore Users page. -- `THEMES`: **gitea-auto,gitea-light,gitea-dark**: All available themes. Allow users select personalized themes. - regardless of the value of `DEFAULT_THEME`. -- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB) -- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI -- `REACTIONS`: All available reactions users can choose on issues/prs and comments - Values can be emoji alias (:smile:) or a unicode emoji. - For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png -- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover). -- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard. - By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and - add it to this config. -- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used. -- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page. -- `ONLY_SHOW_RELEVANT_REPOS`: **false**: Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. - A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic). -- `EXPLORE_PAGING_DEFAULT_SORT`: **recentupdate**: Change the sort type of the explore pages. Valid values are "recentupdate", "alphabetically", "reverselastlogin", "newest" and "oldest" -- `PREFERRED_TIMESTAMP_TENSE`: **mixed**: The tense all timestamps should be rendered in. Possible values are `absolute` time (i.e. 1970-01-01, 11:59) and `mixed`. `mixed` means most timestamps are rendered in relative time (i.e. 2 days ago). - -### UI - Admin (`ui.admin`) - -- `USER_PAGING_NUM`: **50**: Number of users that are shown in one page. -- `REPO_PAGING_NUM`: **50**: Number of repos that are shown in one page. -- `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page. -- `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page. - -### UI - User (`ui.user`) - -- `REPO_PAGING_NUM`: **15**: Number of repos that are shown in one page. - -### UI - Metadata (`ui.meta`) - -- `AUTHOR`: **Gitea - Git with a cup of tea**: Author meta tag of the homepage. -- `DESCRIPTION`: **Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go**: Description meta tag of the homepage. -- `KEYWORDS`: **go,git,self-hosted,gitea**: Keywords meta tag of the homepage. - -### UI - Notification (`ui.notification`) - -- `MIN_TIMEOUT`: **10s**: These options control how often notification endpoint is polled to update the notification count. On page load the notification count will be checked after `MIN_TIMEOUT`. The timeout will increase to `MAX_TIMEOUT` by `TIMEOUT_STEP` if the notification count is unchanged. Set MIN_TIMEOUT to -1 to turn off. -- `MAX_TIMEOUT`: **60s**. -- `TIMEOUT_STEP`: **10s**. -- `EVENT_SOURCE_UPDATE_TIME`: **10s**: This setting determines how often the database is queried to update notification counts. If the browser client supports `EventSource` and `SharedWorker`, a `SharedWorker` will be used in preference to polling notification endpoint. Set to **-1** to disable the `EventSource`. - -### UI - SVG Images (`ui.svg`) - -- `ENABLE_RENDER`: **true**: Whether to render SVG files as images. If SVG rendering is disabled, SVG files are displayed as text and cannot be embedded in markdown files as images. - -### UI - CSV Files (`ui.csv`) - -- `MAX_FILE_SIZE`: **524288** (512kb): Maximum allowed file size in bytes to render CSV files as table. (Set to 0 for no limit). - -## Markdown (`markdown`) - -- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: Render soft line breaks as hard line breaks in comments, which - means a single newline character between paragraphs will cause a line break and adding - trailing whitespace to paragraphs is not necessary to force a line break. -- `ENABLE_HARD_LINE_BREAK_IN_DOCUMENTS`: **false**: Render soft line breaks as hard line breaks in documents, which - means a single newline character between paragraphs will cause a line break and adding - trailing whitespace to paragraphs is not necessary to force a line break. -- `CUSTOM_URL_SCHEMES`: Use a comma separated list (ftp,git,svn) to indicate additional - URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are - always displayed. If this entry is empty, all URL schemes are allowed -- `FILE_EXTENSIONS`: **.md,.markdown,.mdown,.mkd,.livemd**: List of file extensions that should be rendered/edited as Markdown. Separate the extensions with a comma. To render files without any extension as markdown, just put a comma. -- `ENABLE_MATH`: **true**: Enables detection of `\(...\)`, `\[...\]`, `$...$` and `$$...$$` blocks as math blocks. - -## Server (`server`) - -- `APP_DATA_PATH`: **_`AppWorkPath`_/data**: This is the default root path for storing data. -- `PROTOCOL`: **http**: \[http, https, fcgi, http+unix, fcgi+unix\] - - Note: Value must be lowercase. -- `USE_PROXY_PROTOCOL`: **false**: Expect PROXY protocol headers on connections -- `PROXY_PROTOCOL_TLS_BRIDGING`: **false**: When protocol is https, expect PROXY protocol headers after TLS negotiation. -- `PROXY_PROTOCOL_HEADER_TIMEOUT`: **5s**: Timeout to wait for PROXY protocol header (set to 0 to have no timeout) -- `PROXY_PROTOCOL_ACCEPT_UNKNOWN`: **false**: Accept PROXY protocol headers with Unknown type. -- `DOMAIN`: **localhost**: Domain name of this server. -- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: - Overwrite the automatically generated public URL. - This is useful if the internal and the external URL don't match (e.g. in Docker). -- `STATIC_URL_PREFIX`: **_empty_**: - Overwrite this option to request static resources from a different URL. - This includes CSS files, images, JS files and web fonts. - Avatar images are dynamic resources and still served by Gitea. - The option can be just a different path, as in `/static`, or another domain, as in `https://cdn.example.com`. - Requests are then made as `%(ROOT_URL)s/static/assets/css/index.css` or `https://cdn.example.com/assets/css/index.css` respectively. - The static files are located in the `public/` directory of the Gitea source repository. - You can proxy the STATIC_URL_PREFIX requests to Gitea server to serve the static - assets, or copy the manually built Gitea assets from `$GITEA_BUILD/public` to - the assets location, eg: `/var/www/assets`, make sure `$STATIC_URL_PREFIX/assets/css/index.css` - points to `/var/www/assets/css/index.css`. - -- `HTTP_ADDR`: **0.0.0.0**: HTTP listen address. - - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket - defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. - - If `PROTOCOL` is set to `http+unix` or `fcgi+unix`, this should be the name of the Unix socket file to use. Relative paths will be made absolute against the _`AppWorkPath`_. -- `HTTP_PORT`: **3000**: HTTP listen port. - - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket - defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. -- `UNIX_SOCKET_PERMISSION`: **666**: Permissions for the Unix socket. -- `LOCAL_ROOT_URL`: **%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/**: Local - (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In - most cases you do not need to change the default value. Alter it only if - your SSH server node is not the same as HTTP node. For different protocol, the default - values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`. - If `PROTOCOL` is `fcgi` or `fcgi+unix`, the default value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`. - If listen on `0.0.0.0`, the default value is `%(PROTOCOL)s://localhost:%(HTTP_PORT)s/`, Otherwise the default - value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`. -- `LOCAL_USE_PROXY_PROTOCOL`: **%(USE_PROXY_PROTOCOL)s**: When making local connections pass the PROXY protocol header. - This should be set to false if the local connection will go through the proxy. -- `PER_WRITE_TIMEOUT`: **30s**: Timeout for any write to the connection. (Set to -1 to - disable all timeouts.) -- `PER_WRITE_PER_KB_TIMEOUT`: **10s**: Timeout per Kb written to connections. - -- `DISABLE_SSH`: **false**: Disable SSH feature when it's not available. -- `START_SSH_SERVER`: **false**: When enabled, use the built-in SSH server. -- `SSH_SERVER_USE_PROXY_PROTOCOL`: **false**: Expect PROXY protocol header on connections to the built-in SSH Server. -- `BUILTIN_SSH_SERVER_USER`: **%(RUN_USER)s**: Username to use for the built-in SSH Server. -- `SSH_USER`: **%(BUILTIN_SSH_SERVER_USER)s**: SSH username displayed in clone URLs. This is only for people who configure the SSH server themselves; in most cases, you want to leave this blank and modify the `BUILTIN_SSH_SERVER_USER`. -- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of this server, used for displayed clone URL. -- `SSH_PORT`: **22**: SSH port displayed in clone URL. -- `SSH_LISTEN_HOST`: **0.0.0.0**: Listen address for the built-in SSH server. -- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server. -- `SSH_ROOT_PATH`: **~/.ssh**: Root path of SSH directory. -- `SSH_CREATE_AUTHORIZED_KEYS_FILE`: **true**: Gitea will create a authorized_keys file by default when it is not using the internal ssh server. If you intend to use the AuthorizedKeysCommand functionality then you should turn this off. -- `SSH_AUTHORIZED_KEYS_BACKUP`: **false**: Enable SSH Authorized Key Backup when rewriting all keys, default is false. -- `SSH_TRUSTED_USER_CA_KEYS`: **_empty_**: Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. Multiple keys should be comma separated. E.g.`ssh-<algorithm> <key>` or `ssh-<algorithm> <key1>, ssh-<algorithm> <key2>`. For more information see `TrustedUserCAKeys` in the sshd config man pages. When empty no file will be created and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` will default to `off`. -- `SSH_TRUSTED_USER_CA_KEYS_FILENAME`: **`RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem**: Absolute path of the `TrustedUserCaKeys` file Gitea will manage. If you're running your own ssh server and you want to use the Gitea managed file you'll also need to modify your sshd_config to point to this file. The official docker image will automatically work without further configuration. -- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set. -- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`. -- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`. -- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted. -- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect. -- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect. -- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect -- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If no key exists a 4096 bit RSA key will be created for you. -- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory. -- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself. -- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false. -- `SSH_PER_WRITE_TIMEOUT`: **30s**: Timeout for any write to the SSH connections. (Set to - -1 to disable all timeouts.) -- `SSH_PER_WRITE_PER_KB_TIMEOUT`: **10s**: Timeout per Kb written to SSH connections. -- `MINIMUM_KEY_SIZE_CHECK`: **true**: Indicate whether to check minimum key size with corresponding type. - -- `OFFLINE_MODE`: **true**: Disables use of CDN for static files and Gravatar for profile pictures. -- `CERT_FILE`: **https/cert.pem**: Cert file path used for HTTPS. When chaining, the server certificate must come first, then intermediate CA certificates (if any). This is ignored if `ENABLE_ACME=true`. Paths are relative to `CUSTOM_PATH`. -- `KEY_FILE`: **https/key.pem**: Key file path used for HTTPS. This is ignored if `ENABLE_ACME=true`. Paths are relative to `CUSTOM_PATH`. -- `STATIC_ROOT_PATH`: **_`StaticRootPath`_**: Upper level of template and static files path. -- `APP_DATA_PATH`: **data** (**/data/gitea** on docker): Default path for application data. Relative paths will be made absolute against _`AppWorkPath`_. -- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. Note that this cache is disabled when `RUN_MODE` is "dev". -- `ENABLE_GZIP`: **false**: Enable gzip compression for runtime-generated content, static resources excluded. -- `ENABLE_PPROF`: **false**: Application profiling (memory and cpu). For "web" command it listens on `localhost:6060`. For "serv" command it dumps to disk at `PPROF_DATA_PATH` as `(cpuprofile|memprofile)_<username>_<temporary id>` -- `PPROF_DATA_PATH`: **_`AppWorkPath`_/data/tmp/pprof**: `PPROF_DATA_PATH`, use an absolute path when you start Gitea as service -- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login, **custom**\]. Where custom would instead be any URL such as "/org/repo" or even `https://anotherwebsite.com` -- `LFS_START_SERVER`: **false**: Enables Git LFS support. -- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)s/lfs**: Default LFS content path. (if it is on local storage.) **DEPRECATED** use settings in `[lfs]`. -- `LFS_JWT_SECRET`: **_empty_**: LFS authentication secret, change this a unique string. -- `LFS_JWT_SECRET_URI`: **_empty_**: Instead of defining LFS_JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/lfs_jwt_secret`) -- `LFS_HTTP_AUTH_EXPIRY`: **24h**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail. -- `LFS_MAX_FILE_SIZE`: **0**: Maximum allowed LFS file size in bytes (Set to 0 for no limit). -- `LFS_LOCKS_PAGING_NUM`: **50**: Maximum number of LFS Locks returned per page. - -- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, allows redirecting http requests on `PORT_TO_REDIRECT` to the https port Gitea listens on. -- `REDIRECTOR_USE_PROXY_PROTOCOL`: **%(USE_PROXY_PROTOCOL)s**: expect PROXY protocol header on connections to https redirector. -- `PORT_TO_REDIRECT`: **80**: Port for the http redirection service to listen on. Used when `REDIRECT_OTHER_PORT` is true. -- `SSL_MIN_VERSION`: **TLSv1.2**: Set the minimum version of ssl support. -- `SSL_MAX_VERSION`: **_empty_**: Set the maximum version of ssl support. -- `SSL_CURVE_PREFERENCES`: **X25519,P256**: Set the preferred curves, -- `SSL_CIPHER_SUITES`: **ecdhe_ecdsa_with_aes_256_gcm_sha384,ecdhe_rsa_with_aes_256_gcm_sha384,ecdhe_ecdsa_with_aes_128_gcm_sha256,ecdhe_rsa_with_aes_128_gcm_sha256,ecdhe_ecdsa_with_chacha20_poly1305,ecdhe_rsa_with_chacha20_poly1305**: Set the preferred cipher suites. - - If there is no hardware support for AES suites, by default the ChaCha suites will be preferred over the AES suites. - - supported suites as of Go 1.18 are: - - TLS 1.0 - 1.2 cipher suites - - "rsa_with_rc4_128_sha" - - "rsa_with_3des_ede_cbc_sha" - - "rsa_with_aes_128_cbc_sha" - - "rsa_with_aes_256_cbc_sha" - - "rsa_with_aes_128_cbc_sha256" - - "rsa_with_aes_128_gcm_sha256" - - "rsa_with_aes_256_gcm_sha384" - - "ecdhe_ecdsa_with_rc4_128_sha" - - "ecdhe_ecdsa_with_aes_128_cbc_sha" - - "ecdhe_ecdsa_with_aes_256_cbc_sha" - - "ecdhe_rsa_with_rc4_128_sha" - - "ecdhe_rsa_with_3des_ede_cbc_sha" - - "ecdhe_rsa_with_aes_128_cbc_sha" - - "ecdhe_rsa_with_aes_256_cbc_sha" - - "ecdhe_ecdsa_with_aes_128_cbc_sha256" - - "ecdhe_rsa_with_aes_128_cbc_sha256" - - "ecdhe_rsa_with_aes_128_gcm_sha256" - - "ecdhe_ecdsa_with_aes_128_gcm_sha256" - - "ecdhe_rsa_with_aes_256_gcm_sha384" - - "ecdhe_ecdsa_with_aes_256_gcm_sha384" - - "ecdhe_rsa_with_chacha20_poly1305_sha256" - - "ecdhe_ecdsa_with_chacha20_poly1305_sha256" - - TLS 1.3 cipher suites - - "aes_128_gcm_sha256" - - "aes_256_gcm_sha384" - - "chacha20_poly1305_sha256" - - Aliased names - - "ecdhe_rsa_with_chacha20_poly1305" is an alias for "ecdhe_rsa_with_chacha20_poly1305_sha256" - - "ecdhe_ecdsa_with_chacha20_poly1305" is alias for "ecdhe_ecdsa_with_chacha20_poly1305_sha256" -- `ENABLE_ACME`: **false**: Flag to enable automatic certificate management via an ACME capable Certificate Authority (CA) server (default: Lets Encrypt). If enabled, `CERT_FILE` and `KEY_FILE` are ignored, and the CA must resolve `DOMAIN` to this gitea server. Ensure that DNS records are set and either port `80` or port `443` are accessible by the CA server (the public internet by default), and redirected to the appropriate ports `PORT_TO_REDIRECT` or `HTTP_PORT` respectively. -- `ACME_URL`: **_empty_**: The CA's ACME directory URL, e.g. for a self-hosted [smallstep CA server](https://github.com/smallstep/certificates), it can look like `https://ca.example.com/acme/acme/directory`. If left empty, it defaults to using Let's Encerypt's production CA (check `LETSENCRYPT_ACCEPTTOS` as well). -- `ACME_ACCEPTTOS`: **false**: This is an explicit check that you accept the terms of service of the ACME provider. The default is Lets Encrypt [terms of service](https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf). -- `ACME_DIRECTORY`: **https**: Directory that the certificate manager will use to cache information such as certs and private keys. -- `ACME_EMAIL`: **_empty_**: Email used for the ACME registration. Usually it is to notify about problems with issued certificates. -- `ACME_CA_ROOT`: **_empty_**: The CA's root certificate. If left empty, it defaults to using the system's trust chain. -- `ALLOW_GRACEFUL_RESTARTS`: **true**: Perform a graceful restart on SIGHUP -- `GRACEFUL_HAMMER_TIME`: **60s**: After a restart the parent process will stop accepting new connections and will allow requests to finish before stopping. Shutdown will be forced if it takes longer than this time. -- `STARTUP_TIMEOUT`: **0**: Shutsdown the server if startup takes longer than the provided time. On Windows setting this sends a waithint to the SVC host to tell the SVC host startup may take some time. Please note startup is determined by the opening of the listeners - HTTP/HTTPS/SSH. Indexers may take longer to startup and can have their own timeouts. - -## Database (`database`) - -- `DB_TYPE`: **mysql**: The database type in use \[mysql, postgres, mssql, sqlite3\]. -- `HOST`: **127.0.0.1:3306**: Database host address and port or absolute path for unix socket \[mysql, postgres[^1]\] (ex: /var/run/mysqld/mysqld.sock). -- `NAME`: **gitea**: Database name. -- `USER`: **root**: Database username. -- `PASSWD`: **_empty_**: Database user password. Use \`your password\` or """your password""" for quoting if you use special characters in the password. -- `CHARSET_COLLATION`: **_empty_**: (MySQL/MSSQL only) Gitea expects to use a case-sensitive collation for database. Leave it empty to use the default collation decided by the Gitea. Don't change it unless you clearly know what you need. -- `SCHEMA`: **_empty_**: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand, - the user must have creation privileges on it, and the user search path must be set to the look into the schema first - (e.g. `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`). -- `SSL_MODE`: **disable**: SSL/TLS encryption mode for connecting to the database. This option is only applied for PostgreSQL and MySQL. - - Valid values for MySQL: - - `true`: Enable TLS with verification of the database server certificate against its root certificate. When selecting this option make sure that the root certificate required to validate the database server certificate (e.g. the CA certificate) is on the system certificate store of both the database and Gitea servers. See your system documentation for instructions on how to add a CA certificate to the certificate store. - - `false`: Disable TLS. - - `disable`: Alias for `false`, for compatibility with PostgreSQL. - - `skip-verify`: Enable TLS without database server certificate verification. Use this option if you have self-signed or invalid certificate on the database server. - - `prefer`: Enable TLS with fallback to non-TLS connection. - - Valid values for PostgreSQL: - - `disable`: Disable TLS. - - `require`: Enable TLS without any verifications. - - `verify-ca`: Enable TLS with verification of the database server certificate against its root certificate. - - `verify-full`: Enable TLS and verify the database server name matches the given certificate in either the `Common Name` or `Subject Alternative Name` fields. -- `SQLITE_TIMEOUT`: **500**: Query timeout for SQLite3 only. -- `SQLITE_JOURNAL_MODE`: **""**: Change journal mode for SQlite3. Can be used to enable [WAL mode](https://www.sqlite.org/wal.html) when high load causes write congestion. See [SQlite3 docs](https://www.sqlite.org/pragma.html#pragma_journal_mode) for possible values. Defaults to the default for the database file, often DELETE. -- `ITERATE_BUFFER_SIZE`: **50**: Internal buffer size for iterating. -- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path. -- `LOG_SQL`: **false**: Log the executed SQL. -- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed. -- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occurred. -- `MAX_OPEN_CONNS` **0**: Database maximum open connections - default is 0, meaning there is no limit. -- `MAX_IDLE_CONNS` **2**: Max idle database connections on connection pool, default is 2 - this will be capped to `MAX_OPEN_CONNS`. -- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071). -- `AUTO_MIGRATION` **true**: Whether execute database models migrations automatically. -- `SLOW_QUERY_THRESHOLD` **5s**: Threshold value in seconds beyond which query execution time is logged as a warning in the xorm logger. - -[^1]: It may be necessary to specify a hostport even when listening on a unix socket, as the port is part of the socket name. see [#24552](https://github.com/go-gitea/gitea/issues/24552#issuecomment-1681649367) for additional details. - -Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their -relation to port exhaustion. - -## Indexer (`indexer`) - -- `ISSUE_INDEXER_TYPE`: **bleve**: Issue indexer type, currently supported: `bleve`, `db`, `elasticsearch` or `meilisearch`. -- `ISSUE_INDEXER_CONN_STR`: ****: Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g. http://elastic:password@localhost:9200) or meilisearch (e.g. http://:apikey@localhost:7700) -- `ISSUE_INDEXER_NAME`: **gitea_issues**: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch. -- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch. Relative paths will be made absolute against _`AppWorkPath`_. - -- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size). -- `REPO_INDEXER_REPO_TYPES`: **sources,forks,mirrors,templates**: Repo indexer units. The items to index could be `sources`, `forks`, `mirrors`, `templates` or any combination of them separated by a comma. If empty then it defaults to `sources` only, as if you'd like to disable fully please see `REPO_INDEXER_ENABLED`. -- `REPO_INDEXER_TYPE`: **bleve**: Code search engine type, could be `bleve` or `elasticsearch`. -- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: Index file used for code search. -- `REPO_INDEXER_CONN_STR`: ****: Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:password@localhost:9200 -- `REPO_INDEXER_NAME`: **gitea_codes**: Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch - -- `REPO_INDEXER_INCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **include** in the index. Use `**.txt` to match any files with .txt extension. An empty list means include all files. -- `REPO_INDEXER_EXCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **exclude** from the index. Files that match this list will not be indexed, even if they match in `REPO_INDEXER_INCLUDE`. -- `REPO_INDEXER_EXCLUDE_VENDORED`: **true**: Exclude vendored files from index. -- `MAX_FILE_SIZE`: **1048576**: Maximum size in bytes of files to be indexed. -- `STARTUP_TIMEOUT`: **30s**: If the indexer takes longer than this timeout to start - fail. (This timeout will be added to the hammer time above for child processes - as bleve will not start until the previous parent is shutdown.) Set to -1 to never timeout. - -## Queue (`queue` and `queue.*`) - -Configuration at `[queue]` will set defaults for queues with overrides for individual queues at `[queue.*]`. (However see below.) - -- `TYPE`: **level**: General queue type, currently support: `level` (uses a LevelDB internally), `channel`, `redis`, `dummy`. Invalid types are treated as `level`. -- `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`. -- `LENGTH`: **100000**: Maximal queue size before channel queues block -- `BATCH_LENGTH`: **20**: Batch data before passing to the handler -- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR` -- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section. -- `SET_NAME`: **_unique**: The suffix that will be added to the default redis and disk queue `set` name for unique queues. Individual queues will default to **`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific `queue.name` section. -- `MAX_WORKERS`: **(dynamic)**: Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10. - -Gitea creates the following non-unique queues: - -- `code_indexer` -- `issue_indexer` -- `notification-service` -- `task` -- `mail` -- `push_update` - -And the following unique queues: - -- `repo_stats_update` -- `repo-archive` -- `mirror` -- `pr_patch_checker` - -## Admin (`admin`) - -- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled -- `DISABLE_REGULAR_ORG_CREATION`: **false**: Disallow regular (non-admin) users from creating organizations. -- `USER_DISABLED_FEATURES`: **_empty_** Disabled features for users, could be `deletion`, `manage_ssh_keys`, `manage_gpg_keys` and more features can be added in future. - - `deletion`: User cannot delete their own account. - - `manage_ssh_keys`: User cannot configure ssh keys. - - `manage_gpg_keys`: User cannot configure gpg keys. - -## Security (`security`) - -- `INSTALL_LOCK`: **false**: Controls access to the installation page. When set to "true", the installation page is not accessible. -- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This key is VERY IMPORTANT, if you lost it, the data encrypted by it (like 2FA secret) can't be decrypted anymore. -- `SECRET_KEY_URI`: **_empty_**: Instead of defining SECRET_KEY, this option can be used to use the key stored in a file (example value: `file:/etc/gitea/secret_key`). It shouldn't be lost like SECRET_KEY. -- `LOGIN_REMEMBER_DAYS`: **31**: How long to remember that a user is logged in before requiring relogin (in days). -- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication - information. -- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy - authentication. -- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: Header name for reverse proxy - authentication provided email. -- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**: Header name for reverse proxy - authentication provided full name. -- `REVERSE_PROXY_LIMIT`: **1**: Interpret X-Forwarded-For header or the X-Real-IP header and set this as the remote IP for the request. - Number of trusted proxy count. Set to zero to not use these headers. -- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**: List of IP addresses and networks separated by comma of trusted proxy servers. Use `*` to trust all. -- `DISABLE_GIT_HOOKS`: **true**: Set to `false` to enable users with Git Hook privilege to create custom Git Hooks. - WARNING: Custom Git Hooks can be used to perform arbitrary code execution on the host operating system. - This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service. - By modifying the Gitea database, users can gain Gitea administrator privileges. - It also enables them to access other resources available to the user on the operating system that is running the - Gitea instance and perform arbitrary actions in the name of the Gitea OS user. - This maybe harmful to you website or your operating system. - Setting this to true does not change existing hooks in git repos; adjust it before if necessary. -- `DISABLE_WEBHOOKS`: **false**: Set to `true` to disable webhooks feature. -- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**: Set to `false` to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to Gitea repositories you should set the environment appropriately. -- `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to prevent all users (including admin) from importing local path on server. -- `INTERNAL_TOKEN`: **\<random at every install if no uri set\>**: Secret used to validate communication within Gitea binary. -- `INTERNAL_TOKEN_URI`: **_empty_**: Instead of defining INTERNAL_TOKEN in the configuration, this configuration option can be used to give Gitea a path to a file that contains the internal token (example value: `file:/etc/gitea/internal_token`) -- `PASSWORD_HASH_ALGO`: **pbkdf2**: The hash algorithm to use \[argon2, pbkdf2, pbkdf2_v1, pbkdf2_hi, scrypt, bcrypt\], argon2 and scrypt will spend significant amounts of memory. - - Note: The default parameters for `pbkdf2` hashing have changed - the previous settings are available as `pbkdf2_v1` but are not recommended. - - The hash functions may be tuned by using `$` after the algorithm: - - `argon2$<time>$<memory>$<threads>$<key-length>` - - `bcrypt$<cost>` - - `pbkdf2$<iterations>$<key-length>` - - `scrypt$<n>$<r>$<p>$<key-length>` - - The defaults are: - - `argon2`: `argon2$2$65536$8$50` - - `bcrypt`: `bcrypt$10` - - `pbkdf2`: `pbkdf2$50000$50` - - `pbkdf2_v1`: `pbkdf2$10000$50` - - `pbkdf2_v2`: `pbkdf2$50000$50` - - `pbkdf2_hi`: `pbkdf2$320000$50` - - `scrypt`: `scrypt$65536$16$2$50` - - Adjusting the algorithm parameters using this functionality is done at your own risk. -- `CSRF_COOKIE_HTTP_ONLY`: **true**: Set false to allow JavaScript to read CSRF cookie. -- `MIN_PASSWORD_LENGTH`: **8**: Minimum password length for new users. -- `PASSWORD_COMPLEXITY`: **off**: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, checking is disabled (off): - - lower - use one or more lower latin characters - - upper - use one or more upper latin characters - - digit - use one or more digits - - spec - use one or more special characters as ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~`` - - off - do not check password complexity -- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed. -- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security. -- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24. - -## Camo (`camo`) - -- `ENABLED`: **false**: Enable media proxy, we support images only at the moment. -- `SERVER_URL`: **_empty_**: URL of camo server, it **is required** if camo is enabled. -- `HMAC_KEY`: **_empty_**: Provide the HMAC key for encoding URLs, it **is required** if camo is enabled. -- `ALLWAYS`: **false**: Set to true to use camo for both HTTP and HTTPS content, otherwise only non-HTTPS URLs are proxied - -## OpenID (`openid`) - -- `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID. -- `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID. -- `WHITELISTED_URIS`: **_empty_**: If non-empty, list of POSIX regex patterns matching - OpenID URI's to permit. -- `BLACKLISTED_URIS`: **_empty_**: If non-empty, list of POSIX regex patterns matching - OpenID URI's to block. - -## OAuth2 Client (`oauth2_client`) - -- `REGISTER_EMAIL_CONFIRM`: _[service]_ **REGISTER\_EMAIL\_CONFIRM**: Set this to enable or disable email confirmation of OAuth2 auto-registration. (Overwrites the REGISTER\_EMAIL\_CONFIRM setting of the `[service]` section) -- `OPENID_CONNECT_SCOPES`: **_empty_**: List of additional openid connect scopes. (`openid` is implicitly added) -- `ENABLE_AUTO_REGISTRATION`: **false**: Automatically create user accounts for new oauth2 users. -- `USERNAME`: **nickname**: The source of the username for new oauth2 accounts: - - `userid` - use the userid / sub attribute - - `nickname` - use the nickname attribute - - `email` - use the username part of the email attribute - - Note: `nickname` and `email` options will normalize input strings using the following criteria: - - diacritics are removed - - the characters in the set `['´\x60]` are removed - - the characters in the set `[\s~+]` are replaced with `-` -- `UPDATE_AVATAR`: **false**: Update avatar if available from oauth2 provider. Update will be performed on each login. -- `ACCOUNT_LINKING`: **login**: How to handle if an account / email already exists: - - disabled - show an error - - login - show an account linking login - - auto - automatically link with the account (Please be aware that this will grant access to an existing account just because the same username or email is provided. You must make sure that this does not cause issues with your authentication providers.) - -## Service (`service`) - -- `ACTIVE_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm account/email registration. -- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset - process. -- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. - Requires `Mailer` to be enabled. -- `REGISTER_MANUAL_CONFIRM`: **false**: Enable this to manually confirm new registrations. - Requires `REGISTER_EMAIL_CONFIRM` to be disabled. -- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create - accounts for users. -- `REQUIRE_EXTERNAL_REGISTRATION_PASSWORD`: **false**: Enable this to force externally created - accounts (via GitHub, OpenID Connect, etc) to create a password. Warning: enabling this will - decrease security, so you should only enable it if you know what you're doing. -- `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page or to use API. -- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when - something happens, like creating issues. Requires `Mailer` to be enabled. -- `ENABLE_BASIC_AUTHENTICATION`: **true**: Disable this to disallow authentication using HTTP - BASIC and the user's password. Please note if you disable this you will not be able to access the - tokens API endpoints using a password. Further, this only disables BASIC authentication using the - password - not tokens or OAuth Basic. -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication for web requests -- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. -- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration - for reverse authentication. -- `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a - provided email rather than a generated email. -- `ENABLE_REVERSE_PROXY_FULL_NAME`: **false**: Enable this to allow to auto-registration with a - provided full name for the user. -- `ENABLE_CAPTCHA`: **false**: Enable this to use captcha validation for registration. -- `REQUIRE_CAPTCHA_FOR_LOGIN`: **false**: Enable this to require captcha validation for login. You also must enable `ENABLE_CAPTCHA`. -- `REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA`: **false**: Enable this to force captcha validation - even for External Accounts (i.e. GitHub, OpenID Connect, etc). You also must enable `ENABLE_CAPTCHA`. -- `CAPTCHA_TYPE`: **image**: \[image, recaptcha, hcaptcha, mcaptcha, cfturnstile\] -- `RECAPTCHA_SECRET`: **""**: Go to https://www.google.com/recaptcha/admin to get a secret for recaptcha. -- `RECAPTCHA_SITEKEY`: **""**: Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha. -- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**: Set the recaptcha url - allows the use of recaptcha net. -- `HCAPTCHA_SECRET`: **""**: Sign up at https://www.hcaptcha.com/ to get a secret for hcaptcha. -- `HCAPTCHA_SITEKEY`: **""**: Sign up at https://www.hcaptcha.com/ to get a sitekey for hcaptcha. -- `MCAPTCHA_SECRET`: **""**: Go to your mCaptcha instance to get a secret for mCaptcha. -- `MCAPTCHA_SITEKEY`: **""**: Go to your mCaptcha instance to get a sitekey for mCaptcha. -- `MCAPTCHA_URL` **https://demo.mcaptcha.org/**: Set the mCaptcha URL. -- `CF_TURNSTILE_SECRET` **""**: Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a secret for cloudflare turnstile. -- `CF_TURNSTILE_SITEKEY` **""**: Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a sitekey for cloudflare turnstile. -- `DEFAULT_KEEP_EMAIL_PRIVATE`: **false**: By default set users to keep their email address private. -- `DEFAULT_ALLOW_CREATE_ORGANIZATION`: **true**: Allow new users to create organizations by default. -- `DEFAULT_USER_IS_RESTRICTED`: **false**: Give new users restricted permissions by default -- `DEFAULT_ENABLE_DEPENDENCIES`: **true**: Enable this to have dependencies enabled by default. -- `ALLOW_CROSS_REPOSITORY_DEPENDENCIES` : **true** Enable this to allow dependencies on issues from any repository where the user is granted access. -- `USER_LOCATION_MAP_URL`: **""**: A map service URL to show user's location on a map. The location will be appended to the URL as escaped query parameter. -- `ENABLE_USER_HEATMAP`: **true**: Enable this to display the heatmap on users profiles. -- `ENABLE_TIMETRACKING`: **true**: Enable Timetracking feature. -- `DEFAULT_ENABLE_TIMETRACKING`: **true**: Allow repositories to use timetracking by default. -- `DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME`: **true**: Only allow users with write permissions to track time. -- `EMAIL_DOMAIN_ALLOWLIST`: **_empty_**: If non-empty, comma separated list of domain names that can only be used to register on this instance, wildcard is supported. -- `EMAIL_DOMAIN_BLOCKLIST`: **_empty_**: If non-empty, comma separated list of domain names that cannot be used to register on this instance, wildcard is supported. -- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button -- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** Enable this to show the milestones dashboard page - a view of all the user's milestones -- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created -- `AUTO_WATCH_ON_CHANGES`: **false**: Enable this to make users watch a repository after their first commit to it -- `DEFAULT_USER_VISIBILITY`: **public**: Set default visibility mode for users, either "public", "limited" or "private". -- `ALLOWED_USER_VISIBILITY_MODES`: **public,limited,private**: Set which visibility modes a user can have -- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private". -- `DEFAULT_ORG_MEMBER_VISIBLE`: **false** True will make the membership of the users visible when added to the organisation. -- `ALLOW_ONLY_INTERNAL_REGISTRATION`: **false** Set to true to force registration only via Gitea. -- `ALLOW_ONLY_EXTERNAL_REGISTRATION`: **false** Set to true to force registration only using third-party services. -- `NO_REPLY_ADDRESS`: **noreply.DOMAIN** Value for the domain part of the user's email address in the Git log if user has set KeepEmailPrivate to true. DOMAIN resolves to the value in server.DOMAIN. - The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS. -- `USER_DELETE_WITH_COMMENTS_MAX_TIME`: **0** Minimum amount of time a user must exist before comments are kept when the user is deleted. -- `VALID_SITE_URL_SCHEMES`: **http, https**: Valid site url schemes for user profiles - -### Service - Explore (`service.explore`) - -- `REQUIRE_SIGNIN_VIEW`: **false**: Only allow signed in users to view the explore pages. -- `DISABLE_USERS_PAGE`: **false**: Disable the users explore page. - -## SSH Minimum Key Sizes (`ssh.minimum_key_sizes`) - -Define allowed algorithms and their minimum key length (use -1 to disable a type): - -- `ED25519`: **256** -- `ECDSA`: **256** -- `RSA`: **3071**: We set 3071 here because an otherwise valid 3072 RSA key can be reported as 3071 length. -- `DSA`: **-1**: DSA is now disabled by default. Set to **1024** to re-enable but ensure you may need to reconfigure your SSHD provider - -## Webhook (`webhook`) - -- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value. -- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks. -- `ALLOWED_HOST_LIST`: **external**: Webhook can only call allowed hosts for security reasons. Comma separated list. - - Built-in networks: - - `loopback`: 127.0.0.0/8 for IPv4 and ::1/128 for IPv6, localhost is included. - - `private`: RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and RFC 4193 (FC00::/7). Also called LAN/Intranet. - - `external`: A valid non-private unicast IP, you can access all hosts on public internet. - - `*`: All hosts are allowed. - - CIDR list: `1.2.3.0/8` for IPv4 and `2001:db8::/32` for IPv6 - - Wildcard hosts: `*.mydomain.com`, `192.168.100.*` -- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification. -- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page. -- `PROXY_URL`: **_empty_**: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy. If not given, will use global proxy setting. -- `PROXY_HOSTS`: **_empty_`**: Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. If not given, will use global proxy setting. - -## Mailer (`mailer`) - -⚠️ This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older, -please refer to -[Gitea 1.17 app.ini example](https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini) -and -[Gitea 1.17 configuration document](https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md) - -- `ENABLED`: **false**: Enable to use a mail service. -- `PROTOCOL`: **_empty_**: Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". _Before 1.18, this was inferred from a combination of `MAILER_TYPE` and `IS_TLS_ENABLED`._ - - SMTP family, if your provider does not explicitly say which protocol it uses but does provide a port, you can set SMTP_PORT instead and this will be inferred. - - **sendmail** Use the operating system's `sendmail` command instead of SMTP. This is common on Linux systems. - - **dummy** Send email messages to the log as a testing phase. - - Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM`, `SUBJECT_PREFIX` and `SENDMAIL_PATH`. - - Enabling dummy will ignore all settings except `ENABLED`, `SUBJECT_PREFIX` and `FROM`. -- `SMTP_ADDR`: **_empty_**: Mail server address. e.g. smtp.gmail.com. For smtp+unix, this should be a path to a unix socket instead. _Before 1.18, this was combined with `SMTP_PORT` under the name `HOST`._ -- `SMTP_PORT`: **_empty_**: Mail server port. If no protocol is specified, it will be inferred by this setting. Common ports are listed below. _Before 1.18, this was combined with `SMTP_ADDR` under the name `HOST`._ - - 25: insecure SMTP - - 465: SMTP Secure - - 587: StartTLS -- `USE_CLIENT_CERT`: **false**: Use client certificate for TLS/SSL. -- `CLIENT_CERT_FILE`: **custom/mailer/cert.pem**: Client certificate file. -- `CLIENT_KEY_FILE`: **custom/mailer/key.pem**: Client key file. -- `FORCE_TRUST_SERVER_CERT`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe. Consider adding the certificate to the system trust store instead. -- `USER`: **_empty_**: Username of mailing user (usually the sender's e-mail address). -- `PASSWD`: **_empty_**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password. - - Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or SMTP host is localhost. See [Email Setup](administration/email-setup.md) for more information. -- `ENABLE_HELO`: **true**: Enable HELO operation. -- `HELO_HOSTNAME`: **(retrieved from system)**: HELO hostname. -- `FROM`: **_empty_**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format. -- `ENVELOPE_FROM`: **_empty_**: Address set as the From address on the SMTP mail envelope. Set to `<>` to send an empty address. -- `SUBJECT_PREFIX`: **_empty_**: Prefix to be placed before e-mail subject lines. -- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be command or full path). -- `SENDMAIL_ARGS`: **_empty_**: Specify any extra sendmail arguments. (NOTE: you should be aware that email addresses can look like options - if your `sendmail` command takes options you must set the option terminator `--`) -- `SENDMAIL_TIMEOUT`: **5m**: default timeout for sending email through sendmail -- `SENDMAIL_CONVERT_CRLF`: **true**: Most versions of sendmail prefer LF line endings rather than CRLF line endings. Set this to false if your version of sendmail requires CRLF line endings. -- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]` -- `SEND_AS_PLAIN_TEXT`: **false**: Send mails only in plain text, without HTML alternative. - -## Incoming Email (`email.incoming`) - -- `ENABLED`: **false**: Enable handling of incoming emails. -- `REPLY_TO_ADDRESS`: **_empty_**: The email address including the `%{token}` placeholder that will be replaced per user/action. Example: `incoming+%{token}@example.com`. The placeholder must appear in the user part of the address (before the `@`). -- `HOST`: **_empty_**: IMAP server host. -- `PORT`: **_empty_**: IMAP server port. -- `USERNAME`: **_empty_**: Username of the receiving account. -- `PASSWORD`: **_empty_**: Password of the receiving account. -- `USE_TLS`: **false**: Whether the IMAP server uses TLS. -- `SKIP_TLS_VERIFY`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe. -- `MAILBOX`: **INBOX**: The mailbox name where incoming mail will end up. -- `DELETE_HANDLED_MESSAGE`: **true**: Whether handled messages should be deleted from the mailbox. -- `MAXIMUM_MESSAGE_SIZE`: **10485760**: Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size. - -## Cache (`cache`) - -- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `redis-cluster`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.) -- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory and twoqueue cache only. -- `HOST`: **_empty_**: Connection string for `redis`, `redis-cluster` and `memcache`. For `twoqueue` sets configuration for the queue. - - Redis: `redis://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - - Redis-cluster `redis+cluster://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - - Memcache: `127.0.0.1:9090;127.0.0.1:9091` - - TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` representing the maximum number of objects stored in the cache. -- `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to -1 disables caching. - -## Cache - LastCommitCache settings (`cache.last_commit`) - -- `ITEM_TTL`: **8760h**: Time to keep items in cache if not used, Setting it to -1 disables caching. -- `COMMITS_COUNT`: **1000**: Only enable the cache when repository's commits count great than. - -## Session (`session`) - -- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, redis-cluster, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]` -- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string. Relative paths will be made absolute against _`AppWorkPath`_. -- `COOKIE_SECURE`:**_empty_**: `true` or `false`. Enable this to force using HTTPS for all session access. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL. -- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID. -- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds. -- `SESSION_LIFE_TIME`: **86400**: Session life time in seconds, default is 86400 (1 day) -- `DOMAIN`: **_empty_**: Sets the cookie Domain -- `SAME_SITE`: **lax** \[strict, lax, none\]: Set the SameSite setting for the cookie. - -## Picture (`picture`) - -- `GRAVATAR_SOURCE`: **gravatar**: Can be `gravatar`, `duoshuo` or anything like - `http://cn.gravatar.com/avatar/`. -- `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only. **DEPRECATED [v1.18+]** moved to database. Use admin panel to configure. -- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see - [http://www.libravatar.org](http://www.libravatar.org)). **DEPRECATED [v1.18+]** moved to database. Use admin panel to configure. - -- `AVATAR_STORAGE_TYPE`: **default**: Storage type defined in `[storage.xxx]`. Default is `default` which will read `[storage]` if no section `[storage]` will be a type `local`. -- `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store user avatar image files. -- `AVATAR_MAX_WIDTH`: **4096**: Maximum avatar image width in pixels. -- `AVATAR_MAX_HEIGHT`: **4096**: Maximum avatar image height in pixels. -- `AVATAR_MAX_FILE_SIZE`: **1048576** (1MiB): Maximum avatar image file size in bytes. -- `AVATAR_MAX_ORIGIN_SIZE`: **262144** (256KiB): If the uploaded file is not larger than this byte size, the image will be used as is, without resizing/converting. -- `AVATAR_RENDERED_SIZE_FACTOR`: **2**: The multiplication factor for rendered avatar images. Larger values result in finer rendering on HiDPI devices. - -- `REPOSITORY_AVATAR_STORAGE_TYPE`: **default**: Storage type defined in `[storage.xxx]`. Default is `default` which will read `[storage]` if no section `[storage]` will be a type `local`. -- `REPOSITORY_AVATAR_UPLOAD_PATH`: **data/repo-avatars**: Path to store repository avatar image files. -- `REPOSITORY_AVATAR_FALLBACK`: **none**: How Gitea deals with missing repository avatars - - none = no avatar will be displayed - - random = random avatar will be generated - - image = default image will be used (which is set in `REPOSITORY_AVATAR_FALLBACK_IMAGE`) -- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: Image used as default repository avatar (if `REPOSITORY_AVATAR_FALLBACK` is set to image and none was uploaded) - -## Project (`project`) - -Default templates for project boards: - -- `PROJECT_BOARD_BASIC_KANBAN_TYPE`: **To Do, In Progress, Done** -- `PROJECT_BOARD_BUG_TRIAGE_TYPE`: **Needs Triage, High Priority, Low Priority, Closed** - -## Issue and pull request attachments (`attachment`) - -- `ENABLED`: **true**: Whether issue and pull request attachments are enabled. -- `ALLOWED_TYPES`: **.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -- `MAX_SIZE`: **2048**: Maximum size (MB). -- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. -- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` -- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing. -- `PATH`: **attachments**: Path to store attachments only available when STORAGE_TYPE is `local`, relative paths will be resolved to `${AppDataPath}/${attachment.PATH}`. -- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when STORAGE_TYPE is `minio` -- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when STORAGE_TYPE is `minio` -- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -- `MINIO_BUCKET`: **gitea**: Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio bucket lookup type only available when `STORAGE_TYPE` is `minio` - - `auto` Auto detect - - `dns` Virtual Host Style bucket lookup - - `path` Path style bucket lookup -- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when STORAGE_TYPE is `minio` -- `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` -- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio` -- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` -- `MINIO_CHECKSUM_ALGORITHM`: **default**: Minio checksum algorithm: `default` (for MinIO or AWS S3) or `md5` (for Cloudflare or Backblaze) - -## Log (`log`) - -- `ROOT_PATH`: **_empty_**: Root path for log files. -- `MODE`: **console**: Logging mode. For multiple modes, use a comma to separate values. You can configure each mode in per mode log subsections `\[log.writer-mode-name\]`. -- `LEVEL`: **Info**: General log level. \[Trace, Debug, Info, Warn, Error, Critical, Fatal, None\] -- `STACKTRACE_LEVEL`: **None**: Default log level at which to log create stack traces (rarely useful, do not set it). \[Trace, Debug, Info, Warn, Error, Critical, Fatal, None\] -- `ENABLE_SSH_LOG`: **false**: save ssh log to log file -- `logger.access.MODE`: **_empty_**: The "access" logger -- `logger.router.MODE`: **,**: The "router" logger, a single comma means it will use the default MODE above -- `logger.xorm.MODE`: **,**: The "xorm" logger - -### Access Log (`log`) - -- `ACCESS_LOG_TEMPLATE`: **`{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"`**: Sets the template used to create the access log. - - The following variables are available: - - `Ctx`: the `context.Context` of the request. - - `Identity`: the SignedUserName or `"-"` if not logged in. - - `Start`: the start time of the request. - - `ResponseWriter`: the responseWriter from the request. - - `RequestID`: the value matching REQUEST_ID_HEADERS(default: `-`, if not matched). - - You must be very careful to ensure that this template does not throw errors or panics as this template runs outside the panic/recovery script. -- `REQUEST_ID_HEADERS`: **_empty_**: You can configure multiple values that are splited by comma here. It will match in the order of configuration, and the first match will be finally printed in the access log. - - e.g. - - In the Request Header: X-Request-ID: **test-id-123** - - Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID - - Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "**test-id-123**" ... - -### Log subsections (`log.<writer-mode-name>`) - -- `MODE`: **name**: Sets the mode of this log writer - Defaults to the provided subsection name. This allows you to have two different file loggers at different levels. -- `LEVEL`: **log.LEVEL**: Sets the log-level of this writer. Defaults to the `LEVEL` set in the global `[log]` section. -- `STACKTRACE_LEVEL`: **log.STACKTRACE_LEVEL**: Sets the log level at which to log stack traces. -- `EXPRESSION`: **""**: A regular expression to match either the function name, file or message. Defaults to empty. Only log messages that match the expression will be saved in the logger. -- `FLAGS`: **stdflags**: A comma separated string representing the log flags. Defaults to `stdflags` which represents the prefix: `2009/01/23 01:23:23 ...a/b/c/d.go:23:runtime.Caller() [I]: message`. `none` means don't prefix log lines. See `modules/log/flags.go` for more information. -- `PREFIX`: **""**: An additional prefix for every log line in this logger. Defaults to empty. -- `COLORIZE`: **false**: Whether to colorize the log lines - -### Console log mode (`log.console`, or `MODE=console`) - -- For the console logger `COLORIZE` will default to `true` if not on windows or the terminal is determined to be able to color. -- `STDERR`: **false**: Use Stderr instead of Stdout. - -### File log mode (`log.file`, or `MODE=file`) - -- `FILE_NAME`: Set the file name for this logger. Defaults to `gitea.log` (exception: access log defaults to `access.log`). If relative will be relative to the `ROOT_PATH` -- `LOG_ROTATE`: **true**: Rotate the log files. -- `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file, 28 represents 256Mb. -- `DAILY_ROTATE`: **true**: Rotate logs daily. -- `MAX_DAYS`: **7**: Delete the log file after n days -- `COMPRESS`: **true**: Compress old log files by default with gzip -- `COMPRESSION_LEVEL`: **-1**: Compression level - -### Conn log mode (`log.conn`, or `MODE=conn`) - -- `RECONNECT_ON_MSG`: **false**: Reconnect host for every single message. -- `RECONNECT`: **false**: Try to reconnect when connection is lost. -- `PROTOCOL`: **tcp**: Set the protocol, either "tcp", "unix" or "udp". -- `ADDR`: **:7020**: Sets the address to connect to. - -## Cron (`cron`) - -- `ENABLED`: **false**: Enable to run all cron tasks periodically with default settings. -- `RUN_AT_START`: **false**: Run cron tasks at application start-up. -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. - -- `SCHEDULE` accept formats - - Full crontab specs, e.g. `* * * * * ?` - - Descriptors, e.g. `@midnight`, `@every 1h30m` ... - - See more: [cron documentation](https://pkg.go.dev/github.com/gogs/cron@v0.0.0-20171120032916-9f6c956d3e14) - -### Basic cron tasks - enabled by default - -#### Cron - Cleanup old repository archives (`cron.archive_cleanup`) - -- `ENABLED`: **true**: Enable service. -- `RUN_AT_START`: **true**: Run tasks at start up time (if ENABLED). -- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -- `OLDER_THAN`: **24h**: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`. - -#### Cron - Update Mirrors (`cron.update_mirrors`) - -- `SCHEDULE`: **@every 10m**: Cron syntax for scheduling update mirrors, e.g. `@every 3h`. -- `PULL_LIMIT`: **50**: Limit the number of mirrors added to the queue to this number (negative values mean no limit, 0 will result in no mirrors being queued effectively disabling pull mirror updating). -- `PUSH_LIMIT`: **50**: Limit the number of mirrors added to the queue to this number (negative values mean no limit, 0 will result in no mirrors being queued effectively disabling push mirror updating). - -#### Cron - Repository Health Check (`cron.repo_health_check`) - -- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository health check. -- `TIMEOUT`: **60s**: Time duration syntax for health check execution timeout. -- `ARGS`: **_empty_**: Arguments for command `git fsck`, e.g. `--unreachable --tags`. See more on http://git-scm.com/docs/git-fsck - -#### Cron - Repository Statistics Check (`cron.check_repo_stats`) - -- `RUN_AT_START`: **true**: Run repository statistics check at start time. -- `SCHEDULE`: **@midnight**: Cron syntax for scheduling repository statistics check. - -#### Cron - Cleanup hook_task Table (`cron.cleanup_hook_task_table`) - -- `ENABLED`: **true**: Enable cleanup hook_task job. -- `RUN_AT_START`: **false**: Run cleanup hook_task at start time (if ENABLED). -- `SCHEDULE`: **@midnight**: Cron syntax for cleaning hook_task table. -- `CLEANUP_TYPE` **OlderThan** OlderThan or PerWebhook Method to cleanup hook_task, either by age (i.e. how long ago hook_task record was delivered) or by the number to keep per webhook (i.e. keep most recent x deliveries per webhook). -- `OLDER_THAN`: **168h**: If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted. -- `NUMBER_TO_KEEP`: **10**: If CLEANUP_TYPE is set to PerWebhook, this is number of hook_task records to keep for a webhook (i.e. keep the most recent x deliveries). - -#### Cron - Cleanup expired packages (`cron.cleanup_packages`) - -- `ENABLED`: **true**: Enable cleanup expired packages job. -- `RUN_AT_START`: **true**: Run job at start time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Notify every time this job runs. -- `SCHEDULE`: **@midnight**: Cron syntax for the job. -- `OLDER_THAN`: **24h**: Unreferenced package data created more than OLDER_THAN ago is subject to deletion. - -#### Cron - Update Migration Poster ID (`cron.update_migration_poster_id`) - -- `SCHEDULE`: **@midnight** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts. - -#### Cron - Sync External Users (`cron.sync_external_users`) - -- `SCHEDULE`: **@midnight** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts. -- `UPDATE_EXISTING`: **true**: Create new users, update existing user data and disable users that are not in external source anymore (default) or only create new users if UPDATE_EXISTING is set to false. - -## Cron - Cleanup Expired Actions Assets (`cron.cleanup_actions`) - -- `ENABLED`: **true**: Enable cleanup expired actions assets job. -- `RUN_AT_START`: **true**: Run job at start time (if ENABLED). -- `SCHEDULE`: **@midnight** : Cron syntax for the job. - -### Extended cron tasks (not enabled by default) - -#### Cron - Garbage collect all repositories (`cron.git_gc_repos`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. -- `TIMEOUT`: **60s**: Time duration syntax for garbage collection execution timeout. -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `ARGS`: **_empty_**: Arguments for command `git gc`, e.g. `--aggressive --auto`. The default value is same with [git] -> GC_ARGS - -#### Cron - Update the '.ssh/authorized_keys' file with Gitea SSH keys (`cron.resync_all_sshkeys`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. - -#### Cron - Resynchronize pre-receive, update and post-receive hooks of all repositories (`cron.resync_all_hooks`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. - -#### Cron - Reinitialize all missing Git repositories for which records exist (`cron.reinit_missing_repos`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. - -#### Cron - Delete all repositories missing their Git files (`cron.delete_missing_repos`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. - -#### Cron - Delete generated repository avatars (`cron.delete_generated_repository_avatars`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. - -#### Cron - Delete all old actions from database (`cron.delete_old_actions`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NOTICE_ON_SUCCESS`: **false**: Set to true to switch on success notices. -- `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. -- `OLDER_THAN`: **8760h**: any action older than this expression will be deleted from database, suggest using `8760h` (1 year) because that's the max length of heatmap. - -#### Cron - Check for new Gitea versions (`cron.update_checker`) - -- `ENABLED`: **true**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `ENABLE_SUCCESS_NOTICE`: **true**: Set to false to switch off success notices. -- `SCHEDULE`: **@every 168h**: Cron syntax for scheduling a work, e.g. `@every 168h`. -- `HTTP_ENDPOINT`: **https://dl.gitea.com/gitea/version.json**: the endpoint that Gitea will check for newer versions - -#### Cron - Delete all old system notices from database (`cron.delete_old_system_notices`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `NO_SUCCESS_NOTICE`: **false**: Set to true to switch off success notices. -- `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check. -- `OLDER_THAN`: **8760h**: any system notice older than this expression will be deleted from database. - -#### Cron - Garbage collect LFS pointers in repositories (`cron.gc_lfs`) - -- `ENABLED`: **false**: Enable service. -- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED). -- `SCHEDULE`: **@every 24h**: Cron syntax to set how often to check. -- `OLDER_THAN`: **168h**: Only attempt to garbage collect LFSMetaObjects older than this (default 7 days) -- `LAST_UPDATED_MORE_THAN_AGO`: **72h**: Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days) -- `NUMBER_TO_CHECK_PER_REPO`: **100**: Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all. -- `PROPORTION_TO_CHECK_PER_REPO`: **0.6**: Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.) - -## Git (`git`) - -- `PATH`: **""**: The path of Git executable. If empty, Gitea searches through the PATH environment. -- `HOME_PATH`: **%(APP_DATA_PATH)s/home**: The HOME directory for Git. - This directory will be used to contain the `.gitconfig` and possible `.gnupg` directories that Gitea's git calls will use. If you can confirm Gitea is the only application running in this environment, you can set it to the normal home directory for Gitea user. -- `DISABLE_DIFF_HIGHLIGHT`: **false**: Disables highlight of added and removed changes. -- `MAX_GIT_DIFF_LINES`: **1000**: Max number of lines allowed of a single file in diff view. -- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view. -- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view. -- `COMMITS_RANGE_SIZE`: **50**: Set the default commits range size -- `BRANCHES_RANGE_SIZE`: **20**: Set the default branches range size -- `GC_ARGS`: **_empty_**: Arguments for command `git gc`, e.g. `--aggressive --auto`. See more on http://git-scm.com/docs/git-gc/ -- `ENABLE_AUTO_GIT_WIRE_PROTOCOL`: **true**: If use Git wire protocol version 2 when Git version >= 2.18, default is true, set to false when you always want Git wire protocol version 1. - To enable this for Git over SSH when using a OpenSSH server, add `AcceptEnv GIT_PROTOCOL` to your sshd_config file. -- `PULL_REQUEST_PUSH_MESSAGE`: **true**: Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled) -- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed. -- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay. -- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.) -- `DISABLE_CORE_PROTECT_NTFS`: **false** Set to true to forcibly set `core.protectNTFS` to false. -- `DISABLE_PARTIAL_CLONE`: **false** Disable the usage of using partial clones for git. - -### Git - Timeout settings (`git.timeout`) - -- `DEFAULT`: **360**: Git operations default timeout seconds. -- `MIGRATE`: **600**: Migrate external repositories timeout seconds. -- `MIRROR`: **300**: Mirror external repositories timeout seconds. -- `CLONE`: **300**: Git clone from internal repositories timeout seconds. -- `PULL`: **300**: Git pull from internal repositories timeout seconds. -- `GC`: **60**: Git repository GC timeout seconds. - -### Git - Config options (`git.config`) - -The key/value pairs in this section will be used as git config. -This section only does "set" config, a removed config key from this section won't be removed from git config automatically. The format is `some.configKey = value`. - -- `diff.algorithm`: **histogram** -- `core.logAllRefUpdates`: **true** -- `gc.reflogExpire`: **90** - -## Metrics (`metrics`) - -- `ENABLED`: **false**: Enables /metrics endpoint for prometheus. -- `ENABLED_ISSUE_BY_LABEL`: **false**: Enable issue by label metrics with format `gitea_issues_by_label{label="bug"} 2`. -- `ENABLED_ISSUE_BY_REPOSITORY`: **false**: Enable issue by repository metrics with format `gitea_issues_by_repository{repository="org/repo"} 5`. -- `TOKEN`: **_empty_**: You need to specify the token, if you want to include in the authorization the metrics . The same token need to be used in prometheus parameters `bearer_token` or `bearer_token_file`. - -## API (`api`) - -- `ENABLE_SWAGGER`: **true**: Enables the API documentation endpoints (`/api/swagger`, `/api/v1/swagger`, …). True or false. -- `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page. -- `DEFAULT_PAGING_NUM`: **30**: Default paging number of API. -- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Default and maximum number of items per page for Git trees API. -- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): Default max size of a blob that can be returned by the blobs API. - -## OAuth2 (`oauth2`) - -- `ENABLED`: **true**: Enables OAuth2 provider. -- `ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds -- `REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 refresh token in hours -- `INVALIDATE_REFRESH_TOKENS`: **false**: Check if refresh token has already been used -- `JWT_SIGNING_ALGORITHM`: **RS256**: Algorithm used to sign OAuth2 tokens. Valid values: \[`HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`\] -- `JWT_SECRET`: **_empty_**: OAuth2 authentication secret for access and refresh tokens, change this to a unique string. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `HS256`, `HS384` or `HS512`. -- `JWT_SECRET_URI`: **_empty_**: Instead of defining JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/oauth2_jwt_secret`) -- `JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `APP_DATA_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you. -- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider -- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager, tea**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options. - -## i18n (`i18n`) - -- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN**: - List of locales shown in language selector. The first locale will be used as the default if user browser's language doesn't match any locale in the list. -- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Türkçe,Čeština,Српски,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia,മലയാളം**: Visible names corresponding to the locales - -## Markup (`markup`) - -- `MERMAID_MAX_SOURCE_CHARACTERS`: **5000**: Set the maximum size of a Mermaid source. (Set to -1 to disable) - -Gitea can support Markup using external tools. The example below will add a markup named `asciidoc`. - -```ini -[markup.asciidoc] -ENABLED = true -NEED_POSTPROCESS = true -FILE_EXTENSIONS = .adoc,.asciidoc -RENDER_COMMAND = "asciidoctor --embedded --safe-mode=secure --out-file=- -" -IS_INPUT_FILE = false -``` - -- ENABLED: **false** Enable markup support; set to **true** to enable this renderer. -- NEED\_POSTPROCESS: **true** set to **true** to replace links / sha1 and etc. -- FILE\_EXTENSIONS: **_empty_** List of file extensions that should be rendered by an external - command. Multiple extensions needs a comma as splitter. -- RENDER\_COMMAND: External command to render all matching extensions. -- IS\_INPUT\_FILE: **false** Input is not a standard input but a file param followed `RENDER_COMMAND`. -- RENDER_CONTENT_MODE: **sanitized** How the content will be rendered. - - sanitized: Sanitize the content and render it inside current page, default to only allow a few HTML tags and attributes. Customized sanitizer rules can be defined in `[markup.sanitizer.*]`. - - no-sanitizer: Disable the sanitizer and render the content inside current page. It's **insecure** and may lead to XSS attack if the content contains malicious code. - - iframe: Render the content in a separate standalone page and embed it into current page by iframe. The iframe is in sandbox mode with same-origin disabled, and the JS code are safely isolated from parent page. - -Two special environment variables are passed to the render command: - -- `GITEA_PREFIX_SRC`, which contains the current URL prefix in the `src` path tree. To be used as prefix for links. -- `GITEA_PREFIX_RAW`, which contains the current URL prefix in the `raw` path tree. To be used as prefix for image paths. - -If `RENDER_CONTENT_MODE` is `sanitized`, Gitea supports customizing the sanitization policy for rendered HTML. The example below will support KaTeX output from pandoc. - -```ini -[markup.sanitizer.TeX] -; Pandoc renders TeX segments as <span>s with the "math" class, optionally -; with "inline" or "display" classes depending on context. -ELEMENT = span -ALLOW_ATTR = class -REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+ -ALLOW_DATA_URI_IMAGES = true -``` - -- `ELEMENT`: The element this policy applies to. Must be non-empty. -- `ALLOW_ATTR`: The attribute this policy allows. Must be non-empty. -- `REGEXP`: A regex to match the contents of the attribute against. Must be present but may be empty for unconditional whitelisting of this attribute. -- `ALLOW_DATA_URI_IMAGES`: **false** Allow data uri images (`<img src="data:image/png;base64,..."/>`). - -Multiple sanitisation rules can be defined by adding unique subsections, e.g. `[markup.sanitizer.TeX-2]`. -To apply a sanitisation rules only for a specify external renderer they must use the renderer name, e.g. `[markup.sanitizer.asciidoc.rule-1]`. -If the rule is defined above the renderer ini section or the name does not match a renderer it is applied to every renderer. - -## Highlight Mappings (`highlight.mapping`) - -- `file_extension e.g. .toml`: **language e.g. ini**. File extension to language mapping overrides. - -- Gitea will highlight files using the `linguist-language` or `gitlab-language` attribute from the `.gitattributes` file -if available. If this is not set or the language is unavailable, the file extension will be looked up -in this mapping or the filetype using heuristics. - -## Time (`time`) - -- `DEFAULT_UI_LOCATION`: Default location of time on the UI, so that we can display correct user's time on UI. i.e. Asia/Shanghai - -## Task (`task`) - -Task queue configuration has been moved to `queue.task`. However, the below configuration values are kept for backwards compatibility: - -- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`. -- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`. -- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://123@127.0.0.1:6379/0` or `redis+cluster://123@127.0.0.1:6379/0`. - -## Migrations (`migrations`) - -- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations. -- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds) -- `ALLOWED_DOMAINS`: **_empty_**: Domains allowlist for migrating repositories, default is blank. It means everything will be allowed. Multiple domains could be separated by commas. Wildcard is supported: `github.com, *.github.com`. -- `BLOCKED_DOMAINS`: **_empty_**: Domains blocklist for migrating repositories, default is blank. Multiple domains could be separated by commas. When `ALLOWED_DOMAINS` is not blank, this option has a higher priority to deny domains. Wildcard is supported. -- `ALLOW_LOCALNETWORKS`: **false**: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291. If a domain is allowed by `ALLOWED_DOMAINS`, this option will be ignored. -- `SKIP_TLS_VERIFY`: **false**: Allow skip tls verify - -## Federation (`federation`) - -- `ENABLED`: **false**: Enable/Disable federation capabilities -- `SHARE_USER_STATISTICS`: **true**: Enable/Disable user statistics for nodeinfo if federation is enabled -- `MAX_SIZE`: **4**: Maximum federation request and response size (MB) - - WARNING: Changing the settings below can break federation. - -- `ALGORITHMS`: **rsa-sha256, rsa-sha512, ed25519**: HTTP signature algorithms -- `DIGEST_ALGORITHM`: **SHA-256**: HTTP signature digest algorithm -- `GET_HEADERS`: **(request-target), Date**: GET headers for federation requests -- `POST_HEADERS`: **(request-target), Date, Digest**: POST headers for federation requests - -## Packages (`packages`) - -- `ENABLED`: **true**: Enable/Disable package registry capabilities -- `CHUNKED_UPLOAD_PATH`: **tmp/package-upload**: Path for chunked uploads. Defaults to `APP_DATA_PATH` + `tmp/package-upload` -- `LIMIT_TOTAL_OWNER_COUNT`: **-1**: Maximum count of package versions a single owner can have (`-1` means no limits) -- `LIMIT_TOTAL_OWNER_SIZE`: **-1**: Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_ALPINE`: **-1**: Maximum size of an Alpine upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CARGO`: **-1**: Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CHEF`: **-1**: Maximum size of a Chef upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_COMPOSER`: **-1**: Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CONAN`: **-1**: Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CONDA`: **-1**: Maximum size of a Conda upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CONTAINER`: **-1**: Maximum size of a Container upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_CRAN`: **-1**: Maximum size of a CRAN upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_DEBIAN`: **-1**: Maximum size of a Debian upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_GENERIC`: **-1**: Maximum size of a Generic upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_GO`: **-1**: Maximum size of a Go upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_HELM`: **-1**: Maximum size of a Helm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_MAVEN`: **-1**: Maximum size of a Maven upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_NPM`: **-1**: Maximum size of a npm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_NUGET`: **-1**: Maximum size of a NuGet upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_PUB`: **-1**: Maximum size of a Pub upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_PYPI`: **-1**: Maximum size of a PyPI upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_RPM`: **-1**: Maximum size of a RPM upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_RUBYGEMS`: **-1**: Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_SWIFT`: **-1**: Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -- `LIMIT_SIZE_VAGRANT`: **-1**: Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) - -## Mirror (`mirror`) - -- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo. -- `DISABLE_NEW_PULL`: **false**: Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. -- `DISABLE_NEW_PUSH`: **false**: Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. -- `DEFAULT_INTERVAL`: **8h**: Default interval between each check -- `MIN_INTERVAL`: **10m**: Minimum interval for checking. (Must be >1m). - -## LFS (`lfs`) - -Storage configuration for lfs data. It will be derived from default `[storage]` or -`[storage.xxx]` when set `STORAGE_TYPE` to `xxx`. When derived, the default of `PATH` -is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`. - -- `STORAGE_TYPE`: **local**: Storage type for lfs, `local` for local disk or `minio` for s3 compatible object storage service or other name defined with `[storage.xxx]` -- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing. -- `PATH`: **./data/lfs**: Where to store LFS files, only available when `STORAGE_TYPE` is `local`. If not set it fall back to deprecated LFS_CONTENT_PATH value in [server] section. -- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when `STORAGE_TYPE is` `minio` -- `MINIO_BUCKET`: **gitea**: Minio bucket to store the lfs only available when `STORAGE_TYPE` is `minio` -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio bucket lookup type only available when `STORAGE_TYPE` is `minio` - - `auto` Auto detect - - `dns` Virtual Host Style bucket lookup - - `path` Path style bucket lookup -- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` -- `MINIO_BASE_PATH`: **lfs/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio` -- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` -- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` - -## Storage (`storage`) - -Default storage configuration for attachments, lfs, avatars, repo-avatars, repo-archive, packages, actions_log, actions_artifact. - -- `STORAGE_TYPE`: **local**: Storage type, `local` for local disk or `minio` for s3 compatible object storage service. -- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing. -- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when `STORAGE_TYPE is` `minio` -- `MINIO_BUCKET`: **gitea**: Minio bucket to store the data only available when `STORAGE_TYPE` is `minio` -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio bucket lookup type only available when `STORAGE_TYPE` is `minio` - - `auto` Auto detect - - `dns` Virtual Host Style bucket lookup - - `path` Path style bucket lookup -- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` -- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` -- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` - -The recommended storage configuration for minio like below: - -```ini -[storage] -STORAGE_TYPE = minio -; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -MINIO_ENDPOINT = localhost:9000 -; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio` -MINIO_ACCESS_KEY_ID = -; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -MINIO_SECRET_ACCESS_KEY = -; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -MINIO_BUCKET = gitea -; Minio location to create bucket only available when STORAGE_TYPE is `minio` -MINIO_LOCATION = us-east-1 -; Minio enabled ssl only available when STORAGE_TYPE is `minio` -MINIO_USE_SSL = false -; Minio skip SSL verification available when STORAGE_TYPE is `minio` -MINIO_INSECURE_SKIP_VERIFY = false -SERVE_DIRECT = true -``` - -Defaultly every storage has their default base path like below - -| storage | default base path | -| ----------------- | ------------------ | -| attachments | attachments/ | -| lfs | lfs/ | -| avatars | avatars/ | -| repo-avatars | repo-avatars/ | -| repo-archive | repo-archive/ | -| packages | packages/ | -| actions_log | actions_log/ | -| actions_artifacts | actions_artifacts/ | - -And bucket, basepath or `SERVE_DIRECT` could be special or overrided, if you want to use a different you can: - -```ini -[storage.actions_log] -MINIO_BUCKET = gitea_actions_log -SERVE_DIRECT = true -MINIO_BASE_PATH = my_actions_log/ ; default is actions_log/ if blank -``` - -If you want to customerize a different storage for `lfs` if above default storage defined - -```ini -[lfs] -STORAGE_TYPE = my_minio - -[storage.my_minio] -STORAGE_TYPE = minio -; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -MINIO_ENDPOINT = localhost:9000 -; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio` -MINIO_ACCESS_KEY_ID = -; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -MINIO_SECRET_ACCESS_KEY = -; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -MINIO_BUCKET = gitea -; Minio location to create bucket only available when STORAGE_TYPE is `minio` -MINIO_LOCATION = us-east-1 -; Minio enabled ssl only available when STORAGE_TYPE is `minio` -MINIO_USE_SSL = false -; Minio skip SSL verification available when STORAGE_TYPE is `minio` -MINIO_INSECURE_SKIP_VERIFY = false -``` - -## Repository Archive Storage (`storage.repo-archive`) - -Configuration for repository archive storage. It will inherit from default `[storage]` or -`[storage.xxx]` when set `STORAGE_TYPE` to `xxx`. The default of `PATH` -is `data/repo-archive` and the default of `MINIO_BASE_PATH` is `repo-archive/`. - -- `STORAGE_TYPE`: **local**: Storage type for repo archive, `local` for local disk or `minio` for s3 compatible object storage service or other name defined with `[storage.xxx]` -- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing. -- `PATH`: **./data/repo-archive**: Where to store archive files, only available when `STORAGE_TYPE` is `local`. -- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio` -- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when `STORAGE_TYPE is` `minio` -- `MINIO_BUCKET`: **gitea**: Minio bucket to store the lfs only available when `STORAGE_TYPE` is `minio` -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio bucket lookup type only available when `STORAGE_TYPE` is `minio` - - `auto` Auto detect - - `dns` Virtual Host Style bucket lookup - - `path` Path style bucket lookup -- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio` -- `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio` -- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio` -- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio` - -## Repository Archives (`repo-archive`) - -- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` -- `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` - -## Proxy (`proxy`) - -- `PROXY_ENABLED`: **false**: Enable the proxy if true, all requests to external via HTTP will be affected, if false, no proxy will be used even environment http_proxy/https_proxy -- `PROXY_URL`: **_empty_**: Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy -- `PROXY_HOSTS`: **_empty_**: Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. - -i.e. - -```ini -PROXY_ENABLED = true -PROXY_URL = socks://127.0.0.1:1080 -PROXY_HOSTS = *.github.com -``` - -## Actions (`actions`) - -- `ENABLED`: **true**: Enable/Disable actions capabilities -- `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance. -- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]` -- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio` -- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step. -- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time -- `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time -- `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time -- `SKIP_WORKFLOW_STRINGS`: **[skip ci],[ci skip],[no ci],[skip actions],[actions skip]**: Strings committers can place inside a commit message or PR title to skip executing the corresponding actions workflow - -`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path. -For example, `uses: actions/checkout@v4` means `https://github.com/actions/checkout@v4` since the value of `DEFAULT_ACTIONS_URL` is `github`. -And it can be changed to `self` to make it `root_url_of_your_gitea/actions/checkout@v4`. - -Please note that using `self` is not recommended for most cases, as it could make names globally ambiguous. -Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it. -Therefore, please use `self` only if you understand what you are doing. - -In earlier versions (`<= 1.19`), `DEFAULT_ACTIONS_URL` could be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. -However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`. -However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub). -Like `uses: https://gitea.com/actions/checkout@v4` or `uses: http://your-git-server/actions/checkout@v4`. - -## Other (`other`) - -- `SHOW_FOOTER_VERSION`: **true**: Show Gitea and Go version information in the footer. -- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer. -- `ENABLE_SITEMAP`: **true**: Generate sitemap. -- `ENABLE_FEED`: **true**: Enable/Disable RSS/Atom feed. diff --git a/docs/content/administration/config-cheat-sheet.zh-cn.md b/docs/content/administration/config-cheat-sheet.zh-cn.md deleted file mode 100644 index 19b1b6c774..0000000000 --- a/docs/content/administration/config-cheat-sheet.zh-cn.md +++ /dev/null @@ -1,1373 +0,0 @@ ---- -date: "2016-12-26T16:00:00+02:00" -title: "配置说明" -slug: "config-cheat-sheet" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /zh-cn/config-cheat-sheet -menu: - sidebar: - parent: "administration" - name: "配置说明" - sidebar_position: 30 - identifier: "config-cheat-sheet" ---- - -# 配置说明 - -这是针对Gitea配置文件的说明, -你可以了解Gitea的强大配置。 - -需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。 -如果是从发行版本完成的安装, -配置文件的路径为`/etc/gitea/conf/app.ini`。 - -所有默认值可以通过 [app.example.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) 查看到。 -如果你发现 `%(X)s` 这样的内容,请查看 -[ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。 -标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。 - -在下面的默认值中,`$XYZ`代表环境变量`XYZ`的值(详见:`environment-to-ini`)。 _`XxYyZz`_是指默认配置的一部分列出的值。这些在 app.ini 文件中不起作用,仅在此处列出作为文档说明。 - -包含`#`或者`;`的变量必须使用引号(`` ` ``或者`""""`)包裹,否则会被解析为注释。 - -**注意:** 修改完配置文件后,需要重启 Gitea 服务才能生效。 - -## 默认配置 (非`app.ini`配置文件) - -这些值取决于环境,但构成了许多值的基础。当运行 `gitea help`或启动时,它们将 -作为默认配置的一部分进行报告。它们在那里发出的顺序略有不同,但我们将按照设置的顺序在这里列出。 - -- _`AppPath`_: Gitea二进制可执行文件的绝对路径 -- _`AppWorkPath`_: Gitea可执行文件的工作目录。 该配置可以通过以下几种方式设置,优先级依次递减: - - `app.ini`中的`WORK_PATH`配置项 - - 启动Gitea时的`--work-path`命令行参数 - - `$GITEA_WORK_DIR`环境变量 - - 在编译时设置的内置值(参见从源代码编译) - - 默认为 _`AppPath`_ 的目录 - - 如果上述任何路径为相对路径,将自动解析为相对于 _`AppPath`_ 目录的绝对路径 -- _`CustomPath`_: 这是用于自定义模板和其他选项的基础目录。 -它是通过使用以下层次结构中的第一个设置的内容来确定的: - - 通过传递给二进制文件的`--custom-path`标志 - - 环境变量 `$GITEA_CUSTOM` - - 在构建时设置的内置值(参见从源代码构建) - - 否则,默认为 _`AppWorkPath`_`/custom` - - 如果上述任何路径是相对路径,则会相对于 _`AppWorkPath`_ 目录进行处理, - 使其变为绝对路径。 -- _`CustomConf`_: 这是指向`app.ini`文件的路径。 - - 这是指向`app.ini`文件的路径。 - - 在构建时设置的内置值(参见从源代码构建) - - 否则,默认为 _`CustomPath`_`/conf/app.ini` - - 如果上述任何路径是相对路径,则会相对于_`CustomPath`_目录进行处理。 - -此外,还有_`StaticRootPath`_,可以在构建时设置为内置值,否则将默认为 _`AppWorkPath`_。 - -## Overall (`DEFAULT`) - -- `APP_NAME`: **Gitea: Git with a cup of tea** 应用名称,在网页的标题中显示。 -- `RUN_USER`: **_current OS username_/`$USER`/`$USERNAME` e.g. git**: 运行Gitea的用户, - 应当是一个专用的系统账户(非用户使用,推荐创建一个专用的`git`用户). 如果在你自己的个人电脑使用改成你自己的用户名。 - 该配置如果设置不正确,Gitea可能崩溃。 -- `RUN_MODE`: **prod**: 应用的运行模式,对运行性能和问题排除有影响: `dev` 或者 `prod`,默认为 `prod`。 `dev`模式有助于开发和问题排查, 除设置为`dev` 外,均被视为 `prod`. -- `WORK_PATH`: **_the-work-path_**: 工作目录, 前文有提及. - -## 仓库 (`repository`) - -- `ROOT`: **%(APP_DATA_PATH)s/gitea-repositories**: 存放git工程的根目录,建议填绝对路径。 - 相对路径将被解析为**_`AppWorkPath`_/%(ROOT)s**. -- `SCRIPT_TYPE`: **bash**: 服务器支持的Shell类型,通常是`bash`, - 但有些服务器也有可能是`sh`。 -- `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: 检测到的字符集的决定性顺序 - 如果检测到的字符集具有相等的置信度,则优先选择列表中较早出现的字符集,而不是较晚出现的字符集。添加“defaults”将会将未命名的字符集放置在该点。 -- `ANSI_CHARSET`: **_empty_**: 默认的ANSI字符集,用于覆盖非UTF-8字符集。 -- `FORCE_PRIVATE`: **false**: 强制使每个新仓库变为私有。 -- `DEFAULT_PRIVATE`: **last**: 创建新仓库时默认为私有。 - \[last, private, public\] -- `DEFAULT_PUSH_CREATE_PRIVATE`: **true**: 使用推送创建新仓库时默认为私有。 -- `MAX_CREATION_LIMIT`: **-1**: 每个用户的全局仓库创建上限, - `-1` 代表无限制. -- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: 要放置在列表顶部的指定许可证。 - 名称必须与 options/license 或 custom/options/license 中的文件名匹配。 -- `DISABLE_HTTP_GIT`: **false**: 禁用HTTP协议与仓库进行 - 交互的能力。 -- `USE_COMPAT_SSH_URI`: **false**: 当使用默认的SSH端口时,强制使用ssh://克隆URL, - 而不是scp-style uri。 -- `GO_GET_CLONE_URL_PROTOCOL`: **https**: 用于 "go get" 请求的值,返回仓库的URL作为https或ssh, - 默认为https。 -- `ACCESS_CONTROL_ALLOW_ORIGIN`: **_empty_**:用于 Access-Control-Allow-Origin 标头的值, -默认不提供。 -警告:如果您不提供正确的值,这可能对您的网站造成危害。 -- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: 如果非默认分支上的提交将问题标记为已关闭,则关闭该问题。 -- `ENABLE_PUSH_CREATE_USER`: **false**: 允许用户将本地存储库推送到Gitea,并为用户自动创建它们。 -- `ENABLE_PUSH_CREATE_ORG`: **false**: 允许用户将本地存储库推送到Gitea,并为组织自动创建它们。 -- `DISABLED_REPO_UNITS`: **_empty_**: 逗号分隔的全局禁用的仓库单元列表。允许的值是:: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\] -- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: 逗号分隔的默认新仓库单元列表。允许的值是:: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. 注意:目前无法停用代码和发布。如果您指定了默认的仓库单元,您仍应将它们列出以保持未来的兼容性。外部wiki和问题跟踪器不能默认启用,因为它需要额外的设置。禁用的仓库单元将不会添加到新的仓库中,无论它是否在默认列表中。 -- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: 逗号分隔的默认分叉仓库单元列表。允许的值和规则与`DEFAULT_REPO_UNITS`相同。 -- `PREFIX_ARCHIVE_FILES`: **true**: 通过将存档文件放置在以仓库命名的目录中来添加前缀。 -- `DISABLE_MIGRATIONS`: **false**: 禁用迁移功能。 -- `DISABLE_STARS`: **false**: 禁用点赞功能。 -- `DEFAULT_BRANCH`: **main**: 所有仓库的默认分支名称。 -- `ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`: **false**: 允许非管理员用户认领未被认领的仓库。 -- `ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES`: **false**: 允许非管理员用户删除未被认领的仓库。 -- `DISABLE_DOWNLOAD_SOURCE_ARCHIVES`: **false**: 不允许从用户界面下载源代码存档文件。 -- `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT`: **true**: 允许无限制得派生仓库。 - -### 仓库 - 编辑器 (`repository.editor`) - -- `LINE_WRAP_EXTENSIONS`: **.txt,.md,.markdown,.mdown,.mkd,.livemd,**: 在 Monaco 编辑器中应该换行的文件扩展名列表。用逗号分隔扩展名。要对没有扩展名的文件进行换行,只需放置一个逗号。 -- `PREVIEWABLE_FILE_MODES`: **markdown**: 具有预览API的有效文件模式,例如 `api/v1/markdown`。用逗号分隔各个值。如果文件扩展名不匹配,编辑模式下的预览选项卡将不会显示。 - -### 仓库 - 合并请求 (`repository.pull-request`) - -- `WORK_IN_PROGRESS_PREFIXES`: **WIP:,\[WIP\]**: 在拉取请求标题中用于标记工作正在进行中的前缀列表。 -这些前缀在不区分大小写的情况下进行匹配。 -- `CLOSE_KEYWORDS`: **close**, **closes**, **closed**, **fix**, **fixes**, **fixed**, **resolve**, **resolves**, **resolved**: 在拉取请求评论中用于自动关闭相关问题的关键词列表。 -- `REOPEN_KEYWORDS`: **reopen**, **reopens**, **reopened**: 在拉取请求评论中用于自动重新打开相关问题的 -关键词列表。 -- `DEFAULT_MERGE_STYLE`: **merge**: 设置创建仓库的默认合并方式,可选: `merge`, `rebase`, `rebase-merge`, `squash`, `fast-forward-only` -- `DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT`: **50**: 在默认合并消息中,对于`squash`提交,最多包括此数量的提交。设置为 -1 以包括所有提交。 -- `DEFAULT_MERGE_MESSAGE_SIZE`: **5120**: 在默认的合并消息中,对于`squash`提交,限制提交消息的大小。设置为 `-1`以取消限制。仅在`POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`为`true`时使用。 -- `DEFAULT_MERGE_MESSAGE_ALL_AUTHORS`: **false**: 在默认合并消息中,对于`squash`提交,遍历所有提交以包括所有作者的`Co-authored-by`,否则仅使用限定列表中的作者。 -- `DEFAULT_MERGE_MESSAGE_MAX_APPROVERS`: **10**:在默认合并消息中,限制列出的审批者数量为`Reviewed-by`:。设置为 `-1` 以包括所有审批者。 -- `DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY`: **true**: 在默认合并消息中,仅包括官方允许审查的审批者。 -- `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES`: **false**: 在默认的 squash 合并消息中,包括构成拉取请求的所有提交的提交消息。 -- `ADD_CO_COMMITTER_TRAILERS`: **true**: 如果提交者与作者不匹配,在合并提交消息中添加`co-authored-by`和`co-committed-by`标记。 -- `TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY`:使用三方合并方法测试`PR Patch`以发现是否存在冲突。如果此设置`true`,将使用`git apply`重新测试冲突的`PR Pathch` - 这是1.18(和之前版本)中的先前行为,但效率相对较低。如果发现需要此设置,请报告。 - -### 仓库 - 工单 (`repository.issue`) - -- `LOCK_REASONS`: **Too heated,Off-topic,Resolved,Spam**: 合并请求或工单被锁定的原因列表。 -- `MAX_PINNED`: **3**: 每个仓库的最大可固定工单数量。设置为0禁用固定工单。 - -### 仓库 - 文件上传 (`repository.upload`) - -- `ENABLED`: **true**: 是否启用仓库文件上传。 -- `TEMP_PATH`: **data/tmp/uploads**: 文件上传的临时保存路径(在Gitea重启的时候该目录会被清空)。 -- `ALLOWED_TYPES`: **_empty_**: 以逗号分割的列表,代表支持上传的文件类型。(`.zip`), mime类型 (`text/plain`) or 通配符类型 (`image/*`, `audio/*`, `video/*`). 为空或者 `*/*`代表允许所有类型文件。 -- `FILE_MAX_SIZE`: **50**: 每个文件的最大大小(MB)。 -- `MAX_FILES`: **5**: 每次上传的最大文件数。 - -### 仓库 - 版本发布 (`repository.release`) - -- `ALLOWED_TYPES`: **_empty_**: 允许发布的文件类型列表,用逗号分隔 。如压缩包类型(`.zip`), mime 类型 (`text/plain`) ,也支持通配符 (`image/*`, `audio/*`, `video/*`)。 空值或者 `*/*` 代表允许所有类型。 -- `DEFAULT_PAGING_NUM`: **10**: 默认的发布版本页面分页大小 -- 关于版本发布相关的附件设置,详见`附件`部分。 - -### 仓库 - Signing (`repository.signing`) - -- `SIGNING_KEY`: **default**: \[none, KEYID, default \]: 用于签名的密钥 -- `SIGNING_NAME` & `SIGNING_EMAIL`: 如果`SIGNING_KEY`提供了一个 KEYID,将使用这些作为签名者的姓名和电子邮件地址。这些应与密钥的公开姓名和电子邮件地址相匹配。 -- `INITIAL_COMMIT`: **always**: \[never, pubkey, twofa, always\]: 签名初始提交。 - - `never`: 永不签名 - - `pubkey`: 仅在用户具有公钥时签名 - - `twofa`: 仅在用户使用双因素身份验证登录时签名 - - `always`: 始终签名 - - 除了 never 和 always 之外的选项可以组合为逗号分隔的列表。 -- `DEFAULT_TRUST_MODEL`: **collaborator**: \[collaborator, committer, collaboratorcommitter\]: 用于验证提交的默认信任模型。 - - `collaborator`: 信任协作者密钥签名的签名。 - - `committer`: 信任与提交者匹配的签名(这与GitHub匹配,并会强制Gitea签名的提交具有Gitea作为提交者)。 - - `collaboratorcommitter`: 信任与提交者匹配的协作者密钥签名的签名。 -- `WIKI`: **never**: \[never, pubkey, twofa, always, parentsigned\]: 对wiki提交进行签名。 -- `CRUD_ACTIONS`: **pubkey, twofa, parentsigned**: \[never, pubkey, twofa, parentsigned, always\]: 对CRUD操作进行签名。 - - 与上面相同的选项,增加了: - - `parentsigned`: 仅在父提交进行了签名时才进行签名。 -- `MERGES`: **pubkey, twofa, basesigned, commitssigned**: \[never, pubkey, twofa, approved, basesigned, commitssigned, always\]: 对合并操作进行签名。 - - `approved`: 仅对已批准的合并操作进行签名,适用于受保护的分支。 - - `basesigned`: 仅在基础仓库的父提交进行了签名时才进行签名。 - - `headsigned`: 仅在头分支的头提交进行了签名时才进行签名。 - - `commitssigned`: 仅在头分支中的所有提交到合并点都进行了签名时才进行签名。 - -### 仓库 - Local (`repository.local`) - -- `LOCAL_COPY_PATH`: **tmp/local-repo**:临时本地仓库副本的路径。默认为 tmp/local-repo(内容在 Gitea 重新启动时被删除) - -### 仓库 - MIME type mapping (`repository.mimetype_mapping`) - -配置用于根据可下载文件的文件扩展名设置预期的 MIME 类型。配置以键值对的形式呈现,文件扩展名以`.`开头。 - -以下配置在下载具有`.apk`文件扩展名的文件时设置`Content-Type: application/vnd.android.package-archive`头部。 - -```ini -.apk=application/vnd.android.package-archive -``` - -## 跨域 (`cors`) - -- `ENABLED`: **false**: 启用 CORS 头部(默认禁用) -- `ALLOW_DOMAIN`: **\***: 允许请求的域名列表 -- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: 允许发起的请求方式列表 -- `MAX_AGE`: **10m**: 缓存响应的最大时间 -- `ALLOW_CREDENTIALS`: **false**: 允许带有凭据的请求 -- `HEADERS`: **Content-Type,User-Agent**: 允许请求携带的头部 -- `X_FRAME_OPTIONS`: **SAMEORIGIN**: 详见 `X-Frame-Options`HTTP头部. - -## 界面 (`ui`) - -- `EXPLORE_PAGING_NUM`: **20**: 探索页面每页显示的仓库数量。 -- `ISSUE_PAGING_NUM`: **20**: 工单页面每页显示的工单数量。 -- `MEMBERS_PAGING_NUM`: **20**: 组织成员页面每页显示的成员数量。 -- `FEED_MAX_COMMIT_NUM`: **5**: 活动流页面显示的最大提交数量。 -- `FEED_PAGING_NUM`: **20**: 活动流页面显示的最大活动数量。 -- `SITEMAP_PAGING_NUM`: **20**: 在单个子SiteMap中显示的项数。 -- `GRAPH_MAX_COMMIT_NUM`: **100**: 提交图中显示的最大commit数量。 -- `CODE_COMMENT_LINES`: **4**: 在代码评论中能够显示的最大代码行数。 -- `DEFAULT_THEME`: **gitea-auto**: \[gitea-auto, gitea-light, gitea-dark\]: 在Gitea安装时候设置的默认主题。 -- `SHOW_USER_EMAIL`: **true**: 用户的电子邮件是否应该显示在`Explore Users`页面中。 -- `THEMES`: **gitea-auto,gitea-light,gitea-dark**: 所有可用的主题。允许用户选择个性化的主题, - 而不受DEFAULT_THEME 值的影响。 -- `MAX_DISPLAY_FILE_SIZE`: **8388608**: 能够显示文件的最大大小(默认为8MiB)。 -- `REACTIONS`: 用户可以在问题(Issue)、Pull Request(PR)以及评论中选择的所有可选的反应。 - 这些值可以是表情符号别名(例如::smile:)或Unicode表情符号。 - 对于自定义的反应,在 public/assets/img/emoji/ 目录下添加一个紧密裁剪的正方形图像,文件名为 reaction_name.png。 -- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: 不在utf8标准中定义的额外表情符号。 - 默认情况下,我们支持 Gitea 表情符号(:gitea:)。要添加更多表情符号,请将它们复制到 public/assets/img/emoji/ 目录下, - 并将其添加到此配置中。 -- `DEFAULT_SHOW_FULL_NAME`: **false**: 是否在可能的情况下显示用户的全名。如果没有设置全名,则将使用用户名。 -- `SEARCH_REPO_DESCRIPTION`: **true**: 是否在探索页面上的仓库搜索中搜索描述。 -- `ONLY_SHOW_RELEVANT_REPOS`: **false** 在没有指定关键字并使用默认排序时,是否仅在探索页面上显示相关的仓库。 - 如果一个仓库是分叉或者没有元数据(没有描述、图标、主题),则被视为不相关的仓库。 - -### 界面 - 管理员 (`ui.admin`) - -- `USER_PAGING_NUM`: **50**: 单页显示的用户数量。 -- `REPO_PAGING_NUM`: **50**: 单页显示的仓库数量。 -- `NOTICE_PAGING_NUM`: **25**: 单页显示的通知数量。 -- `ORG_PAGING_NUM`: **50**: 单页显示的组织数量。 - -### 界面 - 用户 (`ui.user`) - -- `REPO_PAGING_NUM`: **15**: 单页显示的仓库数量。 - -### 界面 - 元信息 (`ui.meta`) - -- `AUTHOR`: **Gitea - Git with a cup of tea**: 主页的作者元标签。 -- `DESCRIPTION`: **Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go**: 主页的描述元标签。 -- `KEYWORDS`: **go,git,self-hosted,gitea**: 首页关键词元标签。 - -### 界面 - 通知 (`ui.notification`) - -- `MIN_TIMEOUT`: **10s**: 这些选项控制通知端点定期轮询以更新通知计数。在页面加载后,通知计数将在` MIN_TIMEOUT`之后进行检查。如果通知计数未更改,超时时间将按照`TIMEOUT_STEP`增加到`MAX_TIMEOUT`。将 `MIN_TIMEOUT`设置为 -1 以关闭该功能。 -- `MAX_TIMEOUT`: **60s**. -- `TIMEOUT_STEP`: **10s**. -- `EVENT_SOURCE_UPDATE_TIME`: **10s**: 该设置确定了查询数据库以更新通知计数的频率。如果浏览器客户端支持`EventSource`和`SharedWorker`,则优先使用`SharedWorker`而不是轮询通知端点。将其设置为 -1 可以禁用 `EventSource`。 - -### 界面 - SVG Images (`ui.svg`) - -- `ENABLE_RENDER`: **true**: 是否将SVG文件呈现为图像。如果禁用了SVG渲染,SVG文件将显示为文本,无法作为图像嵌入到Markdown文件中。 - -### 界面 - CSV Files (`ui.csv`) - -- `MAX_FILE_SIZE`: **524288** (512kb): 以字节为单位允许将CSV文件呈现为表格的最大文件大小(将其设置为0表示没有限制)。 - -## Markdown (`markdown`) - -- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: 在评论中将软换行符呈现为硬换行符, - 这意味着段落之间的单个换行符将导致换行, - 并且不需要在段落后添加尾随空格来强制换行。 -- `ENABLE_HARD_LINE_BREAK_IN_DOCUMENTS`: **false**: 在文档中将软换行符呈现为硬换行符, - 这意味着段落之间的单个换行符将导致换行, - 并且不需要在段落后添加尾随空格来强制换行。 -- `CUSTOM_URL_SCHEMES`: 使用逗号分隔的列表(ftp、git、svn)来指示要在Markdown中呈现的附加URL超链接。 - 以http和https开头的URL始终显示。 - 如果此条目为空,则允许所有URL方案。 -- `FILE_EXTENSIONS`: **.md,.markdown,.mdown,.mkd,.livemd**: 应呈现/编辑为Markdown的文件扩展名列表。使用逗号分隔扩展名。要将没有任何扩展名的文件呈现为Markdown,请只需放置一个逗号。 -- `ENABLE_MATH`: **true**: 启用对`\(...\)`, `\[...\]`, `$...$`和`$$...$$` 作为数学块的检测。 - -## 服务器 (`server`) - -- `APP_DATA_PATH`: **_`AppWorkPath`_/data**: 这是存储数据的默认根路径。 -- `PROTOCOL`: **http**: \[http, https, fcgi, http+unix, fcgi+unix\] -- `USE_PROXY_PROTOCOL`: **false**: 在连接中预期`PROXY`协议头。 -- `PROXY_PROTOCOL_TLS_BRIDGING`: **false**: 协议为 https 时,在`TLS`协商后预期`PROXY`协议头。 -- `PROXY_PROTOCOL_HEADER_TIMEOUT`: **5s**: 等待`PROXY`协议头的超时时间(设置为`0`表示没有超时)。 -- `PROXY_PROTOCOL_ACCEPT_UNKNOWN`: **false**:接受带有未知类型的`PROXY`协议头。 -- `DOMAIN`: **localhost**: 此服务器的域名。 -- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: - 覆盖自动生成的公共URL。 - 如果内部URL和外部URL不匹配(例如在Docker中),这很有用。 -- `STATIC_URL_PREFIX`: **_empty_**: - 覆盖此选项以从不同的URL请求静态资源。 - 这包括CSS文件、图片、JS文件和Web字体。 - 头像图片是动态资源,仍由Gitea提供。 - 选项可以是不同的路径,例如`/static`, 也可以是另一个域,例如`https://cdn.example.com`. - 请求会变成 `%(ROOT_URL)s/static/assets/css/index.css` 或 `https://cdn.example.com/assets/css/index.css` - 静态文件位于Gitea源代码仓库的`public/`目录中。 - 您可以将`STATIC_URL_PREFIX`请求代理到 Gitea 服务器以提供静态资源,或者将手动构建的 Gitea 资源从 `$GITEA_BUILD/public`复制到静态位置,例如`/var/www/assets`。确保`$STATIC_URL_PREFIX/assets/css/index.css`指向`/var/www/assets/css/index.css`。 - -- `HTTP_ADDR`: **0.0.0.0**:HTTP 监听地址。 - - 如果 `PROTOCOL` 设置为 `fcgi`,Gitea 将在由 - `HTTP_ADDR` 和 `HTTP_PORT` 配置设置定义的 TCP 套接字上监听 FastCGI 请求。 - - 如果 `PROTOCOL` 设置为 `http+unix` 或 `fcgi+unix`,则应该是要使用的 Unix 套接字文件的名称。相对路径将相对于 _`AppWorkPath`_ 被转换为绝对路径。 -- `HTTP_PORT`: **3000**:HTTP 监听端口。 - - 如果 `PROTOCOL` 设置为 `fcgi`,Gitea 将在由 `HTTP_ADDR` 和 `HTTP_PORT` - 配置设置定义的 TCP 套接字上监听 FastCGI 请求。 -- `UNIX_SOCKET_PERMISSION`: **666**:Unix 套接字的权限。 -- `LOCAL_ROOT_URL`: **%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/**: - 用于访问网络服务的 Gitea 工作器(例如 SSH 更新)的本地(DMZ)URL。 - 在大多数情况下,您不需要更改默认值。 - 仅在您的 SSH 服务器节点与 HTTP 节点不同的情况下才修改它。对于不同的协议,默认值不同。如果 `PROTOCOL` - 是 `http+unix`,则默认值为 `http://unix/`。如果 `PROTOCOL` 是 `fcgi` 或 `fcgi+unix`,则默认值为 - `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`。如果监听在 `0.0.0.0`,则默认值为 - `%(PROTOCOL)s://localhost:%(HTTP_PORT)s/`, - 否则默认值为 `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`。 -- `LOCAL_USE_PROXY_PROTOCOL`: **%(USE_PROXY_PROTOCOL)s**:在进行本地连接时传递 PROXY 协议头。 - 如果本地连接将经过代理,请将其设置为 false。 -- `PER_WRITE_TIMEOUT`: **30s**:连接的任何写操作的超时时间。(将其设置为 -1 - 以禁用所有超时。) -- `PER_WRITE_PER_KB_TIMEOUT`: **10s**:连接每写入 1 KB 的超时时间。 -- `DISABLE_SSH`: **false**:当SSH不可用时禁用SSH功能。 -- `START_SSH_SERVER`: **false**:启用时,使用内置的SSH服务器。 -- `SSH_SERVER_USE_PROXY_PROTOCOL`: **false**:在与内置SSH服务器建立连接时,期望PROXY协议头。 -- `BUILTIN_SSH_SERVER_USER`: **%(RUN_USER)s**:用于内置SSH服务器的用户名。 -- `SSH_USER`: **%(BUILTIN_SSH_SERVER_USER)s**:在克隆URL中显示的SSH用户名。这仅适用于自行配置SSH服务器的人;在大多数情况下,您希望将其留空并修改`BUILTIN_SSH_SERVER_USER`。 -- `SSH_DOMAIN`: **%(DOMAIN)s**:此服务器的域名,用于显示的克隆 URL。 -- `SSH_PORT`: **22**:显示在克隆 URL 中的 SSH 端口。 -- `SSH_LISTEN_HOST`: **0.0.0.0**:内置 SSH 服务器的监听地址。 -- `SSH_LISTEN_PORT`: **%(SSH_PORT)s**:内置 SSH 服务器的端口。 -- `SSH_ROOT_PATH`: **~/.ssh**:SSH 目录的根路径。 -- `SSH_CREATE_AUTHORIZED_KEYS_FILE`: **true**:当 Gitea 不使用内置 SSH 服务器时,默认情况下 Gitea 会创建一个 authorized_keys 文件。如果您打算使用 AuthorizedKeysCommand 功能,您应该关闭此选项。 -- `SSH_AUTHORIZED_KEYS_BACKUP`: **false**:在重写所有密钥时启用 SSH 授权密钥备份,默认值为 false。 -- `SSH_TRUSTED_USER_CA_KEYS`: **_empty_**:指定信任的证书颁发机构的公钥,用于对用户证书进行身份验证。多个密钥应以逗号分隔。例如 `ssh-<algorithm> <key>` 或 `ssh-<algorithm> <key1>, ssh-<algorithm> <key2>`。有关详细信息,请参阅 `sshd` 配置手册中的 `TrustedUserCAKeys` 部分。当为空时,不会创建文件,并且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 默认为 `off`。 -- `SSH_TRUSTED_USER_CA_KEYS_FILENAME`: **`RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem**:Gitea 将管理的 `TrustedUserCaKeys` 文件的绝对路径。如果您正在运行自己的 SSH 服务器,并且想要使用 Gitea 管理的文件,您还需要修改您的 `sshd_config` 来指向此文件。官方的 Docker 映像将自动工作,无需进一步配置。 -- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** 或 **username, email**:\[off, username, email, anything\]:指定允许用户用作 principal 的值。当设置为 `anything` 时,对 principal 字符串不执行任何检查。当设置为 `off` 时,不允许设置授权的 principal。 -- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**:当 Gitea 不使用内置 SSH 服务器且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off` 时,默认情况下 Gitea 会创建一个 authorized_principals 文件。 -- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**:在重写所有密钥时启用 SSH 授权 principal 备份,默认值为 true(如果 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off`)。 -- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**:设置用于传递授权密钥的命令模板。可能的密钥是:AppPath、AppWorkPath、CustomConf、CustomPath、Key,其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。 -- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**:对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。 -- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。 -- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。 -- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**:对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果不存在密钥,将为您创建一个 4096 位的 RSA 密钥。 -- `SSH_KEY_TEST_PATH`: **/tmp**:在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。 -- `SSH_KEYGEN_PATH`: **_empty_**:使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。 -- `SSH_EXPOSE_ANONYMOUS`: **false**:启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。 -- `SSH_PER_WRITE_TIMEOUT`: **30s**:对 SSH 连接的任何写入设置超时。(将其设置为 -1 可以禁用所有超时。) -- `SSH_PER_WRITE_PER_KB_TIMEOUT`: **10s**:对写入 SSH 连接的每 KB 设置超时。 -- `MINIMUM_KEY_SIZE_CHECK`: **true**:指示是否检查最小密钥大小与相应类型。 -- `OFFLINE_MODE`: **true**:禁用 CDN 用于静态文件和 Gravatar 用于个人资料图片。 -- `CERT_FILE`: **https/cert.pem**:用于 HTTPS 的证书文件路径。在链接时,服务器证书必须首先出现,然后是中间 CA 证书(如果有)。如果 `ENABLE_ACME=true`,则此设置会被忽略。路径相对于 `CUSTOM_PATH`。 -- `KEY_FILE`: **https/key.pem**:用于 HTTPS 的密钥文件路径。如果 `ENABLE_ACME=true`,则此设置会被忽略。路径相对于 `CUSTOM_PATH`。 -- `STATIC_ROOT_PATH`: **_`StaticRootPath`_**:模板和静态文件路径的上一级。 -- `APP_DATA_PATH`: **data**(在 Docker 上为 **/data/gitea**):应用程序数据的默认路径。相对路径会相对于 _`AppWorkPath`_ 转为绝对路径。 -- `STATIC_CACHE_TIME`: **6h**:对 `custom/`、`public/` 和所有上传的头像的静态资源的 Web 浏览器缓存时间。请注意,在 `RUN_MODE` 为 "dev" 时,此缓存会被禁用。 -- `ENABLE_GZIP`: **false**:为运行时生成的内容启用 gzip 压缩,静态资源除外。 -- `ENABLE_PPROF`: **false**:应用程序分析(内存和 CPU)。对于 "web" 命令,它会在 `localhost:6060` 上监听。对于 "serv" 命令,它会将数据转储到磁盘上的 `PPROF_DATA_PATH` 中,文件名为 `(cpuprofile|memprofile)_<username>_<temporary id>`。 -- `PPROF_DATA_PATH`: **_`AppWorkPath`_/data/tmp/pprof**:`PPROF_DATA_PATH`,当您将 Gitea 作为服务启动时,请使用绝对路径。 -- `LANDING_PAGE`: **home**:未经身份验证用户的登录页面 \[home, explore, organizations, login, **custom**]。其中 custom 可以是任何 URL,例如 "/org/repo" 或甚至是 `https://anotherwebsite.com`。 -- `LFS_START_SERVER`: **false**:启用 Git LFS 支持。 -- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)s/lfs**:默认的 LFS 内容路径(如果它在本地存储中)。**已弃用**,请使用 `[lfs]` 中的设置。 -- `LFS_JWT_SECRET`: **_empty_**:LFS 身份验证密钥,将其更改为唯一的字符串。 -- `LFS_JWT_SECRET_URI`: **_empty_**:代替在配置中定义 LFS_JWT_SECRET,可以使用此配置选项为 Gitea 提供包含密钥的文件的路径(示例值:`file:/etc/gitea/lfs_jwt_secret`)。 -- `LFS_HTTP_AUTH_EXPIRY`: **24h**:LFS 身份验证的有效期,以 time.Duration 表示,超过此期限的推送可能会失败。 -- `LFS_MAX_FILE_SIZE`: **0**:允许的最大 LFS 文件大小(以字节为单位,设置为 0 为无限制)。 -- `LFS_LOCKS_PAGING_NUM`: **50**:每页返回的最大 LFS 锁定数。 -- `REDIRECT_OTHER_PORT`: **false**:如果为 true 并且 `PROTOCOL` 为 https,则允许将 http 请求重定向到 Gitea 监听的 https 端口的 `PORT_TO_REDIRECT`。 -- `REDIRECTOR_USE_PROXY_PROTOCOL`: **%(USE_PROXY_PROTOCOL)s**:在连接到 https 重定向器时,需要 PROXY 协议头。 -- `PORT_TO_REDIRECT`: **80**:http 重定向服务监听的端口。当 `REDIRECT_OTHER_PORT` 为 true 时使用。 -- `SSL_MIN_VERSION`: **TLSv1.2**:设置最低支持的 SSL 版本。 -- `SSL_MAX_VERSION`: **_empty_**:设置最大支持的 SSL 版本。 -- `SSL_CURVE_PREFERENCES`: **X25519,P256**:设置首选的曲线。 -- `SSL_CIPHER_SUITES`: **ecdhe_ecdsa_with_aes_256_gcm_sha384,ecdhe_rsa_with_aes_256_gcm_sha384,ecdhe_ecdsa_with_aes_128_gcm_sha256,ecdhe_rsa_with_aes_128_gcm_sha256,ecdhe_ecdsa_with_chacha20_poly1305,ecdhe_rsa_with_chacha20_poly1305**:设置首选的密码套件。 - - 如果没有对 AES 套件的硬件支持,默认情况下,ChaCha 套件将优先于 AES 套件。 - - 根据 Go 1.18 的支持的套件有: - - TLS 1.0 - 1.2 套件 - - "rsa_with_rc4_128_sha" - - "rsa_with_3des_ede_cbc_sha" - - "rsa_with_aes_128_cbc_sha" - - "rsa_with_aes_256_cbc_sha" - - "rsa_with_aes_128_cbc_sha256" - - "rsa_with_aes_128_gcm_sha256" - - "rsa_with_aes_256_gcm_sha384" - - "ecdhe_ecdsa_with_rc4_128_sha" - - "ecdhe_ecdsa_with_aes_128_cbc_sha" - - "ecdhe_ecdsa_with_aes_256_cbc_sha" - - "ecdhe_rsa_with_rc4_128_sha" - - "ecdhe_rsa_with_3des_ede_cbc_sha" - - "ecdhe_rsa_with_aes_128_cbc_sha" - - "ecdhe_rsa_with_aes_256_cbc_sha" - - "ecdhe_ecdsa_with_aes_128_cbc_sha256" - - "ecdhe_rsa_with_aes_128_cbc_sha256" - - "ecdhe_rsa_with_aes_128_gcm_sha256" - - "ecdhe_ecdsa_with_aes_128_gcm_sha256" - - "ecdhe_rsa_with_aes_256_gcm_sha384" - - "ecdhe_ecdsa_with_aes_256_gcm_sha384" - - "ecdhe_rsa_with_chacha20_poly1305_sha256" - - "ecdhe_ecdsa_with_chacha20_poly1305_sha256" - - TLS 1.3 套件 - - "aes_128_gcm_sha256" - - "aes_256_gcm_sha384" - - "chacha20_poly1305_sha256" - - 别名 - - "ecdhe_rsa_with_chacha20_poly1305" 是 "ecdhe_rsa_with_chacha20_poly1305_sha256" 的别名 - - "ecdhe_ecdsa_with_chacha20_poly1305" 是 "ecdhe_ecdsa_with_chacha20_poly1305_sha256" 的别名 -- `ENABLE_ACME`: **false**:通过 ACME 能力的证书颁发机构(CA)服务器(默认为 Let's Encrypt)启用自动证书管理的标志。如果启用,将忽略 `CERT_FILE` 和 `KEY_FILE`,并且 CA 必须将 `DOMAIN` 解析为此 Gitea 服务器。确保设置了 DNS 记录,并且端口 `80` 或端口 `443` 可以被 CA 服务器访问(默认情况下是公共互联网),并重定向到相应的端口 `PORT_TO_REDIRECT` 或 `HTTP_PORT`。 -- `ACME_URL`: **_empty_**:CA 的 ACME 目录 URL,例如自托管的 [smallstep CA 服务器](https://github.com/smallstep/certificates),它可以是 `https://ca.example.com/acme/acme/directory`。如果留空,默认使用 Let's Encrypt 的生产 CA(还要检查 `LETSENCRYPT_ACCEPTTOS`)。 -- `ACME_ACCEPTTOS`: **false**:这是一个明确的检查,您是否接受 ACME 提供者的服务条款。默认为 Let's Encrypt 的 [服务条款](https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf)。 -- `ACME_DIRECTORY`: **https**:证书管理器用于缓存证书和私钥等信息的目录。 -- `ACME_EMAIL`: **_empty_**:用于 ACME 注册的电子邮件。通常用于通知有关已颁发的证书的问题。 -- `ACME_CA_ROOT`: **_empty_**:CA 的根证书。如果留空,默认使用系统的信任链。 -- `ALLOW_GRACEFUL_RESTARTS`: **true**:在 SIGHUP 时执行优雅重启。 -- `GRACEFUL_HAMMER_TIME`: **60s**:在重新启动后,父进程将停止接受新连接,并允许请求在停止之前完成。如果耗时超过此时间,则会强制关闭关闭。 -- `STARTUP_TIMEOUT`: **0**:如果启动超过提供的时间,将关闭服务器。在 Windows 上设置这将向 SVC 主机发送一个等待提示,告诉 SVC 主机启动可能需要一些时间。请注意,启动由监听器(HTTP/HTTPS/SSH)的打开来确定。索引程序可能需要更长时间启动,可能具有自己的超时时间。 - -## 数据库 (`database`) - -- `DB_TYPE`: **mysql**:数据库类型 \[mysql, postgres, mssql, sqlite3\]。 -- `HOST`: **127.0.0.1:3306**:数据库主机地址和端口或unix套接字的绝对路径 \[mysql, postgres\](例如:/var/run/mysqld/mysqld.sock)。 -- `NAME`: **gitea**:数据库名称。 -- `USER`: **root**:数据库用户名。 -- `PASSWD`: **_empty_**:数据库密码。如果密码包含特殊字符,请使用 \`your password\` 或 """your password"""。 -- `SCHEMA`: **_empty_**:对于 PostgreSQL,如果与 "public" 不同的模式。模式必须事先存在,用户必须对其具有创建特权,并且用户搜索路径必须设置为首先查找模式(例如 `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`)。 -- `SSL_MODE`: **disable**:MySQL 或 PostgreSQL 数据库是否启用 SSL 模式,仅适用于 MySQL 和 PostgreSQL。 - - MySQL 的有效值: - - `true`:启用 TLS,并针对数据库服务器证书根证书进行验证。选择此选项时,请确保用于验证数据库服务器证书的根证书(例如 CA 证书)位于数据库服务器和 Gitea 服务器的系统证书存储中。有关如何将 CA 证书添加到证书存储的说明,请参阅系统文档。 - - `false`:禁用 TLS。 - - `disable`:`false` 的别名,与 PostgreSQL 兼容。 - - `skip-verify`:启用 TLS,但不进行数据库服务器证书验证。如果数据库服务器上有自签名或无效证书,请使用此选项。 - - `prefer`:启用 TLS,并回退到非 TLS 连接。 - - PostgreSQL 的有效值: - - `disable`:禁用 TLS。 - - `require`:启用 TLS,但不进行任何验证。 - - `verify-ca`:启用 TLS,并对数据库服务器证书进行根证书验证。 - - `verify-full`:启用 TLS,并验证数据库服务器名称是否与给定的证书的 "Common Name" 或 "Subject Alternative Name" 字段匹配。 -- `SQLITE_TIMEOUT`:**500**:仅适用于 SQLite3 的查询超时。 -- `SQLITE_JOURNAL_MODE`:**""**:更改 SQlite3 的日志模式。可以用于在高负载导致写入拥塞时启用 [WAL 模式](https://www.sqlite.org/wal.html)。有关可能的值,请参阅 [SQlite3 文档](https://www.sqlite.org/pragma.html#pragma_journal_mode)。默认为数据库文件的默认值,通常为 DELETE。 -- `ITERATE_BUFFER_SIZE`:**50**:用于迭代的内部缓冲区大小。 -- `PATH`:**data/gitea.db**:仅适用于 SQLite3 的数据库文件路径。 -- `LOG_SQL`:**false**:记录已执行的 SQL。 -- `DB_RETRIES`:**10**:允许多少次 ORM 初始化 / DB 连接尝试。 -- `DB_RETRY_BACKOFF`:**3s**:如果发生故障,等待另一个 ORM 初始化 / DB 连接尝试的 time.Duration。 -- `MAX_OPEN_CONNS`:**0**:数据库最大打开连接数 - 默认为 0,表示没有限制。 -- `MAX_IDLE_CONNS`:**2**:连接池上的最大空闲数据库连接数,默认为 2 - 这将限制为 `MAX_OPEN_CONNS`。 -- `CONN_MAX_LIFETIME`:**0 或 3s**:设置 DB 连接可以重用的最长时间 - 默认为 0,表示没有限制(除了 MySQL,其中为 3s - 请参见 #6804 和 #7071)。 -- `AUTO_MIGRATION`:**true**:是否自动执行数据库模型迁移。 - -请参见 #8540 和 #8273 以获取有关 `MAX_OPEN_CONNS`、`MAX_IDLE_CONNS` 和 `CONN_MAX_LIFETIME` 的适当值及其与端口耗尽的关系的进一步讨论。 - -## 索引 (`indexer`) - -- `ISSUE_INDEXER_TYPE`: **bleve**:工单索引类型,当前支持:`bleve`、`db`、`elasticsearch` 或 `meilisearch`。 -- `ISSUE_INDEXER_CONN_STR`:****:工单索引连接字符串,仅适用于 elasticsearch 和 meilisearch(例如:http://elastic:password@localhost:9200)或者(例如:http://:apikey@localhost:7700)。 -- `ISSUE_INDEXER_NAME`:**gitea_issues**:工单索引器名称,在 ISSUE_INDEXER_TYPE 为 elasticsearch 或 meilisearch 时可用。 -- `ISSUE_INDEXER_PATH`:**indexers/issues.bleve**:用于工单搜索的索引文件;在 ISSUE_INDEXER_TYPE 为 bleve 和 elasticsearch 时可用。相对路径将相对于 _`AppWorkPath`_ 进行绝对路径化。 - -- `REPO_INDEXER_ENABLED`:**false**:启用代码搜索(占用大量磁盘空间,约为存储库大小的 6 倍)。 -- `REPO_INDEXER_REPO_TYPES`:**sources,forks,mirrors,templates**:存储库索引器单元。要索引的项目可以是 `sources`、`forks`、`mirrors`、`templates` 或它们的任何组合,用逗号分隔。如果为空,则默认为仅 `sources`,如果要完全禁用,请参见 `REPO_INDEXER_ENABLED`。 -- `REPO_INDEXER_TYPE`:**bleve**:代码搜索引擎类型,可以为 `bleve` 或者 `elasticsearch`。 -- `REPO_INDEXER_PATH`:**indexers/repos.bleve**:用于代码搜索的索引文件。 -- `REPO_INDEXER_CONN_STR`:****:代码索引器连接字符串,在 `REPO_INDEXER_TYPE` 为 elasticsearch 时可用。例如:http://elastic:password@localhost:9200 -- `REPO_INDEXER_NAME`:**gitea_codes**:代码索引器名称,在 `REPO_INDEXER_TYPE` 为 elasticsearch 时可用。 - -- `REPO_INDEXER_INCLUDE`:**empty**:逗号分隔的 glob 模式列表(参见 https://github.com/gobwas/glob)以用于**包括**在索引中。使用 `**.txt` 匹配任何具有 .txt 扩展名的文件。空列表表示包括所有文件。 -- `REPO_INDEXER_EXCLUDE`:**empty**:逗号分隔的 glob 模式列表(参见 https://github.com/gobwas/glob)以用于**排除**在索引中。即使在 `REPO_INDEXER_INCLUDE` 中匹配,也不会索引与此列表匹配的文件。 -- `REPO_INDEXER_EXCLUDE_VENDORED`:**true**:从索引中排除 vendored 文件。 -- `MAX_FILE_SIZE`:**1048576**:要索引的文件的最大字节数。 -- `STARTUP_TIMEOUT`:**30s**:如果索引器启动时间超过此超时时间 - 则失败。(此超时时间将添加到上面的锤子时间中,用于子进程 - 因为 bleve 不会在上一个父进程关闭之前启动)。设置为 -1 表示永不超时。 - -## 队列 (`queue` and `queue.*`) - -[queue] 配置在 `[queue.*]` 下为各个队列设置默认值,并允许为各个队列设置单独的配置覆盖。(不过请参见下文。) - -- `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。 -- `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。 -- `LENGTH`:**100000**:通道队列阻塞之前的最大队列大小 -- `BATCH_LENGTH`:**20**:在传递给处理程序之前批处理数据 -- `CONN_STR`:**redis://127.0.0.1:6379/0**:redis 队列类型的连接字符串。对于 `redis-cluster`,使用 `redis+cluster://127.0.0.1:6379/0`。可以使用查询参数来设置选项。类似地,LevelDB 选项也可以使用:**leveldb://relative/path?option=value** 或 **leveldb:///absolute/path?option=value** 进行设置,并将覆盖 `DATADIR`。 -- `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。 -- `SET_NAME`:**_unique**:将添加到默认的 redis 和磁盘队列 `set` 名称中以用于唯一队列的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`_`SET_NAME`_,但可以在特定的 `queue.name` 部分中进行覆盖。 -- `MAX_WORKERS`:**(dynamic)**:队列的最大工作协程数。默认值为 "CpuNum/2",限制在 1 到 10 之间。 - -Gitea 创建以下非唯一队列: - -- `code_indexer` -- `issue_indexer` -- `notification-service` -- `task` -- `mail` -- `push_update` - -以及以下唯一队列: - -- `repo_stats_update` -- `repo-archive` -- `mirror` -- `pr_patch_checker` - -## Admin (`admin`) - -- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**:用户电子邮件通知的默认配置(用户可配置)。选项:enabled、onmention、disabled -- `DISABLE_REGULAR_ORG_CREATION`: **false**:禁止普通(非管理员)用户创建组织。 -- `USER_DISABLED_FEATURES`:**_empty_** 禁用的用户特性,当前允许为空或者 `deletion`,`manage_ssh_keys`, `manage_gpg_keys` 未来可以增加更多设置。 - - `deletion`: 用户不能通过界面或者API删除他自己。 - - `manage_ssh_keys`: 用户不能通过界面或者API配置SSH Keys。 - - `manage_gpg_keys`: 用户不能配置 GPG 密钥。 - -## 安全性 (`security`) - -- `INSTALL_LOCK`: **false**:控制是否能够访问安装向导页面,设置为 `true` 则禁止访问安装向导页面。 -- `SECRET_KEY`: **\<每次安装时随机生成\>**:全局服务器安全密钥。这个密钥非常重要,如果丢失将无法解密加密的数据(例如 2FA)。 -- `SECRET_KEY_URI`: **_empty_**:与定义 `SECRET_KEY` 不同,此选项可用于使用存储在文件中的密钥(示例值:`file:/etc/gitea/secret_key`)。它不应该像 `SECRET_KEY` 一样容易丢失。 -- `LOGIN_REMEMBER_DAYS`: **31**:在要求重新登录之前,记住用户的登录状态多长时间(以天为单位)。 -- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**:保存自动登录信息的 Cookie 名称。 -- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**:反向代理认证的 HTTP 头部名称,用于提供用户信息。 -- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**:反向代理认证的 HTTP 头部名称,用于提供邮箱信息。 -- `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`: **X-WEBAUTH-FULLNAME**:反向代理认证的 HTTP 头部名称,用于提供全名信息。 -- `REVERSE_PROXY_LIMIT`: **1**:解释 X-Forwarded-For 标头或 X-Real-IP 标头,并将其设置为请求的远程 IP。 - 可信代理计数。设置为零以不使用这些标头。 -- `REVERSE_PROXY_TRUSTED_PROXIES`: **127.0.0.0/8,::1/128**:逗号分隔的受信任代理服务器的 IP 地址和网络列表。使用 `*` 来信任全部。 -- `DISABLE_GIT_HOOKS`: **true**:设置为 `false` 以允许具有 Git 钩子权限的用户创建自定义 Git 钩子。 - 警告:自定义 Git 钩子可用于在主机操作系统上执行任意代码。这允许用户访问和修改此配置文件和 Gitea 数据库,并中断 Gitea 服务。 - 通过修改 Gitea 数据库,用户可以获得 Gitea 管理员权限。 - 它还使他们可以访问正在运行 Gitea 实例的操作系统上用户可用的其他资源,并以 Gitea 操作系统用户的名义执行任意操作。 - 这可能对您的网站或操作系统造成危害。 - 在必要之前,请在更改现有 git 存储库中的钩子之前进行调整。 -- `DISABLE_WEBHOOKS`: **false**:设置为 `true` 以禁用 Webhooks 功能。 -- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**:设置为 `false` 以允许本地用户在未设置 Gitea 环境的情况下推送到 Gitea 存储库。不建议这样做,如果您希望本地用户推送到 Gitea 存储库,应该适当地设置环境。 -- `IMPORT_LOCAL_PATHS`: **false**:设置为 `false` 以防止所有用户(包括管理员)从服务器上导入本地路径。 -- `INTERNAL_TOKEN`: **\<每次安装时随机生成,如果未设置 URI\>**:用于验证 Gitea 二进制文件内部通信的密钥。 -- `INTERNAL_TOKEN_URI`: **_empty_**:与在配置中定义 `INTERNAL_TOKEN` 不同,此配置选项可用于将包含内部令牌的文件的路径提供给 Gitea(示例值:`file:/etc/gitea/internal_token`)。 -- `PASSWORD_HASH_ALGO`: **pbkdf2**:要使用的哈希算法 \[argon2、pbkdf2、pbkdf2_v1、pbkdf2_hi、scrypt、bcrypt\],argon2 和 scrypt 将消耗大量内存。 - - 注意:`pbkdf2` 哈希的默认参数已更改 - 先前的设置可作为 `pbkdf2_v1` 使用,但不建议使用。 - - 可以通过在算法后使用 `$` 进行调整: - - `argon2$<time>$<memory>$<threads>$<key-length>` - - `bcrypt$<cost>` - - `pbkdf2$<iterations>$<key-length>` - - `scrypt$<n>$<r>$<p>$<key-length>` - - 默认值为: - - `argon2`:`argon2$2$65536$8$50` - - `bcrypt`:`bcrypt$10` - - `pbkdf2`:`pbkdf2$50000$50` - - `pbkdf2_v1`:`pbkdf2$10000$50` - - `pbkdf2_v2`:`pbkdf2$50000$50` - - `pbkdf2_hi`:`pbkdf2$320000$50` - - `scrypt`:`scrypt$65536$16$2$50` - - 使用此功能调整算法参数存在一定风险。 -- `CSRF_COOKIE_HTTP_ONLY`: **true**:设置为 false 以允许 JavaScript 读取 CSRF cookie。 -- `MIN_PASSWORD_LENGTH`: **6**:新用户的最小密码长度。 -- `PASSWORD_COMPLEXITY`: **off**:要求通过最小复杂性的字符类别的逗号分隔列表。如果留空或没有指定有效值,则禁用检查(off): - - lower - 使用一个或多个小写拉丁字符 - - upper - 使用一个或多个大写拉丁字符 - - digit - 使用一个或多个数字 - - spec - 使用一个或多个特殊字符,如 ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~`` - - off - 不检查密码复杂性 -- `PASSWORD_CHECK_PWN`: **false**:检查密码是否在 [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) 中曝光。 -- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**:缓存成功的令牌哈希。API 令牌在数据库中存储为 pbkdf2 哈希,但这意味着在存在多个 API 操作时可能会有显着的哈希负载。此缓存将在 LRU 缓存中存储成功的哈希令牌,以在性能和安全性之间保持平衡。 - -## Camo (`camo`) - -- `ENABLED`: **false**:启用媒体代理,目前仅支持图像。 -- `SERVER_URL`: **_empty_**:Camo服务器的URL,如果启用camo,则**必填**。 -- `HMAC_KEY`: **_empty_**:为URL编码提供HMAC密钥,如果启用camo,则**必填**。 -- `ALLWAYS`: **false**:设置为true以在HTTP和HTTPS内容上使用camo,否则仅代理非HTTPS URL。 - -## OpenID (`openid`) - -- `ENABLE_OPENID_SIGNIN`: **false**:允许通过OpenID进行身份验证。 -- `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**:允许通过OpenID进行注册。 -- `WHITELISTED_URIS`: **_empty_**:如果非空,是一组匹配OpenID URI的POSIX正则表达式模式,用于允许访问。 -- `BLACKLISTED_URIS`: **_empty_**:如果非空,是一组匹配OpenID URI的POSIX正则表达式模式,用于阻止访问。 - -## OAuth2 Client (`oauth2_client`) - -- `REGISTER_EMAIL_CONFIRM`: _[service]_ **REGISTER\_EMAIL\_CONFIRM**:设置此项以启用或禁用OAuth2自动注册的电子邮件确认。(覆盖`[service]`部分的`REGISTER\_EMAIL\_CONFIRM`设置) -- `OPENID_CONNECT_SCOPES`: **_empty_**:附加的OpenID连接范围的列表。(`openid`已隐式添加) -- `ENABLE_AUTO_REGISTRATION`: **false**:为新的OAuth2用户自动创建用户帐户。 -- `USERNAME`: **nickname**:新OAuth2帐户的用户名来源: - - userid - 使用userid / sub属性 - - nickname - 使用nickname属性 - - email - 使用email属性的用户名部分 -- `UPDATE_AVATAR`: **false**:如果OAuth2提供程序中有可用的头像,则进行头像更新。更新将在每次登录时执行。 -- `ACCOUNT_LINKING`: **login**:如果帐户/电子邮件已存在,如何处理: - - disabled - 显示错误 - - login - 显示帐户链接登录 - - auto - 自动与帐户链接(请注意,这将因为提供相同的用户名或电子邮件而自动授予现有帐户的访问权限。您必须确保这不会导致身份验证提供程序出现问题。) - -## Service (`service`) - -- `ACTIVE_CODE_LIVE_MINUTES`: **180**:确认帐户/电子邮件注册的时间限制(分钟)。 -- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**:确认忘记密码重置流程的时间限制(分钟)。 -- `REGISTER_EMAIL_CONFIRM`: **false**:启用此项以要求通过邮件确认注册。需要启用`Mailer`。 -- `REGISTER_MANUAL_CONFIRM`: **false**:启用此项以手动确认新的注册。需要禁用`REGISTER_EMAIL_CONFIRM`。 -- `DISABLE_REGISTRATION`: **false**:禁用注册,之后只有管理员可以为用户创建帐户。 -- `REQUIRE_EXTERNAL_REGISTRATION_PASSWORD`: **false**:启用此项以强制通过外部方式创建的帐户(通过GitHub、OpenID Connect等)创建密码。警告:启用此项将降低安全性,因此只有在您知道自己在做什么时才应启用它。 -- `REQUIRE_SIGNIN_VIEW`: **false**:启用此项以强制用户登录以查看任何页面或使用API。 -- `ENABLE_NOTIFY_MAIL`: **false**:启用此项以在发生某些情况(如创建问题)时向存储库的观察者发送电子邮件。需要启用`Mailer`。 -- `ENABLE_BASIC_AUTHENTICATION`: **true**:禁用此项以禁止使用HTTP BASIC和用户的密码进行身份验证。请注意,如果禁用此项,您将无法使用密码访问令牌API端点。此外,这仅会禁用使用密码的BASIC身份验证,而不会禁用令牌或OAuth Basic。 -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**:启用此项以允许反向代理身份验证。 -- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**:启用此项以允许反向身份验证的自动注册。 -- `ENABLE_REVERSE_PROXY_EMAIL`: **false**:启用此项以允许使用提供的电子邮件而不是生成的电子邮件进行自动注册。 -- `ENABLE_REVERSE_PROXY_FULL_NAME`: **false**:启用此项以允许使用提供的全名进行自动注册。 -- `ENABLE_CAPTCHA`: **false**:启用此项以对注册使用验证码验证。 -- `REQUIRE_CAPTCHA_FOR_LOGIN`: **false**:启用此项以要求登录使用验证码验证。您还必须启用`ENABLE_CAPTCHA`。 -- `REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA`: **false**:启用此项以强制对外部帐户(即GitHub、OpenID Connect等)使用验证码验证。您还必须启用`ENABLE_CAPTCHA`。 -- `CAPTCHA_TYPE`: **image**:\[image、recaptcha、hcaptcha、mcaptcha、cfturnstile\] -- `RECAPTCHA_SECRET`: **""**:访问https://www.google.com/recaptcha/admin以获取recaptcha的密钥。 -- `RECAPTCHA_SITEKEY`: **""**:访问https://www.google.com/recaptcha/admin以获取recaptcha的站点密钥。 -- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**:设置recaptcha网址,允许使用recaptcha net。 -- `HCAPTCHA_SECRET`: **""**:注册https://www.hcaptcha.com/以获取hcaptcha的密钥。 -- `HCAPTCHA_SITEKEY`: **""**:注册https://www.hcaptcha.com/以获取hcaptcha的站点密钥。 -- `MCAPTCHA_SECRET`: **""**:访问您的mCaptcha实例以获取mCaptcha的密钥。 -- `MCAPTCHA_SITEKEY`: **""**:访问您的mCaptcha实例以获取mCaptcha的站点密钥。 -- `MCAPTCHA_URL` **https://demo.mcaptcha.org/**:设置mCaptcha的URL。 -- `CF_TURNSTILE_SECRET` **""**:访问https://dash.cloudflare.com/?to=/:account/turnstile以获取cloudflare turnstile的密钥。 -- `CF_TURNSTILE_SITEKEY` **""**:访问https://dash.cloudflare.com/?to=/:account/turnstile以获取cloudflare turnstile的站点密钥。 -- `DEFAULT_KEEP_EMAIL_PRIVATE`: **false**:默认情况下,将用户设置为保持其电子邮件地址私有。 -- `DEFAULT_ALLOW_CREATE_ORGANIZATION`: **true**:默认情况下,允许新用户创建组织。 -- `DEFAULT_USER_IS_RESTRICTED`: **false**:默认情况下,为新用户分配受限权限。 -- `DEFAULT_ENABLE_DEPENDENCIES`: **true**:启用此项以默认启用依赖项。 -- `ALLOW_CROSS_REPOSITORY_DEPENDENCIES` : **true** 启用此项以允许从用户被授予访问权限的任何存储库上进行依赖项操作。 -- `USER_LOCATION_MAP_URL`: **""**:一个显示用户在地图上位置的地图服务URL。位置将作为转义的查询参数附加到URL中。 -- `ENABLE_USER_HEATMAP`: **true**:启用此项以在用户个人资料上显示热图。 -- `ENABLE_TIMETRACKING`: **true**:启用时间跟踪功能。 -- `DEFAULT_ENABLE_TIMETRACKING`: **true**:默认情况下,允许存储库默认使用时间跟踪。 -- `DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME`: **true**:仅允许具有写权限的用户跟踪时间。 -- `EMAIL_DOMAIN_ALLOWLIST`: **_empty_**:如果非空,逗号分隔的域名列表,只能用于在此实例上注册,支持通配符。 -- `EMAIL_DOMAIN_BLOCKLIST`: **_empty_**:如果非空,逗号分隔的域名列表,不能用于在此实例上注册,支持通配符。 -- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**:显示注册按钮 -- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** 启用此项以显示里程碑仪表板页面 - 查看所有用户的里程碑 -- `AUTO_WATCH_NEW_REPOS`: **true** 启用此项以在创建新存储库时让所有组织用户观看新存储库 -- `AUTO_WATCH_ON_CHANGES`: **false** 启用此项以在首次提交后使用户观看存储库 -- `DEFAULT_USER_VISIBILITY`: **public**:为用户设置默认的可见性模式,可以是"public"、"limited"或"private"。 -- `ALLOWED_USER_VISIBILITY_MODES`: **public,limited,private**:设置用户可以具有的可见性模式 -- `DEFAULT_ORG_VISIBILITY`: **public**:为组织设置默认的可见性模式,可以是"public"、"limited"或"private"。 -- `DEFAULT_ORG_MEMBER_VISIBLE`: **false**:如果添加到组织时将用户的成员身份可见,设置为True。 -- `ALLOW_ONLY_INTERNAL_REGISTRATION`: **false**:设置为True以强制仅通过Gitea进行注册。 -- `ALLOW_ONLY_EXTERNAL_REGISTRATION`: **false**:设置为True以强制仅使用第三方服务进行注册。 -- `NO_REPLY_ADDRESS`: **noreply.DOMAIN**:如果用户将KeepEmailPrivate设置为True,则在Git日志中的用户电子邮件地址的域部分的值。DOMAIN解析为server.DOMAIN中的值。 - 用户的电子邮件将被替换为小写的用户名、"@"和NO_REPLY_ADDRESS的连接。 -- `USER_DELETE_WITH_COMMENTS_MAX_TIME`: **0**:用户删除后,评论将保留的最短时间。 -- `VALID_SITE_URL_SCHEMES`: **http, https**:用户个人资料的有效站点URL方案 - -### Service - Explore (`service.explore`) - -- `REQUIRE_SIGNIN_VIEW`: **false**:仅允许已登录的用户查看探索页面。 -- `DISABLE_USERS_PAGE`: **false**:禁用用户探索页面。 - -## SSH Minimum Key Sizes (`ssh.minimum_key_sizes`) - -定义允许的算法及其最小密钥长度(使用-1来禁用某个类型): - -- `ED25519`:**256** -- `ECDSA`:**256** -- `RSA`:**3071**:我们在这里设置为2047,因为一个其他方面有效的3072 RSA密钥可能被报告为3071长度。 -- `DSA`:**-1**:默认情况下禁用DSA。设置为**1024**以重新启用,但请注意可能需要重新配置您的SSHD提供者 - -## Webhook (`webhook`) - -- `QUEUE_LENGTH`: **1000**:钩子任务队列长度。编辑此值时要小心。 -- `DELIVER_TIMEOUT`: **5**:发送 Webhook 的交付超时时间(秒)。 -- `ALLOWED_HOST_LIST`: **external**:出于安全原因,Webhook 仅能调用允许的主机。以逗号分隔的列表。 - - 内置网络: - - `loopback`:IPv4 的 127.0.0.0/8 和 IPv6 的 ::1/128,包括 localhost。 - - `private`:RFC 1918(10.0.0.0/8,172.16.0.0/12,192.168.0.0/16)和 RFC 4193(FC00::/7)。也称为 LAN/Intranet。 - - `external`:一个有效的非私有单播 IP,您可以访问公共互联网上的所有主机。 - - `*`:允许所有主机。 - - CIDR 列表:IPv4 的 `1.2.3.0/8` 和 IPv6 的 `2001:db8::/32` - - 通配符主机:`*.mydomain.com`,`192.168.100.*` -- `SKIP_TLS_VERIFY`: **false**:允许不安全的证书。 -- `PAGING_NUM`: **10**:一页中显示的 Webhook 历史事件数量。 -- `PROXY_URL`: **_empty_**:代理服务器 URL,支持 http://、https://、socks://,留空将遵循环境的 http_proxy/https_proxy 设置。如果未提供,将使用全局代理设置。 -- `PROXY_HOSTS`: **_empty_**:需要代理的主机名的逗号分隔列表。支持通配符模式 (*);使用 ** 来匹配所有主机。如果未提供,将使用全局代理设置。 - -## 邮件 (`mailer`) - -⚠️ 此部分适用于 Gitea 1.18 及更高版本。如果您使用的是 Gitea 1.17 或更早版本,请阅读以下链接获取更多信息: -[Gitea 1.17 app.ini 示例](https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini) -和 -[Gitea 1.17 配置文档](https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md) - -- `ENABLED`: **false**:是否启用邮件服务。 -- `PROTOCOL`: **_empty_**:邮件服务协议,可选择 "smtp"、"smtps"、"smtp+starttls"、"smtp+unix"、"sendmail"、"dummy"。在 Gitea 1.18 之前,邮件服务协议由 `MAILER_TYPE` 和 `IS_TLS_ENABLED` 两个配置共同决定。 - - SMTP 类族,如果您的提供者没有明确说明使用的是哪个协议,但提供了一个端口,您可以设置 SMTP_PORT,它将被推断出来。 - - **sendmail** 使用操作系统的 `sendmail` 命令,而不是 SMTP。这在 Linux 系统上很常见。 - - **dummy** 将邮件消息发送到日志,作为测试阶段。 - - 请注意,启用 sendmail 将忽略所有其他 `mailer` 设置,除了 `ENABLED`、`FROM`、`SUBJECT_PREFIX` 和 `SENDMAIL_PATH`。 - - 启用 dummy 将忽略所有设置,除了 `ENABLED`、`SUBJECT_PREFIX` 和 `FROM`。 -- `SMTP_ADDR`: **_empty_**:邮件服务器地址,例如 smtp.gmail.com。对于 smtp+unix,这应该是一个到 unix socket 的路径。在 1.18 之前,此设置与 `SMTP_PORT` 合并,名称为 `HOST`。 -- `SMTP_PORT`: **_empty_**:邮件服务器端口。如果未指定协议,将通过此设置进行推断。常用端口如下。在 1.18 之前,此设置与 `SMTP_ADDR` 合并,名称为 `HOST`。 - - 25:不安全的简单邮件传输协议(insecure SMTP) - - 465:安全的简单邮件传输协议(SMTP Secure) - - 587:StartTLS -- `USE_CLIENT_CERT`: **false**:使用客户端证书进行 TLS/SSL 加密。 -- `CLIENT_CERT_FILE`: **custom/mailer/cert.pem**:客户端证书文件。 -- `CLIENT_KEY_FILE`: **custom/mailer/key.pem**:客户端密钥文件。 -- `FORCE_TRUST_SERVER_CERT`: **false**:如果设置为 `true`,将完全忽略服务器证书验证错误。此选项不安全。考虑将证书添加到系统信任存储中。 -- `USER`: **_empty_**:邮件用户的用户名(通常是发件人的电子邮件地址)。 -- `PASSWD`: **_empty_**:邮件用户的密码。如果密码中使用了特殊字符,请使用 \`your password\` 进行引用。 - - 请注意:只有在 SMTP 服务器通信通过 TLS 加密(可以通过 `STARTTLS` 实现)或 SMTP 主机是 localhost 时,才支持身份验证。有关更多信息,请参阅 [邮件设置](administration/email-setup.md)。 -- `ENABLE_HELO`: **true**:启用 HELO 操作。 -- `HELO_HOSTNAME`: **(从系统检索)**:HELO 主机名。 -- `FROM`: **_empty_**:邮件的发件人地址,符合 RFC 5322。这可以是一个电子邮件地址,也可以是 "Name" \<email@example.com\> 格式。 -- `ENVELOPE_FROM`: **_empty_**:在 SMTP 邮件信封上设置的地址作为发件地址。设置为 `<>` 以发送一个空地址。 -- `SUBJECT_PREFIX`: **_empty_**:放置在电子邮件主题行之前的前缀。 -- `SENDMAIL_PATH`: **sendmail**:操作系统上 `sendmail` 的位置(可以是命令或完整路径)。 -- `SENDMAIL_ARGS`: **_empty_**:指定任何额外的 sendmail 参数。(注意:您应该知道电子邮件地址可能看起来像选项 - 如果您的 `sendmail` 命令带有选项,您必须设置选项终止符 `--`) -- `SENDMAIL_TIMEOUT`: **5m**:通过 sendmail 发送电子邮件的默认超时时间。 -- `SENDMAIL_CONVERT_CRLF`: **true**:大多数版本的 sendmail 偏好使用 LF 换行符,而不是 CRLF 换行符。如果您的 sendmail 版本需要 CRLF 换行符,请将此设置为 false。 -- `SEND_BUFFER_LEN`: **100**:邮件队列的缓冲区长度。**已弃用**,请在 `[queue.mailer]` 中使用 `LENGTH`。 -- `SEND_AS_PLAIN_TEXT`: **false**:仅以纯文本形式发送邮件,不包括 HTML 备选方案。 - -## 入站邮件 (`email.incoming`) - -- `ENABLED`: **false**:启用处理入站邮件。 -- `REPLY_TO_ADDRESS`: **_empty_**:包括 `%{token}` 占位符的电子邮件地址,该占位符将根据用户/操作进行替换。示例:`incoming+%{token}@example.com`。占位符必须出现在地址的用户部分(在 `@` 之前)。 -- `HOST`: **_empty_**:IMAP 服务器主机。 -- `PORT`: **_empty_**:IMAP 服务器端口。 -- `USERNAME`: **_empty_**:接收帐户的用户名。 -- `PASSWORD`: **_empty_**:接收帐户的密码。 -- `USE_TLS`: **false**:IMAP 服务器是否使用 TLS。 -- `SKIP_TLS_VERIFY`: **false**:如果设置为 `true`,将完全忽略服务器证书验证错误。此选项不安全。 -- `MAILBOX`: **INBOX**:入站邮件将到达的邮箱名称。 -- `DELETE_HANDLED_MESSAGE`: **true**:是否应从邮箱中删除已处理的消息。 -- `MAXIMUM_MESSAGE_SIZE`: **10485760**:要处理的消息的最大大小。忽略更大的消息。将其设置为 0 以允许每种大小。 - -## 缓存 (`cache`) - -- `ADAPTER`: **memory**: 缓存引擎,可以为 `memory`, `redis`, `redis-cluster`, `twoqueue` 和 `memcache`. (`twoqueue` 代表缓冲区固定的LRU缓存) -- `INTERVAL`: **60**: 垃圾回收间隔(秒),只对`memory`和`towqueue`有效。 -- `HOST`: **_empty_**: 缓存配置。`redis`, `redis-cluster`,`memcache`配置连接字符串;`twoqueue` 设置队列参数 - - Redis: `redis://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - - Redis-cluster `redis+cluster://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` - - Memcache: `127.0.0.1:9090;127.0.0.1:9091` - - TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` 或者 `50000`,代表缓冲区的缓存对象容量 -- `ITEM_TTL`: **16h**: 缓存项目失效时间,设置为 -1 则禁用缓存 - -### 缓存 - 最后提交缓存设置 (`cache.last_commit`) - -- `ITEM_TTL`: **8760h**:如果未使用,保持缓存中的项目的时间,将其设置为 -1 会禁用缓存。 -- `COMMITS_COUNT`: **1000**:仅在存储库的提交计数大于时启用缓存。 - -## 会话 (`session`) - -- `PROVIDER`: **memory**:会话存储引擎 \[memory, file, redis, redis-cluster, db, mysql, couchbase, memcache, postgres\]。设置为 `db` 将会重用 `[database]` 的配置信息。 -- `PROVIDER_CONFIG`: **data/sessions**:对于文件,为根路径;对于 db,为空(将使用数据库配置);对于其他引擎,为连接字符串。相对路径将根据 _`AppWorkPath`_ 绝对化。 -- `COOKIE_SECURE`: **_empty_**:`true` 或 `false`。启用此选项以强制在所有会话访问中使用 HTTPS。如果没有设置,当 ROOT_URL 是 https 链接的时候默认设置为 true。 -- `COOKIE_NAME`: **i\_like\_gitea**:用于会话 ID 的 cookie 名称。 -- `GC_INTERVAL_TIME`: **86400**:GC 间隔时间,以秒为单位。 -- `SESSION_LIFE_TIME`: **86400**:会话生命周期,以秒为单位,默认为 86400(1 天)。 -- `DOMAIN`: **_empty_**:设置 cookie 的域。 -- `SAME_SITE`: **lax** \[strict, lax, none\]:为 cookie 设置 SameSite 属性。 - -## 图像 (`picture`) - -- `GRAVATAR_SOURCE`: **gravatar**:头像来源,可以是 gravatar、duoshuo 或类似 http://cn.gravatar.com/avatar/ 的来源。 - `http://cn.gravatar.com/avatar/`。 -- `DISABLE_GRAVATAR`: **false**:启用后,只使用内部头像。**已弃用 [v1.18+]** 该配置已迁移到数据库中保存,通过管理员面板进行配置。 -- `ENABLE_FEDERATED_AVATAR`: **false**:启用头像联盟支持(参见 - [http://www.libravatar.org](http://www.libravatar.org))。**已弃用 [v1.18+]** 该配置已迁移到数据库中保存,通过管理员面板进行配置。 - -- `AVATAR_STORAGE_TYPE`: **default**:在 `[storage.xxx]` 中定义的存储类型。默认为 `default`,如果没有 `[storage]` 部分,则将读取 `[storage]`,如果没有则将是 `local` 类型。 -- `AVATAR_UPLOAD_PATH`: **data/avatars**:存储用户头像图像文件的路径。 -- `AVATAR_MAX_WIDTH`: **4096**:头像的最大宽度,以像素为单位。 -- `AVATAR_MAX_HEIGHT`: **4096**:头像的最大高度,以像素为单位。 -- `AVATAR_MAX_FILE_SIZE`: **1048576**(1MiB):头像的最大大小。 -- `AVATAR_MAX_ORIGIN_SIZE`: **262144**(256KiB):如果上传的文件不大于此字节大小,则图像将原样使用,无需调整大小/转换。 -- `AVATAR_RENDERED_SIZE_FACTOR`: **2**:渲染的头像图像的乘法因子。较大的值在 HiDPI 设备上会产生更细腻的渲染。 - -- `REPOSITORY_AVATAR_STORAGE_TYPE`: **default**:在 `[storage.xxx]` 中定义的存储类型。默认为 `default`,如果没有 `[storage]` 部分,则将读取 `[storage]`,如果没有则将是 `local` 类型。 -- `REPOSITORY_AVATAR_UPLOAD_PATH`: **data/repo-avatars**:存储仓库头像图像文件的路径。 -- `REPOSITORY_AVATAR_FALLBACK`: **none**:Gitea 处理缺少仓库头像的方式 - - none = 不显示任何头像 - - random = 生成随机头像 - - image = 使用默认图像(在 `REPOSITORY_AVATAR_FALLBACK_IMAGE` 中设置),如果设置为 image 并且未上传任何图像。 -- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**:作为默认仓库头像的图像(如果将 `REPOSITORY_AVATAR_FALLBACK` 设置为 image 并且没有上传图像)。 - -## 项目 (`project`) - -默认项目看板的模板: - -- `PROJECT_BOARD_BASIC_KANBAN_TYPE`: **待办,进行中,已完成** -- `PROJECT_BOARD_BUG_TRIAGE_TYPE`: **待分析,高优先级,低优先级,已关闭** - -## 工单和合并请求的附件 (`attachment`) - -- `ENABLED`: **true**: 是否允许用户上传附件。 -- `ALLOWED_TYPES`: **.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*`、`audio/*`、`video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。 -- `MAX_SIZE`: **2048**: 附件的最大限制(MB)。 -- `MAX_FILES`: **5**: 一次最多上传的附件数量。 -- `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。 -- `SERVE_DIRECT`: **false**: 允许存储驱动器重定向到经过身份验证的 URL 以直接提供文件。目前,只支持 Minio/S3 通过签名 URL 提供支持,local 不会执行任何操作。 -- `PATH`: **attachments**: 存储附件的路径,仅当 STORAGE_TYPE 为 `local` 时可用。如果是相对路径,将会被解析为 `${AppDataPath}/${attachment.PATH}`. -- `MINIO_ENDPOINT`: **localhost:9000**: Minio 端点以连接,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID 以连接,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey 以连接,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_BUCKET`: **gitea**: Minio 存储附件的存储桶,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio 存储桶寻址方式, 仅当 `STORAGE_TYPE` 为 `minio` 时可用。 - - `auto` 自动检测 - - `dns` 子域名寻址 - - `path` 路径寻址 -- `MINIO_LOCATION`: **us-east-1**: Minio 存储桶的位置以创建,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_BASE_PATH`: **attachments/**: Minio 存储桶上的基本路径,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_USE_SSL`: **false**: Minio 启用 SSL,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio 跳过 SSL 验证,仅当 STORAGE_TYPE 为 `minio` 时可用。 -- `MINIO_CHECKSUM_ALGORITHM`: **default**: Minio 校验算法:`default`(适用于 MinIO 或 AWS S3)或 `md5`(适用于 Cloudflare 或 Backblaze) - -## 日志 (`log`) - -- `ROOT_PATH`: **_empty_**: 日志文件的根目录。 -- `MODE`: **console**: 日志模式。对于多个模式,请使用逗号分隔。您可以在每个模式的日志子部分中配置每个模式。 `\[log.writer-mode-name\]`. -- `LEVEL`: **Info**: 日志级别。可选值:\[Trace, Debug, Info, Warn, Error, Critical, Fatal, None\] -- `STACKTRACE_LEVEL`: **None**: 记录创建堆栈跟踪的默认日志级别(很少有用,不要设置它)。可选值:\[Trace, Debug, Info, Warn, Error, Critical, Fatal, None\] -- `ENABLE_SSH_LOG`: **false**: 将 SSH 日志保存到日志文件中。 -- `logger.access.MODE`: **_empty_**: "access" 记录器 -- `logger.router.MODE`: **,**: "router" 记录器,单个逗号表示它将使用上述默认 MODE -- `logger.xorm.MODE`: **,**: "xorm" 记录器 - -### 访问日志 (`log`) - -- `ACCESS_LOG_TEMPLATE`: **`{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"`**: 设置用于创建访问日志的模板。 - - 可用以下变量: - - `Ctx`: 请求的 `context.Context`。 - - `Identity`: 登录的 SignedUserName 或 `"-"`(如果未登录)。 - - `Start`: 请求的开始时间。 - - `ResponseWriter`: 请求的 responseWriter。 - - `RequestID`: 与 REQUEST_ID_HEADERS 相匹配的值(默认:如果不匹配则为 `-`)。 - - 您必须非常小心,确保此模板不会引发错误或 panic,因为此模板在 panic/recovery 脚本之外运行。 -- `REQUEST_ID_HEADERS`: **_empty_**: 您可以在这里配置由逗号分隔的多个值。它将按照配置的顺序进行匹配,最终将在访问日志中打印第一个匹配的值。 - - 例如: - - 在请求头中:X-Request-ID: **test-id-123** - - 在 app.ini 中的配置:REQUEST_ID_HEADERS = X-Request-ID - - 在日志中打印:127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "**test-id-123**" ... - -### 日志子部分 (`log.<writer-mode-name>`) - -- `MODE`: **name**: 设置此日志记录器的模式 - 默认为提供的子部分名称。这允许您在不同级别上具有两个不同的文件日志记录器。 -- `LEVEL`: **log.LEVEL**: 设置此日志记录器的日志级别。默认为全局 `[log]` 部分中设置的 `LEVEL`。 -- `STACKTRACE_LEVEL`: **log.STACKTRACE_LEVEL**: 设置记录堆栈跟踪的日志级别。 -- `EXPRESSION`: **""**: 用于匹配函数名称、文件或消息的正则表达式。默认为空。只有匹配表达式的日志消息才会保存在记录器中。 -- `FLAGS`: **stdflags**: 逗号分隔的字符串,表示日志标志。默认为 `stdflags`,表示前缀:`2009/01/23 01:23:23 ...a/b/c/d.go:23:runtime.Caller() [I]: message`。`none` 表示不要在日志行前缀中添加任何内容。有关更多信息,请参见 `modules/log/flags.go`。 -- `PREFIX`: **""**: 该记录器中每个日志行的附加前缀。默认为空。 -- `COLORIZE`: **false**: 是否为日志行添加颜色 - -### 控制台日志模式 (`log.console` 或 `MODE=console`) - -- 对于控制台记录器,如果不在 Windows 上或终端被确定为能够着色,则 `COLORIZE` 默认为 `true`。 -- `STDERR`: **false**: 使用 Stderr 而不是 Stdout。 - -### 文件日志模式 (`log.file` 或 `MODE=file`) - -- `FILE_NAME`: 设置此记录器的文件名。默认为 `gitea.log`(例外:访问日志默认为 `access.log`)。如果是相对路径,将相对于 `ROOT_PATH`。 -- `LOG_ROTATE`: **true**: 旋转日志文件。 -- `MAX_SIZE_SHIFT`: **28**: 单个文件的最大大小移位,28 表示 256Mb。 -- `DAILY_ROTATE`: **true**: 每天旋转日志。 -- `MAX_DAYS`: **7**: 在 n 天后删除日志文件 -- `COMPRESS`: **true**: 默认使用 gzip 压缩旧的日志文件 -- `COMPRESSION_LEVEL`: **-1**: 压缩级别 - -### 连接日志模式 (`log.conn` 或 `MODE=conn`) - -- `RECONNECT_ON_MSG`: **false**: 对每个单独的消息重新连接主机。 -- `RECONNECT`: **false**: 当连接丢失时尝试重新连接。 -- `PROTOCOL`: **tcp**: 设置协议,可以是 "tcp"、"unix" 或 "udp"。 -- `ADDR`: **:7020**: 设置要连接到的地址。 - -## 定时任务 (`cron`) - -- `ENABLED`: **false**: 是否在后台运行定期任务。 -- `RUN_AT_START`: **false**: 在应用程序启动时运行定时任务。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true时,任务成功完成时将进行通知。 - -- `SCHEDULE` 接受的格式: - - 完整的crontab语法规范, e.g. `* * * * * ?` - - 描述符e.g. `@midnight`, `@every 1h30m` ... - - 更多详见: [cron documentation](https://pkg.go.dev/github.com/gogs/cron@v0.0.0-20171120032916-9f6c956d3e14) - -### 基本定时任务 - 默认开启 - -#### 定时任务 - 删除旧的仓库存档 (`cron.archive_cleanup`) - -- `ENABLED`: **true**: 是否启用该定时任务。 -- `RUN_AT_START`: **true**: 设置在服务启动时运行。 -- `SCHEDULE`: **@midnight**: 使用Cron语法的定时任务触发配置,例如 `@every 1h`。 -- `OLDER_THAN`: **24h**: 超过`OLDER_THAN`时间的存档将被删除,例如 `12h`。 - -#### 定时任务 - 更新镜像仓库 (`cron.update_mirrors`) - -- `SCHEDULE`: **@every 10m**: 使用Cron语法的定时任务触发配置,例如 `@every 3h`。 -- `PULL_LIMIT`: **50**: 将要添加到队列的镜像数量限制为此数字(负值表示无限制,0将导致不会将镜像加入队列,从而有效地禁用镜像更新)。 -- `PUSH_LIMIT`: **50**: 将要添加到队列的镜像数量限制为此数字(负值表示无限制,0将导致不会将镜像加入队列,从而有效地禁用镜像更新)。 - -#### 定时任务 - 健康检查所有仓库 (`cron.repo_health_check`) - -- `SCHEDULE`: **@midnight**: Cron语法,用于安排仓库健康检查。 -- `TIMEOUT`: **60s**: 用于健康检查执行超时的时间持续语法。 -- `ARGS`: **_empty_**: `git fsck` 命令的参数,例如 `--unreachable --tags`。在 http://git-scm.com/docs/git-fsck 上了解更多。 - -#### 定时任务 - 检查所有仓库统计 (`cron.check_repo_stats`) - -- `RUN_AT_START`: **true**: 在启动时运行仓库统计检查。 -- `SCHEDULE`: **@midnight**: Cron语法,用于安排仓库统计检查。 - -#### 定时任务 - 清理 hook_task 表 (`cron.cleanup_hook_task_table`) - -- `ENABLED`: **true**: 启用清理 hook_task 任务。 -- `RUN_AT_START`: **false**: 在启动时运行清理 hook_task(如果启用)。 -- `SCHEDULE`: **@midnight**: Cron语法,用于清理 hook_task 表。 -- `CLEANUP_TYPE` **OlderThan** OlderThan 或 PerWebhook 方法来清理 hook_task,可以按年龄(即 hook_task 记录传递多久)或按每个 Webhook 保留的数量(即每个 Webhook 保留最新的 x 个传递)来清理。 -- `OLDER_THAN`: **168h**: 如果 CLEANUP_TYPE 设置为 OlderThan,则早于此表达式的任何传递的 hook_task 记录将被删除。 -- `NUMBER_TO_KEEP`: **10**: 如果 CLEANUP_TYPE 设置为 PerWebhook,则 Webhook 的此数量 hook_task 记录将被保留(即保留最新的 x 个传递)。 - -#### Cron - 清理过期的包 (`cron.cleanup_packages`) - -- `ENABLED`: **true**: 启用清理过期包任务。 -- `RUN_AT_START`: **true**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 每次运行此任务时都会通知。 -- `SCHEDULE`: **@midnight**: Cron语法,用于任务。 -- `OLDER_THAN`: **24h**: 未引用的包数据创建超过 OLDER_THAN 时间的包将被删除。 - -#### Cron - 更新迁移海报 ID (`cron.update_migration_poster_id`) - -- `SCHEDULE`: **@midnight** : 同步之间的间隔作为持续时间,每次实例启动时都会尝试同步。 - -#### Cron - 同步外部用户 (`cron.sync_external_users`) - -- `SCHEDULE`: **@midnight** : 同步之间的间隔作为持续时间,每次实例启动时都会尝试同步。 -- `UPDATE_EXISTING`: **true**: 创建新用户,更新现有用户数据,并禁用不再在外部源中的用户(默认设置)或仅在 UPDATE_EXISTING 设置为 false 时创建新用户。 - -### 扩展的定时任务(默认未启用) - -#### Cron - 垃圾收集所有仓库 (`cron.git_gc_repos`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 -- `TIMEOUT`: **60s**: 用于垃圾收集执行超时的时间持续语法。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `ARGS`: **_empty_**: `git gc` 命令的参数,例如 `--aggressive --auto`。默认值与 [git] -> GC_ARGS 相同。 - -#### Cron - 使用 Gitea SSH 密钥更新 '.ssh/authorized_keys' 文件 (`cron.resync_all_sshkeys`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 - -#### Cron - 重新同步所有仓库的 pre-receive、update 和 post-receive 钩子 (`cron.resync_all_hooks`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 - -#### Cron - 重新初始化所有缺失的 Git 仓库,但记录已存在 (`cron.reinit_missing_repos`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 - -#### Cron - 删除所有缺少 Git 文件的仓库 (`cron.delete_missing_repos`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 - -#### Cron - 删除生成的仓库头像 (`cron.delete_generated_repository_avatars`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 72h**: Cron语法,用于安排仓库存档清理,例如 `@every 1h`。 - -#### Cron - 从数据库中删除所有旧的操作 (`cron.delete_old_actions`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NOTICE_ON_SUCCESS`: **false**: 设置为 true 以打开成功通知。 -- `SCHEDULE`: **@every 168h**: Cron语法,用于设置多长时间进行检查。 -- `OLDER_THAN`: **8760h**: 早于此表达式的任何操作都将从数据库中删除,建议使用 `8760h`(1年),因为这是热力图的最大长度。 - -#### Cron - 从数据库中删除所有旧的系统通知 (`cron.delete_old_system_notices`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `NO_SUCCESS_NOTICE`: **false**: 设置为 true 以关闭成功通知。 -- `SCHEDULE`: **@every 168h**: Cron语法,用于设置多长时间进行检查。 -- `OLDER_THAN`: **8760h**: 早于此表达式的任何系统通知都将从数据库中删除。 - -#### Cron - 在仓库中回收 LFS 指针 (`cron.gc_lfs`) - -- `ENABLED`: **false**: 启用服务。 -- `RUN_AT_START`: **false**: 在启动时运行任务(如果启用)。 -- `SCHEDULE`: **@every 24h**: Cron语法,用于设置多长时间进行检查。 -- `OLDER_THAN`: **168h**: 只会尝试回收早于此时间(默认7天)的 LFSMetaObject。 -- `LAST_UPDATED_MORE_THAN_AGO`: **72h**: 只会尝试回收超过此时间(默认3天)没有尝试过回收的 LFSMetaObject。 -- `NUMBER_TO_CHECK_PER_REPO`: **100**: 每个仓库要检查的过期 LFSMetaObject 的最小数量。设置为 `0` 以始终检查所有。 - -## Git (`git`) - -- `PATH`: **""**: Git可执行文件的路径。如果为空,Gitea将在PATH环境中搜索。 -- `HOME_PATH`: **%(APP_DATA_PATH)s/home**: Git的HOME目录。 - 此目录将用于包含Gitea的git调用将使用的`.gitconfig`和可能的`.gnupg`目录。如果您可以确认Gitea是在此环境中唯一运行的应用程序,您可以将其设置为Gitea用户的正常主目录。 -- `DISABLE_DIFF_HIGHLIGHT`: **false**: 禁用已添加和已删除更改的高亮显示。 -- `MAX_GIT_DIFF_LINES`: **1000**: 在diff视图中允许单个文件的最大行数。 -- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: 在diff视图中每行的最大字符数。 -- `MAX_GIT_DIFF_FILES`: **100**: 在diff视图中显示的最大文件数。 -- `COMMITS_RANGE_SIZE`: **50**: 设置默认的提交范围大小 -- `BRANCHES_RANGE_SIZE`: **20**: 设置默认的分支范围大小 -- `GC_ARGS`: **_empty_**: 命令`git gc`的参数,例如`--aggressive --auto`。更多信息请参见http://git-scm.com/docs/git-gc/ -- `ENABLE_AUTO_GIT_WIRE_PROTOCOL`: **true**: 如果使用Git版本 >= 2.18时使用Git wire协议版本2,默认为true,当您始终希望使用Git wire协议版本1时设置为false。 - 要在使用OpenSSH服务器的情况下为通过SSH的Git启用此功能,请将`AcceptEnv GIT_PROTOCOL`添加到您的sshd_config文件中。 -- `PULL_REQUEST_PUSH_MESSAGE`: **true**: 对于推送到非默认分支的响应,使用URL创建拉取请求(如果启用了该存储库的拉取请求) -- `VERBOSE_PUSH`: **true**: 在处理推送时打印有关推送状态的信息。 -- `VERBOSE_PUSH_DELAY`: **5s**: 仅在推送时间超过此延迟时才打印详细信息。 -- `LARGE_OBJECT_THRESHOLD`: **1048576**: (仅限于Go-Git),不要在内存中缓存大于此大小的对象。(设置为0以禁用。) -- `DISABLE_CORE_PROTECT_NTFS`: **false** 将`core.protectNTFS`强制设置为false。 -- `DISABLE_PARTIAL_CLONE`: **false** 禁用使用部分克隆进行git。 - -### Git - 超时设置 (`git.timeout`) - -- `DEFAULT`: **360**: Git操作的默认超时时间,单位秒 -- `MIGRATE`: **600**: 在迁移外部存储库时的超时时间,单位秒 -- `MIRROR`: **300**: 在镜像外部存储库时的超时时间,单位秒 -- `CLONE`: **300**: 在存储库之间进行内部克隆的超时时间,单位秒 -- `PULL`: **300**: 在存储库之间进行内部拉取的超时时间,单位秒 -- `GC`: **60**: git存储库GC的超时时间,单位秒 - -### Git - 配置选项 (`git.config`) - -此部分中的键/值对将用作git配置。 -此部分仅执行“设置”配置,从此部分中删除的配置键不会自动从git配置中删除。格式为`some.configKey = value`。 - -- `diff.algorithm`: **histogram** -- `core.logAllRefUpdates`: **true** -- `gc.reflogExpire`: **90** - -## 指标 (`metrics`) - -- `ENABLED`: **false**: 启用/prometheus的metrics端点。 -- `ENABLED_ISSUE_BY_LABEL`: **false**: 启用按标签统计问题,格式为`gitea_issues_by_label{label="bug"} 2`。 -- `ENABLED_ISSUE_BY_REPOSITORY`: **false**: 启用按存储库统计问题,格式为`gitea_issues_by_repository{repository="org/repo"} 5`。 -- `TOKEN`: **_empty_**: 如果要在授权中包含指标,则需要指定令牌。相同的令牌需要在prometheus参数`bearer_token`或`bearer_token_file`中使用。 - -## API (`api`) - -- `ENABLE_SWAGGER`: **true**: 启用API文档接口 (`/api/swagger`, `/api/v1/swagger`, …). True or false。 -- `MAX_RESPONSE_ITEMS`: **50**: API分页的最大单页项目数。 -- `DEFAULT_PAGING_NUM`: **30**: API分页的默认分页数。 -- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Git trees API的默认单页项目数。 -- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): blobs API的默认最大文件大小。 - -## OAuth2 (`oauth2`) - -- `ENABLED`: **true**:启用OAuth2提供者。 -- `ACCESS_TOKEN_EXPIRATION_TIME`:**3600**:OAuth2访问令牌的生命周期,以秒为单位。 -- `REFRESH_TOKEN_EXPIRATION_TIME`:**730**:OAuth2刷新令牌的生命周期,以小时为单位。 -- `INVALIDATE_REFRESH_TOKENS`:**false**:检查刷新令牌是否已被使用。 -- `JWT_SIGNING_ALGORITHM`:**RS256**:用于签署OAuth2令牌的算法。有效值:[`HS256`,`HS384`,`HS512`,`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`]。 -- `JWT_SECRET`:**_empty_**:OAuth2访问和刷新令牌的身份验证密钥,请将其更改为唯一的字符串。仅当`JWT_SIGNING_ALGORITHM`设置为`HS256`,`HS384`或`HS512`时才需要此设置。 -- `JWT_SECRET_URI`:**_empty_**:可以使用此配置选项,而不是在配置中定义`JWT_SECRET`,以向Gitea提供包含密钥的文件的路径(示例值:`file:/etc/gitea/oauth2_jwt_secret`)。 -- `JWT_SIGNING_PRIVATE_KEY_FILE`:**jwt/private.pem**:用于签署OAuth2令牌的私钥文件路径。路径相对于`APP_DATA_PATH`。仅当`JWT_SIGNING_ALGORITHM`设置为`RS256`,`RS384`,`RS512`,`ES256`,`ES384`或`ES512`时才需要此设置。文件必须包含PKCS8格式的RSA或ECDSA私钥。如果不存在密钥,则将为您创建一个4096位密钥。 -- `MAX_TOKEN_LENGTH`:**32767**:从OAuth2提供者接受的令牌/cookie的最大长度。 -- `DEFAULT_APPLICATIONS`:**git-credential-oauth,git-credential-manager, tea**:在启动时预注册用于某些服务的OAuth应用程序。有关可用选项列表,请参阅[OAuth2文档](/development/oauth2-provider.md)。 - -## i18n (`i18n`) - -- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN**: - 在语言选择器中显示的区域设置列表。如果用户浏览器的语言与列表中的任何区域设置不匹配,则将使用第一个区域设置作为默认值。 - -- `NAMES`:**English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Türkçe,Čeština,Српски,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia,മലയാളം**: - 对应于各区域设置的可见名称。 - -## Markup (`markup`) - -- `MERMAID_MAX_SOURCE_CHARACTERS`: **5000**: 设置Mermaid源的最大大小。(设为-1代表禁止) - -gitea支持外部渲染工具,你可以配置你熟悉的文档渲染工具. 比如一下将新增一个名字为 asciidoc 的渲染工具。 - -```ini -[markup.asciidoc] -ENABLED = true -NEED_POSTPROCESS = true -FILE_EXTENSIONS = .adoc,.asciidoc -RENDER_COMMAND = "asciidoctor --embedded --safe-mode=secure --out-file=- -" -IS_INPUT_FILE = false -``` - -- ENABLED:**false** 设置是否启动渲染器 -- NEED_POSTPROCESS:**true** 设置为**true**以替换链接/SHA1等。 -- FILE_EXTENSIONS:**_empty_** 要由外部命令渲染的文件扩展名列表。多个扩展名需要用逗号分隔。 -- RENDER_COMMAND:用于渲染所有匹配的扩展名的外部命令。 -- IS_INPUT_FILE:**false** 输入不是标准输入,而是一个在`RENDER_COMMAND`之后带有文件参数的文件。 -- RENDER_CONTENT_MODE:**sanitized** 内容将如何呈现。 - - sanitized:对内容进行清理,并在当前页面内呈现,默认仅允许一些HTML标签和属性。可以在`[markup.sanitizer.*]`中定义自定义的清理规则。 - - no-sanitizer:禁用清理程序,在当前页面内呈现内容。这是**不安全**的,如果内容包含恶意代码,可能会导致XSS攻击。 - - iframe:在单独的独立页面中呈现内容,并通过iframe嵌入到当前页面中。iframe处于禁用同源策略的沙箱模式,并且JS代码与父页面安全隔离。 - -两个特殊的环境变量会传递给渲染命令: - -- `GITEA_PREFIX_SRC`,其中包含`src`路径树中的当前URL前缀。用作链接的前缀。 -- `GITEA_PREFIX_RAW`,其中包含`raw`路径树中的当前URL前缀。用作图像路径的前缀。 - -如果`RENDER_CONTENT_MODE`为`sanitized`,Gitea支持自定义用于呈现的HTML的清理策略。下面的示例将支持来自pandoc的KaTeX输出。 - -```ini -[markup.sanitizer.TeX] -; Pandoc renders TeX segments as <span>s with the "math" class, optionally -; with "inline" or "display" classes depending on context. -ELEMENT = span -ALLOW_ATTR = class -REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+ -ALLOW_DATA_URI_IMAGES = true -``` - -- `ELEMENT`:此策略适用于的元素。必须非空。 -- `ALLOW_ATTR`:此策略允许的属性。必须非空。 -- `REGEXP`:用于匹配属性内容的正则表达式。必须存在,但可以为空,以无条件允许此属性的白名单。 -- `ALLOW_DATA_URI_IMAGES`:**false** 允许数据URI图像(`<img src="data:image/png;base64,..."/>`)。 - -可以通过添加唯一的子节来定义多个清理规则,例如`[markup.sanitizer.TeX-2]`。 -要仅为指定的外部渲染器应用清理规则,它们必须使用渲染器名称,例如`[markup.sanitizer.asciidoc.rule-1]`。 -如果规则在渲染器ini节之上定义,或者名称与渲染器不匹配,则应用于每个渲染器。 - -## 代码高亮映射 (`highlight.mapping`) - -- `file_extension 比如 .toml`: **language 比如 ini**。文件扩展名到语言的映射覆盖。 - -- Gitea 将使用 `.gitattributes` 文件中的 `linguist-language` 或 `gitlab-language` 属性来对文件进行高亮显示,如果可用。 -如果未设置此属性或语言不可用,则将查找文件扩展名在此映射中或使用启发式方法来确定文件类型。 - -## 时间 (`time`) - -- `DEFAULT_UI_LOCATION`:在 UI 上的默认时间位置,以便我们可以在 UI 上显示正确的用户时间。例如:Asia/Shanghai - -## 任务 (`task`) - -任务队列配置已移动到 `queue.task`。然而,以下配置值仍保留以确保向后兼容: - -- `QUEUE_TYPE`:**channel**:任务队列类型,可以是 `channel` 或 `redis`。 -- `QUEUE_LENGTH`:**1000**:任务队列长度,仅在 `QUEUE_TYPE` 为 `channel` 时可用。 -- `QUEUE_CONN_STR`:**redis://127.0.0.1:6379/0**:任务队列连接字符串,仅在 `QUEUE_TYPE` 为 `redis` 时可用。 - 如果 redis 需要密码,使用 `redis://123@127.0.0.1:6379/0` 或 `redis+cluster://123@127.0.0.1:6379/0`。 - -## 迁移 (`migrations`) - -- `MAX_ATTEMPTS`:**3**:每次 http/https 请求的最大尝试次数(用于迁移)。 -- `RETRY_BACKOFF`:**3**:每次 http/https 请求重试的退避时间(秒)。 -- `ALLOWED_DOMAINS`:**_empty_**:允许迁移仓库的域名允许列表,默认为空。这意味着允许一切。多个域名可以用逗号分隔。支持通配符:`github.com, *.github.com`。 -- `BLOCKED_DOMAINS`:**_empty_**:阻止迁移仓库的域名阻止列表,默认为空。多个域名可以用逗号分隔。当 `ALLOWED_DOMAINS` 不为空时,此选项优先级较高,用于拒绝域名。支持通配符。 -- `ALLOW_LOCALNETWORKS`:**false**:允许 RFC 1918、RFC 1122、RFC 4632 和 RFC 4291 中定义的私有地址。如果域名被 `ALLOWED_DOMAINS` 允许,此选项将被忽略。 -- `SKIP_TLS_VERIFY`:**false**:允许跳过 TLS 验证。 - -## 联邦(`federation`) - -- `ENABLED`:**false**:启用/禁用联邦功能。 -- `SHARE_USER_STATISTICS`:**true**:如果启用联邦,则启用/禁用节点信息的用户统计信息。 -- `MAX_SIZE`:**4**:联邦请求和响应的最大大小(MB)。 - -警告:更改以下设置可能会破坏联邦功能。 - -- `ALGORITHMS`:**rsa-sha256, rsa-sha512, ed25519**:HTTP 签名算法。 -- `DIGEST_ALGORITHM`:**SHA-256**:HTTP 签名摘要算法。 -- `GET_HEADERS`:**(request-target), Date**:用于联邦请求的 GET 头部。 -- `POST_HEADERS`:**(request-target), Date, Digest**:用于联邦请求的 POST 头部。 - -## 包(`packages`) - -- `ENABLED`:**true**:启用/禁用包注册表功能。 -- `CHUNKED_UPLOAD_PATH`:**tmp/package-upload**:分块上传的路径。默认为 `APP_DATA_PATH` + `tmp/package-upload`。 -- `LIMIT_TOTAL_OWNER_COUNT`:**-1**:单个所有者可以拥有的包版本的最大数量(`-1` 表示无限制)。 -- `LIMIT_TOTAL_OWNER_SIZE`:**-1**:单个所有者可以使用的包的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_ALPINE`:**-1**:Alpine 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CARGO`:**-1**:Cargo 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CHEF`:**-1**:Chef 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_COMPOSER`:**-1**:Composer 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CONAN`:**-1**:Conan 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CONDA`:**-1**:Conda 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CONTAINER`:**-1**:Container 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_CRAN`:**-1**:CRAN 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_DEBIAN`:**-1**:Debian 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_GENERIC`:**-1**:通用上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_GO`:**-1**:Go 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_HELM`:**-1**:Helm 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_MAVEN`:**-1**:Maven 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_NPM`:**-1**:npm 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_NUGET`:**-1**:NuGet 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_PUB`:**-1**:Pub 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_PYPI`:**-1**:PyPI 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_RPM`:**-1**:RPM 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_RUBYGEMS`:**-1**:RubyGems 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_SWIFT`:**-1**:Swift 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 -- `LIMIT_SIZE_VAGRANT`:**-1**:Vagrant 上传的最大大小(`-1` 表示无限制,格式为 `1000`、`1 MB`、`1 GiB`)。 - -## 镜像(`mirror`) - -- `ENABLED`:**true**:启用镜像功能。设置为 **false** 以禁用所有镜像。预先存在的镜像保持有效,但不会更新;可以转换为常规仓库。 -- `DISABLE_NEW_PULL`:**false**:禁用创建**新的**拉取镜像。预先存在的镜像保持有效。如果 `mirror.ENABLED` 为 `false`,将被忽略。 -- `DISABLE_NEW_PUSH`:**false**:禁用创建**新的**推送镜像。预先存在的镜像保持有效。如果 `mirror.ENABLED` 为 `false`,将被忽略。 -- `DEFAULT_INTERVAL`:**8h**:每次检查之间的默认间隔。 -- `MIN_INTERVAL`:**10m**:检查的最小间隔。(必须大于 1 分钟)。 - -## LFS (`lfs`) - -用于 lfs 数据的存储配置。当将 `STORAGE_TYPE` 设置为 `xxx` 时,它将从默认的 `[storage]` 或 `[storage.xxx]` 派生。 -当派生时,`PATH` 的默认值是 `data/lfs`,`MINIO_BASE_PATH` 的默认值是 `lfs/`。 - -- `STORAGE_TYPE`:**local**:lfs 的存储类型,`local` 表示本地磁盘,`minio` 表示 S3 兼容对象存储服务,或者使用 `[storage.xxx]` 中定义的其他名称。 -- `SERVE_DIRECT`:**false**:允许存储驱动程序重定向到经过身份验证的 URL 以直接提供文件。目前,仅支持通过签名的 URL 提供 Minio/S3,本地不执行任何操作。 -- `PATH`:**./data/lfs**:存储 LFS 文件的位置,仅在 `STORAGE_TYPE` 为 `local` 时可用。如果未设置,则回退到 `[server]` 部分中已弃用的 `LFS_CONTENT_PATH` 值。 -- `MINIO_ENDPOINT`:**localhost:9000**:连接的 Minio 终端点,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_ACCESS_KEY_ID`:Minio 的 accessKeyID,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_SECRET_ACCESS_KEY`:Minio 的 secretAccessKey,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_BUCKET`:**gitea**:用于存储 lfs 的 Minio 桶,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio 存储桶寻址方式,可选值为 `auto`, `dns`, `path` 仅当 `STORAGE_TYPE` 为 `minio` 时可用。 - - `auto` 自动检测 - - `dns` 子域名寻址 - - `path` 路径寻址 -- `MINIO_LOCATION`:**us-east-1**:创建桶的 Minio 位置,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_BASE_PATH`:**lfs/**:桶上的 Minio 基本路径,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_USE_SSL`:**false**:Minio 启用 ssl,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_INSECURE_SKIP_VERIFY`:**false**:Minio 跳过 SSL 验证,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 - -## 存储 (`storage`) - -默认的附件、lfs、头像、仓库头像、仓库归档、软件包、操作日志、操作艺术品的存储配置。 - -- `STORAGE_TYPE`:**local**:存储类型,`local` 表示本地磁盘,`minio` 表示 S3 兼容的对象存储服务。 -- `SERVE_DIRECT`:**false**:允许存储驱动程序重定向到经过身份验证的 URL 以直接提供文件。目前,仅支持通过签名的 URL 提供 Minio/S3,本地不执行任何操作。 -- `MINIO_ENDPOINT`:**localhost:9000**:连接的 Minio 终端点,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_ACCESS_KEY_ID`:Minio 的 accessKeyID,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_SECRET_ACCESS_KEY`:Minio 的 secretAccessKey,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_BUCKET`:**gitea**:用于存储数据的 Minio 桶,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio 存储桶寻址方式,可选值为 `auto`, `dns`, `path` 仅当 `STORAGE_TYPE` 为 `minio` 时可用。 - - `auto` 自动检测 - - `dns` 子域名寻址 - - `path` 路径寻址 -- `MINIO_LOCATION`:**us-east-1**:创建桶的 Minio 位置,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_USE_SSL`:**false**:Minio 启用 ssl,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 -- `MINIO_INSECURE_SKIP_VERIFY`:**false**:Minio 跳过 SSL 验证,仅在 `STORAGE_TYPE` 为 `minio` 时可用。 - -建议的 minio 存储配置如下: - -```ini -[storage] -STORAGE_TYPE = minio -; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -MINIO_ENDPOINT = localhost:9000 -; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio` -MINIO_ACCESS_KEY_ID = -; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -MINIO_SECRET_ACCESS_KEY = -; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -MINIO_BUCKET = gitea -; Minio location to create bucket only available when STORAGE_TYPE is `minio` -MINIO_LOCATION = us-east-1 -; Minio enabled ssl only available when STORAGE_TYPE is `minio` -MINIO_USE_SSL = false -; Minio skip SSL verification available when STORAGE_TYPE is `minio` -MINIO_INSECURE_SKIP_VERIFY = false -SERVE_DIRECT = true -``` - -默认情况下,每个存储都有其默认的基本路径,如下所示: - -| storage | default base path | -| ----------------- | ------------------ | -| attachments | attachments/ | -| lfs | lfs/ | -| avatars | avatars/ | -| repo-avatars | repo-avatars/ | -| repo-archive | repo-archive/ | -| packages | packages/ | -| actions_log | actions_log/ | -| actions_artifacts | actions_artifacts/ | - -并且桶(bucket)、基本路径或`SERVE_DIRECT`可以是特殊的或被覆盖的,如果您想要使用不同的设置,您可以: - -```ini -[storage.actions_log] -MINIO_BUCKET = gitea_actions_log -SERVE_DIRECT = true -MINIO_BASE_PATH = my_actions_log/ ; default is actions_log/ if blank -``` - -如果您想为' lfs '自定义一个不同的存储,如果上面定义了默认存储 - -```ini -[lfs] -STORAGE_TYPE = my_minio - -[storage.my_minio] -STORAGE_TYPE = minio -; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -MINIO_ENDPOINT = localhost:9000 -; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio` -MINIO_ACCESS_KEY_ID = -; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -MINIO_SECRET_ACCESS_KEY = -; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -MINIO_BUCKET = gitea -; Minio location to create bucket only available when STORAGE_TYPE is `minio` -MINIO_LOCATION = us-east-1 -; Minio enabled ssl only available when STORAGE_TYPE is `minio` -MINIO_USE_SSL = false -; Minio skip SSL verification available when STORAGE_TYPE is `minio` -MINIO_INSECURE_SKIP_VERIFY = false -``` - -### 存储库归档存储 (`storage.repo-archive`) - -存储库归档存储的配置。当将`STORAGE_TYPE`设置为`xxx`时,它将继承默认的 `[storage]` 或 `[storage.xxx]` 配置。`PATH`的默认值是`data/repo-archive`,`MINIO_BASE_PATH`的默认值是`repo-archive/`。 - -- `STORAGE_TYPE`: **local**:存储类型,`local`表示本地磁盘,`minio`表示与S3兼容的对象存储服务,或者使用定义为`[storage.xxx]`的其他名称。 -- `SERVE_DIRECT`: **false**:允许存储驱动程序重定向到经过身份验证的URL以直接提供文件。目前,只有Minio/S3支持通过签名URL,本地不执行任何操作。 -- `PATH`: **./data/repo-archive**:用于存储归档文件的位置,仅在`STORAGE_TYPE`为`local`时可用。 -- `MINIO_ENDPOINT`: **localhost:9000**:Minio端点,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_ACCESS_KEY_ID`: Minio的accessKeyID,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_SECRET_ACCESS_KEY`: Minio的secretAccessKey,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_BUCKET`: **gitea**:用于存储归档的Minio存储桶,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_BUCKET_LOOKUP`: **auto**: Minio 存储桶寻址方式,可选值为 `auto`, `dns`, `path` 仅当 `STORAGE_TYPE` 为 `minio` 时可用。 - - `auto` 自动检测 - - `dns` 子域名寻址 - - `path` 路径寻址 -- `MINIO_LOCATION`: **us-east-1**:用于创建存储桶的Minio位置,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_BASE_PATH`: **repo-archive/**:存储桶上的Minio基本路径,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_USE_SSL`: **false**:启用Minio的SSL,仅在`STORAGE_TYPE`为`minio`时可用。 -- `MINIO_INSECURE_SKIP_VERIFY`: **false**:跳过Minio的SSL验证,仅在`STORAGE_TYPE`为`minio`时可用。 - -### 存储库归档 (`repo-archive`) - -- `STORAGE_TYPE`: **local**:存储类型,用于操作日志,`local`表示本地磁盘,`minio`表示与S3兼容的对象存储服务,默认为`local`,或者使用定义为`[storage.xxx]`的其他名称。 -- `MINIO_BASE_PATH`: **repo-archive/**:Minio存储桶上的基本路径,仅在`STORAGE_TYPE`为`minio`时可用。 - -## 代理 (`proxy`) - -- `PROXY_ENABLED`: **false**: 启用代理,如果为true,所有通过HTTP向外部的请求都将受到影响,如果为false,即使环境设置了http_proxy/https_proxy也不会使用 -- `PROXY_URL`: **_empty_**: 代理服务器地址,支持 http://, https//, socks://,为空则不启用代理而使用环境变量中的 http_proxy/https_proxy -- `PROXY_HOSTS`: **_empty_**: 逗号分隔的多个需要代理的网址,支持 * 号匹配符号, ** 表示匹配所有网站 - -i.e. - -```ini -PROXY_ENABLED = true -PROXY_URL = socks://127.0.0.1:1080 -PROXY_HOSTS = *.github.com -``` - -## Actions (`actions`) - -- `ENABLED`: **true**:启用/禁用操作功能 -- `DEFAULT_ACTIONS_URL`: **github**:获取操作插件的默认平台,`github`表示`https://github.com`,`self`表示当前的 Gitea 实例。 -- `STORAGE_TYPE`: **local**:用于操作日志的存储类型,`local`表示本地磁盘,`minio`表示与S3兼容的对象存储服务,默认为`local`,或者使用定义为`[storage.xxx]`的其他名称。 -- `MINIO_BASE_PATH`: **actions_log/**:Minio存储桶上的基本路径,仅在`STORAGE_TYPE`为`minio`时可用。 - -`DEFAULT_ACTIONS_URL` 指示 Gitea 操作运行程序应该在哪里找到带有相对路径的操作。 -例如,`uses: actions/checkout@v4` 表示 `https://github.com/actions/checkout@v4`,因为 `DEFAULT_ACTIONS_URL` 的值为 `github`。 -它可以更改为 `self`,以使其成为 `root_url_of_your_gitea/actions/checkout@v4`。 - -请注意,对于大多数情况,不建议使用 `self`,因为它可能使名称在全局范围内产生歧义。 -此外,它要求您将所有所需的操作镜像到您的 Gitea 实例,这可能不值得。 -因此,请仅在您了解自己在做什么的情况下使用 `self`。 - -在早期版本(`<= 1.19`)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL,例如 `https://gitea.com` 或 `http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`。 -然而,后来的更新删除了这些选项,现在唯一的选项是 `github` 和 `self`,默认值为 `github`。 -但是,如果您想要使用其他 Git 服务器中的操作,您可以在 `uses` 字段中使用完整的 URL,Gitea 支持此功能(GitHub 不支持)。 -例如 `uses: https://gitea.com/actions/checkout@v4` 或 `uses: http://your-git-server/actions/checkout@v4`。 - -## 其他 (`other`) - -- `SHOW_FOOTER_VERSION`: **true**: 在页面底部显示Gitea的版本。 -- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: 在页脚显示模板执行的时间。 -- `ENABLE_SITEMAP`: **true**: 生成sitemap. -- `ENABLE_FEED`: **true**: 是否启用RSS/Atom diff --git a/docs/content/administration/customizing-gitea.en-us.md b/docs/content/administration/customizing-gitea.en-us.md deleted file mode 100644 index d122fb4bfa..0000000000 --- a/docs/content/administration/customizing-gitea.en-us.md +++ /dev/null @@ -1,403 +0,0 @@ ---- -date: "2017-04-15T14:56:00+02:00" -title: "Customizing Gitea" -slug: "customizing-gitea" -sidebar_position: 100 -toc: false -draft: false -aliases: - - /en-us/customizing-gitea -menu: - sidebar: - parent: "administration" - name: "Customizing Gitea" - identifier: "customizing-gitea" - sidebar_position: 100 ---- - -# Customizing Gitea - -Customizing Gitea is typically done using the `CustomPath` folder - by default this is -the `custom` folder from the working directory (WorkPath), but may be different if your build has -set this differently. This is the central place to override configuration settings, -templates, etc. You can check the `CustomPath` using `gitea help`. You can also find -the path on the _Configuration_ tab in the _Site Administration_ page. You can override -the `CustomPath` by setting either the `GITEA_CUSTOM` environment variable or by -using the `--custom-path` option on the `gitea` binary. (The option will override the -environment variable.) - -If Gitea is deployed from binary, all default paths will be relative to the Gitea -binary. If installed from a distribution, these paths will likely be modified to -the Linux Filesystem Standard. Gitea will attempt to create required folders, including -`custom/`. Distributions may provide a symlink for `custom` using `/etc/gitea/`. - -Application settings can be found in file `CustomConf` which is by default, -`$GITEA_CUSTOM/conf/app.ini` but may be different if your build has set this differently. -Again `gitea help` will allow you review this variable and you can override it using the -`--config` option on the `gitea` binary. - -- [Quick Cheat Sheet](administration/config-cheat-sheet.md) -- [Complete List](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - -If the `CustomPath` folder can't be found despite checking `gitea help`, check the `GITEA_CUSTOM` -environment variable; this can be used to override the default path to something else. -`GITEA_CUSTOM` might, for example, be set by an init script. You can check whether the value -is set under the "Configuration" tab on the site administration page. - -- [List of Environment Variables](administration/environment-variables.md) - -**Note:** Gitea must perform a full restart to see configuration changes. - -## Serving custom public files - -To make Gitea serve custom public files (like pages and images), use the folder -`$GITEA_CUSTOM/public/` as the webroot. Symbolic links will be followed. -At the moment, only the following files are served: - -- `public/robots.txt` -- files in the `public/.well-known/` folder -- files in the `public/assets/` folder - -For example, a file `image.png` stored in `$GITEA_CUSTOM/public/assets/`, can be accessed with -the url `http://gitea.domain.tld/assets/image.png`. - -## Changing the logo - -To build a custom logo and/or favicon clone the Gitea source repository, replace `assets/logo.svg` and/or `assets/favicon.svg` and run -`make generate-images`. `assets/favicon.svg` is used for the favicon only. This will update below output files which you can then place in `$GITEA_CUSTOM/public/assets/img` on your server: - -- `public/assets/img/logo.svg` - Used for site icon, app icon -- `public/assets/img/logo.png` - Used for Open Graph -- `public/assets/img/avatar_default.png` - Used as the default avatar image -- `public/assets/img/apple-touch-icon.png` - Used on iOS devices for bookmarks -- `public/assets/img/favicon.svg` - Used for favicon -- `public/assets/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons - -In case the source image is not in vector format, you can attempt to convert a raster image using tools like [this](https://www.aconvert.com/image/png-to-svg/). - -## Customizing Gitea pages and resources - -Gitea's executable contains all the resources required to run: templates, images, style-sheets -and translations. Any of them can be overridden by placing a replacement in a matching path -inside the `custom` directory. For example, to replace the default `.gitignore` provided -for C++ repositories, we want to replace `options/gitignore/C++`. To do this, a replacement -must be placed in `$GITEA_CUSTOM/options/gitignore/C++` (see about the location of the `CustomPath` -directory at the top of this document). - -Every single page of Gitea can be changed. Dynamic content is generated using [go templates](https://pkg.go.dev/html/template), -which can be modified by placing replacements below the `$GITEA_CUSTOM/templates` directory. - -To obtain any embedded file (including templates), the [`gitea embedded` tool](administration/cmd-embedded.md) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using). - -Be aware that any statement contained inside `{{` and `}}` are Gitea's template syntax and -shouldn't be touched without fully understanding these components. - -### Customizing startpage / homepage - -Copy [`home.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/home.tmpl) for your version of Gitea from `templates` to `$GITEA_CUSTOM/templates`. -Edit as you wish. -Dont forget to restart your Gitea to apply the changes. - -### Adding links and tabs - -If all you want is to add extra links to the top navigation bar or footer, or extra tabs to the repository view, you can put them in `extra_links.tmpl` (links added to the navbar), `extra_links_footer.tmpl` (links added to the left side of footer), and `extra_tabs.tmpl` inside your `$GITEA_CUSTOM/templates/custom/` directory. - -For instance, let's say you are in Germany and must add the famously legally-required "Impressum"/about page, listing who is responsible for the site's content: -just place it under your "$GITEA_CUSTOM/public/assets/" directory (for instance `$GITEA_CUSTOM/public/assets/impressum.html`) and put a link to it in either `$GITEA_CUSTOM/templates/custom/extra_links.tmpl` or `$GITEA_CUSTOM/templates/custom/extra_links_footer.tmpl`. - -To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL: -`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>` - -For more information, see [Adding Legal Pages](administration/adding-legal-pages.md). - -You can add new tabs in the same way, putting them in `extra_tabs.tmpl`. -The exact HTML needed to match the style of other tabs is in the file -`templates/repo/header.tmpl` -([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl)) - -### Other additions to the page - -Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful templates you can put in your `$GITEA_CUSTOM/templates/custom/` directory: - -- `header.tmpl`, just before the end of the `<head>` tag where you can add custom CSS files for instance. -- `body_outer_pre.tmpl`, right after the start of `<body>`. -- `body_inner_pre.tmpl`, before the top navigation bar, but already inside the main container `<div class="full height">`. -- `body_inner_post.tmpl`, before the end of the main container. -- `body_outer_post.tmpl`, before the bottom `<footer>` element. -- `footer.tmpl`, right before the end of the `<body>` tag, a good place for additional JavaScript. - -### Using Gitea variables - -It's possible to use various Gitea variables in your custom templates. - -First, _temporarily_ enable development mode: in your `app.ini` change from `RUN_MODE = prod` to `RUN_MODE = dev`. Then add `{{ $ | DumpVar }}` to any of your templates, restart Gitea and refresh that page; that will dump all available variables. - -Find the data that you need, and use the corresponding variable; for example, if you need the name of the repository then you'd use `{{.Repository.Name}}`. - -If you need to transform that data somehow, and aren't familiar with Go, an easy workaround is to add the data to the DOM and add a small JavaScript script block to manipulate the data. - -### Example: PlantUML - -You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server. -The data is encoded and sent to the PlantUML server which generates the picture. There is an online -demo server at http://www.plantuml.com/plantuml, but if you (or your users) have sensitive data you -can set up your own [PlantUML server](https://plantuml.com/server) instead. To set up PlantUML rendering, -copy JavaScript files from https://gitea.com/davidsvantesson/plantuml-code-highlight and put them in your -`$GITEA_CUSTOM/public/assets/` folder. Then add the following to `custom/footer.tmpl`: - -```html -<script> - $(async () => { - if (!$('.language-plantuml').length) return; - await Promise.all([ - $.getScript('https://your-gitea-server.com/assets/deflate.js'), - $.getScript('https://your-gitea-server.com/assets/encode.js'), - $.getScript('https://your-gitea-server.com/assets/plantuml_codeblock_parse.js'), - ]); - // Replace call with address to your plantuml server - parsePlantumlCodeBlocks("https://www.plantuml.com/plantuml"); - }); -</script> -``` - -You can then add blocks like the following to your markdown: - -```plantuml -Alice -> Bob: Authentication Request -Bob --> Alice: Authentication Response - -Alice -> Bob: Another authentication Request -Alice <-- Bob: Another authentication Response -``` - -The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`. - -### Example: STL Preview - -You can display STL file directly in Gitea by adding: - -```html -<script> - function lS(src) { - return new Promise(function (resolve, reject) { - let s = document.createElement("script"); - s.src = src; - s.addEventListener("load", () => { - resolve(); - }); - document.body.appendChild(s); - }); - } - - if ($('.view-raw>a[href$=".stl" i]').length) { - $("body").append( - '<link href="/assets/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">' - ); - Promise.all([ - lS("/assets/Madeleine.js/src/lib/stats.js"), - lS("/assets/Madeleine.js/src/lib/detector.js"), - lS("/assets/Madeleine.js/src/lib/three.min.js"), - lS("/assets/Madeleine.js/src/Madeleine.js"), - ]).then(function () { - $(".view-raw") - .attr("id", "view-raw") - .attr("style", "padding: 0;margin-bottom: -10px;"); - new Madeleine({ - target: "view-raw", - data: $('.view-raw>a[href$=".stl" i]').attr("href"), - path: "/assets/Madeleine.js/src", - }); - $('.view-raw>a[href$=".stl"]').remove(); - }); - } -</script> -``` - -to the file `templates/custom/footer.tmpl` - -You also need to download the content of the library [Madeleine.js](https://github.com/beige90/Madeleine.js) and place it under `$GITEA_CUSTOM/public/assets/` folder. - -You should end-up with a folder structure similar to: - -``` -$GITEA_CUSTOM/templates --- custom - `-- footer.tmpl - -$GITEA_CUSTOM/public/assets/ --- Madeleine.js - |-- LICENSE - |-- README.md - |-- css - | |-- pygment_trac.css - | `-- stylesheet.css - |-- examples - | |-- ajax.html - | |-- index.html - | `-- upload.html - |-- images - | |-- bg_hr.png - | |-- blacktocat.png - | |-- icon_download.png - | `-- sprite_download.png - |-- models - | |-- dino2.stl - | |-- ducati.stl - | |-- gallardo.stl - | |-- lamp.stl - | |-- octocat.stl - | |-- skull.stl - | `-- treefrog.stl - `-- src - |-- Madeleine.js - |-- css - | `-- Madeleine.css - |-- icons - | |-- logo.png - | |-- madeleine.eot - | |-- madeleine.svg - | |-- madeleine.ttf - | `-- madeleine.woff - `-- lib - |-- MadeleineConverter.js - |-- MadeleineLoader.js - |-- detector.js - |-- stats.js - `-- three.min.js -``` - -Then restart Gitea and open a STL file on your Gitea instance. - -## Customizing Gitea mails - -The `$GITEA_CUSTOM/templates/mail` folder allows changing the body of every mail of Gitea. -Templates to override can be found in the -[`templates/mail`](https://github.com/go-gitea/gitea/tree/main/templates/mail) -directory of Gitea source. -Override by making a copy of the file under `$GITEA_CUSTOM/templates/mail` using a -full path structure matching source. - -Any statement contained inside `{{` and `}}` are Gitea's template -syntax and shouldn't be touched without fully understanding these components. - -## Adding Analytics to Gitea - -Google Analytics, Matomo (previously Piwik), and other analytics services can be added to Gitea. To add the tracking code, refer to the `Other additions to the page` section of this document, and add the JavaScript to the `$GITEA_CUSTOM/templates/custom/header.tmpl` file. - -## Customizing gitignores, labels, licenses, locales, and readmes. - -Place custom files in corresponding sub-folder under `custom/options`. - -**NOTE:** The files should not have a file extension, e.g. `Labels` rather than `Labels.txt` - -### gitignores - -To add custom .gitignore, add a file with existing [.gitignore rules](https://git-scm.com/docs/gitignore) in it to `$GITEA_CUSTOM/options/gitignore` - -## Customizing the git configuration - -Starting with Gitea 1.20, you can customize the git configuration via the `git.config` section. - -### Enabling signed git pushes - -To enable signed git pushes, set these two options: - -```ini -[git.config] -receive.advertisePushOptions = true -receive.certNonceSeed = <randomstring> -``` - -`certNonceSeed` should be set to a random string and be kept secret. - -### Labels - -Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) to `$GITEA_CUSTOM/options/label`: - -```yaml -labels: - - name: "foo/bar" # name of the label that will appear in the dropdown - exclusive: true # whether to use the exclusive namespace for scoped labels. scoped delimiter is / - color: aabbcc # hex colour coding - description: Some label # long description of label intent - ``` - -The [legacy file format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) can still be used following the format below, however we strongly recommend using the newer YAML format instead. - -`#hex-color label name ; label description` - -For more information, see the [labels documentation](usage/labels.md). - -### Licenses - -To add a custom license, add a file with the license text to `$GITEA_CUSTOM/options/license` - -### Locales - -Locales are managed via our [Crowdin](https://crowdin.com/project/gitea). -You can override a locale by placing an altered locale file in `$GITEA_CUSTOM/options/locale`. -Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/main/options/locale) source folder and these should be used as examples for your changes. - -To add a completely new locale, as well as placing the file in the above location, you will need to add the new lang and name to the `[i18n]` section in your `app.ini`. Keep in mind that Gitea will use those settings as **overrides**, so if you want to keep the other languages as well you will need to copy/paste the default values and add your own to them. - -``` -[i18n] -LANGS = en-US,foo-BAR -NAMES = English,FooBar -``` - -The first locale will be used as the default if user browser's language doesn't match any locale in the list. - -Locales may change between versions, so keeping track of your customized locales is highly encouraged. - -### Readmes - -To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `$GITEA_CUSTOM/options/readme` - -**NOTE:** readme templates support **variable expansion**. -currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.SSH}`, `{CloneURL.HTTPS}` and `{OwnerName}` - -### Reactions - -To change reaction emoji's you can set allowed reactions at app.ini - -``` -[ui] -REACTIONS = +1, -1, laugh, confused, heart, hooray, eyes -``` - -A full list of supported emoji's is at [emoji list](https://gitea.com/gitea/gitea.com/issues/8) - -## Customizing the look of Gitea - -The built-in themes are `gitea-light`, `gitea-dark`, and `gitea-auto` (which automatically adapts to OS settings). - -The default theme can be changed via `DEFAULT_THEME` in the [ui](administration/config-cheat-sheet.md#ui-ui) section of `app.ini`. - -Gitea also has support for user themes, which means every user can select which theme should be used. -The list of themes a user can choose from can be configured with the `THEMES` value in the [ui](administration/config-cheat-sheet.md#ui-ui) section of `app.ini`. - -To make a custom theme available to all users: - -1. Add a CSS file to `$GITEA_CUSTOM/public/assets/css/theme-<theme-name>.css`. - The value of `$GITEA_CUSTOM` of your instance can be queried by calling `gitea help` and looking up the value of "CustomPath". -2. Add `<theme-name>` to the comma-separated list of setting `THEMES` in `app.ini` - -Community themes are listed in [gitea/awesome-gitea#themes](https://gitea.com/gitea/awesome-gitea#themes). - -The default theme sources can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/css/themes). - -If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`. -This allows Gitea to adjust the Monaco code editor's theme accordingly. - -## Customizing fonts - -Fonts can be customized using CSS variables: - -```css -:root { - --fonts-proportional: /* custom proportional fonts */ !important; - --fonts-monospace: /* custom monospace fonts */ !important; - --fonts-emoji: /* custom emoji fonts */ !important; -} -``` diff --git a/docs/content/administration/customizing-gitea.zh-cn.md b/docs/content/administration/customizing-gitea.zh-cn.md deleted file mode 100644 index f41533c69c..0000000000 --- a/docs/content/administration/customizing-gitea.zh-cn.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -date: "2017-04-15T14:56:00+02:00" -title: "自定义 Gitea 配置" -slug: "customizing-gitea" -sidebar_position: 100 -toc: false -draft: false -aliases: - - /zh-cn/customizing-gitea -menu: - sidebar: - parent: "administration" - name: "自定义 Gitea 配置" - sidebar_position: 100 - identifier: "customizing-gitea" ---- - -# 自定义 Gitea 配置 - -Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板等默认配置。 - -如果从二进制部署 Gitea ,则所有默认路径都将相对于该 gitea 二进制文件;如果从发行版安装,则可能会将这些路径修改为Linux文件系统标准。Gitea -将会自动创建包括 `custom/` 在内的必要应用目录,应用本身的配置存放在 -`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步: - -- [快速备忘单](administration/config-cheat-sheet.md) -- [完整配置清单](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - -如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM` -环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。 - -- [环境变量清单](administration/environment-variables.md) - -**注:** 必须完全重启 Gitea 以使配置生效。 - -## 使用自定义 /robots.txt - -将 [想要展示的内容](http://www.robotstxt.org/) 存放在 `custom` 目录中的 -`robots.txt` 文件来让 Gitea 使用自定义的`/robots.txt` (默认:空 404)。 - -## 使用自定义的公共文件 - -将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。 - -举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。 - -## 修改默认头像 - -替换以下目录中的 png 图片: `custom/public/assets/img/avatar\_default.png` - -## 自定义 Gitea 页面 - -您可以改变 Gitea `custom/templates` 的每个单页面。您可以在 Gitea 源码的 `templates` 目录中找到用于覆盖的模板文件,应用将根据 -`custom/templates` 目录下的路径结构进行匹配和覆盖。 - -包含在 `{{` 和 `}}` 中的任何语句都是 Gitea 的模板语法,如果您不完全理解这些组件,不建议您对它们进行修改。 - -### 添加链接和页签 - -如果您只是想添加额外的链接到顶部导航栏或额外的选项卡到存储库视图,您可以将它们放在您 `custom/templates/custom/` 目录下的 `extra_links.tmpl` 和 `extra_tabs.tmpl` 文件中。 - -举例说明:假设您需要在网站放置一个静态的“关于”页面,您只需将该页面放在您的 -"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。 - -这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL: -`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>` - -同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与 -`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配 -([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl)) - -### 页面的其他新增内容 - -除了 `extra_links.tmpl` 和 `extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目录中存放一些其他有用的模板,例如: - -- `header.tmpl`,在 `<head>` 标记结束之前的模板,例如添加自定义CSS文件 -- `body_outer_pre.tmpl`,在 `<body>` 标记开始处的模板 -- `body_inner_pre.tmpl`,在顶部导航栏之前,但在主 container 内部的模板,例如添加一个 `<div class="full height">` -- `body_inner_post.tmpl`,在主 container 结束处的模板 -- `body_outer_post.tmpl`,在底部 `<footer>` 元素之前. -- `footer.tmpl`,在 `<body>` 标签结束处的模板,可以在这里填写一些附加的 Javascript 脚本。 - -## 自定义 gitignores,labels, licenses, locales 以及 readmes - -将自定义文件放在 `custom/options` 下相应子的文件夹中即可 - -## 更改 Gitea 外观 - -内置主题是“gitea-light”、“gitea-dark”和“gitea-auto”(自动适应操作系统设置)。 - -默认主题可以通过 `app.ini` 的 [ui](administration/config-cheat-sheet.md#ui-ui) 部分中的 `DEFAULT_THEME` 进行更改。 diff --git a/docs/content/administration/email-setup.en-us.md b/docs/content/administration/email-setup.en-us.md deleted file mode 100644 index f9621e6075..0000000000 --- a/docs/content/administration/email-setup.en-us.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -date: "2019-10-15T10:10:00+05:00" -title: "Email setup" -slug: "email-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /en-us/email-setup -menu: - sidebar: - parent: "administration" - name: "Email setup" - sidebar_position: 12 - identifier: "email-setup" ---- - -# Email setup - -Gitea has mailer functionality for sending transactional emails (such as registration confirmation). It can be configured to either use Sendmail (or compatible MTAs like Postfix and msmtp) or directly use SMTP server. - -## Using Sendmail - -Use `sendmail` command as mailer. - -Note: For use in the official Gitea Docker image, please configure with the SMTP version (see the following section). - -Note: For Internet-facing sites consult documentation of your MTA for instructions to send emails over TLS. Also set up SPF, DMARC, and DKIM DNS records to make emails sent be accepted as legitimate by various email providers. - -```ini -[mailer] -ENABLED = true -FROM = gitea@mydomain.com -PROTOCOL = sendmail -SENDMAIL_PATH = /usr/sbin/sendmail -SENDMAIL_ARGS = "--" ; most "sendmail" programs take options, "--" will prevent an email address being interpreted as an option. -``` - -## Using SMTP - -Directly use SMTP server as relay. This option is useful if you don't want to set up MTA on your instance but you have an account at email provider. - -```ini -[mailer] -ENABLED = true -FROM = gitea@mydomain.com -PROTOCOL = smtps -SMTP_ADDR = mail.mydomain.com -SMTP_PORT = 587 -USER = gitea@mydomain.com -PASSWD = `password` -``` - -Restart Gitea for the configuration changes to take effect. - -To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration. - -For the full list of options check the [Config Cheat Sheet](administration/config-cheat-sheet.md) - -Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through: - -- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it. -- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning. -- Forced SMTPS connection with `PROTOCOL=smtps`. (These are both known as Implicit TLS.) -This is due to protections imposed by the Go internal libraries against STRIPTLS attacks. - -Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018. - -### Gmail - -The following configuration should work with GMail's SMTP server: - -```ini -[mailer] -ENABLED = true -HOST = smtp.gmail.com:465 ; Remove this line for Gitea >= 1.18.0 -SMTP_ADDR = smtp.gmail.com -SMTP_PORT = 465 -FROM = example.user@gmail.com -USER = example.user -PASSWD = `***` -PROTOCOL = smtps -``` - -Note that you'll need to create and use an [App password](https://support.google.com/accounts/answer/185833?hl=en) by enabling 2FA on your Google -account. You won't be able to use your Google account password directly. diff --git a/docs/content/administration/email-setup.zh-cn.md b/docs/content/administration/email-setup.zh-cn.md deleted file mode 100644 index 2e670be85b..0000000000 --- a/docs/content/administration/email-setup.zh-cn.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "Email 设置" -slug: "email-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /zh-cn/email-setup -menu: - sidebar: - parent: "administration" - name: "Email 设置" - sidebar_position: 12 - identifier: "email-setup" ---- - -# Email 设置 - -Gitea 具有邮件功能,用于发送事务性邮件(例如注册确认邮件)。它可以配置为使用 Sendmail(或兼容的 MTA,例如 Postfix 和 msmtp)或直接使用 SMTP 服务器。 - -## 使用 Sendmail - -使用 `sendmail` 命令作为邮件传输代理(mailer)。 - -注意:对于在官方Gitea Docker镜像中使用,请使用SMTP版本进行配置(请参考下一节)。 - -注意:对于面向互联网的网站,请查阅您的 MTA 文档以了解通过TLS发送邮件的说明。同时设置 SPF、DMARC 和 DKIM DNS 记录,以使发送的邮件被各个电子邮件提供商接受为合法邮件。 - -```ini -[mailer] -ENABLED = true -FROM = gitea@mydomain.com -PROTOCOL = sendmail -SENDMAIL_PATH = /usr/sbin/sendmail -SENDMAIL_ARGS = "--" ; 大多数 "sendmail" 程序都接受选项,使用 "--" 将防止电子邮件地址被解释为选项。 -``` - -## 使用 SMTP - -直接使用 SMTP 服务器作为中继。如果您不想在实例上设置 MTA,但在电子邮件提供商那里有一个帐户,这个选项非常有用。 - -```ini -[mailer] -ENABLED = true -FROM = gitea@mydomain.com -PROTOCOL = smtps -SMTP_ADDR = mail.mydomain.com -SMTP_PORT = 587 -USER = gitea@mydomain.com -PASSWD = `password` -``` - -重启 Gitea 以使配置更改生效。 - -要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。 - -有关所有选项的完整列表,请查看[配置速查表](administration/config-cheat-sheet.md)。 - -请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行: - -- 通过端口 587 的 STARTTLS(也称为 Opportunistic TLS)。初始连接是明文的,但如果服务器支持,则可以升级为 TLS。 -- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。 -- 使用 `PROTOCOL=smtps` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS) -这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。 - -请注意,自2018年起,[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。 - -### Gmail - -以下配置应该适用于 Gmail 的 SMTP 服务器: - -```ini -[mailer] -ENABLED = true -HOST = smtp.gmail.com:465 ; 对于 Gitea >= 1.18.0,删除此行 -SMTP_ADDR = smtp.gmail.com -SMTP_PORT = 465 -FROM = example.user@gmail.com -USER = example.user -PASSWD = `***` -PROTOCOL = smtps -``` - -请注意,您需要创建并使用一个 [应用密码](https://support.google.com/accounts/answer/185833?hl=en) 并在您的 Google 帐户上启用 2FA。您将无法直接使用您的 Google 帐户密码。 diff --git a/docs/content/administration/environment-variables.en-us.md b/docs/content/administration/environment-variables.en-us.md deleted file mode 100644 index 2c6fcbe681..0000000000 --- a/docs/content/administration/environment-variables.en-us.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -date: "2017-04-08T11:34:00+02:00" -title: "Environment variables" -slug: "environment-variables" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /en-us/environment-variables -menu: - sidebar: - parent: "administration" - name: "Environment variables" - sidebar_position: 10 - identifier: "environment-variables" ---- - -# Environment variables - -This is an inventory of Gitea environment variables. They change Gitea behaviour. - -Initialize them before Gitea command to be effective, for example: - -```sh -GITEA_CUSTOM=/home/gitea/custom ./gitea web -``` - -## From Go language - -As Gitea is written in Go, it uses some variables that influence the behaviour of Go's runtime, such as: - -- `GOMEMLIMIT` -- `GOGC` -- `GOMAXPROCS` -- `GODEBUG` - -For documentation about each of the variables available, refer to the -[official Go documentation on runtime environment variables](https://pkg.go.dev/runtime#hdr-Environment_Variables). - -## Gitea files - -- `GITEA_WORK_DIR`: Absolute path of working directory. -- `GITEA_CUSTOM`: Gitea uses `WorkPath`/custom folder by default. Use this variable to change _custom_ directory. - -## Operating system specifics - -- `USER`: System user that Gitea will run as. Used for some repository access strings. -- `USERNAME`: if no `USER` found, Gitea will use `USERNAME` -- `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows. - -### Only on Windows - -- `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH` -- `HOMEDRIVE`: Main drive path used to access the home directory (C:) -- `HOMEPATH`: Home relative path in the given home drive path - -## Miscellaneous - -- `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows. diff --git a/docs/content/administration/environment-variables.zh-cn.md b/docs/content/administration/environment-variables.zh-cn.md deleted file mode 100644 index d5be9e03c2..0000000000 --- a/docs/content/administration/environment-variables.zh-cn.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -date: "2017-04-08T11:34:00+02:00" -title: "环境变量清单" -slug: "environment-variables" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /zh-cn/environment-variables -menu: - sidebar: - parent: "administration" - name: "环境变量清单" - sidebar_position: 10 - identifier: "environment-variables" ---- - -# 环境变量清单 - -这里是用来控制 Gitea 行为表现的的环境变量清单,您需要在执行如下 Gitea 启动命令前设置它们来确保配置生效: - -``` -GITEA_CUSTOM=/home/gitea/custom ./gitea web -``` - -## Go 的配置 - -因为 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置参数: - -* `GOOS` -* `GOARCH` -* [`GOPATH`](https://go.dev/cmd/go/#hdr-GOPATH_environment_variable) - -您可以在[官方文档](https://go.dev/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。 - -## Gitea 的文件目录 - -* `GITEA_WORK_DIR`:工作目录的绝对路径 -* `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目录 `GITEA_WORK_DIR`/custom,您可以使用这个参数来配置 *custom* 目录 -* `GOGS_WORK_DIR`: 已废弃,请使用 `GITEA_WORK_DIR` 替代 -* `GOGS_CUSTOM`: 已废弃,请使用 `GITEA_CUSTOM` 替代 - -## 操作系统配置 - -* `USER`:Gitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分 -* `USERNAME`: 如果没有配置 `USER`, Gitea 将使用 `USERNAME` -* `HOME`: 用户的 home 目录,在 Windows 中会使用 `USERPROFILE` 环境变量 - -### 仅限于 Windows 的配置 - -* `USERPROFILE`: 用户的主目录,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH` -* `HOMEDRIVE`: 用于访问 home 目录的主驱动器路径(C盘) -* `HOMEPATH`:在指定主驱动器下的 home 目录相对路径 - -## Miscellaneous - -* `SKIP_MINWINSVC`:如果设置为 1,在 Windows 上不会以 service 的形式运行。 diff --git a/docs/content/administration/external-renderers.en-us.md b/docs/content/administration/external-renderers.en-us.md deleted file mode 100644 index 1e41b80145..0000000000 --- a/docs/content/administration/external-renderers.en-us.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -date: "2018-11-23:00:00+02:00" -title: "External renderers" -slug: "external-renderers" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /en-us/external-renderers -menu: - sidebar: - parent: "administration" - name: "External renderers" - sidebar_position: 60 - identifier: "external-renderers" ---- - -# Custom files rendering configuration - -Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries, -it is just a matter of: - -- installing external binaries -- add some configuration to your `app.ini` file -- restart your Gitea instance - -This supports rendering of whole files. If you want to render code blocks in markdown you would need to do something with javascript. See some examples on the [Customizing Gitea](administration/customizing-gitea.md) page. - -## Installing external binaries - -In order to get file rendering through external binaries, their associated packages must be installed. -If you're using a Docker image, your `Dockerfile` should contain something along this lines: - -```docker -FROM gitea/gitea:@version@ -[...] - -COPY custom/app.ini /data/gitea/conf/app.ini -[...] - -RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev py-pip python3-dev py3-pip py3-pyzmq -# install any other package you need for your external renderers - -RUN pip3 install --upgrade pip -RUN pip3 install -U setuptools -RUN pip3 install jupyter docutils -# add above any other python package you may need to install -``` - -## `app.ini` file configuration - -add one `[markup.XXXXX]` section per external renderer on your custom `app.ini`: - -```ini -[markup.asciidoc] -ENABLED = true -FILE_EXTENSIONS = .adoc,.asciidoc -RENDER_COMMAND = "asciidoctor -s -a showtitle --out-file=- -" -; Input is not a standard input but a file -IS_INPUT_FILE = false - -[markup.jupyter] -ENABLED = true -FILE_EXTENSIONS = .ipynb -RENDER_COMMAND = "jupyter nbconvert --stdin --stdout --to html --template basic" -IS_INPUT_FILE = false - -[markup.restructuredtext] -ENABLED = true -FILE_EXTENSIONS = .rst -RENDER_COMMAND = "timeout 30s pandoc +RTS -M512M -RTS -f rst" -IS_INPUT_FILE = false -``` - -If your external markup relies on additional classes and attributes on the generated HTML elements, you might need to enable custom sanitizer policies. Gitea uses the [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) package as our HTML sanitizer. The example below could be used to support server-side [KaTeX](https://katex.org/) rendering output from [`pandoc`](https://pandoc.org/). - -```ini -[markup.sanitizer.TeX] -; Pandoc renders TeX segments as <span>s with the "math" class, optionally -; with "inline" or "display" classes depending on context. -; - note this is different from the built-in math support in our markdown parser which uses <code> -ELEMENT = span -ALLOW_ATTR = class -REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+ - -[markup.markdown] -ENABLED = true -FILE_EXTENSIONS = .md,.markdown -RENDER_COMMAND = pandoc -f markdown -t html --katex -``` - -You must define `ELEMENT` and `ALLOW_ATTR` in each section. - -To define multiple entries, add a unique alphanumeric suffix (e.g., `[markup.sanitizer.1]` and `[markup.sanitizer.something]`). - -To apply a sanitisation rules only for a specify external renderer they must use the renderer name, e.g. `[markup.sanitizer.asciidoc.rule-1]`, `[markup.sanitizer.<renderer>.rule-1]`. - -**Note**: If the rule is defined above the renderer ini section or the name does not match a renderer it is applied to every renderer. - -Once your configuration changes have been made, restart Gitea to have changes take effect. - -**Note**: Prior to Gitea 1.12 there was a single `markup.sanitiser` section with keys that were redefined for multiple rules, however, -there were significant problems with this method of configuration necessitating configuration through multiple sections. - -### Example: HTML - -Render HTML files directly: - -```ini -[markup.html] -ENABLED = true -FILE_EXTENSIONS = .html,.htm -RENDER_COMMAND = cat -; Input is not a standard input but a file -IS_INPUT_FILE = true - -[markup.sanitizer.html.1] -ELEMENT = div -ALLOW_ATTR = class - -[markup.sanitizer.html.2] -ELEMENT = a -ALLOW_ATTR = class -``` - -### Example: Office DOCX - -Display Office DOCX files with [`pandoc`](https://pandoc.org/): - -```ini -[markup.docx] -ENABLED = true -FILE_EXTENSIONS = .docx -RENDER_COMMAND = "pandoc --from docx --to html --self-contained --template /path/to/basic.html" - -[markup.sanitizer.docx.img] -ALLOW_DATA_URI_IMAGES = true -``` - -The template file has the following content: - -``` -$body$ -``` - -### Example: Jupyter Notebook - -Display Jupyter Notebook files with [`nbconvert`](https://github.com/jupyter/nbconvert): - -```ini -[markup.jupyter] -ENABLED = true -FILE_EXTENSIONS = .ipynb -RENDER_COMMAND = "jupyter-nbconvert --stdin --stdout --to html --template basic" - -[markup.sanitizer.jupyter.img] -ALLOW_DATA_URI_IMAGES = true -``` - -## Customizing CSS - -The external renderer is specified in the .ini in the format `[markup.XXXXX]` and the HTML supplied by your external renderer will be wrapped in a `<div>` with classes `markup` and `XXXXX`. The `markup` class provides out of the box styling (as does `markdown` if `XXXXX` is `markdown`). Otherwise you can use these classes to specifically target the contents of your rendered HTML. - -And so you could write some CSS: - -```css -.markup.XXXXX html { - font-size: 100%; - overflow-y: scroll; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -.markup.XXXXX body { - color: #444; - font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif; - font-size: 12px; - line-height: 1.7; - padding: 1em; - margin: auto; - max-width: 42em; - background: #fefefe; -} - -.markup.XXXXX p { - color: orangered; -} -``` - -Add your stylesheet to your custom directory e.g `custom/public/assets/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`: - -```html -<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" /> -``` diff --git a/docs/content/administration/external-renderers.zh-cn.md b/docs/content/administration/external-renderers.zh-cn.md deleted file mode 100644 index fdf7315d7b..0000000000 --- a/docs/content/administration/external-renderers.zh-cn.md +++ /dev/null @@ -1,203 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "外部渲染器" -slug: "external-renderers" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /zh-cn/external-renderers -menu: - sidebar: - parent: "administration" - name: "外部渲染器" - sidebar_position: 60 - identifier: "external-renderers" ---- - -# 自定义文件渲染配置 - -Gitea 通过外部二进制文件支持自定义文件渲染(例如 Jupyter notebooks、asciidoc 等),只需要进行以下步骤: - -- 安装外部二进制文件 -- 在您的 `app.ini` 文件中添加一些配置 -- 重新启动 Gitea 实例 - -此功能支持整个文件的渲染。如果您想要在 Markdown 中渲染代码块,您需要使用 JavaScript 进行一些操作。请参阅 [自定义 Gitea 配置](administration/customizing-gitea.md) 页面上的一些示例。 - -## 安装外部二进制文件 - -为了通过外部二进制文件进行文件渲染,必须安装它们的关联软件包。 -如果您正在使用 Docker 镜像,则您的 `Dockerfile` 应该包含以下内容: - -```docker -FROM gitea/gitea:@version@ -[...] - -COPY custom/app.ini /data/gitea/conf/app.ini -[...] - -RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev py-pip python3-dev py3-pip py3-pyzmq -# 安装其他您需要的外部渲染器的软件包 - -RUN pip3 install --upgrade pip -RUN pip3 install -U setuptools -RUN pip3 install jupyter docutils -# 在上面添加您需要安装的任何其他 Python 软件包 -``` - -## `app.ini` 文件配置 - -在您的自定义 `app.ini` 文件中为每个外部渲染器添加一个 `[markup.XXXXX]` 部分: - -```ini -[markup.asciidoc] -ENABLED = true -FILE_EXTENSIONS = .adoc,.asciidoc -RENDER_COMMAND = "asciidoctor -s -a showtitle --out-file=- -" -; 输入不是标准输入而是文件 -IS_INPUT_FILE = false - -[markup.jupyter] -ENABLED = true -FILE_EXTENSIONS = .ipynb -RENDER_COMMAND = "jupyter nbconvert --stdin --stdout --to html --template basic" -IS_INPUT_FILE = false - -[markup.restructuredtext] -ENABLED = true -FILE_EXTENSIONS = .rst -RENDER_COMMAND = "timeout 30s pandoc +RTS -M512M -RTS -f rst" -IS_INPUT_FILE = false -``` - -如果您的外部标记语言依赖于在生成的 HTML 元素上的额外类和属性,您可能需要启用自定义的清理策略。Gitea 使用 [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) 包作为我们的 HTML 清理器。下面的示例可以用于支持从 [`pandoc`](https://pandoc.org/) 输出的服务器端 [KaTeX](https://katex.org/) 渲染结果。 - -```ini -[markup.sanitizer.TeX] -; Pandoc 渲染 TeX 段落为带有 "math" 类的 <span> 元素,根据上下文可能还带有 "inline" 或 "display" 类。 -; - 请注意,这与我们的 Markdown 解析器中内置的数学支持不同,后者使用 <code> 元素。 -ELEMENT = span -ALLOW_ATTR = class -REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+ - -[markup.markdown] -ENABLED = true -FILE_EXTENSIONS = .md,.markdown -RENDER_COMMAND = pandoc -f markdown -t html --katex -``` - -您必须在每个部分中定义 `ELEMENT` 和 `ALLOW_ATTR`。 - -要定义多个条目,请添加唯一的字母数字后缀(例如,`[markup.sanitizer.1]` 和 `[markup.sanitizer.something]`)。 - -要仅为特定的外部渲染器应用清理规则,它们必须使用渲染器名称,例如 `[markup.sanitizer.asciidoc.rule-1]`、`[markup.sanitizer.<renderer>.rule-1]`。 - -**注意**:如果规则在渲染器 ini 部分之前定义,或者名称与渲染器不匹配,它将应用于所有渲染器。 - -完成配置更改后,请重新启动 Gitea 以使更改生效。 - -**注意**:在 Gitea 1.12 之前,存在一个名为 `markup.sanitiser` 的单个部分,其中的键被重新定义为多个规则,但是,这种配置方法存在重大问题,需要通过多个部分进行配置。 - -### 示例:HTML - -直接渲染 HTML 文件: - -```ini -[markup.html] -ENABLED = true -FILE_EXTENSIONS = .html,.htm -RENDER_COMMAND = cat -; 输入不是标准输入,而是文件 -IS_INPUT_FILE = true - -[markup.sanitizer.html.1] -ELEMENT = div -ALLOW_ATTR = class - -[markup.sanitizer.html.2] -ELEMENT = a -ALLOW_ATTR = class -``` - -请注意:此示例中的配置将允许渲染 HTML 文件,并使用 `cat` 命令将文件内容输出为 HTML。此外,配置中的两个清理规则将允许 `<div>` 和 `<a>` 元素使用 `class` 属性。 - -在进行配置更改后,请重新启动 Gitea 以使更改生效。 - -### 示例:Office DOCX - -使用 [`pandoc`](https://pandoc.org/) 显示 Office DOCX 文件: - -```ini -[markup.docx] -ENABLED = true -FILE_EXTENSIONS = .docx -RENDER_COMMAND = "pandoc --from docx --to html --self-contained --template /path/to/basic.html" - -[markup.sanitizer.docx.img] -ALLOW_DATA_URI_IMAGES = true -``` - -在此示例中,配置将允许显示 Office DOCX 文件,并使用 `pandoc` 命令将文件转换为 HTML 格式。同时,清理规则中的 `ALLOW_DATA_URI_IMAGES` 设置为 `true`,允许使用 Data URI 格式的图片。 - -模板文件的内容如下: - -``` -$body$ -``` - -### 示例:Jupyter Notebook - -使用 [`nbconvert`](https://github.com/jupyter/nbconvert) 显示 Jupyter Notebook 文件: - -```ini -[markup.jupyter] -ENABLED = true -FILE_EXTENSIONS = .ipynb -RENDER_COMMAND = "jupyter-nbconvert --stdin --stdout --to html --template basic" - -[markup.sanitizer.jupyter.img] -ALLOW_DATA_URI_IMAGES = true -``` - -在此示例中,配置将允许显示 Jupyter Notebook 文件,并使用 `nbconvert` 命令将文件转换为 HTML 格式。同样,清理规则中的 `ALLOW_DATA_URI_IMAGES` 设置为 `true`,允许使用 Data URI 格式的图片。 - -在进行配置更改后,请重新启动 Gitea 以使更改生效。 - -## 自定义 CSS - -在 `.ini` 文件中,可以使用 `[markup.XXXXX]` 的格式指定外部渲染器,并且由外部渲染器生成的 HTML 将被包装在一个带有 `markup` 和 `XXXXX` 类的 `<div>` 中。`markup` 类提供了预定义的样式(如果 `XXXXX` 是 `markdown`,则使用 `markdown` 类)。否则,您可以使用这些类来针对渲染的 HTML 内容进行定制样式。 - -因此,您可以编写一些 CSS 样式: - -```css -.markup.XXXXX html { - font-size: 100%; - overflow-y: scroll; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -.markup.XXXXX body { - color: #444; - font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif; - font-size: 12px; - line-height: 1.7; - padding: 1em; - margin: auto; - max-width: 42em; - background: #fefefe; -} - -.markup.XXXXX p { - color: orangered; -} -``` - -将您的样式表添加到自定义目录中,例如 `custom/public/assets/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入: - -```html -<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" /> -``` - -通过以上步骤,您可以将自定义的 CSS 样式应用到特定的外部渲染器,使其具有所需的样式效果。 diff --git a/docs/content/administration/fail2ban-setup.en-us.md b/docs/content/administration/fail2ban-setup.en-us.md deleted file mode 100644 index c90f88c886..0000000000 --- a/docs/content/administration/fail2ban-setup.en-us.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -date: "2018-05-11T11:00:00+02:00" -title: "Fail2ban Setup " -slug: "fail2ban-setup" -sidebar_position: 16 -toc: false -draft: false -aliases: - - /en-us/fail2ban-setup -menu: - sidebar: - parent: "administration" - name: "Fail2ban setup" - sidebar_position: 16 - identifier: "fail2ban-setup" ---- - -# Fail2ban setup to block users after failed login attempts - -**Remember that fail2ban is powerful and can cause lots of issues if you do it incorrectly, so make -sure to test this before relying on it so you don't lock yourself out.** - -Gitea returns an HTTP 200 for bad logins in the web logs, but if you have logging options on in -`app.ini`, then you should be able to go off of `log/gitea.log`, which gives you something like this -on a bad authentication from the web or CLI using SSH or HTTP respectively: - -```log -2018/04/26 18:15:54 [I] Failed authentication attempt for user from xxx.xxx.xxx.xxx -``` - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:143:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.) - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:155:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.) - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:198:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.) - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:213:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.) - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:227:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.) - -```log -2020/10/15 16:05:09 modules/ssh/ssh.go:249:sshConnectionFailed() [W] Failed authentication attempt from xxx.xxx.xxx.xxx -``` - -(From 1.15 this new message will available and doesn't have any of the false positive results that above messages from publicKeyHandler do. This will only be logged if the user has completely failed authentication.) - -```log -2020/10/15 16:08:44 ...s/context/context.go:204:HandleText() [E] invalid credentials from xxx.xxx.xxx.xxx -``` - -Add our filter in `/etc/fail2ban/filter.d/gitea.conf`: - -```ini -# gitea.conf -[Definition] -failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST> -ignoreregex = -``` - -Add our jail in `/etc/fail2ban/jail.d/gitea.conf`: - -```ini -[gitea] -enabled = true -filter = gitea -logpath = /var/lib/gitea/log/gitea.log -maxretry = 10 -findtime = 3600 -bantime = 900 -action = iptables-allports -``` - -If you're using Docker, you'll also need to add an additional jail to handle the **FORWARD** -chain in **iptables**. Configure it in `/etc/fail2ban/jail.d/gitea-docker.conf`: - -```ini -[gitea-docker] -enabled = true -filter = gitea -logpath = /var/lib/gitea/log/gitea.log -maxretry = 10 -findtime = 3600 -bantime = 900 -action = iptables-allports[chain="FORWARD"] -``` - -Then simply run `service fail2ban restart` to apply your changes. You can check to see if -fail2ban has accepted your configuration using `service fail2ban status`. - -Make sure and read up on fail2ban and configure it to your needs, this bans someone -for **15 minutes** (from all ports) when they fail authentication 10 times in an hour. - -If you run Gitea behind a reverse proxy with Nginx (for example with Docker), you need to add -this to your Nginx configuration so that IPs don't show up as 127.0.0.1: - -``` -proxy_set_header X-Real-IP $remote_addr; -``` - -The security options in `app.ini` need to be adjusted to allow the interpretation of the headers -as well as the list of IP addresses and networks that describe trusted proxy servers -(See the [configuration cheat sheet](administration/config-cheat-sheet.md#security-security) for more information). - -``` -REVERSE_PROXY_LIMIT = 1 -REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.1/8 ; 172.17.0.0/16 for the docker default network -``` diff --git a/docs/content/administration/fail2ban-setup.zh-cn.md b/docs/content/administration/fail2ban-setup.zh-cn.md deleted file mode 100644 index 457afba959..0000000000 --- a/docs/content/administration/fail2ban-setup.zh-cn.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -date: "2022-08-01T00:00:00+00:00" -title: "设置 Fail2ban" -slug: "fail2ban-setup" -sidebar_position: 16 -toc: false -draft: false -aliases: - - /zh-cn/fail2ban-setup -menu: - sidebar: - parent: "administration" - name: "设置 Fail2ban" - sidebar_position: 16 - identifier: "fail2ban-setup" ---- - -# 使用 Fail2ban 阻止攻击者的暴力登录 - -**Fail2ban 检查客户端登录日志,将多次登录失败的客户端识别为攻击者并在一段时间内阻止其访问服务。如果你的实例是公开的,这一点尤其重要。请管理员仔细设置 fail2ban,错误的配置将导致防火墙阻止你访问自己的服务器。** - -Gitea 会在日志文件 `log/gitea.log` 中记录登录失败的 CLI、SSH 或 HTTP 客户端 IP 地址,而你需要将 Gitea 的日志输出模式从默认的 `console` 更改为 `file`。这表示将日志输出到文件,使得 fail2ban 可以定期扫描日志内容。 - -当用户的身份验证失败时,日志中会记录此类信息: - -```log -2018/04/26 18:15:54 [I] Failed authentication attempt for user from xxx.xxx.xxx.xxx -``` - -```log -2020/10/15 16:08:44 [E] invalid credentials from xxx.xxx.xxx.xxx -``` - -## 设置 Fail2ban - -添加日志过滤器规则到配置文件 `/etc/fail2ban/filter.d/gitea.conf`: - -```ini -[Definition] -failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST> -ignoreregex = -``` - -添加监狱规则到配置文件 `/etc/fail2ban/jail.d/gitea.conf`: - -```ini -[gitea] -enabled = true -filter = gitea -logpath = /var/lib/gitea/log/gitea.log -maxretry = 10 -findtime = 3600 -bantime = 900 -action = iptables-allports -``` - -如果你的 Gitea 实例运行在 Docker 容器中,并且直接将容器端口暴露到外部网络, -你还需要添加 `chain="FORWARD"` 到监狱规则配置文件 `/etc/fail2ban/jail.d/gitea-docker.conf` -以适应 Docker 的网络转发规则。但如果你在容器的宿主机上使用 Nginx 反向代理连接到 Gitea 则无需这样配置。 - -```ini -[gitea-docker] -enabled = true -filter = gitea -logpath = /var/lib/gitea/log/gitea.log -maxretry = 10 -findtime = 3600 -bantime = 900 -action = iptables-allports[chain="FORWARD"] -``` - -最后,运行 `systemctl restart fail2ban` 即可应用更改。现在,你可以使用 `systemctl status fail2ban` 检查 fail2ban 运行状态。 - -上述规则规定客户端在 1 小时内,如果登录失败的次数达到 10 次,则通过 iptables 锁定该客户端 IP 地址 15 分钟。 - -## 设置反向代理 - -如果你使用 Nginx 反向代理到 Gitea 实例,你还需要设置 Nginx 的 HTTP 头部值 `X-Real-IP` 将真实的客户端 IP 地址传递给 Gitea。否则 Gitea 程序会将客户端地址错误解析为反向代理服务器的地址,例如回环地址 `127.0.0.1`。 - -``` -proxy_set_header X-Real-IP $remote_addr; -``` - -额外注意,在 Gitea 的配置文件 `app.ini` 中存在下列默认值: - -``` -REVERSE_PROXY_LIMIT = 1 -REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128 -``` - -`REVERSE_PROXY_LIMIT` 限制反向代理服务器的层数,设置为 `0` 表示不使用这些标头。 -`REVERSE_PROXY_TRUSTED_PROXIES` 表示受信任的反向代理服务器网络地址, -经过该网络地址转发来的流量会经过解析 `X-Real-IP` 头部得到真实客户端地址。 -(参考 [configuration cheat sheet](administration/config-cheat-sheet.md#security-security)) diff --git a/docs/content/administration/git-lfs-support.en-us.md b/docs/content/administration/git-lfs-support.en-us.md deleted file mode 100644 index d2c55a29fb..0000000000 --- a/docs/content/administration/git-lfs-support.en-us.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -date: "2019-10-06T08:00:00+05:00" -title: "Git LFS setup" -slug: "git-lfs-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /en-us/git-lfs-setup -menu: - sidebar: - parent: "administration" - name: "Git LFS setup" - sidebar_position: 12 - identifier: "git-lfs-setup" ---- - -# Git Large File Storage setup - -To use Gitea's built-in LFS support, you must update the `app.ini` file: - -```ini -[server] -; Enables git-lfs support. true or false, default is false. -LFS_START_SERVER = true - -[lfs] -; Where your lfs files reside, default is data/lfs. -PATH = /home/gitea/data/lfs -``` - -**Note**: LFS server support needs at least Git v2.1.2 installed on the server diff --git a/docs/content/administration/git-lfs-support.zh-cn.md b/docs/content/administration/git-lfs-support.zh-cn.md deleted file mode 100644 index 268f40f3f0..0000000000 --- a/docs/content/administration/git-lfs-support.zh-cn.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "Git LFS 设置" -slug: "git-lfs-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /zh-cn/git-lfs-setup -menu: - sidebar: - parent: "administration" - name: "Git LFS 设置" - sidebar_position: 12 - identifier: "git-lfs-setup" ---- - -# 配置 Git 大文件存储(Large File Storage,LFS) - -要使用 Gitea 内置的 LFS 支持,您需要更新 `app.ini` 文件: - -```ini -[server] -; 启用 git-lfs 支持。true 或 false,默认为 false。 -LFS_START_SERVER = true - -[lfs] -; 存放 LFS 文件的路径,默认为 data/lfs。 -PATH = /home/gitea/data/lfs -``` - -**注意**:LFS 服务器支持需要服务器上安装 Git v2.1.2 以上版本。 diff --git a/docs/content/administration/https-support.en-us.md b/docs/content/administration/https-support.en-us.md deleted file mode 100644 index 4e18722ddf..0000000000 --- a/docs/content/administration/https-support.en-us.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -date: "2018-06-02T11:00:00+02:00" -title: "HTTPS setup" -slug: "https-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /en-us/https-setup -menu: - sidebar: - parent: "administration" - name: "HTTPS setup" - sidebar_position: 12 - identifier: "https-setup" ---- - -# HTTPS setup to encrypt connections to Gitea - -## Using the built-in server - -Before you enable HTTPS, make sure that you have valid SSL/TLS certificates. -You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate. - -If you are using Apache or nginx on the server, it's recommended to check the [reverse proxy guide](administration/reverse-proxies.md). - -To use Gitea's built-in HTTPS support, you must change your `app.ini` file: - -```ini -[server] -PROTOCOL = https -ROOT_URL = https://git.example.com:3000/ -HTTP_PORT = 3000 -CERT_FILE = cert.pem -KEY_FILE = key.pem -``` - -Note that if your certificate is signed by a third party certificate authority (i.e. not self-signed), then cert.pem should contain the certificate chain. The server certificate must be the first entry in cert.pem, followed by the intermediaries in order (if any). The root certificate does not have to be included because the connecting client must already have it in order to estalbish the trust relationship. -To learn more about the config values, please checkout the [Config Cheat Sheet](administration/config-cheat-sheet.md#server-server). - -For the `CERT_FILE` or `KEY_FILE` field, the file path is relative to the `GITEA_CUSTOM` environment variable when it is a relative path. It can be an absolute path as well. - -### Setting up HTTP redirection - -The Gitea server is only able to listen to one port; to redirect HTTP requests to the HTTPS port, you will need to enable the HTTP redirection service: - -```ini -[server] -REDIRECT_OTHER_PORT = true -; Port the redirection service should listen on -PORT_TO_REDIRECT = 3080 -``` - -If you are using Docker, make sure that this port is configured in your `docker-compose.yml` file. - -## Using ACME (Default: Let's Encrypt) - -[ACME](https://tools.ietf.org/html/rfc8555) is a Certificate Authority standard protocol that allows you to automatically request and renew SSL/TLS certificates. [Let's Encrypt](https://letsencrypt.org/) is a free publicly trusted Certificate Authority server using this standard. Only `HTTP-01` and `TLS-ALPN-01` challenges are implemented. In order for ACME challenges to pass and verify your domain ownership, external traffic to the gitea domain on port `80` (`HTTP-01`) or port `443` (`TLS-ALPN-01`) has to be served by the gitea instance. Setting up [HTTP redirection](#setting-up-http-redirection) and port-forwards might be needed for external traffic to route correctly. Normal traffic to port `80` will otherwise be automatically redirected to HTTPS. **You must consent** to the ACME provider's terms of service (default Let's Encrypt's [terms of service](https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf)). - -Minimum setup using the default Let's Encrypt: - -```ini -[server] -PROTOCOL=https -DOMAIN=git.example.com -ENABLE_ACME=true -ACME_ACCEPTTOS=true -ACME_DIRECTORY=https -;; Email can be omitted here and provided manually at first run, after which it is cached -ACME_EMAIL=email@example.com -``` - -Minimum setup using a [smallstep CA](https://github.com/smallstep/certificates), refer to [their tutorial](https://smallstep.com/docs/tutorials/acme-challenge) for more information. - -```ini -[server] -PROTOCOL=https -DOMAIN=git.example.com -ENABLE_ACME=true -ACME_ACCEPTTOS=true -ACME_URL=https://ca.example.com/acme/acme/directory -;; Can be omitted if using the system's trust is preferred -;ACME_CA_ROOT=/path/to/root_ca.crt -ACME_DIRECTORY=https -ACME_EMAIL=email@example.com -``` - -To learn more about the config values, please checkout the [Config Cheat Sheet](administration/config-cheat-sheet.md#server-server). - -## Using a reverse proxy - -Setup up your reverse proxy as shown in the [reverse proxy guide](administration/reverse-proxies.md). - -After that, enable HTTPS by following one of these guides: - -- [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html) -- [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) -- [caddy](https://caddyserver.com/docs/tls) - -Note: Enabling HTTPS only at the proxy level is referred as [TLS Termination Proxy](https://en.wikipedia.org/wiki/TLS_termination_proxy). The proxy server accepts incoming TLS connections, decrypts the contents, and passes the now unencrypted contents to Gitea. This is normally fine as long as both the proxy and Gitea instances are either on the same machine, or on different machines within private network (with the proxy is exposed to outside network). If your Gitea instance is separated from your proxy over a public network, or if you want full end-to-end encryption, you can also [enable HTTPS support directly in Gitea using built-in server](#using-the-built-in-server) and forward the connections over HTTPS instead. diff --git a/docs/content/administration/https-support.zh-cn.md b/docs/content/administration/https-support.zh-cn.md deleted file mode 100644 index 8beb06e80f..0000000000 --- a/docs/content/administration/https-support.zh-cn.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -date: "2023-04-09T11:00:00+02:00" -title: "HTTPS配置" -slug: "https-setup" -sidebar_position: 12 -toc: false -draft: false -menu: - sidebar: - parent: "administration" - name: "HTTPS setup" - sidebar_position: 12 - identifier: "https-setup" ---- - -# HTTPS setup to encrypt connections to Gitea - -## 使用内置服务器 - -在启用HTTPS之前,确保您拥有有效的SSL/TLS证书。 -建议在测试和评估情况下使用自签名证书,请运行 `gitea cert --host [HOST]` 以生成自签名证书 - -如果您在服务器上使用阿帕奇(Apache)或Nginx,建议参考 [反向代理指南](administration/reverse-proxies.md)。 - -要使用Gitea内置HTTPS支持,您必须编辑`app.ini`文件。 - -```ini -[server] -PROTOCOL = https -ROOT_URL = https://git.example.com:3000/ -HTTP_PORT = 3000 -CERT_FILE = cert.pem -KEY_FILE = key.pem -``` - -请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](administration/config-cheat-sheet#server-server)。 - -对于“CERT_FILE”或“KEY_FILE”字段,当文件路径是相对路径时,文件路径相对于“GITEA_CUSTOM”环境变量。它也可以是绝对路径。 - -### 设置HTTP重定向 - -Gitea服务器仅支持监听一个端口;要重定向HTTP请求致HTTPS端口,您需要启用HTTP重定向服务: - -```ini -[server] -REDIRECT_OTHER_PORT = true -; Port the redirection service should listen on -PORT_TO_REDIRECT = 3080 -``` - -如果您使用Docker,确保端口已配置在 `docker-compose.yml` 文件 - -## 使用 ACME (默认: Let's Encrypt) - -[ACME](https://tools.ietf.org/html/rfc8555) 是一种证书颁发机构标准协议,允许您自动请求和续订 SSL/TLS 证书。[Let`s Encrypt](https://letsencrypt.org/) 是使用此标准的免费公开信任的证书颁发机构服务器。仅实施“HTTP-01”和“TLS-ALPN-01”挑战。为了使 ACME 质询通过并验证您的域所有权,“80”端口(“HTTP-01”)或“443”端口(“TLS-ALPN-01”)上 gitea 域的外部流量必须由 gitea 实例提供服务。可能需要设置 [HTTP 重定向](#设置http重定向) 和端口转发才能正确路由外部流量。否则,到端口“80”的正常流量将自动重定向到 HTTPS。**您必须同意**ACME提供商的服务条款(默认为Let's Encrypt的 [服务条款](https://letsencrypt.org/documents/LE-SA-v1.2-2017年11月15日.pdf)。 - -使用默认 Let's Encrypt 的最小配置如下: - -```ini -[server] -PROTOCOL=https -DOMAIN=git.example.com -ENABLE_ACME=true -ACME_ACCEPTTOS=true -ACME_DIRECTORY=https -;; Email can be omitted here and provided manually at first run, after which it is cached -ACME_EMAIL=email@example.com -``` - -小型配置请使用 [smallstep CA](https://github.com/smallstep/certificates), 点击 [教程](https://smallstep.com/docs/tutorials/acme-challenge) 了解更多信息。 - -```ini -[server] -PROTOCOL=https -DOMAIN=git.example.com -ENABLE_ACME=true -ACME_ACCEPTTOS=true -ACME_URL=https://ca.example.com/acme/acme/directory -;; Can be omitted if using the system's trust is preferred -;ACME_CA_ROOT=/path/to/root_ca.crt -ACME_DIRECTORY=https -ACME_EMAIL=email@example.com -``` - -要了解关于配置, 请访问 [配置备忘单](administration/config-cheat-sheet.md#server-server)获取更多信息 - -## 使用反向代理服务器 - -按照 [reverse proxy guide](administration/reverse-proxies.md) 的规则设置你的反向代理服务器 - -然后,按照下面的向导启用 HTTPS: - -- [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html) -- [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) -- [caddy](https://caddyserver.com/docs/tls) - -注意:仅在代理层启用 HTTPS 被称为 [TLS 终止代理](https://en.wikipedia.org/wiki/TLS_termination_proxy)。代理服务器接受传入的 TLS 连接,解密内容,然后将现在未加密的内容传递给 Gitea。只要代理和 Gitea 实例在同一台计算机上或在私有网络中的不同计算机上(代理暴露给外部网络),这通常是可以接受的。如果您的 Gitea 实例与代理隔离在公共网络上,或者如果您想要全端到端的加密,您还可以直接在 Gitea 中 [启用内置服务器的 HTTPS 支持](#使用内置服务器),并将连接转发到 HTTPS 上。 diff --git a/docs/content/administration/logging-config.en-us.md b/docs/content/administration/logging-config.en-us.md deleted file mode 100644 index 33470ca448..0000000000 --- a/docs/content/administration/logging-config.en-us.md +++ /dev/null @@ -1,294 +0,0 @@ ---- -date: "2019-04-02T17:06:00+01:00" -title: "Logging Configuration" -slug: "logging-config" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /en-us/logging-configuration -menu: - sidebar: - parent: "administration" - name: "Logging Configuration" - sidebar_position: 40 - identifier: "logging-config" ---- - -# Logging Configuration - -The logging configuration of Gitea mainly consists of 3 types of components: - -- The `[log]` section for general configuration -- `[log.<mode-name>]` sections for the configuration of different log writers to output logs, aka: "writer mode", the mode name is also used as "writer name". -- The `[log]` section can also contain sub-logger configurations following the key schema `logger.<logger-name>.<CONFIG-KEY>` - -There is a fully functional log output by default, so it is not necessary to define one. - -## Collecting Logs for Help - -To collect logs for help and issue report, see [Support Options](help/support.md). - -## The `[log]` section - -Configuration of logging facilities in Gitea happen in the `[log]` section and its subsections. - -In the top level `[log]` section the following configurations can be placed: - -- `ROOT_PATH`: (Default: **%(GITEA_WORK_DIR)/log**): Base path for log files -- `MODE`: (Default: **console**) List of log outputs to use for the Default logger. -- `LEVEL`: (Default: **Info**) Least severe log events to persist, case-insensitive. Possible values are: `Trace`, `Debug`, `Info`, `Warn`, `Error`, `Fatal`. -- `STACKTRACE_LEVEL`: (Default: **None**) For this and more severe events the stacktrace will be printed upon getting logged. - -And it can contain the following sub-loggers: - -- `logger.router.MODE`: (Default: **,**): List of log outputs to use for the Router logger. -- `logger.access.MODE`: (Default: **_empty_**) List of log outputs to use for the Access logger. By default, the access logger is disabled. -- `logger.xorm.MODE`: (Default: **,**) List of log outputs to use for the XORM logger. - -Setting a comma (`,`) to sub-logger's mode means making it use the default global `MODE`. - -## Quick samples - -### Default (empty) Configuration - -The empty configuration is equivalent to default: - -```ini -[log] -ROOT_PATH = %(GITEA_WORK_DIR)/log -MODE = console -LEVEL = Info -STACKTRACE_LEVEL = None -logger.router.MODE = , -logger.xorm.MODE = , -logger.access.MODE = - -; this is the config options of "console" mode (used by MODE=console above) -[log.console] -MODE = console -FLAGS = stdflags -PREFIX = -COLORIZE = true -``` - -This is equivalent to sending all logs to the console, with default Golang log being sent to the console log too. - -This is only a sample, and it is the default, do not need to write it into your configuration file. - -### Disable Router logs and record some access logs to file - -The Router logger is disabled, the access logs (>=Warn) goes into `access.log`: - -```ini -[log] -logger.router.MODE = -logger.access.MODE = access-file - -[log.access-file] -MODE = file -LEVEL = Warn -FILE_NAME = access.log -``` - -### Set different log levels for different modes - -Default logs (>=Warn) goes into `gitea.log`, while Error logs goes into `file-error.log`: - -```ini -[log] -LEVEL = Warn -MODE = file, file-error - -; by default, the "file" mode will record logs to %(log.ROOT_PATH)/gitea.log, so we don't need to set it -; [log.file] -; by default, the MODE (actually it's the output writer of this logger) is taken from the section name, so we don't need to set it either -; MODE = file - -[log.file-error] -MODE = file -LEVEL = Error -FILE_NAME = file-error.log -``` - -## Log outputs (mode and writer) - -Gitea provides the following log output writers: - -- `console` - Log to `stdout` (or `stderr` if it is set in the config) -- `file` - Log to a file -- `conn` - Log to a socket (network or unix) - -### Common configuration - -Certain configuration is common to all modes of log output: - -- `MODE` is the mode of the log output writer. It will default to the mode name in the ini section. Thus `[log.console]` will default to `MODE = console`. -- `LEVEL` is the lowest level that this output will log. -- `STACKTRACE_LEVEL` is the lowest level that this output will print a stacktrace. -- `COLORIZE` will default to `true` for `console` as described, otherwise it will default to `false`. - -#### `EXPRESSION` - -`EXPRESSION` represents a regular expression that log events must match to be logged by the output writer. -Either the log message, (with colors removed), must match or the `longfilename:linenumber:functionname` must match. -NB: the whole message or string doesn't need to completely match. - -Please note this expression will be run in the writer's goroutine but not the logging event goroutine. - -#### `FLAGS` - -`FLAGS` represents the preceding logging context information that is -printed before each message. It is a comma-separated string set. The order of values does not matter. - -It defaults to `stdflags` (= `date,time,medfile,shortfuncname,levelinitial`) - -Possible values are: - -- `none` or `,` - No flags. -- `date` - the date in the local time zone: `2009/01/23`. -- `time` - the time in the local time zone: `01:23:23`. -- `microseconds` - microsecond resolution: `01:23:23.123123`. Assumes time. -- `longfile` - full file name and line number: `/a/b/c/d.go:23`. -- `shortfile` - final file name element and line number: `d.go:23`. -- `funcname` - function name of the caller: `runtime.Caller()`. -- `shortfuncname` - last part of the function name. Overrides `funcname`. -- `utc` - if date or time is set, use UTC rather than the local time zone. -- `levelinitial` - initial character of the provided level in brackets eg. `[I]` for info. -- `level` - level in brackets `[INFO]`. -- `gopid` - the Goroutine-PID of the context. -- `medfile` - last 20 characters of the filename - equivalent to `shortfile,longfile`. -- `stdflags` - equivalent to `date,time,medfile,shortfuncname,levelinitial`. - -### Console mode - -In this mode the logger will forward log messages to the stdout and -stderr streams attached to the Gitea process. - -For loggers in console mode, `COLORIZE` will default to `true` if not -on windows, or the Windows terminal can be set into ANSI mode or is a -cygwin or Msys pipe. - -Settings: - -- `STDERR`: **false**: Whether the logger should print to `stderr` instead of `stdout`. - -### File mode - -In this mode the logger will save log messages to a file. - -Settings: - -- `FILE_NAME`: The file to write the log events to, relative to `ROOT_PATH`, Default to `%(ROOT_PATH)/gitea.log`. Exception: access log will default to `%(ROOT_PATH)/access.log`. -- `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file. 28 represents 256Mb. For details see below. -- `LOG_ROTATE` **true**: Whether to rotate the log files. TODO: if false, will it delete instead on daily rotate, or do nothing?. -- `DAILY_ROTATE`: **true**: Whether to rotate logs daily. -- `MAX_DAYS`: **7**: Delete rotated log files after this number of days. -- `COMPRESS`: **true**: Whether to compress old log files by default with gzip. -- `COMPRESSION_LEVEL`: **-1**: Compression level. For details see below. - -`MAX_SIZE_SHIFT` defines the maximum size of a file by left shifting 1 the given number of times (`1 << x`). -The exact behavior at the time of v1.17.3 can be seen [here](https://github.com/go-gitea/gitea/blob/v1.17.3/modules/setting/log.go#L185). - -The useful values of `COMPRESSION_LEVEL` are from 1 to (and including) 9, where higher numbers mean better compression. -Beware that better compression might come with higher resource usage. -Must be preceded with a `-` sign. - -### Conn mode - -In this mode the logger will send log messages over a network socket. - -Settings: - -- `ADDR`: **:7020**: Sets the address to connect to. -- `PROTOCOL`: **tcp**: Set the protocol, either "tcp", "unix" or "udp". -- `RECONNECT`: **false**: Try to reconnect when connection is lost. -- `RECONNECT_ON_MSG`: **false**: Reconnect host for every single message. - -### The "Router" logger - -The Router logger logs the following message types when Gitea's route handlers work: - -- `started` messages will be logged at TRACE level -- `polling`/`completed` routers will be logged at INFO. Exception: "/assets" static resource requests are also logged at TRACE. -- `slow` routers will be logged at WARN -- `failed` routers will be logged at WARN - -### The "XORM" logger - -To make XORM outputs SQL logs, the `LOG_SQL` in `[database]` section should also be set to `true`. - -### The "Access" logger - -The Access logger is a new logger since Gitea 1.9. It provides a NCSA -Common Log compliant log format. It's highly configurable but caution -should be taken when changing its template. The main benefit of this -logger is that Gitea can now log accesses in a standard log format so -standard tools may be used. - -You can enable this logger using `logger.access.MODE = ...`. - -If desired the format of the Access logger can be changed by changing -the value of the `ACCESS_LOG_TEMPLATE`. - -Please note, the access logger will log at `INFO` level, setting the -`LEVEL` of this logger to `WARN` or above will result in no access logs. - -#### The ACCESS_LOG_TEMPLATE - -This value represents a go template. Its default value is - -```tmpl -{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"` -``` - -The template is passed following options: - -- `Ctx` is the `context.Context` -- `Identity` is the `SignedUserName` or `"-"` if the user is not logged in -- `Start` is the start time of the request -- `ResponseWriter` is the `http.ResponseWriter` - -Caution must be taken when changing this template as it runs outside of -the standard panic recovery trap. The template should also be as simple -as it runs for every request. - -## Releasing-and-Reopening, Pausing and Resuming logging - -If you are running on Unix you may wish to release-and-reopen logs in order to use `logrotate` or other tools. -It is possible force Gitea to release and reopen it's logging files and connections by sending `SIGUSR1` to the -running process, or running `gitea manager logging release-and-reopen`. - -Alternatively, you may wish to pause and resume logging - this can be accomplished through the use of the -`gitea manager logging pause` and `gitea manager logging resume` commands. Please note that whilst logging -is paused log events below INFO level will not be stored and only a limited number of events will be stored. -Logging may block, albeit temporarily, slowing Gitea considerably whilst paused - therefore it is -recommended that pausing only done for a very short period of time. - -## Adding and removing logging whilst Gitea is running - -It is possible to add and remove logging whilst Gitea is running using the `gitea manager logging add` and `remove` subcommands. -This functionality can only adjust running log systems and cannot be used to start the access or router loggers if they -were not already initialized. If you wish to start these systems you are advised to adjust the app.ini and (gracefully) restart -the Gitea service. - -The main intention of these commands is to easily add a temporary logger to investigate problems on running systems where a restart -may cause the issue to disappear. - -## Using `logrotate` instead of built-in log rotation - -Gitea includes built-in log rotation, which should be enough for most deployments. However, if you instead want to use the `logrotate` utility: - -- Disable built-in log rotation by setting `LOG_ROTATE` to `false` in your `app.ini`. -- Install `logrotate`. -- Configure `logrotate` to match your deployment requirements, see `man 8 logrotate` for configuration syntax details. - In the `postrotate/endscript` block send Gitea a `USR1` signal via `kill -USR1` or `kill -10` to the `gitea` process itself, - or run `gitea manager logging release-and-reopen` (with the appropriate environment). - Ensure that your configurations apply to all files emitted by Gitea loggers as described in the above sections. -- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations. -- If you are using docker and are running from outside the container you can use - `docker exec -u $OS_USER $CONTAINER_NAME sh -c 'gitea manager logging release-and-reopen'` - or `docker exec $CONTAINER_NAME sh -c '/bin/s6-svc -1 /etc/s6/gitea/'` or send `USR1` directly to the Gitea process itself. - -The next `logrotate` jobs will include your configurations, so no restart is needed. -You can also immediately reload `logrotate` with `logrotate /etc/logrotate.conf --force`. diff --git a/docs/content/administration/logging-config.zh-cn.md b/docs/content/administration/logging-config.zh-cn.md deleted file mode 100644 index 273a413592..0000000000 --- a/docs/content/administration/logging-config.zh-cn.md +++ /dev/null @@ -1,272 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "日志配置" -slug: "logging-config" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /zh-cn/logging-configuration -menu: - sidebar: - parent: "administration" - name: "日志配置" - sidebar_position: 40 - identifier: "logging-config" ---- - -# 日志配置 - -Gitea 的日志配置主要由以下三种类型的组件组成: - -- `[log]` 部分用于一般配置 -- `[log.<mode-name>]` 部分用于配置不同的日志输出方式,也称为 "writer mode",模式名称同时也作为 "writer name" -- `[log]` 部分还可以包含遵循 `logger.<logger-name>.<CONFIG-KEY>` 模式的子日志记录器的配置 - -默认情况下,已经有一个完全功能的日志输出,因此不需要重新定义。 - -## 收集日志以获取帮助 - -要收集日志以获取帮助和报告问题,请参阅 [需要帮助](help/support.md)。 - -## `[log]` 部分 - -在 Gitea 中,日志设施的配置在 `[log]` 部分及其子部分。 - -在顶层的 `[log]` 部分,可以放置以下配置项: - -- `ROOT_PATH`:(默认值:**%(GITEA_WORK_DIR)/log**):日志文件的基本路径。 -- `MODE`:(默认值:**console**):要用于默认日志记录器的日志输出列表。 -- `LEVEL`:(默认值:**Info**):要持久化的最严重的日志事件,不区分大小写。可能的值为:`Trace`、`Debug`、`Info`、`Warn`、`Error`、`Fatal`。 -- `STACKTRACE_LEVEL`:(默认值:**None**):对于此类及更严重的事件,将在记录时打印堆栈跟踪。 - -它还可以包含以下子日志记录器: - -- `logger.router.MODE`:(默认值:**,**):用于路由器日志记录器的日志输出列表。 -- `logger.access.MODE`:(默认值:**_empty_**):用于访问日志记录器的日志输出列表。默认情况下,访问日志记录器被禁用。 -- `logger.xorm.MODE`:(默认值:**,**):用于 XORM 日志记录器的日志输出列表。 - -将子日志记录器的模式设置为逗号(`,`)表示使用默认的全局 `MODE`。 - -## 快速示例 - -### 默认(空)配置 - -空配置等同于默认配置: - -```ini -[log] -ROOT_PATH = %(GITEA_WORK_DIR)/log -MODE = console -LEVEL = Info -STACKTRACE_LEVEL = None -logger.router.MODE = , -logger.xorm.MODE = , -logger.access.MODE = - -; 这是“控制台”模式的配置选项(由上面的 MODE=console 使用) -[log.console] -MODE = console -FLAGS = stdflags -PREFIX = -COLORIZE = true -``` - -这等同于将所有日志发送到控制台,并将默认的 Golang 日志也发送到控制台日志中。 - -这只是一个示例,默认情况下不需要将其写入配置文件中。 - -### 禁用路由日志并将一些访问日志记录到文件中 - -禁用路由日志,将访问日志(>=Warn)记录到 `access.log` 中: - -```ini -[log] -logger.router.MODE = -logger.access.MODE = access-file - -[log.access-file] -MODE = file -LEVEL = Warn -FILE_NAME = access.log -``` - -### 为不同的模式设置不同的日志级别 - -将默认日志(>=Warn)记录到 `gitea.log` 中,将错误日志记录到 `file-error.log` 中: - -```ini -[log] -LEVEL = Warn -MODE = file, file-error - -; 默认情况下,"file" 模式会将日志记录到 %(log.ROOT_PATH)/gitea.log,因此我们不需要设置它 -; [log.file] - -[log.file-error] -LEVEL = Error -FILE_NAME = file-error.log -``` - -## 日志输出(模式和写入器) - -Gitea 提供以下日志写入器: - -- `console` - 输出日志到 `stdout`(或 `stderr`,如果已在配置中设置) -- `file` - 输出日志到文件 -- `conn` - 输出日志到套接字(网络或 Unix 套接字) - -### 公共配置 - -某些配置适用于所有日志输出模式: - -- `MODE` 是日志输出写入器的模式。它将默认为 ini 部分的模式名称。因此,`[log.console]` 将默认为 `MODE = console`。 -- `LEVEL` 是此输出将记录的最低日志级别。 -- `STACKTRACE_LEVEL` 是此输出将打印堆栈跟踪的最低日志级别。 -- `COLORIZE` 对于 `console`,默认为 `true`,否则默认为 `false`。 - -#### `EXPRESSION` - -`EXPRESSION` 表示日志事件必须匹配才能被输出写入器记录的正则表达式。 -日志消息(去除颜色)或 `longfilename:linenumber:functionname` 必须匹配其中之一。 -注意:整个消息或字符串不需要完全匹配。 - -请注意,此表达式将在写入器的 goroutine 中运行,而不是在日志事件的 goroutine 中运行。 - -#### `FLAGS` - -`FLAGS` 表示在每条消息之前打印的前置日志上下文信息。 -它是一个逗号分隔的字符串集。值的顺序无关紧要。 - -默认值为 `stdflags`(= `date,time,medfile,shortfuncname,levelinitial`)。 - -可能的值为: - -- `none` 或 `,` - 无标志。 -- `date` - 当地时区的日期:`2009/01/23`。 -- `time` - 当地时区的时间:`01:23:23`。 -- `microseconds` - 微秒精度:`01:23:23.123123`。假定有时间。 -- `longfile` - 完整的文件名和行号:`/a/b/c/d.go:23`。 -- `shortfile` - 文件名的最后一个部分和行号:`d.go:23`。 -- `funcname` - 调用者的函数名:`runtime.Caller()`。 -- `shortfuncname` - 函数名的最后一部分。覆盖 `funcname`。 -- `utc` - 如果设置了日期或时间,则使用 UTC 而不是本地时区。 -- `levelinitial` - 提供的级别的初始字符,放在方括号内,例如 `[I]` 表示 info。 -- `level` - 在方括号内的级别,例如 `[INFO]`。 -- `gopid` - 上下文的 Goroutine-PID。 -- `medfile` - 文件名的最后 20 个字符 - 相当于 `shortfile,longfile`。 -- `stdflags` - 相当于 `date,time,medfile,shortfuncname,levelinitial`。 - -### Console 模式 - -在此模式下,日志记录器将将日志消息转发到 Gitea 进程附加的 stdout 和 stderr 流。 - -对于 console 模式的日志记录器,如果不在 Windows 上,或者 Windows 终端可以设置为 ANSI 模式,或者是 cygwin 或 Msys 管道,则 `COLORIZE` 默认为 `true`。 - -设置: - -- `STDERR`:**false**:日志记录器是否应将日志打印到 `stderr` 而不是 `stdout`。 - -### File 模式 - -在此模式下,日志记录器将将日志消息保存到文件中。 - -设置: - -- `FILE_NAME`:要将日志事件写入的文件,相对于 `ROOT_PATH`,默认为 `%(ROOT_PATH)/gitea.log`。异常情况:访问日志默认为 `%(ROOT_PATH)/access.log`。 -- `MAX_SIZE_SHIFT`:**28**:单个文件的最大大小位移。28 表示 256Mb。详细信息见下文。 -- `LOG_ROTATE` **true**:是否轮转日志文件。 -- `DAILY_ROTATE`:**true**:是否每天旋转日志。 -- `MAX_DAYS`:**7**:在此天数之后删除旋转的日志文件。 -- `COMPRESS`:**true**:默认情况下是否使用 gzip 压缩旧的日志文件。 -- `COMPRESSION_LEVEL`:**-1**:压缩级别。详细信息见下文。 - -`MAX_SIZE_SHIFT` 通过将给定次数左移 1 (`1 << x`) 来定义文件的最大大小。 -在 v1.17.3 版本时的确切行为可以在[这里](https://github.com/go-gitea/gitea/blob/v1.17.3/modules/setting/log.go#L185)中查看。 - -`COMPRESSION_LEVEL` 的有用值范围从 1 到(包括)9,其中较高的数字表示更好的压缩。 -请注意,更好的压缩可能会带来更高的资源使用。 -必须在前面加上 `-` 符号。 - -### Conn 模式 - -在此模式下,日志记录器将通过网络套接字发送日志消息。 - -设置: - -- `ADDR`:**:7020**:设置要连接的地址。 -- `PROTOCOL`:**tcp**:设置协议,可以是 "tcp"、"unix" 或 "udp"。 -- `RECONNECT`:**false**:在连接丢失时尝试重新连接。 -- `RECONNECT_ON_MSG`:**false**:为每条消息重新连接主机。 - -### "Router" 日志记录器 - -当 Gitea 的路由处理程序工作时,Router 日志记录器记录以下消息类型: - -- `started` 消息将以 TRACE 级别记录 -- `polling`/`completed` 路由将以 INFO 级别记录。异常情况:"/assets" 静态资源请求也会以 TRACE 级别记录。 -- `slow` 路由将以 WARN 级别记录 -- `failed` 路由将以 WARN 级别记录 - -### "XORM" 日志记录器 - -为了使 XORM 输出 SQL 日志,还应将 `[database]` 部分中的 `LOG_SQL` 设置为 `true`。 - -### "Access" 日志记录器 - -"Access" 日志记录器是自 Gitea 1.9 版本以来的新日志记录器。它提供了符合 NCSA Common Log 标准的日志格式。虽然它具有高度可配置性,但在更改其模板时应谨慎。此日志记录器的主要好处是,Gitea 现在可以使用标准日志格式记录访问日志,因此可以使用标准工具进行分析。 - -您可以通过使用 `logger.access.MODE = ...` 来启用此日志记录器。 - -如果需要,可以通过更改 `ACCESS_LOG_TEMPLATE` 的值来更改 "Access" 日志记录器的格式。 - -请注意,访问日志记录器将以 `INFO` 级别记录,将此日志记录器的 `LEVEL` 设置为 `WARN` 或更高级别将导致不记录访问日志。 - -#### ACCESS_LOG_TEMPLATE - -此值表示一个 Go 模板。其默认值为 - -```tmpl -{{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}"` -``` - -模板接收以下选项: - -- `Ctx` 是 `context.Context` -- `Identity` 是 `SignedUserName`,如果用户未登录,则为 "-" -- `Start` 是请求的开始时间 -- `ResponseWriter` 是 `http.ResponseWriter` - -更改此模板时必须小心,因为它在标准的 panic 恢复陷阱之外运行。此模板应该尽可能简单,因为它会为每个请求运行一次。 - -## 释放和重新打开、暂停和恢复日志记录 - -如果您在 Unix 上运行,您可能希望释放和重新打开日志以使用 `logrotate` 或其他工具。 -可以通过向运行中的进程发送 `SIGUSR1` 信号或运行 `gitea manager logging release-and-reopen` 命令来强制 Gitea 释放并重新打开其日志文件和连接。 - -或者,您可能希望暂停和恢复日志记录 - 可以通过使用 `gitea manager logging pause` 和 `gitea manager logging resume` 命令来实现。请注意,当日志记录暂停时,低于 INFO 级别的日志事件将不会存储,并且只会存储有限数量的事件。在暂停时,日志记录可能会阻塞,尽管是暂时性的,但会大大减慢 Gitea 的运行速度,因此建议仅暂停很短的时间。 - -### 在 Gitea 运行时添加和删除日志记录 - -可以使用 `gitea manager logging add` 和 `remove` 子命令在 Gitea 运行时添加和删除日志记录。 -此功能只能调整正在运行的日志系统,不能用于启动未初始化的访问或路由日志记录器。如果您希望启动这些系统,建议调整 app.ini 并(优雅地)重新启动 Gitea 服务。 - -这些命令的主要目的是在运行中的系统上轻松添加临时日志记录器,以便调查问题,因为重新启动可能会导致问题消失。 - -## 使用 `logrotate` 而不是内置的日志轮转 - -Gitea 包含内置的日志轮转功能,对于大多数部署来说应该已经足够了。但是,如果您想使用 `logrotate` 工具: - -- 在 `app.ini` 中将 `LOG_ROTATE` 设置为 `false`,禁用内置的日志轮转。 -- 安装 `logrotate`。 -- 根据部署要求配置 `logrotate`,有关配置语法细节,请参阅 `man 8 logrotate`。 - 在 `postrotate/endscript` 块中通过 `kill -USR1` 或 `kill -10` 向 `gitea` 进程本身发送 `USR1` 信号, - 或者运行 `gitea manager logging release-and-reopen`(使用适当的环境设置)。 - 确保配置适用于由 Gitea 日志记录器生成的所有文件,如上述部分所述。 -- 始终使用 `logrotate /etc/logrotate.conf --debug` 来测试您的配置。 -- 如果您正在使用 Docker 并从容器外部运行,您可以使用 - `docker exec -u $OS_USER $CONTAINER_NAME sh -c 'gitea manager logging release-and-reopen'` - 或 `docker exec $CONTAINER_NAME sh -c '/bin/s6-svc -1 /etc/s6/gitea/'`,或直接向 Gitea 进程本身发送 `USR1` 信号。 - -下一个 `logrotate` 作业将包括您的配置,因此不需要重新启动。 -您还可以立即使用 `logrotate /etc/logrotate.conf --force` 重新加载 `logrotate`。 diff --git a/docs/content/administration/mail-templates.en-us.md b/docs/content/administration/mail-templates.en-us.md deleted file mode 100644 index 8e4e416e8d..0000000000 --- a/docs/content/administration/mail-templates.en-us.md +++ /dev/null @@ -1,278 +0,0 @@ ---- -date: "2019-10-23T17:00:00-03:00" -title: "Mail templates" -slug: "mail-templates" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /en-us/mail-templates -menu: - sidebar: - parent: "administration" - name: "Mail templates" - sidebar_position: 45 - identifier: "mail-templates" ---- - -# Mail templates - -To craft the e-mail subject and contents for certain operations, Gitea can be customized by using templates. The templates -for these functions are located under the [`custom` directory](administration/customizing-gitea.md). -Gitea has an internal template that serves as default in case there's no custom alternative. - -Custom templates are loaded when Gitea starts. Changes made to them are not recognized until Gitea is restarted again. - -## Mail notifications supporting templates - -Currently, the following notification events make use of templates: - -| Action name | Usage | -| ----------- | ------------------------------------------------------------------------------------------------------------ | -| `new` | A new issue or pull request was created. | -| `comment` | A new comment was created in an existing issue or pull request. | -| `close` | An issue or pull request was closed. | -| `reopen` | An issue or pull request was reopened. | -| `review` | The head comment of a review in a pull request. | -| `approve` | The head comment of a approving review for a pull request. | -| `reject` | The head comment of a review requesting changes for a pull request. | -| `code` | A single comment on the code of a pull request. | -| `assigned` | User was assigned to an issue or pull request. | -| `default` | Any action not included in the above categories, or when the corresponding category template is not present. | - -The path for the template of a particular message type is: - -```sh -custom/templates/mail/{action type}/{action name}.tmpl -``` - -Where `{action type}` is one of `issue` or `pull` (for pull requests), and `{action name}` is one of the names listed above. - -For example, the specific template for a mail regarding a comment in a pull request is: - -```sh -custom/templates/mail/pull/comment.tmpl -``` - -However, creating templates for each and every action type/name combination is not required. -A fallback system is used to choose the appropriate template for an event. The _first existing_ -template on this list is used: - -- The specific template for the desired **action type** and **action name**. -- The template for action type `issue` and the desired **action name**. -- The template for the desired **action type**, action name `default`. -- The template for action type `issue`, action name `default`. - -The only mandatory template is action type `issue`, action name `default`, which is already embedded in Gitea -unless it's overridden by the user in the `custom` directory. - -## Template syntax - -Mail templates are UTF-8 encoded text files that need to follow one of the following formats: - -``` -Text and macros for the subject line ------------- -Text and macros for the mail body -``` - -or - -``` -Text and macros for the mail body -``` - -Specifying a _subject_ section is optional (and therefore also the dash line separator). When used, the separator between -_subject_ and _mail body_ templates requires at least three dashes; no other characters are allowed in the separator line. - -_Subject_ and _mail body_ are parsed by [Golang's template engine](https://go.dev/pkg/text/template/) and -are provided with a _metadata context_ assembled for each notification. The context contains the following elements: - -| Name | Type | Available | Usage | -| ------------------ | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `.FallbackSubject` | string | Always | A default subject line. See Below. | -| `.Subject` | string | Only in body | The _subject_, once resolved. | -| `.Body` | string | Always | The message of the issue, pull request or comment, parsed from Markdown into HTML and sanitized. Do not confuse with the _mail body_. | -| `.Link` | string | Always | The address of the originating issue, pull request or comment. | -| `.Issue` | models.Issue | Always | The issue (or pull request) originating the notification. To get data specific to a pull request (e.g. `HasMerged`), `.Issue.PullRequest` can be used, but care should be taken as this field will be `nil` if the issue is _not_ a pull request. | -| `.Comment` | models.Comment | If applicable | If the notification is from a comment added to an issue or pull request, this will contain the information about the comment. | -| `.IsPull` | bool | Always | `true` if the mail notification is associated with a pull request (i.e. `.Issue.PullRequest` is not `nil`). | -| `.Repo` | string | Always | Name of the repository, including owner name (e.g. `mike/stuff`) | -| `.User` | models.User | Always | Owner of the repository from which the event originated. To get the user name (e.g. `mike`),`.User.Name` can be used. | -| `.Doer` | models.User | Always | User that executed the action triggering the notification event. To get the user name (e.g. `rhonda`), `.Doer.Name` can be used. | -| `.IsMention` | bool | Always | `true` if this notification was only generated because the user was mentioned in the comment, while not being subscribed to the source. It will be `false` if the recipient was subscribed to the issue or repository. | -| `.SubjectPrefix` | string | Always | `Re: ` if the notification is about other than issue or pull request creation; otherwise an empty string. | -| `.ActionType` | string | Always | `"issue"` or `"pull"`. Will correspond to the actual _action type_ independently of which template was selected. | -| `.ActionName` | string | Always | It will be one of the action types described above (`new`, `comment`, etc.), and will correspond to the actual _action name_ independently of which template was selected. | -| `.ReviewComments` | []models.Comment | Always | List of code comments in a review. The comment text will be in `.RenderedContent` and the referenced code will be in `.Patch`. | - -All names are case sensitive. - -### The _subject_ part of the template - -The template engine used for the mail _subject_ is golang's [`text/template`](https://go.dev/pkg/text/template/). -Please refer to the linked documentation for details about its syntax. - -The _subject_ is built using the following steps: - -- A template is selected according to the type of notification and to what templates are present. -- The template is parsed and resolved (e.g. `{{.Issue.Index}}` is converted to the number of the issue - or pull request). -- All space-like characters (e.g. `TAB`, `LF`, etc.) are converted to normal spaces. -- All leading, trailing and redundant spaces are removed. -- The string is truncated to its first 256 runes (characters). - -If the end result is an empty string, **or** no subject template was available (i.e. the selected template -did not include a subject part), Gitea's **internal default** will be used. - -The internal default (fallback) subject is the equivalent of: - -```sh -{{.SubjectPrefix}}[{{.Repo}}] {{.Issue.Title}} (#{{.Issue.Index}}) -``` - -For example: `Re: [mike/stuff] New color palette (#38)` - -Gitea's default subject can also be found in the template _metadata_ as `.FallbackSubject` from any of -the two templates, even if a valid subject template is present. - -### The _mail body_ part of the template - -The template engine used for the _mail body_ is golang's [`html/template`](https://go.dev/pkg/html/template/). -Please refer to the linked documentation for details about its syntax. - -The _mail body_ is parsed after the mail subject, so there is an additional _metadata_ field which is -the actual rendered subject, after all considerations. - -The expected result is HTML (including structural elements like`<html>`, `<body>`, etc.). Styling -through `<style>` blocks, `class` and `style` attributes is possible. However, `html/template` -does some [automatic escaping](https://go.dev/pkg/html/template/#hdr-Contexts) that should be considered. - -Attachments (such as images or external style sheets) are not supported. However, other templates can -be referenced too, for example to provide the contents of a `<style>` element in a centralized fashion. -The external template must be placed under `custom/mail` and referenced relative to that directory. -For example, `custom/mail/styles/base.tmpl` can be included using `{{template styles/base}}`. - -The mail is sent with `Content-Type: multipart/alternative`, so the body is sent in both HTML -and text formats. The latter is obtained by stripping the HTML markup. - -## Troubleshooting - -How a mail is rendered is directly dependent on the capabilities of the mail application. Many mail -clients don't even support HTML, so they show the text version included in the generated mail. - -If the template fails to render, it will be noticed only at the moment the mail is sent. -A default subject is used if the subject template fails, and whatever was rendered successfully -from the _mail body_ is used, disregarding the rest. - -Please check [Gitea's logs](administration/logging-config.md) for error messages in case of trouble. - -## Example - -`custom/templates/mail/issue/default.tmpl`: - -```html -[{{.Repo}}] @{{.Doer.Name}} -{{if eq .ActionName "new"}} - created -{{else if eq .ActionName "comment"}} - commented on -{{else if eq .ActionName "close"}} - closed -{{else if eq .ActionName "reopen"}} - reopened -{{else}} - updated -{{end}} -{{if eq .ActionType "issue"}} - issue -{{else}} - pull request -{{end}} -#{{.Issue.Index}}: {{.Issue.Title}} ------------- -<!DOCTYPE html> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>{{.Subject}}</title> -</head> - -<body> - {{if .IsMention}} - <p> - You are receiving this because @{{.Doer.Name}} mentioned you. - </p> - {{end}} - <p> - <p> - <a href="{{AppUrl}}/{{.Doer.LowerName}}">@{{.Doer.Name}}</a> - {{if not (eq .Doer.FullName "")}} - ({{.Doer.FullName}}) - {{end}} - {{if eq .ActionName "new"}} - created - {{else if eq .ActionName "close"}} - closed - {{else if eq .ActionName "reopen"}} - reopened - {{else}} - updated - {{end}} - <a href="{{.Link}}">{{.Repo}}#{{.Issue.Index}}</a>. - </p> - {{if not (eq .Body "")}} - <h3>Message content</h3> - <hr> - {{.Body}} - {{end}} - </p> - <hr> - <p> - <a href="{{.Link}}">View it on Gitea</a>. - </p> -</body> -</html> -``` - -This template produces something along these lines: - -### Subject - -> [mike/stuff] @rhonda commented on pull request #38: New color palette - -### Mail body - -> [@rhonda](#) (Rhonda Myers) updated [mike/stuff#38](#). -> -> #### Message content -> -> \_********************************\_******************************** -> -> Mike, I think we should tone down the blues a little. -> \_********************************\_******************************** -> -> [View it on Gitea](#). - -## Advanced - -The template system contains several functions that can be used to further process and format -the messages. Here's a list of some of them: - -| Name | Parameters | Available | Usage | -| ---------------- | ----------- | --------- | ------------------------------------------------------------------- | -| `AppUrl` | - | Any | Gitea's URL | -| `AppName` | - | Any | Set from `app.ini`, usually "Gitea" | -| `AppDomain` | - | Any | Gitea's host name | -| `EllipsisString` | string, int | Any | Truncates a string to the specified length; adds ellipsis as needed | -| `SanitizeHTML` | string | Body only | Sanitizes text by removing any dangerous HTML tags from it | -| `SafeHTML` | string | Body only | Takes the input as HTML, can be used for outputing raw HTML content | - -These are _functions_, not metadata, so they have to be used: - -```html -Like this: {{SanitizeHTML "Escape<my>text"}} -Or this: {{"Escape<my>text" | SanitizeHTML}} -Or this: {{AppUrl}} -But not like this: {{.AppUrl}} -``` diff --git a/docs/content/administration/mail-templates.zh-cn.md b/docs/content/administration/mail-templates.zh-cn.md deleted file mode 100644 index 3c7c2a9397..0000000000 --- a/docs/content/administration/mail-templates.zh-cn.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "邮件模板" -slug: "mail-templates" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /zh-cn/mail-templates -menu: - sidebar: - parent: "administration" - name: "邮件模板" - sidebar_position: 45 - identifier: "mail-templates" ---- - -# 邮件模板 - -为了定制特定操作的电子邮件主题和内容,可以使用模板来自定义 Gitea。这些功能的模板位于 [`custom` 目录](administration/customizing-gitea.md) 下。 -如果没有自定义的替代方案,Gitea 将使用内部模板作为默认模板。 - -自定义模板在 Gitea 启动时加载。对它们的更改在 Gitea 重新启动之前不会被识别。 - -## 支持模板的邮件通知 - -目前,以下通知事件使用模板: - -| 操作名称 | 用途 | -| ----------- | ------------------------------------------------------------------------------------------------------------ | -| `new` | 创建了新的工单或合并请求。 | -| `comment` | 在现有工单或合并请求中创建了新的评论。 | -| `close` | 关闭了工单或合并请求。 | -| `reopen` | 重新打开了工单或合并请求。 | -| `review` | 在合并请求中进行审查的首要评论。 | -| `approve` | 对合并请求进行批准的首要评论。 | -| `reject` | 对合并请求提出更改请求的审查的首要评论。 | -| `code` | 关于合并请求的代码的单个评论。 | -| `assigned` | 用户被分配到工单或合并请求。 | -| `default` | 未包括在上述类别中的任何操作,或者当对应类别的模板不存在时使用的模板。 | - -特定消息类型的模板路径为: - -```sh -custom/templates/mail/{操作类型}/{操作名称}.tmpl -``` - -其中 `{操作类型}` 是 `issue` 或 `pull`(针对合并请求),`{操作名称}` 是上述列出的操作名称之一。 - -例如,有关合并请求中的评论的电子邮件的特定模板是: - -```sh -custom/templates/mail/pull/comment.tmpl -``` - -然而,并不需要为每个操作类型/名称组合创建模板。 -使用回退系统来选择适当的模板。在此列表中,将使用 _第一个存在的_ 模板: - -- 所需**操作类型**和**操作名称**的特定模板。 -- 操作类型为 `issue` 和所需**操作名称**的模板。 -- 所需**操作类型**和操作名称为 `default` 的模板。 -- 操作类型为` issue` 和操作名称为 `default` 的模板。 - -唯一必需的模板是操作类型为 `issue` 操作名称为 `default` 的模板,除非用户在 `custom` 目录中覆盖了它。 - -## 模板语法 - -邮件模板是 UTF-8 编码的文本文件,需要遵循以下格式之一: - -``` -用于主题行的文本和宏 ------------- -用于邮件正文的文本和宏 -``` - -或者 - -``` -用于邮件正文的文本和宏 -``` - -指定 _主题_ 部分是可选的(因此也是虚线分隔符)。在使用时,_主题_ 和 _邮件正文_ 模板之间的分隔符需要至少三个虚线;分隔符行中不允许使用其他字符。 - -_主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://go.dev/pkg/text/template/) 解析,并提供了为每个通知组装的 _元数据上下文_。上下文包含以下元素: - -| 名称 | 类型 | 可用性 | 用途 | -| -------------------- | ------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `.FallbackSubject` | string | 始终可用 | 默认主题行。参见下文。 | -| `.Subject` | string | 仅在正文中可用 | 解析后的 _主题_。 | -| `.Body` | string | 始终可用 | 工单、合并请求或评论的消息,从 Markdown 解析为 HTML 并进行了清理。请勿与 _邮件正文_ 混淆。 | -| `.Link` | string | 始终可用 | 源工单、合并请求或评论的地址。 | -| `.Issue` | models.Issue | 始终可用 | 产生通知的工单(或合并请求)。要获取特定于合并请求的数据(例如 `HasMerged`),可以使用 `.Issue.PullRequest`,但需要注意,如果工单 _不是_ 合并请求,则该字段将为 `nil`。 | -| `.Comment` | models.Comment | 如果适用 | 如果通知是针对添加到工单或合并请求的评论,则其中包含有关评论的信息。 | -| `.IsPull` | bool | 始终可用 | 如果邮件通知与合并请求关联(即 `.Issue.PullRequest` 不为 `nil` ),则为 `true`。 | -| `.Repo` | string | 始终可用 | 仓库的名称,包括所有者名称(例如 `mike/stuff`) | -| `.User` | models.User | 始终可用 | 事件来源仓库的所有者。要获取用户名(例如 `mike`),可以使用 `.User.Name`。 | -| `.Doer` | models.User | 始终可用 | 执行触发通知事件的操作的用户。要获取用户名(例如 `rhonda`),可以使用 `.Doer.Name`。 | -| `.IsMention` | bool | 始终可用 | 如果此通知仅是因为在评论中提到了用户而生成的,并且收件人未订阅源,则为 `true`。如果收件人已订阅工单或仓库,则为 `false`。 | -| `.SubjectPrefix` | string | 始终可用 | 如果通知是关于除工单或合并请求创建之外的其他内容,则为 `Re:`;否则为空字符串。 | -| `.ActionType` | string | 始终可用 | `"issue"` 或 `"pull"`。它将与实际的 _操作类型_ 对应,与选择的模板无关。 | -| `.ActionName` | string | 始终可用 | 它将是上述操作类型之一(`new` ,`comment` 等),并与选择的模板对应。 | -| `.ReviewComments` | []models.Comment | 始终可用 | 审查中的代码评论列表。评论文本将在 `.RenderedContent` 中,引用的代码将在 `.Patch` 中。 | - -所有名称区分大小写。 - -### 模板中的主题部分 - -用于邮件主题的模板引擎是 Golang 的 [`text/template`](https://go.dev/pkg/text/template/)。 -有关语法的详细信息,请参阅链接的文档。 - -主题构建的步骤如下: - -- 根据通知类型和可用的模板选择一个模板。 -- 解析并解析模板(例如,将 `{{.Issue.Index}}` 转换为工单或合并请求的编号)。 -- 将所有空格字符(例如 `TAB`,`LF` 等)转换为普通空格。 -- 删除所有前导、尾随和多余的空格。 -- 将字符串截断为前 256 个字母(字符)。 - -如果最终结果为空字符串,**或者**没有可用的主题模板(即所选模板不包含主题部分),将使用Gitea的**内部默认值**。 - -内部默认(回退)主题相当于: - -``` -{{.SubjectPrefix}}[{{.Repo}}] {{.Issue.Title}} (#{{.Issue.Index}}) -``` - -例如:`Re: [mike/stuff] New color palette (#38)` - -即使存在有效的主题模板,Gitea的默认主题也可以在模板的元数据中作为 `.FallbackSubject` 找到。 - -### 模板中的邮件正文部分 - -用于邮件正文的模板引擎是 Golang 的 [`html/template`](https://go.dev/pkg/html/template/)。 -有关语法的详细信息,请参阅链接的文档。 - -邮件正文在邮件主题之后进行解析,因此还有一个额外的 _元数据_ 字段,即在考虑所有情况之后实际呈现的主题。 - -期望的结果是 HTML(包括结构元素,如`<html>`,`<body>`等)。可以通过 `<style>` 块、`class` 和 `style` 属性进行样式设置。但是,`html/template` 会进行一些 [自动转义](https://go.dev/pkg/html/template/#hdr-Contexts),需要考虑这一点。 - -不支持附件(例如图像或外部样式表)。但是,也可以引用其他模板,例如以集中方式提供 `<style>` 元素的内容。外部模板必须放置在 `custom/mail` 下,并相对于该目录引用。例如,可以使用 `{{template styles/base}}` 包含 `custom/mail/styles/base.tmpl`。 - -邮件以 `Content-Type: multipart/alternative` 发送,因此正文以 HTML 和文本格式发送。通过剥离 HTML 标记来获取文本版本。 - -## 故障排除 - -邮件的呈现方式直接取决于邮件应用程序的功能。许多邮件客户端甚至不支持 HTML,因此显示生成邮件中包含的文本版本。 - -如果模板无法呈现,则只有在发送邮件时才会注意到。 -如果主题模板失败,将使用默认主题,如果从 _邮件正文_ 中成功呈现了任何内容,则将使用该内容,忽略其他内容。 - -如果遇到问题,请检查 [Gitea的日志](administration/logging-config.md) 以获取错误消息。 - -## 示例 - -`custom/templates/mail/issue/default.tmpl`: - -```html -[{{.Repo}}] @{{.Doer.Name}} -{{if eq .ActionName "new"}} - 创建了 -{{else if eq .ActionName "comment"}} - 评论了 -{{else if eq .ActionName "close"}} - 关闭了 -{{else if eq .ActionName "reopen"}} - 重新打开了 -{{else}} - 更新了 -{{end}} -{{if eq .ActionType "issue"}} - 工单 -{{else}} - 合并请求 -{{end}} -#{{.Issue.Index}}: {{.Issue.Title}} ------------- -<!DOCTYPE html> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>{{.Subject}}</title> -</head> - -<body> - {{if .IsMention}} - <p> - 您收到此邮件是因为 @{{.Doer.Name}} 提到了您。 - </p> - {{end}} - <p> - <p> - <a href="{{AppUrl}}/{{.Doer.LowerName}}">@{{.Doer.Name}}</a> - {{if not (eq .Doer.FullName "")}} - ({{.Doer.FullName}}) - {{end}} - {{if eq .ActionName "new"}} - 创建了 - {{else if eq .ActionName "close"}} - 关闭了 - {{else if eq .ActionName "reopen"}} - 重新打开了 - {{else}} - 更新了 - {{end}} - <a href="{{.Link}}">{{.Repo}}#{{.Issue.Index}}</a>。 - </p> - {{if not (eq .Body "")}} - <h3>消息内容:</h3> - <hr> - {{.Body}} - {{end}} - </p> - <hr> - <p> - <a href="{{.Link}}">在 Gitea 上查看</a>。 - </p> -</body> -</html> -``` - -该模板将生成以下内容: - -### 主题 - -> [mike/stuff] @rhonda 在合并请求 #38 上进行了评论:New color palette - -### 邮件正文 - -> [@rhonda](#)(Rhonda Myers)更新了 [mike/stuff#38](#)。 -> -> #### 消息内容 -> -> \_********************************\_******************************** -> -> Mike, I think we should tone down the blues a little. -> -> \_********************************\_******************************** -> -> [在 Gitea 上查看](#)。 - -## 高级用法 - -模板系统包含一些函数,可用于进一步处理和格式化消息。以下是其中一些函数的列表: - -| 函数名 | 参数 | 可用于 | 用法 | -|------------------| ----------- | ------------ | ------------------------------ | -| `AppUrl` | - | 任何地方 | Gitea 的 URL | -| `AppName` | - | 任何地方 | 从 `app.ini` 中设置,通常为 "Gitea" | -| `AppDomain` | - | 任何地方 | Gitea 的主机名 | -| `EllipsisString` | string, int | 任何地方 | 将字符串截断为指定长度;根据需要添加省略号 | -| `SanitizeHTML` | string | 仅正文部分 | 通过删除其中的危险 HTML 标签对文本进行清理 | -| `SafeHTML` | string | 仅正文部分 | 将输入作为 HTML 处理;可用于输出原始的 HTML 内容 | - -这些都是 _函数_,而不是元数据,因此必须按以下方式使用: - -```html -像这样使用: {{SanitizeHTML "Escape<my>text"}} -或者这样使用: {{"Escape<my>text" | SanitizeHTML}} -或者这样使用: {{AppUrl}} -但不要像这样使用: {{.AppUrl}} -``` diff --git a/docs/content/administration/repo-indexer.en-us.md b/docs/content/administration/repo-indexer.en-us.md deleted file mode 100644 index aa82222911..0000000000 --- a/docs/content/administration/repo-indexer.en-us.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -date: "2019-09-06T01:35:00-03:00" -title: "Repository indexer" -slug: "repo-indexer" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /en-us/repo-indexer -menu: - sidebar: - parent: "administration" - name: "Repository indexer" - sidebar_position: 45 - identifier: "repo-indexer" ---- - -# Repository indexer - -## Builtin repository code search without indexer - -Users could do repository-level code search without setting up a repository indexer. -The builtin code search is based on the `git grep` command, which is fast and efficient for small repositories. -Better code search support could be achieved by setting up the repository indexer. - -## Setting up the repository indexer - -Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](administration/config-cheat-sheet.md): - -```ini -[indexer] -; ... -REPO_INDEXER_ENABLED = true -REPO_INDEXER_PATH = indexers/repos.bleve -MAX_FILE_SIZE = 1048576 -REPO_INDEXER_INCLUDE = -REPO_INDEXER_EXCLUDE = resources/bin/** -``` - -Please bear in mind that indexing the contents can consume a lot of system resources, especially when the index is created for the first time or globally updated (e.g. after upgrading Gitea). - -### Choosing the files for indexing by size - -The `MAX_FILE_SIZE` option will make the indexer skip all files larger than the specified value. - -### Choosing the files for indexing by path - -Gitea applies glob pattern matching from the [`gobwas/glob` library](https://github.com/gobwas/glob) to choose which files will be included in the index. - -Limiting the list of files prevents the indexes from becoming polluted with derived or irrelevant files (e.g. lss, sym, map, etc.), so the search results are more relevant. It can also help reduce the index size. - -`REPO_INDEXER_EXCLUDE_VENDORED` (default: true) excludes vendored files from index. - -`REPO_INDEXER_INCLUDE` (default: empty) is a comma separated list of glob patterns to **include** in the index. An empty list means "_include all files_". -`REPO_INDEXER_EXCLUDE` (default: empty) is a comma separated list of glob patterns to **exclude** from the index. Files that match this list will not be indexed. `REPO_INDEXER_EXCLUDE` takes precedence over `REPO_INDEXER_INCLUDE`. - -Pattern matching works as follows: - -- To match all files with a `.txt` extension no matter what directory, use `**.txt`. -- To match all files with a `.txt` extension _only at the root level of the repository_, use `*.txt`. -- To match all files inside `resources/bin` and below, use `resources/bin/**`. -- To match all files _immediately inside_ `resources/bin`, use `resources/bin/*`. -- To match all files named `Makefile`, use `**Makefile`. -- Matching a directory has no effect; the pattern `resources/bin` will not include/exclude files inside that directory; `resources/bin/**` will. -- All files and patterns are normalized to lower case, so `**Makefile`, `**makefile` and `**MAKEFILE` are equivalent. diff --git a/docs/content/administration/repo-indexer.zh-cn.md b/docs/content/administration/repo-indexer.zh-cn.md deleted file mode 100644 index d70a617ae1..0000000000 --- a/docs/content/administration/repo-indexer.zh-cn.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "仓库索引器" -slug: "repo-indexer" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /zh-cn/repo-indexer -menu: - sidebar: - parent: "administration" - name: "仓库索引器" - sidebar_position: 45 - identifier: "repo-indexer" ---- - -# 仓库索引器 - -## 设置仓库索引器 - -通过在您的 [`app.ini`](administration/config-cheat-sheet.md) 中启用此功能,Gitea 可以通过仓库的文件进行搜索: - -```ini -[indexer] -; ... -REPO_INDEXER_ENABLED = true -REPO_INDEXER_PATH = indexers/repos.bleve -MAX_FILE_SIZE = 1048576 -REPO_INDEXER_INCLUDE = -REPO_INDEXER_EXCLUDE = resources/bin/** -``` - -请记住,索引内容可能会消耗大量系统资源,特别是在首次创建索引或全局更新索引时(例如升级 Gitea 之后)。 - -### 按大小选择要索引的文件 - -`MAX_FILE_SIZE` 选项将使索引器跳过所有大于指定值的文件。 - -### 按路径选择要索引的文件 - -Gitea使用 [`gobwas/glob` 库](https://github.com/gobwas/glob) 中的 glob 模式匹配来选择要包含在索引中的文件。 - -限制文件列表可以防止索引被派生或无关的文件(例如 lss、sym、map 等)污染,从而使搜索结果更相关。这还有助于减小索引的大小。 - -`REPO_INDEXER_EXCLUDE_VENDORED`(默认值为 true)将排除供应商文件不包含在索引中。 - -`REPO_INDEXER_INCLUDE`(默认值为空)是一个逗号分隔的 glob 模式列表,用于在索引中**包含**的文件。空列表表示“_包含所有文件_”。 -`REPO_INDEXER_EXCLUDE`(默认值为空)是一个逗号分隔的 glob 模式列表,用于从索引中**排除**的文件。与该列表匹配的文件将不会被索引。`REPO_INDEXER_EXCLUDE` 优先于 `REPO_INDEXER_INCLUDE`。 - -模式匹配工作方式如下: - -- 要匹配所有带有 `.txt` 扩展名的文件,无论在哪个目录中,请使用 `**.txt`。 -- 要匹配仅在仓库的根级别中具有 `.txt` 扩展名的所有文件,请使用 `*.txt`。 -- 要匹配 `resources/bin` 目录及其子目录中的所有文件,请使用 `resources/bin/**`。 -- 要匹配位于 `resources/bin` 目录下的所有文件,请使用 `resources/bin/*`。 -- 要匹配所有名为 `Makefile` 的文件,请使用 `**Makefile`。 -- 匹配目录没有效果;模式 `resources/bin` 不会包含/排除该目录中的文件;`resources/bin/**` 会。 -- 所有文件和模式都规范化为小写,因此 `**Makefile`、`**makefile` 和 `**MAKEFILE` 是等效的。 diff --git a/docs/content/administration/reverse-proxies.en-us.md b/docs/content/administration/reverse-proxies.en-us.md deleted file mode 100644 index fe54c67d02..0000000000 --- a/docs/content/administration/reverse-proxies.en-us.md +++ /dev/null @@ -1,389 +0,0 @@ ---- -date: "2018-05-22T11:00:00+00:00" -title: "Reverse Proxies" -slug: "reverse-proxies" -sidebar_position: 16 -toc: false -draft: false -aliases: - - /en-us/reverse-proxies -menu: - sidebar: - parent: "administration" - name: "Reverse Proxies" - sidebar_position: 16 - identifier: "reverse-proxies" ---- - -# Reverse Proxies - -## Nginx - -If you want Nginx to serve your Gitea instance, add the following `server` section to the `http` section of `nginx.conf`: - -``` -server { - listen 80; - server_name git.example.com; - - location / { - client_max_body_size 512M; - proxy_pass http://localhost:3000; - proxy_set_header Connection $http_connection; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } -} -``` - -### Resolving Error: 413 Request Entity Too Large - -This error indicates nginx is configured to restrict the file upload size, -it affects attachment uploading, form posting, package uploading and LFS pushing, etc. -You can fine tune the `client_max_body_size` option according to [nginx document](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size). - -## Nginx with a sub-path - -In case you already have a site, and you want Gitea to share the domain name, you can setup Nginx to serve Gitea under a sub-path by adding the following `server` section inside the `http` section of `nginx.conf`: - -``` -server { - listen 80; - server_name git.example.com; - - # Note: Trailing slash - location /gitea/ { - client_max_body_size 512M; - - # make nginx use unescaped URI, keep "%2F" as is - rewrite ^ $request_uri; - rewrite ^/gitea(/.*) $1 break; - proxy_pass http://127.0.0.1:3000$uri; - - # other common HTTP headers, see the "Nginx" config section above - proxy_set_header ... - } -} -``` - -Then you **MUST** set something like `[server] ROOT_URL = http://git.example.com/git/` correctly in your configuration. - -## Nginx and serve static resources directly - -We can tune the performance in splitting requests into categories static and dynamic. - -CSS files, JavaScript files, images and web fonts are static content. -The front page, a repository view or issue list is dynamic content. - -Nginx can serve static resources directly and proxy only the dynamic requests to Gitea. -Nginx is optimized for serving static content, while the proxying of large responses might be the opposite of that -(see [https://serverfault.com/q/587386](https://serverfault.com/q/587386)). - -Download a snapshot of the Gitea source repository to `/path/to/gitea/`. -After this, run `make frontend` in the repository directory to generate the static resources. We are only interested in the `public/` directory for this task, so you can delete the rest. -(You will need to have [Node with npm](https://nodejs.org/en/download/) and `make` installed to generate the static resources) - -Depending on the scale of your user base, you might want to split the traffic to two distinct servers, -or use a cdn for the static files. - -### Single node and single domain - -Set `[server] STATIC_URL_PREFIX = /_/static` in your configuration. - -```apacheconf -server { - listen 80; - server_name git.example.com; - - location /_/static/assets/ { - alias /path/to/gitea/public/; - } - - location / { - proxy_pass http://localhost:3000; - } -} -``` - -### Two nodes and two domains - -Set `[server] STATIC_URL_PREFIX = http://cdn.example.com/gitea` in your configuration. - -```apacheconf -# application server running Gitea -server { - listen 80; - server_name git.example.com; - - location / { - proxy_pass http://localhost:3000; - } -} -``` - -```apacheconf -# static content delivery server -server { - listen 80; - server_name cdn.example.com; - - location /gitea/ { - alias /path/to/gitea/public/; - } - - location / { - return 404; - } -} -``` - -## Apache HTTPD - -If you want Apache HTTPD to serve your Gitea instance, you can add the following to your Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu): - -```apacheconf -<VirtualHost *:80> - ... - ProxyPreserveHost On - ProxyRequests off - AllowEncodedSlashes NoDecode - ProxyPass / http://localhost:3000/ nocanon -</VirtualHost> -``` - -Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http`. - -If you wish to use Let's Encrypt with webroot validation, add the line `ProxyPass /.well-known !` before `ProxyPass` to disable proxying these requests to Gitea. - -## Apache HTTPD with a sub-path - -In case you already have a site, and you want Gitea to share the domain name, you can setup Apache HTTPD to serve Gitea under a sub-path by adding the following to you Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu): - -```apacheconf -<VirtualHost *:80> - ... - <Proxy *> - Order allow,deny - Allow from all - </Proxy> - AllowEncodedSlashes NoDecode - # Note: no trailing slash after either /git or port - ProxyPass /git http://localhost:3000 nocanon -</VirtualHost> -``` - -Then you **MUST** set something like `[server] ROOT_URL = http://git.example.com/git/` correctly in your configuration. - -Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http`. - -## Caddy - -If you want Caddy to serve your Gitea instance, you can add the following server block to your Caddyfile: - -```apacheconf -git.example.com { - reverse_proxy localhost:3000 -} -``` - -## Caddy with a sub-path - -In case you already have a site, and you want Gitea to share the domain name, you can setup Caddy to serve Gitea under a sub-path by adding the following to your server block in your Caddyfile: - -```apacheconf -git.example.com { - route /git/* { - uri strip_prefix /git - reverse_proxy localhost:3000 - } -} -``` - -Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. - -## IIS - -If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite as reverse proxy. - -1. Setup an empty website in IIS, named let's say, `Gitea Proxy`. -2. Follow the first two steps in [Microsoft's Technical Community Guide to Setup IIS with URL Rewrite](https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222#M343). That is: - -- Install Application Request Routing (ARR for short) either by using the Microsoft Web Platform Installer 5.1 (WebPI) or downloading the extension from [IIS.net](https://www.iis.net/downloads/microsoft/application-request-routing) -- Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console called URL Rewrite. -- Open the IIS Manager Console and click on the `Gitea Proxy` Website from the tree view on the left. Select and double click the URL Rewrite Icon from the middle pane to load the URL Rewrite interface. -- Choose the `Add Rule` action from the right pane of the management console and select the `Reverse Proxy Rule` from the `Inbound and Outbound Rules` category. -- In the Inbound Rules section, set the server name to be the host that Gitea is running on with its port. e.g. if you are running Gitea on the localhost with port 3000, the following should work: `127.0.0.1:3000` -- Enable SSL Offloading -- In the Outbound Rules, ensure `Rewrite the domain names of the links in HTTP response` is set and set the `From:` field as above and the `To:` to your external hostname, say: `git.example.com` -- Now edit the `web.config` for your website to match the following: (changing `127.0.0.1:3000` and `git.example.com` as appropriate) - -```xml -<?xml version="1.0" encoding="UTF-8"?> -<configuration> - <system.web> - <httpRuntime requestPathInvalidCharacters="" /> - </system.web> - <system.webServer> - <security> - <requestFiltering> - <hiddenSegments> - <clear /> - </hiddenSegments> - <denyUrlSequences> - <clear /> - </denyUrlSequences> - <fileExtensions allowUnlisted="true"> - <clear /> - </fileExtensions> - </requestFiltering> - </security> - <rewrite> - <rules useOriginalURLEncoding="false"> - <rule name="ReverseProxyInboundRule1" stopProcessing="true"> - <match url="(.*)" /> - <action type="Rewrite" url="http://127.0.0.1:3000{UNENCODED_URL}" /> - <serverVariables> - <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="HTTP_ACCEPT_ENCODING" /> - <set name="HTTP_ACCEPT_ENCODING" value="" /> - </serverVariables> - </rule> - </rules> - <outboundRules> - <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1"> - <!-- set the pattern correctly here - if you only want to accept http or https --> - <!-- change the pattern and the action value as appropriate --> - <match filterByTags="A, Form, Img" pattern="^http(s)?://127.0.0.1:3000/(.*)" /> - <action type="Rewrite" value="http{R:1}://git.example.com/{R:2}" /> - </rule> - <rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding"> - <match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" /> - <action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" /> - </rule> - <preConditions> - <preCondition name="ResponseIsHtml1"> - <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> - </preCondition> - <preCondition name="NeedsRestoringAcceptEncoding"> - <add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" /> - </preCondition> - </preConditions> - </outboundRules> - </rewrite> - <urlCompression doDynamicCompression="true" /> - <handlers> - <clear /> - <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" /> - </handlers> - <!-- Map all extensions to the same MIME type, so all files can be - downloaded. --> - <staticContent> - <clear /> - <mimeMap fileExtension="*" mimeType="application/octet-stream" /> - </staticContent> - </system.webServer> -</configuration> -``` - -## HAProxy - -If you want HAProxy to serve your Gitea instance, you can add the following to your HAProxy configuration - -add an acl in the frontend section to redirect calls to gitea.example.com to the correct backend - -``` -frontend http-in - ... - acl acl_gitea hdr(host) -i gitea.example.com - use_backend gitea if acl_gitea - ... -``` - -add the previously defined backend section - -``` -backend gitea - server localhost:3000 check -``` - -If you redirect the http content to https, the configuration work the same way, just remember that the connection between HAProxy and Gitea will be done via http so you do not have to enable https in Gitea's configuration. - -## HAProxy with a sub-path - -In case you already have a site, and you want Gitea to share the domain name, you can setup HAProxy to serve Gitea under a sub-path by adding the following to you HAProxy configuration: - -``` -frontend http-in - ... - acl acl_gitea path_beg /gitea - use_backend gitea if acl_gitea - ... -``` - -With that configuration http://example.com/gitea/ will redirect to your Gitea instance. - -then for the backend section - -``` -backend gitea - http-request replace-path /gitea\/?(.*) \/\1 - server localhost:3000 check -``` - -The added http-request will automatically add a trailing slash if needed and internally remove /gitea from the path to allow it to work correctly with Gitea by setting properly http://example.com/gitea as the root. - -Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration. - -## Traefik - -If you want traefik to serve your Gitea instance, you can add the following label section to your `docker-compose.yaml` (Assuming the provider is docker). - -```yaml -gitea: - image: gitea/gitea - ... - labels: - - "traefik.enable=true" - - "traefik.http.routers.gitea.rule=Host(`example.com`)" - - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" -``` - -This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik. - -## Traefik with a sub-path - -In case you already have a site, and you want Gitea to share the domain name, you can setup Traefik to serve Gitea under a sub-path by adding the following to your `docker-compose.yaml` (Assuming the provider is docker) : - -```yaml -gitea: - image: gitea/gitea - ... - labels: - - "traefik.enable=true" - - "traefik.http.routers.gitea.rule=Host(`example.com`) && PathPrefix(`/gitea`)" - - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" - - "traefik.http.middlewares.gitea-stripprefix.stripprefix.prefixes=/gitea" - - "traefik.http.routers.gitea.middlewares=gitea-stripprefix" -``` - -This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik. - -Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration. - -## General sub-path configuration - -Usually it's not recommended to put Gitea in a sub-path, it's not widely used and may have some issues in rare cases. - -If you really need to do so, to make Gitea works with sub-path (eg: `http://example.com/gitea/`), here are the requirements: - -1. Set `[server] ROOT_URL = http://example.com/gitea/` in your `app.ini` file. -2. Make the reverse-proxy pass `http://example.com/gitea/foo` to `http://gitea-server:3000/foo`. -3. Make sure the reverse-proxy not decode the URI, the request `http://example.com/gitea/a%2Fb` should be passed as `http://gitea-server:3000/a%2Fb`. - -## Docker / Container Registry - -The container registry uses a fixed sub-path `/v2` which can't be changed. -Even if you deploy Gitea with a different sub-path, `/v2` will be used by the `docker` client. -Therefore you may need to add an additional route to your reverse proxy configuration. diff --git a/docs/content/administration/reverse-proxies.zh-cn.md b/docs/content/administration/reverse-proxies.zh-cn.md deleted file mode 100644 index 4c7de782c7..0000000000 --- a/docs/content/administration/reverse-proxies.zh-cn.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -date: "2018-05-22T11:00:00+00:00" -title: "反向代理" -slug: "reverse-proxies" -sidebar_position: 16 -toc: false -draft: false -aliases: - - /zh-cn/reverse-proxies -menu: - sidebar: - parent: "administration" - name: "反向代理" - sidebar_position: 16 - identifier: "reverse-proxies" ---- - -# 反向代理 - -## 使用 Nginx 作为反向代理服务 - -如果您想使用 Nginx 作为 Gitea 的反向代理服务,您可以参照以下 `nginx.conf` 配置中 `server` 的 `http` 部分: - -``` -server { - listen 80; - server_name git.example.com; - - location / { - proxy_pass http://localhost:3000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } -} -``` - -## 使用 Nginx 作为反向代理服务并将 Gitea 路由至一个子路径 - -如果您已经有一个域名并且想与 Gitea 共享该域名,您可以增加以下 `nginx.conf` 配置中 `server` 的 `http` 部分,为 Gitea 添加路由规则: - -``` -server { - listen 80; - server_name git.example.com; - - # 注意: /git/ 最后需要有一个路径符号 - location /git/ { - # 注意: 反向代理后端 URL 的最后需要有一个路径符号 - proxy_pass http://localhost:3000/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } -} -``` - -然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。 - -## 使用 Apache HTTPD 作为反向代理服务 - -如果您想使用 Apache HTTPD 作为 Gitea 的反向代理服务,您可以为您的 Apache HTTPD 作如下配置(在 Ubuntu 中,配置文件通常在 `/etc/apache2/httpd.conf` 目录下): - -``` -<VirtualHost *:80> - ... - ProxyPreserveHost On - ProxyRequests off - AllowEncodedSlashes NoDecode - ProxyPass / http://localhost:3000/ nocanon -</VirtualHost> -``` - -注:必须启用以下 Apache HTTPD 组件:`proxy`, `proxy_http` - -## 使用 Apache HTTPD 作为反向代理服务并将 Gitea 路由至一个子路径 - -如果您已经有一个域名并且想与 Gitea 共享该域名,您可以增加以下配置为 Gitea 添加路由规则(在 Ubuntu 中,配置文件通常在 `/etc/apache2/httpd.conf` 目录下): - -``` -<VirtualHost *:80> - ... - <Proxy *> - Order allow,deny - Allow from all - </Proxy> - AllowEncodedSlashes NoDecode - # 注意: 路径和 URL 后面都不要写路径符号 '/' - ProxyPass /git http://localhost:3000 nocanon -</VirtualHost> -``` - -然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。 - -注:必须启用以下 Apache HTTPD 组件:`proxy`, `proxy_http` - -## 使用 Caddy 作为反向代理服务 - -如果您想使用 Caddy 作为 Gitea 的反向代理服务,您可以在 `Caddyfile` 中添加如下配置: - -``` -git.example.com { - proxy / http://localhost:3000 -} -``` - -## 使用 Caddy 作为反向代理服务并将 Gitea 路由至一个子路径 - -如果您已经有一个域名并且想与 Gitea 共享该域名,您可以在您的 `Caddyfile` 文件中增加以下配置,为 Gitea 添加路由规则: - -``` -git.example.com { - # 注意: 路径 /git/ 最后需要有路径符号 - proxy /git/ http://localhost:3000 -} -``` - -然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。 - -## 使用 Traefik 作为反向代理服务 - -如果您想使用 traefik 作为 Gitea 的反向代理服务,您可以在 `docker-compose.yaml` 中添加 label 部分(假设使用 docker 作为 traefik 的 provider): - -```yaml -gitea: - image: gitea/gitea - ... - labels: - - "traefik.enable=true" - - "traefik.http.routers.gitea.rule=Host(`example.com`)" - - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" -``` - -这份配置假设您使用 traefik 来处理 HTTPS 服务,并在其和 Gitea 之间使用 HTTP 进行通信。 diff --git a/docs/content/administration/search-engines-indexation.en-us.md b/docs/content/administration/search-engines-indexation.en-us.md deleted file mode 100644 index 664940697d..0000000000 --- a/docs/content/administration/search-engines-indexation.en-us.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -date: "2019-12-31T13:55:00+05:00" -title: "Search Engines Indexation" -slug: "search-engines-indexation" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /en-us/search-engines-indexation -menu: - sidebar: - parent: "administration" - name: "Search Engines Indexation" - sidebar_position: 60 - identifier: "search-engines-indexation" ---- - -# Search engines indexation of your Gitea installation - -By default your Gitea installation will be indexed by search engines. -If you don't want your repository to be visible for search engines read further. - -## Block search engines indexation using robots.txt - -To make Gitea serve a custom `robots.txt` (default: empty 404) for top level installations, -create a file with path `public/robots.txt` in the [`custom` folder or `CustomPath`](administration/customizing-gitea.md) - -Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt). - -```txt -User-agent: * -Disallow: / -``` - -If you installed Gitea in a subdirectory, you will need to create or edit the `robots.txt` in the top level directory. - -```txt -User-agent: * -Disallow: /gitea/ -``` diff --git a/docs/content/administration/search-engines-indexation.zh-cn.md b/docs/content/administration/search-engines-indexation.zh-cn.md deleted file mode 100644 index 904e6de11b..0000000000 --- a/docs/content/administration/search-engines-indexation.zh-cn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "搜索引擎索引" -slug: "search-engines-indexation" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /zh-cn/search-engines-indexation -menu: - sidebar: - parent: "administration" - name: "搜索引擎索引" - sidebar_position: 60 - identifier: "search-engines-indexation" ---- - -# Gitea 安装的搜索引擎索引 - -默认情况下,您的 Gitea 安装将被搜索引擎索引。 -如果您不希望您的仓库对搜索引擎可见,请进一步阅读。 - -## 使用 robots.txt 阻止搜索引擎索引 - -为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在 [`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `public/robots.txt` 的文件。 - -有关如何配置 `robots.txt` 的示例,请参考 [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt)。 - -```txt -User-agent: * -Disallow: / -``` - -如果您将Gitea安装在子目录中,则需要在顶级目录中创建或编辑 `robots.txt`。 - -```txt -User-agent: * -Disallow: /gitea/ -``` diff --git a/docs/content/administration/signing.en-us.md b/docs/content/administration/signing.en-us.md deleted file mode 100644 index 837af14bb1..0000000000 --- a/docs/content/administration/signing.en-us.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -date: "2019-08-17T10:20:00+01:00" -title: "GPG Commit Signatures" -slug: "signing" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /en-us/signing -menu: - sidebar: - parent: "administration" - name: "GPG Commit Signatures" - sidebar_position: 50 - identifier: "signing" ---- - -# GPG Commit Signatures - -Gitea will verify GPG commit signatures in the provided tree by -checking if the commits are signed by a key within the Gitea database, -or if the commit matches the default key for Git. - -Keys are not checked to determine if they have expired or revoked. -Keys are also not checked with keyservers. - -A commit will be marked with a grey unlocked icon if no key can be -found to verify it. If a commit is marked with a red unlocked icon, -it is reported to be signed with a key with an id. - -Please note: The signer of a commit does not have to be an author or -committer of a commit. - -This functionality requires Git >= 1.7.9 but for full functionality -this requires Git >= 2.0.0. - -## Automatic Signing - -There are a number of places where Gitea will generate commits itself: - -- Repository Initialisation -- Wiki Changes -- CRUD actions using the editor or the API -- Merges from Pull Requests - -Depending on configuration and server trust you may want Gitea to -sign these commits. - -## Installing and generating a GPG key for Gitea - -It is up to a server administrator to determine how best to install -a signing key. Gitea generates all its commits using the server `git` -command at present - and therefore the server `gpg` will be used for -signing (if configured.) Administrators should review best-practices -for GPG - in particular it is probably advisable to only install a -signing secret subkey without the master signing and certifying secret -key. - -## General Configuration - -Gitea's configuration for signing can be found with the -`[repository.signing]` section of `app.ini`: - -```ini -... -[repository.signing] -SIGNING_KEY = default -SIGNING_NAME = -SIGNING_EMAIL = -INITIAL_COMMIT = always -CRUD_ACTIONS = pubkey, twofa, parentsigned -WIKI = never -MERGES = pubkey, twofa, basesigned, commitssigned - -... -``` - -### `SIGNING_KEY` - -The first option to discuss is the `SIGNING_KEY`. There are three main -options: - -- `none` - this prevents Gitea from signing any commits -- `default` - Gitea will default to the key configured within `git config` -- `KEYID` - Gitea will sign commits with the gpg key with the ID - `KEYID`. In this case you should provide a `SIGNING_NAME` and - `SIGNING_EMAIL` to be displayed for this key. - -The `default` option will interrogate `git config` for -`commit.gpgsign` option - if this is set, then it will use the results -of the `user.signingkey`, `user.name` and `user.email` as appropriate. - -Please note: by adjusting Git's `config` file within Gitea's -repositories, `SIGNING_KEY=default` could be used to provide different -signing keys on a per-repository basis. However, this is clearly not an -ideal UI and therefore subject to change. - -**Since 1.17**, Gitea runs git in its own home directory `[git].HOME_PATH` (default to `%(APP_DATA_PATH)/home`) -and uses its own config `{[git].HOME_PATH}/.gitconfig`. -If you have your own customized git config for Gitea, you should set these configs in system git config (aka `/etc/gitconfig`) -or the Gitea internal git config `{[git].HOME_PATH}/.gitconfig`. -Related home files for git command (like `.gnupg`) should also be put in Gitea's git home directory `[git].HOME_PATH`. -If you like to keep the `.gnupg` directory outside of `{[git].HOME_PATH}/`, consider setting the `$GNUPGHOME` environment variable to your preferred location. - -### `INITIAL_COMMIT` - -This option determines whether Gitea should sign the initial commit -when creating a repository. The possible values are: - -- `never`: Never sign -- `pubkey`: Only sign if the user has a public key -- `twofa`: Only sign if the user logs in with two factor authentication -- `always`: Always sign - -Options other than `never` and `always` can be combined as a comma -separated list. The commit will be signed if all selected options are true. - -### `WIKI` - -This options determines if Gitea should sign commits to the Wiki. -The possible values are: - -- `never`: Never sign -- `pubkey`: Only sign if the user has a public key -- `twofa`: Only sign if the user logs in with two-factor authentication -- `parentsigned`: Only sign if the parent commit is signed. -- `always`: Always sign - -Options other than `never` and `always` can be combined as a comma -separated list. The commit will be signed if all selected options are true. - -### `CRUD_ACTIONS` - -This option determines if Gitea should sign commits from the web -editor or API CRUD actions. The possible values are: - -- `never`: Never sign -- `pubkey`: Only sign if the user has a public key -- `twofa`: Only sign if the user logs in with two-factor authentication -- `parentsigned`: Only sign if the parent commit is signed. -- `always`: Always sign - -Options other than `never` and `always` can be combined as a comma -separated list. The change will be signed if all selected options are true. - -### `MERGES` - -This option determines if Gitea should sign merge commits from PRs. -The possible options are: - -- `never`: Never sign -- `pubkey`: Only sign if the user has a public key -- `twofa`: Only sign if the user logs in with two-factor authentication -- `basesigned`: Only sign if the parent commit in the base repo is signed. -- `headsigned`: Only sign if the head commit in the head branch is signed. -- `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed. -- `approved`: Only sign approved merges to a protected branch. -- `always`: Always sign - -Options other than `never` and `always` can be combined as a comma -separated list. The merge will be signed if all selected options are true. - -## Obtaining the Public Key of the Signing Key - -The public key used to sign Gitea's commits can be obtained from the API at: - -```sh -/api/v1/signing-key.gpg -``` - -In cases where there is a repository specific key this can be obtained from: - -```sh -/api/v1/repos/:username/:reponame/signing-key.gpg -``` diff --git a/docs/content/administration/signing.zh-cn.md b/docs/content/administration/signing.zh-cn.md deleted file mode 100644 index 5910b1bf78..0000000000 --- a/docs/content/administration/signing.zh-cn.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "GPG 提交签名" -slug: "signing" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /zh-cn/signing -menu: - sidebar: - parent: "administration" - name: "GPG 提交签名" - sidebar_position: 50 - identifier: "signing" ---- - -# GPG 提交签名 - -Gitea 将通过检查提交是否由 Gitea 数据库中的密钥签名,或者提交是否与 Git 的默认密钥匹配,来验证提供的树中的 GPG 提交签名。 - -密钥不会被检查以确定它们是否已过期或撤销。密钥也不会与密钥服务器进行检查。 - -如果找不到用于验证提交的密钥,提交将被标记为灰色的未锁定图标。如果提交被标记为红色的未锁定图标,则表示它使用带有 ID 的密钥签名。 - -请注意:提交的签署者不必是提交的作者或提交者。 - -此功能要求 Git >= 1.7.9,但要实现全部功能,需要 Git >= 2.0.0。 - -## 自动签名 - -有许多地方 Gitea 会生成提交: - -- 仓库初始化 -- Wiki 更改 -- 使用编辑器或 API 进行的 CRUD 操作 -- 从合并请求进行合并 - -根据配置和服务器信任,您可能希望 Gitea 对这些提交进行签名。 - -## 安装和生成 Gitea 的 GPG 密钥 - -如何安装签名密钥由服务器管理员决定。Gitea 目前使用服务器的 `git` 命令生成所有提交,因此将使用服务器的 `gpg` 进行签名(如果配置了)。管理员应该审查 GPG 的最佳实践 - 特别是可能建议仅安装签名的子密钥,而不是主签名和认证的密钥。 - -## 通用配置 - -Gitea 的签名配置可以在 `app.ini` 的 `[repository.signing]` 部分找到: - -```ini -... -[repository.signing] -SIGNING_KEY = default -SIGNING_NAME = -SIGNING_EMAIL = -INITIAL_COMMIT = always -CRUD_ACTIONS = pubkey, twofa, parentsigned -WIKI = never -MERGES = pubkey, twofa, basesigned, commitssigned - -... -``` - -### `SIGNING_KEY` - -首先讨论的选项是 `SIGNING_KEY`。有三个主要选项: - -- `none` - 这将阻止 Gitea 对任何提交进行签名 -- `default` - Gitea 将使用 `git config` 中配置的默认密钥 -- `KEYID` - Gitea 将使用具有 ID `KEYID` 的 GPG 密钥对提交进行签名。在这种情况下,您应该提供 `SIGNING_NAME` 和 `SIGNING_EMAIL`,以便显示此密钥的信息。 - -`default` 选项将读取 `git config` 中的 `commit.gpgsign` 选项 - 如果设置了该选项,它将使用 `user.signingkey`、`user.name` 和 `user.email` 的结果。 - -请注意:通过在 Gitea 的仓库中调整 Git 的 `config` 文件,可以使用 `SIGNING_KEY=default` 为每个仓库提供不同的签名密钥。然而,这显然不是一个理想的用户界面,因此可能会发生更改。 - -**自 1.17 起**,Gitea 在自己的主目录 `[git].HOME_PATH`(默认为 `%(APP_DATA_PATH)/home`)中运行 git,并使用自己的配置文件 `{[git].HOME_PATH}/.gitconfig`。 -如果您有自己定制的 Gitea git 配置,您应该将这些配置设置在系统 git 配置文件中(例如 `/etc/gitconfig`)或者 Gitea 的内部 git 配置文件 `{[git].HOME_PATH}/.gitconfig` 中。 -与 git 命令相关的主目录文件(如 `.gnupg`)也应该放在 Gitea 的 git 主目录 `[git].HOME_PATH` 中。 -如果您希望将 `.gnupg` 目录放在 `{[git].HOME_PATH}/` 之外的位置,请考虑设置 `$GNUPGHOME` 环境变量为您首选的位置。 - -### `INITIAL_COMMIT` - -此选项确定在创建仓库时,Gitea 是否应该对初始提交进行签名。可能的取值有: - -- `never`:从不签名 -- `pubkey`:仅在用户拥有公钥时进行签名 -- `twofa`:仅在用户使用 2FA 登录时进行签名 -- `always`:始终签名 - -除了 `never` 和 `always` 之外的选项可以组合为逗号分隔的列表。如果所有选择的选项都为 true,则提交将被签名。 - -### `WIKI` - -此选项确定 Gitea 是否应该对 Wiki 的提交进行签名。可能的取值有: - -- `never`:从不签名 -- `pubkey`:仅在用户拥有公钥时进行签名 -- `twofa`:仅在用户使用 2FA 登录时进行签名 -- `parentsigned`:仅在父提交已签名时进行签名。 -- `always`:始终签名 - -除了 `never` 和 `always` 之外的选项可以组合为逗号分隔的列表。如果所有选择的选项都为 true,则提交将被签名。 - -### `CRUD_ACTIONS` - -此选项确定 Gitea 是否应该对 Web 编辑器或 API CRUD 操作的提交进行签名。可能的取值有: - -- `never`:从不签名 -- `pubkey`:仅在用户拥有公钥时进行签名 -- `twofa`:仅在用户使用 2FA 登录时进行签名 -- `parentsigned`:仅在父提交已签名时进行签名。 -- `always`:始终签名 - -除了 `never` 和 `always` 之外的选项可以组合为逗号分隔的列表。如果所有选择的选项都为 true,则更改将被签名。 - -### `MERGES` - -此选项确定 Gitea 是否应该对 PR 的合并提交进行签名。可能的选项有: - -- `never`:从不签名 -- `pubkey`:仅在用户拥有公钥时进行签名 -- `twofa`:仅在用户使用 2FA 登录时进行签名 -- `basesigned`:仅在基础仓库中的父提交已签名时进行签名。 -- `headsigned`:仅在头分支中的头提交已签名时进行签名。 -- `commitssigned`:仅在头分支中的所有提交到合并点的提交都已签名时进行签名。 -- `approved`:仅对已批准的合并到受保护分支的提交进行签名。 -- `always`:始终签名 - -除了 `never` 和 `always` 之外的选项可以组合为逗号分隔的列表。如果所有选择的选项都为 true,则合并将被签名。 - -## 获取签名密钥的公钥 - -用于签署 Gitea 提交的公钥可以通过 API 获取: - -```sh -/api/v1/signing-key.gpg -``` - -在存在特定于仓库的密钥的情况下,可以通过以下方式获取: - -```sh -/api/v1/repos/:username/:reponame/signing-key.gpg -``` diff --git a/docs/content/contributing.en-us.md b/docs/content/contributing.en-us.md deleted file mode 100644 index 8cd2e2bd89..0000000000 --- a/docs/content/contributing.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2021-01-22T00:00:00+02:00" -title: "Contributing" -slug: "contributing" -sidebar_position: 35 -toc: false -draft: false -menu: - sidebar: - name: "Contributing" - sidebar_position: 50 - identifier: "contributing" ---- diff --git a/docs/content/contributing/_index.en-us.md b/docs/content/contributing/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/contributing/_index.en-us.md +++ /dev/null diff --git a/docs/content/contributing/_index.zh-cn.md b/docs/content/contributing/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/contributing/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/contributing/guidelines-backend.en-us.md b/docs/content/contributing/guidelines-backend.en-us.md deleted file mode 100644 index 3159a5ff7d..0000000000 --- a/docs/content/contributing/guidelines-backend.en-us.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -date: "2021-11-01T23:41:00+08:00" -title: "Guidelines for Backend Development" -slug: "guidelines-backend" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /en-us/guidelines-backend -menu: - sidebar: - parent: "contributing" - name: "Guidelines for Backend" - sidebar_position: 20 - identifier: "guidelines-backend" ---- - -# Guidelines for Backend Development - -## Background - -Gitea uses Golang as the backend programming language. It uses many third-party packages and also write some itself. -For example, Gitea uses [Chi](https://github.com/go-chi/chi) as basic web framework. [Xorm](https://xorm.io) is an ORM framework that is used to interact with the database. -So it's very important to manage these packages. Please take the below guidelines before you start to write backend code. - -## Package Design Guideline - -### Packages List - -To maintain understandable code and avoid circular dependencies it is important to have a good code structure. The Gitea backend is divided into the following parts: - -- `build`: Scripts to help build Gitea. -- `cmd`: All Gitea actual sub commands includes web, doctor, serv, hooks, admin and etc. `web` will start the web service. `serv` and `hooks` will be invoked by Git or OpenSSH. Other sub commands could help to maintain Gitea. -- `tests`: Common test utility functions - - `tests/integration`: Integration tests, to test back-end regressions - - `tests/e2e`: E2e tests, to test front-end and back-end compatibility and visual regressions. -- `models`: Contains the data structures used by xorm to construct database tables. It also contains functions to query and update the database. Dependencies to other Gitea code should be avoided. You can make exceptions in cases such as logging. - - `models/db`: Basic database operations. All other `models/xxx` packages should depend on this package. The `GetEngine` function should only be invoked from `models/`. - - `models/fixtures`: Sample data used in unit tests and integration tests. One `yml` file means one table which will be loaded into database when beginning the tests. - - `models/migrations`: Stores database migrations between versions. PRs that change a database structure **MUST** also have a migration step. -- `modules`: Different modules to handle specific functionality in Gitea. Work in Progress: Some of them should be moved to `services`, in particular those that depend on models because they rely on the database. - - `modules/setting`: Store all system configurations read from ini files and has been referenced by everywhere. But they should be used as function parameters when possible. - - `modules/git`: Package to interactive with `Git` command line or Gogit package. -- `public`: Compiled frontend files (javascript, images, css, etc.) -- `routers`: Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) must not depend on routers. - - `routers/api` Contains routers for `/api/v1` aims to handle RESTful API requests. - - `routers/install` Could only respond when system is in INSTALL mode (INSTALL_LOCK=false). - - `routers/private` will only be invoked by internal sub commands, especially `serv` and `hooks`. - - `routers/web` will handle HTTP requests from web browsers or Git SMART HTTP protocols. -- `services`: Support functions for common routing operations or command executions. Uses `models` and `modules` to handle the requests. -- `templates`: Golang templates for generating the html output. - -### Package Dependencies - -Since Golang doesn't support import cycles, we have to decide the package dependencies carefully. There are some levels between those packages. Below is the ideal package dependencies direction. - -`cmd` -> `routers` -> `services` -> `models` -> `modules` - -From left to right, left packages could depend on right packages, but right packages MUST not depend on left packages. The sub packages on the same level could depend on according this level's rules. - -**NOTICE** - -Why do we need database transactions outside of `models`? And how? -Some actions should allow for rollback when database record insertion/update/deletion failed. -So services must be allowed to create a database transaction. Here is some example, - -```go -// services/repository/repository.go -func CreateXXXX() error { - return db.WithTx(func(ctx context.Context) error { - // do something, if err is returned, it will rollback automatically - if err := issues.UpdateIssue(ctx, repoID); err != nil { - // ... - return err - } - // ... - return nil - }) -} -``` - -You should **not** use `db.GetEngine(ctx)` in `services` directly, but just write a function under `models/`. -If the function will be used in the transaction, just let `context.Context` as the function's first parameter. - -```go -// models/issues/issue.go -func UpdateIssue(ctx context.Context, repoID int64) error { - e := db.GetEngine(ctx) - - // ... -} -``` - -### Package Name - -For the top level package, use a plural as package name, i.e. `services`, `models`, for sub packages, use singular, -i.e. `services/user`, `models/repository`. - -### Import Alias - -Since there are some packages which use the same package name, it is possible that you find packages like `modules/user`, `models/user`, and `services/user`. When these packages are imported in one Go file, it's difficult to know which package we are using and if it's a variable name or an import name. So, we always recommend to use import aliases. To differ from package variables which are commonly in camelCase, just use **snake_case** for import aliases. -i.e. `import user_service "code.gitea.io/gitea/services/user"` - -### Implementing `io.Closer` - -If a type implements `io.Closer`, calling `Close` multiple times must not fail or `panic` but return an error or `nil`. - -### Important Gotchas - -- Never write `x.Update(exemplar)` without an explicit `WHERE` clause: - - This will cause all rows in the table to be updated with the non-zero values of the exemplar - including IDs. - - You should usually write `x.ID(id).Update(exemplar)`. -- If during a migration you are inserting into a table using `x.Insert(exemplar)` where the ID is preset: - - You will need to ``SET IDENTITY_INSERT `table` ON`` for the MSSQL variant (the migration will fail otherwise) - - However, you will also need to update the id sequence for postgres - the migration will silently pass here but later insertions will fail: - ``SELECT setval('table_name_id_seq', COALESCE((SELECT MAX(id)+1 FROM `table_name`), 1), false)`` - -### Future Tasks - -Currently, we are creating some refactors to do the following things: - -- Correct that codes which doesn't follow the rules. -- There are too many files in `models`, so we are moving some of them into a sub package `models/xxx`. -- Some `modules` sub packages should be moved to `services` because they depend on `models`. diff --git a/docs/content/contributing/guidelines-backend.zh-cn.md b/docs/content/contributing/guidelines-backend.zh-cn.md deleted file mode 100644 index 33129dc086..0000000000 --- a/docs/content/contributing/guidelines-backend.zh-cn.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -date: "2023-05-25T23:41:00+08:00" -title: "后端开发指南" -slug: "guidelines-backend" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/guidelines-backend -menu: - sidebar: - parent: "contributing" - name: "后端开发指南" - sidebar_position: 20 - identifier: "guidelines-backend" ---- - -# 后端开发指南 - -## 背景 - -Gitea使用Golang作为后端编程语言。它使用了许多第三方包,并且自己也编写了一些包。 -例如,Gitea使用[Chi](https://github.com/go-chi/chi)作为基本的Web框架。[Xorm](https://xorm.io)是一个用于与数据库交互的ORM框架。 -因此,管理这些包非常重要。在开始编写后端代码之前,请参考以下准则。 - -## 包设计准则 - -### 包列表 - -为了保持易于理解的代码并避免循环依赖,拥有良好的代码结构是很重要的。Gitea后端分为以下几个部分: - -- `build`:帮助构建Gitea的脚本。 -- `cmd`:包含所有Gitea的实际子命令,包括web、doctor、serv、hooks、admin等。`web`将启动Web服务。`serv`和`hooks`将被Git或OpenSSH调用。其他子命令可以帮助维护Gitea。 -- `tests`:常用的测试函数 -- `tests/integration`:集成测试,用于测试后端回归。 -- `tests/e2e`:端到端测试,用于测试前端和后端的兼容性和视觉回归。 -- `models`:包含由xorm用于构建数据库表的数据结构。它还包含查询和更新数据库的函数。应避免与其他Gitea代码的依赖关系。在某些情况下,比如日志记录时可以例外。 - - `models/db`:基本的数据库操作。所有其他`models/xxx`包都应依赖于此包。`GetEngine`函数只能从models/中调用。 - - `models/fixtures`:单元测试和集成测试中使用的示例数据。一个`yml`文件表示一个将在测试开始时加载到数据库中的表。 - - `models/migrations`:存储不同版本之间的数据库迁移。修改数据库结构的PR**必须**包含一个迁移步骤。 -- `modules`:在Gitea中处理特定功能的不同模块。工作正在进行中:其中一些模块应该移到`services`中,特别是那些依赖于models的模块,因为它们依赖于数据库。 - - `modules/setting`:存储从ini文件中读取的所有系统配置,并在各处引用。但是在可能的情况下,应将其作为函数参数使用。 - - `modules/git`:用于与`Git`命令行或Gogit包交互的包。 -- `public`:编译后的前端文件(JavaScript、图像、CSS等) -- `routers`:处理服务器请求。由于它使用其他Gitea包来处理请求,因此其他包(models、modules或services)不能依赖于routers。 - - `routers/api`:包含`/api/v1`相关路由,用于处理RESTful API请求。 - - `routers/install`:只能在系统处于安装模式(INSTALL_LOCK=false)时响应。 - - `routers/private`:仅由内部子命令调用,特别是`serv`和`hooks`。 - - `routers/web`:处理来自Web浏览器或Git SMART HTTP协议的HTTP请求。 -- `services`:用于常见路由操作或命令执行的支持函数。使用`models`和`modules`来处理请求。 -- `templates`:用于生成HTML输出的Golang模板。 - -### 包依赖关系 - -由于Golang不支持导入循环,我们必须仔细决定包之间的依赖关系。这些包之间有一些级别。以下是理想的包依赖关系方向。 - -`cmd` -> `routers` -> `services` -> `models` -> `modules` - -从左到右,左侧的包可以依赖于右侧的包,但右侧的包不能依赖于左侧的包。在同一级别的子包中,可以根据该级别的规则进行依赖。 - -**注意事项** - -为什么我们需要在`models`之外使用数据库事务?以及如何使用? -某些操作在数据库记录插入/更新/删除失败时应该允许回滚。 -因此,服务必须能够创建数据库事务。以下是一些示例: - -```go -// services/repository/repository.go -func CreateXXXX() error { - return db.WithTx(func(ctx context.Context) error { - // do something, if err is returned, it will rollback automatically - if err := issues.UpdateIssue(ctx, repoID); err != nil { - // ... - return err - } - // ... - return nil - }) -} -``` - -在`services`中**不应该**直接使用`db.GetEngine(ctx)`,而是应该在`models/`下编写一个函数。 -如果该函数将在事务中使用,请将`context.Context`作为函数的第一个参数。 - -```go -// models/issues/issue.go -func UpdateIssue(ctx context.Context, repoID int64) error { - e := db.GetEngine(ctx) - - // ... -} -``` - -### 包名称 - -对于顶层包,请使用复数作为包名,例如`services`、`models`,对于子包,请使用单数,例如`services/user`、`models/repository`。 - -### 导入别名 - -由于有一些使用相同包名的包,例如`modules/user`、`models/user`和`services/user`,当这些包在一个Go文件中被导入时,很难知道我们使用的是哪个包以及它是变量名还是导入名。因此,我们始终建议使用导入别名。为了与常见的驼峰命名法的包变量区分开,建议使用**snake_case**作为导入别名的命名规则。 -例如:`import user_service "code.gitea.io/gitea/services/user"` - -### 重要注意事项 - -- 永远不要写成`x.Update(exemplar)`,而没有明确的`WHERE`子句: - - 这将导致表中的所有行都被使用exemplar的非零值进行更新,包括ID。 - - 通常应该写成`x.ID(id).Update(exemplar)`。 -- 如果在迁移过程中使用`x.Insert(exemplar)`向表中插入记录,而ID是预设的: - - 对于MSSQL变体,你将需要执行``SET IDENTITY_INSERT `table` ON``(否则迁移将失败) - - 对于PostgreSQL,你还需要更新ID序列,否则迁移将悄无声息地通过,但后续的插入将失败: - ``SELECT setval('table_name_id_seq', COALESCE((SELECT MAX(id)+1 FROM `table_name`), 1), false)`` - -### 未来的任务 - -目前,我们正在进行一些重构,以完成以下任务: - -- 纠正不符合规则的代码。 -- `models`中的文件太多了,所以我们正在将其中的一些移动到子包`models/xxx`中。 -- 由于它们依赖于`models`,因此应将某些`modules`子包移动到`services`中。 diff --git a/docs/content/contributing/guidelines-frontend.en-us.md b/docs/content/contributing/guidelines-frontend.en-us.md deleted file mode 100644 index 611b93e5b3..0000000000 --- a/docs/content/contributing/guidelines-frontend.en-us.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -date: "2021-10-13T16:00:00+02:00" -title: "Guidelines for Frontend Development" -slug: "guidelines-frontend" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /en-us/guidelines-frontend -menu: - sidebar: - parent: "contributing" - name: "Guidelines for Frontend" - sidebar_position: 30 - identifier: "guidelines-frontend" ---- - -# Guidelines for Frontend Development - -## Background - -Gitea uses [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend. - -The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template). - -The source files can be found in the following directories: - -* **CSS styles:** `web_src/css/` -* **JavaScript files:** `web_src/js/` -* **Vue components:** `web_src/js/components/` -* **Go HTML templates:** `templates/` - -## General Guidelines - -We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) - -### Gitea specific guidelines: - -1. Every feature (Fomantic-UI/jQuery module) should be put in separate files/directories. -2. HTML ids and classes should use kebab-case, it's preferred to contain 2-3 feature related keywords. -3. HTML ids and classes used in JavaScript should be unique for the whole project, and should contain 2-3 feature related keywords. We recommend to use the `js-` prefix for classes that are only used in JavaScript. -4. CSS styling for classes provided by frameworks should not be overwritten. Always use new class names with 2-3 feature related keywords to overwrite framework styles. Gitea's helper CSS classes in `helpers.less` could be helpful. -5. The backend can pass complex data to the frontend by using `ctx.PageData["myModuleData"] = map[]{}`, but do not expose whole models to the frontend to avoid leaking sensitive data. -6. Simple pages and SEO-related pages use Go HTML Template render to generate static Fomantic-UI HTML output. Complex pages can use Vue3. -7. Clarify variable types, prefer `elem.disabled = true` instead of `elem.setAttribute('disabled', 'anything')`, prefer `$el.prop('checked', var === 'yes')` instead of `$el.prop('checked', var)`. -8. Use semantic elements, prefer `<button class="ui button">` instead of `<div class="ui button">`. -9. Avoid unnecessary `!important` in CSS, add comments to explain why it's necessary if it can't be avoided. -10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event. -11. Custom event names are recommended to use `ce-` prefix. -12. Prefer using Tailwind CSS which is available via `tw-` prefix, e.g. `tw-relative`. Gitea's helper CSS classes use `gt-` prefix (`gt-word-break`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`). -13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided. - -### Accessibility / ARIA - -In history, Gitea heavily uses Fomantic UI which is not an accessibility-friendly framework. -Gitea uses some patches to make Fomantic UI more accessible (see `aria.md` and related JS files), -but there are still many problems which need a lot of work and time to fix. - -### Framework Usage - -Mixing different frameworks together is discouraged, it makes the code difficult to be maintained. -A JavaScript module should follow one major framework and follow the framework's best practice. - -Recommended implementations: - -* Vue + Vanilla JS -* Fomantic-UI (jQuery) -* htmx (partial page reloads for otherwise static components) -* Vanilla JS - -Discouraged implementations: - -* Vue + Fomantic-UI (jQuery) -* jQuery + Vanilla JS -* htmx + any other framework which requires heavy JS code, or unnecessary features like htmx scripting (`hx-on`) - -To make UI consistent, Vue components can use Fomantic-UI CSS classes. -We use htmx for simple interactions. You can see an example for simple interactions where htmx should be used in this [PR](https://github.com/go-gitea/gitea/pull/28908). Do not use htmx if you require more advanced reactivity, use another framework (Vue/Vanilla JS). -Although mixing different frameworks is discouraged, -it should also work if the mixing is necessary and the code is well-designed and maintainable. - -### `async` Functions - -Only mark a function as `async` if and only if there are `await` calls -or `Promise` returns inside the function. - -It's not recommended to use `async` event listeners, which may lead to problems. -The reason is that the code after await is executed outside the event dispatch. -Reference: https://github.com/github/eslint-plugin-github/blob/main/docs/rules/async-preventdefault.md - -If an event listener must be `async`, the `e.preventDefault()` should be before any `await`, -it's recommended to put it at the beginning of the function. - -If we want to call an `async` function in a non-async context, -it's recommended to use `const _promise = asyncFoo()` to tell readers -that this is done by purpose, we want to call the async function and ignore the Promise. -Some lint rules and IDEs also have warnings if the returned Promise is not handled. - -### Fetching data - -To fetch data, use the wrapper functions `GET`, `POST` etc. from `modules/fetch.js`. They -accept a `data` option for the content, will automatically set CSRF token and return a -Promise for a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response). - -### HTML Attributes and `dataset` - -The usage of `dataset` is forbidden, its camel-casing behaviour makes it hard to grep for attributes. -However, there are still some special cases, so the current guideline is: - -* For legacy code: - * `$.data()` should be refactored to `$.attr()`. - * `$.data()` can be used to bind some non-string data to elements in rare cases, but it is highly discouraged. - -* For new code: - * `node.dataset` should not be used, use `node.getAttribute` instead. - * never bind any user data to a DOM node, use a suitable design pattern to describe the relation between node and data. - -### Show/Hide Elements - -* Vue components are recommended to use `v-if` and `v-show` to show/hide elements. -* Go template code should use `.tw-hidden` and `showElem()/hideElem()/toggleElem()`, see more details in `.tw-hidden`'s comment. - -### Styles and Attributes in Go HTML Template - -It's recommended to use: - -```html -<div class="gt-name1 gt-name2 {{if .IsFoo}}gt-foo{{end}}" {{if .IsFoo}}data-foo{{end}}></div> -``` - -instead of: - -```html -<div class="gt-name1 gt-name2{{if .IsFoo}} gt-foo{{end}}"{{if .IsFoo}} data-foo{{end}}></div> -``` - -to make the code more readable. - -### Legacy Code - -A lot of legacy code already existed before this document's written. It's recommended to refactor legacy code to follow the guidelines. - -### Vue3 and JSX - -Gitea is using Vue3 now. We decided not to introduce JSX to keep the HTML and the JavaScript code separated. - -### UI Examples - -Gitea uses some self-made UI elements and customizes others to integrate them better into the general UI approach. When running Gitea in development mode (`RUN_MODE=dev`), a page with some standardized UI examples is available under `http(s)://your-gitea-url:port/devtest`. diff --git a/docs/content/contributing/guidelines-frontend.zh-cn.md b/docs/content/contributing/guidelines-frontend.zh-cn.md deleted file mode 100644 index 1df7bc5bcf..0000000000 --- a/docs/content/contributing/guidelines-frontend.zh-cn.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -date: "2023-05-25T16:00:00+02:00" -title: "前端开发指南" -slug: "guidelines-frontend" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/guidelines-frontend -menu: - sidebar: - parent: "contributing" - name: "前端开发指南" - sidebar_position: 20 - identifier: "guidelines-frontend" ---- - -# 前端开发指南 - -## 背景 - -Gitea 在其前端中使用[Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html)(基于[jQuery](https://api.jquery.com))和 [Vue3](https://vuejs.org/)。 - -HTML 页面由[Go HTML Template](https://pkg.go.dev/html/template)渲染。 - -源文件可以在以下目录中找到: - -* **CSS 样式**: `web_src/css/` -* **JavaScript 文件**: `web_src/js/` -* **Vue 组件**: `web_src/js/components/` -* **Go HTML 模板**: `templates/` - -## 通用准则 - -我们推荐使用[Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html)和[Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)。 - -## Gitea 特定准则 - -1. 每个功能(Fomantic-UI/jQuery 模块)应放在单独的文件/目录中。 -2. HTML 的 id 和 class 应使用 kebab-case,最好包含2-3个与功能相关的关键词。 -3. 在 JavaScript 中使用的 HTML 的 id 和 class 应在整个项目中是唯一的,并且应包含2-3个与功能相关的关键词。建议在仅在 JavaScript 中使用的 class 中使用 `js-` 前缀。 -4. 不应覆盖框架提供的 class 的 CSS 样式。始终使用具有2-3个与功能相关的关键词的新 class 名称来覆盖框架样式。Gitea 中的帮助 CSS 类在 `helpers.less` 中。 -5. 后端可以通过使用`ctx.PageData["myModuleData"] = map[]{}`将复杂数据传递给前端,但不要将整个模型暴露给前端,以避免泄露敏感数据。 -6. 简单页面和与 SEO 相关的页面使用 Go HTML 模板渲染生成静态的 Fomantic-UI HTML 输出。复杂页面可以使用 Vue3。 -7. 明确变量类型,优先使用`elem.disabled = true`而不是`elem.setAttribute('disabled', 'anything')`,优先使用`$el.prop('checked', var === 'yes')`而不是`$el.prop('checked', var)`。 -8. 使用语义化元素,优先使用`<button class="ui button">`而不是`<div class="ui button">`。 -9. 避免在 CSS 中使用不必要的`!important`,如果无法避免,添加注释解释为什么需要它。 -10. 避免在一个事件监听器中混合不同的事件,优先为每个事件使用独立的事件监听器。 -11. 推荐使用自定义事件名称前缀`ce-`。 -12. 建议使用 Tailwind CSS,它可以通过 `tw-` 前缀获得,例如 `tw-relative`. Gitea 自身的助手类 CSS 使用 `gt-` 前缀(`gt-word-break`),Gitea 自身的私有框架级 CSS 类使用 `g-` 前缀(`g-modal-confirm`)。 -13. 尽量避免内联脚本和样式,建议将JS代码放入JS文件中并使用CSS类。如果内联脚本和样式不可避免,请解释无法避免的原因。 - -### 可访问性 / ARIA - -在历史上,Gitea大量使用了可访问性不友好的框架 Fomantic UI。 -Gitea使用一些补丁使Fomantic UI更具可访问性(参见`aria.js`和`aria.md`), -但仍然存在许多问题需要大量的工作和时间来修复。 - -### 框架使用 - -不建议混合使用不同的框架,这会使代码难以维护。 -一个 JavaScript 模块应遵循一个主要框架,并遵循该框架的最佳实践。 - -推荐的实现方式: - -* Vue + Vanilla JS -* Fomantic-UI(jQuery) -* htmx (部分页面重新加载其他静态组件) -* Vanilla JS - -不推荐的实现方式: - -* Vue + Fomantic-UI(jQuery) -* jQuery + Vanilla JS -* htmx + 任何其他需要大量 JavaScript 代码或不必要的功能,如 htmx 脚本 (`hx-on`) - -为了保持界面一致,Vue 组件可以使用 Fomantic-UI 的 CSS 类。 -尽管不建议混合使用不同的框架, -我们使用 htmx 进行简单的交互。您可以在此 [PR](https://github.com/go-gitea/gitea/pull/28908) 中查看一个简单交互的示例,其中应使用 htmx。如果您需要更高级的反应性,请不要使用 htmx,请使用其他框架(Vue/Vanilla JS)。 -但如果混合使用是必要的,并且代码设计良好且易于维护,也可以工作。 - -### `async` 函数 - -只有当函数内部存在`await`调用或返回`Promise`时,才将函数标记为`async`。 - -不建议使用`async`事件监听器,这可能会导致问题。 -原因是`await`后的代码在事件分发之外执行。 -参考:https://github.com/github/eslint-plugin-github/blob/main/docs/rules/async-preventdefault.md - -如果一个事件监听器必须是`async`,应在任何`await`之前使用`e.preventDefault()`, -建议将其放在函数的开头。 - -如果我们想在非异步上下文中调用`async`函数, -建议使用`const _promise = asyncFoo()`来告诉读者 -这是有意为之的,我们想调用异步函数并忽略Promise。 -一些 lint 规则和 IDE 也会在未处理返回的 Promise 时发出警告。 - -### 获取数据 - -要获取数据,请使用`modules/fetch.js`中的包装函数`GET`、`POST`等。他们 -接受内容的`data`选项,将自动设置 CSRF 令牌并返回 -[Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)。 - -### HTML 属性和 dataset - -禁止使用`dataset`,它的驼峰命名行为使得搜索属性变得困难。 -然而,仍然存在一些特殊情况,因此当前的准则是: - -* 对于旧代码: - * 应将`$.data()`重构为`$.attr()`。 - * 在极少数情况下,可以使用`$.data()`将一些非字符串数据绑定到元素上,但强烈不推荐使用。 - -* 对于新代码: - * 不应使用`node.dataset`,而应使用`node.getAttribute`。 - * 不要将任何用户数据绑定到 DOM 节点上,使用合适的设计模式描述节点和数据之间的关系。 - -### 显示/隐藏元素 - -* 推荐在Vue组件中使用`v-if`和`v-show`来显示/隐藏元素。 -* Go 模板代码应使用 `.tw-hidden` 和 `showElem()/hideElem()/toggleElem()` 来显示/隐藏元素,请参阅`.tw-hidden`的注释以获取更多详细信息。 - -### Go HTML 模板中的样式和属性 - -建议使用以下方式: - -```html -<div class="gt-name1 gt-name2 {{if .IsFoo}}gt-foo{{end}}" {{if .IsFoo}}data-foo{{end}}></div> -``` - -而不是: - -```html -<div class="gt-name1 gt-name2{{if .IsFoo}} gt-foo{{end}}"{{if .IsFoo}} data-foo{{end}}></div> -``` - -以使代码更易读。 - -### 旧代码 - -许多旧代码已经存在于本文撰写之前。建议重构旧代码以遵循指南。 - -### Vue3 和 JSX - -Gitea 现在正在使用 Vue3。我们决定不引入 JSX,以保持 HTML 代码和 JavaScript 代码分离。 - -### UI示例 - -Gitea 使用一些自制的 UI 元素并自定义其他元素,以将它们更好地集成到通用 UI 方法中。当在开发模式(`RUN_MODE=dev`)下运行 Gitea 时,在 `http(s)://your-gitea-url:port/devtest` 下会提供一个包含一些标准化 UI 示例的页面。 diff --git a/docs/content/contributing/guidelines-refactoring.en-us.md b/docs/content/contributing/guidelines-refactoring.en-us.md deleted file mode 100644 index 5d368a120d..0000000000 --- a/docs/content/contributing/guidelines-refactoring.en-us.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -date: "2023-02-14T00:00:00+00:00" -title: "Guidelines for Refactoring" -slug: "guidelines-refactoring" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /en-us/guidelines-refactoring -menu: - sidebar: - parent: "contributing" - name: "Guidelines for Refactoring" - sidebar_position: 40 - identifier: "guidelines-refactoring" ---- - -# Guidelines for Refactoring - -## Background - -Since the first line of code was written at Feb 12, 2014, Gitea has grown to be a large project. -As a result, the codebase has become larger and larger. The larger the codebase is, the more difficult it is to maintain. -A lot of outdated mechanisms exist, a lot of frameworks are mixed together, some legacy code might cause bugs and block new features. -To make the codebase more maintainable and make Gitea better, developers should keep in mind to use modern mechanisms to refactor the old code. - -This document is a collection of guidelines for refactoring the codebase. - -## Refactoring Suggestions - -* Design more about the future, but not only resolve the current problem. -* Reduce ambiguity, reduce conflicts, improve maintainability. -* Describe the refactoring, for example: - * Why the refactoring is needed. - * How the legacy problems would be solved. - * What's the Pros/Cons of the refactoring. -* Only do necessary changes, keep the old logic as much as possible. -* Introduce some intermediate steps to make the refactoring easier to review, a complete refactoring plan could be done in several PRs. -* If there is any divergence, the TOC(Technical Oversight Committee) should be involved to help to make decisions. -* Add necessary tests to make sure the refactoring is correct. -* Non-bug refactoring is preferred to be done at the beginning of a milestone, it would be easier to find problems before the release. - -## Reviewing & Merging Suggestions - -* A refactoring PR shouldn't be kept open for a long time (usually 7 days), it should be reviewed as soon as possible. -* A refactoring PR should be merged as soon as possible, it should not be blocked by other PRs. -* If there is no objection from TOC, a refactoring PR could be merged after 7 days with one core member's approval (not the author). -* Tolerate some dirty/hacky intermediate steps if the final result is good. -* Tolerate some regression bugs if the refactoring is necessary, fix bugs as soon as possible. diff --git a/docs/content/contributing/guidelines-refactoring.zh-cn.md b/docs/content/contributing/guidelines-refactoring.zh-cn.md deleted file mode 100644 index d65fe486dc..0000000000 --- a/docs/content/contributing/guidelines-refactoring.zh-cn.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -date: "2023-05-25T00:00:00+00:00" -title: "重构指南" -slug: "guidelines-refactoring" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/guidelines-refactoring -menu: - sidebar: - parent: "contributing" - name: "重构指南" - sidebar_position: 20 - identifier: "guidelines-refactoring" ---- - -# 重构指南 - -## 背景 - -自2014年2月12日编写了第一行代码以来,Gitea已经发展成为一个庞大的项目。 -因此,代码库变得越来越大。代码库越大,维护就越困难。 -存在许多过时的机制,许多框架混合在一起,一些遗留代码可能会导致错误并阻碍新功能的开发。 -为了使代码库更易于维护,使Gitea变得更好,开发人员应牢记使用现代机制来重构旧代码。 - -本文档是关于重构代码库的指南集合。 - -## 重构建议 - -* 设计更多关于未来的内容,而不仅仅解决当前问题。 -* 减少模糊性,减少冲突,提高可维护性。 -* 描述重构,例如: - * 为什么需要重构。 - * 如何解决旧问题。 - * 重构的优点/缺点是什么。 -* 只做必要的更改,尽量保留旧逻辑。 -* 引入一些中间步骤,使重构更容易审查,完整的重构计划可以在几个PR中完成。 -* 如果存在分歧,应该请TOC(技术监督委员会)参与决策。 -* 添加必要的测试以确保重构的正确性。 -* 非错误重构优先在里程碑的开始时进行,这样可以更容易地在发布之前发现问题。 - -## 审查和合并建议 - -* 重构的PR不应该长时间保持打开状态(通常为7天),应尽快进行审查。 -* 重构的PR应尽快合并,不应被其他PR阻塞。 -* 如果TOC没有异议,重构的PR可以在7天后由一名核心成员(非作者)批准后合并。 -* 如果最终结果良好,容忍一些不完美/临时的步骤。 -* 如果重构是必要的,容忍一些回归错误,并尽快修复错误。 diff --git a/docs/content/contributing/localization.de-de.md b/docs/content/contributing/localization.de-de.md deleted file mode 100644 index 0741179240..0000000000 --- a/docs/content/contributing/localization.de-de.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -date: "2021-01-22T00:00:00+02:00" -title: "Übersetzungs Richtlinien" -slug: "localization" -sidebar_position: 70 -toc: false -draft: false -menu: - sidebar: - parent: "contributing" - name: "Übersetzungsrichtlinien" - sidebar_position: 70 - identifier: "localization" ---- - -## Allgemeines - -Anrede: Wenig förmlich: - -* "Du"-Form -* Keine "Amtsdeusch"-Umschreibungen, einfach so als ob man den Nutzer direkt persönlich ansprechen würde - -Genauer definiert: - -* "falsch" anstatt "nicht korrekt/inkorrekt" -* Benutzerkonto oder Konto? Oder Account? -* "Wende dich an ..." anstatt "kontaktiere ..." -* In der selben Zeit übersetzen (sonst wird aus "is" "war") -* Richtige Anführungszeichen verwenden. Also `"` statt `''` oder `'` oder \` oder `´` - * `„` für beginnende Anführungszeichen, `“` für schließende Anführungszeichen - -Es gelten Artikel und Worttrennungen aus dem Duden. - -## Formulierungen in Modals und Buttons - -Es sollten die gleichen Formulierungen auf Buttons und Modals verwendet werden. - -Beispiel: Wenn der Button mit `löschen` beschriftet ist, sollte im Modal die Frage lauten `Willst du das wirklich löschen?` und nicht `Willst du das wirklich entfernen?`. Gleiches gilt für Success/Errormeldungen nach der Aktion. - -## Trennungen - -* Pull-Request -* Time-Tracker -* E-Mail-Adresse (siehe Duden) - -## Artikeldefinitionen für Anglizismen - -* _Der_ Commit (m.) -* _Der_ Branch (m.), plural: die Branches -* _Das_ Issue (n.) -* _Der_ Fork (m.) -* _Das_ Repository (n.), plural: die Repositories -* _Der_ Pull-Request (m.) -* _Der_ Token (m.), plural: die Token -* _Das_ Review (n.) -* _Der_ Key (m.) -* _Der_ Committer (m.), plural: die Committer - -## Weiterführende Links - -Diese beiden Links sind sehr empfehlenswert: - -* http://docs.translatehouse.org/projects/localization-guide/en/latest/guide/translation_guidelines_german.html -* https://docs.qgis.org/2.18/en/docs/documentation_guidelines/do_translations.html diff --git a/docs/content/contributing/localization.en-us.md b/docs/content/contributing/localization.en-us.md deleted file mode 100644 index 05ff5ee121..0000000000 --- a/docs/content/contributing/localization.en-us.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Localization" -slug: "localization" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /en-us/localization -menu: - sidebar: - parent: "contributing" - name: "Localization" - sidebar_position: 70 - identifier: "localization" ---- - -# Localization - -Gitea's localization happens through our [Crowdin project](https://crowdin.com/project/gitea). - -For changes to an **English** translation, a pull request can be made that changes the appropriate key in -the [english locale](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini). - -For changes to a **non-English** translation, refer to the Crowdin project above. - -## Supported Languages - -Any language listed in the above Crowdin project will be supported as long as 25% or more has been translated. - -After a translation has been accepted, it will be reflected in the main repository after the next Crowdin sync, which is generally after any PR is merged. - -At the time of writing, this means that a changed translation may not appear until the following Gitea release. - -If you use a bleeding edge build, it should appear as soon as you update after the change is synced. - -# How to Contribute - -Different Languages have different translation guidelines. Please visit the respective page for more information. diff --git a/docs/content/contributing/localization.zh-cn.md b/docs/content/contributing/localization.zh-cn.md deleted file mode 100644 index 9f2353e0e9..0000000000 --- a/docs/content/contributing/localization.zh-cn.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "本地化" -slug: "localization" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /zh-cn/localization -menu: - sidebar: - parent: "contributing" - name: "本地化" - sidebar_position: 70 - identifier: "localization" ---- - -# 本地化 - -Gitea的本地化是通过我们的[Crowdin项目](https://crowdin.com/project/gitea)进行的。 - -对于对**英语翻译**的更改,可以发出pull-request,来更改[英语语言环境](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini)中合适的关键字。 - -有关对**非英语**翻译的更改,请参阅上面的 Crowdin 项目。 - -## 支持的语言 - -上述 Crowdin 项目中列出的任何语言一旦翻译了 25% 或更多都将得到支持。 - -翻译被接受后,它将在下一次 Crowdin 同步后反映在主存储库中,这通常是在任何 PR 合并之后。 - -在撰写本文时,这意味着更改后的翻译可能要到 Gitea 的下一个版本才会出现。 - -如果使用开发版本,则在同步更改内容后,它应该会在更新后立即显示。 diff --git a/docs/content/contributing/translation.zh-cn.md b/docs/content/contributing/translation.zh-cn.md deleted file mode 100644 index 80ce6fd743..0000000000 --- a/docs/content/contributing/translation.zh-cn.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -date: "2023-05-25T00:00:00+02:00" -title: "翻译指南" -sidebar_position: 70 -toc: true -draft: false -menu: - sidebar: - parent: "contributing" - name: "翻译指南" - sidebar_position: 70 - identifier: "translation-guidelines" ---- - -本页面用于提供一套通用规则,以确保翻译的一致性。 - -* [German](/de-de/übersetzungs-richtlinien/) diff --git a/docs/content/development.en-us.md b/docs/content/development.en-us.md deleted file mode 100644 index 92201b1f5b..0000000000 --- a/docs/content/development.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Development" -slug: "development" -sidebar_position: 40 -toc: false -draft: false -menu: - sidebar: - name: "Development" - sidebar_position: 40 - identifier: "development" ---- diff --git a/docs/content/development.zh-cn.md b/docs/content/development.zh-cn.md deleted file mode 100644 index 4992b313d1..0000000000 --- a/docs/content/development.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "开发" -slug: "development" -sidebar_position: 40 -toc: false -draft: false -menu: - sidebar: - name: "开发" - sidebar_position: 40 - identifier: "development" ---- diff --git a/docs/content/development/_index.en-us.md b/docs/content/development/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/development/_index.en-us.md +++ /dev/null diff --git a/docs/content/development/_index.zh-cn.md b/docs/content/development/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/development/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/development/api-usage.en-us.md b/docs/content/development/api-usage.en-us.md deleted file mode 100644 index 94dac70b88..0000000000 --- a/docs/content/development/api-usage.en-us.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -date: "2018-06-24:00:00+02:00" -title: "API Usage" -slug: "api-usage" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /en-us/api-usage -menu: - sidebar: - parent: "development" - name: "API Usage" - sidebar_position: 40 - identifier: "api-usage" ---- - -# API Usage - -## Enabling/configuring API access - -By default, `ENABLE_SWAGGER` is true, and `MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat Sheet](administration/config-cheat-sheet.md) for more information. - -## Authentication - -Gitea supports these methods of API authentication: - -- HTTP basic authentication -- `token=...` parameter in URL query string -- `access_token=...` parameter in URL query string -- `Authorization: token ...` header in HTTP headers - -All of these methods accept the same API key token type. You can -better understand this by looking at the code -- as of this writing, -Gitea parses queries and headers to find the token in -[modules/auth/auth.go](https://github.com/go-gitea/gitea/blob/6efdcaed86565c91a3dc77631372a9cc45a58e89/modules/auth/auth.go#L47). - -## Generating and listing API tokens - -A new token can be generated with a `POST` request to -`/users/:name/tokens`. - -Note that `/users/:name/tokens` is a special endpoint and requires you -to authenticate using `BasicAuth` and a password, as follows: - -```sh -$ curl -H "Content-Type: application/json" -d '{"name":"test"}' -u username:password https://gitea.your.host/api/v1/users/<username>/tokens -{"id":1,"name":"test","sha1":"9fcb1158165773dd010fca5f0cf7174316c3e37d","token_last_eight":"16c3e37d"} -``` - -The ``sha1`` (the token) is only returned once and is not stored in -plain-text. It will not be displayed when listing tokens with a `GET` -request; e.g. - -```sh -$ curl --url https://yourusername:password@gitea.your.host/api/v1/users/<username>/tokens -[{"name":"test","sha1":"","token_last_eight:"........":},{"name":"dev","sha1":"","token_last_eight":"........"}] -``` - -To use the API with basic authentication with two factor authentication -enabled, you'll need to send an additional header that contains the one -time password (6 digitrotating token). -An example of the header is `X-Gitea-OTP: 123456` where `123456` -is where you'd place the code from your authenticator. -Here is how the request would look like in curl: - -```sh -$ curl -H "X-Gitea-OTP: 123456" --url https://yourusername:yourpassword@gitea.your.host/api/v1/users/yourusername/tokens -``` - -You can also create an API key token via your Gitea installation's web -interface: `Settings | Applications | Generate New Token`. - -## OAuth2 Provider - -Access tokens obtained from Gitea's [OAuth2 provider](development/oauth2-provider.md) are accepted by these methods: - -- `Authorization bearer ...` header in HTTP headers -- `token=...` parameter in URL query string -- `access_token=...` parameter in URL query string - -### More on the `Authorization:` header - -For historical reasons, Gitea needs the word `token` included before -the API key token in an authorization header, like this: - -```sh -Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675 -``` - -In a `curl` command, for instance, this would look like: - -```sh -curl "http://localhost:4000/api/v1/repos/test1/test1/issues" \ - -H "accept: application/json" \ - -H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \ - -H "Content-Type: application/json" -d "{ \"body\": \"testing\", \"title\": \"test 20\"}" -i -``` - -As mentioned above, the token used is the same one you would use in -the `token=` string in a GET request. - -## Pagination - -The API supports pagination. The `page` and `limit` parameters are used to specify the page number and the number of items per page. As well, the `Link` header is returned with the next, previous, and last page links if there are more than one pages. The `x-total-count` is also returned to indicate the total number of items. - -```sh -curl -v "http://localhost/api/v1/repos/search?limit=1" -... -< link: <http://localhost/api/v1/repos/search?limit=1&page=2>; rel="next",<http://localhost/api/v1/repos/search?limit=1&page=5252>; rel="last" -... -< x-total-count: 5252 -``` - -## API Guide - -API Reference guide is auto-generated by swagger and available on: -`https://gitea.your.host/api/swagger` -or on the -[Gitea demo instance](https://try.gitea.io/api/swagger) - -The OpenAPI document is at: -`https://gitea.your.host/swagger.v1.json` - -## Sudo - -The API allows admin users to sudo API requests as another user. Simply add either a `sudo=` parameter or `Sudo:` request header with the username of the user to sudo. - -## SDKs - -- [Official go-sdk](https://gitea.com/gitea/go-sdk) -- [more](https://gitea.com/gitea/awesome-gitea#user-content-sdk) diff --git a/docs/content/development/api-usage.zh-cn.md b/docs/content/development/api-usage.zh-cn.md deleted file mode 100644 index 96c1997294..0000000000 --- a/docs/content/development/api-usage.zh-cn.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -date: "2018-06-24:00:00+02:00" -title: "API 使用指南" -slug: "api-usage" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /zh-cn/api-usage -menu: - sidebar: - parent: "development" - name: "API 使用指南" - sidebar_position: 40 - identifier: "api-usage" ---- - -# Gitea API 使用指南 - -## 开启/配置 API 访问 - -通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。 - -## 通过 API 认证 - -Gitea 支持以下几种 API 认证方式: - -- HTTP basic authentication 方式 -- 通过指定 `token=...` URL 查询参数方式 -- 通过指定 `access_token=...` URL 查询参数方式 -- 通过指定 `Authorization: token ...` HTTP header 方式 - -以上提及的认证方法接受相同的 apiKey token 类型,您可以在编码时通过查阅代码更好地理解这一点。 -Gitea 调用解析查询参数以及头部信息来获取 token 的代码可以在 [modules/auth/auth.go](https://github.com/go-gitea/gitea/blob/6efdcaed86565c91a3dc77631372a9cc45a58e89/modules/auth/auth.go#L47) 中找到。 - -您可以通过您的 gitea web 界面来创建 apiKey token: -`Settings | Applications | Generate New Token`. - -### 关于 `Authorization:` header - -由于一些历史原因,Gitea 需要在 header 的 apiKey token 里引入前缀 `token`,类似于如下形式: - -``` -Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675 -``` - -以 `curl` 命令为例,它会以如下形式携带在请求中: - -``` -curl "http://localhost:4000/api/v1/repos/test1/test1/issues" \ - -H "accept: application/json" \ - -H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \ - -H "Content-Type: application/json" -d "{ \"body\": \"testing\", \"title\": \"test 20\"}" -i -``` - -正如上例所示,您也可以在 GET 请求中使用同一个 token 并以 `token=` 的查询参数形式携带 token 来进行认证。 - -## 通过 API 列出您发布的令牌 - -`/users/:name/tokens` 是一个特殊的接口,需要您使用 basic authentication 进行认证,具体原因在 issue 中 -[#3842](https://github.com/go-gitea/gitea/issues/3842#issuecomment-397743346) 有所提及,使用方法如下所示: - -### 使用 Basic authentication 认证: - -``` -$ curl --url https://yourusername:yourpassword@gitea.your.host/api/v1/users/yourusername/tokens -[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}] -``` - -## 使用 Sudo 方式请求 API - -此 API 允许管理员借用其他用户身份进行 API 请求。只需在请求中指定查询参数 `sudo=` 或是指定 header 中的 `Sudo:` 为需要使用的用户 username 即可。 diff --git a/docs/content/development/hacking-on-gitea.en-us.md b/docs/content/development/hacking-on-gitea.en-us.md deleted file mode 100644 index 004e803827..0000000000 --- a/docs/content/development/hacking-on-gitea.en-us.md +++ /dev/null @@ -1,374 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Hacking on Gitea" -slug: "hacking-on-gitea" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /en-us/hacking-on-gitea -menu: - sidebar: - parent: "development" - name: "Hacking on Gitea" - sidebar_position: 10 - identifier: "hacking-on-gitea" ---- - -# Hacking on Gitea - -## Quickstart - -To get a quick working development environment you could use Gitpod. - -[![Open in Gitpod](/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) - -## Installing go - -You should [install go](https://go.dev/doc/install) and set up your go -environment correctly. - -Next, [install Node.js with npm](https://nodejs.org/en/download/) which is -required to build the JavaScript and CSS files. The minimum supported Node.js -version is @minNodeVersion@ and the latest LTS version is recommended. - -**Note**: When executing make tasks that require external tools, like -`make watch-backend`, Gitea will automatically download and build these as -necessary. To be able to use these you must have the `"$GOPATH"/bin` directory -on the executable path. If you don't add the go bin directory to the -executable path you will have to manage this yourself. - -**Note 2**: Go version @minGoVersion@ or higher is required. -Gitea uses `gofmt` to format source code. However, the results of -`gofmt` can differ by the version of `go`. Therefore it is -recommended to install the version of Go that our continuous integration is -running. As of last update, the Go version should be @goVersion@. - -To lint the template files, ensure [Python](https://www.python.org/) and -[Poetry](https://python-poetry.org/) are installed. - -## Installing Make - -Gitea makes heavy use of Make to automate tasks and improve development. This -guide covers how to install Make. - -### On Linux - -Install with the package manager. - -On Ubuntu/Debian: - -```bash -sudo apt-get install make -``` - -On Fedora/RHEL/CentOS: - -```bash -sudo yum install make -``` - -### On Windows - -One of these three distributions of Make will run on Windows: - -- [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`. - - [32-bits version](http://www.equation.com/ftpdir/make/32/make.exe) - - [64-bits version](http://www.equation.com/ftpdir/make/64/make.exe) -- [MinGW-w64](https://www.mingw-w64.org) / [MSYS2](https://www.msys2.org/). - - MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software, it includes MinGW-w64. - - In MingGW-w64, the binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`. - - In MSYS2, you can use `make` directly. See [MSYS2 Porting](https://www.msys2.org/wiki/Porting/). - - To compile Gitea with CGO_ENABLED (eg: SQLite3), you might need to use [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) instead of MSYS2 gcc, because MSYS2 gcc headers lack some Windows-only CRT functions like `_beginthread`. -- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make` - -**Note**: If you are attempting to build using make with Windows Command Prompt, you may run into issues. The above prompts (Git bash, or MinGW) are recommended, however if you only have command prompt (or potentially PowerShell) you can set environment variables using the [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) command, e.g. `set TAGS=bindata`. - -## Downloading and cloning the Gitea source code - -The recommended method of obtaining the source code is by using `git clone`. - -```bash -git clone https://github.com/go-gitea/gitea -``` - -(Since the advent of go modules, it is no longer necessary to build go projects -from within the `$GOPATH`, hence the `go get` approach is no longer recommended.) - -## Forking Gitea - -Download the main Gitea source code as above. Then, fork the -[Gitea repository](https://github.com/go-gitea/gitea) on GitHub, -and either switch the git remote origin for your fork or add your fork as another remote: - -```bash -# Rename original Gitea origin to upstream -git remote rename origin upstream -git remote add origin "git@github.com:$GITHUB_USERNAME/gitea.git" -git fetch --all --prune -``` - -or: - -```bash -# Add new remote for our fork -git remote add "$FORK_NAME" "git@github.com:$GITHUB_USERNAME/gitea.git" -git fetch --all --prune -``` - -To be able to create pull requests, the forked repository should be added as a remote -to the Gitea sources. Otherwise, changes can't be pushed. - -## Building Gitea (Basic) - -Take a look at our -[instructions](installation/from-source.md) -for [building from source](installation/from-source.md). - -The simplest recommended way to build from source is: - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -The `build` target will execute both `frontend` and `backend` sub-targets. If the `bindata` tag is present, the frontend files will be compiled into the binary. It is recommended to leave out the tag when doing frontend development so that changes will be reflected. - -See `make help` for all available `make` targets. Also see [`.drone.yml`](https://github.com/go-gitea/gitea/blob/main/.drone.yml) to see how our continuous integration works. - -## Building continuously - -To run and continuously rebuild when source files change: - -```bash -# for both frontend and backend -make watch - -# or: watch frontend files (html/js/css) only -make watch-frontend - -# or: watch backend files (go) only -make watch-backend -``` - -On macOS, watching all backend source files may hit the default open files limit which can be increased via `ulimit -n 12288` for the current shell or in your shell startup file for all future shells. - -### Formatting, code analysis and spell check - -Our continuous integration will reject PRs that fail the code linters (including format check, code analysis and spell check). - -You should format your code: - -```bash -make fmt -``` - -and lint the source code: - -```bash -# lint both frontend and backend code -make lint -# lint only backend code -make lint-backend -``` - -**Note**: The results of `gofmt` are dependent on the version of `go` present. -You should run the same version of go that is on the continuous integration -server as mentioned above. - -### Working on JS and CSS - -Frontend development should follow [Guidelines for Frontend Development](contributing/guidelines-frontend.md) - -To build with frontend resources, either use the `watch-frontend` target mentioned above or just build once: - -```bash -make build && ./gitea -``` - -Before committing, make sure the linters pass: - -```bash -make lint-frontend -``` - -### Configuring local ElasticSearch instance - -Start local ElasticSearch instance using docker: - -```sh -mkdir -p $(pwd)/data/elasticsearch -sudo chown -R 1000:1000 $(pwd)/data/elasticsearch -docker run --rm --memory="4g" -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -v "$(pwd)/data/elasticsearch:/usr/share/elasticsearch/data" docker.elastic.co/elasticsearch/elasticsearch:7.16.3 -``` - -Configure `app.ini`: - -```ini -[indexer] -ISSUE_INDEXER_TYPE = elasticsearch -ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 -REPO_INDEXER_ENABLED = true -REPO_INDEXER_TYPE = elasticsearch -REPO_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 -``` - -### Building and adding SVGs - -SVG icons are built using the `make svg` target which compiles the icon sources into the output directory `public/assets/img/svg`. Custom icons can be added in the `web_src/svg` directory. - -### Building the Logo - -The PNG and SVG versions of the Gitea logo are built from a single SVG source file `assets/logo.svg` using the `TAGS="gitea" make generate-images` target. To run it, Node.js and npm must be available. - -The same process can also be used to generate custom logo PNGs from a SVG source file by updating `assets/logo.svg` and running `make generate-images`. Omitting the `gitea` tag will update only the user-designated logo files. - -### Updating the API - -When creating new API routes or modifying existing API routes, you **MUST** -update and/or create [Swagger](https://swagger.io/docs/specification/2-0/what-is-swagger/) -documentation for these using [go-swagger](https://goswagger.io/) comments. -The structure of these comments is described in the [specification](https://goswagger.io/use/spec.html#annotation-syntax). -If you want more information about the Swagger structure, you can look at the -[Swagger 2.0 Documentation](https://swagger.io/docs/specification/2-0/basic-structure/) -or compare with a previous PR adding a new API endpoint, e.g. [PR #5483](https://github.com/go-gitea/gitea/pull/5843/files#diff-2e0a7b644cf31e1c8ef7d76b444fe3aaR20) - -You should be careful not to break the API for downstream users which depend -on a stable API. In general, this means additions are acceptable, but deletions -or fundamental changes to the API will be rejected. - -Once you have created or changed an API endpoint, please regenerate the Swagger -documentation using: - -```bash -make generate-swagger -``` - -You should validate your generated Swagger file: - -```bash -make swagger-validate -``` - -You should commit the changed swagger JSON file. The continuous integration -server will check that this has been done using: - -```bash -make swagger-check -``` - -**Note**: Please note you should use the Swagger 2.0 documentation, not the -OpenAPI 3 documentation. - -### Creating new configuration options - -When creating new configuration options, it is not enough to add them to the -`modules/setting` files. You should add information to `custom/conf/app.ini` -and to the -[configuration cheat sheet](administration/config-cheat-sheet.md) -found in `docs/content/doc/administer/config-cheat-sheet.en-us.md` - -### Changing the logo - -When changing the Gitea logo SVG, you will need to run and commit the results -of: - -```bash -make generate-images -``` - -This will create the necessary Gitea favicon and others. - -### Database Migrations - -If you make breaking changes to any of the database persisted structs in the -`models/` directory, you will need to make a new migration. These can be found -in `models/migrations/`. You can ensure that your migrations work for the main -database types using: - -```bash -make test-sqlite-migration # with SQLite switched for the appropriate database -``` - -## Testing - -There are two types of test run by Gitea: Unit tests and Integration Tests. - -### Unit Tests - -Unit tests are covered by `*_test.go` in `go test` system. -You can set the environment variable `GITEA_UNIT_TESTS_LOG_SQL=1` to display all SQL statements when running the tests in verbose mode (i.e. when `GOTESTFLAGS=-v` is set). - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests -``` - -### Integration Tests - -Unit tests will not and cannot completely test Gitea alone. Therefore, we -have written integration tests; however, these are database dependent. - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build test-sqlite -``` - -will run the integration tests in an SQLite environment. Integration tests -require `git lfs` to be installed. Other database tests are available but -may need adjustment to the local environment. - -Take a look at [`tests/integration/README.md`](https://github.com/go-gitea/gitea/blob/main/tests/integration/README.md) -for more information and how to run a single test. - -### Testing for a PR - -Our continuous integration will test the code passes its unit tests and that -all supported databases will pass integration test in a Docker environment. -Migration from several recent versions of Gitea will also be tested. - -Please submit your PR with additional tests and integration tests as -appropriate. - -## Documentation for the website - -Documentation for the website is found in `docs/`. If you change this you -can test your changes to ensure that they pass continuous integration using: - -```bash -make lint-md -``` - -## Visual Studio Code - -A `launch.json` and `tasks.json` are provided within `contrib/ide/vscode` for -Visual Studio Code. Look at -[`contrib/ide/README.md`](https://github.com/go-gitea/gitea/blob/main/contrib/ide/README.md) -for more information. - -## GoLand - -Clicking the `Run Application` arrow on the function `func main()` in `/main.go` -can quickly start a debuggable Gitea instance. - -The `Output Directory` in `Run/Debug Configuration` MUST be set to the -gitea project directory (which contains `main.go` and `go.mod`), -otherwise, the started instance's working directory is a GoLand's temporary directory -and prevents Gitea from loading dynamic resources (eg: templates) in a development environment. - -To run unit tests with SQLite in GoLand, set `-tags sqlite,sqlite_unlock_notify` -in `Go tool arguments` of `Run/Debug Configuration`. - -## Submitting PRs - -Once you're happy with your changes, push them up and open a pull request. It -is recommended that you allow Gitea Managers and Owners to modify your PR -branches as we will need to update it to main before merging and/or may be -able to help fix issues directly. - -Any PR requires two approvals from the Gitea maintainers and needs to pass the -continuous integration. Take a look at our -[`CONTRIBUTING.md`](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md) -document. - -If you need more help pop on to [Discord](https://discord.gg/gitea) #Develop -and chat there. - -That's it! You are ready to hack on Gitea. diff --git a/docs/content/development/hacking-on-gitea.zh-cn.md b/docs/content/development/hacking-on-gitea.zh-cn.md deleted file mode 100644 index 7dfea30538..0000000000 --- a/docs/content/development/hacking-on-gitea.zh-cn.md +++ /dev/null @@ -1,343 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "玩转 Gitea" -slug: "hacking-on-gitea" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /zh-cn/hacking-on-gitea -menu: - sidebar: - parent: "development" - name: "玩转 Gitea" - sidebar_position: 10 - identifier: "hacking-on-gitea" ---- - -# Hacking on Gitea - -## 快速入门 - -要获得快速工作的开发环境,您可以使用 Gitpod。 - -[![在 Gitpod 中打开](/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) - -## 安装 Golang - -您需要 [安装 go]( https://go.dev/doc/install ) 并设置您的 go 环境。 - -接下来,[使用 npm 安装 Node.js](https://nodejs.org/en/download/) ,这是构建 -JavaScript 和 CSS 文件的必要工具。最低支持的 Node.js 版本是 @minNodeVersion@ -并且推荐使用最新的 LTS 版本。 - -**注意** :当执行需要外部工具的 make 任务时,比如 -`make watch-backend`,Gitea 会自动下载并构建这些必要的组件。为了能够使用这些,你必须 -将 `"$GOPATH"/bin` 目录加入到可执行路径上。如果你不把go bin目录添加到可执行路径你必须手动 -指定可执行程序路径。 - -**注意2** :Go版本 @minGoVersion@ 或更高版本是必须的。Gitea 使用 `gofmt` 来 -格式化源代码。然而,`gofmt` 的结果可能因 `go` 的版本而有差异。因此推荐安装我们持续集成使用 -的 Go版本。截至上次更新,Go 版本应该是 @goVersion@。 - -## 安装 Make - -Gitea 大量使用 `Make` 来自动化任务和改进开发。本指南涵盖了如何安装 Make。 - -### 在 Linux 上 - -使用包管理器安装。 - -在 Ubuntu/Debian 上: - -```bash -sudo apt-get install make -``` - -在 Fedora/RHEL/CentOS 上: - -```bash -sudo yum install make -``` - -### 在 Windows 上 - -Make 的这三个发行版都可以在 Windows 上运行: - -- [单个二进制构建]( http://www.equation.com/servlet/equation.cmd?fa=make )。复制到某处并添加到 `PATH`。 - - [32 位版本](http://www.equation.com/ftpdir/make/32/make.exe) - - [64 位版本](http://www.equation.com/ftpdir/make/64/make.exe) -- [MinGW-w64](https://www.mingw-w64.org) / [MSYS2](https://www.msys2.org/)。 - - MSYS2 是一个工具和库的集合,为您提供一个易于使用的环境来构建、安装和运行本机 Windows 软件,它包括 MinGW-w64。 - - 在 MingGW-w64 中,二进制文件称为 `mingw32-make.exe` 而不是 `make.exe`。将 `bin` 文件夹添加到 `PATH`。 - - 在 MSYS2 中,您可以直接使用 `make`。请参阅 [MSYS2 移植](https://www.msys2.org/wiki/Porting/)。 - - 要使用 CGO_ENABLED(例如:SQLite3)编译 Gitea,您可能需要使用 [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) 而不是 MSYS2 gcc,因为 MSYS2 gcc 标头缺少一些 Windows -只有 CRT 函数像 _beginthread 一样。 -- [Chocolatey包管理器]( https://chocolatey.org/packages/make )。运行`choco install make` - -**注意** :如果您尝试在 Windows 命令提示符下使用 make 进行构建,您可能会遇到问题。建议使用上述提示(Git bash 或 MinGW),但是如果您只有命令提示符(或可能是 PowerShell),则可以使用 [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) 命令,例如 `set TAGS=bindata`。 - -## 下载并克隆 Gitea 源代码 - -获取源代码的推荐方法是使用 `git clone`。 - -```bash -git clone https://github.com/go-gitea/gitea -``` - -(自从go modules出现后,不再需要构建 go 项目从 `$GOPATH` 中获取,因此不再推荐使用 `go get` 方法。) - -## 派生 Gitea - -如上所述下载主要的 Gitea 源代码。然后,派生 [Gitea 仓库](https://github.com/go-gitea/gitea), -并为您的本地仓库切换 git 远程源,或添加另一个远程源: - -```bash -# 将原来的 Gitea origin 重命名为 upstream -git remote rename origin upstream -git remote add origin "git@github.com:$GITHUB_USERNAME/gitea.git" -git fetch --all --prune -``` - -或者: - -```bash -# 为我们的 fork 添加新的远程 -git remote add "$FORK_NAME" "git@github.com:$GITHUB_USERNAME/gitea.git" -git fetch --all --prune -``` - -为了能够创建合并请求,应将分叉存储库添加为 Gitea 本地仓库的远程,否则无法推送更改。 - -## 构建 Gitea(基本) - -看看我们的 -[说明](installation/from-source.md) -关于如何[从源代码构建](installation/from-source.md) 。 - -从源代码构建的最简单推荐方法是: - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -`build` 目标将同时执行 `frontend` 和 `backend` 子目标。如果存在 `bindata` 标签,资源文件将被编译成二进制文件。建议在进行前端开发时省略 `bindata` 标签,以便实时反映更改。 - -有关所有可用的 `make` 目标,请参阅 `make help`。另请参阅 [`.drone.yml`](https://github.com/go-gitea/gitea/blob/main/.drone.yml) 以了解我们的持续集成是如何工作的。 - -## 持续构建 - -要在源文件更改时运行并持续构建: - -```bash -# 对于前端和后端 -make watch - -# 或者:只看前端文件(html/js/css) -make watch-frontend - -# 或者:只看后端文件 (go) -make watch-backend -``` - -在 macOS 上,监视所有后端源文件可能会达到默认的打开文件限制,这可以通过当前 shell 的 `ulimit -n 12288` 或所有未来 shell 的 shell 启动文件来增加。 - -### 格式化、代码分析和拼写检查 - -我们的持续集成将拒绝未通过代码检查(包括格式检查、代码分析和拼写检查)的 PR。 - -你应该格式化你的代码: - -```bash -make fmt -``` - -并检查源代码: - -```bash -# lint 前端和后端代码 -make lint -# 仅 lint 后端代码 -make lint-backend -``` - -**注意** :`gofmt` 的结果取决于 `go` 的版本。您应该运行与持续集成相同的 go 版本。 - -### 处理 JS 和 CSS - -前端开发应遵循 [Guidelines for Frontend Development](contributing/guidelines-frontend.md)。 - -要使用前端资源构建,请使用上面提到的“watch-frontend”目标或只构建一次: - -```bash -make build && ./gitea -``` - -在提交之前,确保 linters 通过: - -```bash -make lint-frontend -``` - -### 配置本地 ElasticSearch 实例 - -使用 docker 启动本地 ElasticSearch 实例: - -```sh -mkdir -p $(pwd) /data/elasticsearch -sudo chown -R 1000:1000 $(pwd) /data/elasticsearch -docker run --rm --memory= "4g" -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -v "$(pwd)/data /elasticsearch:/usr/share/elasticsearch/data" docker.elastic.co/elasticsearch/elasticsearch:7.16.3 -``` - -配置`app.ini`: - -```ini -[indexer] -ISSUE_INDEXER_TYPE = elasticsearch -ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 -REPO_INDEXER_ENABLED = true -REPO_INDEXER_TYPE = elasticsearch -REPO_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200 -``` - -### 构建和添加 SVGs - -SVG 图标是使用 `make svg` 命令构建的,该命令将图标资源编译到输出目录 `public/assets/img/svg` 中。可以在 `web_src/svg` 目录中添加自定义图标。 - -### 构建 Logo - -Gitea Logo的 PNG 和 SVG 版本是使用 `TAGS="gitea" make generate-images` 目标从单个 SVG 源文件 assets/logo.svg 构建的。要运行它,Node.js 和 npm 必须可用。 - -通过更新 `assets/logo.svg` 并运行 `make generate-images`,同样的过程也可用于从 SVG 源文件生成自定义 Logo PNG。忽略 gitea 编译选项将仅更新用户指定的 LOGO 文件。 - -### 更新 API - -创建新的 API 路由或修改现有的 API 路由时,您**必须** -更新和/或创建 [Swagger](https://swagger.io/docs/specification/2-0/what-is-swagger/) -这些使用 [go-swagger](https://goswagger.io/) 评论的文档。 -[规范]( https://goswagger.io/use/spec.html#annotation-syntax )中描述了这些注释的结构。 -如果您想了解更多有关 Swagger 结构的信息,可以查看 -[Swagger 2.0 文档](https://swagger.io/docs/specification/2-0/basic-structure/) -或与添加新 API 端点的先前 PR 进行比较,例如 [PR #5483](https://github.com/go-gitea/gitea/pull/5843/files#diff-2e0a7b644cf31e1c8ef7d76b444fe3aaR20) - -您应该注意不要破坏下游用户依赖的 API。在稳定的 API 上,一般来说添加是可以接受的,但删除 -或对 API 进行根本性更改将会被拒绝。 - -创建或更改 API 端点后,请用以下命令重新生成 Swagger 文档: - -```bash -make generate-swagger -``` - -您应该验证生成的 Swagger 文件: - -```bash -make swagger-validate -``` - -您应该提交更改后的 swagger JSON 文件。持续集成服务器将使用以下方法检查是否已完成: - -```bash -make swagger-check -``` - -**注意** :请注意,您应该使用 Swagger 2.0 文档,而不是 OpenAPI 3 文档。 - -### 创建新的配置选项 - -创建新的配置选项时,将它们添加到 `modules/setting` 的对应文件。您应该将信息添加到 `custom/conf/app.ini` -并到[配置备忘单](administration/config-cheat-sheet.md) -在 `docs/content/doc/advanced/config-cheat-sheet.zh-cn.md` 中找到 - -### 更改Logo - -更改 Gitea Logo SVG 时,您将需要运行并提交结果的: - -```bash -make generate-images -``` - -这将创建必要的 Gitea 图标和其他图标。 - -### 数据库迁移 - -如果您对数据库中的任何数据库持久结构进行重大更改 -`models/` 目录,您将需要进行新的迁移。可以找到这些 -在 `models/migrations/` 中。您可以确保您的迁移适用于主要 -数据库类型使用: - -```bash -make test-sqlite-migration # 将 SQLite 切换为适当的数据库 -``` - -## 测试 - -Gitea 运行两种类型的测试:单元测试和集成测试。 - -### 单元测试 - -`go test` 系统中的`*_test.go` 涵盖了单元测试。 -您可以设置环境变量 `GITEA_UNIT_TESTS_LOG_SQL=1` 以在详细模式下运行测试时显示所有 SQL 语句(即设置`GOTESTFLAGS=-v` 时)。 - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests -``` - -### 集成测试 - -单元测试不会也不能完全单独测试 Gitea。因此,我们编写了集成测试;但是,这些依赖于数据库。 - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build test-sqlite -``` - -将在 SQLite 环境中运行集成测试。集成测试需要安装 `git lfs`。其他数据库测试可用,但 -可能需要适应当地环境。 - -看看 [`tests/integration/README.md`](https://github.com/go-gitea/gitea/blob/main/tests/integration/README.md) 有关更多信息以及如何运行单个测试。 - -### 测试 PR - -我们的持续集成将测试代码是否通过了单元测试,并且所有支持的数据库都将在 Docker 环境中通过集成测试。 -还将测试从几个最新版本的 Gitea 迁移。 - -请在PR中附带提交适当的单元测试和集成测试。 - -## 网站文档 - -该网站的文档位于 `docs/` 中。如果你改变了文档内容,你可以使用以下测试方法进行持续集成: - -```bash -make lint-md -``` - -## Visual Studio Code - -`contrib/ide/vscode` 中为 Visual Studio Code 提供了 `launch.json` 和 `tasks.json`。查看 -[`contrib/ide/README.md`](https://github.com/go-gitea/gitea/blob/main/contrib/ide/README.md) 了解更多信息。 - -## Goland - -单击 `/main.go` 中函数 `func main()` 上的 `Run Application` 箭头 -可以快速启动一个可调试的 Gitea 实例。 - -`Run/Debug Configuration` 中的 `Output Directory` 必须设置为 -gitea 项目目录(包含 `main.go` 和 `go.mod`), -否则,启动实例的工作目录是 GoLand 的临时目录 -并防止 Gitea 在开发环境中加载动态资源(例如:模板)。 - -要在 GoLand 中使用 SQLite 运行单元测试,请设置 `-tags sqlite,sqlite_unlock_notify` -在 `运行/调试配置` 的 `Go 工具参数` 中。 - -## 提交 PR - -对更改感到满意后,将它们推送并打开拉取请求。它建议您允许 Gitea Managers 和 Owners 修改您的 PR -分支,因为我们需要在合并之前将其更新为 main 和/或可能是能够直接帮助解决问题。 - -任何 PR 都需要 Gitea 维护者的两次批准,并且需要通过持续集成。看看我们的 -[CONTRIBUTING.md](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md) -文档。 - -如果您需要更多帮助,请访问 [Discord](https://discord.gg/gitea) #Develop 频道 -并在那里聊天。 - -现在,您已准备好 Hacking Gitea。 diff --git a/docs/content/development/integrations.en-us.md b/docs/content/development/integrations.en-us.md deleted file mode 100644 index 66ea36243b..0000000000 --- a/docs/content/development/integrations.en-us.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -date: "2019-04-15T17:29:00+08:00" -title: "Integrations" -slug: "integrations" -sidebar_position: 65 -toc: false -draft: false -aliases: - - /en-us/integrations -menu: - sidebar: - parent: "development" - name: "Integrations" - sidebar_position: 65 - identifier: "integrations" ---- - -# Integrations - -Gitea has a wonderful community of third-party integrations, as well as first-class support in various other -projects. - -We are curating a list over at [awesome-gitea](https://gitea.com/gitea/awesome-gitea) to track these! - -If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops), -an [SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk), -or even some extra [themes](https://gitea.com/gitea/awesome-gitea#user-content-themes), -you can find them listed in the [awesome-gitea](https://gitea.com/gitea/awesome-gitea) repository! - -## Pre-Fill New File name and contents - -If you'd like to open a new file with a given name and contents, -you can do so with query parameters: - -```txt -GET /{{org}}/{{repo}}/_new/{{filepath}} - ?filename={{filename}} - &value={{content}} -``` - -For example: - -```txt -GET https://git.example.com/johndoe/bliss/_new/articles/ - ?filename=hello-world.md - &value=Hello%2C%20World! -``` diff --git a/docs/content/development/integrations.zh-cn.md b/docs/content/development/integrations.zh-cn.md deleted file mode 100644 index 0b8ca0d5a0..0000000000 --- a/docs/content/development/integrations.zh-cn.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -date: "2023-05-25T17:29:00+08:00" -title: "集成" -slug: "integrations" -sidebar_position: 65 -toc: false -draft: false -aliases: - - /zh-cn/integrations -menu: - sidebar: - parent: "development" - name: "集成" - sidebar_position: 65 - identifier: "integrations" ---- - -# 集成 - -Gitea拥有一个出色的第三方集成社区,以及在其他各种项目中的一流支持。 - -我们正在[awesome-gitea](https://gitea.com/gitea/awesome-gitea)上整理一个列表来跟踪这些集成! - -如果你正在寻找[CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops), -一个[SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk), -甚至一些额外的[主题](https://gitea.com/gitea/awesome-gitea#user-content-themes), -你可以在[awesome-gitea](https://gitea.com/gitea/awesome-gitea)中找到它们的列表! - -## 预填新文件名和内容 - -如果你想打开一个具有给定名称和内容的新文件, -你可以使用查询参数来实现: - -```txt -GET /{{org}}/{{repo}}/_new/{{filepath}} - ?filename={{filename}} - &value={{content}} -``` - -例如: - -```txt -GET https://git.example.com/johndoe/bliss/_new/articles/ - ?filename=hello-world.md - &value=Hello%2C%20World! -``` diff --git a/docs/content/development/migrations.en-us.md b/docs/content/development/migrations.en-us.md deleted file mode 100644 index 1e72f1b520..0000000000 --- a/docs/content/development/migrations.en-us.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -date: "2019-04-15T17:29:00+08:00" -title: "Migrations Interfaces" -slug: "migrations-interfaces" -sidebar_position: 55 -toc: false -draft: false -aliases: - - /en-us/migrations-interfaces -menu: - sidebar: - parent: "development" - name: "Migrations Interfaces" - sidebar_position: 55 - identifier: "migrations-interfaces" ---- - -# Migration Features - -Complete migrations were introduced in Gitea 1.9.0. It defines two interfaces to support migrating -repository data from other Git host platforms to Gitea or, in the future, migrating Gitea data to other Git host platforms. - -Currently, migrations from GitHub, GitLab, and other Gitea instances are implemented. - -First of all, Gitea defines some standard objects in packages [modules/migration](https://github.com/go-gitea/gitea/tree/main/modules/migration). -They are `Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`. - -## Downloader Interfaces - -To migrate from a new Git host platform, there are two steps to be updated. - -- You should implement a `Downloader` which will be used to get repository information. -- You should implement a `DownloaderFactory` which will be used to detect if the URL matches and create the above `Downloader`. - - You'll need to register the `DownloaderFactory` via `RegisterDownloaderFactory` on `init()`. - -You can find these interfaces in [downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go). - -## Uploader Interface - -Currently, only a `GiteaLocalUploader` is implemented, so we only save downloaded -data via this `Uploader` to the local Gitea instance. Other uploaders are not supported at this time. - -You can find these interfaces in [uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go). diff --git a/docs/content/development/migrations.zh-cn.md b/docs/content/development/migrations.zh-cn.md deleted file mode 100644 index 923be9046e..0000000000 --- a/docs/content/development/migrations.zh-cn.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -date: "2023-05-25T17:29:00+08:00" -title: "迁移界面" -slug: "migrations-interfaces" -sidebar_position: 55 -toc: false -draft: false -aliases: - - /zh-cn/migrations-interfaces -menu: - sidebar: - parent: "development" - name: "迁移界面" - sidebar_position: 55 - identifier: "migrations-interfaces" ---- - -# 迁移功能 - -完整迁移功能在Gitea 1.9.0版本中引入。它定义了两个接口,用于支持从其他Git托管平台迁移存储库数据到Gitea,或者在将来将Gitea数据迁移到其他Git托管平台。 - -目前已实现了从GitHub、GitLab和其他Gitea实例的迁移。 - -首先,Gitea在包[modules/migration](https://github.com/go-gitea/gitea/tree/main/modules/migration)中定义了一些标准对象。它们是`Repository`、`Milestone`、`Release`、`ReleaseAsset`、`Label`、`Issue`、`Comment`、`PullRequest`、`Reaction`、`Review`、`ReviewComment`。 - -## 下载器接口 - -要从新的Git托管平台迁移,需要进行两个步骤的更新。 - -- 您应该实现一个`Downloader`,用于获取存储库信息。 -- 您应该实现一个`DownloaderFactory`,用于检测URL是否匹配,并创建上述的`Downloader`。 - - 您需要在`init()`中通过`RegisterDownloaderFactory`注册`DownloaderFactory`。 - -您可以在[downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go)中找到这些接口。 - -## 上传器接口 - -目前,只实现了`GiteaLocalUploader`,因此我们只能通过此Uploader将下载的数据保存到本地的Gitea实例。目前不支持其他上传器。 - -您可以在[uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go)中找到这些接口。 diff --git a/docs/content/development/oauth2-provider.en-us.md b/docs/content/development/oauth2-provider.en-us.md deleted file mode 100644 index 54674f9246..0000000000 --- a/docs/content/development/oauth2-provider.en-us.md +++ /dev/null @@ -1,214 +0,0 @@ ---- -date: "2023-06-01T08:40:00+08:00" -title: "OAuth2 provider" -slug: "oauth2-provider" -sidebar_position: 41 -toc: false -draft: false -aliases: - - /en-us/oauth2-provider -menu: - sidebar: - parent: "development" - name: "OAuth2 Provider" - sidebar_position: 41 - identifier: "oauth2-provider" ---- - -# OAuth2 provider - -Gitea supports acting as an OAuth2 provider to allow third party applications to access its resources with the user's consent. This feature is available since release 1.8.0. - -## Endpoints - -| Endpoint | URL | -| ------------------------ | ----------------------------------- | -| OpenID Connect Discovery | `/.well-known/openid-configuration` | -| Authorization Endpoint | `/login/oauth/authorize` | -| Access Token Endpoint | `/login/oauth/access_token` | -| OpenID Connect UserInfo | `/login/oauth/userinfo` | -| JSON Web Key Set | `/login/oauth/keys` | - -## Supported OAuth2 Grants - -At the moment Gitea only supports the [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) standard with additional support of the following extensions: - -- [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636) -- [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) - -To use the Authorization Code Grant as a third party application it is required to register a new application via the "Settings" (`/user/settings/applications`) section of the settings. To test or debug you can use the web-tool https://oauthdebugger.com/. - -## Scopes - -Gitea supports scoped access tokens, which allow users the ability to restrict tokens to operate only on selected url routes. Scopes are grouped by high-level API routes, and further refined to the following: - -- `read`: `GET` routes -- `write`: `POST`, `PUT`, `PATCH`, and `DELETE` routes (in addition to `GET`) - -Gitea token scopes are as follows: - -| Name | Description | -| ---- |------------------------------------------------------------------------------------------------------------------------------------------------------| -| **(no scope)** | Not supported. A scope is required even for public repositories. | -| **activitypub** | `activitypub` API routes: ActivityPub related operations. | -| **read:activitypub** | Grants read access for ActivityPub operations. | -| **write:activitypub** | Grants read/write/delete access for ActivityPub operations. | -| **admin** | `/admin/*` API routes: Site-wide administrative operations (hidden for non-admin accounts). | -| **read:admin** | Grants read access for admin operations, such as getting cron jobs or registered user emails. | -| **write:admin** | Grants read/write/delete access for admin operations, such as running cron jobs or updating user accounts. | -| **issue** | `issues/*`, `labels/*`, `milestones/*` API routes: Issue-related operations. | -| **read:issue** | Grants read access for issues operations, such as getting issue comments, issue attachments, and milestones. | -| **write:issue** | Grants read/write/delete access for issues operations, such as posting or editing an issue comment or attachment, and updating milestones. | -| **misc** | Reserved for future usage. | -| **read:misc** | Reserved for future usage. | -| **write:misc** | Reserved for future usage. | -| **notification** | `notification/*` API routes: user notification operations. | -| **read:notification** | Grants read access to user notifications, such as which notifications users are subscribed to and read new notifications. | -| **write:notification** | Grants read/write/delete access to user notifications, such as marking notifications as read. | -| **organization** | `orgs/*` and `teams/*` API routes: Organization and team management operations. | -| **read:organization** | Grants read access to org and team status, such as listing all orgs a user has visibility to, teams, and team members. | -| **write:organization** | Grants read/write/delete access to org and team status, such as creating and updating teams and updating org settings. | -| **package** | `/packages/*` API routes: Packages operations | -| **read:package** | Grants read access to package operations, such as reading and downloading available packages. | -| **write:package** | Grants read/write/delete access to package operations. Currently the same as `read:package`. | -| **repository** | `/repos/*` API routes except `/repos/issues/*`: Repository file, pull-request, and release operations. | -| **read:repository** | Grants read access to repository operations, such as getting repository files, releases, collaborators. | -| **write:repository** | Grants read/write/delete access to repository operations, such as getting updating repository files, creating pull requests, updating collaborators. | -| **user** | `/user/*` and `/users/*` API routes: User-related operations. | -| **read:user** | Grants read access to user operations, such as getting user repo subscriptions and user settings. | -| **write:user** | Grants read/write/delete access to user operations, such as updating user repo subscriptions, followed users, and user settings. | - -## Pre-configured Applications - -Gitea creates OAuth applications for the following services by default on startup, as we assume that these are universally useful. - -|Application|Description|Client ID| -|-----------|-----------|---------| -|[git-credential-oauth](https://github.com/hickford/git-credential-oauth)|Git credential helper|`a4792ccc-144e-407e-86c9-5e7d8d9c3269`| -|[Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager)|Git credential helper|`e90ee53c-94e2-48ac-9358-a874fb9e0662`| -|[tea](https://gitea.com/gitea/tea)|tea|`d57cb8c4-630c-4168-8324-ec79935e18d4`| - -To prevent unexpected behavior, they are being displayed as locked in the UI and their creation can instead be controlled by the `DEFAULT_APPLICATIONS` parameter in `app.ini`. - -## Client types - -Gitea supports both confidential and public client types, [as defined by RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1). - -For public clients, a redirect URI of a loopback IP address such as `http://127.0.0.1/` allows any port. Avoid using `localhost`, [as recommended by RFC 8252](https://datatracker.ietf.org/doc/html/rfc8252#section-8.3). - -## Examples - -### Confidential client - -**Note:** This example does not use PKCE. - -1. Redirect the user to the authorization endpoint in order to get their consent for accessing the resources: - - ```curl - https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&state=STATE - ``` - - The `CLIENT_ID` can be obtained by registering an application in the settings. The `STATE` is a random string that will be sent back to your application after the user authorizes. The `state` parameter is optional, but should be used to prevent CSRF attacks. - - ![Authorization Page](/authorize.png) - - The user will now be asked to authorize your application. If they authorize it, the user will be redirected to the `REDIRECT_URL`, for example: - - ```curl - https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE - ``` - -2. Using the provided `code` from the redirect, you can request a new application and refresh token. The access token endpoint accepts POST requests with `application/json` and `application/x-www-form-urlencoded` body, for example: - - ```curl - POST https://[YOUR-GITEA-URL]/login/oauth/access_token - ``` - - ```json - { - "client_id": "YOUR_CLIENT_ID", - "client_secret": "YOUR_CLIENT_SECRET", - "code": "RETURNED_CODE", - "grant_type": "authorization_code", - "redirect_uri": "REDIRECT_URI" - } - ``` - - Response: - - ```json - { - "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug", - "token_type": "bearer", - "expires_in": 3600, - "refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw" - } - ``` - - The `CLIENT_SECRET` is the unique secret code generated for this application. Please note that the secret will only be visible after you created/registered the application with Gitea and cannot be recovered. If you lose the secret, you must regenerate the secret via the application's settings. - - The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request. - -3. Use the `access_token` to make [API requests](development/api-usage.md#oauth2-provider) to access the user's resources. - -### Public client (PKCE) - -PKCE (Proof Key for Code Exchange) is an extension to the OAuth flow which allows for a secure credential exchange without the requirement to provide a client secret. - -**Note**: Please ensure you have registered your OAuth application as a public client. - -To achieve this, you have to provide a `code_verifier` for every authorization request. A `code_verifier` has to be a random string with a minimum length of 43 characters and a maximum length of 128 characters. It can contain alphanumeric characters as well as the characters `-`, `.`, `_` and `~`. - -Using this `code_verifier` string, a new one called `code_challenge` is created by using one of two methods: - -- If you have the required functionality on your client, set `code_challenge` to be a URL-safe base64-encoded string of the SHA256 hash of `code_verifier`. In that case, your `code_challenge_method` becomes `S256`. -- If you are unable to do so, you can provide your `code_verifier` as a plain string to `code_challenge`. Then you have to set your `code_challenge_method` as `plain`. - -After you have generated this values, you can continue with your request. - -1. Redirect the user to the authorization endpoint in order to get their consent for accessing the resources: - - ```curl - https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&code_challenge_method=CODE_CHALLENGE_METHOD&code_challenge=CODE_CHALLENGE&state=STATE - ``` - - The `CLIENT_ID` can be obtained by registering an application in the settings. The `STATE` is a random string that will be sent back to your application after the user authorizes. The `state` parameter is optional, but should be used to prevent CSRF attacks. - - ![Authorization Page](/authorize.png) - - The user will now be asked to authorize your application. If they authorize it, the user will be redirected to the `REDIRECT_URL`, for example: - - ```curl - https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE - ``` - -2. Using the provided `code` from the redirect, you can request a new application and refresh token. The access token endpoint accepts POST requests with `application/json` and `application/x-www-form-urlencoded` body, for example: - - ```curl - POST https://[YOUR-GITEA-URL]/login/oauth/access_token - ``` - - ```json - { - "client_id": "YOUR_CLIENT_ID", - "code": "RETURNED_CODE", - "grant_type": "authorization_code", - "redirect_uri": "REDIRECT_URI", - "code_verifier": "CODE_VERIFIER", - } - ``` - - Response: - - ```json - { - "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug", - "token_type": "bearer", - "expires_in": 3600, - "refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw" - } - ``` - - The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request. - -3. Use the `access_token` to make [API requests](development/api-usage.md#oauth2-provider) to access the user's resources. diff --git a/docs/content/development/oauth2-provider.zh-cn.md b/docs/content/development/oauth2-provider.zh-cn.md deleted file mode 100644 index 80d8469414..0000000000 --- a/docs/content/development/oauth2-provider.zh-cn.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -date: "2019-04-19:44:00+01:00" -title: "OAuth2 提供者" -slug: "oauth2-provider" -sidebar_position: 41 -toc: false -draft: false -aliases: - - /zh-cn/oauth2-provider -menu: - sidebar: - parent: "development" - name: "OAuth2 提供者" - sidebar_position: 41 - identifier: "oauth2-provider" ---- - -# OAuth2 提供者 - -Gitea 支持作为 OAuth2 提供者,允许第三方应用程序在用户同意的情况下访问其资源。此功能自 1.8.0 版起可用。 - -## 端点 - -| 端点 | URL | -| ------------------------ | ----------------------------------- | -| OpenID Connect Discovery | `/.well-known/openid-configuration` | -| Authorization Endpoint | `/login/oauth/authorize` | -| Access Token Endpoint | `/login/oauth/access_token` | -| OpenID Connect UserInfo | `/login/oauth/userinfo` | -| JSON Web Key Set | `/login/oauth/keys` | - -## 支持的 OAuth2 授权 - -目前 Gitea 仅支持 [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) 标准,并额外支持以下扩展: - -- [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636) -- [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) - -要将 Authorization Code Grant 作为第三方应用程序,您需要通过在设置中添加一个新的 "应用程序" (`/user/settings/applications`)。 - -## 范围 - -Gitea 支持以下令牌范围: - -| 名称 | 介绍 | -| ---- | ----------- | -| **(no scope)** | 授予对公共用户配置文件和公共存储库的只读访问权限 | -| **repo** | 完全控制所有存储库 | -| **repo:status** | 授予对所有存储库中提交状态的读/写访问权限 | -| **public_repo** | 仅授予对公共存储库的读/写访问权限 | -| **admin:repo_hook** | 授予对所有存储库的 Hooks 访问权限,该权限已包含在 `repo` 范围中 | -| **write:repo_hook** | 授予对存储库 Hooks 的读/写访问权限 | -| **read:repo_hook** | 授予对存储库 Hooks 的只读访问权限 | -| **admin:org** | 授予对组织设置的完全访问权限 | -| **write:org** | 授予对组织设置的读/写访问权限 | -| **read:org** | 授予对组织设置的只读访问权限 | -| **admin:public_key** | 授予公钥管理的完全访问权限 | -| **write:public_key** | 授予对公钥的读/写访问权限 | -| **read:public_key** | 授予对公钥的只读访问权限 | -| **admin:org_hook** | 授予对组织级别 Hooks 的完全访问权限 | -| **admin:user_hook** | 授予对用户级别 Hooks 的完全访问权限 | -| **notification** | 授予对通知的完全访问权限 | -| **user** | 授予对用户个人资料信息的完全访问权限 | -| **read:user** | 授予对用户个人资料的读取权限 | -| **user:email** | 授予对用户电子邮件地址的读取权限 | -| **user:follow** | 授予访问权限以关注/取消关注用户 | -| **delete_repo** | 授予删除存储库的权限 | -| **package** | 授予对托管包的完全访问权限 | -| **write:package** | 授予对包的读/写访问权限 | -| **read:package** | 授予对包的读取权限 | -| **delete:package** | 授予对包的删除权限 | -| **admin:gpg_key** | 授予 GPG 密钥管理的完全访问权限 | -| **write:gpg_key** | 授予对 GPG 密钥的读/写访问权限 | -| **read:gpg_key** | 授予对 GPG 密钥的只读访问权限 | -| **admin:application** | 授予应用程序管理的完全访问权限 | -| **write:application** | 授予应用程序管理的读/写访问权限 | -| **read:application** | 授予应用程序管理的读取权限 | -| **sudo** | 允许以站点管理员身份执行操作 | - -## 客户端类型 - -Gitea 支持私密和公共客户端类型,[参见 RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1). - -对于公共客户端, 允许在本地回环地址的重定向 URI 中使用任意端口,例如 `http://127.0.0.1/`。根据 [RFC 8252 的建议](https://datatracker.ietf.org/doc/html/rfc8252#section-8.3),请避免使用 `localhost`。 - -## 示例 - -**注意:** 该示例中尚未使用 PKCE。 - -1. 将用户重定向到授权端点,以获得他们的访问资源授权: - - ```curl - https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE - ``` - - 在设置中注册应用程序以获得 `CLIENT_ID`。`STATE` 是一个随机字符串,它将在获得用户授权后发送回您的应用程序。`state` 参数是可选的,但您应该使用它来防止 CSRF 攻击。 - - ![Authorization Page](/authorize.png) - - 用户将会被询问是否授权给您的应用程序。如果他们同意了授权,用户将会被重定向到 `REDIRECT_URL`,例如: - - ```curl - https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE - ``` - -2. 使用重定向提供的 `code`,您可以请求一个新的应用程序和 Refresh Token。Access Token Endpoint 接受 `application/json` 或 `application/x-www-form-urlencoded` 类型的 POST 请求,例如: - - ```curl - POST https://[YOUR-GITEA-URL]/login/oauth/access_token - ``` - - ```json - { - "client_id": "YOUR_CLIENT_ID", - "client_secret": "YOUR_CLIENT_SECRET", - "code": "RETURNED_CODE", - "grant_type": "authorization_code", - "redirect_uri": "REDIRECT_URI" - } - ``` - - 返回: - - ```json - { - "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug", - "token_type": "bearer", - "expires_in": 3600, - "refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw" - } - ``` - - `CLIENT_SECRET` 是生成给应用程序的唯一密钥。请注意,该密钥只会在您使用 Gitea 创建/注册应用程序后出现一次。如果您丢失了密钥,您必须在应用程序设置中重新生成密钥。 - - `access_token` 请求中的 `REDIRECT_URI` 必须与 `authorize` 请求中的 `REDIRECT_URI` 相符。 - -3. 使用 `access_token` 来构造 [API 请求](development/api-usage.md#oauth2-provider) 以读写用户的资源。 diff --git a/docs/content/help.en-us.md b/docs/content/help.en-us.md deleted file mode 100644 index 5a7f4a42bc..0000000000 --- a/docs/content/help.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-01-20T15:00:00+08:00" -title: "Help" -slug: "help" -sidebar_position: 5 -toc: false -draft: false -menu: - sidebar: - name: "Help" - sidebar_position: 100 - identifier: "help" ---- diff --git a/docs/content/help.zh-cn.md b/docs/content/help.zh-cn.md deleted file mode 100644 index 60b63bc28a..0000000000 --- a/docs/content/help.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2017-01-20T15:00:00+08:00" -title: "帮助" -slug: "help" -sidebar_position: 5 -toc: false -draft: false -menu: - sidebar: - name: "帮助" - sidebar_position: 100 - identifier: "help" ---- diff --git a/docs/content/help/_index.en-us.md b/docs/content/help/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/help/_index.en-us.md +++ /dev/null diff --git a/docs/content/help/_index.zh-cn.md b/docs/content/help/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/help/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/help/faq.en-us.md b/docs/content/help/faq.en-us.md deleted file mode 100644 index 5ea2c10f5e..0000000000 --- a/docs/content/help/faq.en-us.md +++ /dev/null @@ -1,443 +0,0 @@ ---- -date: "2019-04-05T16:00:00+02:00" -title: "FAQ" -slug: "faq" -sidebar_position: 5 -toc: false -draft: false -aliases: - - /en-us/faq -menu: - sidebar: - parent: "help" - name: "FAQ" - sidebar_position: 5 - identifier: "faq" ---- - -# Frequently Asked Questions - -This page contains some common questions and answers. - -For more help resources, check all [Support Options](help/support.md). - -## Difference between 1.x and 1.x.x downloads, how can I get latest stable release with bug fixes? - -Version 1.20.x will be used for this example. - -On our [downloads page](https://dl.gitea.com/gitea/) you will see a 1.20 directory, as well as directories for 1.20.0, 1.20.1. - -The 1.20 directory is the nightly build, which is built on each merged commit to the [`release/v1.20`](https://github.com/go-gitea/gitea/tree/release/v1.20) branch. - -The 1.20.0 directory is a release build that was created when the [`v1.20.0`](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) tag was created. - -The nightly builds (1.x) downloads will change as commits are merged to their respective branch, they contain the latest changes/fixes before a tag release is built. - -If a bug fix is targeted on 1.20.1 but 1.20.1 is not released yet, you can get the "1.20-nightly" build to get the bug fix. - -## How to migrate from Gogs/GitHub/etc. to Gitea - -To migrate from Gogs to Gitea: - -- [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) - -To migrate from GitHub to Gitea, you can use Gitea's built-in migration form. - -In order to migrate items such as issues, pull requests, etc. you will need to input at least your username. - -[Example (requires login)](https://try.gitea.io/repo/migrate) - -To migrate from GitLab to Gitea, you can use this non-affiliated tool: - -https://github.com/loganinak/MigrateGitlabToGogs - -## Where does Gitea store what file - -- _`AppWorkPath`_ - - The `WORK_PATH` option in `app.ini` - - Else the `--work-path` flag - - Else Environment variable `GITEA_WORK_DIR` - - Else a built-in value set at build time - - Else the directory that contains the Gitea binary -- `AppDataPath` (default for database, indexers, etc.) - - `APP_DATA_PATH` from `app.ini` - - Else _`AppWorkPath`_`/data` -- _`CustomPath`_ (custom templates) - - The `--custom-path` flag - - Else Environment variable `GITEA_CUSTOM` - - Else a built-in value set at build time - - Else _`AppWorkPath`_`/custom` -- HomeDir - - Unix: Environment variable `HOME` - - Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH` -- RepoRootPath - - `ROOT` in the \[repository] section of `app.ini` if absolute - - Else _`AppWorkPath`_`/ROOT` if `ROOT` in the \[repository] section of `app.ini` if relative - - Default `%(APP_DATA_PATH)/gitea-repositories` -- INI (config file) - - `--config` flag - - A possible built-in value set a build time - - Else _`CustomPath`_`/conf/app.ini` -- SQLite Database - - `PATH` in `database` section of `app.ini` - - Else `%(APP_DATA_PATH)/gitea.db` - -## Not seeing a clone URL or the clone URL being incorrect - -There are a few places that could make this show incorrectly. - -1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide](administration/reverse-proxies.md) -2. Make sure you have correctly set `ROOT_URL` in the `server` section of your `app.ini` - -If certain clone options aren't showing up (HTTP/S or SSH), the following options can be checked in your `app.ini` - -- `DISABLE_HTTP_GIT`: if set to true, there will be no HTTP/HTTPS link -- `DISABLE_SSH`: if set to true, there will be no SSH link -- `SSH_EXPOSE_ANONYMOUS`: if set to false, SSH links will be hidden for anonymous users - -## File upload fails with: 413 Request Entity Too Large - -This error occurs when the reverse proxy limits the file upload size. - -See the [reverse proxy guide](administration/reverse-proxies.md) for a solution with nginx. - -## Custom Templates not loading or working incorrectly - -Gitea's custom templates must be added to the correct location or Gitea will not find and use them. - -The correct path for the template(s) will be relative to the `CustomPath` - -1. To find `CustomPath`, look for Custom File Root Path in Site Administration -> Configuration -2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-what-file) -3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea](administration/customizing-gitea.md) page to add your template to the correct location. - -## Does Gitea have a "GitHub/GitLab pages" feature? - -Gitea doesn't provide a built-in Pages server. You need a dedicated domain to serve static pages to avoid CSRF security risks. - -For simple usage, you can use a reverse proxy to rewrite & serve static contents from Gitea's raw file URLs. - -And there are already available third-party services, like a standalone [pages server](https://codeberg.org/Codeberg/pages-server) or a [caddy plugin](https://github.com/42wim/caddy-gitea), that can provide the required functionality. - -## Active user vs login prohibited user - -In Gitea, an "active" user refers to a user that has activated their account via email. - -A "login prohibited" user is a user that is not allowed to log in to Gitea anymore - -## Setting up logging - -- [Official Docs](administration/logging-config.md) - -## What is Swagger? - -[Swagger](https://swagger.io/) is what Gitea uses for its API documentation. - -All Gitea instances have the built-in API and there is no way to disable it completely. -You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`. -For more information, refer to Gitea's [API docs](development/api-usage.md). - -You can see the latest API (for example) on https://try.gitea.io/api/swagger - -You can also see an example of the `swagger.json` file at https://try.gitea.io/swagger.v1.json - -## Adjusting your server for public/private use - -### Preventing spammers - -There are multiple things you can combine to prevent spammers. - -1. By whitelisting or blocklisting certain email domains -2. By only whitelisting certain domains with OpenID (see below) -3. Setting `ENABLE_CAPTCHA` to `true` in your `app.ini` and properly configuring `RECAPTCHA_SECRET` and `RECAPTCHA_SITEKEY` -4. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI](administration/command-line.md), [API](development/api-usage.md), or Gitea's Admin UI - -### Only allow/block certain email domains - -You can configure `EMAIL_DOMAIN_WHITELIST` or `EMAIL_DOMAIN_BLOCKLIST` in your app.ini under `[service]` - -### Only allow/block certain OpenID providers - -You can configure `WHITELISTED_URIS` or `BLACKLISTED_URIS` under `[openid]` in your `app.ini` - -**NOTE:** whitelisted takes precedence, so if it is non-blank then blacklisted is ignored - -### Issue only users - -The current way to achieve this is to create/modify a user with a max repo creation limit of 0. - -### Restricted users - -Restricted users are limited to a subset of the content based on their organization/team memberships and collaborations, ignoring the public flag on organizations/repos etc.\_\_ - -Example use case: A company runs a Gitea instance that requires login. Most repos are public (accessible/browsable by all co-workers). - -At some point, a customer or third party needs access to a specific repo and only that repo. Making such a customer account restricted and granting any needed access using team membership(s) and/or collaboration(s) is a simple way to achieve that without the need to make everything private. - -### Enable Fail2ban - -Use [Fail2Ban](administration/fail2ban-setup.md) to monitor and stop automated login attempts or other malicious behavior based on log patterns - -## How to add/use custom themes - -Gitea supports three official themes right now, `gitea-light`, `gitea-dark`, and `gitea-auto` (automatically switches between the previous two depending on operating system settings). -To add your own theme, currently the only way is to provide a complete theme (not just color overrides) - -As an example, let's say our theme is `arc-blue` (this is a real theme, and can be found [in this issue](https://github.com/go-gitea/gitea/issues/6011)) - -Name the `.css` file `theme-arc-blue.css` and add it to your custom folder in `custom/public/assets/css` - -Allow users to use it by adding `arc-blue` to the list of `THEMES` in your `app.ini` - -## SSHD vs built-in SSH - -SSHD is the built-in SSH server on most Unix systems. - -Gitea also provides its own SSH server, for usage when SSHD is not available. - -## Gitea is running slow - -The most common culprit for this is loading federated avatars. - -This can be turned off by setting `ENABLE_FEDERATED_AVATAR` to `false` in your `app.ini` - -Another option that may need to be changed is setting `DISABLE_GRAVATAR` to `true` in your `app.ini` - -## Can't create repositories/files - -Make sure that Gitea has sufficient permissions to write to its home directory and data directory. - -See [AppDataPath and RepoRootPath](#where-does-gitea-store-what-file) - -**Note for Arch users:** At the time of writing this, there is an issue with the Arch package's systemd file including this line: - -`ReadWritePaths=/etc/gitea/app.ini` - -Which makes all other paths non-writeable to Gitea. - -## Translation is incorrect/how to add more translations - -Our translations are currently crowd-sourced on our [Crowdin project](https://crowdin.com/project/gitea) - -Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration. - -## Push Hook / Webhook aren't running - -If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook, there are a few possibilities: - -1. The git hooks are out of sync: run "Resynchronize pre-receive, update and post-receive hooks of all repositories" on the site admin panel -2. The git repositories (and hooks) are stored on some filesystems (ex: mounted by NAS) which don't support script execution, make sure the filesystem supports `chmod a+x any-script` -3. If you are using docker, make sure Docker Server (not the client) >= 20.10.6 - -## SSH issues - -If you cannot reach repositories over `ssh`, but `https` works fine, consider looking into the following. - -First, make sure you can access Gitea via SSH. - -`ssh git@myremote.example` - -If the connection is successful, you should receive an error message like the following: - -``` -Hi there, You've successfully authenticated, but Gitea does not provide shell access. -If this is unexpected, please log in with password and setup Gitea under another user. -``` - -If you do not get the above message but still connect, it means your SSH key is **not** being managed by Gitea. This means hooks won't run, among other potential problems. - -If you cannot connect at all, your SSH key may not be configured correctly locally. -This is specific to SSH and not Gitea, so will not be covered here. - -### SSH Common Errors - -``` -Permission denied (publickey). -fatal: Could not read from remote repository. -``` - -This error signifies that the server rejected a log in attempt, check the -following things: - -- On the client: - - Ensure the public and private ssh keys are added to the correct Gitea user. - - Make sure there are no issues in the remote url. In particular, ensure the name of the - Git user (before the `@`) is spelled correctly. - - Ensure public and private ssh keys are correct on client machine. -- On the server: - - Make sure the repository exists and is correctly named. - - Check the permissions of the `.ssh` directory in the system user's home directory. - - Verify that the correct public keys are added to `.ssh/authorized_keys`. - - Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the - Gitea admin panel. - - Read Gitea logs. - - Read /var/log/auth (or similar). - - Check permissions of repositories. - -The following is an example of a missing public SSH key where authentication -succeeded, but some other setting is preventing SSH from reaching the correct -repository. - -``` -fatal: Could not read from remote repository. - -Please make sure you have the correct access rights -and the repository exists. -``` - -In this case, look into the following settings: - -- On the server: - - Make sure that the `git` system user has a usable shell set - - Verify this with `getent passwd git | cut -d: -f7` - - `usermod` or `chsh` can be used to modify this. - - Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the - correct configuration file. - -## Missing releases after migrating repository with tags - -To migrate an repository _with_ all tags, you need to do two things: - -- Push tags to the repository: - -``` - git push --tags -``` - -- (Re-)sync tags of all repositories within Gitea: - -``` -gitea admin repo-sync-releases -``` - -## LFS Issues - -For issues concerning LFS data upload - -``` -batch response: Authentication required: Authorization error: <GITEA_LFS_URL>/info/lfs/objects/batch -Check that you have proper access to the repository -error: failed to push some refs to '<GIT_REPO_URL>' -``` - -Check the value of `LFS_HTTP_AUTH_EXPIRY` in your `app.ini` file. - -By default, your LFS token will expire after 20 minutes. If you have a slow connection or a large file (or both), it may not finish uploading within the time limit. - -You may want to set this value to `60m` or `120m`. - -## How can I create users before starting Gitea - -Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands](administration/command-line.md#admin) to add users like normal. - -## How can I enable password reset - -There is no setting for password resets. It is enabled when a [mail service](administration/email-setup.md) is configured, and disabled otherwise. - -## How can a user's password be changed - -- As an **admin**, you can change any user's password (and optionally force them to change it on next login)... - - By navigating to your `Site Administration -> User Accounts` page and editing a user. - - By using the [admin CLI commands](administration/command-line.md#admin). - - Keep in mind most commands will also need a [global flag](administration/command-line.md#global-options) to point the CLI at the correct configuration. -- As a **user** you can change it... - - In your account `Settings -> Account` page (this method **requires** you to know your current password). - - By using the `Forgot Password` link. - - If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service](administration/email-setup.md). - -## Why is my markdown broken - -In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant. - -If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax. - -If it is the latter, _usually_ there is a compliant alternative listed in the spec. - -## Upgrade errors with MySQL - -If you are receiving errors on upgrade of Gitea using MySQL that read: - -> `ORM engine initialization failed: migrate: do migrate: Error: 1118: Row size too large...` - -Please run `gitea doctor convert` or run `ALTER TABLE table_name ROW_FORMAT=dynamic;` for each table in the database. - -The underlying problem is that the space allocated for indices by the default row format -is too small. Gitea requires that the `ROWFORMAT` for its tables is `DYNAMIC`. - -If you are receiving an error line containing `Error 1071: Specified key was too long; max key length is 1000 bytes...` -then you are attempting to run Gitea on tables which use the ISAM engine. While this may have worked by chance in previous versions of Gitea, it has never been officially supported and -you must use InnoDB. You should run `ALTER TABLE table_name ENGINE=InnoDB;` for each table in the database. - -## Why are Emoji displaying only as placeholders or in monochrome - -Gitea requires the system or browser to have one of the supported Emoji fonts installed, which are Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji and Twemoji Mozilla. Generally, the operating system should already provide one of these fonts, but especially on Linux, it may be necessary to install them manually. - -## Initial logging - -Before Gitea has read the configuration file and set-up its logging it will log a number of things to stdout in order to help debug things if logging does not work. - -You can stop this logging by setting the `--quiet` or `-q` option. Please note this will only stop logging until Gitea has set-up its own logging. - -If you report a bug or issue you MUST give us logs with this information restored. - -You should only set this option once you have completely configured everything. - -## Warnings about struct defaults during database startup - -Sometimes when there are migrations the old columns and default values may be left -unchanged in the database schema. This may lead to warning such as: - -``` -2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0 -``` - -These can safely be ignored, but you are able to stop these warnings by getting Gitea to recreate these tables using: - -``` -gitea doctor recreate-table user -``` - -This will cause Gitea to recreate the user table and copy the old data into the new table -with the defaults set appropriately. - -You can ask Gitea to recreate multiple tables using: - -``` -gitea doctor recreate-table table1 table2 ... -``` - -And if you would like Gitea to recreate all tables simply call: - -``` -gitea doctor recreate-table -``` - -It is highly recommended to back-up your database before running these commands. - -## How to adopt repositories from disk - -- Add your (bare) repositories to the correct spot for your configuration (`repository.ROOT`), ensuring they are in the correct layout `<REPO_ROOT>/[user]/[repo].git`. - - **Note:** the directory names must be lowercase. - - You can also check `<ROOT_URL>/admin/config` for the repository root path. -- Ensure that the user/org exists that you want to adopt repositories for. -- As an admin, go to `<ROOT_URL>/admin/repos/unadopted` and search. - - Users can also be given similar permissions via config [`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`](administration/config-cheat-sheet.md#repository). -- If the above steps are done correctly, you should be able to select repositories to adopt. - - If no repositories are found, enable [debug logging](administration/config-cheat-sheet.md#repository) to check for any specific errors. - -## Gitea can't start on NFS - -In most cases, it's caused by broken NFS lock system. You can try to stop Gitea process and -run `flock -n /data-nfs/gitea/queues/LOCK echo 'lock acquired'` to see whether the lock can be acquired immediately. -If the lock can't be acquired, NFS might report some errors like `lockd: cannot monitor node-3, statd: server rpc.statd not responding, timed out` in its server logs. - -Then the NFS lock could be reset by: - -```bash -# /etc/init.d/nfs stop -# rm -rf /var/lib/nfs/sm/* -# /etc/init.d/nfs start -``` diff --git a/docs/content/help/faq.zh-cn.md b/docs/content/help/faq.zh-cn.md deleted file mode 100644 index b8dd3cd180..0000000000 --- a/docs/content/help/faq.zh-cn.md +++ /dev/null @@ -1,447 +0,0 @@ ---- -date: "2023-05-25T16:00:00+02:00" -title: "常见问题" -slug: "faq" -sidebar_position: 5 -toc: false -draft: false -aliases: - - /zh-cn/faq -menu: - sidebar: - parent: "help" - name: "常见问题" - sidebar_position: 5 - identifier: "faq" ---- - -# 常见问题 - -本页面包含一些常见问题和答案。 - -有关更多帮助资源,请查看所有[支持选项](help/support.md)。 - -## 1.x和1.x.x下载之间的区别 - -以1.7.x版本为例。 - -**注意:**此示例也适用于Docker镜像! - -在我们的[下载页面](https://dl.gitea.com/gitea/)上,您会看到一个1.7目录,以及1.7.0、1.7.1、1.7.2、1.7.3、1.7.4、1.7.5和1.7.6的目录。 - -1.7目录和1.7.0目录是**不同**的。1.7目录是在每个合并到[`release/v1.7`](https://github.com/go-gitea/gitea/tree/release/v1.7)分支的提交上构建的。 - -然而,1.7.0目录是在创建[`v1.7.0`](https://github.com/go-gitea/gitea/releases/tag/v1.7.0)标签时创建的构建。 - -这意味着1.x的下载会随着提交合并到各自的分支而改变(将其视为每个版本的单独的“main”分支)。 - -另一方面,1.x.x的下载应该永远不会改变。 - -## 如何从Gogs/GitHub等迁移到Gitea - -要从Gogs迁移到Gitea: - -- [Gogs版本0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286) - -要从GitHub迁移到Gitea,您可以使用Gitea内置的迁移表单。 - -为了迁移诸如问题、拉取请求等项目,您需要至少输入您的用户名。 - -[Example (requires login)](https://try.gitea.io/repo/migrate) - -要从GitLab迁移到Gitea,您可以使用这个非关联的工具: - -https://github.com/loganinak/MigrateGitlabToGogs - -## Gitea存储文件的位置 - -- _`AppWorkPath`_ - - `--work-path`标志 - - 或者环境变量`GITEA_WORK_DIR` - - 或者在构建时设置的内置值 - - 或者包含Gitea二进制文件的目录 -- `%(APP_DATA_PATH)`(数据库、索引器等的默认路径) - - `app.ini`中的`APP_DATA_PATH` - - 或者_`AppWorkPath`_`/data` -- _`CustomPath`_(自定义模板) - - `--custom-path`标志 - - 或者环境变量`GITEA_CUSTOM` - - 或者在构建时设置的内置值 - - 或者_`AppWorkPath`_`/custom` -- HomeDir - - Unix:环境变量`HOME` - - Windows:环境变量`USERPROFILE`,或者环境变量`HOMEDRIVE`+`HOMEPATH` -- RepoRootPath - - `app.ini`中\[repository]部分的`ROOT`(如果是绝对路径) - - 否则_`AppWorkPath`_`/ROOT`(如果`app.ini`中\[repository]部分的`ROOT`是相对路径) - - 默认值为`%(APP_DATA_PATH)/gitea-repositories` -- INI(配置文件) - - `--config`标志 - - 或者在构建时设置的可能内置值 - - 或者 _`CustomPath`_`/conf/app.ini` -- SQLite数据库 - - app.ini中database部分的PATH - - 或者`%(APP_DATA_PATH)/gitea.db` - -## 看不到克隆URL或克隆URL不正确 - -有几个地方可能会导致显示不正确。 - -1. 如果使用反向代理,请确保按照[反向代理指南](administration/reverse-proxies.md)中的正确说明进行设置。 -2. 确保在`app.ini`的`server`部分中正确设置了`ROOT_URL`。 - -如果某些克隆选项未显示(HTTP/S或SSH),可以在`app.ini中` - -- `DISABLE_HTTP_GIT`: 如果设为true, 将会没有HTTP/HTTPS链接 -- `DISABLE_SSH`: 如果设为true, 将会没有SSH链接 -- `SSH_EXPOSE_ANONYMOUS`: 如果设为false, SSH链接将会对匿名用户隐藏 - -## 文件上传失败:413 Request Entity Too Large - -当反向代理限制文件上传大小时,会出现此错误。 - -有关使用nginx解决此问题,请参阅[反向代理指南](administration/reverse-proxies.md)。 - -## 自定义模板无法加载或运行错误 - -Gitea的自定义模板必须将其添加到正确的位置,否则Gitea将无法找到并使用自定义模板。 - -模板的正确路径应该相对于`CustomPath`。 - -1. 要找到`CustomPath`,请在站点管理 -> 配置 中查找自定义文件根路径。 - - 如果找不到,请尝试`echo $GITEA_CUSTOM`。 - -2. 如果仍然找不到,默认值可以被[计算](help/faq.md#where-does-gitea-store-what-file) -3. 如果仍然找不到路径,则可以参考[自定义Gitea](administration/customizing-gitea.md)页面,将模板添加到正确的位置。 - -## Gitea是否有"GitHub/GitLab Pages"功能? - -Gitea不提供内置的Pages服务器。您需要一个专用的域名来提供静态页面,以避免CSRF安全风险。 - -对于简单的用法,您可以使用反向代理来重写和提供Gitea的原始文件URL中的静态内容。 - -还有一些已经可用的第三方服务,比如独立[pages server](https://codeberg.org/Codeberg/pages-server)的或[caddy plugin](https://github.com/42wim/caddy-gitea),可以提供所需的功能。 - -## 活跃用户与禁止登录用户 - -在Gitea中,"活跃用户"是指通过电子邮件激活其帐户的用户。 - -"禁止登录用户"是指不允许再登录到Gitea的用户。 - -## 设置日志记录 - -- [官方文档](administration/logging-config.md) - -## 什么是Swagger? - -[Swagger](https://swagger.io/) 是Gitea用于其API文档的工具。 - -所有Gitea实例都有内置的API,无法完全禁用它。 -但是,您可以在app.ini的api部分将ENABLE_SWAGGER设置为false,以禁用其文档显示。 -有关更多信息,请参阅Gitea的[API文档](development/api-usage.md)。 - -您可以在上查看最新的API(例如)https://try.gitea.io/api/swagger - -您还可以在上查看`swagger.json`文件的示例 https://try.gitea.io/swagger.v1.json - -## 调整服务器用于公共/私有使用 - -### 防止垃圾邮件发送者 - -有多种方法可以组合使用来防止垃圾邮件发送者: - -1. 通过设置电子邮件域名的白名单或黑名单。 -2. 通过设置一些域名或者OpenID白名单(见下文)。 -3. 在您的`app.ini`中将`ENABLE_CAPTCHA`设置为`true`,并正确配置`RECAPTCHA_SECRET`和 `RECAPTCHA_SITEKEY`。 -4. 将`DISABLE_REGISTRATION`设置为`true`,并通过 [CLI](administration/command-line.md)、[API](development/api-usage.md) 或 Gitea 的管理界面创建新用户。 - -### 仅允许/阻止特定的电子邮件域名 - -您可以在`app.ini`中的`[service]`下的配置`EMAIL_DOMAIN_WHITELIST` 或 `EMAIL_DOMAIN_BLOCKLIST`。 - -### 仅允许/阻止特定的 OpenID 提供商 - -您可以在`app.ini`的`[openid]`下配置`WHITELISTED_URI`或`BLACKLISTED_URIS`。 - -**注意**: 白名单优先,如果白名单非空,则忽略黑名单。 - -### 仅允许发布问题的用户 - -目前实现这一点的方法是创建/修改一个具有最大仓库创建限制为 0 的用户。 - -### 受限制的用户 - -受限制的用户仅能访问其组织/团队成员和协作所在的内容的子集,而忽略组织/仓库等的公共标志。 - -示例用例:一个公司运行一个需要登录的 Gitea 实例。大多数仓库是公开的(所有同事都可以访问/浏览)。 - -在某些情况下,某个客户或第三方需要访问特定的仓库,并且只能访问该仓库。通过将此类客户帐户设置为受限制帐户,并使用团队成员身份和/或协作来授予所需的任何访问权限,可以简单地实现这一点,而无需使所有内容都变为私有。 - -### 启用 Fail2ban - -使用 [Fail2Ban](administration/fail2ban-setup.md) 监视并阻止基于日志模式的自动登录尝试或其他恶意行为。 - -## 如何添加/使用自定义主题 - -Gitea 目前支持三个官方主题,分别是 `gitea-light`、`gitea-dark` 和 `gitea-auto`(根据操作系统设置自动切换前两个主题)。 -要添加自己的主题,目前唯一的方法是提供一个完整的主题(不仅仅是颜色覆盖)。 - -假设我们的主题是 `arc-blue`(这是一个真实的主题,可以在[此问题](https://github.com/go-gitea/gitea/issues/6011)中找到) - -将`.css`文件命名为`theme-arc-blue.css`并将其添加到`custom/public/assets/css`文件夹中 - -通过将`arc-blue`添加到`app.ini`中的`THEMES`列表中,允许用户使用该主题 - -## SSHD vs 内建SSH - -SSHD是大多数Unix系统上内建的SSH服务器。 - -Gitea还提供了自己的SSH服务器,用于在SSHD不可用时使用。 - -## Gitea运行缓慢 - -导致此问题的最常见原因是加载联合头像。 - -您可以通过在`app.ini`中将`ENABLE_FEDERATED_AVATAR`设置为`false`来关闭此功能。 - -还有一个可能需要更改的选项是在`app.ini`中将`DISABLE_GRAVATAR`设置为`true`。 - -## 无法创建仓库/文件 - -请确保Gitea具有足够的权限来写入其主目录和数据目录。 - -参见[AppDataPath 和 RepoRootPath](help/faq.md#where-does-gitea-store-what-file) - -**适用于Arch用户的注意事项:**在撰写本文时,Arch软件包的systemd文件包含了以下行: - -`ReadWritePaths=/etc/gitea/app.ini` - -这将使得Gitea无法写入其他路径。 - -## 翻译不正确/如何添加更多翻译 - -我们当前的翻译是在我们的[Crowdin项目](https://crowdin.com/project/gitea)上众包进行的 - -无论您想要更改翻译还是添加新的翻译,都需要在Crowdin集成中进行,因为所有翻译都会被CI覆盖。 - -## 推送钩子/ Webhook未运行 - -如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发Webhook,有几种可能性: - -1. Git钩子不同步:在站点管理面板上运行“重新同步所有仓库的pre-receive、update和post-receive钩子” -2. Git仓库(和钩子)存储在一些不支持脚本执行的文件系统上(例如由NAS挂载),请确保文件系统支持`chmod a+x any-script` -3. 如果您使用的是Docker,请确保Docker Server(而不是客户端)的版本 >= 20.10.6 - -## SSH问题 - -如果无法通过`ssh`访问仓库,但`https`正常工作,请考虑以下情况。 - -首先,请确保您可以通过SSH访问Gitea。 - -`ssh git@myremote.example` - -如果连接成功,您应该会收到以下错误消息: - -``` -Hi there, You've successfully authenticated, but Gitea does not provide shell access. -If this is unexpected, please log in with password and setup Gitea under another user. -``` - -如果您收到以上消息但仍然连接成功,这意味着您的 SSH 密钥**没有**由 Gitea 管理。这意味着钩子不会运行,在其他一些潜在问题中也包括在内。 - -如果您无法连接,可能是因为您的 SSH 密钥在本地配置不正确。 -这是针对 SSH 而不是 Gitea 的问题,因此在此不涉及。 - -### SSH 常见错误 - -``` -Permission denied (publickey). -fatal: Could not read from remote repository. -``` - -此错误表示服务器拒绝登录尝试, -请检查以下事项: - -- 在客户端: - - 确保公钥和私钥已添加到正确的 Gitea 用户。 - - 确保远程 URL 中没有任何问题。特别是,请确保∂ - Git 用户(@ 之前的部分)的名称拼写正确。 - - 确保客户端机器上的公钥和私钥正确无误。 -- 在服务器上: - - 确保存储库存在并且命名正确。 - - 检查系统用户主目录中的 `.ssh` 目录的权限。 - - 验证正确的公钥是否已添加到 `.ssh/authorized_keys` 中。 - - 尝试在 Gitea 管理面板上运行 - `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)`。 -- 查看 Gitea 日志。 -- 查看 /var/log/auth(或类似的文件)。 -- 检查存储库的权限。 - -以下是一个示例,其中缺少公共 SSH 密钥, -认证成功,但是其他设置导致 SSH 无法访问正确的 -存储库。 - -``` -fatal: Could not read from remote repository. - -Please make sure you have the correct access rights -and the repository exists. -``` - -在这种情况下,请检查以下设置: - -- 在服务器上: - - 确保`git`系统用户设置了可用的 shell - - 使用`getent passwd git | cut -d: -f7`进行验证 - - 可以使用`usermod`或`chsh`进行修改。 - - 确保`.ssh/authorized_keys`中的`gitea serv`命令使用 - 正确的配置文件。 - -## 迁移带有标签的存储库后缺失发布版本 - -要迁移带有所有标签的存储库,您需要执行两个操作: - -- 推送标签到存储库: - -``` - git push --tags -``` - -- 在 Gitea 中重新同步所有存储库的标签: - -``` -gitea admin repo-sync-releases -``` - -## LFS 问题 - -针对涉及 LFS 数据上传的问题 - -``` -batch response: Authentication required: Authorization error: <GITEA_LFS_URL>/info/lfs/objects/batch -Check that you have proper access to the repository -error: failed to push some refs to '<GIT_REPO_URL>' -``` - -检查`app.ini`文件中的`LFS_HTTP_AUTH_EXPIRY`值。 - -默认情况下,LFS 令牌在 20 分钟后过期。如果您的连接速度较慢或文件较大(或两者都是),可能无法在时间限制内完成上传。 - -您可以将此值设置为`60m`或`120m`。 - -## 如何在启动 Gitea 之前创建用户 - -Gitea 提供了一个子命令`gitea migrate`来初始化数据库,然后您可以使用[管理 CLI 命令](administration/command-line.md#admin)像正常情况下添加用户。 - -## 如何启用密码重置 - -没有密码重置的设置。当配置了[邮件服务](administration/email-setup.md)时,密码重置将自动启用;否则将被禁用。 - -## 如何更改用户的密码 - -- 作为管理员,您可以更改任何用户的密码(并可选择强制其在下次登录时更改密码)... - - 转到您的`站点管理 -> 用户账户`页面并编辑用户。 -- 使用[管理 CLI 命令](administration/command-line.md#admin)。 - - 请注意,大多数命令还需要一个[全局标志](administration/command-line.md#global-options)来指向正确的配置。 -- 作为**用户**,您可以更改密码... - - 在您的账户的`设置 -> 账户`页面(此方法**需要**您知道当前密码)。 - - 使用`忘记密码`链接。 - - 如果`忘记密码/账户恢复`页面被禁用,请联系管理员配置[邮件服务](administration/email-setup.md)。 - -## 为什么我的 Markdown 显示错误 - -在 Gitea 版本 `1.11` 中,我们转换为使用[goldmark](https://github.com/yuin/goldmark)进行 Markdown 渲染,它符合[CommonMark](https://commonmark.org/)标准。 - -如果您在版本`1.11`之前的Markdown正常工作,但在升级后无法正常工作,请仔细阅读CommonMark规范,看看问题是由错误还是非兼容的语法引起的。 - -如果是后者,通常规范中会列出一种符合标准的替代方法。 - -## 使用 MySQL 进行升级时出现的错误 - -如果在使用 MySQL 升级 Gitea 时收到以下错误: - -> `ORM engine initialization failed: migrate: do migrate: Error: 1118: Row size too large...` - -请运行 `gitea doctor convert` 或对数据库中的每个表运行 `ALTER TABLE table_name ROW_FORMAT=dynamic;`。 - -潜在问题是默认行格式分配给每个表的索引空间 -太小。Gitea 要求其表的`ROWFORMAT`为`DYNAMIC`。 - -如果收到包含`Error 1071: Specified key was too long; max key length is 1000 bytes...` -的错误行,则表示您正在尝试在使用 ISAM 引擎的表上运行 Gitea。尽管在先前版本的 Gitea 中可能是凑巧能够工作的,但它从未得到官方支持, -您必须使用 InnoDB。您应该对数据库中的每个表运行`ALTER TABLE table_name ENGINE=InnoDB;`。 - -## 为什么 Emoji 只显示占位符或单色图像 - -Gitea 需要系统或浏览器安装其中一个受支持的 Emoji 字体,例如 Apple Color Emoji、Segoe UI Emoji、Segoe UI Symbol、Noto Color Emoji 和 Twemoji Mozilla。通常,操作系统应该已经提供了其中一个字体,但特别是在 Linux 上,可能需要手动安装它们。 - -## SystemD 和 Docker 上的标准输出日志 - -SystemD 上的标准输出默认会写入日志记录中。您可以尝试使用 `journalctl`、`journalctl -u gitea` 或 `journalctl <path-to-gitea-binary>`来查看。 - -类似地,Docker 上的标准输出可以使用`docker logs <container>`来查看。 - -要收集日志以进行帮助和问题报告,请参阅[支持选项](help/support.md)。 - -## 初始日志记录 - -在 Gitea 读取配置文件并设置其日志记录之前,它会将一些内容记录到标准输出,以帮助调试日志记录无法工作的情况。 - -您可以通过设置`--quiet`或`-q`选项来停止此日志记录。请注意,这只会在 Gitea 设置自己的日志记录之前停止日志记录。 - -如果您报告了错误或问题,必须提供这些信息以恢复初始日志记录。 - -只有在完全配置了所有内容之后,您才应该设置此选项。 - -## 在数据库启动期间出现有关结构默认值的警告 - -有时,在迁移过程中,旧列和默认值可能在数据库架构中保持不变。 -这可能会导致警告,例如: - -``` -2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync() [W] Table user Column keep_activity_private db default is , struct default is 0 -``` - -可以安全地忽略这些警告,但您可以通过让 Gitea 重新创建这些表来停止这些警告,使用以下命令: - -``` -gitea doctor recreate-table user -``` - -这将导致 Gitea 重新创建用户表并将旧数据复制到新表中, -并正确设置默认值。 - -您可以使用以下命令要求 Gitea 重新创建多个表: - -``` -gitea doctor recreate-table table1 table2 ... -``` - -如果您希望 Gitea 重新创建所有表,请使用以下命令: - -``` -gitea doctor recreate-table -``` - -在运行这些命令之前,强烈建议您备份数据库。 - -## 为什么查看文件时制表符/缩进显示错误 - -如果您正在使用 Cloudflare,请在仪表板中关闭自动缩小选项。 - -`Speed` -> `Optimization` -> 在 `Auto-Minify` 设置中取消选中 `HTML`。 - -## 如何从磁盘采用存储库 - -- 将您的(裸)存储库添加到正确的位置,即您的配置所在的地方(`repository.ROOT`),确保它们位于正确的布局`<REPO_ROOT>/[user]/[repo].git`。 - - **注意:**目录名必须为小写。 - - 您还可以在`<ROOT_URL>/admin/config`中检查存储库根路径。 -- 确保存在要采用存储库的用户/组织。 -- 作为管理员,转到`<ROOT_URL>/admin/repos/unadopted`并搜索。 -- 用户也可以通过配置[`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`](administration/config-cheat-sheet.md#repository) 获得类似的权限。 -- 如果上述步骤都正确执行,您应该能够选择要采用的存储库。 - - 如果没有找到存储库,请启用[调试日志记录](administration/config-cheat-sheet.md#repository)以检查是否有特定错误。 diff --git a/docs/content/help/support.en-us.md b/docs/content/help/support.en-us.md deleted file mode 100644 index db735b8124..0000000000 --- a/docs/content/help/support.en-us.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -date: "2018-05-21T15:00:00+00:00" -title: "Support Options" -slug: "support" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /en-us/seek-help -menu: - sidebar: - parent: "help" - name: "Support Options" - sidebar_position: 20 - identifier: "support" ---- - -# Support Options - -- [Paid Commercial Support](https://about.gitea.com/) -- [Discord](https://discord.gg/Gitea) -- [Discourse Forum](https://discourse.gitea.io/) -- [Matrix](https://matrix.to/#/#gitea-space:matrix.org) - - NOTE: Most of the Matrix channels are bridged with their counterpart in Discord and may experience some degree of flakiness with the bridge process. -- Chinese Support - - [Discourse Chinese Category](https://discourse.gitea.io/c/5-category/5) - - QQ Group 328432459 - -# Bug Report - -If you found a bug, please [create an issue on GitHub](https://github.com/go-gitea/gitea/issues). - -**NOTE:** When asking for support, it may be a good idea to have the following available so that the person helping has all the info they need: - -1. Your `app.ini` (with any sensitive data scrubbed as necessary). -2. Any error messages you are seeing. -3. The Gitea logs, and all other related logs for the situation. - - It's more useful to collect `trace` / `debug` level logs (see the next section). - - When using systemd, use `journalctl --lines 1000 --unit gitea` to collect logs. - - When using docker, use `docker logs --tail 1000 <gitea-container>` to collect logs. -4. Reproducible steps so that others could reproduce and understand the problem more quickly and easily. - - [try.gitea.io](https://try.gitea.io) could be used to reproduce the problem. -5. If you encounter slow/hanging/deadlock problems, please report the stacktrace when the problem occurs. - Go to the "Site Admin" -> "Monitoring" -> "Stacktrace" -> "Download diagnosis report". - -# Advanced Bug Report Tips - -## More Config Options for Logs - -By default, the logs are outputted to console with `info` level. -If you need to set log level and/or collect logs from files, -you could just copy the following config into your `app.ini` (remove all other `[log]` sections), -then you will find the `*.log` files in Gitea's log directory (default: `%(GITEA_WORK_DIR)/log`). - -```ini -; To show all SQL logs, you can also set LOG_SQL=true in the [database] section -[log] -LEVEL=debug -MODE=console,file -``` - -## Collecting Stacktrace by Command Line - -Gitea could use Golang's pprof handler and toolchain to collect stacktrace and other runtime information. - -If the web UI stops working, you could try to collect the stacktrace by command line: - -1. Set `app.ini`: - - ``` - [server] - ENABLE_PPROF = true - ``` - -2. Restart Gitea - -3. Try to trigger the bug, when the requests get stuck for a while, - use `curl` or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` to get the stacktrace. diff --git a/docs/content/help/support.zh-cn.md b/docs/content/help/support.zh-cn.md deleted file mode 100644 index de56d8abe0..0000000000 --- a/docs/content/help/support.zh-cn.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -date: "2017-01-20T15:00:00+08:00" -title: "需要帮助" -slug: "support" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/seek-help -menu: - sidebar: - parent: "help" - name: "需要帮助" - sidebar_position: 20 - identifier: "support" ---- - -## 需要帮助? - -如果您在使用或者开发过程中遇到问题,请到以下渠道咨询: - -- 到 [GitHub Issue](https://github.com/go-gitea/gitea/issues) 提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问) -- 中文问题到 [Gitea 论坛](https://discourse.gitea.io/c/5-category/5) 提问 -- 访问 [Discord Gitea 聊天室 - 英文](https://discord.gg/Gitea) -- 加入 QQ群 328432459 获得进一步的支持 diff --git a/docs/content/index.en-us.md b/docs/content/index.en-us.md deleted file mode 100644 index 170bf26f71..0000000000 --- a/docs/content/index.en-us.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -date: "2016-11-08T16:00:00+02:00" -title: "Documentation" -slug: / -sidebar_position: 10 -toc: false -draft: false ---- - -# What is Gitea? - -Gitea is a painless self-hosted all-in-one software development service, it includes Git hosting, code review, team collaboration, package registry and CI/CD. It is similar to GitHub, Bitbucket and GitLab. -Gitea was forked from [Gogs](http://gogs.io) originally and almost all the code has been changed. See the [Gitea Announcement](https://blog.gitea.com/welcome-to-gitea/) -blog post to read about the justification for a fork. - -## Purpose - -The goal of this project is to provide the easiest, fastest, and most painless way of setting -up a self-hosted Git service. - -With Go, this can be done platform-independently across -**all platforms** which Go supports, including Linux, macOS, and Windows, -on x86, amd64, ARM and PowerPC architectures. -You can try it out using [the online demo](https://try.gitea.io/). - -## Features - -- Code Hosting: Gitea supports creating and managing repositories, browsing commit history and code files, reviewing and merging code submissions, managing collaborators, handling branches, and more. It also supports many common Git features such as tags, Cherry-pick, hooks, integrated collaboration tools, and more. - -- Lightweight and Fast: One of Gitea's design goals is to be lightweight and fast in response. Unlike some large code hosting platforms, it remains lean, performing well in terms of speed, and is suitable for resource-limited server environments. Due to its lightweight design, Gitea has relatively low resource consumption and performs well in resource-constrained environments. - -- Easy Deployment and Maintenance: It can be easily deployed on various servers without complex configurations or dependencies. This makes it convenient for individual developers or small teams to set up and manage their own Git services. - -- Security: Gitea places a strong emphasis on security, offering features such as user permission management, access control lists, and more to ensure the security of code and data. - -- Code Review: Code review supports both the Pull Request workflow and AGit workflow. Reviewers can browse code online and provide review comments or feedback. Submitters can receive review comments and respond or modify code online. Code reviews can help individuals and organizations enhance code quality. - -- CI/CD: Gitea Actions supports CI/CD functionality, compatible with GitHub Actions. Users can write workflows in familiar YAML format and reuse a variety of existing Actions plugins. Actions plugins support downloading from any Git website. - -- Project Management: Gitea tracks project requirements, features, and bugs through boards and issues. Issues support features like branches, tags, milestones, assignments, time tracking, due dates, dependencies, and more. - -- Artifact Repository: Gitea supports over 20 different types of public or private software package management, including Cargo, Chef, Composer, Conan, Conda, Container, Helm, Maven, npm, NuGet, Pub, PyPI, RubyGems, Vagrant, and more. - -- Open Source Community Support: Gitea is an open-source project based on the MIT license. It has an active open-source community that continuously develops and improves the platform. The project also actively welcomes community contributions, ensuring updates and innovation. - -- Multilingual Support: Gitea provides interfaces in multiple languages, catering to users globally and promoting internationalization and localization. - -Additional Features: For more detailed information, please refer to: https://docs.gitea.com/installation/comparison#general-features - -## System Requirements - -- A Raspberry Pi 3 is powerful enough to run Gitea for small workloads. -- 2 CPU cores and 1GB RAM is typically sufficient for small teams/projects. -- Gitea should be run with a dedicated non-root system account on UNIX-type systems. - - Note: Gitea manages the `~/.ssh/authorized_keys` file. Running Gitea as a regular user could break that user's ability to log in. -- [Git](https://git-scm.com/) version 2.0.0 or later is required. - - [Git Large File Storage](https://git-lfs.github.com/) will be available if enabled and if your Git version is >= 2.1.2 - - Git commit-graph rendering will be enabled automatically if your Git version is >= 2.18 - -## Browser Support - -- Last 2 versions of Chrome, Firefox, Safari and Edge -- Firefox ESR - -## Components - -- Web server framework: [Chi](http://github.com/go-chi/chi) -- ORM: [XORM](https://xorm.io) -- UI frameworks: - - [jQuery](https://jquery.com) - - [Fomantic UI](https://fomantic-ui.com) - - [Vue3](https://vuejs.org) - - and various components (see package.json) -- Editors: - - [CodeMirror](https://codemirror.net) - - [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) - - [Monaco Editor](https://microsoft.github.io/monaco-editor) -- Database drivers: - - [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - - [github.com/lib/pq](https://github.com/lib/pq) - - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -## Integrated support - - Please visit [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) to get more third-party integrated support diff --git a/docs/content/index.zh-cn.md b/docs/content/index.zh-cn.md deleted file mode 100644 index 3cec5b396e..0000000000 --- a/docs/content/index.zh-cn.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -date: "2016-11-08T16:00:00+02:00" -title: "文档" -slug: / -sidebar_position: 10 -toc: false -draft: false ---- - -# 关于Gitea - -Gitea 是一个轻量级的 DevOps 平台软件。从开发计划到产品成型的整个软件生命周期,他都能够高效而轻松的帮助团队和开发者。包括 Git 托管、代码审查、团队协作、软件包注册和 CI/CD。它与 GitHub、Bitbucket 和 GitLab 等比较类似。 -Gitea 最初是从 [Gogs](http://gogs.io) 分支而来,几乎所有代码都已更改。对于我们Fork的原因可以看 -[这里](https://blog.gitea.com/welcome-to-gitea/)。 - -## 目标 - -Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好 -的自建 Git 服务。 - -采用Go作为后端语言,只需生成一个可执行程序即可。 -支持 Linux, macOS 和 Windows等多平台, - 支持主流的x86,amd64、 - ARM 和 PowerPC等架构。 - -## 功能特性 - -- 代码托管:Gitea⽀持创建和管理仓库、浏览提交历史和代码⽂件、审查和合并代码提交、管理协作者、管理分⽀等。它还⽀持许多常见的Git特性,⽐如标签、Cherry-pick、hook、集成协作⼯具等。 -- 轻量级和快速: Gitea 的设计目标之一就是轻量级和快速响应。它不像一些大型的代码托管平台那样臃肿,因此在性能方面表现出色,适用于资源有限的服务器环境。由于其轻量级设计,Gitea 在资源消耗方面相对较低,可以在资源有限的环境下运行良好。 -- 易于部署和维护: 轻松地部署在各种服务器上,不需要复杂的配置和依赖。这使得个人开发者或小团队可以方便地设置和管理自己的 Git 服务。 -- 安全性: Gitea 注重安全性,提供了用户权限管理、访问控制列表等功能,可以确保代码和数据的安全性。 -- 代码评审:代码评审同时支持 Pull Request workflow 和 AGit workflow。评审⼈可以在线浏览代码,并提交评审意见或问题。 提交者可以接收到评审意见,并在线回 复或修改代码。代码评审可以帮助用户和企业提⾼代码质量。 -- CI/CD: Gitea Actions⽀持 CI/CD 功能,该功能兼容 GitHub Actions,⽤⼾可以采用熟悉的YAML格式编写workflows,也可以重⽤⼤量的已有的 Actions 插件。Actions 插件支持从任意的 Git 网站中下载。 -- 项目管理:Gitea 通过看板和⼯单来跟踪⼀个项⽬的需求,功能和bug。⼯单⽀持分支,标签、⾥程碑、 指派、时间跟踪、到期时间、依赖关系等功能。 -- 制品库: Gitea支持超过 20 种不同种类的公有或私有软件包管理,包括:Cargo, Chef, Composer, Conan, Conda, Container, Helm, Maven, npm, NuGet, Pub, PyPI, RubyGems, Vagrant等 -- 开源社区支持: Gitea 是一个基于 MIT 许可证的开源项目,Gitea 拥有一个活跃的开源社区,能够持续地进行开发和改进,同时也积极接受社区贡献,保持了平台的更新和创新。 -- 多语言支持: Gitea 提供多种语言界面,适应全球范围内的用户,促进了国际化和本地化。 - -更多功能特性:详见:https://docs.gitea.com/installation/comparison#general-features - -## 系统要求 - -- 树莓派Pi3功能强大,足以运行 Gitea 来处理小型工作负载。 -- 对于小型团队/项目而言,2 个 CPU 内核和 1GB 内存通常就足够了。 -- 在 UNIX 系统上,Gitea 应使用专用的非 root 系统账户运行。 - - 注意:Gitea 管理 `~/.ssh/authorized_keys` 文件。以普通用户身份运行 Gitea 可能会破坏该用户的登录能力。 -- [Git](https://git-scm.com/) 需要 2.0.0 或更高版本。 - - [Git Large File Storage](https://git-lfs.github.com/) 如果启用,且 Git 版本大于等于 2.1.2,则该选项可用 - - 如果 Git 版本大于等于 2.18,将自动启用 Git 提交历史图形化展示功能 - -## 浏览器支持 - -- Last 2 versions of Chrome, Firefox, Safari and Edge -- Firefox ESR - -## 技术栈 - -- Web框架: [Chi](http://github.com/go-chi/chi) -- ORM: [XORM](https://xorm.io) -- UI 框架: - - [jQuery](https://jquery.com) - - [Fomantic UI](https://fomantic-ui.com) - - [Vue3](https://vuejs.org) - - 更多组件参见 package.json -- 编辑器: - - [CodeMirror](https://codemirror.net) - - [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) - - [Monaco Editor](https://microsoft.github.io/monaco-editor) -- 数据库驱动: - - [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - - [github.com/lib/pq](https://github.com/lib/pq) - - [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - - [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -## 集成支持 - -请访问 [Awesome Gitea](https://gitea.com/gitea/awesome-gitea/) 获得更多的第三方集成支持 diff --git a/docs/content/installation.en-us.md b/docs/content/installation.en-us.md deleted file mode 100644 index 32933f0f78..0000000000 --- a/docs/content/installation.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Installation" -slug: "installation" -sidebar_position: 10 -toc: false -draft: false -menu: - sidebar: - name: "Installation" - sidebar_position: 10 - identifier: "installation" ---- diff --git a/docs/content/installation.zh-cn.md b/docs/content/installation.zh-cn.md deleted file mode 100644 index 979abc28c1..0000000000 --- a/docs/content/installation.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "安装" -slug: "installation" -sidebar_position: 10 -toc: false -draft: false -menu: - sidebar: - name: "安装" - sidebar_position: 10 - identifier: "installation" ---- diff --git a/docs/content/installation/_index.en-us.md b/docs/content/installation/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/installation/_index.en-us.md +++ /dev/null diff --git a/docs/content/installation/_index.zh-cn.md b/docs/content/installation/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/installation/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/installation/comparison.en-us.md b/docs/content/installation/comparison.en-us.md deleted file mode 100644 index 3fb6561f31..0000000000 --- a/docs/content/installation/comparison.en-us.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -date: "2018-05-07T13:00:00+02:00" -title: "Compared to other Git hosting" -slug: "comparison" -sidebar_position: 5 -toc: false -draft: false -aliases: - - /en-us/comparison -menu: - sidebar: - name: "Comparison" - sidebar_position: 5 - parent: installation - identifier: "comparison" ---- - -# Gitea compared to other Git hosting options - -To help decide if Gitea is suited for your needs, here is how it compares to other Git self hosted options. - -Be warned that we don't regularly check for feature changes in other products, so this list may be outdated. If you find anything that needs to be updated in the table below, please [open an issue](https://github.com/go-gitea/gitea/issues/new/choose). - -_Symbols used in table:_ - -- _✓ - supported_ - -- _⁄ - supported with limited functionality_ - -- _✘ - unsupported_ - -- _⚙️ - supported through third-party software_ - -## General Features - -| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE | -| ------------------------------------------------ | --------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | ------------ | -| Open source and free | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ✓ | -| Low RAM/ CPU usage | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| Multiple database support | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ | ✓ | -| Multiple OS support | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ✓ | -| Easy upgrades | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ | ✓ | -| Telemetry | **✘** | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Third-party render tool support | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ✘ | ✘ | -| WebAuthn (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✓ | -| Extensive API | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Built-in Package/Container Registry | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Sync commits to an external repo (push mirror) | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ | ✓ | -| Sync commits from an external repo (pull mirror) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ | ✓ | -| Light and Dark Theme | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Custom Theme Support | ✓ | ✓ | ✘ | ✘ | ✘ | ✓ | ✓ | ✓ | -| Markdown support | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| CSV support | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ✘ | ✘ | -| 'GitHub / GitLab pages' | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Gists / Snippets | [⚙️][opengist] | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Repo-specific wiki (as a repo itself) | ✓ | ✓ | ✓ | ✓ | ✓ | / | ✘ | ✘ | -| Deploy Tokens | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Repository Tokens with write rights | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| RSS Feeds | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ✓ | ✓ | -| Built-in CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Subgroups: groups within groups | [✘](https://github.com/go-gitea/gitea/issues/1872) | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ | ✓ | -| Interaction with other instances | [/](https://github.com/go-gitea/gitea/issues/18240) | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| Mermaid diagrams in Markdown | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Math syntax in Markdown | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✓ | ✓ | - -## Code management - -| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE | -| ------------------------------------------- | --------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | ------------ | -| Repository topics | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Repository code search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Global code search | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | -| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Group Milestones | [✘](https://github.com/go-gitea/gitea/issues/14622) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Granular user roles (Code, Issues, Wiki, …) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Verified Committer | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ | ✘ | -| GPG Signed Commits | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| SSH Signed Commits | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ | ✘ | -| Reject unsigned commits | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Migrating repos from other services | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Repository Activity page | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Branch manager | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Create new branches | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Web code editor | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Commit graph | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Template Repositories | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ | ✘ | -| Git Blame | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Visual comparison of image changes | ✓ | ✘ | ✓ | ? | ? | ? | ✘ | ✘ | - -- Gitea has builtin repository-level code search -- Better code search support could be achieved by [using a repository indexer](administration/repo-indexer.md) - -## Issue Tracker - -| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE | -| ----------------------------- | --------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | ------------ | -| Issue tracker | ✓ | ✓ | ✓ | ✓ | ✓ | / | ✘ | ✘ | -| Issue templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Labels | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Time tracking | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Multiple assignees for issues | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | -| Related issues | ✘ | ✘ | ⁄ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Confidential issues | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Comment reactions | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Lock Discussion | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Batch issue handling | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Issue Boards (Kanban) | [/](https://github.com/go-gitea/gitea/issues/14710) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Create branch from issue | [✘](https://github.com/go-gitea/gitea/issues/20226) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Convert comment to new issue | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Issue search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Global issue search | [/](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Issue dependency | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| Create issue via email | [✘](https://github.com/go-gitea/gitea/issues/6226) | ✘ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Service Desk | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✘ | - -## Pull/Merge requests - -| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE | -| ----------------------------------------------- | -------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | ------------ | -| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Squash merging | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Rebase merging | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Pull/Merge request inline comments | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Pull/Merge request approval | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Pull/Merge require approval | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | -| Pull/Merge multiple reviewers | ✓ | ✓ | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | -| Merge conflict resolution | [✘](https://github.com/go-gitea/gitea/issues/9014) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Restrict push and merge access to certain users | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Revert specific commits | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Pull/Merge requests templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | ✘ | -| Cherry-picking changes | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | ✓ | -| Download Patch | ✓ | ✘ | ✓ | ✓ | ✓ | / | ✓ | ✓ | -| Merge queues | ✘ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | - -## 3rd-party integrations - -| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE | -| ---------------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ | ------------ | -| Webhooks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Git Hooks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| AD / LDAP integration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Multiple LDAP / AD server support | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ | ✓ | -| LDAP user synchronization | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✓ | -| SAML 2.0 service provider | [✘](https://github.com/go-gitea/gitea/issues/5512) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✓ | -| OpenID Connect support | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ | ✓ | -| OAuth 2.0 integration (external authorization) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✘ | ✓ | -| Act as OAuth 2.0 provider | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Two factor authentication (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✓ | -| Integration with the most common services | ✓ | / | ⁄ | ✓ | ✓ | ⁄ | ✓ | ✓ | -| Incorporate external CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - -[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea -[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server -[opengist]: https://github.com/thomiceli/opengist diff --git a/docs/content/installation/comparison.zh-cn.md b/docs/content/installation/comparison.zh-cn.md deleted file mode 100644 index 422d6314c5..0000000000 --- a/docs/content/installation/comparison.zh-cn.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -date: "2019-02-14T11:51:04+08:00" -title: "对比 Gitea 与其它 Git 托管工具" -slug: "comparison" -sidebar_position: 5 -toc: false -draft: false -aliases: - - /zh-cn/comparison -menu: - sidebar: - parent: "installation" - name: "横向对比" - sidebar_position: 5 - identifier: "comparison" ---- - -# 对比 Gitea 与其它 Git 托管工具 - -这里列出了 Gitea 与其它一些 Git 托管工具之间的异同,以便确认 Gitea 是否能够满足您的需求。 - -请注意,此列表中的某些表项可能已经过时,因为我们并没有定期检查其它产品的功能是否有所更改。你可以前往 [Github issue](https://github.com/go-gitea/gitea/issues) 来帮助我们更新过时的内容,感谢! - -_表格中的符号含义:_ - -* _✓ - 支持_ - -* _⁄ - 部分支持_ - -* _✘ - 不支持_ - -* _⚙️ - 由第三方服务或插件支持_ - -#### 主要特性 - -| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------------------- | -------------------------------------------------- | ---- | --------- | --------- | --------- | -------------- | ------------ | -| 开源免费 | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | -| 低资源开销 (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | -| 支持多种数据库 | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ | -| 支持多种操作系统 | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | -| 升级简便 | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ | -| 可观测性 | **✘** | ✘ | ✓ | ✓ | ✓ | ✓ | ? | -| 支持第三方渲染工具 | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ | ? | -| WebAuthn (2FA) | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ? | -| 扩展 API | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 内置软件包/容器注册中心 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 同步提交到外部仓库 (push mirror) | ✓ | ✓ | ✘ | ✓ | ✓ | ✘ | ✓ | -| 同步外部仓库的提交 (pull mirror) | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ? | -| 浅色和深色主题 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ? | -| 自定义主题支持 | ✓ | ✓ | ✘ | ✘ | ✘ | ✓ | ✘ | -| 支持 Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 支持 CSV | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ | ? | -| Git 驱动的静态 pages | [⚙️][gitea-pages-server], [⚙️][gitea-caddy-plugin] | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Git 驱动的集成化 wiki | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ | -| 部署令牌 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 仓库写权限令牌 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| RSS Feeds | ✓ | ✘ | ✓ | ✘ | ✘ | ✘ | ✘ | -| 内置 CI/CD | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 子组织:组织内的组织 | [✘](https://github.com/go-gitea/gitea/issues/1872) | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ | -| 多实例交互 | [/](https://github.com/go-gitea/gitea/issues/18240) | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| Markdown绘图 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| Markdown数学公式 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | - -#### 代码管理 - -| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------------------------ | --------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ | -| 仓库主题描述 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 仓库内代码搜索 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 全局代码搜索 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ | -| Git LFS 2.0 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 组织里程碑 | [✘](https://github.com/go-gitea/gitea/issues/14622) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 细粒度用户角色 | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 提交人的身份验证 | ⁄ | ✘ | ? | ✓ | ✓ | ✓ | ✘ | -| GPG 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| SSH 签名的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ? | -| 拒绝未通过验证的提交 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 外部仓库迁移 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 仓库活跃度页面 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 分支管理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 建立新分支 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 在线代码编辑 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 提交的统计图表 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 模板仓库 | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ | -| Git Blame | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 可视化镜像变化 | ✓ | ✘ | ✓ | ? | ? | ? | ? | - -#### 工单管理 - -| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | ----------------------------------------------------------------------- | --------- | -------------- | ------------ | -| 工单跟踪 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (cloud only) | ✘ | -| 工单模板 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 标签 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 时间跟踪 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 支持多个负责人 | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ | -| 关联的工单 | ✘ | ✘ | ⁄ | [✓](https://docs.gitlab.com/ce/user/project/issues/related_issues.html) | ✓ | ✘ | ✘ | -| 私密工单 | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 评论反馈 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 锁定讨论 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 工单批处理 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 工单看板 | [✓](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 从工单创建分支 | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 从评论创建工单 | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 工单搜索 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 工单全局搜索 | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 工单依赖关系 | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | -| 通过 Email 创建工单 | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✓ | ✓ | ✓ | ✘ | -| 服务台 | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ | - -#### Pull/Merge requests - -| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| ------------------------------------ | -------------------------------------------------- | ---- | --------- | --------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ | ------------ | -| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Squash merging | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ | -| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ | -| 评论 Pull/Merge request 中的某行代码 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 指定 Pull/Merge request 的审核人 | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ | -| 解决 Merge 冲突 | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 限制某些用户的 push 和 merge 权限 | ✓ | ✘ | ✓ | ⁄ | ✓ | ✓ | ✓ | -| 回退某些 commits 或 merge request | [✓](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| Pull/Merge requests 模板 | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 查看 Cherry-picking 的更改 | [✓](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ | -| 下载 Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ | -| Merge queues | ✘ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ | - -#### 第三方集成 - -| 特性 | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | -| -------------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | --------- | --------- | --------- | ------------ | -| 支持 Webhook | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 自定义 Git 钩子 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 集成 AD / LDAP | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| 支持多个 LDAP / AD 服务 | ✓ | ✓ | ✘ | ✘ | ✓ | ✓ | ✓ | -| LDAP 用户同步 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | -| SAML 2.0 service provider | [✘](https://github.com/go-gitea/gitea/issues/5512) | [✘](https://github.com/gogs/gogs/issues/1221) | ✓ | ✓ | ✓ | ✓ | ✘ | -| 支持 OpenId 连接 | ✓ | ✘ | ✓ | ✓ | ✓ | ? | ✘ | -| 集成 OAuth 2.0(外部授权) | ✓ | ✘ | ⁄ | ✓ | ✓ | ? | ✓ | -| 作为 OAuth 2.0 provider | [✓](https://github.com/go-gitea/gitea/pull/5378) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 二次验证 (2FA) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 集成 Mattermost/Slack | ✓ | ✓ | ⁄ | ✓ | ✓ | ⁄ | ✓ | -| 集成 Discord | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ | -| 集成 Microsoft Teams | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ | -| 显示外部 CI/CD 的状态 | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ | - -[gitea-caddy-plugin]: https://github.com/42wim/caddy-gitea -[gitea-pages-server]: https://codeberg.org/Codeberg/pages-server diff --git a/docs/content/installation/database-preparation.en-us.md b/docs/content/installation/database-preparation.en-us.md deleted file mode 100644 index e6abb8a613..0000000000 --- a/docs/content/installation/database-preparation.en-us.md +++ /dev/null @@ -1,309 +0,0 @@ ---- -date: "2020-01-16" -title: "Database Preparation" -slug: "database-prep" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /en-us/database-prep -menu: - sidebar: - parent: "installation" - name: "Database preparation" - sidebar_position: 10 - identifier: "database-prep" ---- - -# Database Preparation - -You need a database to use Gitea. Gitea supports PostgreSQL (>= 12), MySQL (>= 8.0), MariaDB (>= 10.4), SQLite (builtin), and MSSQL (>= 2012 SP4). This page will guide into preparing database. Only PostgreSQL and MySQL will be covered here since those database engines are widely-used in production. If you plan to use SQLite, you can ignore this chapter. - -If you use an unsupported database version, please [get in touch](/help/support) with us for information on our Extended Support Contracts. We can provide testing and support for older databases and integrate those fixes into the Gitea codebase. - -Database instance can be on same machine as Gitea (local database setup), or on different machine (remote database). - -Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server application on database instance and client program on your Gitea server. The client program is used to test connection to the database from Gitea server, while Gitea itself use database driver provided by Go to accomplish the same thing. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers. - -## MySQL/MariaDB - -1. For remote database setup, you will need to make MySQL listen to your IP address. Edit `bind-address` option on `/etc/mysql/my.cnf` on database instance to: - - ```ini - bind-address = 203.0.113.3 - ``` - -2. On database instance, login to database console as root: - - ``` - mysql -u root -p - ``` - - Enter the password as prompted. - -3. Create database user which will be used by Gitea, authenticated by password. This example uses `'gitea'` as password. Please use a secure password for your instance. - - For local database: - - ```sql - SET old_passwords=0; - CREATE USER 'gitea'@'%' IDENTIFIED BY 'gitea'; - ``` - - For remote database: - - ```sql - SET old_passwords=0; - CREATE USER 'gitea'@'192.0.2.10' IDENTIFIED BY 'gitea'; - ``` - - where `192.0.2.10` is the IP address of your Gitea instance. - - Replace username and password above as appropriate. - -4. Create database with UTF-8 charset and case-sensitive collation. - - `utf8mb4_bin` is a common collation for both MySQL/MariaDB. - When Gitea starts, it will try to find a better collation (`utf8mb4_0900_as_cs` or `uca1400_as_cs`) and alter the database if it is possible. - If you would like to use other collation, you can set `[database].CHARSET_COLLATION` in the `app.ini` file. - - ```sql - CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin'; - ``` - - Replace database name as appropriate. - -5. Grant all privileges on the database to database user created above. - - For local database: - - ```sql - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'; - FLUSH PRIVILEGES; - ``` - - For remote database: - - ```sql - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'192.0.2.10'; - FLUSH PRIVILEGES; - ``` - -6. Quit from database console by `exit`. - -7. On your Gitea server, test connection to the database: - - ``` - mysql -u gitea -h 203.0.113.3 -p giteadb - ``` - - where `gitea` is database username, `giteadb` is database name, and `203.0.113.3` is IP address of database instance. Omit `-h` option for local database. - - You should be connected to the database. - -## PostgreSQL - -1. For remote database setup, configure PostgreSQL on database instance to listen to your IP address by editing `listen_addresses` on `postgresql.conf` to: - - ```ini - listen_addresses = 'localhost, 203.0.113.3' - ``` - -2. PostgreSQL uses `md5` challenge-response encryption scheme for password authentication by default. Nowadays this scheme is not considered secure anymore. Use SCRAM-SHA-256 scheme instead by editing the `postgresql.conf` configuration file on the database server to: - - ```ini - password_encryption = scram-sha-256 - ``` - - Restart PostgreSQL to apply the setting. - -3. On the database server, login to the database console as superuser: - - ``` - su -c "psql" - postgres - ``` - -4. Create database user (role in PostgreSQL terms) with login privilege and password. Please use a secure, strong password instead of `'gitea'` below: - - ```sql - CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea'; - ``` - - Replace username and password as appropriate. - -5. Create database with UTF-8 charset and owned by the database user created earlier. Any `libc` collations can be specified with `LC_COLLATE` and `LC_CTYPE` parameter, depending on expected content: - - ```sql - CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8'; - ``` - - Replace database name as appropriate. - -6. Allow the database user to access the database created above by adding the following authentication rule to `pg_hba.conf`. - - For local database: - - ```ini - local giteadb gitea scram-sha-256 - ``` - - For remote database: - - ```ini - host giteadb gitea 192.0.2.10/32 scram-sha-256 - ``` - - Replace database name, user, and IP address of Gitea instance with your own. - - Note: rules on `pg_hba.conf` are evaluated sequentially, that is the first matching rule will be used for authentication. Your PostgreSQL installation may come with generic authentication rules that match all users and databases. You may need to place the rules presented here above such generic rules if it is the case. - - Restart PostgreSQL to apply new authentication rules. - -7. On your Gitea server, test connection to the database. - - For local database: - - ``` - psql -U gitea -d giteadb - ``` - - For remote database: - - ``` - psql "postgres://gitea@203.0.113.3/giteadb" - ``` - - where `gitea` is database user, `giteadb` is database name, and `203.0.113.3` is IP address of your database instance. - - You should be prompted to enter password for the database user, and connected to the database. - -## Database Connection over TLS - -If the communication between Gitea and your database instance is performed through a private network, or if Gitea and the database are running on the same server, this section can be omitted since the security between Gitea and the database instance is not critically exposed. If instead the database instance is on a public network, use TLS to encrypt the connection to the database, as it is possible for third-parties to intercept the traffic data. - -### Prerequisites - -- You need two valid TLS certificates, one for the database instance (database server) and one for the Gitea instance (database client). Both certificates must be signed by a trusted CA. -- The database certificate must contain `TLS Web Server Authentication` in the `X509v3 Extended Key Usage` extension attribute, while the client certificate needs `TLS Web Client Authentication` in the corresponding attribute. -- On the database server certificate, one of `Subject Alternative Name` or `Common Name` entries must be the fully-qualified domain name (FQDN) of the database instance (e.g. `db.example.com`). On the database client certificate, one of the entries mentioned above must contain the database username that Gitea will be using to connect. -- You need domain name mappings of both Gitea and database servers to their respective IP addresses. Either set up DNS records for them or add local mappings to `/etc/hosts` (`%WINDIR%\System32\drivers\etc\hosts` in Windows) on each system. This allows the database connections to be performed by domain name instead of IP address. See documentation of your system for details. - -### PostgreSQL TLS - -The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both database client and server authenticate each other by sending their respective certificates to their respective opposite for validation. In other words, the server verifies client certificate, and the client verifies server certificate. - -1. On the server with the database instance, place the following credentials: - - - `/path/to/postgresql.crt`: Database instance certificate - - `/path/to/postgresql.key`: Database instance private key - - `/path/to/root.crt`: CA certificate chain to validate client certificates - -2. Add following options to `postgresql.conf`: - - ```ini - ssl = on - ssl_ca_file = '/path/to/root.crt' - ssl_cert_file = '/path/to/postgresql.crt' - ssl_key_file = '/path/to/postgresql.key' - ssl_min_protocol_version = 'TLSv1.2' - ``` - -3. Adjust credentials ownership and permission, as required by PostgreSQL: - - ``` - chown postgres:postgres /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key - chmod 0600 /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key - ``` - -4. Edit `pg_hba.conf` rule to only allow Gitea database user to connect over SSL, and to require client certificate verification. - - For PostgreSQL 12: - - ```ini - hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=verify-full - ``` - - For PostgreSQL 11 and earlier: - - ```ini - hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=1 - ``` - - Replace database name, user, and IP address of Gitea instance as appropriate. - -5. Restart PostgreSQL to apply configurations above. - -6. On the server running the Gitea instance, place the following credentials under the home directory of the user who runs Gitea (e.g. `git`): - - - `~/.postgresql/postgresql.crt`: Database client certificate - - `~/.postgresql/postgresql.key`: Database client private key - - `~/.postgresql/root.crt`: CA certificate chain to validate server certificate - - Note: Those file names above are hardcoded in PostgreSQL and it is not possible to change them. - -7. Adjust credentials, ownership and permission as required: - - ``` - chown git:git ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt - chown 0600 ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt - ``` - -8. Test the connection to the database: - - ``` - psql "postgres://gitea@example.db/giteadb?sslmode=verify-full" - ``` - - You should be prompted to enter password for the database user, and then be connected to the database. - -### MySQL/MariaDB TLS - -While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details. - -In one-way TLS, the database client verifies the certificate sent from server during the connection handshake, and the server assumes that the connected client is legitimate, since client certificate verification doesn't take place. - -1. On the database instance, place the following credentials: - - - `/path/to/mysql.crt`: Database instance certificate - - `/path/to/mysql.key`: Database instance key - - `/path/to/ca.crt`: CA certificate chain. This file isn't used on one-way TLS, but is used to validate client certificates on two-way TLS. - -2. Add following options to `my.cnf`: - - ```ini - [mysqld] - ssl-ca = /path/to/ca.crt - ssl-cert = /path/to/mysql.crt - ssl-key = /path/to/mysql.key - tls-version = TLSv1.2,TLSv1.3 - ``` - -3. Adjust credentials ownership and permission: - - ``` - chown mysql:mysql /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key - chmod 0600 /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key - ``` - -4. Restart MySQL to apply the setting. - -5. The database user for Gitea may have been created earlier, but it would authenticate only against the IP addresses of the server running Gitea. To authenticate against its domain name, recreate the user, and this time also set it to require TLS for connecting to the database: - - ```sql - DROP USER 'gitea'@'192.0.2.10'; - CREATE USER 'gitea'@'example.gitea' IDENTIFIED BY 'gitea' REQUIRE SSL; - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'example.gitea'; - FLUSH PRIVILEGES; - ``` - - Replace database user name, password, and Gitea instance domain as appropriate. - -6. Make sure that the CA certificate chain required to validate the database server certificate is on the system certificate store of both the database and Gitea servers. Consult your system documentation for instructions on adding a CA certificate to the certificate store. - -7. On the server running Gitea, test connection to the database: - - ``` - mysql -u gitea -h example.db -p --ssl - ``` - - You should be connected to the database. diff --git a/docs/content/installation/database-preparation.zh-cn.md b/docs/content/installation/database-preparation.zh-cn.md deleted file mode 100644 index d651088395..0000000000 --- a/docs/content/installation/database-preparation.zh-cn.md +++ /dev/null @@ -1,305 +0,0 @@ ---- -date: "2020-01-16" -title: "数据库准备" -slug: "database-prep" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /zh-cn/database-prep -menu: - sidebar: - parent: "installation" - name: "数据库准备" - sidebar_position: 10 - identifier: "database-prep" ---- - -# 数据库准备 - -在使用 Gitea 前,您需要准备一个数据库。Gitea 支持 PostgreSQL(>= 12)、MySQL(>= 8.0)、SQLite 和 MSSQL(>= 2012 SP4)这几种数据库。本页将指导您准备数据库。由于 PostgreSQL 和 MySQL 在生产环境中被广泛使用,因此本文档将仅涵盖这两种数据库。如果您计划使用 SQLite,则可以忽略本章内容。 - -数据库实例可以与 Gitea 实例在相同机器上(本地数据库),也可以与 Gitea 实例在不同机器上(远程数据库)。 - -注意:以下所有步骤要求您的选择的数据库引擎已安装在您的系统上。对于远程数据库设置,请在数据库实例上安装服务器应用程序,在 Gitea 服务器上安装客户端程序。客户端程序用于测试 Gitea 服务器与数据库之间的连接,而 Gitea 本身使用 Go 提供的数据库驱动程序完成相同的任务。此外,请确保服务器和客户端使用相同的引擎版本,以使某些引擎功能正常工作。出于安全原因,请使用安全密码保护 `root`(MySQL)或 `postgres`(PostgreSQL)数据库超级用户。以下步骤假设您在数据库和 Gitea 服务器上都使用 Linux。 - -## MySQL/MariaDB - -1. 对于远程数据库设置,您需要让 MySQL 监听您的 IP 地址。编辑数据库实例上的 `/etc/mysql/my.cnf` 文件中的 `bind-address` 选项为: - - ```ini - bind-address = 203.0.113.3 - ``` - -2. 在数据库实例上,使用 `root` 用户登录到数据库控制台: - - ``` - mysql -u root -p - ``` - - 按提示输入密码。 - -3. 创建一个将被 Gitea 使用的数据库用户,并使用密码进行身份验证。以下示例中使用了 `'gitea'` 作为密码。请为您的实例使用一个安全密码。 - - 对于本地数据库: - - ```sql - SET old_passwords=0; - CREATE USER 'gitea' IDENTIFIED BY 'gitea'; - ``` - - 对于远程数据库: - - ```sql - SET old_passwords=0; - CREATE USER 'gitea'@'192.0.2.10' IDENTIFIED BY 'gitea'; - ``` - - 其中 `192.0.2.10` 是您的 Gitea 实例的 IP 地址。 - - 根据需要替换上述用户名和密码。 - -4. 使用 UTF-8 字符集和大小写敏感的排序规则创建数据库。 - - Gitea 启动后会尝试把数据库修改为更合适的字符集,如果你想指定自己的字符集规则,可以在 app.ini 中设置 `[database].CHARSET_COLLATION`。 - - ```sql - CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin'; - ``` - - 根据需要替换数据库名称。 - -5. 将数据库上的所有权限授予上述创建的数据库用户。 - - 对于本地数据库: - - ```sql - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'; - FLUSH PRIVILEGES; - ``` - - 对于远程数据库: - - ```sql - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'192.0.2.10'; - FLUSH PRIVILEGES; - ``` - -6. 通过 exit 退出数据库控制台。 - -7. 在您的 Gitea 服务器上,测试与数据库的连接: - - ``` - mysql -u gitea -h 203.0.113.3 -p giteadb - ``` - - 其中 `gitea` 是数据库用户名,`giteadb` 是数据库名称,`203.0.113.3` 是数据库实例的 IP 地址。对于本地数据库,省略 -h 选项。 - - 到此您应该能够连接到数据库了。 - -## PostgreSQL - -1. 对于远程数据库设置,通过编辑数据库实例上的 postgresql.conf 文件中的 listen_addresses 将 PostgreSQL 配置为监听您的 IP 地址: - - ```ini - listen_addresses = 'localhost, 203.0.113.3' - ``` - -2. PostgreSQL 默认使用 `md5` 质询-响应加密方案进行密码身份验证。现在这个方案不再被认为是安全的。改用 SCRAM-SHA-256 方案,通过编辑数据库服务器上的` postgresql.conf` 配置文件: - - ```ini - password_encryption = scram-sha-256 - ``` - - 重启 PostgreSQL 以应用该设置。 - -3. 在数据库服务器上,以超级用户身份登录到数据库控制台: - - ``` - su -c "psql" - postgres - ``` - -4. 创建具有登录权限和密码的数据库用户(在 PostgreSQL 术语中称为角色)。请使用安全的、强密码,而不是下面的 `'gitea'`: - - ```sql - CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea'; - ``` - - 根据需要替换用户名和密码。 - -5. 使用 UTF-8 字符集创建数据库,并由之前创建的数据库用户拥有。可以根据预期内容使用任何 `libc` 排序规则,使用 `LC_COLLATE` 和 `LC_CTYPE` 参数指定: - - ```sql - CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8'; - ``` - - 根据需要替换数据库名称。 - -6. 通过将以下身份验证规则添加到 `pg_hba.conf`,允许数据库用户访问上面创建的数据库。 - - 对于本地数据库: - - ```ini - local giteadb gitea scram-sha-256 - ``` - - 对于远程数据库: - - ```ini - host giteadb gitea 192.0.2.10/32 scram-sha-256 - ``` - - 根据您自己的数据库名称、用户和 Gitea 实例的 IP 地址进行替换。 - - 注意:`pg_hba.conf` 上的规则按顺序评估,也就是第一个匹配的规则将用于身份验证。您的 PostgreSQL 安装可能附带了适用于所有用户和数据库的通用身份验证规则。如果是这种情况,您可能需要将此处提供的规则放置在此类通用规则之上。 - - 重启 PostgreSQL 以应用新的身份验证规则。 - -7. 在您的 Gitea 服务器上,测试与数据库的连接。 - - 对于本地数据库: - - ``` - psql -U gitea -d giteadb - ``` - - 对于远程数据库: - - ``` - psql "postgres://gitea@203.0.113.3/giteadb" - ``` - - 其中 `gitea` 是数据库用户,`giteadb` 是数据库名称,`203.0.113.3` 是您的数据库实例的 IP 地址。 - - 您应该会被提示输入数据库用户的密码,并连接到数据库。 - -## 使用 TLS 进行数据库连接 - -如果 Gitea 和您的数据库实例之间的通信是通过私有网络进行的,或者如果 Gitea 和数据库运行在同一台服务器上,那么可以省略本节,因为 Gitea 和数据库实例之间的安全性不会受到严重威胁。但是,如果数据库实例位于公共网络上,请使用 TLS 对数据库连接进行加密,以防止第三方拦截流量数据。 - -### 先决条件 - -- 您需要两个有效的 TLS 证书,一个用于数据库实例(数据库服务器),一个用于 Gitea 实例(数据库客户端)。两个证书都必须由受信任的 CA 签名。 -- 数据库证书必须在 `X509v3 Extended Key Usage` 扩展属性中包含 `TLS Web Server Authentication`,而客户端证书则需要在相应的属性中包含 `TLS Web Client Authentication`。 -- 在数据库服务器证书中,`Subject Alternative Name` 或 `Common Name` 条目之一必须是数据库实例的完全限定域名(FQDN)(例如 `db.example.com`)。在数据库客户端证书中,上述提到的条目之一必须包含 Gitea 将用于连接的数据库用户名。 -- 您需要将 Gitea 和数据库服务器的域名映射到它们各自的 IP 地址。可以为它们设置 DNS 记录,也可以在每个系统上的 `/etc/hosts`(Windows 中的 `%WINDIR%\System32\drivers\etc\hosts`)中添加本地映射。这样可以通过域名而不是 IP 地址进行数据库连接。有关详细信息,请参阅您系统的文档。 - -### PostgreSQL TLS - -Gitea 使用的 PostgreSQL 驱动程序支持双向 TLS。在双向 TLS 中,数据库客户端和服务器通过将各自的证书发送给对方进行验证来相互认证。换句话说,服务器验证客户端证书,客户端验证服务器证书。 - -1. 在数据库实例所在的服务器上,放置以下凭据: - - - `/path/to/postgresql.crt`: 数据库实例证书 - - `/path/to/postgresql.key`: 数据库实例私钥 - - `/path/to/root.crt`: 用于验证客户端证书的CA证书链 - -2. 在 `postgresql.conf` 中添加以下选项: - - ```ini - ssl = on - ssl_ca_file = '/path/to/root.crt' - ssl_cert_file = '/path/to/postgresql.crt' - ssl_key_file = '/path/to/postgresql.key' - ssl_min_protocol_version = 'TLSv1.2' - ``` - -3. 根据 PostgreSQL 的要求,调整凭据的所有权和权限: - - ``` - chown postgres:postgres /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key - chmod 0600 /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key - ``` - -4. 编辑 `pg_hba.conf` 规则,仅允许 Gitea 数据库用户通过SSL连接,并要求客户端证书验证。 - - 对于PostgreSQL 12: - - ```ini - hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=verify-full - ``` - - 对于PostgreSQL 11及更早版本: - - ```ini - hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=1 - ``` - - 根据需要替换数据库名称、用户和 Gitea 实例的 IP 地址。 - -5. 重新启动 PostgreSQL 以应用上述配置。 - -6. 在运行 Gitea 实例的服务器上,将以下凭据放置在运行 Gitea 的用户的主目录下(例如 `git`): - - - `~/.postgresql/postgresql.crt`: 数据库客户端证书 - - `~/.postgresql/postgresql.key`: 数据库客户端私钥 - - `~/.postgresql/root.crt`: 用于验证服务器证书的CA证书链 - - 注意:上述文件名在 PostgreSQL 中是硬编码的,无法更改。 - -7. 根据需要调整凭据、所有权和权限: - - ``` - chown git:git ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt - chown 0600 ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt - ``` - -8. 测试与数据库的连接: - - ``` - psql "postgres://gitea@example.db/giteadb?sslmode=verify-full" - ``` - - 您将被提示输入数据库用户的密码,然后连接到数据库。 - -### MySQL/MariaDB TLS - -虽然 Gitea 使用的MySQL驱动程序也支持双向 TLS,但目前 Gitea 仅支持单向 TLS。有关详细信息,请参见工单#10828。 - -在单向TLS中,数据库客户端在连接握手期间验证服务器发送的证书,而服务器则假定连接的客户端是合法的,因为不进行客户端证书验证。 - -1. 在数据库实例上放置以下凭据: - - - `/path/to/mysql.crt`: 数据库实例证书 - - `/path/to/mysql.key`: 数据库实例密钥 - - `/path/to/ca.crt`: CA证书链。在单向TLS中不使用此文件,但用于验证双向TLS中的客户端证书。 - -2. 将以下选项添加到 `my.cnf`: - - ```ini - [mysqld] - ssl-ca = /path/to/ca.crt - ssl-cert = /path/to/mysql.crt - ssl-key = /path/to/mysql.key - tls-version = TLSv1.2,TLSv1.3 - ``` - -3. 调整凭据的所有权和权限: - - ``` - chown mysql:mysql /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key - chmod 0600 /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key - ``` - -4. 重新启动MySQL以应用设置。 - -5. Gitea 的数据库用户可能已经创建过,但只会对运行 Gitea 的服务器的 IP 地址进行身份验证。要对其域名进行身份验证,请重新创建用户,并设置其需要通过 TLS 连接到数据库: - - ```sql - DROP USER 'gitea'@'192.0.2.10'; - CREATE USER 'gitea'@'example.gitea' IDENTIFIED BY 'gitea' REQUIRE SSL; - GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'example.gitea'; - FLUSH PRIVILEGES; - ``` - - 根据需要替换数据库用户名、密码和 Gitea 实例域名。 - -6. 确保用于验证数据库服务器证书的CA证书链位于数据库和 Gitea 服务器的系统证书存储中。请参考系统文档中有关将 CA 证书添加到证书存储的说明。 - -7. 在运行Gitea的服务器上,测试与数据库的连接: - - ``` - mysql -u gitea -h example.db -p --ssl - ``` - - 至此应该成功连接到数据库了。 diff --git a/docs/content/installation/from-binary.en-us.md b/docs/content/installation/from-binary.en-us.md deleted file mode 100644 index 88f82be322..0000000000 --- a/docs/content/installation/from-binary.en-us.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -date: "2017-06-19T12:00:00+02:00" -title: "Installation from binary" -slug: "install-from-binary" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /en-us/install-from-binary -menu: - sidebar: - parent: "installation" - name: "From binary" - sidebar_position: 15 - identifier: "install-from-binary" ---- - -# Installation from binary - -All downloads come with SQLite, MySQL and PostgreSQL support, and are built with -embedded assets. This can be different from Gogs. - -## Download - -You can find the file matching your platform from the [downloads page](https://dl.gitea.com/gitea/) after navigating to the version you want to download. - -### Choosing the right file - -**For Linux**, you will likely want `linux-amd64`. It's for 64-bit Intel/AMD platforms, but there are other platforms available, including `arm64` (e.g. Raspberry PI 4), `386` (i.e. 32-bit), `arm-5`, and `arm-6`. - -**For Windows**, you will likely want `windows-4.0-amd64`. It's for all modern versions of Windows, but there is also a `386` platform available designed for older, 32-bit versions of Windows. - -*Note: there is also a `gogit-windows` file available that was created to help with some [performance problems](https://github.com/go-gitea/gitea/pull/15482) reported by some Windows users on older systems/versions. You should consider using this file if you're experiencing performance issues, and let us know if it improves performance.* - -**For macOS**, you should choose `darwin-arm64` if your hardware uses Apple Silicon, or `darwin-amd64` for Intel. - -**For FreeBSD**, you should choose `freebsd12-amd64` for 64-bit Intel/AMD platforms. - -### Downloading with wget - -Copy the commands below and replace the URL within the one you wish to download. - -```sh -wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64 -chmod +x gitea -``` - -Note that the above command will download Gitea @version@ for 64-bit Linux. - -## Verify GPG signature - -Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teabot%40gitea.io) to prevent against unwanted modification of binaries. -To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the GPG command line tool. - -```sh -gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2 -gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64 -``` - -Look for the text `Good signature from "Teabot <teabot@gitea.io>"` to assert a good binary, -despite warnings like `This key is not certified with a trusted signature!`. - -## Recommended server configuration - -**NOTE:** Many of the following directories can be configured using [Environment Variables](administration/environment-variables.md) as well! -Of note, configuring `GITEA_WORK_DIR` will tell Gitea where to base its working directory, as well as ease installation. - -### Prepare environment - -Check that Git is installed on the server. If it is not, install it first. Gitea requires Git version >= 2.0. - -```sh -git --version -``` - -Create a user to run Gitea (e.g. `git`) - -```sh -# On Ubuntu/Debian: -adduser \ - --system \ - --shell /bin/bash \ - --gecos 'Git Version Control' \ - --group \ - --disabled-password \ - --home /home/git \ - git - -# On Fedora/RHEL/CentOS: -groupadd --system git -adduser \ - --system \ - --shell /bin/bash \ - --comment 'Git Version Control' \ - --gid git \ - --home-dir /home/git \ - --create-home \ - git -``` - -### Create required directory structure - -```sh -mkdir -p /var/lib/gitea/{custom,data,log} -chown -R git:git /var/lib/gitea/ -chmod -R 750 /var/lib/gitea/ -mkdir /etc/gitea -chown root:git /etc/gitea -chmod 770 /etc/gitea -``` - -> **NOTE:** `/etc/gitea` is temporarily set with write permissions for user `git` so that the web installer can write the configuration file. After the installation is finished, it is recommended to set permissions to read-only using: -> -> ```sh -> chmod 750 /etc/gitea -> chmod 640 /etc/gitea/app.ini -> ``` - -If you don't want the web installer to be able to write to the config file, it is possible to make the config file read-only for the Gitea user (owner/group `root:git`, mode `0640`) however you will need to edit your config file manually to: - -* Set `INSTALL_LOCK= true`, -* Ensure all database configuration details are set correctly -* Ensure that the `SECRET_KEY` and `INTERNAL_TOKEN` values are set. (You may want to use the `gitea generate secret` to generate these secret keys.) -* Ensure that any other secret keys you need are set. - -See the [command line documentation](administration/command-line.md) for information on using `gitea generate secret`. - -### Configure Gitea's working directory - -**NOTE:** If you plan on running Gitea as a Linux service, you can skip this step, as the service file allows you to set `WorkingDirectory`. Otherwise, consider setting this environment variable (semi-)permanently so that Gitea consistently uses the correct working directory. - -```sh -export GITEA_WORK_DIR=/var/lib/gitea/ -``` - -### Copy the Gitea binary to a global location - -```sh -cp gitea /usr/local/bin/gitea -``` - -### Adding bash/zsh autocompletion (from 1.19) - -A script to enable bash-completion can be found at [`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete). This can be copied to `/usr/share/bash-completion/completions/gitea` -or sourced within your `.bashrc`. - -Similarly a script for zsh-completion can be found at [`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete). This can be copied to `/usr/share/zsh/_gitea` or sourced within your -`.zshrc`. - -YMMV and these scripts may need further improvement. - -## Running Gitea - -After you complete the above steps, you can run Gitea two ways: - -### 1. Creating a service file to start Gitea automatically (recommended) - -See how to create [Linux service](installation/run-as-service-in-ubuntu.md) - -### 2. Running from command-line/terminal - -```sh -GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini -``` - -## Updating to a new version - -You can update to a new version of Gitea by stopping Gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance. -The binary file name should not be changed during the update to avoid problems in existing repositories. - -It is recommended that you make a [backup](administration/backup-and-restore.md) before updating your installation. - -If you have carried out the installation steps as described above, the binary should -have the generic name `gitea`. Do not change this, i.e. to include the version number. - -### 1. Restarting Gitea with systemd (recommended) - -As we explained before, we recommend to use systemd as the service manager. In this case, `systemctl restart gitea` should be fine. - -### 2. Restarting Gitea without systemd - -To restart your Gitea instance, we recommend to use SIGHUP signal. If you know your Gitea PID, use `kill -1 $GITEA_PID`, otherwise you can use `killall -1 gitea`. - -To gracefully stop the Gitea instance, a simple `kill $GITEA_PID` or `killall gitea` is enough. - -**NOTE:** We don't recommend to use the SIGKILL signal (`-9`); you may be forcefully stopping some of Gitea's internal tasks, and it will not gracefully stop (tasks in queues, indexers, etc.) - -See below for troubleshooting instructions to repair broken repositories after -an update of your Gitea version. - -## Troubleshooting - -### Old glibc versions - -Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the -Gitea binary, usually producing an error such as `./gitea: /lib/x86_64-linux-gnu/libc.so.6: -version 'GLIBC\_2.14' not found (required by ./gitea)`. This is due to the integrated -SQLite support in the binaries provided by dl.gitea.com. In this situation, it is usually -possible to [install from source](installation/from-source.md), without including -SQLite support. - -### Running Gitea on another port - -For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: -bind: address already in use`, Gitea needs to be started on another free port. This -is possible using `./gitea web -p $PORT`. It's possible another instance of Gitea -is already running. - -### Running Gitea on Raspbian - -As of v1.8, there is a problem with the arm7 version of Gitea, and it doesn't run on Raspberry Pis and similar devices. - -It is recommended to switch to the arm6 version, which has been tested and shown to work on Raspberry Pis and similar devices. - -<!--- -please remove after fixing the arm7 bug ----> -### Git error after updating to a new version of Gitea - -If during the update, the binary file name has been changed to a new version of Gitea, -Git Hooks in existing repositories will not work any more. In that case, a Git -error will be displayed when pushing to the repository. - -``` -remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory -``` - -The `[...]` part of the error message will contain the path to your previous Gitea -binary. - -To solve this, go to the admin options and run the task `Resynchronize pre-receive, -update and post-receive hooks of all repositories` to update all hooks to contain -the new binary path. Please note that this overwrites all Git Hooks, including ones -with customizations made. - -If you aren't using the Gitea built-in SSH server, you will also need to re-write -the authorized key file by running the `Update the '.ssh/authorized_keys' file with -Gitea SSH keys.` task in the admin options. diff --git a/docs/content/installation/from-binary.zh-cn.md b/docs/content/installation/from-binary.zh-cn.md deleted file mode 100644 index 216a6be51e..0000000000 --- a/docs/content/installation/from-binary.zh-cn.md +++ /dev/null @@ -1,214 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "使用二进制文件安装" -slug: "install-from-binary" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-cn/install-from-binary -menu: - sidebar: - parent: "installation" - name: "使用二进制文件安装" - sidebar_position: 15 - identifier: "install-from-binary" ---- - -# 使用二进制文件安装 - -所有打包的二进制程序均包含 SQLite,MySQL 和 PostgreSQL 的数据库连接支持,同时网站的静态资源均已嵌入到可执行程序中,这一点和曾经的 Gogs 有所不同。 - -## 下载 - -你可以从 [下载页面](https://dl.gitea.com/gitea/) 选择对应平台的二进制文件。 - -### 选择架构 - -- **对于 Linux**,`linux-amd64` 适用于 64-bit 的 Intel/AMD 平台。更多架构包含 `arm64` (Raspberry PI 4),`386` (32-bit),`arm-5` 以及 `arm-6`。 - -- **对于 Windows**,`windows-4.0-amd64` 适用于 64-bit 的 Intel/AMD 平台,`386` 适用于 32-bit 的 Intel/AMD 平台。(提示:`gogit-windows` 版本内建了 gogit 可能缓解在旧的 Windows 平台上 Go 程序调用 git 子程序时面临的 [性能问题](https://github.com/go-gitea/gitea/pull/15482)) - -- **对于 macOS**,`darwin-arm64` 适用于 Apple Silicon 架构,`darwin-amd64` 适用于 Intel 架构. - -- **对于 FreeBSD**,`freebsd12-amd64` 适用于 64-bit 的 Intel/AMD 平台。 - -### 使用 wget 下载 - -使用以下命令下载适用于 64-bit Linux 平台的二进制文件。 - -```sh -wget -O gitea https://dl.gitea.com/gitea/@version@/gitea-@version@-linux-amd64 -chmod +x gitea -``` - -## 验证 GPG 签名 - -Gitea 对打包的二进制文件使用 [GPG密钥](https://keys.openpgp.org/search?q=teabot%40gitea.io) 签名以防止篡改。 -请根据对应文件名 `.asc` 中包含的校验码检验文件的一致性。 - -```sh -gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2 -gpg --verify gitea-@version@-linux-amd64.asc gitea-@version@-linux-amd64 -``` - -校验正确时的信息为 `Good signature from "Teabot <teabot@gitea.io>"`。 -校验错误时的信息为 `This key is not certified with a trusted signature!`。 - -## 服务器设置 - -**提示:** `GITEA_WORK_DIR` 表示 Gitea 工作的路径。以下路径可以通过 [环境变量](administration/environment-variables.md) 初始化。 - -### 准备环境 - -检查是否安装 Git。要求 Git 版本 >= 2.0。 - -```sh -git --version -``` - -创建用户(推荐使用名称 `git`) - -```sh -# On Ubuntu/Debian: -adduser \ - --system \ - --shell /bin/bash \ - --gecos 'Git Version Control' \ - --group \ - --disabled-password \ - --home /home/git \ - git - -# On Fedora/RHEL/CentOS: -groupadd --system git -adduser \ - --system \ - --shell /bin/bash \ - --comment 'Git Version Control' \ - --gid git \ - --home-dir /home/git \ - --create-home \ - git -``` - -### 创建工作路径 - -```sh -mkdir -p /var/lib/gitea/{custom,data,log} -chown -R git:git /var/lib/gitea/ -chmod -R 750 /var/lib/gitea/ -mkdir /etc/gitea -chown root:git /etc/gitea -chmod 770 /etc/gitea -``` - -> **注意:** 为了让 Web 安装程序可以写入配置文件,我们临时为 `/etc/gitea` 路径授予了组外用户 `git` 写入权限。建议在安装结束后将配置文件的权限设置为只读。 -> -> ```sh -> chmod 750 /etc/gitea -> chmod 640 /etc/gitea/app.ini -> ``` - -如果您不希望通过 Web 安装程序创建配置文件,可以将配置文件设置为仅供 Gitea 用户只读(owner/group `root:git`, mode `0640`)并手工创建配置文件: - -- 设置 `INSTALL_LOCK=true` 关闭安装界面 -- 手动配置数据库连接参数 -- 使用 `gitea generate secret` 创建 `SECRET_KEY` 和 `INTERNAL_TOKEN` -- 提供所有必要的密钥 - -详情参考 [命令行文档](administration/command-line.md) 中有关 `gitea generate secret` 的内容。 - -### 配置 Gitea 工作路径 - -**提示:** 如果使用 Systemd 管理 Gitea 的 Linux 服务,你可以采用 `WorkingDirectory` 参数来配置工作路径。 否则,使用环境变量 `GITEA_WORK_DIR` 来明确指出程序工作和数据存放路径。 - -```sh -export GITEA_WORK_DIR=/var/lib/gitea/ -``` - -### 复制二进制文件到全局位置 - -```sh -cp gitea /usr/local/bin/gitea -``` - -### 添加 bash/zsh 自动补全(从 1.19 版本开始) - -可以在 [`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete) 找到启用 bash 自动补全的脚本。可以将其复制到 `/usr/share/bash-completion/completions/gitea`,或在 `.bashrc` 中引用。 - -同样地,zsh 自动补全的脚本可以在 [`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete) 找到。您可以将其复制到 `/usr/share/zsh/_gitea`,或在您的 `.zshrc` 中引用。 - -具体情况可能会有所不同,这些脚本可能需要进一步的改进。 - -## 运行 Gitea - -完成以上步骤后,可以通过两种方式运行 Gitea: - -### 1. 创建服务自动启动 Gitea(推荐) - -学习创建 [Linux 服务](installation/run-as-service-in-ubuntu.md) - -### 2. 通过命令行终端运行 - -```sh -GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini -``` - -## 升级到最新版本 - -您可以通过停止程序,替换 `/usr/local/bin/gitea` 并重启来更新到新版本。直接替换可执行程序时不要更改或使用新的文件名称,以避免数据出错。 - -建议您在更新之前进行[备份](administration/backup-and-restore.md)。 - -如果您按照上述描述执行了安装步骤,二进制文件的通用名称应为 gitea。请勿更改此名称,即不要包含版本号。 - -### 1. 使用 systemd 重新启动 Gitea(推荐) - -我们建议使用 systemd 作为服务管理器,使用 `systemctl restart gitea` 安全地重启程序。 - -### 2. 非 systemd 重启方法 - -使用 SIGHUP 信号关闭程序:查询到 Gitea 程序的 PID,使用 `kill -1 $GITEA_PID`,或者 `killall -1 gitea`。 - -更优雅的停止指令可能包括 `kill $GITEA_PID` 或者 `killall gitea`。 - -**提示:** 我们不建议使用 SIGKILL 信号(`-9`),这会强制停止 Gitea 程序,但不会正确关闭队列、索引器等任务。 - -请参阅下面的疑难解答说明,以在Gitea版本更新后修复损坏的仓库。 - -## 排查故障 - -### 旧版 glibc - -旧版 Linux 发行版(例如 Debian 7 和 CentOS 6)可能无法加载 Gitea 二进制文件,通常会产生类似于 `./gitea: /lib/x86_64-linux-gnu/libc.so.6: -version 'GLIBC\_2.14' not found (required by ./gitea)` 的错误。这是由于 dl.gitea.com 提供的二进制文件中集成了 SQLite 支持。在这种情况下,通常可以选择[从源代码安装](installation/from-source.md),而不包括 SQLite 支持。 - -### 在另一个端口上运行 Gitea - -对于出现类似于 `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: -bind: address already in use` 的错误,需要将 Gitea 启动在另一个空闲端口上。您可以使用 `./gitea web -p $PORT` 来实现。可能已经有另一个 Gitea 实例在运行。 - -### 在 Raspbian 上运行 Gitea - -从 v1.8 版本开始,arm7 版本的 Gitea 存在问题,无法在树莓派和类似设备上运行。 - -建议切换到 arm6 版本,该版本经过测试并已被证明可以在树莓派和类似设备上运行。 - -### 更新到新版本的 Gitea 后出现的 Git 错误 - -如果在更新过程中,二进制文件的名称已更改为新版本的 Gitea,则现有仓库中的 Git 钩子将不再起作用。在这种情况下,当推送到仓库时,会显示 Git 错误。 - -``` -remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory -``` - -错误信息中的 `[...]` 部分将包含您先前 Gitea 二进制文件的路径。 - -要解决此问题,请转到管理选项,并运行任务 `Resynchronize pre-receive, update and post-receive hooks of all repositories`,以将所有钩子更新为包含新的二进制文件路径。请注意,这将覆盖所有 Git 钩子,包括自定义的钩子。 - -如果您没有使用 Gitea 内置的 SSH 服务器,您还需要通过在管理选项中运行任务 `Update the '.ssh/authorized_keys' file with Gitea SSH keys.` 来重新编写授权密钥文件。 - -> 更多经验总结,请参考英文版 [Troubleshooting](https://docs.gitea.com/installation/install-from-binary#troubleshooting) - -如果从本页中没有找到你需要的内容,请访问 [帮助页面](help/support.md) diff --git a/docs/content/installation/from-package.en-us.md b/docs/content/installation/from-package.en-us.md deleted file mode 100644 index aceb2029d2..0000000000 --- a/docs/content/installation/from-package.en-us.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Installation from package" -slug: "install-from-package" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /en-us/install-from-package -menu: - sidebar: - parent: "installation" - name: "From package" - sidebar_position: 20 - identifier: "install-from-package" ---- - -# Installation from Package - -## Official packages - -### macOS - -Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/). -Following the [deployment from binary](installation/from-binary.md) guide may work, -but is not supported. To install Gitea via `brew`: - -``` -brew install gitea -``` - -## Unofficial packages - -### Alpine Linux - -Alpine Linux has [Gitea](https://pkgs.alpinelinux.org/packages?name=gitea&branch=edge) in its community repository which follows the latest stable version. - -```sh -apk add gitea -``` - -### Arch Linux - -The rolling release distribution has [Gitea](https://www.archlinux.org/packages/extra/x86_64/gitea/) in their official extra repository and package updates are provided with new Gitea releases. - -```sh -pacman -S gitea -``` - -### Arch Linux ARM - -Arch Linux ARM provides packages for [aarch64](https://archlinuxarm.org/packages/aarch64/gitea), [armv7h](https://archlinuxarm.org/packages/armv7h/gitea) and [armv6h](https://archlinuxarm.org/packages/armv6h/gitea). - -```sh -pacman -S gitea -``` - -### Gentoo Linux - -The rolling release distribution has [Gitea](https://packages.gentoo.org/packages/www-apps/gitea) in their official community repository and package updates are provided with new Gitea releases. - -```sh -emerge gitea -va -``` - -### Canonical Snap - -There is a [Gitea Snap](https://snapcraft.io/gitea) package which follows the latest stable version. -*Note: The Gitea snap package is [strictly confined](https://snapcraft.io/docs/snap-confinement). Strictly confined snaps run in complete isolation, so some of the Gitea functionals may not work with the confinement* - -```sh -snap install gitea -``` - -### SUSE and openSUSE - -OpenSUSE build service provides packages for [openSUSE and SLE](https://software.opensuse.org/download/package?package=gitea&project=devel%3Atools%3Ascm) -in the Development Software Configuration Management Repository - -### Windows - -There is a [Gitea](https://chocolatey.org/packages/gitea) package for Windows by [Chocolatey](https://chocolatey.org/). - -```sh -choco install gitea -``` - -Or follow the [deployment from binary](installation/from-binary.md) guide. - -### FreeBSD - -A FreeBSD port `www/gitea` is available. To install the pre-built binary package: - -``` -pkg install gitea -``` - -For the most up to date version, or to build the port with custom options, -[install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html): - -``` -su - -cd /usr/ports/www/gitea -make install clean -``` - -The port uses the standard FreeBSD file system layout: config files are in `/usr/local/etc/gitea`, -bundled templates, options, plugins and themes are in `/usr/local/share/gitea`, and a start script -is in `/usr/local/etc/rc.d/gitea`. - -To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. - -### Others - -Various other third-party packages of Gitea exist. -To see a curated list, head over to [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages). - -Do you know of an existing package that isn't on the list? Send in a PR to get it added! diff --git a/docs/content/installation/from-package.zh-cn.md b/docs/content/installation/from-package.zh-cn.md deleted file mode 100644 index 929782f23c..0000000000 --- a/docs/content/installation/from-package.zh-cn.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "使用包管理器安装" -slug: "install-from-package" -sidebar_position: 20 -toc: false -draft: false -aliases: - - /zh-cn/install-from-package -menu: - sidebar: - parent: "installation" - name: "使用包管理器安装" - sidebar_position: 20 - identifier: "install-from-package" ---- - -# 官方包管理器 - -## macOS - -macOS 平台下当前我们仅支持通过 `brew` 来安装。如果你没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装](installation/from-binary.md)。在你安装了 `brew` 之后, 你可以执行以下命令: - -``` -brew install gitea -``` - -# 非官方包管理器 - -## Alpine Linux - -Gitea 已经包含在 Alpine Linux 的[社区存储库](https://pkgs.alpinelinux.org/packages?name=gitea&branch=edge)中,版本与 Gitea 官方保持同步。 - -```sh -apk add gitea -``` - -## Arch Linux - -Gitea 已经在滚动发布发行版的官方[社区存储库](https://www.archlinux.org/packages/community/x86_64/gitea/)中,版本与 Gitea 官方保持同步。 - -```sh -pacman -S gitea -``` - -## Arch Linux ARM - -官方支持 [aarch64](https://archlinuxarm.org/packages/aarch64/gitea), [armv7h](https://archlinuxarm.org/packages/armv7h/gitea) 和 [armv6h](https://archlinuxarm.org/packages/armv6h/gitea) 架构。 - -```sh -pacman -S gitea -``` - -## Gentoo Linux - -滚动发布的发行版在其官方社区软件仓库中提供了 [Gitea](https://packages.gentoo.org/packages/www-apps/gitea),并且会随着新的 Gitea 发布提供软件包更新。 - -```sh -emerge gitea -va -``` - -## Canonical Snap - -目前 Gitea 已在 Snap Store 中发布,名称为 [gitea](https://snapcraft.io/gitea)。 - -```sh -snap install gitea -``` - -## SUSE/openSUSE - -OpenSUSE 构建服务为 [openSUSE 和 SLE](https://software.opensuse.org/download/package?package=gitea&project=devel%3Atools%3Ascm) -提供包,你可以在开发软件配置管理存储库中找到它们。 - -## Windows - -目前你可以通过 [Chocolatey](https://chocolatey.org/) 来安装 [Gitea](https://chocolatey.org/packages/gitea)。 - -```sh -choco install gitea -``` - -你也可以 [从二进制安装](installation/from-binary.md) 。 - -## FreeBSD - -可以使用 Gitea 的 FreeBSD port `www/gitea`。 请安装预构建的二进制包: - -``` -pkg install gitea -``` - -对于最新版本,或使用自定义选项构建 port,请 -[从 port 安装](https://www.freebsd.org/doc/handbook/ports-using.html): - -``` -su - -cd /usr/ports/www/gitea -make install clean -``` - -该 port 使用标准的 FreeBSD 文件系统布局:配置文件在 `/usr/local/etc/gitea` 目录中, -模板、选项、插件和主题在 `/usr/local/share/gitea` 目录中,启动脚本在 `/usr/local/etc/rc.d/gitea` 目录中。 - -要使 Gitea 作为服务运行,请运行 `sysrc gitea_enable=YES` 并使用 `service gitea start` 命令启动它。 - -## 第三方 - -如果这里没有找到你喜欢的包管理器,可以使用 Gitea 第三方软件包。这里有一个完整的列表: [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages)。 - -如果你知道其他 Gitea 第三方软件包,请发送 PR 来添加它。 diff --git a/docs/content/installation/from-source.en-us.md b/docs/content/installation/from-source.en-us.md deleted file mode 100644 index cd9fd56511..0000000000 --- a/docs/content/installation/from-source.en-us.md +++ /dev/null @@ -1,262 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Installation from source" -slug: "install-from-source" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /en-us/install-from-source -menu: - sidebar: - parent: "installation" - name: "From source" - sidebar_position: 30 - identifier: "install-from-source" ---- - -# Installation from source - -You should [install go](https://go.dev/doc/install) and set up your go -environment correctly. In particular, it is recommended to set the `$GOPATH` -environment variable and to add the go bin directory or directories -`${GOPATH//://bin:}/bin` to the `$PATH`. See the Go wiki entry for -[GOPATH](https://github.com/golang/go/wiki/GOPATH). - -Next, [install Node.js with npm](https://nodejs.org/en/download/) which is -required to build the JavaScript and CSS files. The minimum supported Node.js -version is @minNodeVersion@ and the latest LTS version is recommended. - -**Note**: Go version @minGoVersion@ or higher is required. However, it is recommended to -obtain the same version as our continuous integration, see the advice given in -[Hacking on Gitea](development/hacking-on-gitea.md) - -## Download - -First, we must retrieve the source code. Since, the advent of go modules, the -simplest way of doing this is to use Git directly as we no longer have to have -Gitea built from within the GOPATH. - -```bash -git clone https://github.com/go-gitea/gitea -``` - -(Previous versions of this document recommended using `go get`. This is -no longer necessary.) - -Decide which version of Gitea to build and install. Currently, there are -multiple options to choose from. The `main` branch represents the current -development version. To build with main, skip to the [build section](#build). - -To work with tagged releases, the following commands can be used: - -```bash -git branch -a -git checkout v@version@ -``` - -To validate a Pull Request, first enable the new branch (`xyz` is the PR id; -for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)): - -```bash -git fetch origin pull/xyz/head:pr-xyz -``` - -To build Gitea from source at a specific tagged release (like v@version@), list the -available tags and check out the specific tag. - -List available tags with the following. - -```bash -git tag -l -git checkout v@version@ # or git checkout pr-xyz -``` - -## Build - -To build from source, the following programs must be present on the system: - -- `go` @minGoVersion@ or higher, see [here](https://go.dev/dl/) -- `node` @minNodeVersion@ or higher with `npm`, see [here](https://nodejs.org/en/download/) -- `make`, see [here](development/hacking-on-gitea.md#installing-make) - -Various [make tasks](https://github.com/go-gitea/gitea/blob/main/Makefile) -are provided to keep the build process as simple as possible. - -Depending on requirements, the following build tags can be included. - -- `bindata`: Build a single monolithic binary, with all assets included. Required for production build. -- `sqlite sqlite_unlock_notify`: Enable support for a - [SQLite3](https://sqlite.org/) database. Suggested only for tiny - installations. -- `pam`: Enable support for PAM (Linux Pluggable Authentication Modules). Can - be used to authenticate local users or extend authentication to methods - available to PAM. -- `gogit`: (EXPERIMENTAL) Use go-git variants of Git commands. - -Bundling all assets (JS/CSS/templates, etc) into the binary. Using the `bindata` build tag is required for -production deployments. You could exclude `bindata` when you are developing/testing Gitea or able to separate the assets correctly. - -To include all assets, use the `bindata` tag: - -```bash -TAGS="bindata" make build -``` - -In the default release build of our continuous integration system, the build -tags are: `TAGS="bindata sqlite sqlite_unlock_notify"`. The simplest -recommended way to build from source is therefore: - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -The `build` target is split into two sub-targets: - -- `make backend` which requires [Go @minGoVersion@](https://go.dev/dl/) or greater. -- `make frontend` which requires [Node.js @minNodeVersion@](https://nodejs.org/en/download/) or greater. - -If pre-built frontend files are present it is possible to only build the backend: - -```bash -TAGS="bindata" make backend -``` - -## Test - -After following the steps above, a `gitea` binary will be available in the working directory. -It can be tested from this directory or moved to a directory with test data. When Gitea is -launched manually from command line, it can be killed by pressing `Ctrl + C`. - -```bash -./gitea web -``` - -## Changing default paths - -Gitea will search for a number of things from the _`CustomPath`_. By default this is -the `custom/` directory in the current working directory when running Gitea. It will also -look for its configuration file _`CustomConf`_ in `$(CustomPath)/conf/app.ini`, and will use the -current working directory as the relative base path _`AppWorkPath`_ for a number configurable -values. Finally the static files will be served from _`StaticRootPath`_ which defaults to the _`AppWorkPath`_. - -These values, although useful when developing, may conflict with downstream users preferences. - -One option is to use a script file to shadow the `gitea` binary and create an appropriate -environment before running Gitea. However, when building you can change these defaults -using the `LDFLAGS` environment variable for `make`. The appropriate settings are as follows - -- To set the _`CustomPath`_ use `LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""` -- For _`CustomConf`_ you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"` -- For _`AppWorkPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"` -- For _`StaticRootPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"` -- To change the default PID file location use `-X \"code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid\"` - -Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build` -with the appropriate `TAGS` as above. - -Running `gitea help` will allow you to review what the computed settings will be for your `gitea`. - -## Cross Build - -The `go` compiler toolchain supports cross-compiling to different architecture targets that are supported by the toolchain. See [`GOOS` and `GOARCH` environment variable](https://go.dev/doc/install/source#environment) for the list of supported targets. Cross compilation is helpful if you want to build Gitea for less-powerful systems (such as Raspberry Pi). - -To cross build Gitea with build tags (`TAGS`), you also need a C cross compiler which targets the same architecture as selected by the `GOOS` and `GOARCH` variables. For example, to cross build for Linux ARM64 (`GOOS=linux` and `GOARCH=arm64`), you need the `aarch64-unknown-linux-gnu-gcc` cross compiler. This is required because Gitea build tags uses `cgo`'s foreign-function interface (FFI). - -Cross-build Gitea for Linux ARM64, without any tags: - -``` -GOOS=linux GOARCH=arm64 make build -``` - -Cross-build Gitea for Linux ARM64, with recommended build tags: - -``` -CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -Replace `CC`, `GOOS`, and `GOARCH` as appropriate for your architecture target. - -You will sometimes need to build a static compiled image. To do this you will need to add: - -``` -LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="netgo osusergo $TAGS" make build -``` - -This can be combined with `CC`, `GOOS`, and `GOARCH` as above. - -### Adding bash/zsh autocompletion (from 1.19) - -A script to enable bash-completion can be found at [`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete). This should be altered as appropriate and can be `source` in your `.bashrc` -or copied as `/usr/share/bash-completion/completions/gitea`. - -Similarly, a script for zsh-completion can be found at [`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete). This can be copied to `/usr/share/zsh/_gitea` or sourced within your -`.zshrc`. - -YMMV and these scripts may need further improvement. - -## Compile or cross-compile using Linux with Zig - -Follow [Getting Started of Zig](https://ziglang.org/learn/getting-started/#installing-zig) to install zig. - -- Compile (Linux ➝ Linux) - -```sh -CC="zig cc -target x86_64-linux-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -CGO_LDFLAGS="-linkmode=external -v" -GOOS=linux \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -- Cross-compile (Linux ➝ Windows) - -```sh -CC="zig cc -target x86_64-windows-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -GOOS=windows \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -## Compile or cross-compile with Zig using Windows - -Compile with `GIT BASH`. - -- Compile (Windows ➝ Windows) - -```sh -CC="zig cc -target x86_64-windows-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -GOOS=windows \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -- Cross-compile (Windows ➝ Linux) - -```sh -CC="zig cc -target x86_64-linux-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -CGO_LDFLAGS="-linkmode=external -v" -GOOS=linux \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -## Source Maps - -By default, gitea generates reduced source maps for frontend files to conserve space. This can be controlled with the `ENABLE_SOURCEMAP` environment variable: - -- `ENABLE_SOURCEMAP=true` generates all source maps, the default for development builds -- `ENABLE_SOURCEMAP=reduced` generates limited source maps, the default for production builds -- `ENABLE_SOURCEMAP=false` generates no source maps diff --git a/docs/content/installation/from-source.zh-cn.md b/docs/content/installation/from-source.zh-cn.md deleted file mode 100644 index 3ff7efb4ed..0000000000 --- a/docs/content/installation/from-source.zh-cn.md +++ /dev/null @@ -1,227 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "使用源代码安装" -slug: "install-from-source" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /zh-cn/install-from-source -menu: - sidebar: - parent: "installation" - name: "使用源代码安装" - sidebar_position: 30 - identifier: "install-from-source" ---- - -# 使用源代码安装 - -你需要 [安装Go](https://golang.google.cn/doc/install) 并正确设置Go环境。特别的,建议设置`$GOPATH`环境变量,并将 Go 的二进制目录或目录`${GOPATH//://bin:}/bin`添加到`$PATH`中。请参阅 Go 百科上关于 [GOPATH](https://github.com/golang/go/wiki/GOPATH) 的词条。 - -接下来,[安装 Node.js 和 npm](https://nodejs.org/zh-cn/download/), 这是构建 JavaScript 和 CSS 文件所需的。最低支持的 Node.js 版本是 @minNodeVersion@,建议使用最新的 LTS 版本。 - -**注意**:需要 Go 版本 @minGoVersion@ 或更高版本。不过,建议获取与我们的持续集成(continuous integration, CI)相同的版本,请参阅在 [Hacking on Gitea](development/hacking-on-gitea.md) 中给出的建议。 - -## 下载 - -首先,我们需要获取源码。由于引入了 Go 模块,最简单的方法是直接使用 Git,因为我们不再需要在 GOPATH 内构建 Gitea。 - -```bash -git clone https://github.com/go-gitea/gitea -``` - -(之前的版本中建议使用 `go get`,但现在不再需要。) - -你可以选择编译和安装的版本,当前有多个选择。`main` 分支代表当前的开发版本。如果你想编译 `main` 版本,你可以直接跳到 [构建](#构建) 部分。 - -如果你想编译带有标签的发行版本,可以使用以下命令签出: - -```bash -git branch -a -git checkout v@version@ -``` - -要验证一个拉取请求(Pull Request, PR),要先启用新的分支(其中 `xyz` 是 PR 的 ID;例如,对于 [#2663](https://github.com/go-gitea/gitea/pull/2663),ID是 `2663 `): - -```bash -git fetch origin pull/xyz/head:pr-xyz -``` - -要以指定发行版本(如 v@version@ )的源代码来构建 Gitea,可执行以下命令列出可用的版本并选择某个版本签出。 -使用以下命令列出可用的版本: - -```bash -git tag -l -git checkout v@version@ # or git checkout pr-xyz -``` - -## 构建 - -要从源代码进行构建,系统必须预先安装以下程序: - -- `go` @minGoVersion@ 或更高版本,请参阅 [这里](https://go.dev/dl/) -- `node` @minNodeVersion@ 或更高版本,并且安装 `npm`, 请参阅 [这里](https://nodejs.org/zh-cn/download/) -- `make`, 请参阅 [这里](development/hacking-on-gitea.md) - -为了尽可能简化编译过程,提供了各种 [make任务](https://github.com/go-gitea/gitea/blob/main/Makefile)。 - -根据你的构建需求,以下 tags 可以使用: - -- `bindata`: 构建一个单一的整体二进制文件,包含所有资源。适用于构建生产环境版本。 -- `sqlite sqlite_unlock_notify`: 启用对 [SQLite3](https://sqlite.org/) 数据库的支持。仅建议在少数人使用时使用这个模式。 -- `pam`: 启用对 PAM( Linux 可插拔认证模块)的支持。可用于对本地用户进行身份验证或扩展身份验证到 PAM 可用的方法。 -- `gogit`:(实验性功能)使用 go-git 变体的 Git 命令。 - -将所有资源(JS/CSS/模板等)打包到二进制文件中。在生产环境部署时,使用`bindata`构建标签是必需的。在开发/测试 Gitea 或能够明确分离资源时,可以不用`bindata`。 - -要包含所有资源,请使用 `bindata` 标签: - -```bash -TAGS="bindata" make build -``` - -在我们的持续集成系统的默认发行版中,构建标签为:`TAGS="bindata sqlite sqlite_unlock_notify"`。因此,从源码构建的最简单、推荐方式是: - -```bash -TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -`build`目标分为两个子目标: - -- `make backend` 需要 [Go @minGoVersion@](https://golang.google.cn/doc/install) 或更高版本。 -- `make frontend` 需要 [Node.js @minNodeVersion@](https://nodejs.org/zh-cn/download/) 或更高版本。 - -如果存在预构建的前端文件,可以仅构建后端: - -```bash -TAGS="bindata" make backend -``` - -## 测试 - -按照上述步骤完成后,工作目录中将会有一个`gitea`二进制文件。可以从该目录进行测试,或将其移动到带有测试数据的目录中。当手动从命令行启动 Gitea 时,可以通过按下`Ctrl + C`来停止程序。 - -```bash -./gitea web -``` - -## 更改默认路径 - -Gitea 将从`CustomPath`中查找许多信息。默认的,这会在运行 Gitea 时当前工作目录下的`custom/`目录中(译者案:即`$PATH_TO_YOUR_GITEA$/custom/`)。它还将在`$(CustomPath)/conf/app.ini`中查找其配置文件`CustomConf`,并将当前工作目录用作一些可配置值的相对基本路径`AppWorkPath`。最后,静态文件将从默认为 `AppWorkPath`的`StaticRootPath`提供。 - -尽管在开发时这些值很有用,但可能与下游用户的偏好冲突。 - -一种选择是使用脚本文件来隐藏`gitea`二进制文件,并在运行Gitea之前创建适当的环境。然而,在构建时,可以使用`make`的`LDFLAGS`环境变量来更改这些默认值。适当的设置如下: - -- 要设置`CustomPath`,请使用`LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""` -- 对于`CustomConf`,应该使用`-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"` -- 对于`AppWorkPath`,应该使用`-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"` -- 对于`StaticRootPath`,应该使用`-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"` -- 要更改默认的 PID 文件位置,请使用`-X \"code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid\"` - -将这些字符串与其前导的`-X`添加到`LDFLAGS`变量中,并像上面那样使用适当的`TAGS`运行`make build`。 - -运行`gitea help`将允许您查看配置的`gitea`设置。 - -## 交叉编译 - -`go`编译器工具链支持将代码交叉编译到不同的目标架构上。请参考[`GOOS`和`GOARCH`环境变量](https://go.dev/doc/install/source#environment) 以获取支持的目标列表。如果您想为性能较弱的系统(如树莓派)构建 Gitea,交叉编译非常有用。 - -要使用构建标签(`TAGS`)进行交叉编译Gitea,您还需要一个 C 交叉编译器,该编译器的目标架构与`GOOS`和`GOARCH`变量选择的架构相同。例如,要为 Linux ARM64(`GOOS=linux`和`GOARCH=arm64`)进行交叉编译,您需要`aarch64-unknown-linux-gnu-gcc`交叉编译器。这是因为 Gitea 构建标签使用了`cgo`的外部函数接口(FFI)。 - -在没有任何标签的情况下,交叉编译的 Gitea 为 Linux ARM64 版本: - -``` -GOOS=linux GOARCH=arm64 make build -``` - -要交叉编译 Linux ARM64 下的Gitea,这是推荐的构建标签: - -``` -CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sqlite_unlock_notify" make build -``` - -根据您的目标架构,适当替换`CC`、`GOOS`和`GOARCH`。 - -有时您需要构建一个静态编译的镜像。为此,您需要添加以下内容: - -``` -LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="netgo osusergo $TAGS" make build -``` - -这可以与上述的`CC`、`GOOS`和`GOARCH`结合使用。 - -### 添加 bash/zsh 自动补全(从 1.19 版本起) - -在[`contrib/autocompletion/bash_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete)中可以找到一个启用 bash 自动补全的脚本。您可以根据需要进行修改,并在您的 `.bashrc` 中使用 `source` 命令加载该脚本,或者将其复制到 `/usr/share/bash-completion/completions/gitea`。 - -类似地,可以在[`contrib/autocompletion/zsh_autocomplete`](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/zsh_autocomplete)中找到一个用于 zsh 自动补全的脚本。您可以将其复制到 `/usr/share/zsh/_gitea`,或者在您的 `.zshrc` 中使用 `source` 命令加载该脚本。 - -可能需要你根据具体情况进一步改进这些脚本。 - -## 在 Linux 上使用 Zig 进行编译或交叉编译 - -请按照 [Zig 的入门指南](https://ziglang.org/learn/getting-started/#installing-zig) 安装 Zig。 - -- 编译 (Linux ➝ Linux) - -```sh -CC="zig cc -target x86_64-linux-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -CGO_LDFLAGS="-linkmode=external -v" -GOOS=linux \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -- 交叉编译 (Linux ➝ Windows) - -```sh -CC="zig cc -target x86_64-windows-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -GOOS=windows \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -## 在 Windows 上使用 Zig 进行编译或交叉编译 - -使用`GIT BASH`编译。 - -- 编译 (Windows ➝ Windows) - -```sh -CC="zig cc -target x86_64-windows-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -GOOS=windows \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -- 交叉编译 (Windows ➝ Linux) - -```sh -CC="zig cc -target x86_64-linux-gnu" \ -CGO_ENABLED=1 \ -CGO_CFLAGS="-O2 -g -pthread" \ -CGO_LDFLAGS="-linkmode=external -v" -GOOS=linux \ -GOARCH=amd64 \ -TAGS="bindata sqlite sqlite_unlock_notify" \ -make build -``` - -## Source Map - -默认情况下,gitea 会为前端文件生成精简的 Source Map 以节省空间。 这可以通过“ENABLE_SOURCEMAP”环境变量进行控制: - -- `ENABLE_SOURCEMAP=true` 生成所有Source Map,这是开发版本的默认设置 -- `ENABLE_SOURCEMAP=reduced` 生成有限的Source Map,这是生产版本的默认设置 -- `ENABLE_SOURCEMAP=false` 不生成Source Map diff --git a/docs/content/installation/on-cloud-provider.en-us.md b/docs/content/installation/on-cloud-provider.en-us.md deleted file mode 100644 index d5baece8ca..0000000000 --- a/docs/content/installation/on-cloud-provider.en-us.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Install on Cloud Provider" -slug: "install-on-cloud-provider" -sidebar_position: 90 -toc: false -draft: false -aliases: - - /en-us/install-on-cloud-provider -menu: - sidebar: - parent: "installation" - name: "On cloud provider" - sidebar_position: 90 - identifier: "install-on-cloud-provider" ---- - -# Installation on Cloud Provider - -## Cloudron - -Gitea is available as a 1-click install on [Cloudron](https://cloudron.io). -Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure. - -[![Install](/cloudron.svg)](https://cloudron.io/button.html?app=io.gitea.cloudronapp) - -The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app). - -There is a [demo instance](https://my.demo.cloudron.io) (username: cloudron password: cloudron) where -you can experiment with running Gitea. - -## Vultr - -Gitea can be found in [Vultr](https://www.vultr.com)'s marketplace. - -To deploy Gitea to Vultr, have a look at the [Vultr Marketplace](https://www.vultr.com/marketplace/apps/gitea). - -## DigitalOcean - -[DigitalOcean](https://www.digitalocean.com) has Gitea as droplet in their marketplace. - -To deploy Gitea to DigitalOcean, have a look at the [DigitalOcean Marketplace](https://marketplace.digitalocean.com/apps/gitea). - -## Linode - -[Linode](https://www.linode.com/) has Gitea as an app in their marketplace. - -To deploy Gitea to Linode, have a look at the [Linode Marketplace](https://www.linode.com/marketplace/apps/linode/gitea/). - -## alwaysdata - -[alwaysdata](https://www.alwaysdata.com/) has Gitea as an app in their marketplace. - -To deploy Gitea to alwaysdata, have a look at the [alwaysdata Marketplace](https://www.alwaysdata.com/en/marketplace/gitea/). - -## Exoscale - -[Exoscale](https://www.exoscale.com/) provides Gitea managed by [Glasskube](https://glasskube.eu/) in their marketplace. - -Exoscale is a European cloud service provider. - -The package is maintained and update via the open source [Glasskube Kubernetes Operator](https://github.com/glasskube/operator). - -To deploy Gitea to Exoscale, have a look at the [Exoscale Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/). diff --git a/docs/content/installation/on-cloud-provider.zh-cn.md b/docs/content/installation/on-cloud-provider.zh-cn.md deleted file mode 100644 index 7b9a7bdf40..0000000000 --- a/docs/content/installation/on-cloud-provider.zh-cn.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "在云服务器中安装 Gitea" -slug: "install-on-cloud-provider" -sidebar_position: 90 -toc: false -draft: false -aliases: - - /zh-cn/install-on-cloud-provider -menu: - sidebar: - parent: "installation" - name: "在云服务器中安装 Gitea" - sidebar_position: 90 - identifier: "install-on-cloud-provider" ---- - -# 在云服务器上安装 Gitea - -## Cloudron - -Gitea 可以在 [Cloudron](https://cloudron.io) 上进行一键安装。 -Cloudron 使得在您的服务器上运行 Gitea,并保持其更新和安全变得简单。 - -[![Install](/cloudron.svg)](https://cloudron.io/button.html?app=io.gitea.cloudronapp) - -Gitea软件包的维护地址在[这里](https://git.cloudron.io/cloudron/gitea-app). - -这里有一个[demo 实例](https://my.demo.cloudron.io) (用户名: cloudron 密码: cloudron) 您可以在其中尝试运行Gitea。 - -## Vultr - -Gitea 可以在 [Vultr](https://www.vultr.com) 的市场中被找到。 - -要将 Gitea 部署到 Vultr,请参考 [Vultr Marketplace](https://www.vultr.com/marketplace/apps/gitea). - -## DigitalOcean - -[DigitalOcean](https://www.digitalocean.com) 将 Gitea 作为其市场中的一个 droplet。 - -要将 Gitea 部署到 DigitalOcean, 请参考 [DigitalOcean Marketplace](https://marketplace.digitalocean.com/apps/gitea). - -## Linode - -[Linode](https://www.linode.com/) 将 Gitea 作为其市场中的一个应用程序. - -要将 Gitea 部署到 Linode, 请参考 [Linode Marketplace](https://www.linode.com/marketplace/apps/linode/gitea/). - -## alwaysdata - -[alwaysdata](https://www.alwaysdata.com/) 将 Gitea 作为其市场中的一个 droplet. - -要将 Gitea 部署到 alwaysdata, 请参考 [alwaysdata Marketplace](https://www.alwaysdata.com/en/marketplace/gitea/). - -## Exoscale - -[Exoscale](https://www.exoscale.com/) 在其市场中提供由 [Glasskube](https://glasskube.eu/) 管理的 Gitea。 - -Exoscale 是一家欧洲的云服务提供商。 - -该软件包通过开源的 [Glasskube Kubernetes Operator](https://github.com/glasskube/operator) 进行维护和更新。 - -要在 Exoscale 上部署 Gitea,请参考 [Exoscale Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/)。 diff --git a/docs/content/installation/on-kubernetes.en-us.md b/docs/content/installation/on-kubernetes.en-us.md deleted file mode 100644 index 00f2aab28d..0000000000 --- a/docs/content/installation/on-kubernetes.en-us.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -date: "2020-03-19T19:27:00+02:00" -title: "Install on Kubernetes" -slug: "install-on-kubernetes" -sidebar_position: 80 -toc: false -draft: false -aliases: - - /en-us/install-on-kubernetes -menu: - sidebar: - parent: "installation" - name: "Kubernetes" - sidebar_position: 80 - identifier: "install-on-kubernetes" ---- - -# Installation with Helm (on Kubernetes) - -Gitea provides a Helm Chart to allow for installation on kubernetes. - -A non-customized install can be done with: - -``` -helm repo add gitea-charts https://dl.gitea.com/charts/ -helm install gitea gitea-charts/gitea -``` - -If you would like to customize your install, which includes kubernetes ingress, please refer to the complete [Gitea helm chart configuration details](https://gitea.com/gitea/helm-chart/) - -## Health check endpoint - -Gitea comes with a health check endpoint `/api/healthz`, you can configure it in kubernetes like this: - -```yaml - livenessProbe: - httpGet: - path: /api/healthz - port: http - initialDelaySeconds: 200 - timeoutSeconds: 5 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 10 -``` - -a successful health check response will respond with http code `200`, here's example: - -``` -HTTP/1.1 200 OK - -{ - "status": "pass", - "description": "Gitea: Git with a cup of tea", - "checks": { - "cache:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ], - "database:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ] - } -} -``` - -for more information, please reference to kubernetes documentation [Define a liveness HTTP request](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request) diff --git a/docs/content/installation/on-kubernetes.zh-cn.md b/docs/content/installation/on-kubernetes.zh-cn.md deleted file mode 100644 index 1af55d874b..0000000000 --- a/docs/content/installation/on-kubernetes.zh-cn.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -date: "2020-03-19T19:27:00+02:00" -title: "在 Kubernetes 中安装 Gitea" -slug: "install-on-kubernetes" -sidebar_position: 80 -toc: false -draft: false -aliases: - - /zh-cn/install-on-kubernetes -menu: - sidebar: - parent: "installation" - name: "在 Kubernetes 中安装 Gitea" - sidebar_position: 80 - identifier: "install-on-kubernetes" ---- - -# 使用 Helm 在 Kubernetes 云原生环境中安装 Gitea - -Gitea 已经提供了便于在 Kubernetes 云原生环境中安装所需的 Helm Chart - -默认安装指令为: - -```bash -helm repo add gitea https://dl.gitea.com/charts -helm repo update -helm install gitea gitea/gitea -``` - -如果采用默认安装指令,Helm 会部署单实例的 Gitea, PostgreSQL, Memcached。若您想实现自定义安装(包括配置 Gitea 集群、NGINX Ingress、MySQL、MariaDB、持久存储等),请前往阅读:[Gitea Helm Chart](https://gitea.com/gitea/helm-chart/) - -您也可以通过 `helm show` 命令导出 `README.md` 和配置文件 `values.yaml` 进行学习和编辑,例如: - -```bash -helm show values gitea/gitea > values.yaml -helm show readme gitea/gitea > README.md - -# 使用自定义的配置文件 values.yaml -helm install gitea -f values.yaml gitea/gitea -``` - -## 运行状况检查接口 - -Gitea 附带了一个运行状况检查接口 `/api/healthz`,你可以像这样在 Kubernetes 中配置它: - -```yaml - livenessProbe: - httpGet: - path: /api/healthz - port: http - initialDelaySeconds: 200 - timeoutSeconds: 5 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 10 -``` - -成功的运行状况检查响应代码为 HTTP `200`,下面是示例: - -``` -HTTP/1.1 200 OK - -{ - "status": "pass", - "description": "Gitea: Git with a cup of tea", - "checks": { - "cache:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ], - "database:ping": [ - { - "status": "pass", - "time": "2022-02-19T09:16:08Z" - } - ] - } -} -``` - -有关更多信息,请参考 Kubernetes 文档 [配置存活、就绪和启动探测器](https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) diff --git a/docs/content/installation/run-as-service-in-ubuntu.en-us.md b/docs/content/installation/run-as-service-in-ubuntu.en-us.md deleted file mode 100644 index 4e169d6bcc..0000000000 --- a/docs/content/installation/run-as-service-in-ubuntu.en-us.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -date: "2017-07-21T12:00:00+02:00" -title: "Run as a Linux service" -slug: "linux-service" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /en-us/linux-service -menu: - sidebar: - parent: "installation" - name: "Linux service" - sidebar_position: 40 - identifier: "linux-service" ---- - -# Run as a Linux service - -You can run Gitea as a Linux service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification). - -## Using systemd - -Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor. - -Uncomment any service that needs to be enabled on this host, such as MySQL. - -Change the user, home directory, and other required startup values. Change the -PORT or remove the -p flag if default port is used. - -Enable and start Gitea at boot: - -``` -sudo systemctl enable gitea -sudo systemctl start gitea -``` - -If you have systemd version 220 or later, you can enable and immediately start Gitea at once by: - -``` -sudo systemctl enable gitea --now -``` - -## Using supervisor - -Install supervisor by running below command in terminal: - -``` -sudo apt install supervisor -``` - -Create a log dir for the supervisor logs: - -``` -# assuming Gitea is installed in /home/git/gitea/ -mkdir /home/git/gitea/log/supervisor -``` - -Append the configuration from the sample -[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea) to `/etc/supervisor/supervisord.conf`. - -Using your favorite editor, change the user (`git`) and home -(`/home/git`) settings to match the deployment environment. Change the PORT -or remove the -p flag if default port is used. - -Lastly enable and start supervisor at boot: - -``` -sudo systemctl enable supervisor -sudo systemctl start supervisor -``` - -If you have systemd version 220 or later, you can enable and immediately start supervisor by: - -``` -sudo systemctl enable supervisor --now -``` diff --git a/docs/content/installation/run-as-service-in-ubuntu.zh-cn.md b/docs/content/installation/run-as-service-in-ubuntu.zh-cn.md deleted file mode 100644 index 6ec127c312..0000000000 --- a/docs/content/installation/run-as-service-in-ubuntu.zh-cn.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -date: "2017-07-21T12:00:00+02:00" -title: "在 Linux 中以 service 方式运行" -slug: "linux-service" -sidebar_position: 40 -toc: false -draft: false -aliases: - - /zh-cn/linux-service -menu: - sidebar: - parent: "installation" - name: "在Linux中以service方式运行" - sidebar_position: 40 - identifier: "linux-service" ---- - -### 在 Ubuntu 16.04 LTS 中以 service 方式运行 - -#### systemd 方式 - -在 terminal 中执行以下命令: - -``` -sudo vim /etc/systemd/system/gitea.service -``` - -接着拷贝示例代码 [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) 并取消对任何需要运行在主机上的服务部分的注释,譬如 MySQL。 - -修改 user,home 目录以及其他必须的初始化参数,如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。 - -激活 gitea 并将它作为系统自启动服务: - -``` -sudo systemctl enable gitea -sudo systemctl start gitea -``` - -#### 使用 supervisor - -在 terminal 中执行以下命令安装 supervisor: - -``` -sudo apt install supervisor -``` - -为 supervisor 配置日志路径: - -``` -# assuming gitea is installed in /home/git/gitea/ -mkdir /home/git/gitea/log/supervisor -``` - -在文件编辑器中打开 supervisor 的配置文件: - -``` -sudo vim /etc/supervisor/supervisord.conf -``` - -增加如下示例配置 -[supervisord config](https://github.com/go-gitea/gitea/blob/main/contrib/supervisor/gitea)。 - -将 user(git) 和 home(/home/git) 设置为与上文部署中匹配的值。如果使用自定义端口,则需修改 PORT 参数,反之如果使用默认端口则需删除 -p 标记。 - -最后激活 supervisor 并将它作为系统自启动服务: - -``` -sudo systemctl enable supervisor -sudo systemctl start supervisor -``` diff --git a/docs/content/installation/upgrade-from-gitea.en-us.md b/docs/content/installation/upgrade-from-gitea.en-us.md deleted file mode 100644 index 4a5f21778a..0000000000 --- a/docs/content/installation/upgrade-from-gitea.en-us.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -date: "2021-09-02T16:00:00+08:00" -title: "Upgrade from an old Gitea" -slug: "upgrade-from-gitea" -sidebar_position: 100 -toc: false -draft: false -aliases: - - /en-us/upgrade-from-gitea -menu: - sidebar: - parent: "installation" - name: "Upgrade From Old Gitea" - sidebar_position: 100 - identifier: "upgrade-from-gitea" ---- - -# Upgrade from an old Gitea - -Follow below steps to ensure a smooth upgrade to a new Gitea version. - -## Check the Changelog for breaking changes - -To make Gitea better, some breaking changes are unavoidable, especially for big milestone releases. -Before upgrading, please read the [Changelog on Gitea blog](https://blog.gitea.com/) -and check whether the breaking changes affect your Gitea instance. - -## Verify there are no deprecated configuration options - -New versions of Gitea often come with changed configuration syntax or options which are usually displayed for -at least one release cycle inside at the top of the Site Administration panel. If these warnings are not -resolved, Gitea may refuse to start in the following version. - -## Backup for downgrade - -Gitea keeps compatibility for patch versions whose first two fields are the same (`a.b.x` -> `a.b.y`), -these patch versions can be upgraded and downgraded with the same database structure. -Otherwise (`a.b.?` -> `a.c.?`), a newer Gitea version will upgrade the old database -to a new structure that may differ from the old version. - -For example: - -| From | To | Result | -| --- | --- | --- | -| 1.4.0 | 1.4.1 | ✅ | -| 1.4.1 | 1.4.0 | ⚠️ Not recommended, take your own risk! Although it may work if the database structure doesn't change, it's highly recommended to use a backup to downgrade. | -| 1.4.x | 1.5.y | ✅ Database gets upgraded. You can upgrade from 1.4.x to the latest 1.5.y directly. | -| 1.5.y | 1.4.x | ❌ Database already got upgraded and can not be used for an old Gitea, use a backup to downgrade. | - -**Since you can not run an old Gitea with an upgraded database, -a backup should always be made before a database upgrade.** - -If you use Gitea in production, it's always highly recommended to make a backup before upgrade, -even if the upgrade is between patch versions. - -Backup steps: - -* Stop Gitea instance -* Backup database -* Backup Gitea config -* Backup Gitea data files in `APP_DATA_PATH` -* Backup Gitea external storage (eg: S3/MinIO or other storages if used) - -If you are using cloud services or filesystems with snapshot feature, -a snapshot for the Gitea data volume and related object storage is more convenient. - -After all of steps have been prepared, download the new version, stop the application, perform a backup and -then start the new application. On each startup, Gitea verifies that the database is up to date and will automatically -perform any necessary migrations. Depending on the size of the database, this can take some additional time on the -first launch during which the application will be unavailable. - -## Upgrade with Docker - -* `docker pull` the latest Gitea release. -* Stop the running instance, backup data. -* Use `docker` or `docker-compose` to start the newer Gitea Docker container. - -## Upgrade from package - -* Stop the running instance, backup data. -* Use your package manager to upgrade Gitea to the latest version. -* Start the Gitea instance. - -## Upgrade from binary - -* Download the latest Gitea binary to a temporary directory. -* Stop the running instance, backup data. -* Replace the installed Gitea binary with the downloaded one. -* Start the Gitea instance. - -A script automating these steps for a deployment on Linux can be found at [`contrib/upgrade.sh` in Gitea's source tree](https://github.com/go-gitea/gitea/blob/main/contrib/upgrade.sh). - -## Take care about customized templates - -Gitea's template structure and variables may change between releases, if you are using customized templates, -do pay attention if your templates are compatible with the Gitea you are using. - -If the customized templates don't match Gitea version, you may experience: -`50x` server error, page components missing or malfunctioning, strange page layout, ... -Remove or update the incompatible templates and Gitea web will work again. diff --git a/docs/content/installation/upgrade-from-gitea.zh-cn.md b/docs/content/installation/upgrade-from-gitea.zh-cn.md deleted file mode 100644 index 6300917e2d..0000000000 --- a/docs/content/installation/upgrade-from-gitea.zh-cn.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -date: "2021-09-02T16:00:00+08:00" -title: "从旧版 Gitea 升级" -slug: "upgrade-from-gitea" -sidebar_position: 100 -toc: false -draft: false -menu: - sidebar: - parent: "installation" - name: "从旧版 Gitea 升级" - sidebar_position: 100 - identifier: "upgrade-from-gitea" ---- - -# 从旧版 Gitea 升级 - -在升级之前,您需要做如下的准备工作。 - -## 为重大变更检查更新日志 - -为了让 Gitea 变得更好,进行重大变更是不可避免的,尤其是一些里程碑更新的发布。 -在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.com/) -并检查重大变更是否会影响你的 Gitea 实例。 - -## 在控制面板中检查过期的配置项 - -一些配置项可能会在后续版本中过期,你需要在控制面板中检查他们。如果不解决过期的配置项, -Gitea也许会在升级后无法重启。你可以访问 https://docs.gitea.com 获得要升级的版本 -对应的文档来修改你的配置文件。 - -## 降级前的备份 - -Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`), -这些版本拥有相同的数据库结构,可以自由升级或降级。 -其他情况 (`a.b.?` -> `a.c.?`)下, -新版 Gitea 可能将会将数据库升级到与旧版数据库不同的结构。 - -举个例子: - -| 当前 | 目标 | 结果 | -| --- | --- | --- | -| 1.4.0 | 1.4.1 | ✅ | -| 1.4.1 | 1.4.0 | ⚠️ 不建议,后果自负!尽管数据库结构可能不会变更,让它可以正常工作。我们强烈建议降级前进行完全的备份。 | -| 1.4.x | 1.5.y | ✅ 数据库会被自动升级。你可以直接从 1.4.x 升级到最新的 1.5.y。 | -| 1.5.y | 1.4.x | ❌ 数据库已被升级且无法用于旧版本Gitea,使用备份来进行降级。 | - -**因为你不能基于升级后的数据库运行旧版 Gitea,所以你应该在数据库升级前完成数据备份。** - -如果你在生产环境下使用 Gitea,你应该在升级前做好备份,哪怕只是小版本的补丁更新。 - -备份步骤: - -* 停止 Gitea 实例 -* 备份数据库 -* 备份 Gitea 配置文件 -* 备份 Gitea 在 `APP_DATA_PATH` 中的数据文件 -* 备份 Gitea 的外部存储 (例如: S3/MinIO 或被使用的其他存储) - -如果你在使用云服务或拥有快照功能的文件系统, -最好对 Gitea 的数据盘及相关资料存储进行一次快照。 - -在所有上述步骤准备妥当之后,要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。 -每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。 -如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。 - -## 从 Docker 升级 - -* `docker pull` 拉取 Gitea 的最新发布版。 -* 停止运行中的实例,备份数据。 -* 使用 `docker` 或 `docker-compose` 启动较新的 Gitea Docker 容器. - -## 从包升级 - -* 停止运行中的实例,备份数据。 -* 使用你的包管理器更新 Gitea 到最新版本。 -* 启动 Gitea 实例。 - -## 从二进制升级 - -* 下载最新的 Gitea 二进制文件到临时文件夹中。 -* 停止运行中的实例,备份数据。 -* 将旧的 Gitea 二进制文件覆盖成新的。 -* 启动 Gitea 实例。 - -在 Linux 系统上自动执行以上步骤的脚本可在 [Gitea 的 source tree 中找到 `contrib/upgrade.sh` 来获取](https://github.com/go-gitea/gitea/blob/main/contrib/upgrade.sh). - -## 小心你的自定义模板 - -Gitea 的模板结构与变量可能会随着各个版本的发布发生变化,如果你使用了自定义模板, -你得注意你的模板与你使用的 Gitea 版本的兼容性。 - -如果自定义模板与 Gitea 版本不兼容,你可能会遇到: -`50x` 服务器错误,页面元素丢失或故障,莫名其妙的页面布局,等等… -移除或更新不兼容的模板,Gitea Web 才可以正常工作。 diff --git a/docs/content/installation/windows-service.en-us.md b/docs/content/installation/windows-service.en-us.md deleted file mode 100644 index 6c7d372549..0000000000 --- a/docs/content/installation/windows-service.en-us.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -date: "2016-12-21T15:00:00-02:00" -title: "Register as a Windows service" -slug: "windows-service" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /en-us/windows-service -menu: - sidebar: - parent: "installation" - name: "Windows Service" - sidebar_position: 50 - identifier: "windows-service" ---- -# Register as a Windows service - -## Prerequisites - -The following changes are made in C:\gitea\custom\conf\app.ini: - -``` -RUN_USER = COMPUTERNAME$ -``` - -Sets Gitea to run as the local system user. - -COMPUTERNAME is whatever the response is from `echo %COMPUTERNAME%` on the command line. If the response is `USER-PC` then `RUN_USER = USER-PC$` - -### Use absolute paths - -If you use SQLite3, change the `PATH` to include the full path: - -``` -[database] -PATH = c:/gitea/data/gitea.db -``` - -## Register Gitea - -To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator, -then run the following command: - -``` -sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" -``` - -Do not forget to replace `C:\gitea` with the correct Gitea directory. - -Open "Windows Services", search for the service named "gitea", right-click it and click on -"Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port -that was configured). - -### Service startup type - -It was observed that on loaded systems during boot Gitea service may fail to start with timeout records in Windows Event Log. -In that case change startup type to `Automatic-Delayed`. This can be done during service creation, or by running config command - -``` -sc.exe config gitea start= delayed-auto -``` - -### Adding startup dependencies - -To add a startup dependency to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command: - -``` -sc.exe config gitea depend= mariadb -``` - -This will ensure that when the Windows machine restarts, the automatic starting of Gitea is postponed until the database is ready and thus mitigate failed startups. - -## Unregister Gitea - -To unregister Gitea as a Windows service, open a command prompt (cmd) as an Administrator and run: - -``` -sc.exe delete gitea -``` diff --git a/docs/content/installation/windows-service.zh-cn.md b/docs/content/installation/windows-service.zh-cn.md deleted file mode 100644 index 985492b7e8..0000000000 --- a/docs/content/installation/windows-service.zh-cn.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -date: "2016-12-21T15:00:00-02:00" -title: "注册为Windows服务" -slug: "windows-service" -sidebar_position: 50 -toc: false -draft: false -aliases: - - /zh-cn/windows-service -menu: - sidebar: - parent: "installation" - name: "Windows服务" - sidebar_position: 50 - identifier: "windows-service" ---- - -# 准备工作 - -在 C:\gitea\custom\conf\app.ini 中进行了以下更改: - -``` -RUN_USER = COMPUTERNAME$ -``` - -将 Gitea 设置为以本地系统用户运行。 - -COMPUTERNAME 是从命令行中运行 `echo %COMPUTERNAME%` 后得到的响应。如果响应是 `USER-PC`,那么 `RUN_USER = USER-PC$`。 - -## 使用绝对路径 - -如果您使用 SQLite3,请将 `PATH` 更改为包含完整路径: - -``` -[database] -PATH = c:/gitea/data/gitea.db -``` - -# 注册为Windows服务 - -要注册为Windows服务,首先以Administrator身份运行 `cmd`,然后执行以下命令: - -``` -sc.exe create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\"" -``` - -别忘了将 `C:\gitea` 替换成你的 Gitea 安装目录。 - -之后在控制面板打开 "Windows Services",搜索 "gitea",右键选择 "Run"。在浏览器打开 `http://localhost:3000` 就可以访问了。(如果你修改了端口,请访问对应的端口,3000是默认端口)。 - -## 添加启动依赖项 - -要将启动依赖项添加到 Gitea Windows 服务(例如 Mysql、Mariadb),作为管理员,然后运行以下命令: - -``` -sc.exe config gitea depend= mariadb -``` - -这将确保在 Windows 计算机重新启动时,将延迟自动启动 Gitea,直到数据库准备就绪,从而减少启动失败的情况。 - -## 从Windows服务中删除 - -以Administrator身份运行 `cmd`,然后执行以下命令: - -``` -sc.exe delete gitea -``` diff --git a/docs/content/installation/with-docker-rootless.en-us.md b/docs/content/installation/with-docker-rootless.en-us.md deleted file mode 100644 index 10f1212217..0000000000 --- a/docs/content/installation/with-docker-rootless.en-us.md +++ /dev/null @@ -1,364 +0,0 @@ ---- -date: "2020-02-09T20:00:00+02:00" -title: "Installation with Docker (rootless)" -slug: "install-with-docker-rootless" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /en-us/install-with-docker-rootless -menu: - sidebar: - parent: "installation" - name: "With Docker Rootless" - sidebar_position: 60 - identifier: "install-with-docker-rootless" ---- - -# Installation with Docker - -Gitea provides automatically updated Docker images within its Docker Hub organization. It is -possible to always use the latest stable tag or to use another service that handles updating -Docker images. - -The rootless image uses Gitea internal SSH to provide Git protocol and doesn't support OpenSSH. - -This reference setup guides users through the setup based on `docker-compose`, but the installation -of `docker-compose` is out of scope of this documentation. To install `docker-compose` itself, follow -the official [install instructions](https://docs.docker.com/compose/install/). - -## Basics - -The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest-rootless` -image as a service. Since there is no database available, one can be initialized using SQLite3. - -Create a directory for `data` and `config`: - -```sh -mkdir -p gitea/{data,config} -cd gitea -touch docker-compose.yml -``` - -Then paste the following content into a file named `docker-compose.yml`: - -```yaml -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -Note that the volume should be owned by the user/group with the UID/GID specified in the config file. By default Gitea in docker will use uid:1000 gid:1000. If needed you can set ownership on those folders with the command: - -```sh -sudo chown 1000:1000 config/ data/ -``` - -> If you don't give the volume correct permissions, the container may not start. - -For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:@version@-rootless`, but if you'd like to use the latest development version then `:nightly-rootless` would be an appropriate tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-nightly-rootless` tag, where x is the minor version of Gitea. (e.g. `:1.16-nightly-rootless`) - -## Custom port - -To bind the integrated ssh and the webserver on a different port, adjust -the port section. It's common to just change the host port and keep the ports within -the container like they are. - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: -- - "3000:3000" -- - "2222:2222" -+ - "80:3000" -+ - "22:2222" -``` - -## MySQL database - -To start Gitea in combination with a MySQL database, apply these changes to the -`docker-compose.yml` file created above. - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless -+ environment: -+ - GITEA__database__DB_TYPE=mysql -+ - GITEA__database__HOST=db:3306 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -+ depends_on: -+ - db -+ -+ db: -+ image: mysql:8 -+ restart: always -+ environment: -+ - MYSQL_ROOT_PASSWORD=gitea -+ - MYSQL_USER=gitea -+ - MYSQL_PASSWORD=gitea -+ - MYSQL_DATABASE=gitea -+ volumes: -+ - ./mysql:/var/lib/mysql -``` - -## PostgreSQL database - -To start Gitea in combination with a PostgreSQL database, apply these changes to -the `docker-compose.yml` file created above. - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - environment: -+ - GITEA__database__DB_TYPE=postgres -+ - GITEA__database__HOST=db:5432 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -+ depends_on: -+ - db -+ -+ db: -+ image: postgres:14 -+ restart: always -+ environment: -+ - POSTGRES_USER=gitea -+ - POSTGRES_PASSWORD=gitea -+ - POSTGRES_DB=gitea -+ volumes: -+ - ./postgres:/var/lib/postgresql/data -``` - -## Named volumes - -To use named volumes instead of host volumes, define and use the named volume -within the `docker-compose.yml` configuration. This change will automatically -create the required volume. You don't need to worry about permissions with -named volumes; Docker will deal with that automatically. - -```diff -version: "2" - -+volumes: -+ gitea-data: -+ driver: local -+ gitea-config: -+ driver: local -+ -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: -- - ./data:/var/lib/gitea -+ - gitea-data:/var/lib/gitea -- - ./config:/etc/gitea -+ - gitea-config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -MySQL or PostgreSQL containers will need to be created separately. - -## Custom user - -You can choose to use a custom user (following --user flag definition https://docs.docker.com/engine/reference/run/#user). -As an example to clone the host user `git` definition use the command `id -u git` and add it to `docker-compose.yml` file: -Please make sure that the mounted folders are writable by the user. - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always -+ user: 1001 - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -## Start - -To start this setup based on `docker-compose`, execute `docker-compose up -d`, -to launch Gitea in the background. Using `docker-compose ps` will show if Gitea -started properly. Logs can be viewed with `docker-compose logs`. - -To shut down the setup, execute `docker-compose down`. This will stop -and kill the containers. The volumes will still exist. - -Notice: if using a non-3000 port on http, change app.ini to match -`LOCAL_ROOT_URL = http://localhost:3000/`. - -## Install - -After starting the Docker setup via `docker-compose`, Gitea should be available using a -favorite browser to finalize the installation. Visit http://server-ip:3000 and follow the -installation wizard. If the database was started with the `docker-compose` setup as -documented above, please note that `db` must be used as the database hostname. - -# Customization - -Customization files described [here](administration/customizing-gitea.md) should -be placed in `/var/lib/gitea/custom` directory. If using host volumes, it's quite easy to access these -files; for named volumes, this is done through another container or by direct access at -`/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea`. The configuration file will be saved at -`/etc/gitea/app.ini` after the installation. - -# Upgrading - -:exclamation::exclamation: **Make sure you have volumed data to somewhere outside Docker container** :exclamation::exclamation: - -To upgrade your installation to the latest release: - -``` -# Edit `docker-compose.yml` to update the version, if you have one specified -# Pull new images -docker-compose pull -# Start a new container, automatically removes old one -docker-compose up -d -``` - -# Upgrading from standard image - -- Backup your setup -- Change volume mountpoint from /data to /var/lib/gitea -- If you used a custom app.ini move it to a new volume mounted to /etc/gitea -- Rename folder (inside volume) gitea to custom -- Edit app.ini if needed - - Set START_SSH_SERVER = true -- Use image gitea/gitea:@version@-rootless - -## Managing Deployments With Environment Variables - -In addition to the environment variables above, any settings in `app.ini` can be set -or overridden with an environment variable of the form: `GITEA__SECTION_NAME__KEY_NAME`. -These settings are applied each time the docker container starts, and won't be passed into Gitea's sub-processes. -Full information [here](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini). - -These environment variables can be passed to the docker container in `docker-compose.yml`. -The following example will enable a smtp mail server if the required env variables -`GITEA__mailer__FROM`, `GITEA__mailer__HOST`, `GITEA__mailer__PASSWD` are set on the host -or in a `.env` file in the same directory as `docker-compose.yml`. - -The settings can be also set or overridden with the content of a file by defining an environment variable of the form: -`GITEA__section_name__KEY_NAME__FILE` that points to a file. - -```bash -... -services: - server: - environment: - - GITEA__mailer__ENABLED=true - - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__PROTOCOL=smtp - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} - - GITEA__mailer__IS_TLS_ENABLED=true - - GITEA__mailer__USER=${GITEA__mailer__USER:-apikey} - - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" -``` - -To set required TOKEN and SECRET values, consider using Gitea's built-in [generate utility functions](administration/command-line.md#generate). - -# SSH Container Passthrough - -Since SSH is running inside the container, SSH needs to be passed through from the host to the container if SSH support is desired. One option would be to run the container SSH on a non-standard port (or moving the host port to a non-standard port). Another option which might be more straightforward is to forward SSH commands from the host to the container. This setup is explained in the following. - -This guide assumes that you have created a user on the host called `git` with permission to run `docker exec`, and that the Gitea container is called `gitea`. You will need to modify that user's shell to forward the commands to the `sh` executable inside the container, using `docker exec`. - -First, create the file `/usr/local/bin/gitea-shell` on the host, with the following contents: - -```bash -#!/bin/sh -/usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" -``` - -Note that `gitea` in the docker command above is the name of the container. If you named yours differently, don't forget to change that. - -You should also make sure that you’ve set the permissions of the shell wrapper correctly: - -```bash -sudo chmod +x /usr/local/bin/gitea-shell -``` - -Once the wrapper is in place, you can make it the shell for the `git` user: - -```bash -sudo usermod -s /usr/local/bin/gitea-shell git -``` - -Now that all the SSH commands are forwarded to the container, you need to set up the SSH authentication on the host. This is done by leveraging the [SSH AuthorizedKeysCommand](administration/command-line.md#keys) to match the keys against those accepted by Gitea. Add the following block to `/etc/ssh/sshd_config`, on the host: - -```bash -Match User git - AuthorizedKeysCommandUser git - AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /etc/gitea/app.ini -e git -u %u -t %t -k %k -``` - -(From 1.16.0 you will not need to set the `-c /etc/gitea/app.ini` option.) - -All that is left to do is restart the SSH server: - -```bash -sudo systemctl restart sshd -``` - -**Notes** - -This isn't actually using the docker SSH - it is simply using the commands around it. -You could theoretically not run the internal SSH server. diff --git a/docs/content/installation/with-docker-rootless.zh-cn.md b/docs/content/installation/with-docker-rootless.zh-cn.md deleted file mode 100644 index 70bc32dc12..0000000000 --- a/docs/content/installation/with-docker-rootless.zh-cn.md +++ /dev/null @@ -1,332 +0,0 @@ ---- -date: "2020-02-09T20:00:00+02:00" -title: "使用 Docker 安装 (rootless)" -slug: "install-with-docker-rootless" -sidebar_position: 60 -toc: false -draft: false -aliases: - - /zh-cn/install-with-docker-rootless -menu: - sidebar: - parent: "installation" - name: "使用 Docker 安装 (rootless)" - sidebar_position: 60 - identifier: "install-with-docker-rootless" ---- - -# 使用 Docker 安装 - -Gitea 在其 Docker Hub 组织中提供自动更新的 Docker 镜像。您可以始终使用最新的稳定标签,或使用其他处理 Docker 镜像更新的服务。 - -rootless 镜像使用 Gitea 内部 SSH 功能来提供 Git 协议,但不支持 OpenSSH。 - -本参考设置指南将用户引导通过基于 `docker-compose` 的设置。但是,`docker-compose` 的安装超出了本文档的范围。要安装`docker-compose` 本身, 请按照官方的 [安装说明](https://docs.docker.com/compose/install/)进行操作。 - -## 基础设置 - -最简单的设置只需创建一个卷和一个网络,并将 `gitea/gitea:latest-rootless` 镜像作为服务启动。由于没有可用的数据库,可以使用 SQLite3 来初始化一个。 - -创建一个名为 `data` 和 `config`: - -```sh -mkdir -p gitea/{data,config} -cd gitea -touch docker-compose.yml -``` - -然后将以下内容粘贴到名为 `docker-compose.yml` 的文件中: - -```yaml -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -请注意,卷应由在配置文件中指定的UID/GID的用户/组所有。默认情况下,Docker中的Gitea将使用uid:1000 gid:1000。如果需要,您可以使用以下命令设置这些文件夹的所有权: - -```sh -sudo chown 1000:1000 config/ data/ -``` - -> 如果未为卷设置正确的权限,容器可能无法启动。 - -对于稳定版本,您可以使用 `:latest-rootless`、`:1-rootless`,或指定特定的版本,如: `@version@-rootless`。如果您想使用最新的开发版本,则可以使用 `:dev-rootless` 标签。如果您想运行发布分支的最新提交,可以使用 `:1.x-dev-rootless` 标签,其中 x是 Gitea 的次要版本号(例如:`1.16-dev-rootless`)。 - -## 自定义端口 - -要将集成的SSH和Web服务器绑定到不同的端口,请调整端口部分。通常只需更改主机端口并保持容器内的端口不变。 - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: -- - "3000:3000" -- - "2222:2222" -+ - "80:3000" -+ - "22:2222" -``` - -## MySQL 数据库 - -要将 Gitea 与 MySQL 数据库结合使用,请对上面创建的 `docker-compose.yml` 文件进行以下更改。 - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless -+ environment: -+ - GITEA__database__DB_TYPE=mysql -+ - GITEA__database__HOST=db:3306 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -+ depends_on: -+ - db -+ -+ db: -+ image: mysql:8 -+ restart: always -+ environment: -+ - MYSQL_ROOT_PASSWORD=gitea -+ - MYSQL_USER=gitea -+ - MYSQL_PASSWORD=gitea -+ - MYSQL_DATABASE=gitea -+ volumes: -+ - ./mysql:/var/lib/mysql -``` - -## PostgreSQL 数据库 - -要将 Gitea 与 PostgreSQL 数据库结合使用,请对上面创建的 `docker-compose.yml` 文件进行以下更改。 - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - environment: -+ - GITEA__database__DB_TYPE=postgres -+ - GITEA__database__HOST=db:5432 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -+ depends_on: -+ - db -+ -+ db: -+ image: postgres:14 -+ restart: always -+ environment: -+ - POSTGRES_USER=gitea -+ - POSTGRES_PASSWORD=gitea -+ - POSTGRES_DB=gitea -+ volumes: -+ - ./postgres:/var/lib/postgresql/data -``` - -## 命名卷 (Named Volumes) - -要使用命名卷 (Named Volumes) 而不是主机卷 (Host Volumes),请在 `docker-compose.yml` 配置中定义和使用命名卷。这样的更改将自动创建所需的卷。您不需要担心权限问题,Docker 会自动处理。 - -```diff -version: "2" - -+volumes: -+ gitea-data: -+ driver: local -+ gitea-config: -+ driver: local -+ -services: - server: - image: gitea/gitea:@version@-rootless - restart: always - volumes: -- - ./data:/var/lib/gitea -+ - gitea-data:/var/lib/gitea -- - ./config:/etc/gitea -+ - gitea-config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -MySQL 或 PostgreSQL 容器需要单独创建。 - -## 自定义用户 - -你可以选择使用自定义用户 (遵循 --user 标志定义 https://docs.docker.com/engine/reference/run/#user)。 -例如,要克隆主机用户 `git` 的定义,请使用命令 `id -u git` 并将其添加到 `docker-compose.yml` 文件中: -请确用户对保挂载的文件夹具有写权限。 - -```diff -version: "2" - -services: - server: - image: gitea/gitea:@version@-rootless - restart: always -+ user: 1001 - volumes: - - ./data:/var/lib/gitea - - ./config:/etc/gitea - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "2222:2222" -``` - -## 启动 - -要启动基于 `docker-compose` 的这个设置,请执行 `docker-compose up -d`,以在后台启动 Gitea。使用 `docker-compose ps` 命令可以查看 Gitea 是否正确启动。可以使用 `docker-compose logs` 命令查看日志。 - -要关闭设置,请执行 `docker-compose down` 命令。这将停止和终止容器,但卷仍将存在。 - -注意:如果在 HTTP 上使用的是非 3000 端口,请将 app.ini 更改为匹配 `LOCAL_ROOT_URL = http://localhost:3000/`。 - -## 安装 - -在通过 `docker-compose` 启动 Docker 设置后,可以使用喜爱的浏览器访问 Gitea,完成安装过程。访问 `http://<服务器-IP>:3000` 并按照安装向导进行操作。如果数据库是使用上述文档中的 `docker-compose` 设置启动的,请注意必须使用 `db` 作为数据库主机名。 - -# 自定义 - -自定义文件的位置位于 `/var/lib/gitea/custom` 目录中,可以在这里找到有关自定义的文件说明。如果使用主机卷(host volumes),很容易访问这些文件;如果使用命名卷(named volumes),则可以通过另一个容器或直接访问 `/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea` 来进行访问。在安装后,配置文件将保存在 `/etc/gitea/app.ini` 中。 - -# 升级 - -:exclamation::exclamation: **确保您已将数据卷迁移到 Docker 容器之外的其他位置** :exclamation::exclamation: - -要将安装升级到最新版本,请按照以下步骤操作: - -``` -# 如果在 docker-compose.yml 中指定了版本,请编辑该文件以更新版本 -# 拉取新的镜像 -docker-compose pull -# 启动一个新的容器,自动移除旧的容器 -docker-compose up -d -``` - -# 从标准镜像升级 - -- 备份您的设置 -- 将卷挂载点从 `/data` 更改为 `/var/lib/gitea` -- 如果使用了自定义的 `app.ini`,请将其移动到新的挂载到 `/etc/gitea` 的卷中 -- 将卷中的文件夹(gitea)重命名为 custom -- 如果需要,编辑 `app.ini` - - 设置 `START_SSH_SERVER = true` -- 使用镜像 `gitea/gitea:@version@-rootless` - -## 使用环境变量管理部署 - -除了上述的环境变量外,`app.ini` 中的任何设置都可以通过形式为 `GITEA__SECTION_NAME__KEY_NAME` 的环境变量进行设置或覆盖。这些设置在每次 Docker 容器启动时都会生效。完整信息请参考[这里](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini). - -这些环境变量可以在 `docker-compose.yml` 中传递给 Docker 容器。以下示例将启用 SMTP 邮件服务器,如果主机上设置了所需的环境变量 GITEA__mailer__FROM、GITEA__mailer__HOST、GITEA__mailer__PASSWD,或者在与 `docker-compose.yml` 相同目录中的 `.env` 文件中设置了这些环境变量: - -```bash -... -services: - server: - environment: - - GITEA__mailer__ENABLED=true - - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__PROTOCOL=smtp - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} - - GITEA__mailer__IS_TLS_ENABLED=true - - GITEA__mailer__USER=${GITEA__mailer__USER:-apikey} - - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" -``` - -要设置所需的 TOKEN 和 SECRET 值,可以使用 Gitea 的内置[生成使用函数](administration/command-line.md#generate). - -# SSH 容器透传 - -由于 SSH 在容器内运行,如果需要 SSH 支持,需要将 SSH 从主机透传到容器。一种选择是在容器内运行 SSH,并使用非标准端口(或将主机端口移动到非标准端口)。另一种可能更直接的选择是将主机上的 SSH 命令转发到容器。下面解释了这种设置。 - -本指南假设您已在主机上创建了一个名为 `git` 的用户,并具有运行 `docker exec` 的权限,并且 Gitea 容器的名称为 `gitea`。您需要修改该用户的 shell,以将命令转发到容器内的 `sh` 可执行文件,使用 `docker exec`。 - -首先,在主机上创建文件 `/usr/local/bin/gitea-shell`,并填入以下内容: - -```bash -#!/bin/sh -/usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" -``` - -注意上述 docker 命令中的 `gitea` 是容器的名称。如果您的容器名称不同,请记得更改。 - -还应确保正确设置了 shell 包装器的权限: - -```bash -sudo chmod +x /usr/local/bin/gitea-shell -``` - -一旦包装器就位,您可以将其设置为 `git` 用户的 shell: - -```bash -sudo usermod -s /usr/local/bin/gitea-shell git -``` - -现在,所有的 SSH 命令都会被转发到容器,您需要在主机上设置 SSH 认证。这可以通过利用 [SSH AuthorizedKeysCommand](administration/command-line.md#keys) 来匹配 Gitea 接受的密钥。在主机的 `/etc/ssh/sshd_config` 文件中添加以下代码块: - -```bash -Match User git - AuthorizedKeysCommandUser git - AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /etc/gitea/app.ini -e git -u %u -t %t -k %k -``` - -(从 1.16.0 开始,您将不需要设置 `-c /etc/gitea/app.ini` 选项。) - -剩下的就是重新启动 SSH 服务器: - -```bash -sudo systemctl restart sshd -``` - -**注意** - -这实际上并没有使用 Docker 的 SSH,而是仅仅使用了围绕它的命令。 -从理论上讲,您可以不运行内部的 SSH 服务器。 diff --git a/docs/content/installation/with-docker.en-us.md b/docs/content/installation/with-docker.en-us.md deleted file mode 100644 index e67f5bccb2..0000000000 --- a/docs/content/installation/with-docker.en-us.md +++ /dev/null @@ -1,642 +0,0 @@ ---- -date: "2020-03-19T19:27:00+02:00" -title: "Installation with Docker" -slug: "install-with-docker" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /en-us/install-with-docker -menu: - sidebar: - parent: "installation" - name: "With Docker" - sidebar_position: 70 - identifier: "install-with-docker" ---- - -# Installation with Docker - -Gitea provides automatically updated Docker images within its Docker Hub organization. It is -possible to always use the latest stable tag or to use another service that handles updating -Docker images. - -This reference setup guides users through the setup based on `docker-compose`, but the installation -of `docker-compose` is out of scope of this documentation. To install `docker-compose` itself, follow -the official [install instructions](https://docs.docker.com/compose/install/). - -## Basics - -The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` -image as a service. Since there is no database available, one can be initialized using SQLite3. -Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. -Note that the volume should be owned by the user/group with the UID/GID specified in the config file. -If you don't give the volume correct permissions, the container may not start. -For a stable release you can use `:latest`, `:1` or specify a certain release like `:@version@`, but if you'd like to use the latest development version of Gitea then you could use the `:nightly` tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-nightly` tag, where x is the minor version of Gitea. (e.g. `:1.16-nightly`) - -```yaml -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -``` - -## Ports - -To bind the integrated OpenSSH daemon and the webserver on a different port, adjust -the port section. It's common to just change the host port and keep the ports within -the container like they are. - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: -- - "3000:3000" -- - "222:22" -+ - "8080:3000" -+ - "2221:22" -``` - -## Databases - -### MySQL database - -To start Gitea in combination with a MySQL database, apply these changes to the -`docker-compose.yml` file created above. - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 -+ - GITEA__database__DB_TYPE=mysql -+ - GITEA__database__HOST=db:3306 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -+ depends_on: -+ - db -+ -+ db: -+ image: mysql:8 -+ restart: always -+ environment: -+ - MYSQL_ROOT_PASSWORD=gitea -+ - MYSQL_USER=gitea -+ - MYSQL_PASSWORD=gitea -+ - MYSQL_DATABASE=gitea -+ networks: -+ - gitea -+ volumes: -+ - ./mysql:/var/lib/mysql -``` - -### PostgreSQL database - -To start Gitea in combination with a PostgreSQL database, apply these changes to -the `docker-compose.yml` file created above. - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 -+ - GITEA__database__DB_TYPE=postgres -+ - GITEA__database__HOST=db:5432 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -+ depends_on: -+ - db -+ -+ db: -+ image: postgres:14 -+ restart: always -+ environment: -+ - POSTGRES_USER=gitea -+ - POSTGRES_PASSWORD=gitea -+ - POSTGRES_DB=gitea -+ networks: -+ - gitea -+ volumes: -+ - ./postgres:/var/lib/postgresql/data -``` - -## Named volumes - -To use named volumes instead of host volumes, define and use the named volume -within the `docker-compose.yml` configuration. This change will automatically -create the required volume. You don't need to worry about permissions with -named volumes; Docker will deal with that automatically. - -```diff -version: "3" - -networks: - gitea: - external: false - -+volumes: -+ gitea: -+ driver: local -+ -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - restart: always - networks: - - gitea - volumes: -- - ./gitea:/data -+ - gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -``` - -MySQL or PostgreSQL containers will need to be created separately. - -## Startup - -To start this setup based on `docker-compose`, execute `docker-compose up -d`, -to launch Gitea in the background. Using `docker-compose ps` will show if Gitea -started properly. Logs can be viewed with `docker-compose logs`. - -To shut down the setup, execute `docker-compose down`. This will stop -and kill the containers. The volumes will still exist. - -Notice: if using a non-3000 port on http, change app.ini to match -`LOCAL_ROOT_URL = http://localhost:3000/`. - -## Installation - -After starting the Docker setup via `docker-compose`, Gitea should be available using a -favorite browser to finalize the installation. Visit http://server-ip:3000 and follow the -installation wizard. If the database was started with the `docker-compose` setup as -documented above, please note that `db` must be used as the database hostname. - -## Configure the user inside Gitea using environment variables - -- `USER`: **git**: The username of the user that runs Gitea within the container. -- `USER_UID`: **1000**: The UID (Unix user ID) of the user that runs Gitea within the container. Match this to the UID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). -- `USER_GID`: **1000**: The GID (Unix group ID) of the user that runs Gitea within the container. Match this to the GID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). - -## Customization - -Customization files described [here](administration/customizing-gitea.md) should -be placed in `/data/gitea` directory. If using host volumes, it's quite easy to access these -files; for named volumes, this is done through another container or by direct access at -`/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at -`/data/gitea/conf/app.ini` after the installation. - -## Upgrading - -:exclamation::exclamation: **Make sure you have volumed data to somewhere outside Docker container** :exclamation::exclamation: - -To upgrade your installation to the latest release: - -```bash -# Edit `docker-compose.yml` to update the version, if you have one specified -# Pull new images -docker-compose pull -# Start a new container, automatically removes old one -docker-compose up -d -``` - -## Managing Deployments With Environment Variables - -In addition to the environment variables above, any settings in `app.ini` can be set -or overridden with an environment variable of the form: `GITEA__SECTION_NAME__KEY_NAME`. -These settings are applied each time the docker container starts, and won't be passed into Gitea's sub-processes. -Full information [here](https://github.com/go-gitea/gitea/tree/master/contrib/environment-to-ini). - -These environment variables can be passed to the docker container in `docker-compose.yml`. -The following example will enable an smtp mail server if the required env variables -`GITEA__mailer__FROM`, `GITEA__mailer__HOST`, `GITEA__mailer__PASSWD` are set on the host -or in a `.env` file in the same directory as `docker-compose.yml`. - -The settings can be also set or overridden with the content of a file by defining an environment variable of the form: -`GITEA__section_name__KEY_NAME__FILE` that points to a file. - -```bash -... -services: - server: - environment: - - GITEA__mailer__ENABLED=true - - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__PROTOCOL=smtps - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} - - GITEA__mailer__USER=${GITEA__mailer__USER:-apikey} - - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" -``` - -Gitea will generate new secrets/tokens for every new installation automatically and write them into the app.ini. If you want to set the secrets/tokens manually, you can use the following docker commands to use of Gitea's built-in [generate utility functions](administration/command-line.md#generate). Do not lose/change your SECRET_KEY after the installation, otherwise the encrypted data can not be decrypted anymore. - -The following commands will output a new `SECRET_KEY` and `INTERNAL_TOKEN` to `stdout`, which you can then place in your environment variables. - -```bash -docker run -it --rm gitea/gitea:1 gitea generate secret SECRET_KEY -docker run -it --rm gitea/gitea:1 gitea generate secret INTERNAL_TOKEN -``` - -```yaml -... -services: - server: - environment: - - GITEA__security__SECRET_KEY=[value returned by generate secret SECRET_KEY] - - GITEA__security__INTERNAL_TOKEN=[value returned by generate secret INTERNAL_TOKEN] -``` - -## SSH Container Passthrough - -Since SSH is running inside the container, SSH needs to be passed through from the host to the container if SSH support is desired. One option would be to run the container SSH on a non-standard port (or moving the host port to a non-standard port). Another option which might be more straightforward is for Gitea users to ssh to a Gitea user on the host which will then relay those connections to the docker. - -### Understanding SSH access to Gitea (without passthrough) - -To understand what needs to happen, you first need to understand what happens without passthrough. So we will try to explain this: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea will add an entry for this key to the `.ssh/authorized_keys` file of its running user, `git`. -3. This entry has the public key, but also has a `command=` option. It is this command that Gitea uses to match this key to the client user and manages authentication. -4. The client then makes an SSH request to the SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -5. The client will attempt to authenticate with the server, passing one or more public keys one at a time to the server. -6. For each key the client provides, the SSH server will first check its configuration for an `AuthorizedKeysCommand` to see if the public key matches, and then the `git` user's `authorized_keys` file. -7. The first entry that matches will be selected, and assuming this is a Gitea entry, the `command=` will now be executed. -8. The SSH server creates a user session for the `git` user, and using the shell for the `git` user runs the `command=` -9. This runs `gitea serv` which takes over control of the rest of the SSH session and manages gitea authentication & authorization of the git commands. - -Now, for the SSH passthrough to work, we need the host SSH to match the public keys and then run the `gitea serv` on the docker. There are multiple ways of doing this. However, all of these require some information about the docker being passed to the host. - -### SSHing Shim (with authorized_keys) - -In this option, the idea is that the host simply uses the `authorized_keys` that gitea creates but at step 9 the `gitea` command that the host runs is a shim that actually runs ssh to go into the docker and then run the real docker `gitea` itself. - -- To make the forwarding work, the SSH port of the container (22) needs to be mapped to the host port 2222 in `docker-compose.yml` . Since this port does not need to be exposed to the outside world, it can be mapped to the `localhost` of the host machine: - - ```yaml - ports: - # [...] - - "127.0.0.1:2222:22" - ``` - -- Next on the host create the `git` user which shares the same `UID`/ `GID` as the container values `USER_UID`/ `USER_GID`. These values can be set as environment variables in the `docker-compose.yml`: - - ```yaml - environment: - - USER_UID=1000 - - USER_GID=1000 - ``` - -- Mount `/home/git/.ssh` of the host into the container. This ensures that the `authorized_keys` file is shared between the host `git` user and the container `git` user otherwise the SSH authentication cannot work inside the container. - - ```yaml - volumes: - - /home/git/.ssh/:/data/git/.ssh - ``` - -- Now a SSH key pair needs to be created on the host. This key pair will be used to authenticate the `git` user on the host to the container. As an administrative user on the host run: (by administrative user we mean a user that can sudo to root) - - ```bash - sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key" - ``` - -- Please note depending on the local version of ssh you may want to consider using `-t ecdsa` here. - -- `/home/git/.ssh/authorized_keys` on the host now needs to be modified. It needs to act in the same way as `authorized_keys` within the Gitea container. Therefore add the public key of the key you created above ("Gitea Host Key") to `~/git/.ssh/authorized_keys`. As an administrative user on the host run: - - ```bash - sudo -u git cat /home/git/.ssh/id_rsa.pub | sudo -u git tee -a /home/git/.ssh/authorized_keys - sudo -u git chmod 600 /home/git/.ssh/authorized_keys - ``` - - Important: The pubkey from the `git` user needs to be added "as is" while all other pubkeys added via the Gitea web interface will be prefixed with `command="/usr [...]`. - - `/home/git/.ssh/authorized_keys` should then look somewhat like - - ```bash - # SSH pubkey from git user - ssh-rsa <Gitea Host Key> - - # other keys from users - command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty <user pubkey> - ``` - -- The next step is to create the fake host `gitea` command that will forward commands from the host to the container. The name of this file depends on your version of Gitea: - - - For Gitea v1.16.0+. As an administrative user on the host run: - - ```bash - cat <<"EOF" | sudo tee /usr/local/bin/gitea - #!/bin/sh - ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@" - EOF - sudo chmod +x /usr/local/bin/gitea - ``` - -Here is a detailed explanation what is happening when a SSH request is made: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea in the container will add an entry for this key to the `.ssh/authorized_keys` file of its running user, `git`. - - However, because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key has been added to the host `git` user's `authorized_keys` file too. -3. This entry has the public key, but also has a `command=` option. - - This command matches the location of the Gitea binary on the container, but also the location of the shim on the host. -4. The client then makes an SSH request to the host SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -5. The client will attempt to authenticate with the server, passing one or more public keys in turn to the host. -6. For each key the client provides, the host SSH server will first check its configuration for an `AuthorizedKeysCommand` to see if the public key matches, and then the host `git` user's `authorized_keys` file. - - Because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key they added to the Gitea web will be found -7. The first entry that matches will be selected, and assuming this is a Gitea entry, the `command=` will now be executed. -8. The host SSH server creates a user session for the `git` user, and using the shell for the host `git` user runs the `command=` -9. This means that the host runs the host `/usr/local/bin/gitea` shim that opens an SSH from the host to container passing the rest of the command arguments directly to `/usr/local/bin/gitea` on the container. -10. Meaning that the container `gitea serv` is run, taking over control of the rest of the SSH session and managing gitea authentication & authorization of the git commands. - -**Notes** - -SSH container passthrough using `authorized_keys` will work only if - -- `opensshd` is used in the container -- if `AuthorizedKeysCommand` is _not used_ in combination with `SSH_CREATE_AUTHORIZED_KEYS_FILE=false` to disable authorized files key generation -- `LOCAL_ROOT_URL` is not changed (depending on the changes) - -If you try to run `gitea` on the host, you will attempt to ssh to the container and thence run the `gitea` command there. - -Never add the `Gitea Host Key` as a SSH key to a user on the Gitea interface. - -### SSHing Shell (with authorized_keys) - -In this option, the idea is that the host simply uses the `authorized_keys` that gitea creates but at step 8 above we change the shell that the host runs to ssh directly into the docker and then run the shell there. This means that the `gitea` that is then run is the real docker `gitea`. - -- In this case we setup as per SSHing Shim except instead of creating `/usr/local/bin/gitea` -we create a new shell for the git user. As an administrative user on the host run: - - ```bash - cat <<"EOF" | sudo tee /home/git/ssh-shell - #!/bin/sh - shift - ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $@" - EOF - sudo chmod +x /home/git/ssh-shell - sudo usermod -s /home/git/ssh-shell git - ``` - - Be careful here - if you try to login as the git user in future you will ssh directly to the docker. - -Here is a detailed explanation what is happening when a SSH request is made: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea in the container will add an entry for this key to the `.ssh/authorized_keys` file of its running user, `git`. - - However, because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key has been added to the host `git` user's `authorized_keys` file too. -3. This entry has the public key, but also has a `command=` option. - - This command matches the location of the Gitea binary on the container. -4. The client then makes an SSH request to the host SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -5. The client will attempt to authenticate with the server, passing one or more public keys in turn to the host. -6. For each key the client provides, the host SSH server will first check its configuration for an `AuthorizedKeysCommand` to see if the public key matches, and then the host `git` user's `authorized_keys` file. - - Because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key they added to the Gitea web will be found -7. The first entry that matches will be selected, and assuming this is a Gitea entry, the `command=` will now be executed. -8. The host SSH server creates a user session for the `git` user, and using the shell for the host `git` user runs the `command=` -9. The shell of the host `git` user is now our `ssh-shell` which opens an SSH connection from the host to container, (which opens a shell on the container for the container `git`). -10. The container shell now runs the `command=` option meaning that the container `gitea serv` is run, taking over control of the rest of the SSH session and managing gitea authentication & authorization of the git commands. - -**Notes** - -SSH container passthrough using `authorized_keys` will work only if - -- `opensshd` is used in the container -- if `AuthorizedKeysCommand` is _not used_ in combination with `SSH_CREATE_AUTHORIZED_KEYS_FILE=false` to disable authorized files key generation -- `LOCAL_ROOT_URL` is not changed (depending on the changes) - -If you try to login as the `git` user on the host in future you will ssh directly to the docker. - -Never add the `Gitea Host Key` as a SSH key to a user on the Gitea interface. - -### Docker Shell (with authorized_keys) - -Similar to the above ssh shell technique we can use a shell which simply uses `docker exec`. As an administrative user on the host run: - -```bash -cat <<"EOF" | sudo tee /home/git/docker-shell -#!/bin/sh -/usr/bin/docker exec -i -u git --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" -EOF -sudo chmod +x /home/git/docker-shell -sudo usermod -s /home/git/docker-shell git -``` - -Here is a detailed explanation what is happening when a SSH request is made: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea in the container will add an entry for this key to the `.ssh/authorized_keys` file of its running user, `git`. - - However, because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key has been added to the host `git` user's `authorized_keys` file too. -3. This entry has the public key, but also has a `command=` option. - - This command matches the location of the Gitea binary on the container. -4. The client then makes an SSH request to the host SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -5. The client will attempt to authenticate with the server, passing one or more public keys in turn to the host. -6. For each key the client provides, the host SSH server will first check its configuration for an `AuthorizedKeysCommand` to see if the public key matches, and then the host `git` user's `authorized_keys` file. - - Because `/home/git/.ssh/` on the host is mounted as `/data/git/.ssh` this means that the key they added to the Gitea web will be found -7. The first entry that matches will be selected, and assuming this is a Gitea entry, the `command=` will now be executed. -8. The host SSH server creates a user session for the `git` user, and using the shell for the host `git` user runs the `command=` -9. The shell of the host `git` user is now our `docker-shell` which uses `docker exec` to open a shell for the `git` user on the container. -10. The container shell now runs the `command=` option meaning that the container `gitea serv` is run, taking over control of the rest of the SSH session and managing gitea authentication & authorization of the git commands. - -Note that `gitea` in the docker command above is the name of the container. If you named yours differently, don't forget to change that. The host `git` user also has to have -permission to run `docker exec`. - -**Notes** - -Docker shell passthrough using `authorized_keys` will work only if - -- `opensshd` is used in the container -- if `AuthorizedKeysCommand` is _not used_ in combination with `SSH_CREATE_AUTHORIZED_KEYS_FILE=false` to disable authorized files key generation -- `LOCAL_ROOT_URL` is not changed (depending on the changes) - -If you try to login as the `git` user on the host in future you will `docker exec` directly to the docker. - -A Docker execing shim could be created similarly to above. - -### Docker Shell with AuthorizedKeysCommand - -The AuthorizedKeysCommand route provides another option that does not require many changes to the compose file or the `authorized_keys` - but does require changes to the host `/etc/sshd_config`. - -In this option, the idea is that the host SSH uses an `AuthorizedKeysCommand` instead of relying on sharing the `authorized_keys` file that gitea creates. We continue to use a special shell at step 8 above to exec into the docker and then run the shell there. This means that the `gitea` that is then run is the real docker `gitea`. - -- On the host create a `git` user with permission to run `docker exec`. -- We will again assume that the Gitea container is called `gitea`. -- Modify the `git` user's shell to forward commands to the `sh` executable inside the container using `docker exec`. As an administrative user on the host run: - - ```bash - cat <<"EOF" | sudo tee /home/git/docker-shell - #!/bin/sh - /usr/bin/docker exec -i --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@" - EOF - sudo chmod +x /home/git/docker-shell - sudo usermod -s /home/git/docker-shell git - ``` - -Now all attempts to login as the `git` user on the host will be forwarded to the docker - including the `SSH_ORIGINAL_COMMAND`. We now need to set-up SSH authentication on the host. - -We will do this by leveraging the [SSH AuthorizedKeysCommand](administration/command-line.md#keys) to match the keys against those accepted by Gitea. - -Add the following block to `/etc/ssh/sshd_config`, on the host: - -```bash -Match User git - AuthorizedKeysCommandUser git - AuthorizedKeysCommand /usr/bin/docker exec -i gitea /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k -``` - -(From 1.16.0 you will not need to set the `-c /data/gitea/conf/app.ini` option.) - -Finally restart the SSH server. As an administrative user on the host run: - -```bash -sudo systemctl restart sshd -``` - -Here is a detailed explanation what is happening when a SSH request is made: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea in the container will add an entry for this key to its database. -3. The client then makes an SSH request to the host SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -4. The client will attempt to authenticate with the server, passing one or more public keys in turn to the host. -5. For each key the client provides, the host SSH server will checks its configuration for an `AuthorizedKeysCommand`. -6. The host runs the above `AuthorizedKeysCommand`, which execs in to the docker and then runs the `gitea keys` command. -7. Gitea on the docker will look in it's database to see if the public key matches and will return an entry like that of an `authorized_keys` command. -8. This entry has the public key, but also has a `command=` option which matches the location of the Gitea binary on the container. -9. The host SSH server creates a user session for the `git` user, and using the shell for the host `git` user runs the `command=`. -10. The shell of the host `git` user is now our `docker-shell` which uses `docker exec` to open a shell for the `git` user on the container. -11. The container shell now runs the `command=` option meaning that the container `gitea serv` is run, taking over control of the rest of the SSH session and managing gitea authentication & authorization of the git commands. - -**Notes** - -Docker shell passthrough using `AuthorizedKeysCommand` will work only if - -- The host `git` user is allowed to run the `docker exec` command. - -If you try to login as the `git` user on the host in future you will `docker exec` directly to the docker. - -A Docker execing shim could be created similarly to above. - -### SSH Shell with AuthorizedKeysCommand - -Create a key for the host `git` user as above, add it to the docker `/data/git/.ssh/authorized_keys` then finally create and set the `ssh-shell` as above. - -Add the following block to `/etc/ssh/sshd_config`, on the host: - -```bash -Match User git - AuthorizedKeysCommandUser git - AuthorizedKeysCommand /usr/bin/ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k -``` - -(From 1.16.0 you will not need to set the `-c /data/gitea/conf/app.ini` option.) - -Finally restart the SSH server. As an administrative user on the host run: - -```bash -sudo systemctl restart sshd -``` - -Here is a detailed explanation what is happening when a SSH request is made: - -1. The client adds their SSH public key to Gitea using the webpage. -2. Gitea in the container will add an entry for this key to its database. -3. The client then makes an SSH request to the host SSH server using the `git` user, e.g. `git clone git@domain:user/repo.git`. -4. The client will attempt to authenticate with the server, passing one or more public keys in turn to the host. -5. For each key the client provides, the host SSH server will checks its configuration for an `AuthorizedKeysCommand`. -6. The host runs the above `AuthorizedKeysCommand`, which will SSH in to the docker and then run the `gitea keys` command. -7. Gitea on the docker will look in it's database to see if the public key matches and will return an entry like that of an `authorized_keys` command. -8. This entry has the public key, but also has a `command=` option which matches the location of the Gitea binary on the container. -9. The host SSH server creates a user session for the `git` user, and using the shell for the host `git` user runs the `command=`. -10. The shell of the host `git` user is now our `git-shell` which uses SSH to open a shell for the `git` user on the container. -11. The container shell now runs the `command=` option meaning that the container `gitea serv` is run, taking over control of the rest of the SSH session and managing gitea authentication & authorization of the git commands. - -**Notes** - -SSH container passthrough using `AuthorizedKeysCommand` will work only if - -- `opensshd` is running on the container - -If you try to login as the `git` user on the host in future you will `ssh` directly to the docker. - -Never add the `Gitea Host Key` as a SSH key to a user on the Gitea interface. - -SSHing shims could be created similarly to above. diff --git a/docs/content/installation/with-docker.zh-cn.md b/docs/content/installation/with-docker.zh-cn.md deleted file mode 100644 index fcaff1c119..0000000000 --- a/docs/content/installation/with-docker.zh-cn.md +++ /dev/null @@ -1,380 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "使用 Docker 安装" -slug: "install-with-docker" -sidebar_position: 70 -toc: false -draft: false -aliases: - - /zh-cn/install-with-docker -menu: - sidebar: - parent: "installation" - name: "使用 Docker 安装" - sidebar_position: 70 - identifier: "install-with-docker" ---- - -# 使用 Docker 安装 - -Gitea 在其 Docker Hub 组织内提供自动更新的 Docker 镜像。可以始终使用最新的稳定标签或使用其他服务来更新 Docker 镜像。 - -该参考设置指导用户完成基于 `docker-compose` 的设置,但是 `docker-compose` 的安装不在本文档的范围之内。要安装 `docker-compose` 本身,请遵循官方[安装说明](https://docs.docker.com/compose/install/)。 - -## 基本 - -最简单的设置只是创建一个卷和一个网络,然后将 `gitea/gitea:latest` 镜像作为服务启动。由于没有可用的数据库,因此可以使用 SQLite3 初始化数据库。创建一个类似 `gitea` 的目录,并将以下内容粘贴到名为 `docker-compose.yml` 的文件中。请注意,该卷应由配置文件中指定的 UID/GID 的用户/组拥有。如果您不授予卷正确的权限,则容器可能无法启动。另请注意,标签 `:latest` 将安装当前的开发版本。对于稳定的发行版,您可以使用 `:1` 或指定某个发行版,例如 `@version@`。 - -```yaml -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -``` - -## 端口 - -要将集成的 openSSH 守护进程和 Web 服务器绑定到其他端口,请调整端口部分。通常,只需更改主机端口,容器内的端口保持原样即可。 - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: -- - "3000:3000" -- - "222:22" -+ - "8080:3000" -+ - "2221:22" -``` - -## 数据库 - -### MySQL 数据库 - -要将 Gitea 与 MySQL 数据库结合使用,请将这些更改应用于上面创建的 `docker-compose.yml` 文件。 - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 -+ - GITEA__database__DB_TYPE=mysql -+ - GITEA__database__HOST=db:3306 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -+ depends_on: -+ - db -+ -+ db: -+ image: mysql:8 -+ restart: always -+ environment: -+ - MYSQL_ROOT_PASSWORD=gitea -+ - MYSQL_USER=gitea -+ - MYSQL_PASSWORD=gitea -+ - MYSQL_DATABASE=gitea -+ networks: -+ - gitea -+ volumes: -+ - ./mysql:/var/lib/mysql -``` - -### PostgreSQL 数据库 - -要将 Gitea 与 PostgreSQL 数据库结合使用,请将这些更改应用于上面创建的 `docker-compose.yml` 文件。 - -```diff -version: "3" - -networks: - gitea: - external: false - -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 -+ - GITEA__database__DB_TYPE=postgres -+ - GITEA__database__HOST=db:5432 -+ - GITEA__database__NAME=gitea -+ - GITEA__database__USER=gitea -+ - GITEA__database__PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - ./gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -+ depends_on: -+ - db -+ -+ db: -+ image: postgres:14 -+ restart: always -+ environment: -+ - POSTGRES_USER=gitea -+ - POSTGRES_PASSWORD=gitea -+ - POSTGRES_DB=gitea -+ networks: -+ - gitea -+ volumes: -+ - ./postgres:/var/lib/postgresql/data -``` - -## 命名卷 - -要使用命名卷而不是主机卷,请在 `docker-compose.yml` 配置中定义并使用命名卷。此更改将自动创建所需的卷。您无需担心命名卷的权限;Docker 将自动处理该问题。 - -```diff -version: "3" - -networks: - gitea: - external: false - -+volumes: -+ gitea: -+ driver: local -+ -services: - server: - image: gitea/gitea:@version@ - container_name: gitea - restart: always - networks: - - gitea - volumes: -- - ./gitea:/data -+ - gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "3000:3000" - - "222:22" -``` - -MySQL 或 PostgreSQL 容器将需要分别创建。 - -## 启动 - -要基于 `docker-compose` 启动此设置,请执行 `docker-compose up -d`,以在后台启动 Gitea。使用 `docker-compose ps` 将显示 Gitea 是否正确启动。可以使用 `docker-compose logs` 查看日志。 - -要关闭设置,请执行 `docker-compose down`。这将停止并杀死容器。这些卷将仍然存在。 - -注意:如果在 http 上使用非 3000 端口,请更改 app.ini 以匹配 `LOCAL_ROOT_URL = http://localhost:3000/`。 - -## 安装 - -通过 `docker-compose` 启动 Docker 安装后,应该可以使用喜欢的浏览器访问 Gitea,以完成安装。访问 http://server-ip:3000 并遵循安装向导。如果数据库是通过上述 `docker-compose` 设置启动的,请注意,必须将 `db` 用作数据库主机名。 - -## 环境变量 - -您可以通过环境变量配置 Gitea 的一些设置: - -(默认值以**粗体**显示) - -- `APP_NAME`:**“Gitea: Git with a cup of tea”**:应用程序名称,在页面标题中使用。 -- `RUN_MODE`:**prod**:应用程序运行模式,会影响性能和调试。"dev","prod"或"test"。 -- `DOMAIN`:**localhost**:此服务器的域名,用于 Gitea UI 中显示的 http 克隆 URL。 -- `SSH_DOMAIN`:**localhost**:该服务器的域名,用于 Gitea UI 中显示的 ssh 克隆 URL。如果启用了安装页面,则 SSH 域服务器将采用以下形式的 DOMAIN 值(保存时将覆盖此设置)。 -- `SSH_PORT`:**22**:克隆 URL 中显示的 SSH 端口。 -- `SSH_LISTEN_PORT`:**%(SSH_PORT)s**:内置 SSH 服务器的端口。 -- `DISABLE_SSH`:**false**:如果不可用,请禁用 SSH 功能。如果要禁用 SSH 功能,则在安装 Gitea 时应将 SSH 端口设置为 `0`。 -- `HTTP_PORT`:**3000**:HTTP 监听端口。 -- `ROOT_URL`:**""**:覆盖自动生成的公共 URL。如果内部 URL 和外部 URL 不匹配(例如在 Docker 中),这很有用。 -- `LFS_START_SERVER`:**false**:启用 git-lfs 支持。 -- `DB_TYPE`:**sqlite3**:正在使用的数据库类型[mysql,postgres,mssql,sqlite3]。 -- `DB_HOST`:**localhost:3306**:数据库主机地址和端口。 -- `DB_NAME`:**gitea**:数据库名称。 -- `DB_USER`:**root**:数据库用户名。 -- `DB_PASSWD`:**"_empty_"** :数据库用户密码。如果您在密码中使用特殊字符,请使用“您的密码”进行引用。 -- `INSTALL_LOCK`:**false**:禁止访问安装页面。 -- `SECRET_KEY`:**""** :全局密钥。这应该更改。如果它具有一个值并且 `INSTALL_LOCK` 为空,则 `INSTALL_LOCK` 将自动设置为 `true`。 -- `DISABLE_REGISTRATION`:**false**:禁用注册,之后只有管理员才能为用户创建帐户。 -- `REQUIRE_SIGNIN_VIEW`:**false**:启用此选项可强制用户登录以查看任何页面。 -- `USER_UID`:**1000**:在容器内运行 Gitea 的用户的 UID(Unix 用户 ID)。如果使用主机卷,则将其与 `/data` 卷的所有者的 UID 匹配(对于命名卷,则不需要这样做)。 -- `USER_GID`:**1000**:在容器内运行 Gitea 的用户的 GID(Unix 组 ID)。如果使用主机卷,则将其与 `/data` 卷的所有者的 GID 匹配(对于命名卷,则不需要这样做)。 - -## 自定义 - -[此处](administration/customizing-gitea.md)描述的定制文件应放在 `/data/gitea` 目录中。如果使用主机卷,则访问这些文件非常容易;对于命名卷,可以通过另一个容器或通过直接访问 `/var/lib/docker/volumes/gitea_gitea/_data` 来完成。安装后,配置文件将保存在 `/data/gitea/conf/app.ini` 中。 - -## 升级 - -:exclamation::exclamation: **确保已将数据卷到 Docker 容器外部的某个位置** :exclamation::exclamation: - -要将安装升级到最新版本: - -```bash -# Edit `docker-compose.yml` to update the version, if you have one specified -# Pull new images -docker-compose pull -# Start a new container, automatically removes old one -docker-compose up -d -``` - -## 使用环境变量管理部署 - -除了上面的环境变量之外,`app.ini` 中的任何设置都可以使用以下形式的环境变量进行设置或覆盖:`GITEA__SECTION_NAME__KEY_NAME`。 每次 docker 容器启动时都会应用这些设置。 完整信息在[这里](https://github.com/go-gitea/gitea/tree/master/contrib/environment-to-ini)。 - -```bash -... -services: - server: - environment: - - GITEA__mailer__ENABLED=true - - GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set} - - GITEA__mailer__PROTOCOL=smtps - - GITEA__mailer__HOST=${GITEA__mailer__HOST:?GITEA__mailer__HOST not set} - - GITEA__mailer__USER=${GITEA__mailer__USER:-apikey} - - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}""" -``` - -Gitea 将为每次新安装自动生成新的 `SECRET_KEY` 并将它们写入 `app.ini`。 如果您想手动设置 `SECRET_KEY`,您可以使用以下 docker 命令来使用 Gitea 内置的[方法](administration/command-line.md#generate)生成 `SECRET_KEY`。 安装后请妥善保管您的 `SECRET_KEY`,如若丢失则无法解密已加密的数据。 - -以下命令将向 `stdout` 输出一个新的 `SECRET_KEY` 和 `INTERNAL_TOKEN`,然后您可以将其放入环境变量中。 - -```bash -docker run -it --rm gitea/gitea:1 gitea generate secret SECRET_KEY -docker run -it --rm gitea/gitea:1 gitea generate secret INTERNAL_TOKEN -``` - -```yaml -... -services: - server: - environment: - - GITEA__security__SECRET_KEY=[value returned by generate secret SECRET_KEY] - - GITEA__security__INTERNAL_TOKEN=[value returned by generate secret INTERNAL_TOKEN] -``` - -## SSH 容器直通 - -由于 SSH 在容器内运行,因此,如果需要 SSH 支持,则需要将 SSH 从主机传递到容器。一种选择是在非标准端口上运行容器 SSH(或将主机端口移至非标准端口)。另一个可能更直接的选择是将 SSH 连接从主机转发到容器。下面将说明此设置。 - -本指南假定您已经在名为 `git` 的主机上创建了一个用户,该用户与容器值 `USER_UID`/`USER_GID` 共享相同的 `UID`/`GID`。这些值可以在 `docker-compose.yml` 中设置为环境变量: - -```bash -environment: - - USER_UID=1000 - - USER_GID=1000 -``` - -接下来将主机的 `/home/git/.ssh` 装入容器。否则,SSH 身份验证将无法在容器内运行。 - -```bash -volumes: - - /home/git/.ssh/:/data/git/.ssh -``` - -现在,需要在主机上创建 SSH 密钥对。该密钥对将用于向主机验证主机上的 `git` 用户。 - -```bash -sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key" -``` - -在下一步中,需要在主机上创建一个名为 `/usr/local/bin/gitea` 的文件(具有可执行权限)。该文件将发出从主机到容器的 SSH 转发。将以下内容添加到 `/usr/local/bin/gitea`: - -```bash -ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@" -``` - -为了使转发正常工作,需要将容器(22)的 SSH 端口映射到 `docker-compose.yml` 中的主机端口 2222。由于此端口不需要暴露给外界,因此可以将其映射到主机的 `localhost`: - -```bash -ports: - # [...] - - "127.0.0.1:2222:22" -``` - -另外,主机上的 `/home/git/.ssh/authorized_keys` 需要修改。它需要以与 Gitea 容器内的 `authorized_keys` 相同的方式进行操作。因此,将您在上面创建的密钥(“Gitea 主机密钥”)的公共密钥添加到 `~/git/.ssh/authorized_keys`。这可以通过 `echo "$(cat /home/git/.ssh/id_rsa.pub)" >> /home/git/.ssh/authorized_keys` 完成。重要提示:来自 `git` 用户的公钥需要“按原样”添加,而通过 Gitea 网络界面添加的所有其他公钥将以 `command="/app [...]` 作为前缀。 - -该文件应该看起来像: - -```bash -# SSH pubkey from git user -ssh-rsa <Gitea Host Key> - -# other keys from users -command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty <user pubkey> -``` - -这是详细的说明,当发出 SSH 请求时会发生什么: - -1. 使用 `git` 用户向主机发出 SSH 请求,例如 `git clone git@domain:user/repo.git`。 -2. 在 `/home/git/.ssh/authorized_keys` 中,该命令执行 `/usr/local/bin/gitea` 脚本。 -3. `/usr/local/bin/gitea` 将 SSH 请求转发到端口 2222,该端口已映射到容器的 SSH 端口(22)。 -4. 由于 `/home/git/.ssh/authorized_keys` 中存在 `git` 用户的公钥,因此身份验证主机 → 容器成功,并且 SSH 请求转发到在 docker 容器中运行的 Gitea。 - -如果在 Gitea Web 界面中添加了新的 SSH 密钥,它将以与现有密钥相同的方式附加到 `.ssh/authorized_keys` 中。 - -**注意** - -SSH 容器直通仅在以下情况下有效 - -- 在容器中使用 `opensshd` -- 如果未将 `AuthorizedKeysCommand` 与 `SSH_CREATE_AUTHORIZED_KEYS_FILE = false` 结合使用以禁用授权文件密钥生成 -- `LOCAL_ROOT_URL` 不变 diff --git a/docs/content/packages.en-us.md b/docs/content/packages.en-us.md deleted file mode 100644 index 75c29033ee..0000000000 --- a/docs/content/packages.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-27T16:00:00+02:00" -title: "Packages" -slug: "packages" -sidebar_position: 35 -toc: false -draft: false -menu: - sidebar: - name: "Usage - Packages" - sidebar_position: 30 - identifier: "packages" ---- diff --git a/docs/content/search.en-us.md b/docs/content/search.en-us.md deleted file mode 100644 index 226d9fe3bc..0000000000 --- a/docs/content/search.en-us.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "Search" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /en-us/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/docs/content/search.nl-nl.md b/docs/content/search.nl-nl.md deleted file mode 100644 index 7ebcf28dbf..0000000000 --- a/docs/content/search.nl-nl.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "Search" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /nl-nl/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/docs/content/search.pt-br.md b/docs/content/search.pt-br.md deleted file mode 100644 index 06b215c689..0000000000 --- a/docs/content/search.pt-br.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "Search" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /pt-br/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/docs/content/search.zh-cn.md b/docs/content/search.zh-cn.md deleted file mode 100644 index 6ab5ad0814..0000000000 --- a/docs/content/search.zh-cn.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: "2019-11-12T16:00:00+02:00" -title: "搜索" -slug: "search" -sidebar_position: 1 -toc: false -draft: false -aliases: - - /zh-cn/help/search -sitemap: - priority : 1 -layout: "search" ---- - -This file exists solely to respond to /search URL with the related `search` layout template. - -No content shown here is rendered, all content is based in the template layouts/doc/search.html - -Setting a very low sitemap priority will tell search engines this is not important content. diff --git a/docs/content/usage.en-us.md b/docs/content/usage.en-us.md deleted file mode 100644 index 436d031b4a..0000000000 --- a/docs/content/usage.en-us.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-27T16:00:00+02:00" -title: "Usage" -slug: "usage" -sidebar_position: 35 -toc: false -draft: false -menu: - sidebar: - name: "Usage" - sidebar_position: 30 - identifier: "usage" ---- diff --git a/docs/content/usage.zh-cn.md b/docs/content/usage.zh-cn.md deleted file mode 100644 index 91e40ced9f..0000000000 --- a/docs/content/usage.zh-cn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -date: "2016-12-27T16:00:00+02:00" -title: "使用指南" -slug: "usage" -sidebar_position: 35 -toc: false -draft: false -menu: - sidebar: - name: "使用指南" - sidebar_position: 30 - identifier: "usage" ---- diff --git a/docs/content/usage/_index.en-us.md b/docs/content/usage/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/usage/_index.en-us.md +++ /dev/null diff --git a/docs/content/usage/_index.zh-cn.md b/docs/content/usage/_index.zh-cn.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/usage/_index.zh-cn.md +++ /dev/null diff --git a/docs/content/usage/actions/act-runner.en-us.md b/docs/content/usage/actions/act-runner.en-us.md deleted file mode 100644 index 3fad9cbfe8..0000000000 --- a/docs/content/usage/actions/act-runner.en-us.md +++ /dev/null @@ -1,334 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Act Runner" -slug: "act-runner" -sidebar_position: 20 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Act Runner" - sidebar_position: 20 - identifier: "actions-runner" ---- - -# Act Runner - -This page will introduce the [act runner](https://gitea.com/gitea/act_runner) in detail, which is the runner of Gitea Actions. - -## Requirements - -It is recommended to run jobs in a docker container, so you need to install docker first. -And make sure that the docker daemon is running. - -Other OCI container engines which are compatible with Docker's API should also work, but are untested. - -However, if you are sure that you want to run jobs directly on the host only, then docker is not required. - -## Installation - -There are multiple ways to install the act runner. - -### Download the binary - -You can download the binary from the [release page](https://gitea.com/gitea/act_runner/releases). -However, if you want to use the latest nightly build, you can download it from the [download page](https://dl.gitea.com/act_runner/). - -When you download the binary, please make sure that you have downloaded the correct one for your platform. -You can check it by running the following command: - -```bash -chmod +x act_runner -./act_runner --version -``` - -If you see the version information, it means that you have downloaded the correct binary. - -### Use the docker image - -You can use the docker image from the [docker hub](https://hub.docker.com/r/gitea/act_runner/tags). -Just like the binary, you can use the latest nightly build by using the `nightly` tag, while the `latest` tag is the latest stable release. - -```bash -docker pull gitea/act_runner:latest # for the latest stable release -docker pull gitea/act_runner:nightly # for the latest nightly build -``` - -## Configuration - -Configuration is done via a configuration file. It is optional, and the default configuration will be used when no configuration file is specified. - -You can generate a configuration file by running the following command: - -```bash -./act_runner generate-config -``` - -The default configuration is safe to use without any modification, so you can just use it directly. - -```bash -./act_runner generate-config > config.yaml -./act_runner --config config.yaml [command] -``` - -You could also generate config file with docker: - -```bash -docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml -``` - -When you are using the docker image, you can specify the configuration file by using the `CONFIG_FILE` environment variable. Make sure that the file is mounted into the container as a volume: - -```bash -docker run -v $PWD/config.yaml:/config.yaml -e CONFIG_FILE=/config.yaml ... -``` - -You may notice the commands above are both incomplete, because it is not the time to run the act runner yet. -Before running the act runner, we need to register it to your Gitea instance first. - -## Registration - -Registration is required before running the act runner, because the runner needs to know where to get jobs from. -And it is also important to Gitea instance to identify the runner. - -### Runner levels - -You can register a runner in different levels, it can be: - -- Instance level: The runner will run jobs for all repositories in the instance. -- Organization level: The runner will run jobs for all repositories in the organization. -- Repository level: The runner will run jobs for the repository it belongs to. - -Note that the repository may still use instance-level or organization-level runners even if it has its own repository-level runners. A future release may provide an option to allow more control over this. - -### Obtain a registration token - -The level of the runner determines where to obtain the registration token. - -- Instance level: The admin settings page, like `<your_gitea.com>/admin/actions/runners`. -- Organization level: The organization settings page, like `<your_gitea.com>/<org>/settings/actions/runners`. -- Repository level: The repository settings page, like `<your_gitea.com>/<owner>/<repo>/settings/actions/runners`. - -If you cannot see the settings page, please make sure that you have the right permissions and that Actions have been enabled. - -The format of the registration token is a random string `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`. - -A registration token can also be obtained from the gitea [command-line interface](administration/command-line.md#actions-generate-runner-token): - -``` -gitea --config /etc/gitea/app.ini actions generate-runner-token -``` - -### Register the runner - -The act runner can be registered by running the following command: - -```bash -./act_runner register -``` - -Alternatively, you can use the `--config` option to specify the configuration file mentioned in the previous section. - -```bash -./act_runner --config config.yaml register -``` - -You will be asked to input the registration information step by step. Includes: - -- The Gitea instance URL, like `https://gitea.com/` or `http://192.168.8.8:3000/`. -- The registration token. -- The runner name, which is optional. If you leave it blank, the hostname will be used. -- The runner labels, which is optional. If you leave it blank, the default labels will be used. - -You may be confused about the runner labels, which will be explained later. - -If you want to register the runner in a non-interactive way, you can use arguments to do it. - -```bash -./act_runner register --no-interactive --instance <instance_url> --token <registration_token> --name <runner_name> --labels <runner_labels> -``` - -When you have registered the runner, you can find a new file named `.runner` in the current directory. -This file stores the registration information. -Please do not edit it manually. -If this file is missing or corrupted, you can simply remove it and register again. - -If you want to store the registration information in another place, you can specify it in the configuration file, -and don't forget to specify the `--config` option. - -### Register the runner with docker - -If you are using the docker image, behaviour will be slightly different. Registration and running are combined into one step in this case, so you need to specify the registration information when running the act runner. - -```bash -docker run \ - -v $PWD/config.yaml:/config.yaml \ - -v $PWD/data:/data \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e CONFIG_FILE=/config.yaml \ - -e GITEA_INSTANCE_URL=<instance_url> \ - -e GITEA_RUNNER_REGISTRATION_TOKEN=<registration_token> \ - -e GITEA_RUNNER_NAME=<runner_name> \ - -e GITEA_RUNNER_LABELS=<runner_labels> \ - --name my_runner \ - -d gitea/act_runner:nightly -``` - -You may notice that we have mounted the `/var/run/docker.sock` into the container. -It is because the act runner will run jobs in docker containers, so it needs to communicate with the docker daemon. -As mentioned, you can remove it if you want to run jobs in the host directly. -To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine. - -### Set up the runner using docker compose - -You could also set up the runner using the following `docker-compose.yml`: - -```yml -version: "3.8" -services: - runner: - image: gitea/act_runner:nightly - environment: - CONFIG_FILE: /config.yaml - GITEA_INSTANCE_URL: "${INSTANCE_URL}" - GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}" - GITEA_RUNNER_NAME: "${RUNNER_NAME}" - GITEA_RUNNER_LABELS: "${RUNNER_LABELS}" - volumes: - - ./config.yaml:/config.yaml - - ./data:/data - - /var/run/docker.sock:/var/run/docker.sock -``` - -### Configuring cache when starting a Runner using docker image - -If you do not intend to use `actions/cache` in workflow, you can ignore this section. - -If you use `actions/cache` without any additional configuration, it will return the following error: -> Failed to restore: getCacheEntry failed: connect ETIMEDOUT IP:PORT - -The error occurs because the runner container and job container are on different networks, so the job container cannot access the runner container. - -Therefore, it is essential to configure the cache action to ensure its proper functioning. Follow these steps: - -- 1.Obtain the LAN IP address of the host machine where the runner container is running. -- 2.Find an available port number on the host machine where the runner container is running. -- 3.Configure the following settings in the configuration file: - -```yaml -cache: - enabled: true - dir: "" - # Use the LAN IP obtained in step 1 - host: "192.168.8.17" - # Use the port number obtained in step 2 - port: 8088 -``` - -- 4.When starting the container, map the cache port to the host machine: - -```bash -docker run \ - --name gitea-docker-runner \ - -p 8088:8088 \ - -d gitea/act_runner:nightly -``` - -### Labels - -The labels of a runner are used to determine which jobs the runner can run, and how to run them. - -The default labels are `ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster`. -It is a comma-separated list, and each item is a label. - -Let's take `ubuntu-22.04:docker://node:16-bullseye` as an example. -It means that the runner can run jobs with `runs-on: ubuntu-22.04`, and the job will be run in a docker container with the image `node:16-bullseye`. - -If the default image is insufficient for your needs, and you have enough disk space to use a better and bigger one, you can change it to `ubuntu-22.04:docker://<the image you like>`. -You can find more useful images on [act images](https://github.com/nektos/act/blob/master/IMAGES.md). - -If you want to run jobs in the host directly, you can change it to `ubuntu-22.04:host` or just `ubuntu-22.04`, the `:host` is optional. -However, we suggest you to use a special name like `linux_amd64:host` or `windows:host` to avoid misusing it. - -Starting with Gitea 1.21, you can change labels by modifying `container.labels` in the runner configuration file (if you don't have a configuration file, please refer to [configuration tutorials](#configuration)). -The runner will use these new labels as soon as you restart it, i.e., by calling `./act_runner daemon --config config.yaml`. - -## Running - -After you have registered the runner, you can run it by running the following command: - -```bash -./act_runner daemon -# or -./act_runner daemon --config config.yaml -``` - -The runner will fetch jobs from the Gitea instance and run them automatically. - -Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly. - -## Systemd service - -It is also possible to run act-runner as a [systemd](https://en.wikipedia.org/wiki/Systemd) service. Create an unprivileged `act_runner` user on your system, and the following file in `/etc/systemd/system/act_runner.service`. The paths in `ExecStart` and `WorkingDirectory` may need to be adjusted depending on where you installed the `act_runner` binary, its configuration file, and the home directory of the `act_runner` user. - -```ini -[Unit] -Description=Gitea Actions runner -Documentation=https://gitea.com/gitea/act_runner -After=docker.service - -[Service] -ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml -ExecReload=/bin/kill -s HUP $MAINPID -WorkingDirectory=/var/lib/act_runner -TimeoutSec=0 -RestartSec=10 -Restart=always -User=act_runner - -[Install] -WantedBy=multi-user.target -``` - -Then: - -```bash -# load the new systemd unit file -sudo systemctl daemon-reload -# start the service and enable it at boot -sudo systemctl enable act_runner --now -``` - -If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface). - -## Configuration variable - -You can create configuration variables on the user, organization and repository level. -The level of the variable depends on where you created it. - -### Naming conventions - -The following rules apply to variable names: - -- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed. - -- Variable names must not start with the `GITHUB_` and `GITEA_` prefix. - -- Variable names must not start with a number. - -- Variable names are case-insensitive. - -- Variable names must be unique at the level they are created at. - -- Variable names must not be `CI`. - -### Using variable - -After creating configuration variables, they will be automatically filled in the `vars` context. -They can be accessed through expressions like `{{ vars.VARIABLE_NAME }}` in the workflow. - -### Precedence - -If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence: -A repository variable will always be chosen over an organization/user variable. diff --git a/docs/content/usage/actions/act-runner.zh-cn.md b/docs/content/usage/actions/act-runner.zh-cn.md deleted file mode 100644 index 274b0f0692..0000000000 --- a/docs/content/usage/actions/act-runner.zh-cn.md +++ /dev/null @@ -1,289 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "Act Runner" -slug: "act-runner" -sidebar_position: 20 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Act Runner" - sidebar_position: 20 - identifier: "actions-runner" ---- - -# Act Runner - -本页面将详细介绍[Act Runner](https://gitea.com/gitea/act_runner),这是Gitea Actions的Runner。 - -## 要求 - -建议在Docker容器中运行Job,因此您需要首先安装Docker。 -并确保Docker守护进程正在运行。 - -其他与Docker API兼容的OCI容器引擎也应该可以正常工作,但尚未经过测试。 - -但是,如果您确定要直接在主机上运行Job,则不需要Docker。 - -## 安装 - -有多种安装Act Runner的方法。 - -### 下载二进制文件 - -您可以从[发布页面](https://gitea.com/gitea/act_runner/releases)下载二进制文件。 -然而,如果您想使用最新的夜间构建版本,可以从[下载页面](https://dl.gitea.com/act_runner/)下载。 - -下载二进制文件时,请确保您已经下载了适用于您的平台的正确版本。 -您可以通过运行以下命令进行检查: - -```bash -chmod +x act_runner -./act_runner --version -``` - -如果看到版本信息,则表示您已经下载了正确的二进制文件。 - -### 使用 Docker 镜像 - -您可以使用[docker hub](https://hub.docker.com/r/gitea/act_runner/tags)上的Docker镜像。 -与二进制文件类似,您可以使用`nightly`标签使用最新的夜间构建版本,而`latest`标签是最新的稳定版本。 - -```bash -docker pull gitea/act_runner:latest # for the latest stable release -docker pull gitea/act_runner:nightly # for the latest nightly build -``` - -## 配置 - -配置通过配置文件进行。它是可选的,当没有指定配置文件时,将使用默认配置。 - -您可以通过运行以下命令生成配置文件: - -```bash -./act_runner generate-config -``` - -默认配置是安全的,可以直接使用。 - -```bash -./act_runner generate-config > config.yaml -./act_runner --config config.yaml [command] -``` - -您亦可以如下使用 docker 创建配置文件: - -```bash -docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml -``` - -当使用Docker镜像时,可以使用`CONFIG_FILE`环境变量指定配置文件。确保将文件作为卷挂载到容器中: - -```bash -docker run -v $(pwd)/config.yaml:/config.yaml -e CONFIG_FILE=/config.yaml ... -``` - -您可能注意到上面的命令都是不完整的,因为现在还不是运行Act Runner的时候。 -在运行Act Runner之前,我们需要首先将其注册到您的Gitea实例中。 - -## 注册 - -在运行Act Runner之前,需要进行注册,因为Runner需要知道从哪里获取Job,并且对于Gitea实例来说,识别Runner也很重要。 - -### Runner级别 - -您可以在不同级别上注册Runner,它可以是: - -- 实例级别:Runner将为实例中的所有存储库运行Job。 -- 组织级别:Runner将为组织中的所有存储库运行Job。 -- 存储库级别:Runner将为其所属的存储库运行Job。 - -请注意,即使存储库具有自己的存储库级别Runner,它仍然可以使用实例级别或组织级别Runner。未来的版本可能提供更多对此进行更好控制的选项。 - -### 获取注册令牌 - -Runner级别决定了从哪里获取注册令牌。 - -- 实例级别:管理员设置页面,例如 `<your_gitea.com>/admin/actions/runners`。 -- 组织级别:组织设置页面,例如 `<your_gitea.com>/<org>/settings/actions/runners`。 -- 存储库级别:存储库设置页面,例如 `<your_gitea.com>/<owner>/<repo>/settings/actions/runners`。 - -如果您无法看到设置页面,请确保您具有正确的权限并且已启用 Actions。 - -注册令牌的格式是一个随机字符串 `D0gvfu2iHfUjNqCYVljVyRV14fISpJxxxxxxxxxx`。 - -注册令牌也可以通过 Gitea 的 [命令行](administration/command-line.md#actions-generate-runner-token) 获得: - -### 注册Runner - -可以通过运行以下命令来注册Act Runner: - -```bash -./act_runner register -``` - -或者,您可以使用 `--config` 选项来指定前面部分提到的配置文件。 - -```bash -./act_runner --config config.yaml register -``` - -您将逐步输入注册信息,包括: - -- Gitea 实例的 URL,例如 `https://gitea.com/` 或 `http://192.168.8.8:3000/`。 -- 注册令牌。 -- Runner名称(可选)。如果留空,将使用主机名。 -- Runner标签(可选)。如果留空,将使用默认标签。 - -您可能对Runner标签感到困惑,稍后将对其进行解释。 - -如果您想以非交互方式注册Runner,可以使用参数执行以下操作。 - -```bash -./act_runner register --no-interactive --instance <instance_url> --token <registration_token> --name <runner_name> --labels <runner_labels> -``` - -注册Runner后,您可以在当前目录中找到一个名为 `.runner` 的新文件。该文件存储注册信息。 -请不要手动编辑该文件。 -如果此文件丢失或损坏,可以直接删除它并重新注册。 - -如果您想将注册信息存储在其他位置,请在配置文件中指定,并不要忘记指定 `--config` 选项。 - -### 使用Docker注册Runner - -如果您使用的是Docker镜像,注册行为会略有不同。在这种情况下,注册和运行合并为一步,因此您需要在运行Act Runner时指定注册信息。 - -```bash -docker run \ - -v $(pwd)/config.yaml:/config.yaml \ - -v $(pwd)/data:/data \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e CONFIG_FILE=/config.yaml \ - -e GITEA_INSTANCE_URL=<instance_url> \ - -e GITEA_RUNNER_REGISTRATION_TOKEN=<registration_token> \ - -e GITEA_RUNNER_NAME=<runner_name> \ - -e GITEA_RUNNER_LABELS=<runner_labels> \ - --name my_runner \ - -d gitea/act_runner:nightly -``` - -您可能注意到我们已将`/var/run/docker.sock`挂载到容器中。 -这是因为Act Runner将在Docker容器中运行Job,因此它需要与Docker守护进程进行通信。 -如前所述,如果要在主机上直接运行Job,可以将其移除。 -需要明确的是,这里的 "主机" 实际上指的是当前运行 Act Runner的容器,而不是主机机器本身。 - -### 使用 Docker compose 运行 Runner - -您亦可使用如下的 `docker-compose.yml`: - -```yml -version: "3.8" -services: - runner: - image: gitea/act_runner:nightly - environment: - CONFIG_FILE: /config.yaml - GITEA_INSTANCE_URL: "${INSTANCE_URL}" - GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}" - GITEA_RUNNER_NAME: "${RUNNER_NAME}" - GITEA_RUNNER_LABELS: "${RUNNER_LABELS}" - volumes: - - ./config.yaml:/config.yaml - - ./data:/data - - /var/run/docker.sock:/var/run/docker.sock -``` - -### 当您使用 Docker 镜像启动 Runner,如何配置 Cache - -如果你不打算在工作流中使用 `actions/cache`,你可以忽略本段。 - -如果您在使用 `actions/cache` 时没有进行额外的配置,将会返回以下错误信息: -> Failed to restore: getCacheEntry failed: connect ETIMEDOUT IP:PORT - -这个错误的原因是 runner 容器和作业容器位于不同的网络中,因此作业容器无法访问 runner 容器。 -因此,配置 cache 动作以确保其正常运行是非常重要的。请按照以下步骤操作: - -- 1.获取 Runner 容器所在主机的 LAN(本地局域网) IP 地址。 -- 2.获取一个 Runner 容器所在主机的空闲端口号。 -- 3.在配置文件中如下配置: - -```yaml -cache: - enabled: true - dir: "" - # 使用步骤 1. 获取的 LAN IP - host: "192.168.8.17" - # 使用步骤 2. 获取的端口号 - port: 8088 -``` - -- 4.启动容器时, 将 Cache 端口映射至主机。 - -```bash -docker run \ - --name gitea-docker-runner \ - -p 8088:8088 \ - -d gitea/act_runner:nightly -``` - -### 标签 - -Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们。 - -默认标签为`ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster`。 -它们是逗号分隔的列表,每个项目都是一个标签。 - -让我们以 `ubuntu-22.04:docker://node:16-bullseye` 为例。 -它意味着Runner可以运行带有`runs-on: ubuntu-22.04`的Job,并且该Job将在使用`node:16-bullseye`镜像的Docker容器中运行。 - -如果默认镜像无法满足您的需求,并且您有足够的磁盘空间可以使用更好、更大的镜像,您可以将其更改为`ubuntu-22.04:docker://<您喜欢的镜像>`。 -您可以在[act 镜像](https://github.com/nektos/act/blob/master/IMAGES.md)上找到更多有用的镜像。 - -如果您想直接在主机上运行Job,您可以将其更改为`ubuntu-22.04:host`或仅`ubuntu-22.04`,`:host`是可选的。 -然而,我们建议您使用类似`linux_amd64:host`或`windows:host`的特殊名称,以避免误用。 - -从 Gitea 1.21 开始,您可以通过修改 runner 的配置文件中的 `container.labels` 来更改标签(如果没有配置文件,请参考 [配置教程](#配置)),通过执行 `./act_runner daemon --config config.yaml` 命令重启 runner 之后,这些新定义的标签就会生效。 - -## 运行 - -注册完Runner后,您可以通过运行以下命令来运行它: - -```bash -./act_runner daemon -# or -./act_runner daemon --config config.yaml -``` - -Runner将从Gitea实例获取Job并自动运行它们。 - -由于Act Runner仍处于开发中,建议定期检查最新版本并进行升级。 - -## 变量 - -您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。 - -### 命名规则 - -以下规则适用于变量名: - -- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。 - -- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。 - -- 变量名称不能以数字开头。 - -- 变量名称不区分大小写。 - -- 变量名称在创建它们的级别上必须是唯一的。 - -- 变量名称不能为 “CI”。 - -### 使用 - -创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `{{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。 - -### 优先级 - -如果同名变量存在于多个级别,则级别最低的变量优先。 -仓库级别的变量总是比组织或者用户级别的变量优先被选中。 diff --git a/docs/content/usage/actions/comparison.en-us.md b/docs/content/usage/actions/comparison.en-us.md deleted file mode 100644 index 1ea3afac5b..0000000000 --- a/docs/content/usage/actions/comparison.en-us.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Compared to GitHub Actions" -slug: "comparison" -sidebar_position: 30 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Comparison" - sidebar_position: 30 - identifier: "actions-comparison" ---- - -# Compared to GitHub Actions - -Even though Gitea Actions is designed to be compatible with GitHub Actions, there are some differences between them. - -## Additional features - -### Absolute action URLs - -Gitea Actions supports defining actions via absolute URL, which means that you can use actions from any git repository. -Like `uses: https://github.com/actions/checkout@v4` or `uses: http://your_gitea.com/owner/repo@branch`. - -### Actions written in Go - -Gitea Actions supports writing actions in Go. -See [Creating Go Actions](https://blog.gitea.com/creating-go-actions/). - -### Support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly on schedule - -Github Actions doesn't support that. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule - -## Unsupported workflows syntax - -### `concurrency` - -It's used to run a single job at a time. -See [Using concurrency](https://docs.github.com/en/actions/using-jobs/using-concurrency). - -It's ignored by Gitea Actions now. - -### `run-name` - -The name for workflow runs generated from the workflow. -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#run-name). - -It's ignored by Gitea Actions now. - -### `permissions` and `jobs.<job_id>.permissions` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions). - -It's ignored by Gitea Actions now. - -### `jobs.<job_id>.timeout-minutes` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes). - -It's ignored by Gitea Actions now. - -### `jobs.<job_id>.continue-on-error` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error). - -It's ignored by Gitea Actions now. - -### `jobs.<job_id>.environment` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment). - -It's ignored by Gitea Actions now. - -### Complex `runs-on` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on). - -Gitea Actions only supports `runs-on: xyz` or `runs-on: [xyz]` now. - -### `workflow_dispatch` - -See [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatch). - -It's ignored by Gitea Actions now. - -### `hashFiles` expression - -See [Expressions](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles) - -Gitea Actions doesn't support it now, if you use it, the result will always be empty string. - -As a workaround, you can use [go-hashfiles](https://gitea.com/actions/go-hashfiles) instead. - -## Missing features - -### Problem Matchers - -Problem Matchers are a way to scan the output of actions for a specified regex pattern and surface that information prominently in the UI. -See [Problem matchers](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md). - -It's ignored by Gitea Actions now. - -### Create an error annotation - -See [Creating an annotation for an error](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-creating-an-annotation-for-an-error) - -It's ignored by Gitea Actions now. - -## Missing UI features - -### Pre and Post steps - -Pre and Post steps don't have their own section in the job log user interface. - -### Services steps - -Services steps don't have their own section in the job log user interface. - -## Different behavior - -### Downloading actions - -Previously (Pre 1.21.0), `[actions].DEFAULT_ACTIONS_URL` defaulted to `https://gitea.com`. -We have since restricted this option to only allow two values (`github` and `self`). -When set to `github`, the new default, Gitea will download non-fully-qualified actions from `https://github.com`. -For example, if you use `uses: actions/checkout@v4`, it will download the checkout repository from `https://github.com/actions/checkout.git`. - -If you want to download an action from another git hoster, you can use an absolute URL, e.g. `uses: https://gitea.com/actions/checkout@v4`. - -If your Gitea instance is in an intranet or a restricted area, you can set the URL to `self` to only download actions from your own instance by default. -Of course, you can still use absolute URLs in workflows. - -More details about the `[actions].DEFAULT_ACTIONS_URL` configuration can be found in the [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions)。 - -### Context availability - -Context availability is not checked, so you can use the env context on more places. -See [Context availability](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability). diff --git a/docs/content/usage/actions/comparison.zh-cn.md b/docs/content/usage/actions/comparison.zh-cn.md deleted file mode 100644 index dbe9ca007d..0000000000 --- a/docs/content/usage/actions/comparison.zh-cn.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "与GitHub Actions的对比" -slug: "comparison" -sidebar_position: 30 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "对比" - sidebar_position: 30 - identifier: "actions-comparison" ---- - -# 与GitHub Actions的对比 - -尽管Gitea Actions旨在与GitHub Actions兼容,但它们之间存在一些差异。 - -## 额外功能 - -### Action URL绝对路径 - -Gitea Actions支持通过URL绝对路径定义actions,这意味着您可以使用来自任何Git存储库的Actions。 -例如,`uses: https://github.com/actions/checkout@v4`或`uses: http://your_gitea.com/owner/repo@branch`。 - -### 使用Go编写Actions - -Gitea Actions支持使用Go编写Actions。 -请参阅[创建Go Actions](https://blog.gitea.com/creating-go-actions/)。 - -### 支持非标准的调度语法 @yearly, @monthly, @weekly, @daily, @hourly - -Github Actions 不支持这些语法,详见: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule - -## 不支持的工作流语法 - -### `concurrency` - -这是用于一次运行一个Job。 -请参阅[使用并发](https://docs.github.com/zh/actions/using-jobs/using-concurrency)。 - -Gitea Actions目前不支持此功能。 - -### `run-name` - -这是工作流生成的工作流运行的名称。 -请参阅[GitHub Actions 的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#run-name)。 - -Gitea Actions目前不支持此功能。 - -### `permissions`和`jobs.<job_id>.permissions` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#permissions)。 - -Gitea Actions目前不支持此功能。 - -### `jobs.<job_id>.timeout-minutes` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes)。 - -Gitea Actions目前不支持此功能。 - -### `jobs.<job_id>.continue-on-error` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error)。 - -Gitea Actions目前不支持此功能。 - -### `jobs.<job_id>.environment` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment)。 - -Gitea Actions 目前不支持此功能。 - -### 复杂的`runs-on` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on)。 - -Gitea Actions目前只支持`runs-on: xyz`或`runs-on: [xyz]`。 - -### `workflow_dispatch` - -请参阅[GitHub Actions的工作流语法](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatch)。 - -Gitea Actions目前不支持此功能。 - -### `hashFiles`表达式 - -请参阅[表达式](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles)。 - -Gitea Actions目前不支持此功能,如果使用它,结果将始终为空字符串。 - -作为解决方法,您可以使用[go-hashfiles](https://gitea.com/actions/go-hashfiles)。 - -## 缺失的功能 - -### 变量 - -请参阅[变量](https://docs.github.com/zh/actions/learn-github-actions/variables)。 - -目前变量功能正在开发中。 - -### 问题匹配器 - -问题匹配器是一种扫描Actions输出以查找指定正则表达式模式并在用户界面中突出显示该信息的方法。 -请参阅[问题匹配器](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md)。 - -Gitea Actions目前不支持此功能。 - -### 为错误创建注释 - -请参阅[为错误创建注释](https://docs.github.com/zh/actions/using-workflows/workflow-commands-for-github-actions#example-creating-an-annotation-for-an-error)。 - -Gitea Actions目前不支持此功能。 - -## 缺失的UI功能 - -### 预处理和后处理步骤 - -预处理和后处理步骤在Job日志用户界面中没有自己的用户界面。 - -### 服务步骤 - -服务步骤在Job日志用户界面中没有自己的用户界面。 - -## 不一样的行为 - -### 下载Actions - -当 `[actions].DEFAULT_ACTIONS_URL` 保持默认值为 `github` 时,Gitea将会从 https://github.com 下载相对路径的actions。比如: -如果你使用 `uses: actions/checkout@v4`,Gitea将会从 https://github.com/actions/checkout.git 下载这个 actions 项目。 -如果你想要从另外一个 Git服务下载actions,你只需要使用绝对URL `uses: https://gitea.com/actions/checkout@v4` 来下载。 - -如果你的 Gitea 实例是部署在一个互联网限制的网络中,也可以使用绝对地址来下载 actions。你也可以将配置项修改为 `[actions].DEFAULT_ACTIONS_URL = self`。这样所有的相对路径的actions引用,将不再会从 github.com 去下载,而会从这个 Gitea 实例自己的仓库中去下载。例如: `uses: actions/checkout@v4` 将会从 `[server].ROOT_URL`/actions/checkout.git 这个地址去下载 actions。 - -设置`[actions].DEFAULT_ACTIONS_URL`进行配置。请参阅[配置备忘单](administration/config-cheat-sheet.md#actions-actions)。 - -### 上下文可用性 - -不检查上下文可用性,因此您可以在更多地方使用env上下文。 -请参阅[上下文可用性](https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability)。 diff --git a/docs/content/usage/actions/design.en-us.md b/docs/content/usage/actions/design.en-us.md deleted file mode 100644 index 29fa433e59..0000000000 --- a/docs/content/usage/actions/design.en-us.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Design of Gitea Actions" -slug: "design" -sidebar_position: 40 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Design" - sidebar_position: 40 - identifier: "actions-design" ---- - -# Design of Gitea Actions - -Gitea Actions has multiple components. This document describes them individually. - -## Act - -The [nektos/act](https://github.com/nektos/act) project is an excellent tool that allows you to run your GitHub Actions locally. -We were inspired by this and wondered if it would be possible to run actions for Gitea. - -However, while [nektos/act](https://github.com/nektos/act) is designed as a command line tool, what we actually needed was a Go library with modifications specifically for Gitea. -So we forked it as [gitea/act](https://gitea.com/gitea/act). - -This is a soft fork that will periodically follow the upstream. -Although some custom commits have been added, we will try our best to avoid changing too much of the original code. - -The forked act is just a shim or adapter for Gitea's specific usage. -There are some additional commits that have been made, such as: - -- Outputting execution logs to logger hook so they can be reported to Gitea -- Disabling the GraphQL URL, since Gitea doesn't support it -- Starting a new container for every job instead of reusing to ensure isolation. - -These modifications have no reason to be merged into the upstream. -They don't make sense if the user just wants to run trusted actions locally. - -However, there may be overlaps in the future, such as a required bug fix or new feature needed by both projects. -In these cases, we will contribute the changes back to the upstream repository. - -## Act runner - -Gitea's runner is called act runner because it's based on act. - -Like other CI runners, we designed it as an external part of Gitea, which means it should run on a different server than Gitea. - -To ensure that the runner connects to the correct Gitea instance, we need to register it with a token. -Additionally, the runner will introduce itself to Gitea and declare what kind of jobs it can run by reporting its labels. - -Earlier, we mentioned that `runs-on: ubuntu-latest` in a workflow file means that the job will be run on a runner with the `ubuntu-latest` label. -But how does the runner know to run `ubuntu-latest`? The answer lies in mapping the label to an environment. -That's why when you add custom labels during registration, you will need to input some complex content like `my_custom_label:docker://centos:7`. -This means that the runner can take the job which needs to run on `my_custom_label`, and it will run it via a docker container with the image `centos:7`. - -Docker isn't the only option, though. -The act also supports running jobs directly on the host. -This is achieved through labels like `linux_arm:host`. -This label indicates that the runner can take a job that needs to run on `linux_arm` and run it directly on the host. - -The label's design follows the format `label[:schema[:args]]`. -If the schema is omitted, it defaults to `host`. -So, - -- `my_custom_label:docker://node:18`: Run jobs labeled with `my_custom_label` using the `node:18` Docker image. -- `my_custom_label:host`: Run jobs labeled with `my_custom_label` directly on the host. -- `my_custom_label`: Same as `my_custom_label:host`. -- `my_custom_label:vm:ubuntu-latest`: (Example only, not implemented) Run jobs labeled with `my_custom_label` using a virtual machine with the `ubuntu-latest` ISO. - -## Communication protocol - -As act runner is an independent part of Gitea, we needed a protocol for runners to communicate with the Gitea instance. -However, we did not think it was a good idea to have Gitea listen on a new port. -Instead, we wanted to reuse the HTTP port, which means we needed a protocol that is compatible with HTTP. -We chose to use gRPC over HTTP. - -We use [actions-proto-def](https://gitea.com/gitea/actions-proto-def) and [actions-proto-go](https://gitea.com/gitea/actions-proto-go) to wire them up. -More information about gRPC can be found on [its website](https://grpc.io/). - -## Network architecture - -Let's examine the overall network architecture. -This will help you troubleshoot some problems and explain why it's a bad idea to register a runner with a loopback address of the Gitea instance. - -![network](/images/usage/actions/network.png) - -There are four network connections marked in the picture, and the direction of the arrows indicates the direction of establishing the connections. - -### Connection 1, act runner to Gitea instance - -The act runner must be able to connect to Gitea to receive tasks and send back the execution results. - -### Connection 2, job containers to Gitea instance - -The job containers have different network namespaces than the runner, even if they are on the same machine. -They need to connect to Gitea to fetch codes if there is `actions/checkout@v4` in the workflow, for example. -Fetching code is not always necessary to run some jobs, but it is required in most cases. - -If you use a loopback address to register a runner, the runner can connect to Gitea when it is on the same machine. -However, if a job container tries to fetch code from localhost, it will fail because Gitea is not in the same container. - -### Connection 3, act runner to internet - -When you use some actions like `actions/checkout@v4`, the act runner downloads the scripts, not the job containers. -By default, it downloads from [gitea.com](http://gitea.com/), so it requires access to the internet. -It also downloads some docker images from Docker Hub by default, which also requires internet access. - -However, internet access is not strictly necessary. -You can configure your Gitea instance to fetch actions or images from your intranet facilities. - -In fact, your Gitea instance can serve as both the actions marketplace and the image registry. -You can mirror actions repositories from GitHub to your Gitea instance, and use them as normal. -And [Gitea Container Registry](usage/packages/container.md) can be used as a Docker image registry. - -### Connection 4, job containers to internet - -When using actions such as `actions/setup-go@v5`, it may be necessary to download resources from the internet to set up the Go language environment in job containers. -Therefore, access to the internet is required for the successful completion of these actions. - -However, it is optional as well. -You can use your own custom actions to avoid relying on internet access, or you can use your packaged Docker image to run jobs with all dependencies installed. - -## Summary - -Using Gitea Actions only requires ensuring that the runner can connect to the Gitea instance. -Internet access is optional, but not having it will require some additional work. -In other words: The runner works best when it can query the internet itself, but you don't need to expose it to the internet (in either direction). - -If you encounter any network issues while using Gitea Actions, hopefully the image above can help you troubleshoot them. diff --git a/docs/content/usage/actions/design.zh-cn.md b/docs/content/usage/actions/design.zh-cn.md deleted file mode 100644 index 8add1cf7c5..0000000000 --- a/docs/content/usage/actions/design.zh-cn.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "Gitea Actions设计" -slug: "design" -sidebar_position: 40 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "设计" - sidebar_position: 40 - identifier: "actions-design" ---- - -# Gitea Actions设计 - -Gitea Actions由多个组件组成。本文档将对它们进行逐个描述。 - -## Act - -[nektos/act](https://github.com/nektos/act) 项目是一个优秀的工具,允许你在本地运行GitHub Actions。 -我们受到了它的启发,并思考它是否可能为Gitea运行Actions。 - -然而,尽管[nektos/act](https://github.com/nektos/act)被设计为一个命令行工具,但我们实际上需要的是一个专为Gitea修改的Go库。 -因此,我们在[gitea/act](https://gitea.com/gitea/act)基础上进行了分叉。 - -这是一个软分叉,将定期跟进上游。 -虽然添加了一些自定义提交,但我们会尽力避免对原始代码进行太多更改。 - -分叉的 act 只是Gitea特定用途的桥接或适配器。 -还添加了一些额外的提交,例如: - -- 将执行日志输出到日志记录器钩子,以便报告给Gitea -- 禁用 GraphQL URL,因为Gitea不支持它 -- 每个Job启动一个新的容器,而不是重复使用,以确保隔离性。 - -这些修改没有理由合并到上游。 -如果用户只想在本地运行可信的Actions,它们是没有意义的。 - -然而,将来可能会出现重叠,例如两个项目都需要的必要错误修复或新功能。 -在这些情况下,我们将向上游仓库贡献变更。 - -## act runner - -Gitea的Runner被称为act runner,因为它基于act。 - -与其他CIRunner一样,我们将其设计为Gitea的外部部分,这意味着它应该在与Gitea不同的服务器上运行。 - -为了确保Runner连接到正确的Gitea实例,我们需要使用令牌注册它。 -此外,Runner通过声明自己的标签向Gitea报告它可以运行的Job类型。 - -之前,我们提到工作流文件中的 `runs-on: ubuntu-latest` 表示该Job将在具有`ubuntu-latest`标签的Runner上运行。 -但是,Runner如何知道要运行 `ubuntu-latest`?答案在于将标签映射到环境。 -这就是为什么在注册过程中添加自定义标签时,需要输入一些复杂内容,比如`my_custom_label:docker://centos:7`。 -这意味着Runner可以接受需要在`my_custom_label`上运行的Job,并通过使用`centos:7`镜像的Docker容器来运行它。 - -然而,Docker不是唯一的选择。 -act 也支持直接在主机上运行Job。 -这是通过像`linux_arm:host`这样的标签实现的。 -这个标签表示Runner可以接受需要在`linux_arm`上运行的Job,并直接在主机上运行它们。 - -标签的设计遵循格式`label[:schema[:args]]`。 -如果省略了schema,则默认为`host`。 - -因此, - -- `my_custom_label:docker://node:18`:使用`node:18 Docker`镜像运行带有`my_custom_label`标签的Job。 -- `my_custom_label:host`:在主机上直接运行带有`my_custom_label`标签的Job。 -- `my_custom_label`:等同于`my_custom_label:host`。 -- `my_custom_label:vm:ubuntu-latest`:(仅为示例,未实现)使用带有`ubuntu-latest` ISO的虚拟机运行带有`my_custom_label`标签的Job。 - -## 通信协议 - -由于act runner是Gitea的独立部分,我们需要一种协议让Runner与Gitea实例进行通信。 -然而,我们不认为让Gitea监听一个新端口是个好主意。 -相反,我们希望重用HTTP端口,这意味着我们需要一个与HTTP兼容的协议。 -因此,我们选择使用基于HTTP的gRPC。 - -我们使用[actions-proto-def](https://gitea.com/gitea/actions-proto-def) 和 [actions-proto-go](https://gitea.com/gitea/actions-proto-go) 进行连接。 -有关 gRPC 的更多信息,请访问[其官方网站](https://grpc.io/)。 - -## 网络架构 - -让我们来看一下整体的网络架构。 -这将帮助您解决一些问题,并解释为什么使用回环地址注册Runner是个不好的主意。 - -![network](/images/usage/actions/network.png) - -图片中标记了四个网络连接,并且箭头的方向表示建立连接的方向。 - -### 连接 1,act runner到Gitea实例 - -act runner 必须能够连接到Gitea以接收任务并发送执行结果回来。 - -### 连接 2,Job容器到Gitea实例 - -即使Job容器位于同一台机器上,它们的网络命名空间与Runner不同。 -举个例子,如果工作流中包含 `actions/checkout@v4`,Job容器需要连接到Gitea来获取代码。 -获取代码并不总是运行某些Job所必需的,但在大多数情况下是必需的。 - -如果您使用回环地址注册Runner,当Runner与Gitea在同一台机器上时,Runner可以连接到Gitea。 -然而,如果Job容器尝试从本地主机获取代码,它将失败,因为Gitea不在同一个容器中。 - -### 连接 3,act runner到互联网 - -当您使用诸如 `actions/checkout@v4` 的一些Actions时,act runner下载的是脚本,而不是Job容器。 -默认情况下,它从[gitea.com](http://gitea.com/)下载,因此需要访问互联网。 -它还默认从Docker Hub下载一些Docker镜像,这也需要互联网访问。 - -然而,互联网访问并不是绝对必需的。 -您可以配置您的Gitea实例从您的内部网络设施中获取 Actions 或镜像。 - -实际上,您的Gitea实例可以同时充当 Actions 市场和镜像注册表。 -您可以将GitHub上的Actions仓库镜像到您的Gitea实例,并将其用作普通Actions。 -而 [Gitea 容器注册表](usage/packages/container.md) 可用作Docker镜像注册表。 - -### 连接 4,Job容器到互联网 - -当使用诸如`actions/setup-go@v5`的Actions时,可能需要从互联网下载资源,以设置Job容器中的Go语言环境。 -因此,成功完成这些Actions需要访问互联网。 - -然而,这也是可选的。 -您可以使用自定义的Actions来避免依赖互联网访问,或者可以使用已安装所有依赖项的打包的Docker镜像来运行Job。 - -## 总结 - -使用Gitea Actions只需要确保Runner能够连接到Gitea实例。 -互联网访问是可选的,但如果没有互联网访问,将需要额外的工作。 -换句话说:当Runner能够自行查询互联网时,它的工作效果最好,但您不需要将其暴露给互联网(无论是单向还是双向)。 - -如果您在使用Gitea Actions时遇到任何网络问题,希望上面的图片能够帮助您进行故障排除。 diff --git a/docs/content/usage/actions/faq.en-us.md b/docs/content/usage/actions/faq.en-us.md deleted file mode 100644 index 7ed59e02cd..0000000000 --- a/docs/content/usage/actions/faq.en-us.md +++ /dev/null @@ -1,185 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Frequently Asked Questions of Gitea Actions" -slug: "faq" -sidebar_position: 100 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "FAQ" - sidebar_position: 100 - identifier: "actions-faq" ---- - -# Frequently Asked Questions of Gitea Actions - -This page contains some common questions and answers about Gitea Actions. - -## Why is Actions not enabled by default? - -We know it's annoying to enable Actions for the whole instance and each repository one by one, but not everyone likes or needs this feature. -We believe that more work needs to be done to improve Gitea Actions before it deserves any further special treatment. - -## Is it possible to enable Actions for new repositories by default for my own instance? - -Yes, when you enable Actions for the instance, you can choose to enable the `actions` unit for all new repositories by default. - -```ini -[repository] -DEFAULT_REPO_UNITS = ...,repo.actions -``` - -## Should we use `${{ github.xyz }}` or `${{ gitea.xyz }}` in workflow files? - -You can use `github.xyz` and Gitea will work fine. -As mentioned, Gitea Actions is designed to be compatible with GitHub Actions. -However, we recommend using `gitea.xyz` in case Gitea adds something that GitHub does not have to avoid different kinds of secrets in your workflow file (and because you are using this workflow on Gitea, not GitHub). -Still, this is completely optional since both options have the same effect at the moment. - -## Is it possible to register runners for a specific user (not organization)? - -Not yet. -It is technically possible to implement, but we need to discuss whether it is necessary. - -## Where will the runner download scripts when using actions such as `actions/checkout@v4`? - -You may be aware that there are tens of thousands of [marketplace actions](https://github.com/marketplace?type=actions) in GitHub. -However, when you write `uses: actions/checkout@v4`, it actually downloads the scripts from [gitea.com/actions/checkout](http://gitea.com/actions/checkout) by default (not GitHub). -This is a mirror of [github.com/actions/checkout](http://github.com/actions/checkout), but it's impossible to mirror all of them. -That's why you may encounter failures when trying to use some actions that haven't been mirrored. - -The good news is that you can specify the URL prefix to use actions from anywhere. -This is an extra syntax in Gitea Actions. -For example: - -- `uses: https://github.com/xxx/xxx@xxx` -- `uses: https://gitea.com/xxx/xxx@xxx` -- `uses: http://your_gitea_instance.com/xxx@xxx` - -Be careful, the `https://` or `http://` prefix is necessary! - -Alternatively, if you want your runners to download actions from GitHub or your own Gitea instance by default, you can configure it by setting `[actions].DEFAULT_ACTIONS_URL`. -See [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions). - -This is one of the differences from GitHub Actions, but it should allow users much more flexibility in how they run Actions. - -## How to limit the permission of the runners? - -Runners have no more permissions than simply connecting to your Gitea instance. -When any runner receives a job to run, it will temporarily gain limited permission to the repository associated with the job. -If you want to give more permissions to the runner, allowing it to access more private repositories or external systems, you can pass [secrets](usage/secrets.md) to it. - -Refined permission control to Actions is a complicated job. -In the future, we will add more options to Gitea to make it more configurable, such as allowing more write access to repositories or read access to all repositories in the same organization. - -## How to avoid being hacked? - -There are two types of possible attacks: unknown runner stealing the code or secrets from your repository, or malicious scripts controlling your runner. - -Avoiding the former means not allowing people you don't know to register runners for your repository, organization, or instance. - -The latter is a bit more complicated. -If you're using a private Gitea instance for your company, you may not need to worry about security since you trust your colleagues and can hold them accountable. - -For public instances, things are a little different. -Here's how we do it on [gitea.com](http://gitea.com/): - -- We only register runners for the "gitea" organization, so our runners will not execute jobs from other repositories. -- Our runners always run jobs with isolated containers. While it is possible to do this directly on the host, we choose not to for more security. -- To run actions for fork pull requests, approval is required. See [#22803](https://github.com/go-gitea/gitea/pull/22803). -- If someone registers their own runner for their repository or organization on [gitea.com](http://gitea.com/), we have no objections and will just not use it in our org. However, they should take care to ensure that the runner is not used by other users they do not know. - -## Which operating systems are supported by act runner? - -It works well on Linux, macOS, and Windows. -While other operating systems are theoretically supported, they require further testing. - -One thing to note is that if you choose to run jobs directly on the host instead of in job containers, the environmental differences between operating systems may cause unexpected failures. - -For example, bash is not available on Windows in most cases, while act tries to use bash to run scripts by default. -Therefore, you need to specify `powershell` as the default shell in your workflow file, see [defaults.run](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun). - -```yaml -defaults: - run: - shell: powershell -``` - -## Why choose GitHub Actions? Why not something compatible with GitLab CI/CD? - -[@lunny](https://gitea.com/lunny) has explained this in the [issue to implement actions](https://github.com/go-gitea/gitea/issues/13539). -Furthermore, Actions is not only a CI/CD system but also an automation tool. - -There have also been numerous [marketplace actions](https://github.com/marketplace?type=actions) implemented in the open-source world. -It is exciting to be able to reuse them. - -## What if it runs on multiple labels, such as `runs-on: [label_a, label_b]`? - -This is valid syntax. -It means that it should run on runners that have both the `label_a` **and** `label_b` labels, see [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on). -Unfortunately, act runner does not work this way. -As mentioned, we map labels to environments: - -- `ubuntu` → `ubuntu:22.04` -- `centos` → `centos:8` - -But we need to map label groups to environments instead, like so: - -- `[ubuntu]` → `ubuntu:22.04` -- `[with-gpu]` → `linux:with-gpu` -- `[ubuntu, with-gpu]` → `ubuntu:22.04_with-gpu` - -We also need to re-design how tasks are assigned to runners. -A runner with `ubuntu`, `centos`, or `with-gpu` does not necessarily indicate that it can accept jobs with `[centos, with-gpu]`. -Therefore, the runner should inform the Gitea instance that it can only accept jobs with `[ubuntu]`, `[centos]`, `[with-gpu]`, and `[ubuntu, with-gpu]`. -This is not a technical problem, it was just overlooked in the early design. -See [runtime.go#L65](https://gitea.com/gitea/act_runner/src/commit/90b8cc6a7a48f45cc28b5ef9660ebf4061fcb336/runtime/runtime.go#L65). - -Currently, the act runner attempts to match everyone in the labels and uses the first match it finds. - -## What is the difference between agent labels and custom labels for a runner? - -![labels](/images/usage/actions/labels.png) - -Agent labels are reported to the Gitea instance by the runner during registration. -Custom labels, on the other hand, are added manually by a Gitea administrator or owners of the organization or repository (depending on the level of the runner). - -However, the design here needs improvement, as it currently has some rough edges. -You can add a custom label such as `centos` to a registered runner, which means the runner will receive jobs with `runs-on: centos`. -However, the runner may not know which environment to use for this label, resulting in it using a default image or leading to a logical dead end. -This default may not match user expectations. -See [runtime.go#L71](https://gitea.com/gitea/act_runner/src/commit/90b8cc6a7a48f45cc28b5ef9660ebf4061fcb336/runtime/runtime.go#L71). - -In the meantime, we suggest that you re-register your runner if you want to change its labels. - -## Will there be more implementations for Gitea Actions runner? - -Although we would like to provide more options, our limited manpower means that act runner will be the only officially supported runner. -However, both Gitea and act runner are completely open source, so anyone can create a new/better implementation. -We support your choice, no matter how you decide. -In case you fork act runner to create your own version: Please contribute the changes back if you can and if you think your changes will help others as well. - -## What workflow trigger events does Gitea support? - -All events listed in this table are supported events and are compatible with GitHub. -For events supported only by GitHub, see GitHub's [documentation](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows). - -| trigger event | activity types | -|-----------------------------|--------------------------------------------------------------------------------------------------------------------------| -| create | not applicable | -| delete | not applicable | -| fork | not applicable | -| gollum | not applicable | -| push | not applicable | -| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` | -| issue_comment | `created`, `edited`, `deleted` | -| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` | -| pull_request_review | `submitted`, `edited` | -| pull_request_review_comment | `created`, `edited` | -| release | `published`, `edited` | -| registry_package | `published` | - -> For `pull_request` events, in [GitHub Actions](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request), the `ref` is `refs/pull/:prNumber/merge`, which is a reference to the merge commit preview. However, Gitea has no such reference. -> Therefore, the `ref` in Gitea Actions is `refs/pull/:prNumber/head`, which points to the head of pull request rather than the preview of the merge commit. diff --git a/docs/content/usage/actions/faq.zh-cn.md b/docs/content/usage/actions/faq.zh-cn.md deleted file mode 100644 index ba5f87bf0c..0000000000 --- a/docs/content/usage/actions/faq.zh-cn.md +++ /dev/null @@ -1,185 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "Gitea Actions常见问题解答" -slug: "faq" -sidebar_position: 100 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "常见问题" - sidebar_position: 100 - identifier: "actions-faq" ---- - -# Gitea Actions常见问题解答 - -本页面包含一些关于Gitea Actions的常见问题和答案。 - -## 为什么默认情况下不启用Actions? - -我们知道为整个实例和每个仓库启用Actions可能很麻烦,但并不是每个人都喜欢或需要此功能。 -在我们认为Gitea Actions值得被特别对待之前,我们认为还需要做更多的工作来改进它。 - -## 是否可以在我的实例中默认启用新仓库的Actions? - -是的,当您为实例启用Actions时,您可以选择默认启用actions单元以适用于所有新仓库。 - -```ini -[repository] -DEFAULT_REPO_UNITS = ...,repo.actions -``` - -## 在工作流文件中应该使用`${{ github.xyz }}`还是`${{ gitea.xyz }}`? - -您可以使用`github.xyz`,Gitea将正常工作。 -如前所述,Gitea Actions的设计是与GitHub Actions兼容的。 -然而,我们建议在工作流文件中使用`gitea.xyz`,以防止在工作流文件中出现不同类型的密钥(因为您在Gitea上使用此工作流,而不是GitHub)。 -不过,这完全是可选的,因为目前这两个选项的效果是相同的。 - -## 是否可以为特定用户(而不是组织)注册Runner? - -目前还不可以。 -从技术上讲是可以实现的,但我们需要讨论是否有必要。 - -## 使用`actions/checkout@v4`等Actions时,Job容器会从何处下载脚本? - -您可能知道GitHub上有成千上万个[Actions市场](https://github.com/marketplace?type=actions)。 -然而,当您编写`uses: actions/checkout@v4`时,它实际上默认从[gitea.com/actions/checkout](http://gitea.com/actions/checkout)下载脚本(而不是从GitHub下载)。 -这是[github.com/actions/checkout](http://github.com/actions/checkout)的镜像,但无法将它们全部镜像。 -这就是为什么在尝试使用尚未镜像的某些Actions时可能会遇到失败的原因。 - -好消息是,您可以指定要从任何位置使用Actions的URL前缀。 -这是Gitea Actions中的额外语法。 -例如: - -- `uses: https://github.com/xxx/xxx@xxx` -- `uses: https://gitea.com/xxx/xxx@xxx` -- `uses: http://your_gitea_instance.com/xxx@xxx` - -注意,`https://`或`http://`前缀是必需的! - -另外,如果您希望您的Runner默认从GitHub或您自己的Gitea实例下载Actions,可以通过设置 `[actions].DEFAULT_ACTIONS_URL`进行配置。 -参见[配置速查表](administration/config-cheat-sheet.md#actions-actions)。 - -这是与GitHub Actions的一个区别,但它应该允许用户以更灵活的方式运行Actions。 - -## 如何限制Runner的权限? - -Runner仅具有连接到您的Gitea实例的权限。 -当任何Runner接收到要运行的Job时,它将临时获得与Job关联的仓库的有限权限。 -如果您想为Runner提供更多权限,允许它访问更多私有仓库或外部系统,您可以向其传递[密钥](usage/secrets.md)。 - -对于 Actions 的细粒度权限控制是一项复杂的工作。 -在未来,我们将添加更多选项以使Gitea更可配置,例如允许对仓库进行更多写访问或对同一组织中的所有仓库进行读访问。 - -## 如何避免被黑客攻击? - -有两种可能的攻击类型:未知的Runner窃取您的仓库中的代码或密钥,或恶意脚本控制您的Runner。 - -避免前者意味着不允许您不认识的人为您的仓库、组织或实例注册Runner。 - -后者要复杂一些。 -如果您为公司使用私有的Gitea实例,您可能不需要担心安全问题,因为您信任您的同事,并且可以追究他们的责任。 - -对于公共实例,情况略有不同。 -以下是我们在 [gitea.com](http://gitea.com/)上的做法: - -- 我们仅为 "gitea" 组织注册Runner,因此我们的Runner不会执行来自其他仓库的Job。 -- 我们的Runner始终在隔离容器中运行Job。虽然可以直接在主机上进行这样的操作,但出于安全考虑,我们选择不这样做。 -- 对于 fork 的拉取请求,需要获得批准才能运行Actions。参见[#22803](https://github.com/go-gitea/gitea/pull/22803)。 -- 如果有人在[gitea.com](http://gitea.com/)为其仓库或组织注册自己的Runner,我们不会反对,只是不会在我们的组织中使用它。然而,他们应该注意确保该Runner不被他们不认识的其他用户使用。 - -## act runner支持哪些操作系统? - -它在Linux、macOS和Windows上运行良好。 -虽然理论上支持其他操作系统,但需要进一步测试。 - -需要注意的一点是,如果选择直接在主机上运行Job而不是在Job容器中运行,操作系统之间的环境差异可能会导致意外的失败。 - -例如,在大多数情况下,Windows上没有可用的bash,而act尝试默认使用bash运行脚本。 -因此,您需要在工作流文件中将默认shell指定为`powershell`,参考[defaults.run](https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun)。 - -```yaml -defaults: - run: - shell: powershell -``` - -## 为什么选择GitHub Actions?为什么不选择与GitLab CI/CD兼容的工具? - -[@lunny](https://gitea.com/lunny)在实现Actions的[问题](https://github.com/go-gitea/gitea/issues/13539)中已经解释过这个问题。 -此外,Actions不仅是一个CI/CD 系统,还是一个自动化工具。 - -在开源世界中,已经有许多[市场上的Actions](https://github.com/marketplace?type=actions)实现了。 -能够重用它们是令人兴奋的。 - -## 如果它在多个标签上运行,例如 `runs-on: [label_a, label_b]`,会发生什么? - -这是有效的语法。 -它意味着它应该在具有`label_a` **和** `label_b`标签的Runner上运行,参考[GitHub Actions的工作流语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on)。 -不幸的是,act runner 并不支持这种方式。 -如上所述,我们将标签映射到环境: - -- `ubuntu` → `ubuntu:22.04` -- `centos` → `centos:8` - -但我们需要将标签组映射到环境,例如: - -- `[ubuntu]` → `ubuntu:22.04` -- `[with-gpu]` → `linux:with-gpu` -- `[ubuntu, with-gpu]` → `ubuntu:22.04_with-gpu` - -我们还需要重新设计任务分配给Runner的方式。 -具有`ubuntu`、`centos`或`with-gpu`的Runner并不一定表示它可以接受`[centos, with-gpu]`的Job。 -因此,Runner应该通知Gitea实例它只能接受具有 `[ubuntu]`、`[centos]`、`[with-gpu]` 和 `[ubuntu, with-gpu]`的Job。 -这不是一个技术问题,只是在早期设计中被忽视了。 -参见[runtime.go#L65](https://gitea.com/gitea/act_runner/src/commit/90b8cc6a7a48f45cc28b5ef9660ebf4061fcb336/runtime/runtime.go#L65)。 - -目前,act runner尝试匹配标签中的每一个,并使用找到的第一个匹配项。 - -## 代理标签和自定义标签对于Runner有什么区别? - -![labels](/images/usage/actions/labels.png) - -代理标签是由Runner在注册过程中向Gitea实例报告的。 -而自定义标签则是由Gitea的管理员或组织或仓库的所有者手动添加的(取决于Runner所属的级别)。 - -然而,目前这方面的设计还有待改进,因为它目前存在一些不完善之处。 -您可以向已注册的Runner添加自定义标签,比如 `centos`,这意味着该Runner将接收具有`runs-on: centos`的Job。 -然而,Runner可能不知道要使用哪个环境来执行该标签,导致它使用默认镜像或导致逻辑死胡同。 -这个默认值可能与用户的期望不符。 -参见[runtime.go#L71](https://gitea.com/gitea/act_runner/src/commit/90b8cc6a7a48f45cc28b5ef9660ebf4061fcb336/runtime/runtime.go#L71)。 - -与此同时,如果您想更改Runner的标签,我们建议您重新注册Runner。 - -## Gitea Actions runner会有更多的实现吗? - -虽然我们希望提供更多的选择,但由于我们有限的人力资源,act runner将是唯一受支持的官方Runner。 -然而,无论您如何决定,Gitea 和act runner都是完全开源的,所以任何人都可以创建一个新的/更好的实现。 -我们支持您的选择,无论您如何决定。 -如果您选择分支act runner来创建自己的版本,请在您认为您的更改对其他人也有帮助的情况下贡献这些更改。 - -## Gitea 支持哪些工作流触发事件? - -表格中列出的所有事件都是支持的,并且与 GitHub 兼容。 -对于仅 GitHub 支持的事件,请参阅 GitHub 的[文档](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)。 - -| 触发事件 | 活动类型 | -|-----------------------------|--------------------------------------------------------------------------------------------------------------------------| -| create | 不适用 | -| delete | 不适用 | -| fork | 不适用 | -| gollum | 不适用 | -| push | 不适用 | -| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` | -| issue_comment | `created`, `edited`, `deleted` | -| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` | -| pull_request_review | `submitted`, `edited` | -| pull_request_review_comment | `created`, `edited` | -| release | `published`, `edited` | -| registry_package | `published` | - -> 对于 `pull_request` 事件,在 [GitHub Actions](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) 中 `ref` 是 `refs/pull/:prNumber/merge`,它指向这个拉取请求合并提交的一个预览。但是 Gitea 没有这种 reference。 -> 因此,Gitea Actions 中 `ref` 是 `refs/pull/:prNumber/head`,它指向这个拉取请求的头分支而不是合并提交的预览。 diff --git a/docs/content/usage/actions/overview.en-us.md b/docs/content/usage/actions/overview.en-us.md deleted file mode 100644 index 135fdfd433..0000000000 --- a/docs/content/usage/actions/overview.en-us.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Gitea Actions" -slug: "overview" -sidebar_position: 1 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Overview" - sidebar_position: 1 - identifier: "actions-overview" ---- - -# Gitea Actions - -Starting with Gitea **1.19**, Gitea Actions are available as a built-in CI/CD solution. - -## Name - -It is similar and compatible to [GitHub Actions](https://github.com/features/actions), and its name is inspired by it too. -To avoid confusion, we have clarified the spelling here: - -- "Gitea Actions" (with an "s", both words capitalized) is the name of the Gitea feature. -- "GitHub Actions" is the name of the GitHub feature. -- "Actions" could refer to either of the above, depending on the context. So it refers to "Gitea Actions" in this document. -- "action" or "actions" refer to some scripts/plugins to be used, like "actions/checkout@v4" or "actions/cache@v3". - -## Runners - -Just like other CI/CD solutions, Gitea doesn't run the jobs itself, but delegates the jobs to runners. -The runner of Gitea Actions is called [act runner](https://gitea.com/gitea/act_runner), it is a standalone program and also written in Go. -It is based on a [fork](https://gitea.com/gitea/act) of [nektos/act](http://github.com/nektos/act). - -Because the runner is deployed independently, there could be potential security issues. -To avoid them, please follow two simple rules: - -- Don't use a runner you don't trust for your repository, organization or instance. -- Don't provide a runner to a repository, organization or instance you don't trust. - -For Gitea instances used internally, such as instances used by enterprises or individuals, neither of these two rules is a problem, they are naturally so. -However, for public Gitea instances, such as [gitea.com](https://gitea.com), these two rules should be kept in mind when adding or using runners. - -## Status - -Gitea Actions is still under development, so there may be some bugs and missing features. -And breaking changes may be made before it's stable (v1.20 or later). - -If the situation changes, we will update it here. -So please refer to the content here when you find outdated articles elsewhere. diff --git a/docs/content/usage/actions/overview.zh-cn.md b/docs/content/usage/actions/overview.zh-cn.md deleted file mode 100644 index a2ec3070bc..0000000000 --- a/docs/content/usage/actions/overview.zh-cn.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "Gitea Actions" -slug: "overview" -sidebar_position: 1 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Overview" - sidebar_position: 1 - identifier: "actions-overview" ---- - -# Gitea Actions - -从Gitea **1.19**版本开始,Gitea Actions成为了内置的CI/CD解决方案。 - -## 名称 - -Gitea Actions与[GitHub Actions](https://github.com/features/actions)相似且兼容,它的名称也受到了它的启发。 -为了避免混淆,在这里我们明确了拼写方式: - -- "Gitea Actions"(两个单词都大写且带有"s")是Gitea功能的名称。 -- "GitHub Actions"是GitHub功能的名称。 -- "Actions"根据上下文的不同可以指代以上任意一个。在本文档中指代的是"Gitea Actions"。 -- "action"或"actions"指代一些要使用的脚本/插件,比如"actions/checkout@v4"或"actions/cache@v3"。 - -## Runner - -和其他CI/CD解决方案一样,Gitea不会自己运行Job,而是将Job委托给Runner。 -Gitea Actions的Runner被称为[act runner](https://gitea.com/gitea/act_runner),它是一个独立的程序,也是用Go语言编写的。 -它是基于[nektos/act](http://github.com/nektos/act)的一个[分支](https://gitea.com/gitea/act) 。 - -由于Runner是独立部署的,可能存在潜在的安全问题。 -为了避免这些问题,请遵循两个简单的规则: - -- 不要为你的仓库、组织或实例使用你不信任的Runner。 -- 不要为你不信任的仓库、组织或实例提供Runner。 - -对于内部使用的Gitea实例,比如企业或个人使用的实例,这两个规则不是问题,它们自然而然就是如此。 -然而,对于公共的Gitea实例,比如[gitea.com](https://gitea.com),在添加或使用Runner时应当牢记这两个规则。 - -## 状态 - -Gitea Actions仍然在开发中,因此可能存在一些错误和缺失的功能。 -并且在稳定版本(v1.20或更高版本)之前可能会进行一些重大的更改。 - -如果情况发生变化,我们将在此处进行更新。 -因此,请在其他地方找到过时文章时参考此处的内容。 diff --git a/docs/content/usage/actions/quickstart.en-us.md b/docs/content/usage/actions/quickstart.en-us.md deleted file mode 100644 index 2a2cf72584..0000000000 --- a/docs/content/usage/actions/quickstart.en-us.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -date: "2023-04-27T15:00:00+08:00" -title: "Quick Start" -slug: "quickstart" -sidebar_position: 10 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "Quick Start" - sidebar_position: 10 - identifier: "actions-quickstart" ---- - -# Quick Start - -This page will guide you through the process of using Gitea Actions. - -## Set up Gitea - -First of all, you need a Gitea instance. -You can follow the [documentation](installation/from-package.md) to set up a new instance or upgrade your existing one. -It doesn't matter how you install or run Gitea, as long as its version is 1.19.0 or higher. - -Since 1.21.0, Actions are enabled by default. If you are using versions before 1.21.0, you need to add the following to the configuration file to enable it: - -```ini -[actions] -ENABLED=true -``` - -If you want to learn more or encounter any problems while configuring it, please refer to the [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions). - -### Set up runner - -Gitea Actions requires [act runner](https://gitea.com/gitea/act_runner) to run the jobs. -In order to avoid consuming too many resources and affecting the Gitea instance, it is recommended to start runners on separate machines from the Gitea instance. - -You can use the [pre-built binaries](http://dl.gitea.com/act_runner) or the [docker images](https://hub.docker.com/r/gitea/act_runner/tags) to set up the runner. - -Before proceeding any further, we suggest running it as a command line with pre-built binaries to ensure that it works with your environment, especially if you are running a runner on your local host. -And it could be easier to debug if something goes wrong. - -The runner can run the jobs in isolated Docker containers, so you need to make sure that the Docker has been installed and Docker daemon is running. -While it is not strictly necessary, because the runner can also run the jobs directly on the host, it depends on how you configure it. -However, it is recommended to use Docker to run the jobs, because it is more secure and easier to manage. - -Before running a runner, you should first register it to your Gitea instance using the following command: - -```bash -./act_runner register --no-interactive --instance <instance> --token <token> -``` - -There are two arguments required, `instance` and `token`. - -`instance` refers to the address of your Gitea instance, like `http://192.168.8.8:3000` or `https://gitea.com`. -The runner and job containers (which are started by the runner to execute jobs) will connect to this address. -This means that it could be different from the `ROOT_URL` of your Gitea instance, which is configured for web access. -It is always a bad idea to use a loopback address such as `127.0.0.1` or `localhost`. -If you are unsure which address to use, the LAN address is usually the right choice. - -`token` is used for authentication and identification, such as `P2U1U0oB4XaRCi8azcngmPCLbRpUGapalhmddh23`. -It is one-time use only and cannot be used to register multiple runners. -You can obtain different levels of 'tokens' from the following places to create the corresponding level of' runners': - -- Instance level: The admin settings page, like `<your_gitea.com>/admin/actions/runners`. -- Organization level: The organization settings page, like `<your_gitea.com>/<org>/settings/actions/runners`. -- Repository level: The repository settings page, like `<your_gitea.com>/<owner>/<repo>/settings/actions/runners`. - -![register runner](/images/usage/actions/register-runner.png) - -After registering, a new file named `.runner` will appear in the current directory. -This file stores the registration information. -Please do not edit it manually. -If this file is missing or corrupted, you can simply remove it and register again. - -Finally, it's time to start the runner: - -```bash -./act_runner daemon -``` - -And you can see the new runner in the management page: - -![view runner](/images/usage/actions/view-runner.png) - -You can find more information by visiting [Act runner](usage/actions/act-runner.md). - -### Use Actions - -Even if Actions is enabled for the Gitea instance, repositories still disable Actions by default. - -To enable it, go to the settings page of your repository like `your_gitea.com/<owner>/repo/settings` and enable `Enable Repository Actions`. - -![enable actions](/images/usage/actions/enable-actions.png) - -The next steps may be rather complicated. -You will need to study [the workflow syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) for Actions and write the workflow files you want. - -However, we can just start from a simple demo: - -```yaml -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." -``` - -You can upload it as a file with the extension `.yaml` in the directory `.gitea/workflows/` of the repository, for example `.gitea/workflows/demo.yaml`. -You might notice that this is fairly similar from the [Quickstart for GitHub Actions](https://docs.github.com/en/actions/quickstart). -That is because Gitea Actions is designed to be compatible with GitHub Actions wherever possible. - -Be careful, the demo file contains some emojis. -Please make sure your database supports them, especially when using MySQL. -If the charset is not `utf8mb4`, errors will occur, such as `Error 1366 (HY000): Incorrect string value: '\\xF0\\x9F\\x8E\\x89 T...' for column 'name' at row 1`. -See [Database Preparation](installation/database-preparation.md#mysql) for more information. - -Alternatively, you can remove all emojis from the demo file and try again. - -The line `on: [push]` indicates that the workflow will be triggered when you push commits to this repository. -However, when you upload the YAML file, it also pushes a commit, so you should see a new task in the Actions tab. - -![view job](/images/usage/actions/view-job.png) - -Great job! You have successfully started working with Actions. diff --git a/docs/content/usage/actions/quickstart.zh-cn.md b/docs/content/usage/actions/quickstart.zh-cn.md deleted file mode 100644 index 8fccc6c909..0000000000 --- a/docs/content/usage/actions/quickstart.zh-cn.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -date: "2023-05-24T15:00:00+08:00" -title: "快速入门" -slug: "quickstart" -sidebar_position: 10 -draft: false -toc: false -menu: - sidebar: - parent: "actions" - name: "快速入门" - sidebar_position: 10 - identifier: "actions-quickstart" ---- - -# 快速入门 - -本页面将指导您使用Gitea Actions的过程。 - -## 设置Gitea - -首先,您需要一个Gitea实例。 -您可以按照[文档](installation/from-package.md) 来设置一个新实例或升级现有实例。 -无论您如何安装或运行Gitea,只要版本号是1.19.0或更高即可。 - -从1.21.0开始,默认情况下,Actions是启用的。如果您正在使用1.21.0之前的版本,您需要将以下内容添加到配置文件中以启用它: - -```ini -[actions] -ENABLED=true -``` - -如果您想了解更多信息或在配置过程中遇到任何问题,请参考[配置速查表](administration/config-cheat-sheet.md#actions-actions)。 - -### 设置Runner - -Gitea Actions需要[act runner](https://gitea.com/gitea/act_runner) 来运行Job。 -为了避免消耗过多资源并影响Gitea实例,建议您在与Gitea实例分开的机器上启动Runner。 - -您可以使用[预构建的二进制文件](http://dl.gitea.com/act_runner)或[容器镜像](https://hub.docker.com/r/gitea/act_runner/tags)来设置Runner。 - -在进一步操作之前,建议您先使用预构建的二进制文件以命令行方式运行它,以确保它与您的环境兼容,尤其是如果您在本地主机上运行Runner。 -如果出现问题,这样调试起来会更容易。 - -该Runner可以在隔离的Docker容器中运行Job,因此您需要确保已安装Docker并且Docker守护进程正在运行。 -虽然这不是严格必需的,因为Runner也可以直接在主机上运行Job,这取决于您的配置方式。 -然而,建议使用Docker运行Job,因为它更安全且更易于管理。 - -在运行Runner之前,您需要使用以下命令将其注册到Gitea实例中: - -```bash -./act_runner register --no-interactive --instance <instance> --token <token> -``` - -需要两个必需的参数:`instance` 和 `token`。 - -`instance`是您的Gitea实例的地址,如`http://192.168.8.8:3000`或`https://gitea.com`。 -Runner和Job容器(由Runner启动以执行Job)将连接到此地址。 -这意味着它可能与用于Web访问的`ROOT_URL`不同。 -使用回环地址(例如 `127.0.0.1` 或 `localhost`)是一个不好的选择。 -如果不确定使用哪个地址,通常选择局域网地址即可。 - -`token` 用于身份验证和标识,例如 `P2U1U0oB4XaRCi8azcngmPCLbRpUGapalhmddh23`。 -它只能使用一次,并且不能用于注册多个Runner。 -您可以从以下位置获取不同级别的`token`,从而创建出相应级别的`runner` - -- 实例级别:管理员设置页面,例如 `<your_gitea.com>/admin/actions/runners`。 -- 组织级别:组织设置页面,例如 `<your_gitea.com>/<org>/settings/actions/runners`。 -- 存储库级别:存储库设置页面,例如 `<your_gitea.com>/<owner>/<repo>/settings/actions/runners`。 - -![register runner](/images/usage/actions/register-runner.png) - -注册后,当前目录中将出现一个名为 `.runner` 的新文件,该文件存储了注册信息。 -请不要手动编辑该文件。 -如果该文件丢失或损坏,只需删除它然后重新注册即可。 - -最后,是时候启动Runner了: - -```bash -./act_runner daemon -``` - -您可以在管理页面上看到新的Runner: - -![view runner](/images/usage/actions/view-runner.png) - -您可以通过访问[act runner](usage/actions/act-runner.md) 获取更多信息。 - -### 使用Actions - -即使对于启用了Gitea实例的Actions,存储库仍默认禁用Actions。 - -要启用它,请转到存储库的设置页面,例如`your_gitea.com/<owner>/repo/settings`,然后启用`Enable Repository Actions`。 - -![enable actions](/images/usage/actions/enable-actions.png) - -接下来的步骤可能相当复杂。 -您需要学习Actions的[工作流语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions),并编写您想要的工作流文件。 - -不过,我们可以从一个简单的演示开始: - -```yaml -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." -``` - -您可以将上述示例上传为一个以`.yaml`扩展名的文件,放在存储库的`.gitea/workflows/`目录中,例如`.gitea/workflows/demo.yaml`。 -您可能会注意到,这与[GitHub Actions的快速入门](https://docs.github.com/en/actions/quickstart)非常相似。 -这是因为Gitea Actions在尽可能兼容GitHub Actions的基础上进行设计。 - -请注意,演示文件中包含一些表情符号。 -请确保您的数据库支持它们,特别是在使用MySQL时。 -如果字符集不是`utf8mb4`,将出现错误,例如`Error 1366 (HY000): Incorrect string value: '\\xF0\\x9F\\x8E\\x89 T...' for column 'name' at row 1`。 -有关更多信息,请参阅[数据库准备工作](installation/database-preparation.md#mysql)。 - -或者,您可以从演示文件中删除所有表情符号,然后再尝试一次。 - -`on: [push]` 这一行表示当您向该存储库推送提交时,工作流将被触发。 -然而,当您上传 YAML 文件时,它也会推送一个提交,所以您应该在"Actions"标签中看到一个新的任务。 - -![view job](/images/usage/actions/view-job.png) - -做得好!您已成功开始使用Actions。 diff --git a/docs/content/usage/agit-support.en-us.md b/docs/content/usage/agit-support.en-us.md deleted file mode 100644 index fff9124320..0000000000 --- a/docs/content/usage/agit-support.en-us.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -date: " 2022-09-01T20:50:42+0000" -title: "Agit Setup" -slug: "agit-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /en-us/agit-setup -menu: - sidebar: - parent: "usage" - name: "Agit Setup" - sidebar_position: 12 - identifier: "agit-setup" ---- - -# Agit Setup - -In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added. -**Note**: git version 2.29 or higher is required on the server side for this to work. - -## Creating PRs with Agit - -Agit allows to create PRs while pushing code to the remote repo. -This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git). -The following example illustrates this: - -```shell -git push origin HEAD:refs/for/main -``` - -The command has the following structure: - -- `HEAD`: The target branch -- `origin`: The target repository (not a fork!) -- `HEAD`: The local branch containing the changes you are proposing -- `refs/<for|draft|for-review>/<branch>`: The target PR type and configuration - - `for`: Create a normal PR with `<branch>` as the target branch - - `draft`/`for-review`: Currently ignored silently - - `<branch>/`: The branch you want your changes to be merged into -- `-o <topic|title|description>`: Options for the PR - - `topic`: The topic of this change. It will become the name of the branch holding the changes waiting for review. This is REQUIRED to trigger a pull request. - - `title`: The PR title (optional but recommended), only used for topics not already having an associated PR. - - `description`: The PR description (optional but recommended), only used for topics not already having an associated PR. - - `force-push`: confirm force update the target branch - -Here's another advanced example for creating a new PR targeting `main` with `topic`, `title`, and `description`: - -```shell -git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" -``` diff --git a/docs/content/usage/agit-support.zh-cn.md b/docs/content/usage/agit-support.zh-cn.md deleted file mode 100644 index 54210d070b..0000000000 --- a/docs/content/usage/agit-support.zh-cn.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "Agit 设置" -slug: "agit-setup" -sidebar_position: 12 -toc: false -draft: false -aliases: - - /zh-cn/agit-setup -menu: - sidebar: - parent: "usage" - name: "Agit 设置" - sidebar_position: 12 - identifier: "agit-setup" ---- - -# Agit 设置 - -在 Gitea `1.13` 版本中,添加了对 [agit](https://git-repo.info/zh/2020/03/agit-flow-and-git-repo/) 的支持。 - -## 使用 Agit 创建 PR - -Agit 允许在推送代码到远程仓库时创建 PR(合并请求)。 -通过在推送时使用特定的 refspec(git 中已知的位置标识符),可以实现这一功能。 -下面的示例说明了这一点: - -```shell -git push origin HEAD:refs/for/main -``` - -该命令的结构如下: - -- `HEAD`:目标分支 -- `refs/<for|draft|for-review>/<branch>`:目标 PR 类型 - - `for`:创建一个以 `<branch>` 为目标分支的普通 PR - - `draft`/`for-review`:目前被静默忽略 -- `<branch>/<session>`:要打开 PR 的目标分支 -- `-o <topic|title|description>`:PR 的选项 - - `title`:PR 的标题 - - `topic`:PR 应该打开的分支名称 - - `description`:PR 的描述 - - `force-push`:确认强制更新目标分支 - -下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `main`: - -```shell -git push origin HEAD:refs/for/main -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok" -``` diff --git a/docs/content/usage/authentication.en-us.md b/docs/content/usage/authentication.en-us.md deleted file mode 100644 index adc936dfbe..0000000000 --- a/docs/content/usage/authentication.en-us.md +++ /dev/null @@ -1,351 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Authentication" -slug: "authentication" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /en-us/authentication -menu: - sidebar: - parent: "usage" - name: "Authentication" - sidebar_position: 10 - identifier: "authentication" ---- - -# Authentication - -## LDAP (Lightweight Directory Access Protocol) - -Both the LDAP via BindDN and the simple auth LDAP share the following fields: - -- Authorization Name **(required)** - - - A name to assign to the new method of authorization. - -- Host **(required)** - - - The address where the LDAP server can be reached. - - Example: `mydomain.com` - -- Port **(required)** - - - The port to use when connecting to the server. - - Example: `389` for LDAP or `636` for LDAP SSL - -- Enable TLS Encryption (optional) - - - Whether to use TLS when connecting to the LDAP server. - -- Admin Filter (optional) - - - An LDAP filter specifying if a user should be given administrator - privileges. If a user account passes the filter, the user will be - privileged as an administrator. - - Example: `(objectClass=adminAccount)` - - Example for Microsoft Active Directory (AD): `(memberOf=CN=admin-group,OU=example,DC=example,DC=org)` - -- Username attribute (optional) - - - The attribute of the user's LDAP record containing the user name. Given - attribute value will be used for new Gitea account user name after first - successful sign-in. Leave empty to use login name given on sign-in form. - - This is useful when supplied login name is matched against multiple - attributes, but only single specific attribute should be used for Gitea - account name, see "User Filter". - - Example: `uid` - - Example for Microsoft Active Directory (AD): `sAMAccountName` - -- First name attribute (optional) - - - The attribute of the user's LDAP record containing the user's first name. - This will be used to populate their account information. - - Example: `givenName` - -- Surname attribute (optional) - - - The attribute of the user's LDAP record containing the user's surname. - This will be used to populate their account information. - - Example: `sn` - -- E-mail attribute **(required)** - - The attribute of the user's LDAP record containing the user's email - address. This will be used to populate their account information. - - Example: `mail` - -### LDAP via BindDN - -Adds the following fields: - -- Bind DN (optional) - - - The DN to bind to the LDAP server with when searching for the user. This - may be left blank to perform an anonymous search. - - Example: `cn=Search,dc=mydomain,dc=com` - -- Bind Password (optional) - - - The password for the Bind DN specified above, if any. _Note: The password - is stored encrypted with the SECRET_KEY on the server. It is still recommended - to ensure that the Bind DN has as few privileges as possible._ - -- User Search Base **(required)** - - - The LDAP base at which user accounts will be searched for. - - Example: `ou=Users,dc=mydomain,dc=com` - -- User Filter **(required)** - - An LDAP filter declaring how to find the user record that is attempting to - authenticate. The `%[1]s` matching parameter will be substituted with login - name given on sign-in form. - - Example: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - - Example for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))` - - To substitute more than once, `%[1]s` should be used instead, e.g. when - matching supplied login name against multiple attributes such as user - identifier, email or even phone number. - - Example: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` -- Enable user synchronization - - This option enables a periodic task that synchronizes the Gitea users with - the LDAP server. The default period is every 24 hours but that can be - changed in the app.ini file. See the _cron.sync_external_users_ section in - the [sample - app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - for detailed comments about that section. The _User Search Base_ and _User - Filter_ settings described above will limit which users can use Gitea and - which users will be synchronized. When initially run the task will create - all LDAP users that match the given settings so take care if working with - large Enterprise LDAP directories. - -### LDAP using simple auth - -Adds the following fields: - -- User DN **(required)** - - - A template to use as the user's DN. The `%s` matching parameter will be - substituted with login name given on sign-in form. - - Example: `cn=%s,ou=Users,dc=mydomain,dc=com` - - Example: `uid=%s,ou=Users,dc=mydomain,dc=com` - -- User Search Base (optional) - - - The LDAP base at which user accounts will be searched for. - - Example: `ou=Users,dc=mydomain,dc=com` - -- User Filter **(required)** - - An LDAP filter declaring when a user should be allowed to log in. The `%[1]s` - matching parameter will be substituted with login name given on sign-in - form. - - Example: `(&(objectClass=posixAccount)(|(cn=%[1]s)(mail=%[1]s)))` - - Example: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - -### Verify group membership in LDAP - -Uses the following fields: - -- Group Search Base DN (optional) - - - The LDAP DN used for groups. - - Example: `ou=group,dc=mydomain,dc=com` - -- Group Attribute Containing List Of Users (optional) - - The attribute of the group object that lists/contains the group members. - - Example: `memberUid` or `member` - -- User Attribute Listed in Group (optional) - - - The user attribute that is used to reference a user in the group object. - - Example: `uid` if the group objects contains a `member: bender` and the user object contains a `uid: bender`. - - Example: `dn` if the group object contains a `member: uid=bender,ou=users,dc=planetexpress,dc=com`. - -- Verify group membership in LDAP (optional) - - - An LDAP filter declaring how to find valid groups in the above DN. - - Example: `(|(cn=gitea_users)(cn=admins))` - -## PAM (Pluggable Authentication Module) - -This procedure enables PAM authentication. Users may still be added to the -system manually using the user administration. PAM provides a mechanism to -automatically add users to the current database by testing them against PAM -authentication. To work with normal Linux passwords, the user running Gitea -must also have read access to `/etc/shadow` in order to check the validity of -the account when logging in using a public key. - -**Note**: If a user has added SSH public keys into Gitea, the use of these -keys _may_ bypass the login check system. Therefore, if you wish to disable a user who -authenticates with PAM, you _should_ also manually disable the account in Gitea using the -built-in user manager. - -1. Configure and prepare the installation. - - It is recommended that you create an administrative user. - - Deselecting automatic sign-up may also be desired. -1. Once the database has been initialized, log in as the newly created -administrative user. -1. Navigate to the user setting (icon in top-right corner), and select -`Site Administration` -> `Authentication Sources`, and select -`Add Authentication Source`. -1. Fill out the field as follows: - - `Authentication Type` : `PAM` - - `Name` : Any value should be valid here, use "System Authentication" if - you'd like. - - `PAM Service Name` : Select the appropriate file listed under `/etc/pam.d/` - that performs the authentication desired.[^1] - - `PAM Email Domain` : The e-mail suffix to append to user authentication. - For example, if the login system expects a user called `gituser`, and this - field is set to `mail.com`, then Gitea will expect the `user email` field - for an authenticated GIT instance to be `gituser@mail.com`.[^2] - -**Note**: PAM support is added via [build-time flags](installation/from-source.md#build), -and the official binaries provided do not have this enabled. PAM requires that -the necessary libpam dynamic library be available and the necessary PAM -development headers be accessible to the compiler. - -[^1]: For example, using standard Linux log-in on Debian "Bullseye" use -`common-session-noninteractive` - this value may be valid for other flavors of -Debian including Ubuntu and Mint, consult your distribution's documentation. -[^2]: **This is a required field for PAM**. Be aware: In the above example, the -user will log into the Gitea web interface as `gituser` and not `gituser@mail.com` - -## SMTP (Simple Mail Transfer Protocol) - -This option allows Gitea to log in to an SMTP host as a Gitea user. To -configure this, set the fields below: - -- Authentication Name **(required)** - - - A name to assign to the new method of authorization. - -- SMTP Authentication Type **(required)** - - - Type of authentication to use to connect to SMTP host, PLAIN or LOGIN. - -- Host **(required)** - - - The address where the SMTP host can be reached. - - Example: `smtp.mydomain.com` - -- Port **(required)** - - - The port to use when connecting to the server. - - Example: `587` - -- Allowed Domains - - - Restrict what domains can log in if using a public SMTP host or SMTP host - with multiple domains. - - Example: `gitea.io,mydomain.com,mydomain2.com` - -- Force SMTPS - - - SMTPS will be used by default for connections to port 465, if you wish to use SMTPS - for other ports. Set this value. - - Otherwise if the server provides the `STARTTLS` extension this will be used. - -- Skip TLS Verify - - - Disable TLS verify on authentication. - -- This Authentication Source is Activated - - Enable or disable this authentication source. - -## FreeIPA - -- In order to log in to Gitea using FreeIPA credentials, a bind account needs to - be created for Gitea: - -- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com` - with your DN, and provide an appropriately secure password: - - ```sh - dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com - changetype: add - objectclass: account - objectclass: simplesecurityobject - uid: gitea - userPassword: secure password - passwordExpirationTime: 20380119031407Z - nsIdleTimeout: 0 - ``` - -- Import the LDIF (change localhost to an IPA server if needed). A prompt for - Directory Manager password will be presented: - - ```sh - ldapmodify -h localhost -p 389 -x -D \ - "cn=Directory Manager" -W -f gitea.ldif - ``` - -- Add an IPA group for gitea_users : - - ```sh - ipa group-add --desc="Gitea Users" gitea_users - ``` - -- Note: For errors about IPA credentials, run `kinit admin` and provide the - domain admin account password. - -- Log in to Gitea as an Administrator and click on "Authentication" under Admin Panel. - Then click `Add New Source` and fill in the details, changing all where appropriate. - -## SPNEGO with SSPI (Kerberos/NTLM, for Windows only) - -Gitea supports SPNEGO single sign-on authentication (the scheme defined by RFC4559) for the web part of the server via the Security Support Provider Interface (SSPI) built in Windows. SSPI works only in Windows environments - when both the server and the clients are running Windows. - -Before activating SSPI single sign-on authentication (SSO) you have to prepare your environment: - -- Create a separate user account in active directory, under which the `gitea.exe` process will be running (eg. `user` under domain `domain.local`): - -- Create a service principal name for the host where `gitea.exe` is running with class `HTTP`: - - - Start `Command Prompt` or `PowerShell` as a privileged domain user (eg. Domain Administrator) - - Run the command below, replacing `host.domain.local` with the fully qualified domain name (FQDN) of the server where the web application will be running, and `domain\user` with the name of the account created in the previous step: - - ```sh - setspn -A HTTP/host.domain.local domain\user - ``` - -- Sign in (_sign out if you were already signed in_) with the user created - -- Make sure that `ROOT_URL` in the `[server]` section of `custom/conf/app.ini` is the fully qualified domain name of the server where the web application will be running - the same you used when creating the service principal name (eg. `host.domain.local`) - -- Start the web server (`gitea.exe web`) - -- Enable SSPI authentication by adding an `SPNEGO with SSPI` authentication source in `Site Administration -> Authentication Sources` - -- Sign in to a client computer in the same domain with any domain user (client computer, different from the server running `gitea.exe`) - -- If you are using Chrome or Edge, add the URL of the web app to the Local intranet sites (`Internet Options -> Security -> Local intranet -> Sites`) - -- Start Chrome or Edge and navigate to the FQDN URL of Gitea (eg. `http://host.domain.local:3000`) - -- Click the `Sign In` button on the dashboard and choose SSPI to be automatically logged in with the same user that is currently logged on to the computer - -- If it does not work, make sure that: - - You are not running the web browser on the same server where Gitea is running. You should be running the web browser on a domain joined computer (client) that is different from the server. If both the client and server are running on the same computer NTLM will be preferred over Kerberos. - - There is only one `HTTP/...` SPN for the host - - The SPN contains only the hostname, without the port - - You have added the URL of the web app to the `Local intranet zone` - - The clocks of the server and client should not differ with more than 5 minutes (depends on group policy) - - `Integrated Windows Authentication` should be enabled in Internet Explorer (under `Advanced settings`) - -## Reverse Proxy - -Gitea supports Reverse Proxy Header authentication, it will read headers as a trusted login user name or user email address. This hasn't been enabled by default, you can enable it with - -```ini -[service] -ENABLE_REVERSE_PROXY_AUTHENTICATION = true -``` - -The default login user name is in the `X-WEBAUTH-USER` header, you can change it via changing `REVERSE_PROXY_AUTHENTICATION_USER` in app.ini. If the user doesn't exist, you can enable automatic registration with `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true`. - -The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changing `REVERSE_PROXY_AUTHENTICATION_EMAIL` in app.ini, this could also be disabled with `ENABLE_REVERSE_PROXY_EMAIL` - -If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`. - -You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level. - -Notice: Reverse Proxy Auth doesn't support the API. You still need an access token or basic auth to make API requests. diff --git a/docs/content/usage/authentication.zh-cn.md b/docs/content/usage/authentication.zh-cn.md deleted file mode 100644 index d1cfeeb800..0000000000 --- a/docs/content/usage/authentication.zh-cn.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "认证" -slug: "authentication" -sidebar_position: 10 -toc: false -draft: false -aliases: - - /zh-cn/authentication -menu: - sidebar: - parent: "usage" - name: "认证" - sidebar_position: 10 - identifier: "authentication" ---- - -# 认证 - -## 轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP) - -通过BindDN的LDAP和简单认证方式LDAP共享以下字段: - -- 认证名称 **(必选)** - - - 分配给新授权方法的名称。 - -- 主机名 **(必选)** - - - LDAP 服务的主机地址. - - 例如:`mydomain.com` - -- 端口号 **(必选)** - - - LDAP 服务的端口号. - - 例如: LDAP `389`/ LDAPs `636` - -- 安全协议 (可选) - - 连接LDAP服务器时是否使用TLS协议。 - -- 管理员过滤规则 (可选) - - 一个LDAP过滤器,用于指定哪些用户应该被赋予管理员特权。如果用户帐户符合过滤器条件,则该用户将被授予管理员权限。 - - 示例:`(objectClass=adminAccount)` - - 适用于Microsoft Active Directory(AD)的示例:`memberOf=CN=admin-group,OU=example,DC=example,DC=org` - -- 用户名属性(可选) - - - 用户LDAP记录中包含用户名称的属性。在第一次成功登录后,将使用指定的属性值作为新的Gitea账户用户名。若留空,则使用登录表单上提供的用户名。 - - 当提供的登录名与多个属性匹配时,这一选项非常有用,但是只有一个特定属性应该用于Gitea账户名称,请参阅"用户过滤器"。 - - 示例:uid - - 适用于Microsoft Active Directory(AD)的示例:`sAMAccountName` - -- 名字属性(可选) - - - 用户LDAP记录中包含用户名字的属性。将用于填充他们的账户信息。 - - 示例:givenName -- 姓氏属性(可选) - - 用户LDAP记录中包含用户姓氏的属性。将用于填充他们的账户信息。 - - 示例:`sn` - -- 电子邮件属性 **(必选)** - - 用户LDAP记录中包含用户电子邮件地址的属性。将用于填充他们的账户信息。 - - 示例:`mail` - -### LDAP(via BindDN) - -需要额外设置以下字段: - -- 绑定DN (可选) - - - 搜索用户时绑定到LDAP服务器的DN。这可以留空以执行匿名搜索。 - - 示例: `cn=Search,dc=mydomain,dc=com` - -- 绑定密码 (可选) - - - 上述指定的Bind DN(绑定区别名)的密码,如果有的话。注意:该密码在服务器上使用SECRET_KEY进行加密存储。仍然建议确保Bind DN具有尽可能少的权限。 - -- 用户搜索基准 **(必选)** - - - 这是用于搜索用户帐户的LDAP基础路径. - - 示例: `ou=Users,dc=mydomain,dc=com` - -- 用户过滤规则 **(必选)** - - LDAP 过滤器声明如何查找试图进行身份验证的用户记录 - `%[1]s`匹配参数将替换为登录表单中给出的登录名 - - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - - 示例 for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))` - - 如需多次替换,应使用 `%[1]s`,例如在将提供的登录名与多个属性(如用户标识符、电子邮件甚至电话号码)进行匹配时。 - - 示例: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` -- 启用用户同步 - - 这个选项启用了一个周期性任务,用于将Gitea用户与LDAP服务器进行同步。默认的同步周期是每24小时, - 但您可以在app.ini文件中进行更改。 - 有关此部分的详细说明,请参阅[sample - app.ini](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini) - 的_cron.sync_external_users_ 部分的注释。前面提到的_User Search Base_和_User Filter_ - 设置将限制哪些用户可以使用Gitea以及哪些用户将被同步。 - 在初始运行任务时,将根据给定的设置创建所有与LDAP匹配的用户,因此在使用大型企业LDAP目录时需要小心。 - -### LDAP(simple auth) - -需要额外设置以下字段: - -- 用户DN **(必选)** - - - 用作用户 DN 的模板。匹配参数 `%s` 将替换为登录表单中的登录名。 - - 示例: `cn=%s,ou=Users,dc=mydomain,dc=com` - - 示例: `uid=%s,ou=Users,dc=mydomain,dc=com` - -- 用户搜索基准 (可选) - - - 用户搜索基准声明哪些用户帐户将被搜索. - - 示例: `ou=Users,dc=mydomain,dc=com` - -- 用户过滤规则 **(必选)** - - LDAP 过滤器声明何时允许用户登录 - `%[1]s`匹配参数将替换为登录表单中给出的登录名。 - - 示例: `(&(objectClass=posixAccount)(|(cn=%[1]s)(mail=%[1]s)))` - - 示例: `(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))` - -### 使用LDAP验证分组成员 - -使用以下字段: - -- 群组搜索基础DN(可选) - - 组使用的 LDAP DN。 - - 示例: `ou=group,dc=mydomain,dc=com` - -- 组名过滤器 (可选) - - - LDAP 过滤器,声明如何在上述 DN 中查找有效组。 - - 示例: `(|(cn=gitea_users)(cn=admins))` - -- 组中的用户属性 (可选) - - - 组中列出了哪个用户的 LDAP 属性。 - - 示例: `uid` - -- 用户组属性 (可选) - - 哪个组的 LDAP 属性包含一个高于用户属性名称的数组。 - - 示例: `memberUid` - -## 可插拔式认证模块(Pluggable Authentication Module,PAM) - -这个过程启用了PAM(Pluggable Authentication Modules)认证。用户仍然可以通过用户管理手动添加到系统中。 -PAM提供了一种机制,通过对用户进行PAM认证来自动将其添加到当前数据库中。为了与普通的Linux密码一起使用, -运行Gitea的用户还必须具有对`/etc/shadow`的读取权限,以便在使用公钥登录时检查账户的有效性。 - -**注意**:如果用户已将SSH公钥添加到Gitea中,使用这些密钥可能会绕过登录检查系统。因此, -如果您希望禁用使用PAM进行身份验证的用户,应该在Gitea中手动禁用该账户,使用内置的用户管理功能。 - -1. 配置和安装准备. - - 建议您创建一个管理用户. - - 建议取消自动注册. -1. 一旦数据库已初始化完成,使用新创建的管理员账户登录. -1. 导航至用户设置(右上角的图标),然后选择 -`Site Administration` -> `Authentication Sources`, 并选择 -`Add Authentication Source`. -1. 填写字段如下: - - 认证类型:`PAM`。 - - 名称:任何有效的值都可以,如果您愿意,可以使用"System Authentication"。 - - PAM服务名称:从/etc/pam.d/目录下选择适用于所需认证的正确文件[^1]。 - - PAM电子邮件域:用户认证时要附加的电子邮件后缀。例如,如果登录系统期望一个名为gituse的用户, - 并且将此字段设置为mail.com,那么Gitea在验证一个GIT实例的用户时将期望user emai字段为gituser@mail.com[^2]。 - -**Note**: PAM 支持通过[build-time flags](installation/from-source.md#build)添加, -而官方提供的二进制文件通常不会默认启用此功能。PAM需要确保系统上有必要的libpam动态库,并且编译器可以访问必要的PAM开发头文件。 - -[^1]: 例如,在Debian "Bullseye"上使用标准Linux登录,可以使用`common-session-noninteractive`。这个值对于其他版本的Debian, -包括Ubuntu和Mint,可能也是有效的,请查阅您所使用发行版的文档以确认。 - -[^2]: **PAM的必选项** 请注意:在上面的示例中,用户将作为`gituser`而不是`gituser@mail.com`登录到Gitea的Web界面。 - -## 简单邮件传输协议(Simple Mail Transfer Protocol,SMTP) - -此选项允许 Gitea 以 Gitea 用户身份登录 SMTP 主机。请设置以下字段: - -- 身份验证名称 **(必选)** - - 分配给新授权方法的名称 - -- SMTP 验证类型 **(必选)** - - 用于连接 SMTP 主机的验证类型,plain 或 login - -- 主机名 **(必选)** - - - SMTP 服务的主机地址 - - 例如:`smtp.mydomain.com` - -- 端口号 **(必选)** - - - SMTP 服务的端口号 - - 例如: `587` - -- 允许的域名 - - - 如果使用公共 SMTP 主机或有多个域的 SMTP 主机,限制哪些域可以登录 - 限制哪些域可以登录。 - - 示例: `gitea.io,mydomain.com,mydomain2.com` - -- 强制使用 SMTPS - - 默认情况下将使用SMTPS连接到端口465.如果您希望将smtp用于其他端口,自行设置 - - 否则,如果服务器提供' STARTTLS '扩展名,则将使用此扩展名 -- 跳过 TLS 验证 - - 禁用 TLS 验证身份. -- 该认证源处于激活状态 - - 启用或禁用此身份验证源 - -## FreeIPA - -- 要使用 FreeIPA 凭据登录 Gitea,需要为 Gitea 创建一个绑定帐户。 - 创建一个绑定帐户: -- 在FreeIPA服务器上创建一个gitea.ldif文件,并将`dc=example,dc=com`替换为您的`dn`,然后提供一个适当安全的密码。 - - ```sh - dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com - changetype: add - objectclass: account - objectclass: simplesecurityobject - uid: gitea - userPassword: secure password - passwordExpirationTime: 20380119031407Z - nsIdleTimeout: 0 - ``` - -- 导入LDIF文件(如果需要,请将localhost更改为IPA服务器)。系统会提示您输入Directory Manager的密码。: - - ```sh - ldapmodify -h localhost -p 389 -x -D \ - "cn=Directory Manager" -W -f gitea.ldif - ``` - -- 为`gitea_users`添加IPA组: - - ```sh - ipa group-add --desc="Gitea Users" gitea_users - ``` - -- **提示**:对于IPA凭证错误,运行' kinit admin '并提供域管理帐户密码. -- 以管理员身份登录Gitea,点击Admin Panel下的`Authentication`。然后单击`Add New Source`并填写详细信息,更改所有适当的地方。 - -## SPNEGO with SSPI (Kerberos/NTLM, for Windows only) - -Gitea支持通过Windows内置的安全支持提供程序接口(Security Support Provider Interface,SSPI)实现SPNEGO单点登录认证(由RFC4559定义的方案),用于服务器的Web部分。SSPI仅在Windows环境中工作,即当服务器和客户端都在Windows操作系统上运行时。 - -在激活SSPI单点登录认证(SSO)之前,您需要准备您的环境: - -- 在Active Directory中创建一个单独的用户账户,gitea.exe 进程将在该账户下运行(例如,在domain.local域下创建一个名为user的账户: -- 为运行gitea.exe的主机创建一个服务主体名称(Service Principal Name,SPN),其类别为HTTP: - - - 以特权域用户(例如域管理员)的身份启动“命令提示符”或“PowerShell”。 - - 运行下面的命令,将host.domain.local替换为Web应用程序将运行的服务器的完全限定域名(FQDN),将domain\user替换为在前一步中创建的账户名称: - - ```sh - setspn -A HTTP/host.domain.local domain\user - ``` - -在遵循上述步骤之前,请确保您按照以下流程进行操作: - -1. 用之前创建的用户登录(如果已经登录,请先注销)。 -2. 确保在`custom/conf/app.ini`文件的`[server]`部分中,`ROOT_URL`设置为Web应用程序将运行的服务器的完全限定域名(FQDN),与之前创建服务主体名称时使用的一致(例如,`host.domain.local`)。 -3. 启动Web服务器(运行 `gitea.exe web`)。 -4. 在 `Site Administration -> Authentication Sources` 中添加一个 `SPNEGO with SSPI` 认证源,以启用SSPI认证。 -5. 在域中的客户端计算机上,使用任何域用户登录(与运行`gitea.exe`的服务器不同)。 -6. 如果您使用Chrome或Edge浏览器,请将Web应用程序的URL添加到“本地站点”(`Internet选项 -> 安全 -> 本地站点 -> 站点`)。 -7. 启动Chrome或Edge浏览器,导航到Gitea的FQDN URL(例如,`http://host.domain.local:3000`)。 -8. 在控制面板中点击“Sign In”按钮,然后选择SSPI,将会自动使用当前登录到计算机的用户进行登录。 -9. 如果无法正常工作,请确保: - - 您不是在运行`gitea.exe`的同一台服务器上运行Web浏览器。应该在与服务器不同的域加入计算机(客户端)上运行Web浏览器。如果客户端和服务器都在同一台计算机上运行,则NTLM将优先于Kerberos。 - - 主机上只有一个`HTTP/...`的SPN。 - - SPN中只包含主机名,不包含端口号。 - - 将Web应用程序的URL添加到"本地站点"。 - - 服务器和客户端的时钟差异不超过5分钟(取决于组策略)。 - - 在Internet Explorer中启用了"集成Windows身份验证"(在"高级设置"下)。 - -遵循这些步骤,您应该能够成功启用和使用SSPI单点登录认证(SSO)。 - -## 反向代理认证 - -Gitea 支持通过读取反向代理传递的 HTTP 头中的登录名或者 email 地址来支持反向代理来认证。默认是不启用的,你可以用以下配置启用。 - -```ini -[service] -ENABLE_REVERSE_PROXY_AUTHENTICATION = true -``` - -默认的登录用户名的 HTTP 头是 `X-WEBAUTH-USER`,你可以通过修改 `REVERSE_PROXY_AUTHENTICATION_USER` 来变更它。如果用户不存在,可以自动创建用户,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。 - -默认的登录用户 Email 的 HTTP 头是 `X-WEBAUTH-EMAIL`,你可以通过修改 `REVERSE_PROXY_AUTHENTICATION_EMAIL` 来变更它。如果用户不存在,可以自动创建用户,当然你需要修改 `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true` 来启用它。你也可以通过修改 `ENABLE_REVERSE_PROXY_EMAIL` 来启用或停用这个 HTTP 头。 - -如果设置了 `ENABLE_REVERSE_PROXY_FULL_NAME=true`,则用户的全名会从 `X-WEBAUTH-FULLNAME` 读取,这样在自动创建用户时将使用这个字段作为用户全名,你也可以通过修改 `REVERSE_PROXY_AUTHENTICATION_FULL_NAME` 来变更 HTTP 头。 - -你也可以通过修改 `REVERSE_PROXY_TRUSTED_PROXIES` 来设置反向代理的IP地址范围,加强安全性,默认值是 `127.0.0.0/8,::1/128`。 通过 `REVERSE_PROXY_LIMIT`, 可以设置最多信任几级反向代理。 - -注意:反向代理认证不支持认证 API,API 仍旧需要用 access token 来进行认证。 diff --git a/docs/content/usage/blame.en-us.md b/docs/content/usage/blame.en-us.md deleted file mode 100644 index 7772bbc16d..0000000000 --- a/docs/content/usage/blame.en-us.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -date: "2023-08-14T00:00:00+00:00" -title: "Blame File View" -slug: "blame" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /en-us/blame -menu: - sidebar: - parent: "usage" - name: "Blame" - sidebar_position: 13 - identifier: "blame" ---- - -# Blame File View - -Gitea supports viewing the line-by-line revision history for a file also known as blame view. -You can also use [`git blame`](https://git-scm.com/docs/git-blame) on the command line to view the revision history of lines within a file. - -1. Navigate to and open the file whose line history you want to view. -1. Click the `Blame` button in the file header bar. -1. The new view shows the line-by-line revision history for a file with author and commit information on the left side. -1. To navigate to an older commit, click the ![versions](/octicon-versions.svg) icon. - -## Ignore commits in the blame view - -All revisions specified in the `.git-blame-ignore-revs` file are hidden from the blame view. -This is especially useful to hide reformatting changes and keep the benefits of `git blame`. -Lines that were changed or added by an ignored commit will be blamed on the previous commit that changed that line or nearby lines. -The `.git-blame-ignore-revs` file must be located in the root directory of the repository. -For more information like the file format, see [the `git blame --ignore-revs-file` documentation](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt). - -### Bypassing `.git-blame-ignore-revs` in the blame view - -If the blame view for a file shows a message about ignored revisions, you can see the normal blame view by appending the url parameter `?bypass-blame-ignore=true`. diff --git a/docs/content/usage/clone-filter.en-us.md b/docs/content/usage/clone-filter.en-us.md deleted file mode 100644 index c3d4a43e2c..0000000000 --- a/docs/content/usage/clone-filter.en-us.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -date: "2021-02-02" -title: "Clone filters (partial clone)" -slug: "clone-filters" -sidebar_position: 25 -draft: false -toc: false -aliases: - - /en-us/clone-filters -menu: - sidebar: - parent: "usage" - name: "Clone filters" - sidebar_position: 25 - identifier: "clone-filters" ---- - -# Clone filters (partial clone) - -Git introduces `--filter` option to `git clone` command, which filters out -large files and objects (such as blobs) to create partial clone of a repo. -Clone filters are especially useful for large repo and/or metered connection, -where full clone (without `--filter`) can be expensive (as all history data -must be downloaded). - -This requires Git version 2.22 or later, both on the Gitea server and on the -client. For clone filters to work properly, make sure that Git version -on the client is at least the same as on the server (or later). Login to -Gitea server as admin and head to Site Administration -> Configuration to -see Git version of the server. - -By default, clone filters are enabled, unless `DISABLE_PARTIAL_CLONE` under -`[git]` is set to `true`. - -See [GitHub blog post: Get up to speed with partial clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/) -for common use cases of clone filters (blobless and treeless clones), and -[GitLab docs for partial clone](https://docs.gitlab.com/ee/topics/git/partial_clone.html) -for more advanced use cases (such as filter by file size and remove -filters to turn partial clone into full clone). diff --git a/docs/content/usage/clone-filter.zh-cn.md b/docs/content/usage/clone-filter.zh-cn.md deleted file mode 100644 index 53ce060fdf..0000000000 --- a/docs/content/usage/clone-filter.zh-cn.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "克隆过滤器 (部分克隆)" -slug: "clone-filters" -sidebar_position: 25 -draft: false -toc: false -aliases: - - /zh-cn/clone-filters -menu: - sidebar: - parent: "usage" - name: "克隆过滤器" - sidebar_position: 25 - identifier: "clone-filters" ---- - -# 克隆过滤器 (部分克隆) - -Git 引入了 `--filter` 选项用于 `git clone` 命令,该选项可以过滤掉大文件和对象(如 blob),从而创建一个仓库的部分克隆。克隆过滤器对于大型仓库和/或按流量计费的连接特别有用,因为完全克隆(不使用 `--filter`)可能会很昂贵(需要下载所有历史数据)。 - -这需要 Git 2.22 或更高版本,无论是在 Gitea 服务器上还是在客户端上都需要如此。为了使克隆过滤器正常工作,请确保客户端上的 Git 版本至少与服务器上的版本相同(或更高)。以管理员身份登录到 Gitea,然后转到管理后台 -> 应用配置,查看服务器的 Git 版本。 - -默认情况下,克隆过滤器是启用的,除非在 `[git]` 下将 `DISABLE_PARTIAL_CLONE` 设置为 `true`。 - -请参阅 [GitHub 博客文章:了解部分克隆](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/) 以获取克隆过滤器的常见用法(无 Blob 和无树的克隆),以及 [GitLab 部分克隆文档](https://docs.gitlab.com/ee/topics/git/partial_clone.html) 以获取更高级的用法(例如按文件大小过滤和取消过滤以将部分克隆转换为完全克隆)。 diff --git a/docs/content/usage/code-owners.en-us.md b/docs/content/usage/code-owners.en-us.md deleted file mode 100644 index 7642175d8d..0000000000 --- a/docs/content/usage/code-owners.en-us.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -date: "2023-05-24T16:00:00+00:00" -title: "Code Owners" -slug: "code-owners" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /en-us/code-owners -menu: - sidebar: - parent: "usage" - name: "Code Owners" - sidebar_position: 30 - identifier: "code-owners" ---- - -# Code Owners - -Gitea maintains code owner files. It looks for it in the following locations in this order: - -- `./CODEOWNERS` -- `./docs/CODEOWNERS` -- `./.gitea/CODEOWNERS` - -And stops at the first found file. - -File format: `<regexp rule> <@user or @org/team> [@user or @org/team]...` - -Regexp specified in golang Regex format. -Regexp can start with `!` for negative rules - match all files except specified. - -Example file: - -``` -.*\\.go @user1 @user2 # This is comment - -# Comment too -# You can assigning code owning for users or teams -frontend/src/.*\\.js @org1/team1 @org1/team2 @user3 - -# You can use negative pattern -!frontend/src/.* @org1/team3 @user5 - -# You can use power of go regexp -docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4 -!/assets/.*\\.(bin|exe|msi) @user9 -``` - -### Escaping - -You can escape characters `#`, ` ` (space) and `\` with `\`, like: - -``` -dir/with\#hashtag @user1 -path\ with\ space @user2 -path/with\\backslash @user3 -``` - -Some character (`.+*?()|[]{}^$\`) should be escaped with `\\` inside regexp, like: - -``` -path/\\.with\\.dots -path/with\\+plus -``` diff --git a/docs/content/usage/incoming-email.en-us.md b/docs/content/usage/incoming-email.en-us.md deleted file mode 100644 index 3f20f3b1fe..0000000000 --- a/docs/content/usage/incoming-email.en-us.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -date: "2022-12-01T00:00:00+00:00" -title: "Incoming Email" -slug: "incoming-email" -sidebar_position: 13 -draft: false -toc: false -aliases: - - /en-us/incoming-email -menu: - sidebar: - parent: "usage" - name: "Incoming Email" - sidebar_position: 13 - identifier: "incoming-email" ---- - -# Incoming Email - -Gitea supports the execution of several actions through incoming mails. This page describes how to set this up. - -## Requirements - -Handling incoming email messages requires an IMAP-enabled email account. -The recommended strategy is to use [email sub-addressing](https://en.wikipedia.org/wiki/Email_address#Sub-addressing) but a catch-all mailbox does work too. -The receiving email address contains a user/action specific token which tells Gitea which action should be performed. -This token is expected in the `To` and `Delivered-To` header fields. - -Gitea tries to detect automatic responses to skip and the email server should be configured to reduce the incoming noise too (spam, newsletter). - -## Configuration - -To activate the handling of incoming email messages you have to configure the `email.incoming` section in the configuration file. - -The `REPLY_TO_ADDRESS` contains the address an email client will respond to. -This address needs to contain the `%{token}` placeholder which will be replaced with a token describing the user/action. -This placeholder must only appear once in the address and must be in the user part of the address (before the `@`). - -An example using email sub-addressing may look like this: `incoming+%{token}@example.com` - -If a catch-all mailbox is used, the placeholder may be used anywhere in the user part of the address: `incoming+%{token}@example.com`, `incoming_%{token}@example.com`, `%{token}@example.com` - -## Security - -Be careful when choosing the domain used for receiving incoming email. -It's recommended receiving incoming email on a subdomain, such as `incoming.example.com` to prevent potential security problems with other services running on `example.com`. diff --git a/docs/content/usage/incoming-email.zh-cn.md b/docs/content/usage/incoming-email.zh-cn.md deleted file mode 100644 index 7aeb3c0866..0000000000 --- a/docs/content/usage/incoming-email.zh-cn.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "邮件接收" -slug: "incoming-email" -sidebar_position: 13 -draft: false -toc: false -aliases: - - /zh-cn/incoming-email -menu: - sidebar: - parent: "usage" - name: "邮件接收" - sidebar_position: 13 - identifier: "incoming-email" ---- - -# 邮件接收 - -Gitea 支持通过接收邮件执行多种操作。本页面描述了如何进行设置。 - -## 要求 - -处理接收的电子邮件需要启用 IMAP 功能的电子邮件帐户。 -推荐的策略是使用 [电子邮件子地址](https://en.wikipedia.org/wiki/Email_address#Sub-addressing),但也可以使用 catch-all 邮箱。 -接收电子邮件地址中包含一个用户/操作特定的令牌,告诉 Gitea 应执行哪个操作。 -此令牌应该出现在 `To` 和 `Delivered-To` 头字段中。 - -Gitea 会尝试检测自动回复并跳过它们,电子邮件服务器也应该配置以减少接收到的干扰(垃圾邮件、通讯订阅等)。 - -## 配置 - -要激活处理接收的电子邮件消息功能,您需要在配置文件中配置 `email.incoming` 部分。 - -`REPLY_TO_ADDRESS` 包含电子邮件客户端将要回复的地址。 -该地址需要包含 `%{token}` 占位符,该占位符将被替换为描述用户/操作的令牌。 -此占位符在地址中只能出现一次,并且必须位于地址的用户部分(`@` 之前)。 - -使用电子邮件子地址的示例可能如下:`incoming+%{token}@example.com` - -如果使用 catch-all 邮箱,则占位符可以出现在地址的用户部分的任何位置:`incoming+%{token}@example.com`、`incoming_%{token}@example.com`、`%{token}@example.com` - -## 安全性 - -在选择用于接收传入电子邮件的域时要小心。 -建议在子域名上接收传入电子邮件,例如 `incoming.example.com`,以防止与运行在 `example.com` 上的其他服务可能存在的安全问题。 diff --git a/docs/content/usage/issue-pull-request-templates.en-us.md b/docs/content/usage/issue-pull-request-templates.en-us.md deleted file mode 100644 index bd43131f4a..0000000000 --- a/docs/content/usage/issue-pull-request-templates.en-us.md +++ /dev/null @@ -1,327 +0,0 @@ ---- -date: "2018-05-10T16:00:00+02:00" -title: "Issue and Pull Request templates" -slug: "issue-pull-request-templates" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /en-us/issue-pull-request-templates -menu: - sidebar: - parent: "usage" - name: "Issue and Pull Request templates" - sidebar_position: 15 - identifier: "issue-pull-request-templates" ---- - -# Issue and Pull Request Templates - -Some projects have a standard list of questions that users need to answer -when creating an issue or pull request. Gitea supports adding templates to the -main branch of the repository so that they can autopopulate the form when users are -creating issues and pull requests. This will cut down on the initial back and forth -of getting some clarifying details. - -Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. - -## File names - -Possible file names for issue templates: - -- `ISSUE_TEMPLATE.md` -- `ISSUE_TEMPLATE.yaml` -- `ISSUE_TEMPLATE.yml` -- `issue_template.md` -- `issue_template.yaml` -- `issue_template.yml` -- `.gitea/ISSUE_TEMPLATE.md` -- `.gitea/ISSUE_TEMPLATE.yaml` -- `.gitea/ISSUE_TEMPLATE.yml` -- `.gitea/issue_template.md` -- `.gitea/issue_template.yaml` -- `.gitea/issue_template.yml` -- `.github/ISSUE_TEMPLATE.md` -- `.github/ISSUE_TEMPLATE.yaml` -- `.github/ISSUE_TEMPLATE.yml` -- `.github/issue_template.md` -- `.github/issue_template.yaml` -- `.github/issue_template.yml` - -Possible file names for issue config: - -- `.gitea/ISSUE_TEMPLATE/config.yaml` -- `.gitea/ISSUE_TEMPLATE/config.yml` -- `.gitea/issue_template/config.yaml` -- `.gitea/issue_template/config.yml` -- `.github/ISSUE_TEMPLATE/config.yaml` -- `.github/ISSUE_TEMPLATE/config.yml` -- `.github/issue_template/config.yaml` -- `.github/issue_template/config.yml` - -Possible file names for PR templates: - -- `PULL_REQUEST_TEMPLATE.md` -- `PULL_REQUEST_TEMPLATE.yaml` -- `PULL_REQUEST_TEMPLATE.yml` -- `pull_request_template.md` -- `pull_request_template.yaml` -- `pull_request_template.yml` -- `.gitea/PULL_REQUEST_TEMPLATE.md` -- `.gitea/PULL_REQUEST_TEMPLATE.yaml` -- `.gitea/PULL_REQUEST_TEMPLATE.yml` -- `.gitea/pull_request_template.md` -- `.gitea/pull_request_template.yaml` -- `.gitea/pull_request_template.yml` -- `.github/PULL_REQUEST_TEMPLATE.md` -- `.github/PULL_REQUEST_TEMPLATE.yaml` -- `.github/PULL_REQUEST_TEMPLATE.yml` -- `.github/pull_request_template.md` -- `.github/pull_request_template.yaml` -- `.github/pull_request_template.yml` - -## Directory names - -Alternatively, users can create multiple issue templates inside a special directory and allow users to choose one that more specifically -addresses their problem. - -Possible directory names for issue templates: - -- `ISSUE_TEMPLATE` -- `issue_template` -- `.gitea/ISSUE_TEMPLATE` -- `.gitea/issue_template` -- `.github/ISSUE_TEMPLATE` -- `.github/issue_template` -- `.gitlab/ISSUE_TEMPLATE` -- `.gitlab/issue_template` - -Inside the directory can be multiple markdown (`.md`) or yaml (`.yaml`/`.yml`) issue templates of the form. - -## Syntax for markdown template - -```md ---- - -name: "Template Name" -about: "This template is for testing!" -title: "[TEST] " -ref: "main" -labels: - -- bug -- "help needed" - ---- - -This is the template! -``` - -In the above example, when a user is presented with the list of issues they can submit, this would show as `Template Name` with the description -`This template is for testing!`. When submitting an issue with the above example, the issue title would be pre-populated with -`[TEST] ` while the issue body would be pre-populated with `This is the template!`. The issue would also be assigned two labels, -`bug` and `help needed`, and the issue will have a reference to `main`. - -## Syntax for yaml template - -This example YAML configuration file defines an issue form using several inputs to report a bug. - -```yaml -name: Bug Report -about: File a bug report -title: "[Bug]: " -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - # some markdown that will only be visible once the issue has been created - - type: markdown - attributes: - value: | - This issue was created by an issue **template** :) - visible: [content] - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: ex. email@example.com - validations: - required: false - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Also tell us, what did you expect to happen? - placeholder: Tell us what you see! - value: "A bug happened!" - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of our software are you running? - options: - - 1.0.2 (Default) - - 1.0.3 (Edge) - validations: - required: true - - type: dropdown - id: browsers - attributes: - label: What browsers are you seeing the problem on? - multiple: true - options: - - Firefox - - Chrome - - Safari - - Microsoft Edge - - type: textarea - id: logs - attributes: - label: Relevant log output - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - render: shell - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) - options: - - label: I agree to follow this project's Code of Conduct - required: true - - label: I have also read the CONTRIBUTION.MD - required: true - visible: [form] - - label: This is a TODO only visible after issue creation - visible: [content] -``` - -### Markdown - -You can use a `markdown` element to display Markdown in your form that provides extra context to the user, but is not submitted by default. - -Attributes: - -| Key | Description | Required | Type | Default | Valid values | -|-------|--------------------------------------------------------------|----------|--------|---------|--------------| -| value | The text that is rendered. Markdown formatting is supported. | Required | String | - | - | - -visible: Default is **[form]** - -### Textarea - -You can use a `textarea` element to add a multi-line text field to your form. Contributors can also attach files in `textarea` fields. - -Attributes: - -| Key | Description | Required | Type | Default | Valid values | -|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|--------|--------------|---------------------------| -| label | A brief description of the expected user input, which is also displayed in the form. | Required | String | - | - | -| description | A description of the text area to provide context or guidance, which is displayed in the form. | Optional | String | Empty String | - | -| placeholder | A semi-opaque placeholder that renders in the text area when empty. | Optional | String | Empty String | - | -| value | Text that is pre-filled in the text area. | Optional | String | - | - | -| render | If a value is provided, submitted text will be formatted into a codeblock. When this key is provided, the text area will not expand for file attachments or Markdown editing. | Optional | String | - | Languages known to Gitea. | - -Validations: - -| Key | Description | Required | Type | Default | Valid values | -|----------|------------------------------------------------------|----------|---------|---------|--------------| -| required | Prevents form submission until element is completed. | Optional | Boolean | false | - | - -visible: Default is **[form, content]** - -### Input - -You can use an `input` element to add a single-line text field to your form. - -Attributes: - -| Key | Description | Required | Type | Default | Valid values | -|-------------|--------------------------------------------------------------------------------------------|----------|--------|--------------|--------------| -| label | A brief description of the expected user input, which is also displayed in the form. | Required | String | - | - | -| description | A description of the field to provide context or guidance, which is displayed in the form. | Optional | String | Empty String | - | -| placeholder | A semi-transparent placeholder that renders in the field when empty. | Optional | String | Empty String | - | -| value | Text that is pre-filled in the field. | Optional | String | - | - | - -Validations: - -| Key | Description | Required | Type | Default | Valid values | -|-----------|--------------------------------------------------------------------------------------------------|----------|---------|---------|--------------------------------------------------------------------------| -| required | Prevents form submission until element is completed. | Optional | Boolean | false | - | -| is_number | Prevents form submission until element is filled with a number. | Optional | Boolean | false | - | -| regex | Prevents form submission until element is filled with a value that match the regular expression. | Optional | String | - | a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) | - -visible: Default is **[form, content]** - -### Dropdown - -You can use a `dropdown` element to add a dropdown menu in your form. - -Attributes: - -| Key | Description | Required | Type | Default | Valid values | -|-------------|-----------------------------------------------------------------------------------------------------|----------|--------------|--------------|--------------| -| label | A brief description of the expected user input, which is displayed in the form. | Required | String | - | - | -| description | A description of the dropdown to provide extra context or guidance, which is displayed in the form. | Optional | String | Empty String | - | -| multiple | Determines if the user can select more than one option. | Optional | Boolean | false | - | -| options | An array of options the user can choose from. Cannot be empty and all choices must be distinct. | Required | String array | - | - | - -Validations: - -| Key | Description | Required | Type | Default | Valid values | -|----------|------------------------------------------------------|----------|---------|---------|--------------| -| required | Prevents form submission until element is completed. | Optional | Boolean | false | - | - -visible: Default is **[form, content]** - -### Checkboxes - -You can use the `checkboxes` element to add a set of checkboxes to your form. - -Attributes: - -| Key | Description | Required | Type | Default | Valid values | -| ----------- | ----------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | ------------ | -| label | A brief description of the expected user input, which is displayed in the form. | Required | String | - | - | -| description | A description of the set of checkboxes, which is displayed in the form. Supports Markdown formatting. | Optional | String | Empty String | - | -| options | An array of checkboxes that the user can select. For syntax, see below. | Required | Array | - | - | - -For each value in the options array, you can set the following keys. - -| Key | Description | Required | Type | Default | Options | -|--------------|------------------------------------------------------------------------------------------------------------------------------------------|----------|--------------|---------|---------| -| label | The identifier for the option, which is displayed in the form. Markdown is supported for bold or italic text formatting, and hyperlinks. | Required | String | - | - | -| required | Prevents form submission until element is completed. | Optional | Boolean | false | - | -| visible | Whether a specific checkbox appears in the form only, in the created issue only, or both. Valid options are "form" and "content". | Optional | String array | false | - | - -visible: Default is **[form, content]** - -## Syntax for issue config - -This is a example for a issue config file - -```yaml -blank_issues_enabled: true -contact_links: - - name: Gitea - url: https://gitea.io - about: Visit the Gitea Website -``` - -### Possible Options - -| Key | Description | Type | Default | -|----------------------|-------------------------------------------------------|--------------------|-------------| -| blank_issues_enabled | If set to false, the User is forced to use a Template | Boolean | true | -| contact_links | Custom Links to show in the Choose Box | Contact Link Array | Empty Array | - -### Contact Link - -| Key | Description | Type | Required | -|-------|----------------------------------|--------|----------| -| name | the name of your link | String | true | -| url | The URL of your Link | String | true | -| about | A short description of your Link | String | true | diff --git a/docs/content/usage/issue-pull-request-templates.zh-cn.md b/docs/content/usage/issue-pull-request-templates.zh-cn.md deleted file mode 100644 index fe865e3358..0000000000 --- a/docs/content/usage/issue-pull-request-templates.zh-cn.md +++ /dev/null @@ -1,294 +0,0 @@ ---- -date: "2022-09-07T16:00:00+08:00" -title: "工单与合并请求模板" -slug: "issue-pull-request-templates" -sidebar_position: 15 -toc: true -draft: false -aliases: - - /zh-cn/issue-pull-request-templates -menu: - sidebar: - parent: "usage" - name: "工单与合并请求模板" - sidebar_position: 15 - identifier: "issue-pull-request-templates" ---- - -# 从模板创建工单与合并请求 - -开发者可以利用问题模板创建工单与合并请求,其目的在于规范参与者的语言表达。 - -## 模板介绍 - -Gitea 支持两种格式的模板:Markdown 和 YAML。 - -### Markdown 模板 - -在 Gitea 中存在两种用途的 Markdown 模板: - -- `ISSUE_TEMPLATE/bug-report.md` 用于规范工单的 Markdown 文本描述 -- `PULL_REQUEST_TEMPLATE.md` 用于规范合并请求的 Markdown 文本描述 - -对于以上 Markdown 模板,我们推荐您将它们放置到项目目录 `.gitea` 进行收纳。 - -### YAML 模板 - -用 YAML 语法编写的模板相比 Markdown 可以实现更丰富的功能,利用表单实现诸如:问卷调查、字符校验。在 Gitea 中的 YAML 同样支持两种用途: - -- `ISSUE_TEMPLATE/bug-report.yaml` 用于创建问卷调查形式的工单 -- `PULL_REQUEST_TEMPLATE.yaml` 用于创建表单形式的合并请求 - -对于以上 YAML 模板,我们同样推荐您将它们放置到项目目录 `.gitea` 进行收纳。 - -##### 表单支持通过 URL 查询参数传值 - -当新建工单页面 URL 以 `?title=Issue+Title&body=Issue+Text` 为查询参数,表单将使用其中的参数(key-value)填充表单内容。 - -### Gitea 支持的模板文件路径 - -工单模板文件名: - -- `ISSUE_TEMPLATE.md` -- `ISSUE_TEMPLATE.yaml` -- `ISSUE_TEMPLATE.yml` -- `issue_template.md` -- `issue_template.yaml` -- `issue_template.yml` -- `.gitea/ISSUE_TEMPLATE.md` -- `.gitea/ISSUE_TEMPLATE.yaml` -- `.gitea/ISSUE_TEMPLATE.yml` -- `.gitea/issue_template.md` -- `.gitea/issue_template.yaml` -- `.gitea/issue_template.yml` -- `.github/ISSUE_TEMPLATE.md` -- `.github/ISSUE_TEMPLATE.yaml` -- `.github/ISSUE_TEMPLATE.yml` -- `.github/issue_template.md` -- `.github/issue_template.yaml` -- `.github/issue_template.yml` - -合并请求模板: - -- `PULL_REQUEST_TEMPLATE.md` -- `PULL_REQUEST_TEMPLATE.yaml` -- `PULL_REQUEST_TEMPLATE.yml` -- `pull_request_template.md` -- `pull_request_template.yaml` -- `pull_request_template.yml` -- `.gitea/PULL_REQUEST_TEMPLATE.md` -- `.gitea/PULL_REQUEST_TEMPLATE.yaml` -- `.gitea/PULL_REQUEST_TEMPLATE.yml` -- `.gitea/pull_request_template.md` -- `.gitea/pull_request_template.yaml` -- `.gitea/pull_request_template.yml` -- `.github/PULL_REQUEST_TEMPLATE.md` -- `.github/PULL_REQUEST_TEMPLATE.yaml` -- `.github/PULL_REQUEST_TEMPLATE.yml` -- `.github/pull_request_template.md` -- `.github/pull_request_template.yaml` -- `.github/pull_request_template.yml` - -#### 工单模板目录 - -由于工单存在多种类型,Gitea 支持将工单模板统一收纳到 `ISSUE_TEMPLATE` 目录。以下是 Gitea 支持的工单模板目录: - -- `ISSUE_TEMPLATE` -- `issue_template` -- `.gitea/ISSUE_TEMPLATE` -- `.gitea/issue_template` -- `.github/ISSUE_TEMPLATE` -- `.github/issue_template` -- `.gitlab/ISSUE_TEMPLATE` -- `.gitlab/issue_template` - -目录支持混合存放 Markdown (`.md`) 或 YAML (`.yaml`/`.yml`) 格式的工单模板。另外,合并请求模板不支持目录存放。 - -## Markdown 模板语法 - -```md ---- - -name: "Template Name" -about: "This template is for testing!" -title: "[TEST] " -ref: "main" -labels: - -- bug -- "help needed" - ---- - -This is the template! -``` - -上面的示例表示用户从列表中选择一个工单模板时,列表会展示模板名称 `Template Name` 和模板描述 `This template is for testing!`。 同时,标题会预先填充为 `[TEST]`,而正文将预先填充 `This is the template!`。 最后,Issue 还会被分配两个标签,`bug` 和 `help needed`,并且将问题指向 `main` 分支。 - -## YAML 模板语法 - -YAML 模板格式如下,相比 Markdown 模板提供了更多实用性的功能。 - -```yaml -name: 表单名称 -about: 表单描述 -title: 默认标题 -body: 主体内容 - type: 定义表单元素类型 - id: 定义表单标号 - attributes: 扩展的属性 - validations: 内容校验 -``` - -下例 YAML 配置文件完整定义了一个用于提交 bug 的问卷调查。 - -```yaml -name: Bug Report -about: File a bug report -title: "[Bug]: " -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: ex. email@example.com - validations: - required: false - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Also tell us, what did you expect to happen? - placeholder: Tell us what you see! - value: "A bug happened!" - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of our software are you running? - options: - - 1.0.2 (Default) - - 1.0.3 (Edge) - validations: - required: true - - type: dropdown - id: browsers - attributes: - label: What browsers are you seeing the problem on? - multiple: true - options: - - Firefox - - Chrome - - Safari - - Microsoft Edge - - type: textarea - id: logs - attributes: - label: Relevant log output - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - render: shell - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) - options: - - label: I agree to follow this project's Code of Conduct - required: true -``` - -### Markdown 段落 - -您可以在 YAML 模板中使用 `markdown` 元素为开发者提供额外的上下文支撑,这部分内容会作为创建工单的提示但不会作为工单内容提交。 - -`attributes` 子项提供了以下扩展能力: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ------- | ------------------------------ | ---- | ------ | ------ | ------ | -| `value` | 渲染的文本。支持 Markdown 格式 | 必选 | 字符串 | - | - | - -### Textarea 多行文本输入框 - -您可以使用 `textarea` 元素在表单中添加多行文本输入框。 除了输入文本,开发者还可以在 `textarea` 区域附加文件。 - -`attributes` 子项提供了以下扩展能力: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ------------- | ----------------------------------------------------------------------------------------------------- | ---- | ------ | -------- | ------------------ | -| `label` | 预期用户输入的简短描述,也以表单形式显示。 | 必选 | 字符串 | - | - | -| `description` | 提供上下文或指导的文本区域的描述,以表单形式显示。 | 可选 | 字符串 | 空字符串 | - | -| `placeholder` | 半透明的占位符,在文本区域空白时呈现 | 可选 | 字符串 | 空字符串 | - | -| `value` | 在文本区域中预填充的文本。 | 可选 | 字符串 | - | - | -| `render` | 如果提供了值,提交的文本将格式化为代码块。 提供此键时,文本区域将不会扩展到文件附件或 Markdown 编辑。 | 可选 | 字符串 | - | Gitea 支持的语言。 | - -`validations` 子项提供以下文本校验参数: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ---------- | ---------------------------- | ---- | ------ | ------ | ------ | -| `required` | 防止在元素完成之前提交表单。 | 可选 | 布尔型 | false | - | - -### Input 单行输入框 - -您可以使用 `input` 元素添加单行文本字段到表单。 - -`attributes` 子项提供了以下扩展能力: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ------------- | ---------------------------------------------- | ---- | ------ | -------- | ------ | -| `label` | 预期用户输入的简短描述,也以表单形式显示。 | 必选 | 字符串 | - | - | -| `description` | 提供上下文或指导的字段的描述,以表单形式显示。 | 可选 | 字符串 | 空字符串 | - | -| `placeholder` | 半透明的占位符,在字段空白时呈现。 | 可选 | 字符串 | 空字符串 | - | -| `value` | 字段中预填的文本。 | 可选 | 字符串 | - | - | - -`validations` 子项提供以下文本校验参数: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ----------- | -------------------------------- | ---- | ------ | ------ | -------------------------------------------------------------- | -| `required` | 防止在未填内容时提交表单。 | 可选 | 布尔型 | false | - | -| `is_number` | 防止在未填数字时提交表单。 | 可选 | 布尔型 | false | - | -| `regex` | 直到满足了与正则表达式匹配的值。 | 可选 | 字符串 | - | [正则表达式](https://en.wikipedia.org/wiki/Regular_expression) | - -### Dropdown 下拉菜单 - -您可以使用 `dropdown` 元素在表单中添加下拉菜单。 - -`attributes` 子项提供了以下扩展能力: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ------------- | --------------------------------------------------------- | ---- | ---------- | -------- | ------ | -| `label` | 预期用户输入的简短描述,以表单形式显示。 | 必选 | 字符串 | - | - | -| `description` | 提供上下文或指导的下拉列表的描述,以表单形式显示。 | 可选 | 字符串 | 空字符串 | - | -| `multiple` | 确定用户是否可以选择多个选项。 | 可选 | 布尔型 | false | - | -| `options` | 用户可以选择的选项列表。 不能为空,所有选择必须是不同的。 | 必选 | 字符串数组 | - | - | - -`validations` 子项提供以下文本校验参数: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ---------- | ---------------------------- | ---- | ------ | ------ | ------ | -| `required` | 防止在元素完成之前提交表单。 | 可选 | 布尔型 | false | - | - -### Checkboxes 复选框 - -您可以使用 `checkboxes` 元素添加一组复选框到表单。 - -`attributes` 子项提供了以下扩展能力: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ------------- | ----------------------------------------------------- | ---- | ------ | -------- | ------ | -| `label` | 预期用户输入的简短描述,以表单形式显示。 | 必选 | 字符串 | - | - | -| `description` | 复选框集的描述,以表单形式显示。 支持 Markdown 格式。 | 可选 | 字符串 | 空字符串 | - | -| `options` | 用户可以选择的复选框列表。 有关语法,请参阅下文。 | 必选 | 数组 | - | - | - -对于 `options`,您可以设置以下参数: - -| 键 | 描述 | 必选 | 类型 | 默认值 | 有效值 | -| ---------- | --------------------------------------------------------------------------------- | ---- | ------ | ------ | ------ | -| `label` | 选项的标识符,显示在表单中。 支持 Markdown 用于粗体或斜体文本格式化和超文本链接。 | 必选 | 字符串 | - | - | -| `required` | 防止在元素完成之前提交表单。 | 可选 | 布尔型 | false | - | diff --git a/docs/content/usage/labels.en-us.md b/docs/content/usage/labels.en-us.md deleted file mode 100644 index 4058ca14e4..0000000000 --- a/docs/content/usage/labels.en-us.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -date: "2023-03-04T19:00:00+00:00" -title: "Labels" -slug: "labels" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /en-us/labels -menu: - sidebar: - parent: "usage" - name: "Labels" - sidebar_position: 13 - identifier: "labels" ---- - -# Labels - -You can use labels to classify issues and pull requests and to improve your overview over them. - -## Creating Labels - -For repositories, labels can be created by going to `Issues` and clicking on `Labels`. - -For organizations, you can define organization-wide labels that are shared with all organization repositories, including both already-existing repositories as well as newly created ones. Organization-wide labels can be created in the organization `Settings`. - -Labels have a mandatory name, a mandatory color, an optional description, and must either be exclusive or not (see `Scoped Labels` below). - -When you create a repository, you can ensure certain labels exist by using the `Issue Labels` option. This option lists a number of available label sets that are [configured globally on your instance](../administration/customizing-gitea/#labels). Its contained labels will all be created as well while creating the repository. - -## Scoped Labels - -Scoped labels are used to ensure at most a single label with the same scope is assigned to an issue or pull request. For example, if labels `kind/bug` and `kind/enhancement` have the Exclusive option set, an issue can only be classified as a bug or an enhancement. - -A scoped label must contain `/` in its name (not at either end of the name). The scope of a label is determined based on the **last** `/`, so for example the scope of label `scope/subscope/item` is `scope/subscope`. - -## Filtering by Label - -Issue and pull request lists can be filtered by label. Selecting multiple labels shows issues and pull requests that have all selected labels assigned. - -By holding alt to click the label, issues and pull requests with the chosen label are excluded from the list. diff --git a/docs/content/usage/labels.zh-cn.md b/docs/content/usage/labels.zh-cn.md deleted file mode 100644 index b9cf39304e..0000000000 --- a/docs/content/usage/labels.zh-cn.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "标签" -slug: "labels" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /zh-cn/labels -menu: - sidebar: - parent: "usage" - name: "标签" - sidebar_position: 13 - identifier: "labels" ---- - -# 标签 - -您可以使用标签对工单和合并请求进行分类,并提高对它们的概览。 - -## 创建标签 - -对于仓库,可以在 `工单(Issues)` 中点击 `标签(Labels)` 来创建标签。 - -对于组织,您可以定义组织级别的标签,这些标签与所有组织仓库共享,包括已存在的仓库和新创建的仓库。可以在组织的 `设置(Settings)` 中创建组织级别的标签。 - -标签具有必填的名称和颜色,可选的描述,以及必须是独占的或非独占的(见下面的“作用域标签”)。 - -当您创建一个仓库时,可以通过使用 `工单标签(Issue Labels)` 选项来选择标签集。该选项列出了一些在您的实例上 [全局配置的可用标签集](administration/customizing-gitea.md#labels)。在创建仓库时,这些标签也将被创建。 - -## 作用域标签 - -作用域标签用于确保将至多一个具有相同作用域的标签分配给工单或合并请求。例如,如果标签 `kind/bug` 和 `kind/enhancement` 的独占选项被设置,那么工单只能被分类为 bug 或 enhancement 中的一个。 - -作用域标签的名称必须包含 `/`(不能在名称的任一端)。标签的作用域是基于最后一个 `/` 决定的,因此例如标签 `scope/subscope/item` 的作用域是 `scope/subscope`。 - -## 按标签筛选 - -工单和合并请求列表可以按标签进行筛选。选择多个标签将显示具有所有选定标签的工单和合并请求。 - -通过按住 alt 键并单击标签,可以将具有所选标签的工单和合并请求从列表中排除。 diff --git a/docs/content/usage/linked-references.en-us.md b/docs/content/usage/linked-references.en-us.md deleted file mode 100644 index a0acb0242d..0000000000 --- a/docs/content/usage/linked-references.en-us.md +++ /dev/null @@ -1,201 +0,0 @@ ---- -date: "2019-11-21T17:00:00-03:00" -title: "Automatically Linked References" -slug: "automatically-linked-references" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /en-us/automatically-linked-references -menu: - sidebar: - parent: "usage" - name: "Automatically Linked References" - sidebar_position: 15 - identifier: "automatically-linked-references" ---- - -# Automatically Linked References in Issues, Pull Requests and Commit Messages - -When an issue, pull request or comment is posted, the text description is parsed -in search for references. These references will be shown as links in the Issue View -and, in some cases, produce certain _actions_. - -Likewise, commit messages are parsed when they are listed, and _actions_ -can be triggered when they are pushed to the main branch. - -To prevent the creation of unintended references, there are certain rules -for them to be recognized. For example, they should not be included inside code -text. They should also be reasonably cleared from their surrounding text -(for example, using spaces). - -## User, Team and Organization Mentions - -When a text in the form `@username` is found and `username` matches the name -of an existing user, a _mention_ reference is created. This will be shown -by changing the text into a link to said user's profile, and possibly create -a notification for the mentioned user depending on whether they have -the necessary permission to access the contents. - -Example: - -> [@John](#), can you give this a look? - -This is also valid for teams and organizations: - -> [@Documenters](#), we need to plan for this. -> [@CoolCompanyInc](#), this issue concerns us all! - -Teams will receive mail notifications when appropriate, but whole organizations won't. - -Commit messages do not produce user notifications. - -## Commits - -Commits can be referenced using their SHA1 hash, or a portion of it of -at least seven characters. They will be shown as a link to the corresponding -commit. - -Example: - -> This bug was introduced in [e59ff077](#) - -## Issues and Pull Requests - -A reference to another issue or pull request can be created using the simple -notation `#1234`, where _1234_ is the number of an issue or pull request -in the same repository. These references will be shown as links to the -referenced content. - -The effect of creating this type of reference is that a _notice_ will be -created in the referenced document, provided the creator of the reference -has reading permissions on it. - -Example: - -> This seems related to [#1234](#) - -Issues and pull requests in other repositories can be referred to as well -using the form `owner/repository#1234`: - -> This seems related to [mike/compiler#1234](#) - -Alternatively, the `!1234` notation can be used as well. Even when in Gitea -a pull request is a form of issue, the `#1234` form will always link to -an issue; if the linked entry happens to be a pull request instead, Gitea -will redirect as appropriate. With the `!1234` notation, a pull request -link will be created, which will be redirected to an issue if required. -However, this distinction could be important if an external tracker is -used, where links to issues and pull requests are not interchangeable. - -## Actionable References in Pull Requests and Commit Messages - -Sometimes a commit or pull request may fix or bring back a problem documented -in a particular issue. Gitea supports closing and reopening the referenced -issues by preceding the reference with a particular _keyword_. Common keywords -include "closes", "fixes", "reopens", etc. This list can be -[customized](administration/config-cheat-sheet.md) by the -site administrator. - -Example: - -> This PR _closes_ [#1234](#) - -If the actionable reference is accepted, this will create a notice on the -referenced issue announcing that it will be closed when the referencing PR -is merged. - -For an actionable reference to be accepted, _at least one_ of the following -conditions must be met: - -- The commenter has permissions to close or reopen the issue at the moment - of creating the reference. -- The reference is inside a commit message. -- The reference is posted as part of the pull request description. - -In the last case, the issue will be closed or reopened only if the merger -of the pull request has permissions to do so. - -Additionally, only pull requests and commit messages can create an action, -and only issues can be closed or reopened this way. - -The default _keywords_ are: - -- **Closing**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved -- **Reopening**: reopen, reopens, reopened - -## Time tracking in Pull Requests and Commit Messages - -When commit or merging of pull request results in automatic closing of issue -it is possible to also add spent time resolving this issue through commit message. - -To specify spent time on resolving issue you need to specify time in format -`@<number><time-unit>` after issue number. In one commit message you can specify -multiple fixed issues and spent time for each of them. - -Supported time units (`<time-unit>`): - -- `m` - minutes -- `h` - hours -- `d` - days (equals to 8 hours) -- `w` - weeks (equals to 5 days) -- `mo` - months (equals to 4 weeks) - -Numbers to specify time (`<number>`) can be also decimal numbers, ex. `@1.5h` would -result in one and half hours. Multiple time units can be combined, ex. `@1h10m` would -mean 1 hour and 10 minutes. - -Example of commit message: - -> Fixed #123 spent @1h, refs #102, fixes #124 @1.5h - -This would result in 1 hour added to issue #123 and 1 and half hours added to issue #124. - -## External Trackers - -Gitea supports the use of external issue trackers, and references to issues -hosted externally can be created in pull requests. However, if the external -tracker uses numbers to identify issues, they will be indistinguishable from -the pull requests hosted in Gitea. To address this, Gitea allows the use of -the `!` marker to identify pull requests. For example: - -> This is issue [#1234](#), and links to the external tracker. -> This is pull request [!1234](#), and links to a pull request in Gitea. - -The `!` and `#` can be used interchangeably for issues and pull request _except_ -for this case, where a distinction is required. If the repository uses external -tracker, commit message for squash merge will use `!` as reference by default. - -## Issues and Pull Requests References Summary - -This table illustrates the different kinds of cross-reference for issues and pull requests. -In the examples, `User1/Repo1` refers to the repository where the reference is used, while -`UserZ/RepoZ` indicates a different repository. - -| Reference in User1/Repo1 | Repo1 issues are external | RepoZ issues are external | Should render | -| --------------------------- | :-----------------------: | :-----------------------: | ------------------------------------------------------- | -| `#1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` | -| `!1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` | -| `#1234` | yes | - | A link to _external issue_ 1234 for `User1/Repo1` | -| `!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` | -| `User1/Repo1#1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` | -| `User1/Repo1!1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` | -| `User1/Repo1#1234` | yes | - | A link to _external issue_ 1234 for `User1/Repo1` | -| `User1/Repo1!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` | -| `UserZ/RepoZ#1234` | - | no | A link to issue/pull 1234 in `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | - | no | A link to issue/pull 1234 in `UserZ/RepoZ` | -| `UserZ/RepoZ#1234` | - | yes | A link to _external issue_ 1234 for `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | - | yes | A link to _PR_ 1234 for `UserZ/RepoZ` | -| **Alphanumeric issue IDs:** | - | - | - | -| `AAA-1234` | yes | - | A link to _external issue_ `AAA-1234` for `User1/Repo1` | -| `!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` | -| `User1/Repo1!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` | -| _Not supported_ | - | yes | A link to _external issue_ `AAA-1234` for `UserZ/RepoZ` | -| `UserZ/RepoZ!1234` | - | yes | A link to _PR_ 1234 in `UserZ/RepoZ` | - -_The last section is for repositories with external issue trackers that use alphanumeric format._ - -_**-**: not applicable._ - -Note: automatic references between repositories with different types of issues (external vs. internal) are not fully supported -and may render invalid links. diff --git a/docs/content/usage/linked-references.zh-cn.md b/docs/content/usage/linked-references.zh-cn.md deleted file mode 100644 index 2f1b888047..0000000000 --- a/docs/content/usage/linked-references.zh-cn.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "自动链接引用" -slug: "automatically-linked-references" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-cn/automatically-linked-references -menu: - sidebar: - parent: "usage" - name: "自动链接引用s" - sidebar_position: 15 - identifier: "automatically-linked-references" ---- - -# 在工单、合并请求和提交消息中的自动链接引用 - -当发布工单、合并请求或评论时,文本描述会被解析以查找引用。这些引用将显示为工单视图中的链接,并且在某些情况下会触发特定的“操作”。 - -类似地,当列出提交消息时,它们也会被解析,并且当它们被推送到主分支时可以触发“操作”。 - -为了防止意外创建引用,对于引用的识别有一定的规则。例如,它们不应该包含在代码文本内部。它们还应该在周围的文本中合理清晰(例如,使用空格)。 - -## 用户、团队和组织提及 - -当找到形式为 `@username` 的文本,并且 `username` 与现有用户的名称匹配时,将创建一个“提及”引用。这将通过将文本更改为指向该用户个人资料的链接来显示,并根据被提及的用户是否具有访问内容所需的权限来可能创建通知。 - -示例: - -> [@John](#),你能看一下这个吗? - -对于团队和组织也是有效的: - -> [@Documenters](#),我们需要为此进行规划。 -> [@CoolCompanyInc](#),这个问题关系到我们所有人! - -团队将在适当时收到邮件通知,但整个组织不会收到通知。 - -提交消息不会产生用户通知。 - -## 提交 - -可以使用提交的 SHA1 哈希或至少七个字符的一部分来引用提交。它们将显示为指向相应提交的链接。 - -示例: - -> 这个错误是在 [e59ff077](#) 中引入的 - -## 工单和合并请求 - -可以使用简单的符号 `#1234` 来创建对另一个工单或合并请求的引用,其中 _1234_ 是同一仓库中一个工单或合并请求的编号。这些引用将显示为指向被引用内容的链接。 - -创建此类型引用的效果是,在被引用的文档中创建一个“通知”,前提是引用的创建者对其具有读取权限。 - -示例: - -> 这似乎与 [#1234](#) 相关 - -还可以使用形式 `owner/repository#1234` 来引用其他仓库中的工单和合并请求: - -> 这似乎与 [mike/compiler#1234](#) 相关 - -或者也可以使用 `!1234` 符号。虽然在 Gitea 中合并请求是工单的一种形式,但 `#1234` 形式总是链接到工单;如果链接的条目恰好是一个合并请求,Gitea 会适当地进行重定向。而使用 `!1234` 符号,则会创建一个合并请求链接,根据需要会被重定向到工单。然而,如果使用外部跟踪器,这个区别可能很重要,因为工单和合并请求的链接是不能互换的。 - -## 可操作的引用在合并请求和提交消息中 - -有时,一个提交或合并请求可能会修复或重新出现在某个特定工单中。Gitea 支持在引用之前加上特定的“关键字”来关闭和重新打开被引用的工单。常见的关键字包括“closes”、“fixes”、“reopens”等。这个列表可以由站点管理员进行 [自定义](administration/config-cheat-sheet.md)。 - -示例: - -> 这个合并请求 _closes_ [#1234](#) - -如果可操作的引用被接受,这将在被引用的工单上创建一个通知,宣布当引用的合并请求被合并时该工单将被关闭。 - -为了接受可操作的引用,必须满足以下至少一项条件之一: - -- 评论者在创建引用时具有关闭或重新打开工单的权限。 -- 引用位于提交消息中。 -- 引用作为合并请求描述的一部分发布。 - -在最后一种情况下,只有当合并合并请求的人具有相应权限时,工单才会被关闭或重新打开。 - -此外,只有合并请求和提交消息可以创建一个操作,只有工单可以通过这种方式被关闭或重新打开。 - -默认的关键字如下: - -- **关闭工单**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved -- **重新打开工单**: reopen, reopens, reopened - -## 合并请求和提交消息中的时间跟踪 - -当提交或合并合并请求导致自动关闭工单时,还可以通过提交消息添加解决此工单所花费的时间。 - -要指定解决工单所花费的时间,需要在工单编号后面以 `@<number><time-unit>` 的格式指定时间。在一个提交消息中,可以指定多个已解决的工单,并为每个工单指定花费的时间。 - -支持的时间单位(`<time-unit>`): - -- `m` - 分钟 -- `h` - 小时 -- `d` - 天(相当于8小时) -- `w` - 周(相当于5天) -- `mo` - 月(相当于4周) - -用于指定时间的数字(`<number>`)也可以是小数,例如 `@1.5h` 表示一小时半。多个时间单位可以结合使用,例如 `@1h10m` 表示1小时10分钟。 - -提交消息示例: - -> Fixed #123 spent @1h, refs #102, fixes #124 @1.5h - -这将导致工单 #123 增加 1 小时,工单 #124 增加 1 小时半。 - -## 外部跟踪器 - -Gitea 支持使用外部工单跟踪器,并可以在合并请求中创建对外部托管的工单的引用。但是,如果外部跟踪器使用数字来标识工单,那么它们将与 Gitea 中托管的合并请求无法区分。为了解决这个问题,Gitea 允许使用 `!` 标记来标识合并请求。例如: - -> 这是工单 [#1234](#),并链接到外部跟踪器。 -> 这是合并请求 [!1234](#),并链接到 Gitea 中的合并请求。 - -在工单和合并请求中,`!` 和 `#` 可以互换使用,除非需要进行区分。如果仓库使用外部跟踪器,默认情况下,合并提交消息将使用 `!` 作为引用。 - -## 工单和合并请求引用摘要 - -下表说明了工单和合并请求的不同类型的交叉引用。在示例中,`User1/Repo1` 指的是使用引用的仓库,而 `UserZ/RepoZ` 表示另一个仓库。 - -| 在 User1/Repo1 中的引用 | Repo1 的工单是外部的 | RepoZ 的工单是外部的 | 渲染效果 | -| ----------------------- | :-------------------: | :-------------------: | ------------------------------------------------ | -| `#1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | -| `!1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | -| `#1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ 1234 | -| `!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | -| `User1/Repo1#1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | -| `User1/Repo1!1234` | 否 | - | 链接到 `User1/Repo1` 中的工单/合并请求 1234 | -| `User1/Repo1#1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ 1234 | -| `User1/Repo1!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | -| `UserZ/RepoZ#1234` | - | 否 | 链接到 `UserZ/RepoZ` 中的工单/合并请求 1234 | -| `UserZ/RepoZ!1234` | - | 否 | 链接到 `UserZ/RepoZ` 中的工单/合并请求 1234 | -| `UserZ/RepoZ#1234` | - | 是 | 链接到 `UserZ/RepoZ` 的 _外部工单_ 1234 | -| `UserZ/RepoZ!1234` | - | 是 | 链接到 `UserZ/RepoZ` 的 _PR_ 1234 | -| **字母数字工单编号:** | - | - | - | -| `AAA-1234` | 是 | - | 链接到 `User1/Repo1` 的 _外部工单_ `AAA-1234` | -| `!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | -| `User1/Repo1!1234` | 是 | - | 链接到 `User1/Repo1` 的 _PR_ 1234 | -| _不支持_ | - | 是 | 链接到 `UserZ/RepoZ` 的 _外部工单_ `AAA-1234` | -| `UserZ/RepoZ!1234` | - | 是 | 链接到 `UserZ/RepoZ` 中的 _PR_ 1234 | - -_最后一部分适用于使用字母数字格式的外部工单跟踪器的仓库。_ - -_**-**: 不适用_ - -注意:不完全支持具有不同类型工单(外部 vs. 内部)的仓库之间的自动引用,可能会导致无效链接。 diff --git a/docs/content/usage/merge-message-templates.en-us.md b/docs/content/usage/merge-message-templates.en-us.md deleted file mode 100644 index fbdbd136f8..0000000000 --- a/docs/content/usage/merge-message-templates.en-us.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -date: "2022-08-31T17:35:40+08:00" -title: "Merge Message templates" -slug: "merge-message-templates" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /en-us/merge-message-templates -menu: - sidebar: - parent: "usage" - name: "Merge Message templates" - sidebar_position: 15 - identifier: "merge-message-templates" ---- - -# Merge Message templates - -## File names - -Possible file names for PR default merge message templates: - -- `.gitea/default_merge_message/MERGE_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE-MERGE_TEMPLATE.md` -- `.gitea/default_merge_message/SQUASH_TEMPLATE.md` -- `.gitea/default_merge_message/MANUALLY-MERGED_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE-UPDATE-ONLY_TEMPLATE.md` - -## Variables - -You can use the following variables enclosed in `${}` inside these templates which follow [os.Expand](https://pkg.go.dev/os#Expand) syntax: - -- BaseRepoOwnerName: Base repository owner name of this pull request -- BaseRepoName: Base repository name of this pull request -- BaseBranch: Base repository target branch name of this pull request -- HeadRepoOwnerName: Head repository owner name of this pull request -- HeadRepoName: Head repository name of this pull request -- HeadBranch: Head repository branch name of this pull request -- PullRequestTitle: Pull request's title -- PullRequestDescription: Pull request's description -- PullRequestPosterName: Pull request's poster name -- PullRequestIndex: Pull request's index number -- PullRequestReference: Pull request's reference char with index number. i.e. #1, !2 -- ClosingIssues: return a string contains all issues which will be closed by this pull request i.e. `close #1, close #2` - -## Rebase - -When rebasing without a merge commit, `REBASE_TEMPLATE.md` modifies the message of the last commit. The following additional variables are available in this template: - -- CommitTitle: Commit's title -- CommitBody: Commits's body text diff --git a/docs/content/usage/merge-message-templates.zh-cn.md b/docs/content/usage/merge-message-templates.zh-cn.md deleted file mode 100644 index 0923e637a5..0000000000 --- a/docs/content/usage/merge-message-templates.zh-cn.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "合并消息模板" -slug: "merge-message-templates" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-cn/merge-message-templates -menu: - sidebar: - parent: "usage" - name: "合并消息模板" - sidebar_position: 15 - identifier: "merge-message-templates" ---- - -# 合并消息模板 - -## 文件名 - -PR 默认合并消息模板可能的文件名: - -- `.gitea/default_merge_message/MERGE_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE-MERGE_TEMPLATE.md` -- `.gitea/default_merge_message/SQUASH_TEMPLATE.md` -- `.gitea/default_merge_message/MANUALLY-MERGED_TEMPLATE.md` -- `.gitea/default_merge_message/REBASE-UPDATE-ONLY_TEMPLATE.md` - -## 变量 - -您可以在这些模板中使用以下以 `${}` 包围的变量,这些变量遵循 [os.Expand](https://pkg.go.dev/os#Expand) 语法: - -- BaseRepoOwnerName:此合并请求的基础仓库所有者名称 -- BaseRepoName:此合并请求的基础仓库名称 -- BaseBranch:此合并请求的基础仓库目标分支名称 -- HeadRepoOwnerName:此合并请求的源仓库所有者名称 -- HeadRepoName:此合并请求的源仓库名称 -- HeadBranch:此合并请求的源仓库分支名称 -- PullRequestTitle:合并请求的标题 -- PullRequestDescription:合并请求的描述 -- PullRequestPosterName:合并请求的提交者名称 -- PullRequestIndex:合并请求的索引号 -- PullRequestReference:合并请求的引用字符与索引号。例如,#1、!2 -- ClosingIssues:返回一个包含将由此合并请求关闭的所有工单的字符串。例如 `close #1, close #2` - -## 变基(Rebase) - -在没有合并提交的情况下进行变基时,`REBASE_TEMPLATE.md` 修改最后一次提交的消息。此模板还提供以下附加变量: - -- CommitTitle:提交的标题 -- CommitBody:提交的正文文本 diff --git a/docs/content/usage/multi-factor-authentication.en-us.md b/docs/content/usage/multi-factor-authentication.en-us.md deleted file mode 100644 index 30323f6de5..0000000000 --- a/docs/content/usage/multi-factor-authentication.en-us.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -date: "2023-08-22T14:21:00+08:00" -title: "Multi-factor Authentication (MFA)" -slug: "multi-factor-authentication" -weight: 15 -toc: false -draft: false -menu: - sidebar: - parent: "usage" - name: "Multi-factor Authentication (MFA)" - weight: 15 - identifier: "multi-factor-authentication" ---- - -# Multi-factor Authentication (MFA) - -Multi-factor Authentication (also referred to as MFA or 2FA) enhances security by requiring a time-sensitive set of credentials in addition to a password. -If a password were later to be compromised, logging into Gitea will not be possible without the additional credentials and the account would remain secure. -Gitea supports both TOTP (Time-based One-Time Password) tokens and FIDO-based hardware keys using the Webauthn API. - -MFA can be configured within the "Security" tab of the user settings page. - -## MFA Considerations - -Enabling MFA on a user does affect how the Git HTTP protocol can be used with the Git CLI. -This interface does not support MFA, and trying to use a password normally will no longer be possible whilst MFA is enabled. -If SSH is not an option for Git operations, an access token can be generated within the "Applications" tab of the user settings page. -This access token can be used as if it were a password in order to allow the Git CLI to function over HTTP. - -> **Warning** - By its very nature, an access token sidesteps the security benefits of MFA. -> It must be kept secure and should only be used as a last resort. - -The Gitea API supports providing the relevant TOTP password in the `X-Gitea-OTP` header, as described in [API Usage](development/api-usage.md). -This should be used instead of an access token where possible. diff --git a/docs/content/usage/packages/_index.en-us.md b/docs/content/usage/packages/_index.en-us.md deleted file mode 100644 index e69de29bb2..0000000000 --- a/docs/content/usage/packages/_index.en-us.md +++ /dev/null diff --git a/docs/content/usage/packages/alpine.en-us.md b/docs/content/usage/packages/alpine.en-us.md deleted file mode 100644 index 6cf036cb8b..0000000000 --- a/docs/content/usage/packages/alpine.en-us.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -date: "2023-03-25T00:00:00+00:00" -title: "Alpine Package Registry" -slug: "alpine" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Alpine" - sidebar_position: 4 - identifier: "alpine" ---- - -# Alpine Package Registry - -Publish [Alpine](https://pkgs.alpinelinux.org/) packages for your user or organization. - -## Requirements - -To work with the Alpine registry, you need to use a HTTP client like `curl` to upload and a package manager like `apk` to consume packages. - -The following examples use `apk`. - -## Configuring the package registry - -To register the Alpine registry add the url to the list of known apk sources (`/etc/apk/repositories`): - -``` -https://gitea.example.com/api/packages/{owner}/alpine/<branch>/<repository> -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the packages. | -| `branch` | The branch to use. | -| `repository` | The repository to use. | - -If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication): - -``` -https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/alpine/<branch>/<repository> -``` - -The Alpine registry files are signed with a RSA key which must be known to apk. Download the public key and store it in `/etc/apk/keys/`: - -```shell -curl -JO https://gitea.example.com/api/packages/{owner}/alpine/key -``` - -Afterwards update the local package index: - -```shell -apk update -``` - -## Publish a package - -To publish an Alpine package (`*.apk`), perform a HTTP `PUT` operation with the package content in the request body. - -``` -PUT https://gitea.example.com/api/packages/{owner}/alpine/{branch}/{repository} -``` - -| Parameter | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | -| `branch` | The branch may match the release version of the OS, ex: `v3.17`. | -| `repository` | The repository can be used [to group packages](https://wiki.alpinelinux.org/wiki/Repositories) or just `main` or similar. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.apk \ - https://gitea.example.com/api/packages/testuser/alpine/v3.17/main -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a file with the same name twice to a package. You must delete the existing package file first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package name, version, branch, repository or architecture are invalid. | -| `409 Conflict` | A package file with the same combination of parameters exist already in the package. | - -## Delete a package - -To delete an Alpine package perform a HTTP `DELETE` operation. This will delete the package version too if there is no file left. - -``` -DELETE https://gitea.example.com/api/packages/{owner}/alpine/{branch}/{repository}/{architecture}/{filename} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `owner` | The owner of the package. | -| `branch` | The branch to use. | -| `repository` | The repository to use. | -| `architecture` | The package architecture. | -| `filename` | The file to delete. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/alpine/v3.17/main/test-package-1.0.0.apk -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `204 No Content` | Success | -| `404 Not Found` | The package or file was not found. | - -## Install a package - -To install a package from the Alpine registry, execute the following commands: - -```shell -# use latest version -apk add {package_name} -# use specific version -apk add {package_name}={package_version} -``` diff --git a/docs/content/usage/packages/alpine.zh-cn.md b/docs/content/usage/packages/alpine.zh-cn.md deleted file mode 100644 index cca002caf4..0000000000 --- a/docs/content/usage/packages/alpine.zh-cn.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -date: "2023-03-25T00:00:00+00:00" -title: "Alpine 软件包注册表" -slug: "alpine" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Alpine" - sidebar_position: 4 - identifier: "alpine" ---- - -# Alpine 软件包注册表 - -在您的用户或组织中发布 [Alpine](https://pkgs.alpinelinux.org/) 软件包。 - -## 要求 - -要使用 Alpine 注册表,您需要使用像 curl 这样的 HTTP 客户端来上传包,并使用像 apk 这样的包管理器来消费包。 - -以下示例使用 `apk`。 - -## 配置软件包注册表 - -要注册 Alpine 注册表,请将 URL 添加到已知的 apk 源列表中 (`/etc/apk/repositories`): - -``` -https://gitea.example.com/api/packages/{owner}/alpine/<branch>/<repository> -``` - -| 占位符 | 描述 | -| ------------ | -------------- | -| `owner` | 软件包所有者 | -| `branch` | 要使用的分支名 | -| `repository` | 要使用的仓库名 | - -如果注册表是私有的,请在 URL 中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证): - -``` -https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/alpine/<branch>/<repository> -``` - -Alpine 注册表文件使用 RSA 密钥进行签名,apk 必须知道该密钥。下载公钥并将其存储在 `/etc/apk/keys/` 目录中: - -```shell -curl -JO https://gitea.example.com/api/packages/{owner}/alpine/key -``` - -之后,更新本地软件包索引: - -```shell -apk update -``` - -## 发布软件包 - -要发布一个 Alpine 包(`*.apk`),请执行带有包内容的 HTTP `PUT` 操作,将其放在请求体中。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/alpine/{branch}/{repository} -``` - -| 参数 | 描述 | -| ------------ | --------------------------------------------------------------------------------------------------- | -| `owner` | 包的所有者。 | -| `branch` | 分支可以与操作系统的发行版本匹配,例如:v3.17。 | -| `repository` | 仓库可以用于[分组包](https://wiki.alpinelinux.org/wiki/Repositories) 或者只是 `main` 或类似的名称。 | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.apk \ - https://gitea.example.com/api/packages/testuser/alpine/v3.17/main -``` - -如果您使用的是双重身份验证或 OAuth,请使用[个人访问令牌](development/api-usage.md#authentication)代替密码。 -您不能将具有相同名称的文件两次发布到一个包中。您必须首先删除现有的包文件。 - -服务器将以以下的 HTTP 状态码响应: - -| HTTP 状态码 | 含义 | -| ----------------- | ------------------------------------------ | -| `201 Created` | 软件包已发布。 | -| `400 Bad Request` | 软件包的名称、版本、分支、仓库或架构无效。 | -| `409 Conflict` | 具有相同参数组合的包文件已存在于软件包中。 | - -## 删除软件包 - -要删除 Alpine 包,执行 HTTP 的 DELETE 操作。如果没有文件,这将同时删除包版本。 - -``` -DELETE https://gitea.example.com/api/packages/{owner}/alpine/{branch}/{repository}/{architecture}/{filename} -``` - -| 参数 | 描述 | -| -------------- | -------------- | -| `owner` | 软件包的所有者 | -| `branch` | 要使用的分支名 | -| `repository` | 要使用的仓库名 | -| `architecture` | 软件包的架构 | -| `filename` | 要删除的文件名 | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/alpine/v3.17/main/test-package-1.0.0.apk -``` - -服务器将以以下的 HTTP 状态码响应: - -| HTTP 状态码 | 含义 | -| ---------------- | ------------------ | -| `204 No Content` | 成功 | -| `404 Not Found` | 未找到软件包或文件 | - -## 安装软件包 - -要从 Alpine 注册表安装软件包,请执行以下命令: - -```shell -# use latest version -apk add {package_name} -# use specific version -apk add {package_name}={package_version} -``` diff --git a/docs/content/usage/packages/cargo.en-us.md b/docs/content/usage/packages/cargo.en-us.md deleted file mode 100644 index 356e7ff0b9..0000000000 --- a/docs/content/usage/packages/cargo.en-us.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -date: "2022-11-20T00:00:00+00:00" -title: "Cargo Package Registry" -slug: "cargo" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Cargo" - sidebar_position: 5 - identifier: "cargo" ---- - -# Cargo Package Registry - -Publish [Cargo](https://doc.rust-lang.org/stable/cargo/) packages for your user or organization. - -## Requirements - -To work with the Cargo package registry, you need [Rust and Cargo](https://www.rust-lang.org/tools/install). - -Cargo stores information about the available packages in a package index stored in a git repository. -This repository is needed to work with the registry. -The following section describes how to create it. - -## Index Repository - -Cargo stores information about the available packages in a package index stored in a git repository. -In Gitea this repository has the special name `_cargo-index`. -After a package was uploaded, its metadata is automatically written to the index. -The content of this repository should not be manually modified. - -The user or organization package settings page allows to create the index repository along with the configuration file. -If needed this action will rewrite the configuration file. -This can be useful if for example the Gitea instance domain was changed. - -If the case arises where the packages stored in Gitea and the information in the index repository are out of sync, the settings page allows to rebuild the index repository. -This action iterates all packages in the registry and writes their information to the index. -If there are lot of packages this process may take some time. - -## Configuring the package registry - -To register the package registry the Cargo configuration must be updated. -Add the following text to the configuration file located in the current users home directory (for example `~/.cargo/config.toml`): - -``` -[registry] -default = "gitea" - -[registries.gitea] -index = "sparse+https://gitea.example.com/api/packages/{owner}/cargo/" # Sparse index -# index = "https://gitea.example.com/{owner}/_cargo-index.git" # Git - -# [net] -# git-fetch-with-cli = true -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | - -If the registry is private or you want to publish new packages, you have to configure your credentials. -Add the credentials section to the credentials file located in the current users home directory (for example `~/.cargo/credentials.toml`): - -``` -[registries.gitea] -token = "Bearer {token}" -``` - -| Parameter | Description | -| --------- | ----------- | -| `token` | Your [personal access token](development/api-usage.md#authentication) | - -## Git vs Sparse - -Currently, cargo supports two ways for fetching crates in a registry: Git index & sparse index. -Sparse index is the newest method and offers better performance when updating crates compared to git. -Since Rust 1.68, sparse is the default method for crates.io. - -## Publish a package - -Publish a package by running the following command in your project: - -```shell -cargo publish -``` - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a package from the package registry, execute the following command: - -```shell -cargo add {package_name} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `package_name` | The package name. | - -## Supported commands - -``` -cargo publish -cargo add -cargo install -cargo yank -cargo unyank -cargo search -``` diff --git a/docs/content/usage/packages/cargo.zh-cn.md b/docs/content/usage/packages/cargo.zh-cn.md deleted file mode 100644 index 285fe9c8b3..0000000000 --- a/docs/content/usage/packages/cargo.zh-cn.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -date: "2022-11-20T00:00:00+00:00" -title: "Cargo 软件包注册表" -slug: "cargo" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Cargo" - sidebar_position: 5 - identifier: "cargo" ---- - -# Cargo 软件包注册表 - -为您的用户或组织发布 [Cargo](https://doc.rust-lang.org/stable/cargo/) 软件包。 - -## 要求 - -若要使用 Cargo 软件包注册表, 您需要安装 [Rust 和 Cargo](https://www.rust-lang.org/tools/install). - -Cargo 将可用软件包的信息存储在一个存储在 git 仓库中的软件包索引中。 -这个仓库是与注册表交互所必需的。 -下面的部分将介绍如何创建它。 - -## 索引仓库 - -Cargo 将可用软件包的信息存储在一个存储在 git 仓库中的软件包索引中。 -在 Gitea 中,这个仓库有一个特殊的名称叫做 `_cargo-index`。 -在上传软件包之后,它的元数据会自动写入索引中。 -不应手动修改这个注册表的内容。 - -用户或组织软件包设置页面允许创建这个索引仓库以及配置文件。 -如果需要,此操作将重写配置文件。 -例如,如果 Gitea 实例的域名已更改,这将非常有用。 - -如果存储在 Gitea 中的软件包与索引注册表中的信息不同步,设置页面允许重建这个索引注册表。 -这个操作将遍历注册表中的所有软件包,并将它们的信息写入索引中。 -如果有很多软件包,这个过程可能需要一些时间。 - -## 配置软件包注册表 - -要注册这个软件包注册表,必须更新 Cargo 的配置。 -将以下文本添加到位于当前用户主目录中的配置文件中(例如 `~/.cargo/config.toml`): - -``` -[registry] -default = "gitea" - -[registries.gitea] -index = "sparse+https://gitea.example.com/api/packages/{owner}/cargo/" # Sparse index -# index = "https://gitea.example.com/{owner}/_cargo-index.git" # Git - -[net] -git-fetch-with-cli = true -``` - -| 参数 | 描述 | -| ------- | ---------------- | -| `owner` | 软件包的所有者。 | - -如果这个注册表是私有的或者您想要发布新的软件包,您必须配置您的凭据。 -将凭据部分添加到位于当前用户主目录中的凭据文件中(例如 `~/.cargo/credentials.toml`): - -``` -[registries.gitea] -token = "Bearer {token}" -``` - -| 参数 | 描述 | -| ------- | ------------------------------------------------------------------------------------- | -| `token` | 您的[个人访问令牌](development/api-usage.md#通过-api-认证) | - -## 发布软件包 - -在项目中运行以下命令来发布软件包: - -```shell -cargo publish -``` - -如果已经存在同名和版本的软件包,您将无法发布新的软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装软件包,请执行以下命令: - -```shell -cargo add {package_name} -``` - -| 参数 | 描述 | -| -------------- | ------------ | -| `package_name` | 软件包名称。 | - -## 支持的命令 - -``` -cargo publish -cargo add -cargo install -cargo yank -cargo unyank -cargo search -``` diff --git a/docs/content/usage/packages/chef.en-us.md b/docs/content/usage/packages/chef.en-us.md deleted file mode 100644 index 9f23b9eac8..0000000000 --- a/docs/content/usage/packages/chef.en-us.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -date: "2023-01-20T00:00:00+00:00" -title: "Chef Package Registry" -slug: "chef" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Chef" - sidebar_position: 5 - identifier: "chef" ---- - -# Chef Package Registry - -Publish [Chef](https://chef.io/) cookbooks for your user or organization. - -## Requirements - -To work with the Chef package registry, you have to use [`knife`](https://docs.chef.io/workstation/knife/). - -## Authentication - -The Chef package registry does not use an username:password authentication but signed requests with a private:public key pair. -Visit the package owner settings page to create the necessary key pair. -Only the public key is stored inside Gitea. if you loose access to the private key you must re-generate the key pair. -[Configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the downloaded private key with your Gitea username as `client_name`. - -## Configure the package registry - -To [configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the Gitea package registry add the url to the `~/.chef/config.rb` file. - -``` -knife[:supermarket_site] = 'https://gitea.example.com/api/packages/{owner}/chef' -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | - -## Publish a package - -To publish a Chef package execute the following command: - -```shell -knife supermarket share {package_name} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `package_name` | The package name. | - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a package from the package registry, execute the following command: - -```shell -knife supermarket install {package_name} -``` - -Optional you can specify the package version: - -```shell -knife supermarket install {package_name} {package_version} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `package_name` | The package name. | -| `package_version` | The package version. | - -## Delete a package - -If you want to remove a package from the registry, execute the following command: - -```shell -knife supermarket unshare {package_name} -``` - -Optional you can specify the package version: - -```shell -knife supermarket unshare {package_name}/versions/{package_version} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `package_name` | The package name. | -| `package_version` | The package version. | diff --git a/docs/content/usage/packages/chef.zh-cn.md b/docs/content/usage/packages/chef.zh-cn.md deleted file mode 100644 index d76b33c13e..0000000000 --- a/docs/content/usage/packages/chef.zh-cn.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -date: "2023-01-20T00:00:00+00:00" -title: "Chef 软件包注册表" -slug: "chef" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Chef" - sidebar_position: 5 - identifier: "chef" ---- - -# Chef Package Registry - -为您的用户或组织发布 [Chef](https://chef.io/) cookbooks。 - -## 要求 - -要使用 Chef 软件包注册表,您需要使用 [`knife`](https://docs.chef.io/workstation/knife/). - -## 认证 - -Chef 软件包注册表不使用用户名和密码进行身份验证,而是使用私钥和公钥对请求进行签名。 -请访问软件包所有者设置页面以创建必要的密钥对。 -只有公钥存储在Gitea中。如果您丢失了私钥的访问权限,您必须重新生成密钥对。 -[配置 `knife`](https://docs.chef.io/workstation/knife_setup/),使用下载的私钥,并将 Gitea 用户名设置为 `client_name`。 - -## 配置软件包注册表 - -要将 [`knife` 配置](https://docs.chef.io/workstation/knife_setup/)为使用 Gitea 软件包注册表,请将 URL 添加到 `~/.chef/config.rb` 文件中。 - -``` -knife[:supermarket_site] = 'https://gitea.example.com/api/packages/{owner}/chef' -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -## 发布软件包 - -若要发布 Chef 软件包,请执行以下命令: - -```shell -knife supermarket share {package_name} -``` - -| 参数 | 描述 | -| -------------- | ---------- | -| `package_name` | 软件包名称 | - -如果已经存在同名和版本的软件包,则无法发布新的软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表中安装软件包,请执行以下命令: - -```shell -knife supermarket install {package_name} -``` - -您可以指定软件包的版本,这是可选的: - -```shell -knife supermarket install {package_name} {package_version} -``` - -| 参数 | 描述 | -| ----------------- | ---------- | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | - -## 删除软件包 - -如果您想要从注册表中删除软件包,请执行以下命令: - -```shell -knife supermarket unshare {package_name} -``` - -可选地,您可以指定软件包的版本: - -```shell -knife supermarket unshare {package_name}/versions/{package_version} -``` - -| 参数 | 描述 | -| ----------------- | ---------- | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | diff --git a/docs/content/usage/packages/composer.en-us.md b/docs/content/usage/packages/composer.en-us.md deleted file mode 100644 index 60ad52ac2d..0000000000 --- a/docs/content/usage/packages/composer.en-us.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Composer Package Registry" -slug: "composer" -sidebar_position: 10 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Composer" - sidebar_position: 10 - identifier: "composer" ---- - -# Composer Package Registry - -Publish [Composer](https://getcomposer.org/) packages for your user or organization. - -## Requirements - -To work with the Composer package registry, you can use [Composer](https://getcomposer.org/download/) to consume and a HTTP upload client like `curl` to publish packages. - -## Publish a package - -To publish a Composer package perform a HTTP PUT operation with the package content in the request body. -The package content must be the zipped PHP project with the `composer.json` file. - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -``` -PUT https://gitea.example.com/api/packages/{owner}/composer -``` - -| Parameter | Description | -| ---------- | ----------- | -| `owner` | The owner of the package. | - -If the `composer.json` file does not contain a `version` property, you must provide it as a query parameter: - -``` -PUT https://gitea.example.com/api/packages/{owner}/composer?version={x.y.z} -``` - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/project.zip \ - https://gitea.example.com/api/packages/testuser/composer -``` - -Or specify the package version as query parameter: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/project.zip \ - https://gitea.example.com/api/packages/testuser/composer?version=1.0.3 -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exists already. | - -## Configuring the package registry - -To register the package registry you need to add it to the Composer `config.json` file (which can usually be found under `<user-home-dir>/.composer/config.json`): - -```json -{ - "repositories": [{ - "type": "composer", - "url": "https://gitea.example.com/api/packages/{owner}/composer" - } - ] -} -``` - -To access the package registry using credentials, you must specify them in the `auth.json` file as follows: - -```json -{ - "http-basic": { - "gitea.example.com": { - "username": "{username}", - "password": "{password}" - } - } -} -``` - -| Parameter | Description | -| ---------- | ----------- | -| `owner` | The owner of the package. | -| `username` | Your Gitea username. | -| `password` | Your Gitea password or a personal access token. | - -## Install a package - -To install a package from the package registry, execute the following command: - -```shell -composer require {package_name} -``` - -Optional you can specify the package version: - -```shell -composer require {package_name}:{package_version} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `package_name` | The package name. | -| `package_version` | The package version. | diff --git a/docs/content/usage/packages/composer.zh-cn.md b/docs/content/usage/packages/composer.zh-cn.md deleted file mode 100644 index c37e46b57a..0000000000 --- a/docs/content/usage/packages/composer.zh-cn.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Composer 软件包注册表" -slug: "composer" -sidebar_position: 10 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Composer" - sidebar_position: 10 - identifier: "composer" ---- - -# Composer 软件包注册表 - -为您的用户或组织发布 [Composer](https://getcomposer.org/) 软件包。 - -## 要求 - -要使用 Composer 软件包注册表,您可以使用 [Composer](https://getcomposer.org/download/) 消费,并使用类似 `curl` 的 HTTP 上传客户端发布软件包。 - -## 发布软件包 - -要发布 Composer 软件包,请执行 HTTP `PUT` 操作,将软件包内容放入请求体中。 -软件包内容必须是包含 `composer.json` 文件的压缩 PHP 项目。 -如果已经存在同名和版本的软件包,则无法发布新的软件包。您必须先删除现有的软件包。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/composer -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -如果 `composer.json` 文件不包含 `version` 属性,您必须将其作为查询参数提供: - -``` -PUT https://gitea.example.com/api/packages/{owner}/composer?version={x.y.z} -``` - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/project.zip \ - https://gitea.example.com/api/packages/testuser/composer -``` - -或者将软件包版本指定为查询参数: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/project.zip \ - https://gitea.example.com/api/packages/testuser/composer?version=1.0.3 -``` - -如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。 - -服务器将以以下 HTTP 状态码响应。 - -| HTTP 状态码 | 含义 | -| ----------------- | ----------------------------------------------------------- | -| `201 Created` | 软件包已发布 | -| `400 Bad Request` | 软件包名称和/或版本无效,或具有相同名称和版本的软件包已存在 | - -## 配置软件包注册表 - -要注册软件包注册表,您需要将其添加到 Composer 的 `config.json` 文件中(通常可以在 `<user-home-dir>/.composer/config.json` 中找到): - -```json -{ - "repositories": [{ - "type": "composer", - "url": "https://gitea.example.com/api/packages/{owner}/composer" - } - ] -} -``` - -要使用凭据访问软件包注册表,您必须在 `auth.json` 文件中指定它们,如下所示: - -```json -{ - "http-basic": { - "gitea.example.com": { - "username": "{username}", - "password": "{password}" - } - } -} -``` - -| 参数 | 描述 | -| ---------- | --------------------------- | -| `owner` | 软件包的所有者 | -| `username` | 您的 Gitea 用户名 | -| `password` | 您的Gitea密码或个人访问令牌 | - -## 安装软件包 - -要从软件包注册表中安装软件包,请执行以下命令: - -```shell -composer require {package_name} -``` - -您可以指定软件包的版本,这是可选的: - -```shell -composer require {package_name}:{package_version} -``` - -| 参数 | 描述 | -| ----------------- | ---------- | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | diff --git a/docs/content/usage/packages/conan.en-us.md b/docs/content/usage/packages/conan.en-us.md deleted file mode 100644 index 505460b319..0000000000 --- a/docs/content/usage/packages/conan.en-us.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Conan Package Registry" -slug: "conan" -sidebar_position: 20 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Conan" - sidebar_position: 20 - identifier: "conan" ---- - -# Conan Package Registry - -Publish [Conan](https://conan.io/) packages for your user or organization. - -## Requirements - -To work with the Conan package registry, you need to use the [conan](https://conan.io/downloads.html) command line tool to consume and publish packages. - -## Configuring the package registry - -To register the package registry you need to configure a new Conan remote: - -```shell -conan remote add {remote} https://gitea.example.com/api/packages/{owner}/conan -conan user --remote {remote} --password {password} {username} -``` - -| Parameter | Description | -| -----------| ----------- | -| `remote` | The remote name. | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | -| `owner` | The owner of the package. | - -For example: - -```shell -conan remote add gitea https://gitea.example.com/api/packages/testuser/conan -conan user --remote gitea --password password123 testuser -``` - -## Publish a package - -Publish a Conan package by running the following command: - -```shell -conan upload --remote={remote} {recipe} -``` - -| Parameter | Description | -| ----------| ----------- | -| `remote` | The remote name. | -| `recipe` | The recipe to upload. | - -For example: - -```shell -conan upload --remote=gitea ConanPackage/1.2@gitea/final -``` - -You cannot publish a file with the same name twice to a package. You must delete the existing package or file first. - -The Gitea Conan package registry has full [revision](https://docs.conan.io/en/latest/versioning/revisions.html) support. - -## Install a package - -To install a Conan package from the package registry, execute the following command: - -```shell -conan install --remote={remote} {recipe} -``` - -| Parameter | Description | -| ----------| ----------- | -| `remote` | The remote name. | -| `recipe` | The recipe to download. | - -For example: - -```shell -conan install --remote=gitea ConanPackage/1.2@gitea/final -``` - -## Supported commands - -``` -conan install -conan get -conan info -conan search -conan upload -conan user -conan download -conan remove -``` diff --git a/docs/content/usage/packages/conan.zh-cn.md b/docs/content/usage/packages/conan.zh-cn.md deleted file mode 100644 index 4856002525..0000000000 --- a/docs/content/usage/packages/conan.zh-cn.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Conan 软件包注册表" -slug: "conan" -sidebar_position: 20 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Conan" - sidebar_position: 20 - identifier: "conan" ---- - -# Conan 软件包注册表 - -为您的用户或组织发布 [Conan](https://conan.io/) 软件包。 - -## 要求 - -要使用 [conan](https://conan.io/downloads.html) 软件包注册表,您需要使用 conan 命令行工具来消费和发布软件包。 - -## 配置软件包注册表 - -要注册软件包注册表,您需要配置一个新的 Conan remote: - -```shell -conan remote add {remote} https://gitea.example.com/api/packages/{owner}/conan -conan user --remote {remote} --password {password} {username} -``` - -| 参数 | 描述 | -| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| `remote` | 远程名称。 | -| `username` | 您的 Gitea 用户名。 | -| `password` | 您的 Gitea 密码。如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。 | -| `owner` | 软件包的所有者。 | - -例如: - -```shell -conan remote add gitea https://gitea.example.com/api/packages/testuser/conan -conan user --remote gitea --password password123 testuser -``` - -## 发布软件包 - -通过运行以下命令发布 Conan 软件包: - -```shell -conan upload --remote={remote} {recipe} -``` - -| 参数 | 描述 | -| -------- | --------------- | -| `remote` | 远程名称 | -| `recipe` | 要上传的 recipe | - -For example: - -```shell -conan upload --remote=gitea ConanPackage/1.2@gitea/final -``` - -Gitea Conan 软件包注册表支持完整的[版本修订](https://docs.conan.io/en/latest/versioning/revisions.html)。 - -## 安装软件包 - -要从软件包注册表中安装Conan软件包,请执行以下命令: - -```shell -conan install --remote={remote} {recipe} -``` - -| 参数 | 描述 | -| -------- | --------------- | -| `remote` | 远程名称 | -| `recipe` | 要下载的 recipe | - -例如: - -```shell -conan install --remote=gitea ConanPackage/1.2@gitea/final -``` - -## 支持的命令 - -``` -conan install -conan get -conan info -conan search -conan upload -conan user -conan download -conan remove -``` diff --git a/docs/content/usage/packages/conda.en-us.md b/docs/content/usage/packages/conda.en-us.md deleted file mode 100644 index a256dca51c..0000000000 --- a/docs/content/usage/packages/conda.en-us.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -date: "2022-12-28T00:00:00+00:00" -title: "Conda Package Registry" -slug: "conda" -sidebar_position: 25 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Conda" - sidebar_position: 25 - identifier: "conda" ---- - -# Conda Package Registry - -Publish [Conda](https://docs.conda.io/en/latest/) packages for your user or organization. - -## Requirements - -To work with the Conda package registry, you need to use [conda](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html). - -## Configuring the package registry - -To register the package registry and provide credentials, edit your `.condarc` file: - -```yaml -channel_alias: https://gitea.example.com/api/packages/{owner}/conda -channels: - - https://gitea.example.com/api/packages/{owner}/conda -default_channels: - - https://gitea.example.com/api/packages/{owner}/conda -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | - -See the [official documentation](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html) for explanations of the individual settings. - -If you need to provide credentials, you may embed them as part of the channel url (`https://user:password@gitea.example.com/...`). - -## Publish a package - -To publish a package, perform a HTTP PUT operation with the package content in the request body. - -``` -PUT https://gitea.example.com/api/packages/{owner}/conda/{channel}/{filename} -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | -| `channel` | The [channel](https://conda.io/projects/conda/en/latest/user-guide/concepts/channels.html) of the package. (optional) | -| `filename` | The name of the file. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/package-1.0.conda \ - https://gitea.example.com/api/packages/testuser/conda/package-1.0.conda -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exists already. | - -## Install a package - -To install a package from the package registry, execute one of the following commands: - -```shell -conda install {package_name} -conda install {package_name}={package_version} -conda install -c {channel} {package_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `package_name` | The package name. | -| `package_version` | The package version. | -| `channel` | The channel of the package. (optional) | diff --git a/docs/content/usage/packages/conda.zh-cn.md b/docs/content/usage/packages/conda.zh-cn.md deleted file mode 100644 index 6b385d2575..0000000000 --- a/docs/content/usage/packages/conda.zh-cn.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -date: "2022-12-28T00:00:00+00:00" -title: "Conda 软件包注册表" -slug: "conda" -sidebar_position: 25 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Conda" - sidebar_position: 25 - identifier: "conda" ---- - -# Conda 软件包注册表 - -为您的用户或组织发布 [Conda](https://docs.conda.io/en/latest/) 软件包。 - -## 要求 - -要使用 Conda 软件包注册表,您需要使用 [conda](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html) 命令行工具。 - -## 配置软件包注册表 - -要注册软件包注册表并提供凭据,请编辑您的 `.condarc` 文件: - -```yaml -channel_alias: https://gitea.example.com/api/packages/{owner}/conda -channels: - - https://gitea.example.com/api/packages/{owner}/conda -default_channels: - - https://gitea.example.com/api/packages/{owner}/conda -``` - -| 占位符 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -有关各个设置的解释,请参阅[官方文档](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html)。 - -如果需要提供凭据,可以将它们作为通道 URL 的一部分嵌入(`https://user:password@gitea.example.com/...`)。 - -## 发布软件包 - -要发布一个软件包,请执行一个HTTP `PUT`操作,请求正文中包含软件包内容。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/conda/{channel}/{filename} -``` - -| 占位符 | 描述 | -| ---------- | --------------------------------------------------------------------------------------------------- | -| `owner` | 软件包的所有者 | -| `channel` | 软件包的[通道](https://conda.io/projects/conda/en/latest/user-guide/concepts/channels.html)(可选) | -| `filename` | 文件名 | - -使用HTTP基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/package-1.0.conda \ - https://gitea.example.com/api/packages/testuser/conda/package-1.0.conda -``` - -如果已经存在同名和版本的软件包,则无法发布软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表中安装软件包,请执行以下命令之一: - -```shell -conda install {package_name} -conda install {package_name}={package_version} -conda install -c {channel} {package_name} -``` - -| 参数 | 描述 | -| ----------------- | -------------------- | -| `package_name` | 软件包的名称 | -| `package_version` | 软件包的版本 | -| `channel` | 软件包的通道(可选) | diff --git a/docs/content/usage/packages/container.en-us.md b/docs/content/usage/packages/container.en-us.md deleted file mode 100644 index 6be21c2b27..0000000000 --- a/docs/content/usage/packages/container.en-us.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Container Registry" -slug: "container" -sidebar_position: 30 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Container Registry" - sidebar_position: 30 - identifier: "container" ---- - -# Container Registry - -Publish [Open Container Initiative](https://opencontainers.org/) compliant images for your user or organization. -The container registry follows the OCI specs and supports all compatible images like [Docker](https://www.docker.com/) and [Helm Charts](https://helm.sh/). - -## Requirements - -To work with the Container registry, you can use the tools for your specific image type. -The following examples use the `docker` client. - -## Login to the container registry - -To push an image or if the image is in a private registry, you have to authenticate: - -```shell -docker login gitea.example.com -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -## Image naming convention - -Images must follow this naming convention: - -`{registry}/{owner}/{image}` - -For example, these are all valid image names for the owner `testuser`: - -`gitea.example.com/testuser/myimage` - -`gitea.example.com/testuser/my-image` - -`gitea.example.com/testuser/my/image` - -**NOTE:** The registry only supports case-insensitive tag names. So `image:tag` and `image:Tag` get treated as the same image and tag. - -## Push an image - -Push an image by executing the following command: - -```shell -docker push gitea.example.com/{owner}/{image}:{tag} -``` - -| Parameter | Description | -| ----------| ----------- | -| `owner` | The owner of the image. | -| `image` | The name of the image. | -| `tag` | The tag of the image. | - -For example: - -```shell -docker push gitea.example.com/testuser/myimage:latest -``` - -## Pull an image - -Pull an image by executing the following command: - -```shell -docker pull gitea.example.com/{owner}/{image}:{tag} -``` - -| Parameter | Description | -| ----------| ----------- | -| `owner` | The owner of the image. | -| `image` | The name of the image. | -| `tag` | The tag of the image. | - -For example: - -```shell -docker pull gitea.example.com/testuser/myimage:latest -``` diff --git a/docs/content/usage/packages/container.zh-cn.md b/docs/content/usage/packages/container.zh-cn.md deleted file mode 100644 index 28e4835a3d..0000000000 --- a/docs/content/usage/packages/container.zh-cn.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "容器注册表" -slug: "container" -sidebar_position: 30 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "容器" - sidebar_position: 30 - identifier: "container" ---- - -# 容器注册表 - -为您的用户或组织发布符合 [Open Container Initiative(OCI)](https://opencontainers.org/) 规范的镜像。 -该容器注册表遵循 OCI 规范,并支持所有兼容的镜像类型,如 [Docker](https://www.docker.com/) 和 [Helm Charts](https://helm.sh/)。 - -## 目录 - -要使用容器注册表,您可以使用适用于特定镜像类型的工具。 -以下示例使用 `docker` 客户端。 - -## 登录容器注册表 - -要推送镜像或者如果镜像位于私有注册表中,您需要进行身份验证: - -```shell -docker login gitea.example.com -``` - -如果您使用的是 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码进行身份验证。 - -## 镜像命名约定 - -镜像必须遵循以下命名约定: - -`{registry}/{owner}/{image}` - -例如,以下是所有者为 `testuser` 的有效镜像名称示例: - -`gitea.example.com/testuser/myimage` - -`gitea.example.com/testuser/my-image` - -`gitea.example.com/testuser/my/image` - -**注意:** 该注册表仅支持大小写不敏感的标签名称。因此,`image:tag` 和 `image:Tag` 将被视为相同的镜像和标签。 - -## 推送镜像 - -通过执行以下命令来推送镜像: - -```shell -docker push gitea.example.com/{owner}/{image}:{tag} -``` - -| 参数 | 描述 | -| ------- | ------------ | -| `owner` | 镜像的所有者 | -| `image` | 镜像的名称 | -| `tag` | 镜像的标签 | - -例如: - -```shell -docker push gitea.example.com/testuser/myimage:latest -``` - -## 拉取镜像 - -通过执行以下命令来拉取镜像: - -```shell -docker pull gitea.example.com/{owner}/{image}:{tag} -``` - -| Parameter | Description | -| --------- | ------------ | -| `owner` | 镜像的所有者 | -| `image` | 镜像的名称 | -| `tag` | 镜像的标签 | - -例如: - -```shell -docker pull gitea.example.com/testuser/myimage:latest -``` diff --git a/docs/content/usage/packages/cran.en-us.md b/docs/content/usage/packages/cran.en-us.md deleted file mode 100644 index a6b0d31856..0000000000 --- a/docs/content/usage/packages/cran.en-us.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -date: "2023-01-01T00:00:00+00:00" -title: "CRAN Package Registry" -slug: "cran" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "CRAN" - sidebar_position: 35 - identifier: "cran" ---- - -# CRAN Package Registry - -Publish [R](https://www.r-project.org/) packages to a [CRAN](https://cran.r-project.org/)-like registry for your user or organization. - -## Requirements - -To work with the CRAN package registry, you need to install [R](https://cran.r-project.org/). - -## Configuring the package registry - -To register the package registry you need to add it to `Rprofile.site`, either on the system-level, user-level (`~/.Rprofile`) or project-level: - -``` -options("repos" = c(getOption("repos"), c(gitea="https://gitea.example.com/api/packages/{owner}/cran"))) -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | - -If you need to provide credentials, you may embed them as part of the url (`https://user:password@gitea.example.com/...`). - -## Publish a package - -To publish a R package, perform a HTTP `PUT` operation with the package content in the request body. - -Source packages: - -``` -PUT https://gitea.example.com/api/packages/{owner}/cran/src -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | - -Binary packages: - -``` -PUT https://gitea.example.com/api/packages/{owner}/cran/bin?platform={platform}&rversion={rversion} -``` - -| Parameter | Description | -| ---------- | ----------- | -| `owner` | The owner of the package. | -| `platform` | The name of the platform. | -| `rversion` | The R version of the binary. | - -For example: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/package.zip \ - https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2 -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exists already. | - -## Install a package - -To install a R package from the package registry, execute the following command: - -```shell -install.packages("{package_name}") -``` - -| Parameter | Description | -| -------------- | ----------- | -| `package_name` | The package name. | - -For example: - -```shell -install.packages("testpackage") -``` diff --git a/docs/content/usage/packages/cran.zh-cn.md b/docs/content/usage/packages/cran.zh-cn.md deleted file mode 100644 index c8e32a64c0..0000000000 --- a/docs/content/usage/packages/cran.zh-cn.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -date: "2023-01-01T00:00:00+00:00" -title: "CRAN 软件包注册表" -slug: "cran" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "CRAN" - sidebar_position: 35 - identifier: "cran" ---- - -# CRAN 软件包注册表 - -将 [R](https://www.r-project.org/) 软件包发布到您的用户或组织的类似 [CRAN](https://cran.r-project.org/) 的注册表。 - -## 要求 - -要使用CRAN软件包注册表,您需要安装 [R](https://cran.r-project.org/)。 - -## 配置软件包注册表 - -要注册软件包注册表,您需要将其添加到 `Rprofile.site` 文件中,可以是系统级别、用户级别 `~/.Rprofile` 或项目级别: - -``` -options("repos" = c(getOption("repos"), c(gitea="https://gitea.example.com/api/packages/{owner}/cran"))) -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -如果需要提供凭据,可以将它们嵌入到URL(`https://user:password@gitea.example.com/...`)中。 - -## 发布软件包 - -要发布 R 软件包,请执行带有软件包内容的 HTTP `PUT` 操作。 - -源代码软件包: - -``` -PUT https://gitea.example.com/api/packages/{owner}/cran/src -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -二进制软件包: - -``` -PUT https://gitea.example.com/api/packages/{owner}/cran/bin?platform={platform}&rversion={rversion} -``` - -| 参数 | 描述 | -| ---------- | -------------- | -| `owner` | 软件包的所有者 | -| `platform` | 平台的名称 | -| `rversion` | 二进制的R版本 | - -例如: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/package.zip \ - https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2 -``` - -如果同名和版本的软件包已存在,则无法发布软件包。您必须首先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表中安装R软件包,请执行以下命令: - -```shell -install.packages("{package_name}") -``` - -| 参数 | 描述 | -| -------------- | ----------------- | -| `package_name` | The package name. | - -例如: - -```shell -install.packages("testpackage") -``` diff --git a/docs/content/usage/packages/debian.en-us.md b/docs/content/usage/packages/debian.en-us.md deleted file mode 100644 index 6ee8530bc3..0000000000 --- a/docs/content/usage/packages/debian.en-us.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -date: "2023-01-07T00:00:00+00:00" -title: "Debian Package Registry" -slug: "debian" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Debian" - sidebar_position: 35 - identifier: "debian" ---- - -# Debian Package Registry - -Publish [Debian](https://www.debian.org/distrib/packages) packages for your user or organization. - -## Requirements - -To work with the Debian registry, you need to use a HTTP client like `curl` to upload and a package manager like `apt` to consume packages. - -The following examples use `apt`. - -## Configuring the package registry - -To register the Debian registry add the url to the list of known apt sources: - -```shell -echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list -``` - -| Placeholder | Description | -| -------------- | ----------- | -| `owner` | The owner of the package. | -| `distribution` | The distribution to use. | -| `component` | The component to use. | - -If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication): - -```shell -echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list -``` - -The Debian registry files are signed with a PGP key which must be known to apt: - -```shell -sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc -``` - -Afterwards update the local package index: - -```shell -apt update -``` - -## Publish a package - -To publish a Debian package (`*.deb`), perform a HTTP `PUT` operation with the package content in the request body. - -``` -PUT https://gitea.example.com/api/packages/{owner}/debian/pool/{distribution}/{component}/upload -``` - -| Parameter | Description | -| -------------- | ----------- | -| `owner` | The owner of the package. | -| `distribution` | The distribution may match the release name of the OS, ex: `bionic`. | -| `component` | The component can be used to group packages or just `main` or similar. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.deb \ - https://gitea.example.com/api/packages/testuser/debian/pool/bionic/main/upload -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a package if a package of the same name, version, distribution, component and architecture already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exists already. | - -## Delete a package - -To delete a Debian package perform a HTTP `DELETE` operation. This will delete the package version too if there is no file left. - -``` -DELETE https://gitea.example.com/api/packages/{owner}/debian/pool/{distribution}/{component}/{package_name}/{package_version}/{architecture} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version. | -| `distribution` | The package distribution. | -| `component` | The package component. | -| `architecture` | The package architecture. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/debian/pools/bionic/main/test-package/1.0.0/amd64 -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `204 No Content` | Success | -| `404 Not Found` | The package or file was not found. | - -## Install a package - -To install a package from the Debian registry, execute the following commands: - -```shell -# use latest version -apt install {package_name} -# use specific version -apt install {package_name}={package_version} -``` diff --git a/docs/content/usage/packages/debian.zh-cn.md b/docs/content/usage/packages/debian.zh-cn.md deleted file mode 100644 index 181130c502..0000000000 --- a/docs/content/usage/packages/debian.zh-cn.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -date: "2023-01-07T00:00:00+00:00" -title: "Debian 软件包注册表" -slug: "debian" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Debian" - sidebar_position: 35 - identifier: "debian" ---- - -# Debian 软件包注册表 - -为您的用户或组织发布 [Debian](https://www.debian.org/distrib/packages) 软件包。 - -## 要求 - -要使用 Debian 注册表,您需要使用类似于 `curl` 的 HTTP 客户端进行上传,并使用类似于 `apt` 的软件包管理器消费软件包。 - -以下示例使用 `apt`。 - -## 配置软件包注册表 - -要注册 Debian 注册表,请将 URL 添加到已知 `apt` 源列表中: - -```shell -echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list -``` - -| 占位符 | 描述 | -| -------------- | -------------- | -| `owner` | 软件包的所有者 | -| `distribution` | 要使用的发行版 | -| `component` | 要使用的组件 | - -如果注册表是私有的,请在 URL 中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证): - -```shell -echo "deb [signed-by=/etc/apt/keyrings/gitea-{owner}.asc] https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/debian {distribution} {component}" | sudo tee -a /etc/apt/sources.list.d/gitea.list -``` - -Debian 注册表文件使用 PGP 密钥进行签名,`apt` 必须知道该密钥: - -```shell -sudo curl https://gitea.example.com/api/packages/{owner}/debian/repository.key -o /etc/apt/keyrings/gitea-{owner}.asc -``` - -然后更新本地软件包索引: - -```shell -apt update -``` - -## 发布软件包 - -要发布一个 Debian 软件包(`*.deb`),执行 HTTP `PUT` 操作,并将软件包内容放入请求主体中。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/debian/pool/{distribution}/{component}/upload -``` - -| 参数 | 描述 | -| -------------- | ----------------------------------------------------- | -| `owner` | 软件包的所有者 | -| `distribution` | 发行版,可能与操作系统的发行版名称匹配,例如 `bionic` | -| `component` | 组件,可用于分组软件包,或仅为 `main` 或类似的组件。 | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.deb \ - https://gitea.example.com/api/packages/testuser/debian/pool/bionic/main/upload -``` - -如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。 -您无法向软件包中多次发布具有相同名称的文件。您必须首先删除现有的软件包版本。 - -服务器将使用以下 HTTP 状态代码进行响应。 - -| HTTP 状态码 | 意义 | -| ----------------- | ---------------------------------------- | -| `201 Created` | 软件包已发布 | -| `400 Bad Request` | 软件包名称、版本、发行版、组件或架构无效 | -| `409 Conflict` | 具有相同参数组合的软件包文件已经存在 | - -## 删除软件包 - -要删除 Debian 软件包,请执行 HTTP `DELETE` 操作。如果没有文件留下,这将同时删除软件包版本。 - -``` -DELETE https://gitea.example.com/api/packages/{owner}/debian/pool/{distribution}/{component}/{package_name}/{package_version}/{architecture} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | -| `distribution` | 软件包发行版 | -| `component` | 软件包组件 | -| `architecture` | 软件包架构 | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/debian/pools/bionic/main/test-package/1.0.0/amd64 -``` - -服务器将使用以下 HTTP 状态代码进行响应。 - -| HTTP 状态码 | 含义 | -| ---------------- | ------------------ | -| `204 No Content` | 成功 | -| `404 Not Found` | 找不到软件包或文件 | - -## 安装软件包 - -要从 Debian 注册表安装软件包,请执行以下命令: - -```shell -# use latest version -apt install {package_name} -# use specific version -apt install {package_name}={package_version} -``` diff --git a/docs/content/usage/packages/generic.en-us.md b/docs/content/usage/packages/generic.en-us.md deleted file mode 100644 index 04be6e3597..0000000000 --- a/docs/content/usage/packages/generic.en-us.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Generic Package Registry" -slug: "generic" -sidebar_position: 40 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Generic" - sidebar_position: 40 - identifier: "generic" ---- - -# Generic Package Registry - -Publish generic files, like release binaries or other output, for your user or organization. - -## Authenticate to the package registry - -To authenticate to the Package Registry, you need to provide [custom HTTP headers or use HTTP Basic authentication](development/api-usage.md#authentication). - -## Publish a package - -To publish a generic package perform a HTTP PUT operation with the package content in the request body. -You cannot publish a file with the same name twice to a package. You must delete the existing package version first. - -``` -PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), pluses (`+`), or underscores (`_`). | -| `package_version` | The package version, a non-empty string without trailing or leading whitespaces. | -| `file_name` | The filename. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), pluses (`+`), or underscores (`_`). | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.bin \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package name and/or version and/or file name are invalid. | -| `409 Conflict` | A file with the same name exist already in the package. | - -## Download a package - -To download a generic package perform a HTTP GET operation. - -``` -GET https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version. | -| `file_name` | The filename. | - -The file content is served in the response body. The response content type is `application/octet-stream`. - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_token_or_password \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `200 OK` | Success | -| `404 Not Found` | The package or file was not found. | - -## Delete a package - -To delete a generic package perform a HTTP DELETE operation. This will delete all files of this version. - -``` -DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0 -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `204 No Content` | Success | -| `404 Not Found` | The package was not found. | - -## Delete a package file - -To delete a file of a generic package perform a HTTP DELETE operation. This will delete the package version too if there is no file left. - -``` -DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{filename} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version. | -| `filename` | The filename. | - -Example request using HTTP Basic authentication: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `204 No Content` | Success | -| `404 Not Found` | The package or file was not found. | diff --git a/docs/content/usage/packages/generic.zh-cn.md b/docs/content/usage/packages/generic.zh-cn.md deleted file mode 100644 index f20f7ac418..0000000000 --- a/docs/content/usage/packages/generic.zh-cn.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "通用软件包注册表" -slug: "generic" -sidebar_position: 40 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "通用" - sidebar_position: 40 - identifier: "generic" ---- - -# 通用软件包注册表 - -发布通用文件,如发布二进制文件或其他输出,供您的用户或组织使用。 - -## 身份验证软件包注册表 - -要身份验证软件包注册表,您需要提供[自定义 HTTP 头或使用 HTTP 基本身份验证](development/api-usage.md#通过-api-认证)。 - -## 发布软件包 - -要发布通用软件包,请执行 HTTP `PUT` 操作,并将软件包内容放入请求主体中。 -您无法向软件包中多次发布具有相同名称的文件。您必须首先删除现有的软件包版本。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name} -``` - -| 参数 | 描述 | -| ----------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `owner` | 软件包的所有者。 | -| `package_name` | 软件包名称。它只能包含小写字母 (`a-z`)、大写字母 (`A-Z`)、数字 (`0-9`)、点号 (`.`)、连字符 (`-`)、加号 (`+`) 或下划线 (`_`) | -| `package_version` | 软件包版本,一个非空字符串,不包含前导或尾随空格 | -| `file_name` | 文件名。它只能包含小写字母 (`a-z`)、大写字母 (`A-Z`)、数字 (`0-9`)、点号 (`.`)、连字符 (`-`)、加号 (`+`) 或下划线 (`_`) | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.bin \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。 - -服务器将使用以下 HTTP 状态代码进行响应。 - -| HTTP 状态码 | 意义 | -| ----------------- | ---------------------------------- | -| `201 Created` | 软件包已发布 | -| `400 Bad Request` | 软件包名称和/或版本和/或文件名无效 | -| `409 Conflict` | 具有相同名称的文件已存在于软件包中 | - -## 下载软件包 - -要下载通用软件包,请执行 HTTP `GET` 操作。 - -``` -GET https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | -| `file_name` | 文件名 | - -文件内容将在响应主体中返回。响应的内容类型为 `application/octet-stream`。 - -服务器将使用以下 HTTP 状态代码进行响应。 - -```shell -curl --user your_username:your_token_or_password \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -服务器会以以下 HTTP 状态码进行响应: - -| HTTP 状态码 | 含义 | -| --------------- | -------------------- | -| `200 OK` | 成功 | -| `404 Not Found` | 找不到软件包或者文件 | - -## 删除软件包 - -要删除通用软件包,请执行 HTTP DELETE 操作。这将同时删除该版本的所有文件。 - -``` -DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | - -服务器将使用以下 HTTP 状态代码进行响应。 - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0 -``` - -The server responds with the following HTTP Status codes. - -| HTTP 状态码 | 意义 | -| ---------------- | ------------ | -| `204 No Content` | 成功 | -| `404 Not Found` | 找不到软件包 | - -## 删除软件包文件 - -要删除通用软件包的文件,请执行 HTTP `DELETE` 操作。如果没有文件留下,这将同时删除软件包版本。 - -``` -DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{filename} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | -| `filename` | 文件名 | - -使用 HTTP 基本身份验证的示例请求: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin -``` - -服务器将使用以下 HTTP 状态代码进行响应: - -| HTTP 状态码 | 含义 | -| ---------------- | ------------------ | -| `204 No Content` | 成功 | -| `404 Not Found` | 找不到软件包或文件 | diff --git a/docs/content/usage/packages/go.en-us.md b/docs/content/usage/packages/go.en-us.md deleted file mode 100644 index ed3c1a87e9..0000000000 --- a/docs/content/usage/packages/go.en-us.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -date: "2023-05-10T00:00:00+00:00" -title: "Go Package Registry" -slug: "go" -sidebar_position: 45 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Go" - sidebar_position: 45 - identifier: "go" ---- - -# Go Package Registry - -Publish Go packages for your user or organization. - -## Publish a package - -To publish a Go package perform a HTTP `PUT` operation with the package content in the request body. -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. -The package must follow the [documented structure](https://go.dev/ref/mod#zip-files). - -``` -PUT https://gitea.example.com/api/packages/{owner}/go/upload -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | - -To authenticate to the package registry, you need to provide [custom HTTP headers or use HTTP Basic authentication](development/api-usage.md#authentication): - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.zip \ - https://gitea.example.com/api/packages/testuser/go/upload -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package with the same name exist already. | - -## Install a package - -To install a Go package instruct Go to use the package registry as proxy: - -```shell -# use latest version -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name} -# or -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name}@latest -# use specific version -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name}@{package_version} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version. | - -If the owner of the packages is private you need to [provide credentials](https://go.dev/ref/mod#private-module-proxy-auth). - -More information about the `GOPROXY` environment variable and how to protect against data leaks can be found in [the documentation](https://go.dev/ref/mod#private-modules). diff --git a/docs/content/usage/packages/go.zh-cn.md b/docs/content/usage/packages/go.zh-cn.md deleted file mode 100644 index ddc7b837b0..0000000000 --- a/docs/content/usage/packages/go.zh-cn.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -date: "2023-05-10T00:00:00+00:00" -title: "Go 软件包注册表" -slug: "go" -sidebar_position: 45 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Go" - sidebar_position: 45 - identifier: "go" ---- - -# Go 软件包注册表 - -为您的用户或组织发布 Go 软件包。 - -## 发布软件包 - -要发布 Go 软件包,请执行 HTTP `PUT` 操作,并将软件包内容放入请求主体中。 -如果已经存在相同名称和版本的软件包,您无法发布软件包。您必须首先删除现有的软件包。 -该软件包必须遵循[文档中的结构](https://go.dev/ref/mod#zip-files)。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/go/upload -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -要身份验证到软件包注册表,您需要提供[自定义 HTTP 头或使用 HTTP 基本身份验证](development/api-usage.md#通过-api-认证): - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.zip \ - https://gitea.example.com/api/packages/testuser/go/upload -``` - -如果您使用的是 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码进行身份验证。 - -服务器将使用以下 HTTP 状态代码进行响应。 - -| HTTP 状态码 | 含义 | -| ----------------- | -------------------------- | -| `201 Created` | 软件包已发布 | -| `400 Bad Request` | 软件包无效 | -| `409 Conflict` | 具有相同名称的软件包已存在 | - -## 安装软件包 - -要安装Go软件包,请指示Go使用软件包注册表作为代理: - -```shell -# 使用最新版本 -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name} -# 或者 -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name}@latest -# 使用特定版本 -GOPROXY=https://gitea.example.com/api/packages/{owner}/go go install {package_name}@{package_version} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | - -如果软件包的所有者是私有的,则需要[提供凭据](https://go.dev/ref/mod#private-module-proxy-auth)。 - -有关 `GOPROXY` 环境变量的更多信息以及如何防止数据泄漏的信息,请[参阅文档](https://go.dev/ref/mod#private-modules)。 diff --git a/docs/content/usage/packages/helm.en-us.md b/docs/content/usage/packages/helm.en-us.md deleted file mode 100644 index a9fe6be89d..0000000000 --- a/docs/content/usage/packages/helm.en-us.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -date: "2022-04-14T00:00:00+00:00" -title: "Helm Chart Registry" -slug: "helm" -sidebar_position: 50 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Helm" - sidebar_position: 50 - identifier: "helm" ---- - -# Helm Chart Registry - -Publish [Helm](https://helm.sh/) charts for your user or organization. - -## Requirements - -To work with the Helm Chart registry use a simple HTTP client like `curl` or the [`helm cm-push`](https://github.com/chartmuseum/helm-push/) plugin. - -## Publish a package - -Publish a package by running the following command: - -```shell -curl --user {username}:{password} -X POST --upload-file ./{chart_file}.tgz https://gitea.example.com/api/packages/{owner}/helm/api/charts -``` - -or with the `helm cm-push` plugin: - -```shell -helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm -helm cm-push ./{chart_file}.tgz {repo} -``` - -| Parameter | Description | -| ------------ | ----------- | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | -| `repo` | The name for the repository. | -| `chart_file` | The Helm Chart archive. | -| `owner` | The owner of the package. | - -## Install a package - -To install a Helm char from the registry, execute the following command: - -```shell -helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm -helm repo update -helm install {name} {repo}/{chart} -``` - -| Parameter | Description | -| ---------- | ----------- | -| `username` | Your Gitea username. | -| `password` | Your Gitea password or a personal access token. | -| `repo` | The name for the repository. | -| `owner` | The owner of the package. | -| `name` | The local name. | -| `chart` | The name Helm Chart. | diff --git a/docs/content/usage/packages/helm.zh-cn.md b/docs/content/usage/packages/helm.zh-cn.md deleted file mode 100644 index ea9105e63d..0000000000 --- a/docs/content/usage/packages/helm.zh-cn.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -date: "2022-04-14T00:00:00+00:00" -title: "Helm Chart 注册表" -slug: "helm" -sidebar_position: 50 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Helm" - sidebar_position: 50 - identifier: "helm" ---- - -# Helm Chart 注册表 - -为您的用户或组织发布 [Helm](https://helm.sh/) charts。 - -## 要求 - -要使用 Helm Chart 注册表,可以使用诸如 `curl` 或 [`helm cm-push`](https://github.com/chartmuseum/helm-push/) 插件之类的简单HTTP客户端。 - -## 发布软件包 - -通过运行以下命令来发布软件包: - -```shell -curl --user {username}:{password} -X POST --upload-file ./{chart_file}.tgz https://gitea.example.com/api/packages/{owner}/helm/api/charts -``` - -或者使用 `helm cm-push` 插件: - -```shell -helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm -helm cm-push ./{chart_file}.tgz {repo} -``` - -| 参数 | 描述 | -| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `username` | 您的Gitea用户名 | -| `password` | 您的Gitea密码。如果您使用的是2FA或OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码进行身份验证。 | -| `repo` | 仓库名称 | -| `chart_file` | Helm Chart 归档文件 | -| `owner` | 软件包的所有者 | - -## 安装软件包 - -要从注册表中安装Helm Chart,请执行以下命令: - -```shell -helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm -helm repo update -helm install {name} {repo}/{chart} -``` - -| 参数 | 描述 | -| ---------- | --------------------------- | -| `username` | 您的Gitea用户名 | -| `password` | 您的Gitea密码或个人访问令牌 | -| `repo` | 存储库的名称 | -| `owner` | 软件包的所有者 | -| `name` | 本地名称 | -| `chart` | Helm Chart的名称 | diff --git a/docs/content/usage/packages/maven.en-us.md b/docs/content/usage/packages/maven.en-us.md deleted file mode 100644 index 59e71c87cc..0000000000 --- a/docs/content/usage/packages/maven.en-us.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Maven Package Registry" -slug: "maven" -sidebar_position: 60 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Maven" - sidebar_position: 60 - identifier: "maven" ---- - -# Maven Package Registry - -Publish [Maven](https://maven.apache.org) packages for your user or organization. - -## Requirements - -To work with the Maven package registry, you can use [Maven](https://maven.apache.org/install.html) or [Gradle](https://gradle.org/install/). -The following examples use `Maven` and `Gradle Groovy`. - -## Configuring the package registry - -To register the package registry you first need to add your access token to the [`settings.xml`](https://maven.apache.org/settings.html) file: - -```xml -<settings> - <servers> - <server> - <id>gitea</id> - <configuration> - <httpHeaders> - <property> - <name>Authorization</name> - <value>token {access_token}</value> - </property> - </httpHeaders> - </configuration> - </server> - </servers> -</settings> -``` - -Afterwards add the following sections to your project `pom.xml` file: - -```xml -<repositories> - <repository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </repository> -</repositories> -<distributionManagement> - <repository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </repository> - <snapshotRepository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </snapshotRepository> -</distributionManagement> -``` - -| Parameter | Description | -| -------------- | ----------- | -| `access_token` | Your [personal access token](development/api-usage.md#authentication). | -| `owner` | The owner of the package. | - -### Gradle variant - -When you plan to add some packages from Gitea instance in your project, you should add it in repositories section: - -```groovy -repositories { - // other repositories - maven { url "https://gitea.example.com/api/packages/{owner}/maven" } -} -``` - -In Groovy gradle you may include next script in your publishing part: - -```groovy -publishing { - // other settings of publication - repositories { - maven { - name = "Gitea" - url = uri("https://gitea.example.com/api/packages/{owner}/maven") - - credentials(HttpHeaderCredentials) { - name = "Authorization" - value = "token {access_token}" - } - - authentication { - header(HttpHeaderAuthentication) - } - } - } -} -``` - -## Publish a package - -To publish a package simply run: - -```shell -mvn deploy -``` - -Or call `gradle` with task `publishAllPublicationsToGiteaRepository` in case you are using gradle: - -```groovy -./gradlew publishAllPublicationsToGiteaRepository -``` - -If you want to publish a prebuild package to the registry, you can use [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html): - -```shell -mvn deploy:deploy-file -Durl=https://gitea.example.com/api/packages/{owner}/maven -DrepositoryId=gitea -Dfile=/path/to/package.jar -``` - -| Parameter | Description | -| -------------- | ----------- | -| `owner` | The owner of the package. | - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a Maven package from the package registry, add a new dependency to your project `pom.xml` file: - -```xml -<dependency> - <groupId>com.test.package</groupId> - <artifactId>test_project</artifactId> - <version>1.0.0</version> -</dependency> -``` - -And analog in gradle groovy: - -```groovy -implementation "com.test.package:test_project:1.0.0" -``` - -Afterwards run: - -```shell -mvn install -``` - -## Supported commands - -``` -mvn install -mvn deploy -mvn dependency:get: -``` diff --git a/docs/content/usage/packages/maven.zh-cn.md b/docs/content/usage/packages/maven.zh-cn.md deleted file mode 100644 index 6b873c7959..0000000000 --- a/docs/content/usage/packages/maven.zh-cn.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Maven 软件包注册表" -slug: "maven" -sidebar_position: 60 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Maven" - sidebar_position: 60 - identifier: "maven" ---- - -# Maven 软件包注册表 - -为您的用户或组织发布 [Maven](https://maven.apache.org) 软件包。 - -## 要求 - -要使用 Maven 软件包注册表,您可以使用 [Maven](https://maven.apache.org/install.html) 或 [Gradle](https://gradle.org/install/)。 -以下示例使用 `Maven` 和 `Gradle Groovy`。 - -## 配置软件包注册表 - -要注册软件包注册表,首先需要将访问令牌添加到 [`settings.xml`](https://maven.apache.org/settings.html) 文件中: - -```xml -<settings> - <servers> - <server> - <id>gitea</id> - <configuration> - <httpHeaders> - <property> - <name>Authorization</name> - <value>token {access_token}</value> - </property> - </httpHeaders> - </configuration> - </server> - </servers> -</settings> -``` - -然后在项目的 `pom.xml` 文件中添加以下部分: - -```xml -<repositories> - <repository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </repository> -</repositories> -<distributionManagement> - <repository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </repository> - <snapshotRepository> - <id>gitea</id> - <url>https://gitea.example.com/api/packages/{owner}/maven</url> - </snapshotRepository> -</distributionManagement> -``` - -| 参数 | 描述 | -| -------------- | ------------------------------------------------------------------------------------- | -| `access_token` | 您的[个人访问令牌](development/api-usage.md#通过-api-认证) | -| `owner` | 软件包的所有者 | - -### Gradle variant - -如果您计划在项目中添加来自 Gitea 实例的一些软件包,请将其添加到 repositories 部分中: - -```groovy -repositories { - // other repositories - maven { url "https://gitea.example.com/api/packages/{owner}/maven" } -} -``` - -在 Groovy gradle 中,您可以在发布部分中包含以下脚本: - -```groovy -publishing { - // 其他发布设置 - repositories { - maven { - name = "Gitea" - url = uri("https://gitea.example.com/api/packages/{owner}/maven") - - credentials(HttpHeaderCredentials) { - name = "Authorization" - value = "token {access_token}" - } - - authentication { - header(HttpHeaderAuthentication) - } - } - } -} -``` - -## 发布软件包 - -要发布软件包,只需运行以下命令: - -```shell -mvn deploy -``` - -或者,如果您使用的是 Gradle,请使用 `gradle` 命令和 `publishAllPublicationsToGiteaRepository` 任务: - -```groovy -./gradlew publishAllPublicationsToGiteaRepository -``` - -如果您想要将预构建的软件包发布到注册表中,可以使用 [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html) 命令: - -```shell -mvn deploy:deploy-file -Durl=https://gitea.example.com/api/packages/{owner}/maven -DrepositoryId=gitea -Dfile=/path/to/package.jar -``` - -| 参数 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -如果存在相同名称和版本的软件包,您无法发布该软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表中安装 Maven 软件包,请在项目的 `pom.xml` 文件中添加新的依赖项: - -```xml -<dependency> - <groupId>com.test.package</groupId> - <artifactId>test_project</artifactId> - <version>1.0.0</version> -</dependency> -``` - -在 `Gradle Groovy` 中类似的操作如下: - -```groovy -implementation "com.test.package:test_project:1.0.0" -``` - -然后运行: - -```shell -mvn install -``` - -## 支持的命令 - -``` -mvn install -mvn deploy -mvn dependency:get: -``` diff --git a/docs/content/usage/packages/npm.en-us.md b/docs/content/usage/packages/npm.en-us.md deleted file mode 100644 index 1590b9623a..0000000000 --- a/docs/content/usage/packages/npm.en-us.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "npm Package Registry" -slug: "npm" -sidebar_position: 70 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "npm" - sidebar_position: 70 - identifier: "npm" ---- - -# npm Package Registry - -Publish [npm](https://www.npmjs.com/) packages for your user or organization. - -## Requirements - -To work with the npm package registry, you need [Node.js](https://nodejs.org/en/download/) coupled with a package manager such as [Yarn](https://classic.yarnpkg.com/en/docs/install) or [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/) itself. - -The registry supports [scoped](https://docs.npmjs.com/misc/scope/) and unscoped packages. - -The following examples use the `npm` tool with the scope `@test`. - -## Configuring the package registry - -To register the package registry you need to configure a new package source. - -```shell -npm config set {scope}:registry https://gitea.example.com/api/packages/{owner}/npm/ -npm config set -- '//gitea.example.com/api/packages/{owner}/npm/:_authToken' "{token}" -``` - -| Parameter | Description | -| ------------ | ----------- | -| `scope` | The scope of the packages. | -| `owner` | The owner of the package. | -| `token` | Your [personal access token](development/api-usage.md#authentication). | - -For example: - -```shell -npm config set @test:registry https://gitea.example.com/api/packages/testuser/npm/ -npm config set -- '//gitea.example.com/api/packages/testuser/npm/:_authToken' "personal_access_token" -``` - -or without scope: - -```shell -npm config set registry https://gitea.example.com/api/packages/testuser/npm/ -npm config set -- '//gitea.example.com/api/packages/testuser/npm/:_authToken' "personal_access_token" -``` - -## Publish a package - -Publish a package by running the following command in your project: - -```shell -npm publish -``` - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Unpublish a package - -Delete a package by running the following command: - -```shell -npm unpublish {package_name}[@{package_version}] -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `package_name` | The package name. | -| `package_version` | The package version. | - -For example: - -```shell -npm unpublish @test/test_package -npm unpublish @test/test_package@1.0.0 -``` - -## Install a package - -To install a package from the package registry, execute the following command: - -```shell -npm install {package_name} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `package_name` | The package name. | - -For example: - -```shell -npm install @test/test_package -``` - -## Tag a package - -The registry supports [version tags](https://docs.npmjs.com/adding-dist-tags-to-packages/) which can be managed by `npm dist-tag`: - -```shell -npm dist-tag add {package_name}@{version} {tag} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `package_name` | The package name. | -| `version` | The version of the package. | -| `tag` | The tag name. | - -For example: - -```shell -npm dist-tag add test_package@1.0.2 release -``` - -The tag name must not be a valid version. All tag names which are parsable as a version are rejected. - -## Search packages - -The registry supports [searching](https://docs.npmjs.com/cli/v7/commands/npm-search/) but does not support special search qualifiers like `author:gitea`. - -## Supported commands - -``` -npm install -npm ci -npm publish -npm unpublish -npm dist-tag -npm view -npm search -``` diff --git a/docs/content/usage/packages/npm.zh-cn.md b/docs/content/usage/packages/npm.zh-cn.md deleted file mode 100644 index d51b8b78a1..0000000000 --- a/docs/content/usage/packages/npm.zh-cn.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "npm 软件包注册表" -slug: "npm" -sidebar_position: 70 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "npm" - sidebar_position: 70 - identifier: "npm" ---- - -# npm Package Registry - -为您的用户或组织发布 [npm](https://www.npmjs.com/) 包。 - -## 要求 - -要使用 npm 包注册表,您需要安装 [Node.js](https://nodejs.org/en/download/) 以及与之配套的软件包管理器,例如 [Yarn](https://classic.yarnpkg.com/en/docs/install) 或 [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/) 本身。 - -该注册表支持[作用域](https://docs.npmjs.com/misc/scope/)和非作用域软件包。 - -以下示例使用具有作用域 `@test` 的 `npm` 工具。 - -## 配置软件包注册表 - -要注册软件包注册表,您需要配置一个新的软件包源。 - -```shell -npm config set {scope}:registry https://gitea.example.com/api/packages/{owner}/npm/ -npm config set -- '//gitea.example.com/api/packages/{owner}/npm/:_authToken' "{token}" -``` - -| 参数 | 描述 | -| ------- | --------------------------------------------------------------------------------------- | -| `scope` | 软件包的作用域 | -| `owner` | 软件包的所有者 | -| `token` | 您的[个人访问令牌](development/api-usage.md#通过-api-认证)。 | - -例如: - -```shell -npm config set @test:registry https://gitea.example.com/api/packages/testuser/npm/ -npm config set -- '//gitea.example.com/api/packages/testuser/npm/:_authToken' "personal_access_token" -``` - -或者,不使用作用域: - -```shell -npm config set registry https://gitea.example.com/api/packages/testuser/npm/ -npm config set -- '//gitea.example.com/api/packages/testuser/npm/:_authToken' "personal_access_token" -``` - -## 发布软件包 - -在项目中运行以下命令发布软件包: - -```shell -npm publish -``` - -如果已经存在相同名称和版本的软件包,您无法发布该软件包。您必须先删除现有的软件包。 - -## 删除软件包 - -通过运行以下命令删除软件包: - -```shell -npm unpublish {package_name}[@{package_version}] -``` - -| 参数 | 描述 | -| ----------------- | ---------- | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | - -例如 - -```shell -npm unpublish @test/test_package -npm unpublish @test/test_package@1.0.0 -``` - -## 安装软件包 - -要从软件包注册表中安装软件包,请执行以下命令: - -```shell -npm install {package_name} -``` - -| 参数 | 描述 | -| -------------- | ---------- | -| `package_name` | 软件包名称 | - -例如: - -```shell -npm install @test/test_package -``` - -## 给软件包打标签 - -该注册表支持[版本标签](https://docs.npmjs.com/adding-dist-tags-to-packages/),可以通过 `npm dist-tag` 管理: - -```shell -npm dist-tag add {package_name}@{version} {tag} -``` - -| 参数 | 描述 | -| -------------- | ---------- | -| `package_name` | 软件包名称 | -| `version` | 软件包版本 | -| `tag` | 软件包标签 | - -例如: - -```shell -npm dist-tag add test_package@1.0.2 release -``` - -标签名称不能是有效的版本。所有可解析为版本的标签名称都将被拒绝。 - -## 搜索软件包 - -该注册表支持[搜索](https://docs.npmjs.com/cli/v7/commands/npm-search/),但不支持像 `author:gitea` 这样的特殊搜索限定符。 - -## 支持的命令 - -``` -npm install -npm ci -npm publish -npm unpublish -npm dist-tag -npm view -npm search -``` diff --git a/docs/content/usage/packages/nuget.en-us.md b/docs/content/usage/packages/nuget.en-us.md deleted file mode 100644 index 8cd88e0637..0000000000 --- a/docs/content/usage/packages/nuget.en-us.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "NuGet Package Registry" -slug: "nuget" -sidebar_position: 80 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "NuGet" - sidebar_position: 80 - identifier: "nuget" ---- - -# NuGet Package Registry - -Publish [NuGet](https://www.nuget.org/) packages for your user or organization. The package registry supports the V2 and V3 API protocol and you can work with [NuGet Symbol Packages](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg) too. - -## Requirements - -To work with the NuGet package registry, you can use command-line interface tools as well as NuGet features in various IDEs like Visual Studio. -More information about NuGet clients can be found in [the official documentation](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools). -The following examples use the `dotnet nuget` tool. - -## Configuring the package registry - -To register the package registry you need to configure a new NuGet feed source: - -```shell -dotnet nuget add source --name {source_name} --username {username} --password {password} https://gitea.example.com/api/packages/{owner}/nuget/index.json -``` - -| Parameter | Description | -| ------------- | ----------- | -| `source_name` | The desired source name. | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | -| `owner` | The owner of the package. | - -For example: - -```shell -dotnet nuget add source --name gitea --username testuser --password password123 https://gitea.example.com/api/packages/testuser/nuget/index.json -``` - -You can add the source without credentials and use the [`--api-key`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push) parameter when publishing packages. In this case you need to provide a [personal access token](development/api-usage.md#authentication). - -## Publish a package - -Publish a package by running the following command: - -```shell -dotnet nuget push --source {source_name} {package_file} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `source_name` | The desired source name. | -| `package_file` | Path to the package `.nupkg` file. | - -For example: - -```shell -dotnet nuget push --source gitea test_package.1.0.0.nupkg -``` - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -### Symbol Packages - -The NuGet package registry has build support for a symbol server. The PDB files embedded in a symbol package (`.snupkg`) can get requested by clients. -To do so, register the NuGet package registry as symbol source: - -``` -https://gitea.example.com/api/packages/{owner}/nuget/symbols -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package registry. | - -For example: - -``` -https://gitea.example.com/api/packages/testuser/nuget/symbols -``` - -## Install a package - -To install a NuGet package from the package registry, execute the following command: - -```shell -dotnet add package --source {source_name} --version {package_version} {package_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `source_name` | The desired source name. | -| `package_name` | The package name. | -| `package_version` | The package version. | - -For example: - -```shell -dotnet add package --source gitea --version 1.0.0 test_package -``` - -## Supported commands - -``` -dotnet add -dotnet nuget push -dotnet nuget delete -``` diff --git a/docs/content/usage/packages/nuget.zh-cn.md b/docs/content/usage/packages/nuget.zh-cn.md deleted file mode 100644 index 692d5f928f..0000000000 --- a/docs/content/usage/packages/nuget.zh-cn.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "NuGet 软件包注册表" -slug: "nuget" -sidebar_position: 80 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "NuGet" - sidebar_position: 80 - identifier: "nuget" ---- - -# NuGet 软件包注册表 - -发布适用于您的用户或组织的 [NuGet](https://www.nuget.org/) 软件包。软件包注册表支持 V2 和 V3 API 协议,并且您还可以使用 [NuGet 符号软件包](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg)。 - -## 要求 - -要使用 NuGet 软件包注册表,您可以使用命令行界面工具,以及各种集成开发环境(IDE)中的 NuGet 功能,如 Visual Studio。有关 NuGet 客户端的更多信息,请参[阅官方文档](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools)。 -以下示例使用 `dotnet nuget` 工具。 - -## 配置软件包注册表 - -要注册软件包注册表,您需要配置一个新的NuGet源: - -```shell -dotnet nuget add source --name {source_name} --username {username} --password {password} https://gitea.example.com/api/packages/{owner}/nuget/index.json -``` - -| 参数 | 描述 | -| ------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `source_name` | 所需源名称 | -| `username` | 您的Gitea用户名 | -| `password` | 您的Gitea密码。如果您使用2FA或OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)代替密码。 | -| `owner` | 软件包的所有者 | - -例如: - -```shell -dotnet nuget add source --name gitea --username testuser --password password123 https://gitea.example.com/api/packages/testuser/nuget/index.json -``` - -您可以在不提供凭据的情况下添加源,并在发布软件包时使用--api-key参数。在这种情况下,您需要提供[个人访问令牌](development/api-usage.md#通过-api-认证)。 - -## 发布软件包 - -通过运行以下命令发布软件包: - -```shell -dotnet nuget push --source {source_name} {package_file} -``` - -| 参数 | 描述 | -| -------------- | ---------------------------- | -| `source_name` | 所需源名称 | -| `package_file` | 软件包 `.nupkg` 文件的路径。 | - -例如: - -```shell -dotnet nuget push --source gitea test_package.1.0.0.nupkg -``` - -如果已经存在相同名称和版本的软件包,您无法发布该软件包。您必须先删除现有的软件包。 - -### 符号软件包 - -NuGet 软件包注册表支持构建用于符号服务器的符号软件包。客户端可以请求嵌入在符号软件包(`.snupkg`)中的 PDB 文件。 -为此,请将 NuGet 软件包注册表注册为符号源: - -``` -https://gitea.example.com/api/packages/{owner}/nuget/symbols -``` - -| 参数 | 描述 | -| ------- | -------------------- | -| `owner` | 软件包注册表的所有者 | - -例如: - -``` -https://gitea.example.com/api/packages/testuser/nuget/symbols -``` - -## 安装软件包 - -要从软件包注册表安装 NuGet 软件包,请执行以下命令: - -```shell -dotnet add package --source {source_name} --version {package_version} {package_name} -``` - -| 参数 | 描述 | -| ----------------- | ------------ | -| `source_name` | 所需源名称 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本。 | - -例如: - -```shell -dotnet add package --source gitea --version 1.0.0 test_package -``` - -## 支持的命令 - -``` -dotnet add -dotnet nuget push -dotnet nuget delete -``` diff --git a/docs/content/usage/packages/overview.en-us.md b/docs/content/usage/packages/overview.en-us.md deleted file mode 100644 index 89fc6f286e..0000000000 --- a/docs/content/usage/packages/overview.en-us.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "Package Registry" -slug: "overview" -sidebar_position: 1 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Overview" - sidebar_position: 1 - identifier: "packages-overview" ---- - -# Package Registry - -Starting with Gitea **1.17**, the Package Registry can be used as a public or private registry for common package managers. - -## Supported package managers - -The following package managers are currently supported: - -| Name | Language | Package client | -| ---- | -------- | -------------- | -| [Alpine](usage/packages/alpine.md) | - | `apk` | -| [Cargo](usage/packages/cargo.md) | Rust | `cargo` | -| [Chef](usage/packages/chef.md) | - | `knife` | -| [Composer](usage/packages/composer.md) | PHP | `composer` | -| [Conan](usage/packages/conan.md) | C++ | `conan` | -| [Conda](usage/packages/conda.md) | - | `conda` | -| [Container](usage/packages/container.md) | - | any OCI compliant client | -| [CRAN](usage/packages/cran.md) | R | - | -| [Debian](usage/packages/debian.md) | - | `apt` | -| [Generic](usage/packages/generic.md) | - | any HTTP client | -| [Go](usage/packages/go.md) | Go | `go` | -| [Helm](usage/packages/helm.md) | - | any HTTP client, `cm-push` | -| [Maven](usage/packages/maven.md) | Java | `mvn`, `gradle` | -| [npm](usage/packages/npm.md) | JavaScript | `npm`, `yarn`, `pnpm` | -| [NuGet](usage/packages/nuget.md) | .NET | `nuget` | -| [Pub](usage/packages/pub.md) | Dart | `dart`, `flutter` | -| [PyPI](usage/packages/pypi.md) | Python | `pip`, `twine` | -| [RPM](usage/packages/rpm.md) | - | `yum`, `dnf`, `zypper` | -| [RubyGems](usage/packages/rubygems.md) | Ruby | `gem`, `Bundler` | -| [Swift](usage/packages/swift.md) | Swift | `swift` | -| [Vagrant](usage/packages/vagrant.md) | - | `vagrant` | - -**The following paragraphs only apply if Packages are not globally disabled!** - -## Repository-Packages - -A package always belongs to an owner (a user or organisation), not a repository. -To link an (already uploaded) package to a repository, open the settings page -on that package and choose a repository to link this package to. -The entire package will be linked, not just a single version. - -Linking a package results in showing that package in the repository's package list, -and shows a link to the repository on the package site (as well as a link to the repository issues). - -## Access Restrictions - -| Package owner type | User | Organization | -|--------------------|------|--------------| -| **read** access | public, if user is public too; otherwise for this user only | public, if org is public, otherwise for org members only | -| **write** access | owner only | org members with admin or write access to the org | - -N.B.: These access restrictions are [subject to change](https://github.com/go-gitea/gitea/issues/19270), where more finegrained control will be added via a dedicated organization team permission. - -## Create or upload a package - -Depending on the type of package, use the respective package-manager for that. Check out the sub-page of a specific package manager for instructions. - -## View packages - -You can view the packages of a repository on the repository page. - -1. Go to the repository. -1. Go to **Packages** in the navigation bar. - -To view more details about a package, select the name of the package. - -## Download a package - -To download a package from your repository: - -1. Go to **Packages** in the navigation bar. -1. Select the name of the package to view the details. -1. In the **Assets** section, select the name of the package file you want to download. - -## Delete a package - -You cannot edit a package after you have published it in the Package Registry. Instead, you -must delete and recreate it. - -To delete a package from your repository: - -1. Go to **Packages** in the navigation bar. -1. Select the name of the package to view the details. -1. Click **Delete package** to permanently delete the package. - -## Disable the Package Registry - -The Package Registry is automatically enabled. To disable it for a single repository: - -1. Go to **Settings** in the navigation bar. -1. Disable **Enable Repository Packages Registry**. - -Previously published packages are not deleted by disabling the Package Registry. diff --git a/docs/content/usage/packages/overview.zh-cn.md b/docs/content/usage/packages/overview.zh-cn.md deleted file mode 100644 index daacf1dcfd..0000000000 --- a/docs/content/usage/packages/overview.zh-cn.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "软件包注册表" -slug: "overview" -sidebar_position: 1 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Overview" - sidebar_position: 1 - identifier: "packages-overview" ---- - -# 软件包注册表 - -从Gitea **1.17**版本开始,软件包注册表可以用作常见软件包管理器的公共或私有注册表。 - -## 支持的软件包管理器 - -目前支持以下软件包管理器: - -| Name | Language | Package client | -| ------------------------------------------------------------------- | ---------- | ------------------------- | -| [Alpine](usage/packages/alpine.md) | - | `apk` | -| [Cargo](usage/packages/cargo.md) | Rust | `cargo` | -| [Chef](usage/packages/chef.md) | - | `knife` | -| [Composer](usage/packages/composer.md) | PHP | `composer` | -| [Conan](usage/packages/conan.md) | C++ | `conan` | -| [Conda](usage/packages/conda.md) | - | `conda` | -| [Container](usage/packages/container.md) | - | 任何符合OCI规范的客户端 | -| [CRAN](usage/packages/cran.md) | R | - | -| [Debian](usage/packages/debian.md) | - | `apt` | -| [Generic](usage/packages/generic.md) | - | 任何HTTP客户端 | -| [Go](usage/packages/go.md) | Go | `go` | -| [Helm](usage/packages/helm.md) | - | 任何HTTP客户端, `cm-push` | -| [Maven](usage/packages/maven.md) | Java | `mvn`, `gradle` | -| [npm](usage/packages/npm.md) | JavaScript | `npm`, `yarn`, `pnpm` | -| [NuGet](usage/packages/nuget.md) | .NET | `nuget` | -| [Pub](usage/packages/pub.md) | Dart | `dart`, `flutter` | -| [PyPI](usage/packages/pypi.md) | Python | `pip`, `twine` | -| [RPM](usage/packages/rpm.md) | - | `yum`, `dnf`, `zypper` | -| [RubyGems](usage/packages/rubygems.md) | Ruby | `gem`, `Bundler` | -| [Swift](usage/packages/rubygems.md) | Swift | `swift` | -| [Vagrant](usage/packages/vagrant.md) | - | `vagrant` | - -**以下段落仅适用于未全局禁用软件包的情况!** - -## 仓库 x 软件包 - -软件包始终属于所有者(用户或组织),而不是仓库。 -要将(已上传的)软件包链接到仓库,请打开该软件包的设置页面,并选择要将此软件包链接到的仓库。 -将链接到整个软件包,而不仅是单个版本。 - -链接软件包将导致在仓库的软件包列表中显示该软件包,并在软件包页面上显示到仓库的链接(以及到仓库工单的链接)。 - -## 访问限制 - -| 软件包所有者类型 | 用户 | 组织 | -| ---------------- | ---------------------------------------- | ------------------------------------------ | -| **读取** 访问 | 公开,如果用户也是公开的;否则仅限此用户 | 公开,如果组织是公开的,否则仅限组织成员 | -| **写入** 访问 | 仅软件包所有者 | 具有组织中的管理员或写入访问权限的组织成员 | - -注意:这些访问限制可能会[变化](https://github.com/go-gitea/gitea/issues/19270),将通过专门的组织团队权限添加更细粒度的控制。 - -## 创建或上传软件包 - -根据软件包类型,使用相应的软件包管理器。请查看特定软件包管理器的子页面以获取说明。 - -## 查看软件包 - -您可以在仓库页面上查看仓库的软件包。 - -1. 转到仓库主页。 -2. 在导航栏中选择**软件包** - -要查看有关软件包的更多详细信息,请选择软件包的名称。 - -## 下载软件包 - -要从仓库下载软件包: - -1. 在导航栏中选择**软件包** -2. 选择软件包的名称以查看详细信息。 -3. 在 **Assets** 部分,选择要下载的软件包文件的名称。 - -## 删除软件包 - -在将软件包发布到软件包注册表后,您无法编辑软件包。相反,您必须删除并重新创建它。 - -要从仓库中删除软件包: - -1. 在导航栏中选择**软件包** -2. 选择软件包的名称以查看详细信息。 -3. 单击**删除软件包**以永久删除软件包。 - -## 禁用软件包注册表 - -包注册表已自动启用。要在单个存储库中禁用它: - -1. 在导航栏中选择**设置**。 -2. 禁用**启用仓库软件包注册表**. - -禁用软件包注册表不会删除先前发布的软件包。 diff --git a/docs/content/usage/packages/pub.en-us.md b/docs/content/usage/packages/pub.en-us.md deleted file mode 100644 index e5e12de344..0000000000 --- a/docs/content/usage/packages/pub.en-us.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -date: "2022-07-31T00:00:00+00:00" -title: "Pub Package Registry" -slug: "pub" -sidebar_position: 90 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Pub" - sidebar_position: 90 - identifier: "pub" ---- - -# Pub Package Registry - -Publish [Pub](https://dart.dev/guides/packages) packages for your user or organization. - -## Requirements - -To work with the Pub package registry, you need to use the tools [dart](https://dart.dev/tools/dart-tool) and/or [flutter](https://docs.flutter.dev/reference/flutter-cli). - -The following examples use dart. - -## Configuring the package registry - -To register the package registry and provide credentials, execute: - -```shell -dart pub token add https://gitea.example.com/api/packages/{owner}/pub -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | - -You need to provide your [personal access token](development/api-usage.md#authentication). - -## Publish a package - -To publish a package, edit the `pubspec.yaml` and add the following line: - -```yaml -publish_to: https://gitea.example.com/api/packages/{owner}/pub -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | - -Now you can publish the package by running the following command: - -```shell -dart pub publish -``` - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a Pub package from the package registry, execute the following command: - -```shell -dart pub add {package_name} --hosted-url=https://gitea.example.com/api/packages/{owner}/pub/ -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | - -For example: - -```shell -# use latest version -dart pub add mypackage --hosted-url=https://gitea.example.com/api/packages/testuser/pub/ -# specify version -dart pub add mypackage:1.0.8 --hosted-url=https://gitea.example.com/api/packages/testuser/pub/ -``` diff --git a/docs/content/usage/packages/pub.zh-cn.md b/docs/content/usage/packages/pub.zh-cn.md deleted file mode 100644 index 2b3c302047..0000000000 --- a/docs/content/usage/packages/pub.zh-cn.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -date: "2022-07-31T00:00:00+00:00" -title: "Pub 软件包注册表" -slug: "pub" -sidebar_position: 90 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Pub" - sidebar_position: 90 - identifier: "pub" ---- - -# Pub 软件包注册表 - -为您的用户或组织发布 [Pub](https://dart.dev/guides/packages) 软件包。 - -## 要求 - -要使用Pub软件包注册表,您需要使用 [dart](https://dart.dev/tools/dart-tool) 和/或 [flutter](https://docs.flutter.dev/reference/flutter-cli). 工具。 - -以下示例使用 `dart`。 - -## 配置软件包注册表 - -要注册软件包注册表并提供凭据,请执行以下操作: - -```shell -dart pub token add https://gitea.example.com/api/packages/{owner}/pub -``` - -| 占位符 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -您需要提供您的[个人访问令牌](development/api-usage.md#通过-api-认证)。 - -## 发布软件包 - -要发布软件包,请编辑 `pubspec.yaml` 文件,并添加以下行: - -```yaml -publish_to: https://gitea.example.com/api/packages/{owner}/pub -``` - -| 占位符 | 描述 | -| ------- | -------------- | -| `owner` | 软件包的所有者 | - -现在,您可以通过运行以下命令来发布软件包: - -```shell -dart pub publish -``` - -如果已存在具有相同名称和版本的软件包,则无法发布软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装Pub软件包,请执行以下命令: - -```shell -dart pub add {package_name} --hosted-url=https://gitea.example.com/api/packages/{owner}/pub/ -``` - -| 参数 | 描述 | -| -------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | - -例如: - -```shell -# use latest version -dart pub add mypackage --hosted-url=https://gitea.example.com/api/packages/testuser/pub/ -# specify version -dart pub add mypackage:1.0.8 --hosted-url=https://gitea.example.com/api/packages/testuser/pub/ -``` diff --git a/docs/content/usage/packages/pypi.en-us.md b/docs/content/usage/packages/pypi.en-us.md deleted file mode 100644 index be59df0762..0000000000 --- a/docs/content/usage/packages/pypi.en-us.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "PyPI Package Registry" -slug: "pypi" -sidebar_position: 100 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "PyPI" - sidebar_position: 100 - identifier: "pypi" ---- - -# PyPI Package Registry - -Publish [PyPI](https://pypi.org/) packages for your user or organization. - -## Requirements - -To work with the PyPI package registry, you need to use the tools [pip](https://pypi.org/project/pip/) to consume and [twine](https://pypi.org/project/twine/) to publish packages. - -## Configuring the package registry - -To register the package registry you need to edit your local `~/.pypirc` file. Add - -```ini -[distutils] -index-servers = gitea - -[gitea] -repository = https://gitea.example.com/api/packages/{owner}/pypi -username = {username} -password = {password} -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | - -## Publish a package - -Publish a package by running the following command: - -```shell -python3 -m twine upload --repository gitea /path/to/files/* -``` - -The package files have the extensions `.tar.gz` and `.whl`. - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a PyPI package from the package registry, execute the following command: - -```shell -pip install --index-url https://{username}:{password}@gitea.example.com/api/packages/{owner}/pypi/simple --no-deps {package_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `username` | Your Gitea username. | -| `password` | Your Gitea password or a personal access token. | -| `owner` | The owner of the package. | -| `package_name` | The package name. | - -For example: - -```shell -pip install --index-url https://testuser:password123@gitea.example.com/api/packages/testuser/pypi/simple --no-deps test_package -``` - -You can use `--extra-index-url` instead of `--index-url` but that makes you vulnerable to dependency confusion attacks because `pip` checks the official PyPi repository for the package before it checks the specified custom repository. Read the `pip` docs for more information. - -## Supported commands - -``` -pip install -twine upload -``` diff --git a/docs/content/usage/packages/pypi.zh-cn.md b/docs/content/usage/packages/pypi.zh-cn.md deleted file mode 100644 index 80f95141b7..0000000000 --- a/docs/content/usage/packages/pypi.zh-cn.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "PyPI 软件包注册表" -slug: "pypi" -sidebar_position: 100 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "PyPI" - sidebar_position: 100 - identifier: "pypi" ---- - -# PyPI 软件包注册表 - -为您的用户或组织发布 [PyPI](https://pypi.org/) 软件包。 - -## 要求 - -要使用 PyPI 软件包注册表,您需要使用 [pip](https://pypi.org/project/pip/) 工具来消费和使用 [twine](https://pypi.org/project/twine/) 工具来发布软件包。 - -## 配置软件包注册表 - -要注册软件包注册表,您需要编辑本地的 `~/.pypirc` 文件。添加以下内容: - -```ini -[distutils] -index-servers = gitea - -[gitea] -repository = https://gitea.example.com/api/packages/{owner}/pypi -username = {username} -password = {password} -``` - -| 占位符 | 描述 | -| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `owner` | 软件包的所有者 | -| `username` | 您的 Gitea 用户名 | -| `password` | 您的 Gitea 密码。如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码 | - -## 发布软件包 - -通过运行以下命令来发布软件包: - -```shell -python3 -m twine upload --repository gitea /path/to/files/* -``` - -软件包文件的扩展名为 `.tar.gz` 和 `.whl`。 - -如果已存在具有相同名称和版本的软件包,则无法发布软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装 PyPI 软件包,请执行以下命令: - -```shell -pip install --index-url https://{username}:{password}@gitea.example.com/api/packages/{owner}/pypi/simple --no-deps {package_name} -``` - -| 参数 | 描述 | -| -------------- | ----------------------------- | -| `username` | 您的 Gitea 用户名 | -| `password` | 您的 Gitea 密码或个人访问令牌 | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | - -例如: - -```shell -pip install --index-url https://testuser:password123@gitea.example.com/api/packages/testuser/pypi/simple --no-deps test_package -``` - -您可以使用 `--extra-index-url` 替代 `--index-url`,但这样会使您容易受到依赖混淆攻击,因为 `pip` 会先检查官方 PyPi 仓库中的软件包,然后再检查指定的自定义仓库。请阅读 `pip` 文档以获取更多信息。 - -## 支持的命令 - -``` -pip install -twine upload -``` diff --git a/docs/content/usage/packages/rpm.en-us.md b/docs/content/usage/packages/rpm.en-us.md deleted file mode 100644 index 1f93376b7b..0000000000 --- a/docs/content/usage/packages/rpm.en-us.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -date: "2023-03-08T00:00:00+00:00" -title: "RPM Package Registry" -slug: "rpm" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "RPM" - sidebar_position: 105 - identifier: "rpm" ---- - -# RPM Package Registry - -Publish [RPM](https://rpm.org/) packages for your user or organization. - -## Requirements - -To work with the RPM registry, you need to use a package manager like `yum`, `dnf` or `zypper` to consume packages. - -The following examples use `dnf`. - -## Configuring the package registry - -To register the RPM registry add the url to the list of known sources: - -```shell -dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm/{group}.repo -``` - -| Placeholder | Description | -| ----------- | ----------- | -| `owner` | The owner of the package. | -| `group` | Optional: Everything, e.g. empty, `el7`, `rocky/el9`, `test/fc38`. | - -Example: - -```shell -# without a group -dnf config-manager --add-repo https://gitea.example.com/api/packages/testuser/rpm.repo - -# with the group 'centos/el7' -dnf config-manager --add-repo https://gitea.example.com/api/packages/testuser/rpm/centos/el7.repo -``` - -If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication): - -```shell -dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm/{group}.repo -``` - -You have to add the credentials to the urls in the created `.repo` file in `/etc/yum.repos.d` too. - -## Publish a package - -To publish a RPM package (`*.rpm`), perform a HTTP PUT operation with the package content in the request body. - -``` -PUT https://gitea.example.com/api/packages/{owner}/rpm/{group}/upload -``` - -| Parameter | Description | -| --------- | ----------- | -| `owner` | The owner of the package. | -| `group` | Optional: Everything, e.g. empty, `el7`, `rocky/el9`, `test/fc38`. | - -Example request using HTTP Basic authentication: - -```shell -# without a group -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.rpm \ - https://gitea.example.com/api/packages/testuser/rpm/upload - -# with the group 'centos/el7' -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.rpm \ - https://gitea.example.com/api/packages/testuser/rpm/centos/el7/upload -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. -You cannot publish a file with the same name twice to a package. You must delete the existing package version first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exist already in the package. | - -## Delete a package - -To delete an RPM package perform a HTTP DELETE operation. This will delete the package version too if there is no file left. - -``` -DELETE https://gitea.example.com/api/packages/{owner}/rpm/{group}/package/{package_name}/{package_version}/{architecture} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `group` | Optional: The package group. | -| `package_name` | The package name. | -| `package_version` | The package version. | -| `architecture` | The package architecture. | - -Example request using HTTP Basic authentication: - -```shell -# without a group -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/rpm/package/test-package/1.0.0/x86_64 - -# with the group 'centos/el7' -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/rpm/centos/el7/package/test-package/1.0.0/x86_64 -``` - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `204 No Content` | Success | -| `404 Not Found` | The package or file was not found. | - -## Install a package - -To install a package from the RPM registry, execute the following commands: - -```shell -# use latest version -dnf install {package_name} -# use specific version -dnf install {package_name}-{package_version}.{architecture} -``` diff --git a/docs/content/usage/packages/rpm.zh-cn.md b/docs/content/usage/packages/rpm.zh-cn.md deleted file mode 100644 index cbe74bfee2..0000000000 --- a/docs/content/usage/packages/rpm.zh-cn.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -date: "2023-03-08T00:00:00+00:00" -title: "RPM 软件包注册表" -slug: "packages/rpm" -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "RPM" - sidebar_position: 105 - identifier: "rpm" ---- - -# RPM 软件包注册表 - -为您的用户或组织发布 [RPM](https://rpm.org/) 软件包。 - -## 要求 - -要使用RPM注册表,您需要使用像 `yum`, `dnf` 或 `zypper` 这样的软件包管理器来消费软件包。 - -以下示例使用 `dnf`。 - -## 配置软件包注册表 - -要注册RPM注册表,请将 URL 添加到已知 `apt` 源列表中: - -```shell -dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm/{group}.repo -``` - -| 占位符 | 描述 | -| ------- |--------------------------------------| -| `owner` | 软件包的所有者 | -| `group` | 任何名称,例如 `centos/7`、`el-7`、`fc38` | - -如果注册表是私有的,请在URL中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证): - -```shell -dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm/{group}.repo -``` - -您还必须将凭据添加到 `/etc/yum.repos.d` 中的 `rpm.repo` 文件中的URL中。 - -## 发布软件包 - -要发布RPM软件包(`*.rpm`),请执行带有软件包内容的 HTTP `PUT` 操作。 - -``` -PUT https://gitea.example.com/api/packages/{owner}/rpm/{group}/upload -``` - -| 参数 | 描述 | -| ------- |--------------| -| `owner` | 软件包的所有者 | -| `group` | 软件包自定义分组名称 | - -使用HTTP基本身份验证的示例请求: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/file.rpm \ - https://gitea.example.com/api/packages/testuser/rpm/centos/el7/version/upload -``` - -如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。您无法将具有相同名称的文件两次发布到软件包中。您必须先删除现有的软件包版本。 - -服务器将以以下HTTP状态码响应。 - -| HTTP 状态码 | 含义 | -| ----------------- | ------------------------------------------------ | -| `201 Created` | 软件包已发布 | -| `400 Bad Request` | 软件包无效 | -| `409 Conflict` | 具有相同参数组合的软件包文件已经存在于该软件包中 | - -## 删除软件包 - -要删除 RPM 软件包,请执行 HTTP `DELETE` 操作。如果没有文件剩余,这也将删除软件包版本。 - -``` -DELETE https://gitea.example.com/api/packages/{owner}/rpm/{group}/package/{package_name}/{package_version}/{architecture} -``` - -| 参数 | 描述 | -| ----------------- | -------------- | -| `owner` | 软件包的所有者 | -| `group` | 软件包自定义分组 | -| `package_name` | 软件包名称 | -| `package_version` | 软件包版本 | -| `architecture` | 软件包架构 | - -使用HTTP基本身份验证的示例请求: - -```shell -curl --user your_username:your_token_or_password -X DELETE \ - https://gitea.example.com/api/packages/testuser/rpm/centos/el7/package/test-package/1.0.0/x86_64 -``` - -服务器将以以下HTTP状态码响应: - -| HTTP 状态码 | 含义 | -| ---------------- | ------------------ | -| `204 No Content` | 成功 | -| `404 Not Found` | 未找到软件包或文件 | - -## 安装软件包 - -要从RPM注册表安装软件包,请执行以下命令: - -```shell -# use latest version -dnf install {package_name} -# use specific version -dnf install {package_name}-{package_version}.{architecture} -``` diff --git a/docs/content/usage/packages/rubygems.en-us.md b/docs/content/usage/packages/rubygems.en-us.md deleted file mode 100644 index cb1a225bc6..0000000000 --- a/docs/content/usage/packages/rubygems.en-us.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "RubyGems Package Registry" -slug: "rubygems" -sidebar_position: 110 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "RubyGems" - sidebar_position: 110 - identifier: "rubygems" ---- - -# RubyGems Package Registry - -Publish [RubyGems](https://guides.rubygems.org/) packages for your user or organization. - -## Requirements - -To work with the RubyGems package registry, you need to use the [gem](https://guides.rubygems.org/command-reference/) command line tool to consume and publish packages. - -## Configuring the package registry - -To register the package registry edit the `~/.gem/credentials` file and add: - -```ini ---- -https://gitea.example.com/api/packages/{owner}/rubygems: Bearer {token} -``` - -| Parameter | Description | -| ------------- | ----------- | -| `owner` | The owner of the package. | -| `token` | Your [personal access token](development/api-usage.md#authentication). | - -For example: - -``` ---- -https://gitea.example.com/api/packages/testuser/rubygems: Bearer 3bd626f84b01cd26b873931eace1e430a5773cc4 -``` - -## Publish a package - -Publish a package by running the following command: - -```shell -gem push --host {host} {package_file} -``` - -| Parameter | Description | -| -------------- | ----------- | -| `host` | URL to the package registry. | -| `package_file` | Path to the package `.gem` file. | - -For example: - -```shell -gem push --host https://gitea.example.com/api/packages/testuser/rubygems test_package-1.0.0.gem -``` - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -## Install a package - -To install a package from the package registry you can use [Bundler](https://bundler.io) or `gem`. - -### Bundler - -Add a new `source` block to your `Gemfile`: - -``` -source "https://gitea.example.com/api/packages/{owner}/rubygems" do - gem "{package_name}" -end -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | - -For example: - -``` -source "https://gitea.example.com/api/packages/testuser/rubygems" do - gem "test_package" -end -``` - -Afterwards run the following command: - -```shell -bundle install -``` - -### gem - -Execute the following command: - -```shell -gem install --host https://gitea.example.com/api/packages/{owner}/rubygems {package_name} -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | - -For example: - -```shell -gem install --host https://gitea.example.com/api/packages/testuser/rubygems test_package -``` - -## Supported commands - -``` -gem install -bundle install -gem push -``` diff --git a/docs/content/usage/packages/rubygems.zh-cn.md b/docs/content/usage/packages/rubygems.zh-cn.md deleted file mode 100644 index 71db4aaaeb..0000000000 --- a/docs/content/usage/packages/rubygems.zh-cn.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -date: "2021-07-20T00:00:00+00:00" -title: "RubyGems 软件包注册表" -slug: "rubygems" -sidebar_position: 110 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "RubyGems" - sidebar_position: 110 - identifier: "rubygems" ---- - -# RubyGems 软件包注册表 - -为您的用户或组织发布 [RubyGems](https://guides.rubygems.org/) 软件包。 - -## 要求 - -要使用RubyGems软件包注册表,您需要使用 [gem](https://guides.rubygems.org/command-reference/) 命令行工具来消费和发布软件包。 - -## 配置软件包注册表 - -要注册软件包注册表,请编辑 `~/.gem/credentials` 文件并添加: - -```ini ---- -https://gitea.example.com/api/packages/{owner}/rubygems: Bearer {token} -``` - -| 参数 | 描述 | -| ------- | ------------------------------------------------------------------------------------- | -| `owner` | 软件包的所有者 | -| `token` | 您的[个人访问令牌](development/api-usage.md#通过-api-认证) | - -例如: - -``` ---- -https://gitea.example.com/api/packages/testuser/rubygems: Bearer 3bd626f84b01cd26b873931eace1e430a5773cc4 -``` - -## 发布软件包 - -通过运行以下命令来发布软件包: - -```shell -gem push --host {host} {package_file} -``` - -| 参数 | 描述 | -| -------------- | ------------------------ | -| `host` | 软件包注册表的URL | -| `package_file` | 软件包 `.gem` 文件的路径 | - -例如: - -```shell -gem push --host https://gitea.example.com/api/packages/testuser/rubygems test_package-1.0.0.gem -``` - -如果已经存在相同名称和版本的软件包,您将无法发布软件包。您必须先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装软件包,您可以使用 [Bundler](https://bundler.io) 或 `gem`。 - -### Bundler - -在您的 `Gemfile` 中添加一个新的 `source` 块: - -``` -source "https://gitea.example.com/api/packages/{owner}/rubygems" do - gem "{package_name}" -end -``` - -| 参数 | 描述 | -| -------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | - -例如: - -``` -source "https://gitea.example.com/api/packages/testuser/rubygems" do - gem "test_package" -end -``` - -之后运行以下命令: - -```shell -bundle install -``` - -### gem - -执行以下命令: - -```shell -gem install --host https://gitea.example.com/api/packages/{owner}/rubygems {package_name} -``` - -| 参数 | 描述 | -| -------------- | -------------- | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包名称 | - -例如: - -```shell -gem install --host https://gitea.example.com/api/packages/testuser/rubygems test_package -``` - -## 支持的命令 - -``` -gem install -bundle install -gem push -``` diff --git a/docs/content/usage/packages/storage.en-us.md b/docs/content/usage/packages/storage.en-us.md deleted file mode 100644 index f437412dcc..0000000000 --- a/docs/content/usage/packages/storage.en-us.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -date: "2022-11-01T00:00:00+00:00" -title: "Storage" -slug: "storage" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Storage" - sidebar_position: 2 - identifier: "storage" ---- - -# Storage - -This document describes the storage of the package registry and how it can be managed. - -## Deduplication - -The package registry has a build-in deduplication of uploaded blobs. -If two identical files are uploaded only one blob is saved on the filesystem. -This ensures no space is wasted for duplicated files. - -If two packages are uploaded with identical files, both packages will display the same size but on the filesystem they require only half of the size. -Whenever a package gets deleted, only the references to the underlying blobs are removed. -The blobs get not removed at this moment, so they still require space on the filesystem. -When a new package gets uploaded the existing blobs may get referenced again. - -These unreferenced blobs get deleted by a [clean up job](administration/config-cheat-sheet.md#cron---cleanup-expired-packages-croncleanup_packages). -The config setting `OLDER_THAN` configures how long unreferenced blobs are kept before they get deleted. - -## Cleanup Rules - -Package registries can become large over time without cleanup. -It's recommended to delete unnecessary packages and set up cleanup rules to automatically manage the package registry usage. -Every package owner (user or organization) manages the cleanup rules which are applied to their packages. - -|Setting|Description| -|-|-| -|Enabled|Turn the cleanup rule on or off.| -|Type|Every rule manages a specific package type.| -|Apply pattern to full package name|If enabled, the patterns below are applied to the full package name (`package/version`). Otherwise only the version (`version`) is used.| -|Keep the most recent|How many versions to *always* keep for each package.| -|Keep versions matching|The regex pattern that determines which versions to keep. An empty pattern keeps no version while `.+` keeps all versions. The container registry will always keep the `latest` version even if not configured.| -|Remove versions older than|Remove only versions older than the selected days.| -|Remove versions matching|The regex pattern that determines which versions to remove. An empty pattern or `.+` leads to the removal of every package if no other setting tells otherwise.| - -Every cleanup rule can show a preview of the affected packages. -This can be used to check if the cleanup rules is proper configured. - -### Regex examples - -Regex patterns are automatically surrounded with `\A` and `\z` anchors. -Do not include any `\A`, `\z`, `^` or `$` token in the regex patterns as they are not necessary. -The patterns are case-insensitive which matches the behaviour of the package registry in Gitea. - -|Pattern|Description| -|-|-| -|`.*`|Match every possible version.| -|`v.+`|Match versions that start with `v`.| -|`release`|Match only the version `release`.| -|`release.*`|Match versions that are either named or start with `release`.| -|`.+-temp-.+`|Match versions that contain `-temp-`.| -|`v.+\|release`|Match versions that either start with `v` or are named `release`.| -|`package/v.+\|other/release`|Match versions of the package `package` that start with `v` or the version `release` of the package `other`. This needs the setting *Apply pattern to full package name* enabled.| - -### How the cleanup rules work - -The cleanup rules are part of the [clean up job](administration/config-cheat-sheet.md#cron---cleanup-expired-packages-croncleanup_packages) and run periodically. - -The cleanup rule: - -1. Collects all packages of the package type for the owners registry. -2. For every package it collects all versions. -3. Excludes from the list the # versions based on the *Keep the most recent* value. -4. Excludes from the list any versions matching the *Keep versions matching* value. -5. Excludes from the list the versions more recent than the *Remove versions older than* value. -6. Excludes from the list any versions not matching the *Remove versions matching* value. -7. Deletes the remaining versions. diff --git a/docs/content/usage/packages/storage.zh-cn.md b/docs/content/usage/packages/storage.zh-cn.md deleted file mode 100644 index 3832e80c98..0000000000 --- a/docs/content/usage/packages/storage.zh-cn.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -date: "2022-11-01T00:00:00+00:00" -title: "存储" -slug: "storage" -sidebar_position: 5 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Storage" - sidebar_position: 2 - identifier: "storage" ---- - -# 存储 - -本文档描述了软件包注册表的存储方式以及如何管理存储。 - -## 去重 - -软件包注册表具有内置的去重功能,可以对上传的 Blob 进行去重处理。 -如果上传了两个相同的文件,只会在文件系统上保存一个 Blob。 -这样可以确保不会浪费空间用于重复的文件。 - -如果上传了两个具有相同文件的软件包,这两个软件包将显示相同的大小,但在文件系统上,它们只需要一半的大小。 -每当删除一个软件包时,只会删除对底层 Blob 的引用。 -此时,Blob 不会被删除,因此它们仍然占用文件系统上的空间。 -当上传新的软件包时,现有的 Blob 可能会再次被引用。 - -这些无引用的 Blob 会在一个清理任务中被删除。 -配置设置 `OLDER_THAN` 可以配置无引用的 Blob 在被删除之前保留的时间。 - -## 清理规则 - -软件包注册表可能会随着时间的推移而变得很大,如果不进行清理的话。 -建议删除不必要的软件包并设置清理规则以自动管理软件包注册表的使用情况。 -每个软件包所有者(用户或组织)都可以管理应用于其软件包的清理规则。 - -| 设置 | 描述 | -| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| 启用 | 打开或关闭清理规则。 | -| 类型 | 每个规则管理特定的软件包类型。 | -| 将模式应用于完整的软件包名称 | 如果启用,则应用以下模式到完整的软件包名称(`package/version`),否则只使用版本号(`version`)。 | -| 保留最近的版本数 | 对于每个软件包要始终保留的版本数量。 | -| 保留与以下模式匹配的版本 | 确定要保留哪些版本的正则表达式模式。空模式表示不保留任何版本,而 `.+` 表示保留所有版本。即使未配置,容器注册表也始终保留 `latest` 版本。 | -| 删除早于多少天的版本 | 仅删除早于所选天数的版本。 | -| 删除与以下模式匹配的版本 | 确定要删除哪些版本的正则表达式模式。空模式或 `.+` 表示如果没有其他设置指定,则删除所有软件包。 | - -每个清理规则都可以显示受影响的软件包的预览。 -这可以用来检查清理规则是否正确配置。 - -### 正则表达式示例 - -正则表达式模式会自动使用 `\A` 和 `\z` 锚点进行包围。 -不要在正则表达式模式中包含任何 `\A`、`\z`、`^` 或 `$` 标记,因为它们不是必要的。 -模式是不区分大小写的,与 Gitea 中的软件包注册表的行为相匹配。 - -| Pattern | Description | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `.*` | 匹配任何可能的版本。 | -| `v.+` | 匹配以 `v` 开头的版本。 | -| `release` | 仅匹配版本号为 `release`。 | -| `release.*` | 匹配以 `release` 命名或以 `release` 开头的版本。 | -| `.+-temp-.+` | 匹配包含 `-temp-` 的版本。 | -| `v.+\|release` | 匹配以 `v` 开头的版本或版本号为 `release`。 | -| `package/v.+\|other/release` | 匹配以 `v` 开头的 package 的版本或 `other` 的版本号为 `release`。需要启用*将模式应用于完整的软件包名称*设置。 | - -### 清理规则的工作原理 - -清理规则是清理任务的一部分,定期运行。 - -清理规则: - -1. 收集所有属于所有者注册表的特定软件包类型的软件包。 -2. 对于每个软件包,收集所有版本。 -3. 根据 *保留最近的版本数* 的值,从列表中排除版本。 -4. 根据 *保留与以下模式匹配的版本* 的值,从列表中排除任何版本。 -5. 根据 *删除早于多少天的版本* 的值,从列表中排除比这个值更近的版本。 -6. 根据 *删除与以下模式匹配的版本* 的值,从列表中排除任何不匹配的版本。 -7. 删除剩余的版本。 diff --git a/docs/content/usage/packages/swift.en-us.md b/docs/content/usage/packages/swift.en-us.md deleted file mode 100644 index 38eb155641..0000000000 --- a/docs/content/usage/packages/swift.en-us.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -date: "2023-01-10T00:00:00+00:00" -title: "Swift Package Registry" -slug: "swift" -sidebar_position: 95 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Swift" - sidebar_position: 95 - identifier: "swift" ---- - -# Swift Package Registry - -Publish [Swift](https://www.swift.org/) packages for your user or organization. - -## Requirements - -To work with the Swift package registry, you need to use [swift](https://www.swift.org/getting-started/) to consume and a HTTP client (like `curl`) to publish packages. - -## Configuring the package registry - -To register the package registry and provide credentials, execute: - -```shell -swift package-registry set https://gitea.example.com/api/packages/{owner}/swift -swift package-registry login https://gitea.example.com/api/packages/{owner}/swift --username {username} --password {password} -``` - -| Placeholder | Description | -| ------------ | ----------- | -| `owner` | The owner of the package. | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | - -The login is optional and only needed if the package registry is private. - -## Publish a package - -First you have to pack the contents of your package: - -```shell -swift package archive-source -``` - -To publish the package perform a HTTP PUT request with the package content in the request body. - -```shell --user your_username:your_password_or_token \ -curl -X PUT --user {username}:{password} \ - -H "Accept: application/vnd.swift.registry.v1+json" \ - -F source-archive=@/path/to/package.zip \ - -F metadata={metadata} \ - https://gitea.example.com/api/packages/{owner}/swift/{scope}/{name}/{version} -``` - -| Placeholder | Description | -| ----------- | ----------- | -| `username` | Your Gitea username. | -| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. | -| `owner` | The owner of the package. | -| `scope` | The package scope. | -| `name` | The package name. | -| `version` | The package version. | -| `metadata` | (Optional) The metadata of the package. JSON encoded subset of https://schema.org/SoftwareSourceCode | - -You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package file with the same combination of parameters exists already. | - -## Install a package - -To install a Swift package from the package registry, add it in the `Package.swift` file dependencies list: - -``` -dependencies: [ - .package(id: "{scope}.{name}", from:"{version}") -] -``` - -| Parameter | Description | -| ----------- | ----------- | -| `scope` | The package scope. | -| `name` | The package name. | -| `version` | The package version. | - -Afterwards execute the following command to install it: - -```shell -swift package resolve -``` diff --git a/docs/content/usage/packages/swift.zh-cn.md b/docs/content/usage/packages/swift.zh-cn.md deleted file mode 100644 index 595a705e79..0000000000 --- a/docs/content/usage/packages/swift.zh-cn.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -date: "2023-01-10T00:00:00+00:00" -title: "Swift 软件包注册表" -slug: "swift" -sidebar_position: 95 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Swift" - sidebar_position: 95 - identifier: "swift" ---- - -# Swift 软件包注册表 - -为您的用户或组织发布 [Swift](https://www.swift.org/) 软件包。 - -## 要求 - -要使用 Swift 软件包注册表,您需要使用 [swift](https://www.swift.org/getting-started/) 消费软件包,并使用 HTTP 客户端(如 `curl`)发布软件包。 - -## 配置软件包注册表 - -要注册软件包注册表并提供凭据,请执行以下命令: - -```shell -swift package-registry set https://gitea.example.com/api/packages/{owner}/swift -login {username} -password {password} -``` - -| 占位符 | 描述 | -| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `owner` | 软件包的所有者。 | -| `username` | 您的 Gitea 用户名。 | -| `password` | 您的 Gitea 密码。如果您使用两步验证或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)代替密码。 | - -登录是可选的,只有在软件包注册表是私有的情况下才需要。 - -## 发布软件包 - -首先,您需要打包软件包的内容: - -```shell -swift package archive-source -``` - -要发布软件包,请执行一个带有软件包内容的 HTTP `PUT` 请求,将内容放在请求正文中。 - -```shell --user your_username:your_password_or_token \ -curl -X PUT --user {username}:{password} \ - -H "Accept: application/vnd.swift.registry.v1+json" \ - -F source-archive=@/path/to/package.zip \ - -F metadata={metadata} \ - https://gitea.example.com/api/packages/{owner}/swift/{scope}/{name}/{version} -``` - -| 占位符 | 描述 | -| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `username` | 您的 Gitea 用户名。 | -| `password` | 您的 Gitea 密码。如果您使用两步验证或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)代替密码。 | -| `owner` | 软件包的所有者。 | -| `scope` | 软件包的作用域。 | -| `name` | 软件包的名称。 | -| `version` | 软件包的版本。 | -| `metadata` | (可选)软件包的元数据。以 JSON 编码的子集,格式参考 https://schema.org/SoftwareSourceCode | - -如果已经存在相同名称和版本的软件包,则无法发布软件包。您必须首先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装 Swift 软件包,请将其添加到 `Package.swift` 文件的依赖项列表中: - -``` -dependencies: [ - .package(id: "{scope}.{name}", from:"{version}") -] -``` - -| 参数 | 描述 | -| --------- | -------------- | -| `scope` | 软件包的作用域 | -| `name` | 软件包的名称 | -| `version` | 软件包的版本 | - -之后,执行以下命令来安装它: - -```shell -swift package resolve -``` diff --git a/docs/content/usage/packages/vagrant.en-us.md b/docs/content/usage/packages/vagrant.en-us.md deleted file mode 100644 index baa9c2b83e..0000000000 --- a/docs/content/usage/packages/vagrant.en-us.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -date: "2022-08-23T00:00:00+00:00" -title: "Vagrant Package Registry" -slug: "vagrant" -sidebar_position: 120 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Vagrant" - sidebar_position: 120 - identifier: "vagrant" ---- - -# Vagrant Package Registry - -Publish [Vagrant](https://www.vagrantup.com/) packages for your user or organization. - -## Requirements - -To work with the Vagrant package registry, you need [Vagrant](https://www.vagrantup.com/downloads) and a tool to make HTTP requests like `curl`. - -## Publish a package - -Publish a Vagrant box by performing a HTTP PUT request to the registry: - -``` -PUT https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}/{package_version}/{provider}.box -``` - -| Parameter | Description | -| ----------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | -| `package_version` | The package version, semver compatible. | -| `provider` | One of the [supported provider names](https://www.vagrantup.com/docs/providers). | - -Example for uploading a Hyper-V box: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/your/vagrant.box \ - https://gitea.example.com/api/packages/testuser/vagrant/test_system/1.0.0/hyperv.box -``` - -If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. - -You cannot publish a box if a box of the same name, version and provider already exists. You must delete the existing package first. - -The server responds with the following HTTP Status codes. - -| HTTP Status Code | Meaning | -| ----------------- | ------- | -| `201 Created` | The package has been published. | -| `400 Bad Request` | The package is invalid. | -| `409 Conflict` | A package with the same combination of parameters exists already. | - -## Install a package - -To install a box from the package registry, execute the following command: - -```shell -vagrant box add "https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}" -``` - -| Parameter | Description | -| -------------- | ----------- | -| `owner` | The owner of the package. | -| `package_name` | The package name. | - -For example: - -```shell -vagrant box add "https://gitea.example.com/api/packages/testuser/vagrant/test_system" -``` - -This will install the latest version of the package. To add a specific version, use the `--box-version` parameter. -If the registry is private you can pass your [personal access token](development/api-usage.md#authentication) in the `VAGRANT_CLOUD_TOKEN` environment variable. - -## Supported commands - -``` -vagrant box add -``` diff --git a/docs/content/usage/packages/vagrant.zh-cn.md b/docs/content/usage/packages/vagrant.zh-cn.md deleted file mode 100644 index 67d79ad3cc..0000000000 --- a/docs/content/usage/packages/vagrant.zh-cn.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -date: "2022-08-23T00:00:00+00:00" -title: "Vagrant 软件包注册表" -slug: "vagrant" -sidebar_position: 120 -draft: false -toc: false -menu: - sidebar: - parent: "packages" - name: "Vagrant" - sidebar_position: 120 - identifier: "vagrant" ---- - -# Vagrant 软件包注册表 - -为您的用户或组织发布 [Vagrant](https://www.vagrantup.com/) 软件包。 - -## 要求 - -要使用 Vagrant 软件包注册表,您需要安装 [Vagrant](https://www.vagrantup.com/downloads) 并使用类似于 `curl` 的工具进行 HTTP 请求。 - -## 发布软件包 - -通过执行 HTTP PUT 请求将 Vagrant box 发布到注册表: - -``` -PUT https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}/{package_version}/{provider}.box -``` - -| 参数 | 描述 | -| ----------------- | ------------------------------------------------------------------ | -| `owner` | 软件包的所有者 | -| `package_name` | 软件包的名称 | -| `package_version` | 软件包的版本,兼容 semver 格式 | -| `provider` | [支持的提供程序名称](https://www.vagrantup.com/docs/providers)之一 | - -上传 Hyper-V box 的示例: - -```shell -curl --user your_username:your_password_or_token \ - --upload-file path/to/your/vagrant.box \ - https://gitea.example.com/api/packages/testuser/vagrant/test_system/1.0.0/hyperv.box -``` - -如果已经存在相同名称、版本和提供程序的软件包,则无法发布软件包。您必须首先删除现有的软件包。 - -## 安装软件包 - -要从软件包注册表安装软件包,请执行以下命令: - -```shell -vagrant box add "https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}" -``` - -| 参数 | 描述 | -| -------------- | --------------- | -| `owner` | 软件包的所有者. | -| `package_name` | 软件包的名称 | - -例如: - -```shell -vagrant box add "https://gitea.example.com/api/packages/testuser/vagrant/test_system" -``` - -这将安装软件包的最新版本。要添加特定版本,请使用` --box-version` 参数。 -如果注册表是私有的,您可以将您的[个人访问令牌](development/api-usage.md#通过-api-认证)传递给 `VAGRANT_CLOUD_TOKEN` 环境变量。 - -## 支持的命令 - -``` -vagrant box add -``` diff --git a/docs/content/usage/permissions.en-us.md b/docs/content/usage/permissions.en-us.md deleted file mode 100644 index 1e0c6c0bb1..0000000000 --- a/docs/content/usage/permissions.en-us.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -date: "2021-12-13:10:10+08:00" -title: "Permissions" -slug: "permissions" -sidebar_position: 14 -toc: false -draft: false -aliases: - - /en-us/permissions -menu: - sidebar: - parent: "usage" - name: "Permissions" - sidebar_position: 14 - identifier: "permissions" ---- - -# Permissions - -Gitea supports permissions for repository so that you can give different access for different people. At first, we need to know about `Unit`. - -## Unit - -In Gitea, we call a sub module of a repository `Unit`. Now we have following possible units. - -| Name | Description | Permissions | -| --------------- | ---------------------------------------------------- | ----------- | -| Code | Access source code, files, commits and branches. | Read Write | -| Issues | Organize bug reports, tasks and milestones. | Read Write | -| PullRequests | Enable pull requests and code reviews. | Read Write | -| Releases | Track project versions and downloads. | Read Write | -| Wiki | Write and share documentation with collaborators. | Read Write | -| ExternalWiki | Link to an external wiki | Read | -| ExternalTracker | Link to an external issue tracker | Read | -| Projects | The URL to the template repository | Read Write | -| Packages | Packages which linked to this repository | Read Write | -| Actions | Review actions logs or restart/cacnel pipelines | Read Write | -| Settings | Manage the repository | Admin | - -With different permissions, people could do different things with these units. - -| Name | Read | Write | Admin | -| --------------- | ------------------------------------------------- | ---------------------------- | ------------------------- | -| Code | View code trees, files, commits, branches and etc. | Push codes. | - | -| Issues | View issues and create new issues. | Add labels, assign, close | - | -| PullRequests | View pull requests and create new pull requests. | Add labels, assign, close | - | -| Releases | View releases and download files. | Create/Edit releases | - | -| Wiki | View wiki pages. Clone the wiki repository. | Create/Edit wiki pages, push | - | -| ExternalWiki | Link to an external wiki | - | - | -| ExternalTracker | Link to an external issue tracker | - | - | -| Projects | View the boards | Change issues across boards | - | -| Packages | View the packages | Upload/Delete packages | - | -| Actions | View the Actions logs | Approve / Cancel / Restart | - | -| Settings | - | - | Manage the repository | - -And there are some differences for permissions between individual repositories and organization repositories. - -## Individual Repository - -For individual repositories, the creators are the only owners of repositories and have no limit to change anything of this -repository or delete it. Repositories owners could add collaborators to help maintain the repositories. Collaborators could have `Read`, `Write` and `Admin` permissions. - -For a private repository, the experience is similar to visiting an anonymous public repository. You have access to all the available content within the repository, including the ability to clone the code, create issues, respond to issue comments, submit pull requests, and more. If you have 'Write' permission, you can push code to specific branches of the repository, provided it's permitted by the branch protection rules. Additionally, you can make changes to the wiki pages. With 'Admin' permission, you have the ability to modify the repository's settings. - -But you cannot delete or transfer this repository if you are not that repository's owner. - -## Organization Repository - -For individual repositories, the owner is the user who created it. For organization repositories, the owners are the members of the owner team on this organization. All the permissions depends on the team permission settings. - -### Owner Team - -The owner team will be created when the organization is created, and the creator will become the first member of the owner team. The owner team cannot be deleted and there is at least one member. - -### Admin Team - -When creating teams, there are two types of teams. One is the admin team, another is the general team. An admin team can be created to manage some of the repositories, whose members can do anything with these repositories. Only members of the owner or admin team can create a new team. - -### General Team - -A general team in an organization has unit permissions settings. It can have members and repositories scope. - -- A team could access all the repositories in this organization or special repositories. -- A team could also be allowed to create new repositories or not. - -The General team can be created to do the operations allowed by their permissions. One member could join multiple teams. diff --git a/docs/content/usage/permissions.zh-cn.md b/docs/content/usage/permissions.zh-cn.md deleted file mode 100644 index 0c748aef96..0000000000 --- a/docs/content/usage/permissions.zh-cn.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "权限" -slug: "permissions" -sidebar_position: 14 -toc: false -draft: false -aliases: - - /zh-cn/permissions -menu: - sidebar: - parent: "usage" - name: "权限" - sidebar_position: 14 - identifier: "permissions" ---- - -# 权限 - -Gitea 支持对仓库进行权限管理,这样您就可以为不同的人员提供不同的访问权限。首先,我们需要了解 `单元(Unit)`。 - -## 单元(Unit) - -在 Gitea 中,我们将仓库的子模块称为 `单元(Unit)`。现在我们有以下几个单元。 - -| 名称 | 描述 | 权限 | -| ----------------- | --------------------------------------------------- | ------------ | -| 代码 | 访问源代码、文件、提交和分支。 | 读取 写入 | -| 工单 | 组织缺陷报告、任务和里程碑。 | 读取 写入 | -| 合并请求 | 启用合并请求和代码审核。 | 读取 写入 | -| 发布 | 跟踪项目版本和下载。 | 读取 写入 | -| 百科 | 与协作者编写和共享文档。 | 读取 写入 | -| 外部百科 | 链接到外部维基。 | 读取 | -| 外部工单跟踪器 | 链接到外部工单跟踪器。 | 读取 | -| 项目 | 模板仓库的 URL。 | 读取 写入 | -| 包 | 链接到仓库 | 读取 写入 | -| Actions | 审查Actions日志或重启/取消工作流 | 读取 写入 | -| 设置 | 管理仓库。 | 管理员 | - -通过不同的权限,用户可以在这些单元上执行不同的操作。 - -| 名称 | 读取 | 写入 | 管理员 | -| ----------------- | -------------------------------------------------- | ------------------------------ | ------------------------- | -| 代码 | 查看代码树、文件、提交、分支等。 | 推送代码。 | - | -| 工单 | 查看工单并创建新工单。 | 添加标签、分配、关闭工单。 | - | -| 合并请求 | 查看合并请求并创建新合并请求。 | 添加标签、分配、关闭合并请求。 | - | -| 发布 | 查看发布和下载文件。 | 创建/编辑发布。 | - | -| 百科 | 查看百科页面。克隆百科仓库。 | 创建/编辑百科页面,推送更改。 | - | -| 外部百科 | 链接到外部百科。 | - | - | -| 外部工单跟踪器 | 链接到外部工单跟踪器。 | - | - | -| 项目 | 查看面板。 | 在面板之间移动工单。 | - | -| 包 | 查看包 | 上传/删除包 | - | -| Actions | 查看 Actions日志 | 同意 / 取消 / 重启 | - | -| 设置 | - | - | 管理仓库 | - -个人仓库和组织仓库之间的权限存在一些差异。 - -## 个人仓库 - -对于个人仓库,创建者是仓库的唯一所有者,对于该仓库的任何更改或删除没有限制。 -仓库所有者可以添加协作者来帮助维护仓库。协作者可以拥有 `读取(Read)`、`写入(Write)` 和 `管理员(Admin)` 权限。 - -访问私有仓库的体验与访问匿名公共仓库类似。您可以访问仓库中的所有可用内容,包括克隆代码、创建工单、回复工单评论、提交拉取请求等。如果你有 "写"权限,只要分支保护规则允许,你就可以向仓库的特定分支推送代码。此外,你还可以修改百科页面。有了 "管理"权限,你就可以修改仓库的设置。 - -但如果你不是该仓库的所有者,就不能删除或转移该仓库。 - -## 组织仓库 - -对于个人仓库,所有者是创建它的用户。而对于组织仓库,所有者是该组织中的所有者团队成员。对该组织仓库的所有权限都取决于团队权限设置。 - -### 所有者团队 - -创建组织时将自动创建所有者团队,创建者将成为所有者团队的第一名成员。所有者团队不可删除,且至少有一名成员。 - -### 管理员团队 - -创建团队时,有两种类型的团队。一种是管理员团队,另一种是普通团队。可以创建一个管理员团队来管理某些版本库,其成员可以对这些版本库做任何事情。只有所有者或管理员团队的成员才能创建新团队。 - -### 普通团队 - -组织中的普通团队具有可以根据`单元(Unit)`进行权限设置。它可以有成员和存储库范围。 - -- 一个团队可以访问所属组织的所有仓库或特殊仓库。 -- 也可以设置该团队是否有创建新仓库的权限。 - -可以通过创建 "普通团队",并通过权限控制对其行为进行限制。一名成员可以加入多个团队。 diff --git a/docs/content/usage/profile-readme.en-us.md b/docs/content/usage/profile-readme.en-us.md deleted file mode 100644 index 316a735a1c..0000000000 --- a/docs/content/usage/profile-readme.en-us.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -date: "2023-03-02T21:00:00+05:00" -title: "Profile READMEs" -slug: "profile-readme" -sidebar_position: 12 -toc: false -draft: false -menu: - sidebar: - parent: "usage" - name: "Profile READMEs" - sidebar_position: 12 - identifier: "profile-readme" ---- - -# Profile READMEs - -To display a Markdown file in your Gitea user or organization profile page, create a repository named `.profile` and add a new file named `README.md` to it. -Gitea will automatically display the contents of the file on your profile, in a new "Overview" above your repositories. - -Making the `.profile` repository private will hide the Profile README. - -Example of user with `.profile/README.md`: - -![profile readme screenshot](/images/usage/profile-readme.png) diff --git a/docs/content/usage/profile-readme.zh-cn.md b/docs/content/usage/profile-readme.zh-cn.md deleted file mode 100644 index 804f69d2e6..0000000000 --- a/docs/content/usage/profile-readme.zh-cn.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "个人资料 README" -slug: "profile-readme" -sidebar_position: 12 -toc: false -draft: false -menu: - sidebar: - parent: "usage" - name: "个人资料 README" - sidebar_position: 12 - identifier: "profile-readme" ---- - -# 个人资料 README - -要在您的 Gitea 个人资料页面显示一个 Markdown 文件,只需创建一个名为 ".profile" 的仓库,并编辑其中的 README.md 文件。Gitea 将自动获取该文件并在您的仓库上方显示。 - -注意:您可以将此仓库设为私有。这样可以隐藏您的源文件,使其对公众不可见,并允许您将某些文件设为私有。但是,README.md 文件将是您个人资料上唯一存在的文件。如果您希望完全私有化 .profile 仓库,则需删除或重命名 README.md 文件。 diff --git a/docs/content/usage/protected-tags.en-us.md b/docs/content/usage/protected-tags.en-us.md deleted file mode 100644 index b25cbdbb2e..0000000000 --- a/docs/content/usage/protected-tags.en-us.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -date: "2021-05-14T00:00:00-00:00" -title: "Protected tags" -slug: "protected-tags" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /en-us/protected-tags -menu: - sidebar: - parent: "usage" - name: "Protected tags" - sidebar_position: 45 - identifier: "protected-tags" ---- - -# Protected tags - -Protected tags allow control over who has permission to create or update Git tags. Each rule allows you to match either an individual tag name, or use an appropriate pattern to control multiple tags at once. - -## Setting up protected tags - -To protect a tag, you need to follow these steps: - -1. Go to the repository’s **Settings** > **Tags** page. -1. Type a pattern to match a name. You can use a single name, a [glob pattern](https://pkg.go.dev/github.com/gobwas/glob#Compile) or a regular expression. -1. Choose the allowed users and/or teams. If you leave these fields empty no one is allowed to create or modify this tag. -1. Select **Save** to save the configuration. - -## Pattern protected tags - -The pattern uses [glob](https://pkg.go.dev/github.com/gobwas/glob#Compile) or regular expressions to match a tag name. For regular expressions you need to enclose the pattern in slashes. - -Examples: - -| Type | Pattern Protected Tag | Possible Matching Tags | -| ----- | ------------------------ | --------------------------------------- | -| Glob | `v*` | `v`, `v-1`, `version2` | -| Glob | `v[0-9]` | `v0`, `v1` up to `v9` | -| Glob | `*-release` | `2.1-release`, `final-release` | -| Glob | `gitea` | only `gitea` | -| Glob | `*gitea*` | `gitea`, `2.1-gitea`, `1_gitea-release` | -| Glob | `{v,rel}-*` | `v-`, `v-1`, `v-final`, `rel-`, `rel-x` | -| Glob | `*` | matches all possible tag names | -| Regex | `/\Av/` | `v`, `v-1`, `version2` | -| Regex | `/\Av[0-9]\z/` | `v0`, `v1` up to `v9` | -| Regex | `/\Av\d+\.\d+\.\d+\z/` | `v1.0.17`, `v2.1.0` | -| Regex | `/\Av\d+(\.\d+){0,2}\z/` | `v1`, `v2.1`, `v1.2.34` | -| Regex | `/-release\z/` | `2.1-release`, `final-release` | -| Regex | `/gitea/` | `gitea`, `2.1-gitea`, `1_gitea-release` | -| Regex | `/\Agitea\z/` | only `gitea` | -| Regex | `/^gitea$/` | only `gitea` | -| Regex | `/\A(v\|rel)-/` | `v-`, `v-1`, `v-final`, `rel-`, `rel-x` | -| Regex | `/.+/` | matches all possible tag names | diff --git a/docs/content/usage/protected-tags.zh-cn.md b/docs/content/usage/protected-tags.zh-cn.md deleted file mode 100644 index 0529bf7932..0000000000 --- a/docs/content/usage/protected-tags.zh-cn.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "受保护的标签" -slug: "protected-tags" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /zh-cn/protected-tags -menu: - sidebar: - parent: "usage" - name: "受保护的标签" - sidebar_position: 45 - identifier: "protected-tags" ---- - -# 受保护的标签 - -受保护的标签允许控制谁有权限创建或更新 Git 标签。每个规则可以匹配单个标签名称,或者使用适当的模式来同时控制多个标签。 - -## 设置受保护的标签 - -要保护一个标签,你需要按照以下步骤进行操作: - -1. 进入仓库的**设置** > **标签**页面。 -2. 输入一个用于匹配名称的模式。你可以使用单个名称、[glob 模式](https://pkg.go.dev/github.com/gobwas/glob#Compile) 或正则表达式。 -3. 选择允许的用户和/或团队。如果将这些字段留空,则不允许任何人创建或修改此标签。 -4. 选择**保存**以保存配置。 - -## 模式受保护的标签 - -该模式使用 [glob](https://pkg.go.dev/github.com/gobwas/glob#Compile) 或正则表达式来匹配标签名称。对于正则表达式,你需要将模式括在斜杠中。 - -示例: - -| 类型 | 模式受保护的标签 | 可能匹配的标签 | -| ----- | ------------------------ | --------------------------------------- | -| Glob | `v*` | `v`,`v-1`,`version2` | -| Glob | `v[0-9]` | `v0`,`v1` 到 `v9` | -| Glob | `*-release` | `2.1-release`,`final-release` | -| Glob | `gitea` | 仅限 `gitea` | -| Glob | `*gitea*` | `gitea`,`2.1-gitea`,`1_gitea-release` | -| Glob | `{v,rel}-*` | `v-`,`v-1`,`v-final`,`rel-`,`rel-x` | -| Glob | `*` | 匹配所有可能的标签名称 | -| Regex | `/\Av/` | `v`,`v-1`,`version2` | -| Regex | `/\Av[0-9]\z/` | `v0`,`v1` 到 `v9` | -| Regex | `/\Av\d+\.\d+\.\d+\z/` | `v1.0.17`,`v2.1.0` | -| Regex | `/\Av\d+(\.\d+){0,2}\z/` | `v1`,`v2.1`,`v1.2.34` | -| Regex | `/-release\z/` | `2.1-release`,`final-release` | -| Regex | `/gitea/` | `gitea`,`2.1-gitea`,`1_gitea-release` | -| Regex | `/\Agitea\z/` | 仅限 `gitea` | -| Regex | `/^gitea$/` | 仅限 `gitea` | -| Regex | `/\A(v\|rel)-/` | `v-`,`v-1`,`v-final`,`rel-`,`rel-x` | -| Regex | `/.+/` | 匹配所有可能的标签名称 | diff --git a/docs/content/usage/pull-request.en-us.md b/docs/content/usage/pull-request.en-us.md deleted file mode 100644 index 0176d0af97..0000000000 --- a/docs/content/usage/pull-request.en-us.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -date: "2018-06-01T19:00:00+02:00" -title: "Pull Request" -slug: "pull-request" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /en-us/pull-request -menu: - sidebar: - parent: "usage" - name: "Pull Request" - sidebar_position: 13 - identifier: "pull-request" ---- - -# Pull Request - -A Pull Request (PR) is a way to propose changes to a repository. -It is a request to merge one branch into another, accompanied by a description of the changes that were made. -Pull Requests are commonly used as a way for contributors to propose changes and for maintainers to review and merge those changes. - -## Creating a pull request - -To create a PR, you'll need to follow these steps: - -1. **Fork the repository** - If you don't have permission to make changes to the repository directly, you'll need to fork the repository to your own account. -This creates a copy of the repository that you can make changes to. - -2. **Create a branch (optional)** - Create a new branch on your forked repository that contains the changes you want to propose. -Give the branch a descriptive name that indicates what the changes are for. - -3. **Make your changes** - Make the changes you want, commit, and push them to your forked repository. - -4. **Create the PR** - Go to the original repository and go to the "Pull Requests" tab. Click the "New Pull Request" button and select your new branch as the source branch. -Enter a descriptive title and description for your Pull Request and click "Create Pull Request". - -## Reviewing a pull request - -When a PR is created, it triggers a review process. The maintainers of the repository are notified of the PR and can review the changes that were made. -They can leave comments, request changes, or approve the changes. - -If the maintainers request changes, you'll need to make those changes in your branch and push the changes to your forked repository. -The PR will be updated automatically with the new changes. - -If the maintainers approve the changes, they can merge the PR into the repository. - -## Closing a pull request - -If you decide that you no longer want to merge a PR, you can close it. -To close a PR, go to the open PR and click the "Close Pull Request" button. This will close the PR without merging it. - -## "Work In Progress" pull requests - -Marking a pull request as being a work in progress will prevent that pull request from being accidentally merged. -To mark a pull request as being a work in progress, you must prefix its title by `WIP:` or `[WIP]` (case insensitive). -Those values are configurable in your `app.ini` file: - -```ini -[repository.pull-request] -WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] -``` - -The first value of the list will be used in helpers. - -## Pull Request Templates - -You can find more information about pull request templates at the page [Issue and Pull Request templates](usage/issue-pull-request-templates.md). diff --git a/docs/content/usage/pull-request.zh-cn.md b/docs/content/usage/pull-request.zh-cn.md deleted file mode 100644 index a8f00dbd39..0000000000 --- a/docs/content/usage/pull-request.zh-cn.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -date: "2018-06-01T19:00:00+02:00" -title: "合并请求" -slug: "pull-request" -sidebar_position: 13 -toc: false -draft: false -aliases: - - /zh-cn/pull-request -menu: - sidebar: - parent: "usage" - name: "Pull Request" - sidebar_position: 13 - identifier: "pull-request" ---- - -# 合并请求 - -合并请求(PR)是一种提出对仓库进行更改的方式。 -它是一种将一个分支合并到另一个分支的请求,附带有对所做更改的描述。 -合并请求通常用作贡献者对仓库贡献代码的方式,仓库的维护者可以通过对合并请求进行审查来决定是否接受这些更改。 - -## 创建合并请求 - -要创建合并请求,您需要遵循以下步骤: - -1. **Fork 仓库** - 如果您没有直接对仓库进行更改的权限,您需要将仓库 fork 到您自己的账户中。 -这将创建一个您可以对其进行更改的仓库副本。 - -2. **创建分支(可选)** - 在 fork 的仓库中创建一个新分支,该分支包含您要提出的更改。 -给分支取一个描述性的名称,以指示更改的内容。 - -3. **进行更改** - 进行您想要的更改,提交并将其推送到 fork 的仓库中。 - -4. **创建合并请求** - 转到原始仓库并转到“合并请求”选项卡。单击“新建合并请求”按钮,并将您的新分支选择为源分支。 -为您的合并请求输入描述性标题和描述,然后单击“创建合并请求”。 - -## 评审合并请求 - -创建合并请求后,将触发评审流程。仓库的维护者将收到合并请求的通知,并可以审查所做的更改。 -他们可以留下评论、请求更改或批准更改。 - -如果维护者请求更改,您需要在分支中进行这些更改,并将更改推送到 fork 的仓库中。 -合并请求将自动使用新更改进行更新。 - -如果维护者批准更改,他们可以将合并请求合并到仓库中。 - -## 关闭合并请求 - -如果您不接受该合并请求,您可以关闭它。 -要关闭合并请求,请转到打开的合并请求并单击“关闭合并请求”按钮。这将关闭合并请求并且不会将其合并。 - -## 使用“Work In Progress”标记 - -在合并请求中使用“Work In Progress”标记可以防止合并请求被意外合并。 -要将合并请求标记为“Work In Progress”,您必须在其标题中添加前缀`WIP:`或`[WIP]`(不区分大小写)。 -标记前缀可以在您的`app.ini`文件中进行配置: - -``` -[repository.pull-request] -WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] -``` - -列表的第一个值将用于 helpers 程序。 - -## 合并请求模板 - -有关合并请求模板的更多信息请您移步 : [工单与合并请求模板](usage/issue-pull-request-templates.md) diff --git a/docs/content/usage/push.en-us.md b/docs/content/usage/push.en-us.md deleted file mode 100644 index d88dc1a2a9..0000000000 --- a/docs/content/usage/push.en-us.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -date: "2020-07-06T16:00:00+02:00" -title: "Push" -slug: "push" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /en-us/push-to-create - - /en-us/push-options -menu: - sidebar: - parent: "usage" - name: "Push" - sidebar_position: 15 - identifier: "push" ---- - -There are some additional features when pushing commits to Gitea server. - -# Open PR through Push - -When you push commits to a non-default branch for the first time, -you will receive a link you can click on to visit the compare page of your branch compared to your main branch. -From there, it's easy to create a pull request, even if you want to target another branch. - -![Gitea Push Hint](/gitea-push-hint.png) - -# Push Options - -In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) -were added. - -## Supported Options - -- `repo.private` (true|false) - Change the repository's visibility. - - This is particularly useful when combined with push-to-create. - -- `repo.template` (true|false) - Change whether the repository is a template. - -Example of changing a repository's visibility to public: - -```shell -git push -o repo.private=false -u origin main -``` - -# Push To Create - -Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default. - -## Enabling Push To Create - -In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet](administration/config-cheat-sheet.md#repository-repository). - -## Using Push To Create - -Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command: - -```shell -# Add the remote you want to push to -git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git - -# push to the remote -git push -u origin main -``` - -This assumes you are using an SSH remote, but you can also use HTTPS remotes as well. - -Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. diff --git a/docs/content/usage/push.zh-cn.md b/docs/content/usage/push.zh-cn.md deleted file mode 100644 index f9fd687cc1..0000000000 --- a/docs/content/usage/push.zh-cn.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "推送" -slug: "push" -sidebar_position: 15 -toc: false -draft: false -aliases: - - /zh-cn/push-to-create - - /zh-cn/push-options -menu: - sidebar: - parent: "usage" - name: "推送" - sidebar_position: 15 - identifier: "push" ---- - -在将提交推送到 Gitea 服务器时,还有一些额外的功能。 - -# 通过推送打开 PR - -当您第一次将提交推送到非默认分支时,您将收到一个链接,您可以单击该链接访问分支与主分支的比较页面。 -从那里,您可以轻松创建一个拉取请求,即使您想要将其目标指向另一个分支。 - -![Gitea 推送提示](/gitea-push-hint.png) - -# 推送选项 - -在 Gitea `1.13` 版本中,添加了对一些 [推送选项](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) 的支持。 - -## 支持的选项 - -- `repo.private` (true|false) - 更改仓库的可见性。 - - 这在与 push-to-create 结合使用时特别有用。 - -- `repo.template` (true|false) - 更改仓库是否为模板。 - -将仓库的可见性更改为公开的示例: - -```shell -git push -o repo.private=false -u origin main -``` - -# 推送创建 - -推送创建是一项功能,允许您将提交推送到在 Gitea 中尚不存在的仓库。这对于自动化和允许用户创建仓库而无需通过 Web 界面非常有用。此功能默认处于禁用状态。 - -## 启用推送创建 - -在 `app.ini` 文件中,将 `ENABLE_PUSH_CREATE_USER` 设置为 `true`,如果您希望允许用户在自己的用户帐户和所属的组织中创建仓库,将 `ENABLE_PUSH_CREATE_ORG` 设置为 `true`。重新启动 Gitea 以使更改生效。您可以在 [配置速查表](administration/config-cheat-sheet.md#repository-repository) 中了解有关这两个选项的更多信息。 - -## 使用推送创建 - -假设您在当前目录中有一个 git 仓库,您可以通过运行以下命令将提交推送到在 Gitea 中尚不存在的仓库: - -```shell -# 添加要推送到的远程仓库 -git remote add origin git@{domain}:{username}/{尚不存在的仓库名称}.git - -# 推送到远程仓库 -git push -u origin main -``` - -这假设您使用的是 SSH 远程,但您也可以使用 HTTPS 远程。 - -推送创建将默认使用 `app.ini` 中定义的可见性 `DEFAULT_PUSH_CREATE_PRIVATE`。 diff --git a/docs/content/usage/repo-mirror.en-us.md b/docs/content/usage/repo-mirror.en-us.md deleted file mode 100644 index 8804a8885a..0000000000 --- a/docs/content/usage/repo-mirror.en-us.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -date: "2021-05-13T00:00:00-00:00" -title: "Repository Mirror" -slug: "repo-mirror" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /en-us/repo-mirror -menu: - sidebar: - parent: "usage" - name: "Repository Mirror" - sidebar_position: 45 - identifier: "repo-mirror" ---- - -# Repository Mirror - -Repository mirroring allows for the mirroring of repositories to and from external sources. You can use it to mirror branches, tags, and commits between repositories. - -## Use cases - -The following are some possible use cases for repository mirroring: - -- You migrated to Gitea but still need to keep your project in another source. In that case, you can simply set it up to mirror to Gitea (pull) and all the essential history of commits, tags, and branches are available in your Gitea instance. -- You have old projects in another source that you don’t use actively anymore, but don’t want to remove for archiving purposes. In that case, you can create a push mirror so that your active Gitea repository can push its changes to the old location. - -## Pulling from a remote repository - -For an existing remote repository, you can set up pull mirroring as follows: - -1. Select **New Migration** in the **Create...** menu on the top right. -2. Select the remote repository service. -3. Enter a repository URL. -4. If the repository needs authentication fill in your authentication information. -5. Check the box **This repository will be a mirror**. -6. Select **Migrate repository** to save the configuration. - -The repository now gets mirrored periodically from the remote repository. You can force a sync by selecting **Synchronize Now** in the repository settings. - -:exclamation::exclamation: **NOTE:** You can only set up pull mirroring for repos that don't exist yet on your instance. Once the repo is created, you can't convert it into a pull mirror anymore. :exclamation::exclamation: - -## Pushing to a remote repository - -For an existing repository, you can set up push mirroring as follows: - -1. In your repository, go to **Settings** > **Repository**, and then the **Mirror Settings** section. -2. Enter a repository URL. -3. If the repository needs authentication expand the **Authorization** section and fill in your authentication information. Note that the requested **password** can also be your access token. -4. Select **Add Push Mirror** to save the configuration. - -The repository now gets mirrored periodically to the remote repository. You can force a sync by selecting **Synchronize Now**. In case of an error a message displayed to help you resolve it. - -:exclamation::exclamation: **NOTE:** This will force push to the remote repository. This will overwrite any changes in the remote repository! :exclamation::exclamation: - -### Setting up a push mirror from Gitea to GitHub - -To set up a mirror from Gitea to GitHub, you need to follow these steps: - -1. Create a [GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with the *public_repo* box checked. Also check the **workflow** checkbox in case your repo using act for continuous integration. -2. Create a repository with that name on GitHub. Unlike Gitea, GitHub does not support creating repositories by pushing to the remote. You can also use an existing remote repo if it has the same commit history as your Gitea repo. -3. In the settings of your Gitea repo, fill in the **Git Remote Repository URL**: `https://github.com/<your_github_group>/<your_github_project>.git`. -4. Fill in the **Authorization** fields with your GitHub username and the personal access token as **Password**. -5. (Optional, available on Gitea 1.18+) Select `Sync when new commits are pushed` so that the mirror will be updated as well as soon as there are changes. You can also disable the periodic sync if you like. -6. Select **Add Push Mirror** to save the configuration. - -The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button. - -### Setting up a push mirror from Gitea to GitLab - -To set up a mirror from Gitea to GitLab, you need to follow these steps: - -1. Create a [GitLab personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) with *write_repository* scope. -2. Fill in the **Git Remote Repository URL**: `https://<destination host>/<your_gitlab_group_or_name>/<your_gitlab_project>.git`. -3. Fill in the **Authorization** fields with `oauth2` as **Username** and your GitLab personal access token as **Password**. -4. Select **Add Push Mirror** to save the configuration. - -The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button. - -### Setting up a push mirror from Gitea to Bitbucket - -To set up a mirror from Gitea to Bitbucket, you need to follow these steps: - -1. Create a [Bitbucket app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) with the *Repository Write* box checked. -2. Fill in the **Git Remote Repository URL**: `https://bitbucket.org/<your_bitbucket_group_or_name>/<your_bitbucket_project>.git`. -3. Fill in the **Authorization** fields with your Bitbucket username and the app password as **Password**. -4. Select **Add Push Mirror** to save the configuration. - -The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button. - -### Mirror an existing ssh repository - -Currently gitea supports no ssh push mirrors. You can work around this by adding a `post-receive` hook to your gitea repository that pushes manually. - -1. Make sure the user running gitea has access to the git repo you are trying to mirror to from shell. -2. On the Webinterface at the repository settings > git hooks add a post-receive hook for the mirror. I.e. - -``` -#!/usr/bin/env bash -git push --mirror --quiet git@github.com:username/repository.git &>/dev/null & -echo "GitHub mirror initiated .." -``` diff --git a/docs/content/usage/repo-mirror.zh-cn.md b/docs/content/usage/repo-mirror.zh-cn.md deleted file mode 100644 index b74a1b62ad..0000000000 --- a/docs/content/usage/repo-mirror.zh-cn.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "仓库镜像" -slug: "repo-mirror" -sidebar_position: 45 -toc: false -draft: false -aliases: - - /zh-cn/repo-mirror -menu: - sidebar: - parent: "usage" - name: "仓库镜像" - sidebar_position: 45 - identifier: "repo-mirror" ---- - -# 仓库镜像 - -仓库镜像允许将仓库与外部源之间进行镜像。您可以使用它在仓库之间镜像分支、标签和提交。 - -## 使用场景 - -以下是一些仓库镜像的可能使用场景: - -- 您迁移到了 Gitea,但仍需要在其他源中保留您的项目。在这种情况下,您可以简单地设置它以进行镜像到 Gitea(拉取),这样您的 Gitea 实例中就可以获取到所有必要的提交历史、标签和分支。 -- 您在其他源中有一些旧项目,您不再主动使用,但出于归档目的不想删除。在这种情况下,您可以创建一个推送镜像,以便您的活跃的 Gitea 仓库可以将其更改推送到旧位置。 - -## 从远程仓库拉取 - -对于现有的远程仓库,您可以按照以下步骤设置拉取镜像: - -1. 在右上角的“创建...”菜单中选择“迁移外部仓库”。 -2. 选择远程仓库服务。 -3. 输入仓库的 URL。 -4. 如果仓库需要身份验证,请填写您的身份验证信息。 -5. 选中“该仓库将是一个镜像”复选框。 -6. 选择“迁移仓库”以保存配置。 - -现在,该仓库会定期从远程仓库进行镜像。您可以通过在仓库设置中选择“立即同步”来强制进行同步。 - -:exclamation::exclamation: **注意:**您只能为尚不存在于您的实例上的仓库设置拉取镜像。一旦仓库创建成功,您就无法再将其转换为拉取镜像。:exclamation::exclamation: - -## 推送到远程仓库 - -对于现有的仓库,您可以按照以下步骤设置推送镜像: - -1. 在仓库中,转到**设置** > **仓库**,然后进入**镜像设置**部分。 -2. 输入一个仓库的 URL。 -3. 如果仓库需要身份验证,请展开**授权**部分并填写您的身份验证信息。请注意,所请求的**密码**也可以是您的访问令牌。 -4. 选择**添加推送镜像**以保存配置。 - -该仓库现在会定期镜像到远程仓库。您可以通过选择**立即同步**来强制同步。如果出现错误,会显示一条消息帮助您解决问题。 - -:exclamation::exclamation: **注意:** 这将强制推送到远程仓库。这将覆盖远程仓库中的任何更改! :exclamation::exclamation: - -### 从 Gitea 向 GitHub 设置推送镜像 - -要从 Gitea 设置镜像到 GitHub,您需要按照以下步骤进行操作: - -1. 创建一个具有选中 *public_repo* 选项的 [GitHub 个人访问令牌](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)。 -2. 在 GitHub 上创建一个同名的仓库。与 Gitea 不同,GitHub 不支持通过推送到远程来创建仓库。如果您的现有远程仓库与您的 Gitea 仓库具有相同的提交历史,您也可以使用现有的远程仓库。 -3. 在您的 Gitea 仓库设置中,填写**Git 远程仓库 URL**:`https://github.com/<your_github_group>/<your_github_project>.git`。 -4. 使用您的 GitHub 用户名填写**授权**字段,并将个人访问令牌作为**密码**。 -5. (可选,适用于 Gitea 1.18+)选择`当推送新提交时同步`,这样一旦有更改,镜像将会及时更新。如果您愿意,您还可以禁用定期同步。 -6. 选择**添加推送镜像**以保存配置。 - -仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 - -### 从 Gitea 向 GitLab 设置推送镜像 - -要从 Gitea 设置镜像到 GitLab,您需要按照以下步骤进行操作: - -1. 创建具有 *write_repository* 作用域的 [GitLab 个人访问令牌](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)。 -2. 填写**Git 远程仓库 URL**:`https://<destination host>/<your_gitlab_group_or_name>/<your_gitlab_project>.git`。 -3. 在**授权**字段中填写 `oauth2` 作为**用户名**,并将您的 GitLab 个人访问令牌作为**密码**。 -4. 选择**添加推送镜像**以保存配置。 - -仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 - -### 从 Gitea 向 Bitbucket 设置推送镜像 - -要从 Gitea 设置镜像到 Bitbucket,您需要按照以下步骤进行操作: - -1. 创建一个具有选中 *Repository Write* 选项的 [Bitbucket 应用密码](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/)。 -2. 填写**Git 远程仓库 URL**:`https://bitbucket.org/<your_bitbucket_group_or_name>/<your_bitbucket_project>.git`。 -3. 使用您的 Bitbucket 用户名填写**授权**字段,并将应用密码作为**密码**。 -4. 选择**添加推送镜像**以保存配置。 - -仓库会很快进行推送。要强制推送,请选择**立即同步**按钮。 - -### 镜像现有的 ssh 仓库 - -当前,Gitea 不支持从 ssh 仓库进行镜像。如果您想要镜像一个 ssh 仓库,您需要将其转换为 http 仓库。您可以使用以下命令将现有的 ssh 仓库转换为 http 仓库: - -1. 确保运行 gitea 的用户有权限访问您试图从 shell 镜像到的 git 仓库。 -2. 在 Web 界面的版本库设置 > git 钩子中为镜像添加一个接收后钩子。 - -``` -#!/usr/bin/env bash -git push --mirror --quiet git@github.com:username/repository.git &>/dev/null & -echo "GitHub mirror initiated .." -``` diff --git a/docs/content/usage/secrets.en-us.md b/docs/content/usage/secrets.en-us.md deleted file mode 100644 index 8ad6746614..0000000000 --- a/docs/content/usage/secrets.en-us.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -date: "2022-12-19T21:26:00+08:00" -title: "Secrets" -slug: "secrets" -sidebar_position: 50 -draft: false -toc: false -aliases: - - /en-us/secrets -menu: - sidebar: - parent: "usage" - name: "Secrets" - sidebar_position: 50 - identifier: "usage-secrets" ---- - -# Secrets - -Secrets allow you to store sensitive information in your user, organization or repository. -Secrets are available on Gitea 1.19+ and are only visible in 1.20+ when ACTIONS are enabled. - -# Naming your secrets - -The following rules apply to secret names: - -- Secret names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed. - -- Secret names must not start with the `GITHUB_` and `GITEA_` prefix. - -- Secret names must not start with a number. - -- Secret names are not case-sensitive. - -- Secret names must be unique at the level they are created at. - -For example, a secret created at the repository level must have a unique name in that repository, and a secret created at the organization level must have a unique name at that level. - -If a secret with the same name exists at multiple levels, the secret at the lowest level takes precedence. For example, if an organization-level secret has the same name as a repository-level secret, then the repository-level secret takes precedence. diff --git a/docs/content/usage/secrets.zh-cn.md b/docs/content/usage/secrets.zh-cn.md deleted file mode 100644 index 40e80dc785..0000000000 --- a/docs/content/usage/secrets.zh-cn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "密钥管理" -slug: "secrets" -sidebar_position: 50 -draft: false -toc: false -aliases: - - /zh-cn/secrets -menu: - sidebar: - parent: "usage" - name: "密钥管理" - sidebar_position: 50 - identifier: "usage-secrets" ---- - -# 密钥管理 - -密钥管理允许您在用户、组织或仓库中存储敏感信息。 -密钥管理在 Gitea 1.19+ 版本中可用。 - -# 设置密钥名称 - -以下规则适用于密钥名称: - -- 密钥名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。 - -- 密钥名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。 - -- 密钥名称不能以数字开头。 - -- 密钥名称不区分大小写。 - -- 密钥名称在创建它们的级别上必须是唯一的。 - -例如,对于在仓库级别创建的密钥,它在该仓库中必须具有唯一的名称;对于在组织级别创建的密钥,它在该级别上必须具有唯一的名称。 - -如果在多个级别上存在具有相同名称的密钥,则最低级别的密钥优先生效。例如,如果组织级别的密钥与仓库级别的密钥具有相同的名称,则仓库级别的密钥将优先生效。 diff --git a/docs/content/usage/template-repositories.en-us.md b/docs/content/usage/template-repositories.en-us.md deleted file mode 100644 index e57ed85cc9..0000000000 --- a/docs/content/usage/template-repositories.en-us.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -date: "2019-11-28:00:00+02:00" -title: "Template Repositories" -slug: "template-repositories" -sidebar_position: 14 -toc: false -draft: false -aliases: - - /en-us/template-repositories -menu: - sidebar: - parent: "usage" - name: "Template Repositories" - sidebar_position: 14 - identifier: "template-repositories" ---- - -# Template Repositories - -Gitea (starting with version `1.11.0`) supports creating template repositories -which can be used to generate repositories based on the template, complete with -variable expansion of certain pre-defined variables. - -All files in the template repository are included in a generated repository from the -template except for the `.gitea/template` file. The `.gitea/template` file tells -Gitea which files are subject to the variable expansion when creating a -repository from the template. - -Gitea uses [gobwas/glob](https://github.com/gobwas/glob) for its glob syntax. It closely resembles a traditional `.gitignore`, however there may be slight differences. - -## Example `.gitea/template` file - -All paths are relative to the base of the repository - -```gitignore -# Expand all .go files, anywhere in the repository -**.go - -# All text files in the text directory -text/*.txt - -# A specific file -a/b/c/d.json - -# Batch files in both upper or lower case can be matched -**.[bB][aA][tT] -``` - -## Variable Expansion - -In any file matched by the above globs, certain variables will be expanded. - -Matching filenames and paths can also be expanded, and are conservatively sanitized to support cross-platform filesystems. - -All variables must be of the form `$VAR` or `${VAR}`. To escape an expansion, use a double `$$`, such as `$$VAR` or `$${VAR}` - -| Variable | Expands To | Transformable | -| -------------------- | --------------------------------------------------- | ------------- | -| REPO_NAME | The name of the generated repository | ✓ | -| TEMPLATE_NAME | The name of the template repository | ✓ | -| REPO_DESCRIPTION | The description of the generated repository | ✘ | -| TEMPLATE_DESCRIPTION | The description of the template repository | ✘ | -| REPO_OWNER | The owner of the generated repository | ✓ | -| TEMPLATE_OWNER | The owner of the template repository | ✓ | -| REPO_LINK | The URL to the generated repository | ✘ | -| TEMPLATE_LINK | The URL to the template repository | ✘ | -| REPO_HTTPS_URL | The HTTP(S) clone link for the generated repository | ✘ | -| TEMPLATE_HTTPS_URL | The HTTP(S) clone link for the template repository | ✘ | -| REPO_SSH_URL | The SSH clone link for the generated repository | ✘ | -| TEMPLATE_SSH_URL | The SSH clone link for the template repository | ✘ | - -## Transformers :robot: - -Gitea `1.12.0` adds a few transformers to some of the applicable variables above. - -For example, to get `REPO_NAME` in `PASCAL`-case, your template would use `${REPO_NAME_PASCAL}` - -Feeding `go-sdk` to the available transformers yields... - -| Transformer | Effect | -| ----------- | ------ | -| SNAKE | go_sdk | -| KEBAB | go-sdk | -| CAMEL | goSdk | -| PASCAL | GoSdk | -| LOWER | go-sdk | -| UPPER | GO-SDK | -| TITLE | Go-Sdk | diff --git a/docs/content/usage/template-repositories.zh-cn.md b/docs/content/usage/template-repositories.zh-cn.md deleted file mode 100644 index 885b2f4ec8..0000000000 --- a/docs/content/usage/template-repositories.zh-cn.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -date: "2023-05-23T09:00:00+08:00" -title: "模板仓库" -slug: "template-repositories" -sidebar_position: 14 -toc: false -draft: false -aliases: - - /zh-cn/template-repositories -menu: - sidebar: - parent: "usage" - name: "模板仓库" - sidebar_position: 14 - identifier: "template-repositories" ---- - -# 模板仓库 - -Gitea `1.11.0` 及以上版本引入了模板仓库,并且其中一个实现的功能是自动展开模板文件中的特定变量。 - -要告诉 Gitea 哪些文件需要展开,您必须在模板仓库的 `.gitea` 目录中包含一个 `template` 文件。 - -Gitea 使用 [gobwas/glob](https://github.com/gobwas/glob) 作为其 glob 语法。它与传统的 `.gitignore` 语法非常相似,但可能存在细微的差异。 - -## `.gitea/template` 文件示例 - -所有路径都是相对于仓库的根目录 - -```gitignore -# 仓库中的所有 .go 文件 -**.go - -# text 目录中的所有文本文件 -text/*.txt - -# 特定文件 -a/b/c/d.json - -# 匹配批处理文件的大小写变体 -**.[bB][aA][tT] -``` - -**注意:** 当从模板生成仓库时,`.gitea` 目录中的 `template` 文件将被删除。 - -## 参数展开 - -在与上述通配符匹配的任何文件中,将会扩展某些变量。 - -文件名和路径的匹配也可以被扩展,并且会经过谨慎的清理处理,以支持跨平台的文件系统。 - -所有变量都必须采用`$VAR`或`${VAR}`的形式。要转义扩展,使用双重`$$`,例如`$$VAR`或`$${VAR}`。 - -| 变量 | 扩展为 | 可转换 | -| -------------------- | --------------------------------------------------- | ------------- | -| REPO_NAME | 生成的仓库名称 | ✓ | -| TEMPLATE_NAME | 模板仓库名称 | ✓ | -| REPO_DESCRIPTION | 生成的仓库描述 | ✘ | -| TEMPLATE_DESCRIPTION | 模板仓库描述 | ✘ | -| REPO_OWNER | 生成的仓库所有者 | ✓ | -| TEMPLATE_OWNER | 模板仓库所有者 | ✓ | -| REPO_LINK | 生成的仓库链接 | ✘ | -| TEMPLATE_LINK | 模板仓库链接 | ✘ | -| REPO_HTTPS_URL | 生成的仓库的 HTTP(S) 克隆链接 | ✘ | -| TEMPLATE_HTTPS_URL | 模板仓库的 HTTP(S) 克隆链接 | ✘ | -| REPO_SSH_URL | 生成的仓库的 SSH 克隆链接 | ✘ | -| TEMPLATE_SSH_URL | 模板仓库的 SSH 克隆链接 | ✘ | - -## 转换器 :robot: - -Gitea `1.12.0` 添加了一些转换器以应用于上述适用的变量。 - -例如,要以 `PASCAL`-case 获取 `REPO_NAME`,你的模板应使用 `${REPO_NAME_PASCAL}` - -将 `go-sdk` 传递给可用的转换器的效果如下... - -| 转换器 | 效果 | -| ----------- | ------------ | -| SNAKE | go_sdk | -| KEBAB | go-sdk | -| CAMEL | goSdk | -| PASCAL | GoSdk | -| LOWER | go-sdk | -| UPPER | GO-SDK | -| TITLE | Go-Sdk | diff --git a/docs/content/usage/webhooks.en-us.md b/docs/content/usage/webhooks.en-us.md deleted file mode 100644 index 684911f83a..0000000000 --- a/docs/content/usage/webhooks.en-us.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Webhooks" -slug: "webhooks" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /en-us/webhooks -menu: - sidebar: - parent: "usage" - name: "Webhooks" - sidebar_position: 30 - identifier: "webhooks" ---- - -# Webhooks - -Gitea supports webhooks for repository events. This can be configured in the settings -page `/:username/:reponame/settings/hooks` by a repository admin. Webhooks can also be configured on a per-organization and whole system basis. -All event pushes are POST requests. The methods currently supported are: - -- Gitea (can also be a GET request) -- Gogs -- Slack -- Discord -- Dingtalk -- Telegram -- Microsoft Teams -- Feishu -- Wechatwork -- Packagist - -### Event information - -**WARNING**: The `secret` field in the payload is deprecated as of Gitea 1.13.0 and will be removed in 1.14.0: https://github.com/go-gitea/gitea/issues/11755 - -The following is an example of event information that will be sent by Gitea to -a Payload URL: - -``` -X-GitHub-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-GitHub-Event: push -X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gogs-Event: push -X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gitea-Event: push -``` - -```json -{ - "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3", - "ref": "refs/heads/develop", - "before": "28e1879d029cb852e4844d9c718537df08844e03", - "after": "bffeb74224043ba2feb48d137756c8a9331c449a", - "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a", - "commits": [ - { - "id": "bffeb74224043ba2feb48d137756c8a9331c449a", - "message": "Webhooks Yay!", - "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a", - "author": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "committer": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "timestamp": "2017-03-13T13:52:11-04:00" - } - ], - "repository": { - "id": 140, - "owner": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "name": "webhooks", - "full_name": "gitea/webhooks", - "description": "", - "private": false, - "fork": false, - "html_url": "http://localhost:3000/gitea/webhooks", - "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git", - "clone_url": "http://localhost:3000/gitea/webhooks.git", - "website": "", - "stars_count": 0, - "forks_count": 1, - "watchers_count": 1, - "open_issues_count": 7, - "default_branch": "master", - "created_at": "2017-02-26T04:29:06-05:00", - "updated_at": "2017-03-13T13:51:58-04:00" - }, - "pusher": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "sender": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - } -} -``` - -### Example - -This is an example of how to use webhooks to run a php script upon push requests to the repository. -In your repository Settings, under Webhooks, Setup a Gitea webhook as follows: - -- Target URL: http://mydomain.com/webhook.php -- HTTP Method: POST -- POST Content Type: application/json -- Secret: 123 -- Trigger On: Push Events -- Active: Checked - -Now on your server create the php file webhook.php - -``` -<?php - -$secret_key = '123'; - -// check for POST request -if ($_SERVER['REQUEST_METHOD'] != 'POST') { - error_log('FAILED - not POST - '. $_SERVER['REQUEST_METHOD']); - exit(); -} - -// get content type -$content_type = isset($_SERVER['CONTENT_TYPE']) ? strtolower(trim($_SERVER['CONTENT_TYPE'])) : ''; - -if ($content_type != 'application/json') { - error_log('FAILED - not application/json - '. $content_type); - exit(); -} - -// get payload -$payload = trim(file_get_contents("php://input")); - -if (empty($payload)) { - error_log('FAILED - no payload'); - exit(); -} - -// get header signature -$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : ''; - -if (empty($header_signature)) { - error_log('FAILED - header signature missing'); - exit(); -} - -// calculate payload signature -$payload_signature = hash_hmac('sha256', $payload, $secret_key, false); - -// check payload signature against header signature -if ($header_signature !== $payload_signature) { - error_log('FAILED - payload signature'); - exit(); -} - -// convert json to array -$decoded = json_decode($payload, true); - -// check for json decode errors -if (json_last_error() !== JSON_ERROR_NONE) { - error_log('FAILED - json decode - '. json_last_error()); - exit(); -} - -// success, do something -``` - -There is a Test Delivery button in the webhook settings that allows to test the configuration as well as a list of the most Recent Deliveries. - -### Authorization header - -**With 1.19**, Gitea hooks can be configured to send an [authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) to the webhook target. diff --git a/docs/content/usage/webhooks.zh-cn.md b/docs/content/usage/webhooks.zh-cn.md deleted file mode 100644 index dfc709940e..0000000000 --- a/docs/content/usage/webhooks.zh-cn.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -date: "2016-12-01T16:00:00+02:00" -title: "Webhooks" -slug: "webhooks" -sidebar_position: 30 -toc: false -draft: false -aliases: - - /zh-cn/webhooks -menu: - sidebar: - parent: "usage" - name: "Webhooks" - sidebar_position: 30 - identifier: "webhooks" ---- - -# Webhooks - -Gitea支持用于仓库事件的Webhooks。这可以在仓库管理员在设置页面 `/:username/:reponame/settings/hooks` 中进行配置。Webhooks还可以基于组织和整个系统进行配置。 -所有事件推送都是 POST 请求。目前支持: - -- Gitea (也可以是 GET 请求) -- Gogs -- Slack -- Discord -- Dingtalk(钉钉) -- Telegram -- Microsoft Teams -- Feishu -- Wechatwork(企业微信) -- Packagist - -### 事件信息 - -**警告**:自 Gitea 1.13.0 版起,payload 中的 `secret` 字段已被弃用,并将在 1.14.0 版中移除:https://github.com/go-gitea/gitea/issues/11755 - -以下是 Gitea 将发送给 payload URL的事件信息示例: - -``` -X-GitHub-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-GitHub-Event: push -X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gogs-Event: push -X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 -X-Gitea-Event: push -``` - -```json -{ - "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3", - "ref": "refs/heads/develop", - "before": "28e1879d029cb852e4844d9c718537df08844e03", - "after": "bffeb74224043ba2feb48d137756c8a9331c449a", - "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a", - "commits": [ - { - "id": "bffeb74224043ba2feb48d137756c8a9331c449a", - "message": "Webhooks Yay!", - "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a", - "author": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "committer": { - "name": "Gitea", - "email": "someone@gitea.io", - "username": "gitea" - }, - "timestamp": "2017-03-13T13:52:11-04:00" - } - ], - "repository": { - "id": 140, - "owner": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "name": "webhooks", - "full_name": "gitea/webhooks", - "description": "", - "private": false, - "fork": false, - "html_url": "http://localhost:3000/gitea/webhooks", - "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git", - "clone_url": "http://localhost:3000/gitea/webhooks.git", - "website": "", - "stars_count": 0, - "forks_count": 1, - "watchers_count": 1, - "open_issues_count": 7, - "default_branch": "master", - "created_at": "2017-02-26T04:29:06-05:00", - "updated_at": "2017-03-13T13:51:58-04:00" - }, - "pusher": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - }, - "sender": { - "id": 1, - "login": "gitea", - "full_name": "Gitea", - "email": "someone@gitea.io", - "avatar_url": "https://localhost:3000/avatars/1", - "username": "gitea" - } -} -``` - -### 示例 - -这是一个示例,演示如何使用 Webhooks 在推送请求到达仓库时运行一个 php 脚本。 -在你的仓库设置中,在 Webhooks 下,设置一个如下的 Gitea webhook: - -- 目标 URL:http://mydomain.com/webhook.php -- HTTP 方法:POST -- POST Content Type:application/json -- Secret:123 -- 触发条件:推送事件 -- 激活:勾选 - -现在在你的服务器上创建 php 文件 webhook.php。 - -``` -<?php - -$secret_key = '123'; - -// check for POST request -if ($_SERVER['REQUEST_METHOD'] != 'POST') { - error_log('FAILED - not POST - '. $_SERVER['REQUEST_METHOD']); - exit(); -} - -// get content type -$content_type = isset($_SERVER['CONTENT_TYPE']) ? strtolower(trim($_SERVER['CONTENT_TYPE'])) : ''; - -if ($content_type != 'application/json') { - error_log('FAILED - not application/json - '. $content_type); - exit(); -} - -// get payload -$payload = trim(file_get_contents("php://input")); - -if (empty($payload)) { - error_log('FAILED - no payload'); - exit(); -} - -// get header signature -$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : ''; - -if (empty($header_signature)) { - error_log('FAILED - header signature missing'); - exit(); -} - -// calculate payload signature -$payload_signature = hash_hmac('sha256', $payload, $secret_key, false); - -// check payload signature against header signature -if ($header_signature !== $payload_signature) { - error_log('FAILED - payload signature'); - exit(); -} - -// convert json to array -$decoded = json_decode($payload, true); - -// check for json decode errors -if (json_last_error() !== JSON_ERROR_NONE) { - error_log('FAILED - json decode - '. json_last_error()); - exit(); -} - -// success, do something -``` - -在 Webhook 设置中有一个“测试推送(Test Delivery)”按钮,可以测试配置,还有一个“最近推送记录(Recent Deliveries)”的列表。 - -### 授权头(Authorization header) - -**从1.19版本开始**,Gitea 的 Webhook 可以配置为向 Webhook 目标发送一个 [授权头(authorization header)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)。 diff --git a/docs/static/authorize.png b/docs/static/authorize.png Binary files differdeleted file mode 100644 index 7556b1220c..0000000000 --- a/docs/static/authorize.png +++ /dev/null diff --git a/docs/static/cloudron.svg b/docs/static/cloudron.svg deleted file mode 100644 index 716f67a165..0000000000 --- a/docs/static/cloudron.svg +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="155" height="37" id="svg4152" version="1.1" inkscape:version="0.91 r13725" viewBox="0 0 155 37" sodipodi:docname="button.svg" inkscape:export-filename="/home/nebulon/Cloudron/Assets/button_64.png" inkscape:export-xdpi="155.6129" inkscape:export-ydpi="155.6129"> - <defs id="defs4154"/> - <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="1" inkscape:pageshadow="2" inkscape:zoom="3.6203867" inkscape:cx="121.3823" inkscape:cy="1.1988893" inkscape:current-layer="g4481" showgrid="true" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:window-width="1280" inkscape:window-height="736" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" showguides="false"/> - <metadata id="metadata4157"> - <rdf:RDF> - <cc:Work rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> - <dc:title/> - </cc:Work> - </rdf:RDF> - </metadata> - <g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer" transform="translate(0,-27)"> - <g id="g5138"> - <rect inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" ry="3.2883968" y="27.493248" x="0.49324799" height="36.013504" width="154.0135" id="rect4424" style="opacity:1;fill:none;fill-opacity:1;stroke:#03a9f4;stroke-width:0.98649561;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/> - <g transform="translate(-17.67767,3.2702403)" id="g4467"> - <g id="g4382" transform="matrix(0.59473169,0,0,0.59473169,31.04719,102.48374)" inkscape:export-xdpi="67.349998" inkscape:export-ydpi="67.349998"> - <g id="g4496"> - <path inkscape:export-ydpi="67.349998" inkscape:export-xdpi="67.349998" transform="matrix(0.8660254,-0.49999999,0.49999999,0.8660254,51.102849,-7.8015133)" d="m 29.166669,-109.50348 c 1.200386,2.08567 1.17988,17.183595 -0.02617,19.265993 -1.206046,2.082397 -14.291486,9.613601 -16.697919,9.610333 -2.406432,-0.0033 -15.4713664,-7.56999 -16.671752,-9.655655 -1.2003857,-2.085666 -1.1798799,-17.183591 0.026167,-19.265991 1.2060467,-2.0824 14.2914862,-9.6136 16.6979192,-9.61033 2.406432,0.003 15.471366,7.56999 16.671752,9.65565 z" inkscape:randomized="0" inkscape:rounded="0.12490573" inkscape:flatsided="true" sodipodi:arg2="0.0013581913" sodipodi:arg1="-0.52224059" sodipodi:r2="16.307295" sodipodi:r1="19.266006" sodipodi:cy="-99.893143" sodipodi:cx="12.46875" sodipodi:sides="6" id="path4162" style="opacity:1;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1.10000002;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" sodipodi:type="star"/> - <rect style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4168-1-1" width="8.7434387" height="8.7434387" x="2.2207832" y="-104.9176" ry="2.4183984" inkscape:transform-center-x="0.40624986"/> - <g id="g4491" transform="translate(0,0.14463441)"> - <rect ry="2.4183986" y="-98.734459" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/> - <rect ry="2.4183986" y="-111.39002" x="9.0890703" height="8.7434387" width="8.7434387" id="rect4168-1-1-7-2" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.29999995;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/> - </g> - </g> - </g> - </g> - <g style="fill:#03a9f4;fill-opacity:1" transform="translate(0,-12.132814)" id="g4481"> - <g style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4135"> - <path d="m 41.656508,62.625017 c -2.555847,0 -3.639656,-1.261747 -3.639656,-4.173473 0,-2.927901 1.083809,-4.173472 3.639656,-4.173472 1.16469,0 2.216146,0.274996 3.122016,0.679402 l 0,-1.391157 c -0.970575,-0.38823 -2.07056,-0.64705 -3.299955,-0.64705 -2.280851,0 -5.014637,0.954399 -5.014637,5.532277 0,4.577879 2.733786,5.532278 5.014637,5.532278 1.229395,0 2.32938,-0.25882 3.299955,-0.64705 l 0,-1.391157 c -0.90587,0.404406 -1.957326,0.679402 -3.122016,0.679402 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4149"/> - <path d="m 47.031573,52.708976 0,11.145436 1.488215,0 0,-11.145436 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4151"/> - <path d="m 54.478208,55.669229 c -1.730858,0 -3.801418,0.727932 -3.801418,4.157297 0,3.429365 2.07056,4.157296 3.801418,4.157296 1.730859,0 3.801419,-0.727931 3.801419,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801419,-4.157297 z m 0,7.004317 c -1.213218,0 -2.313203,-0.339701 -2.313203,-2.84702 0,-2.507319 1.099985,-2.84702 2.313203,-2.84702 1.213219,0 2.313204,0.339701 2.313204,2.84702 0,2.507319 -1.099985,2.84702 -2.313204,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4153"/> - <path d="m 65.458345,55.782463 0,4.78817 c 0,1.472039 -0.598521,2.119089 -1.924974,2.119089 -1.342629,0 -1.94115,-0.64705 -1.94115,-2.119089 l 0,-4.78817 -1.472039,0 0,4.674936 c 0,2.248499 1.245572,3.542599 3.413189,3.542599 2.167618,0 3.413189,-1.2941 3.413189,-3.542599 l 0,-4.674936 -1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4155"/> - <path d="m 69.133133,59.713292 c 0,3.720538 2.232322,4.27053 3.574951,4.27053 3.089664,0 3.332308,-2.005855 3.332308,-2.620552 l 0,-8.654294 -1.472039,0 0,3.186721 c -0.566169,-0.161763 -1.132338,-0.242644 -1.730859,-0.242644 -1.68233,0 -3.704361,0.711755 -3.704361,4.060239 z m 1.472039,0 c 0,-2.410261 1.083808,-2.749963 2.232322,-2.749963 0.598521,0 1.180866,0.113234 1.730859,0.339702 l 0,4.157296 c 0,0.808813 -0.630874,1.213219 -1.860269,1.213219 -0.986751,0 -2.102912,-0.339701 -2.102912,-2.960254 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4157"/> - <path d="m 79.727313,57.351559 c 0.630874,-0.161762 1.488215,-0.323525 2.442614,-0.339701 l 0,-1.358805 c -2.167618,0 -3.849948,0.77646 -3.930829,0.808813 l 0,7.392546 1.488215,0 0,-6.502853 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4159"/> - <path d="m 86.957085,55.669229 c -1.730859,0 -3.801419,0.727932 -3.801419,4.157297 0,3.429365 2.07056,4.157296 3.801419,4.157296 1.730858,0 3.801418,-0.727931 3.801418,-4.157296 0,-3.429365 -2.07056,-4.157297 -3.801418,-4.157297 z m 0,7.004317 c -1.213219,0 -2.313204,-0.339701 -2.313204,-2.84702 0,-2.507319 1.099985,-2.84702 2.313204,-2.84702 1.213218,0 2.313203,0.339701 2.313203,2.84702 0,2.507319 -1.099985,2.84702 -2.313203,2.84702 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4161"/> - <path d="m 94.118867,63.854412 0,-6.551381 c 0.501464,-0.161763 1.16469,-0.291173 1.892621,-0.291173 1.617625,0 1.827916,0.77646 1.827916,1.536744 l 0,5.30581 1.488215,0 0,-5.208753 c 0,-1.876445 -1.213218,-3.008782 -3.251426,-3.008782 -1.892621,0 -3.380836,0.808812 -3.445541,0.841165 l 0,7.37637 1.488215,0 z" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16.17625046px;line-height:100%;font-family:'Maven Pro';-inkscape-font-specification:'Maven Pro, Medium';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4163"/> - </g> - <g style="font-style:normal;font-weight:normal;font-size:32.19625854px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#03a9f4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="text4477"> - <path d="m 105.24414,53.529928 0,-1.351991 1.41487,0 0,1.351991 -1.41487,0 z m 0,10.312865 0,-8.504969 1.41487,0 0,8.504969 -1.41487,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4156"/> - <path d="m 114.23645,63.842793 0,-5.392245 q 0,-0.841064 -0.16507,-1.304829 -0.16507,-0.463764 -0.52665,-0.668135 -0.36158,-0.204371 -1.06115,-0.204371 -1.02186,0 -1.61139,0.699577 -0.58953,0.699577 -0.58953,1.941523 l 0,4.92848 -1.41487,0 0,-6.689213 q 0,-1.485619 -0.0472,-1.815756 l 1.33628,0 q 0.008,0.0393 0.0157,0.212231 0.008,0.172929 0.0157,0.400881 0.0157,0.220092 0.0314,0.841065 l 0.0236,0 q 0.48735,-0.880367 1.12404,-1.241946 0.64455,-0.369439 1.59566,-0.369439 1.39916,0 2.04371,0.699576 0.65242,0.691717 0.65242,2.295242 l 0,5.667359 -1.42274,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4158"/> - <path d="m 124.17987,61.492529 q 0,1.202643 -0.9118,1.855057 -0.90395,0.652415 -2.53892,0.652415 -1.5878,0 -2.45245,-0.518788 -0.85678,-0.526647 -1.11618,-1.634966 l 1.24981,-0.243673 q 0.18079,0.683856 0.74674,1.006133 0.56595,0.314417 1.57208,0.314417 1.07688,0 1.57209,-0.330137 0.50306,-0.330138 0.50306,-0.990413 0,-0.503066 -0.34586,-0.817483 -0.34585,-0.314416 -1.11618,-0.518787 l -1.01399,-0.267254 q -1.21836,-0.314417 -1.73715,-0.613113 -0.51093,-0.306556 -0.80176,-0.738879 -0.29084,-0.432322 -0.29084,-1.061156 0,-1.163341 0.82535,-1.768593 0.8332,-0.613112 2.421,-0.613112 1.40702,0 2.23236,0.495206 0.83321,0.495206 1.0533,1.587804 l -1.27339,0.157208 q -0.11791,-0.56595 -0.63669,-0.864646 -0.51093,-0.306556 -1.37558,-0.306556 -0.95897,0 -1.41487,0.290836 -0.45591,0.290835 -0.45591,0.880366 0,0.361579 0.18865,0.597391 0.18865,0.235813 0.55809,0.400882 0.36944,0.165068 1.55637,0.455904 1.12404,0.282975 1.61924,0.526647 0.49521,0.235813 0.77818,0.526648 0.29084,0.290836 0.44805,0.675996 0.1572,0.3773 0.1572,0.864646 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4160"/> - <path d="m 129.11621,63.779909 q -0.69957,0.18865 -1.43059,0.18865 -1.69785,0 -1.69785,-1.925801 l 0,-5.67522 -0.98255,0 0,-1.029714 1.03757,0 0.4166,-1.902221 0.94325,0 0,1.902221 1.57209,0 0,1.029714 -1.57209,0 0,5.368663 q 0,0.613113 0.19651,0.864646 0.20438,0.243673 0.69958,0.243673 0.28298,0 0.81748,-0.110046 l 0,1.045435 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4164"/> - <path d="m 132.48047,64.000001 q -1.28124,0 -1.9258,-0.675996 -0.64455,-0.675996 -0.64455,-1.855058 0,-1.320549 0.86464,-2.027987 0.87251,-0.707437 2.80617,-0.7546 l 1.91008,-0.03144 0,-0.463765 q 0,-1.037574 -0.44018,-1.485618 -0.44018,-0.448044 -1.38343,-0.448044 -0.95111,0 -1.38344,0.322277 -0.43232,0.322277 -0.51878,1.029715 l -1.47776,-0.133627 q 0.36158,-2.295241 3.41142,-2.295241 1.60352,0 2.41314,0.738879 0.80963,0.731018 0.80963,2.122311 l 0,3.662954 q 0,0.628833 0.16507,0.95111 0.16506,0.314416 0.62883,0.314416 0.20437,0 0.46376,-0.05502 l 0,0.880366 q -0.5345,0.125767 -1.09259,0.125767 -0.78605,0 -1.14762,-0.408742 -0.35372,-0.416602 -0.40089,-1.296968 l -0.0472,0 q -0.54237,0.974691 -1.26553,1.383433 -0.71529,0.400881 -1.74501,0.400881 z m 0.32228,-1.061156 q 0.77818,0 1.38343,-0.353719 0.60525,-0.353718 0.95111,-0.966831 0.35372,-0.620973 0.35372,-1.273387 l 0,-0.699577 -1.5485,0.03144 q -0.99827,0.01572 -1.51706,0.204371 -0.51093,0.188649 -0.78604,0.58167 -0.27512,0.393021 -0.27512,1.029715 0,0.691716 0.36944,1.069016 0.3773,0.3773 1.06902,0.3773 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4166"/> - <path d="m 139.27187,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4168"/> - <path d="m 142.85622,63.842793 0,-11.664856 1.41488,0 0,11.664856 -1.41488,0 z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.09812927px;line-height:125%;font-family:Arimo;-inkscape-font-specification:'Arimo, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#03a9f4;fill-opacity:1" id="path4170"/> - </g> - </g> - </g> - </g> -</svg>
\ No newline at end of file diff --git a/docs/static/gitea-push-hint.png b/docs/static/gitea-push-hint.png Binary files differdeleted file mode 100644 index 6f3ab3c606..0000000000 --- a/docs/static/gitea-push-hint.png +++ /dev/null diff --git a/docs/static/images/usage/actions/enable-actions.png b/docs/static/images/usage/actions/enable-actions.png Binary files differdeleted file mode 100644 index 8e38bd9a8d..0000000000 --- a/docs/static/images/usage/actions/enable-actions.png +++ /dev/null diff --git a/docs/static/images/usage/actions/labels.png b/docs/static/images/usage/actions/labels.png Binary files differdeleted file mode 100644 index d6e847950b..0000000000 --- a/docs/static/images/usage/actions/labels.png +++ /dev/null diff --git a/docs/static/images/usage/actions/network.png b/docs/static/images/usage/actions/network.png Binary files differdeleted file mode 100644 index afaa5ddd3d..0000000000 --- a/docs/static/images/usage/actions/network.png +++ /dev/null diff --git a/docs/static/images/usage/actions/register-runner.png b/docs/static/images/usage/actions/register-runner.png Binary files differdeleted file mode 100644 index a260e44f48..0000000000 --- a/docs/static/images/usage/actions/register-runner.png +++ /dev/null diff --git a/docs/static/images/usage/actions/view-job.png b/docs/static/images/usage/actions/view-job.png Binary files differdeleted file mode 100644 index 493869969b..0000000000 --- a/docs/static/images/usage/actions/view-job.png +++ /dev/null diff --git a/docs/static/images/usage/actions/view-runner.png b/docs/static/images/usage/actions/view-runner.png Binary files differdeleted file mode 100644 index f25d2643f7..0000000000 --- a/docs/static/images/usage/actions/view-runner.png +++ /dev/null diff --git a/docs/static/images/usage/profile-readme.png b/docs/static/images/usage/profile-readme.png Binary files differdeleted file mode 100644 index f8043ad02a..0000000000 --- a/docs/static/images/usage/profile-readme.png +++ /dev/null diff --git a/docs/static/octicon-versions.svg b/docs/static/octicon-versions.svg deleted file mode 100644 index aaf5f9cc2b..0000000000 --- a/docs/static/octicon-versions.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M7.75 14A1.75 1.75 0 0 1 6 12.25v-8.5C6 2.784 6.784 2 7.75 2h6.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14Zm-.25-1.75c0 .138.112.25.25.25h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25h-6.5a.25.25 0 0 0-.25.25ZM4.9 3.508a.75.75 0 0 1-.274 1.025.249.249 0 0 0-.126.217v6.5c0 .09.048.173.126.217a.75.75 0 0 1-.752 1.298A1.75 1.75 0 0 1 3 11.25v-6.5c0-.649.353-1.214.874-1.516a.75.75 0 0 1 1.025.274ZM1.625 5.533h.001a.249.249 0 0 0-.126.217v4.5c0 .09.048.173.126.217a.75.75 0 0 1-.752 1.298A1.748 1.748 0 0 1 0 10.25v-4.5a1.748 1.748 0 0 1 .873-1.516.75.75 0 1 1 .752 1.299Z"></path></svg>
\ No newline at end of file diff --git a/docs/static/open-in-gitpod.svg b/docs/static/open-in-gitpod.svg deleted file mode 100644 index b97cd29487..0000000000 --- a/docs/static/open-in-gitpod.svg +++ /dev/null @@ -1,23 +0,0 @@ -<svg width="160" height="45" fill="none" xmlns="http://www.w3.org/2000/svg"> - <g filter="url(#filter0_d)"> - <rect x="2" y="2" width="156" height="40" rx="16" fill="#F9F9F9"/> - <path fill-rule="evenodd" clip-rule="evenodd" d="M30.425 11.174c.604 1.114.233 2.53-.83 3.164l-6.986 4.166a.378.378 0 00-.18.325v6.748c0 .134.069.258.18.325l5.714 3.407c.11.066.244.066.354 0l5.714-3.407a.378.378 0 00.18-.325V21.29l-4.986 2.936c-1.067.628-2.416.231-3.015-.886-.6-1.118-.22-2.532.846-3.16l7.008-4.127c2.048-1.206 4.576.345 4.576 2.806v6.718c0 1.803-.924 3.467-2.42 4.36l-5.713 3.407a4.596 4.596 0 01-4.734 0l-5.714-3.408C18.924 29.044 18 27.38 18 25.576V18.83c0-1.803.924-3.467 2.42-4.36l6.985-4.165c1.063-.634 2.415-.245 3.02.87z" fill="url(#paint0_linear)"/> - <path fill="#F9F9F9" d="M47 12.5h95v-1H47z"/> - <path d="M52.538 27.752c2.744 0 4.844-1.876 4.844-5.152 0-3.108-2.1-5.152-4.844-5.152s-4.802 2.002-4.802 5.152c0 3.29 2.058 5.152 4.802 5.152zm0-1.554c-1.736 0-2.912-1.316-2.912-3.598 0-2.226 1.162-3.598 2.912-3.598s2.954 1.4 2.954 3.598c0 2.31-1.218 3.598-2.954 3.598zm7.89 4.158V27.22c0-.196-.013-.378-.055-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308H58.72v9.688h1.708zm1.695-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.866 1.344c1.848 0 3.052-1.078 3.192-2.478h-1.736c-.112.714-.714 1.134-1.456 1.134-1.036 0-1.722-.826-1.736-1.904h4.97v-.378c0-2.226-1.204-3.682-3.29-3.682-1.988 0-3.43 1.47-3.43 3.626 0 2.366 1.442 3.682 3.486 3.682zm-1.75-4.48c.098-.896.756-1.554 1.68-1.554.924 0 1.526.63 1.554 1.554H68.24zm8.006 4.228v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm8.911-7.868h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm5.097 6.832v-4.004c0-.952.616-1.694 1.456-1.694.798 0 1.288.63 1.288 1.638v4.06h1.708v-4.312c0-1.68-.896-2.744-2.408-2.744-1.078 0-1.722.518-2.1 1.204.042-.266.056-.476.056-.672v-.308h-1.708V27.5h1.708zm13.238.252c1.526 0 2.52-.658 2.982-1.54-.07.322-.098.644-.098.98v.308h1.68v-5.222h-4.34v1.554h2.66v.07c0 1.4-1.134 2.296-2.59 2.296-1.792 0-3.024-1.372-3.024-3.598s1.26-3.598 3.066-3.598c1.302 0 2.17.756 2.296 1.736h1.89c-.182-1.904-1.764-3.29-4.214-3.29-2.954 0-4.928 2.128-4.928 5.152 0 3.136 1.848 5.152 4.62 5.152zm6.063-8.12h1.792V17.84h-1.792v1.792zm.042 1.036V27.5h1.708v-6.832h-1.708zm6.413 6.958c.434 0 .84-.07 1.008-.126v-1.288c-.168.028-.35.042-.518.042-.728 0-1.008-.42-1.008-1.134v-3.094h1.68v-1.358h-1.68v-2.464h-1.708v2.464h-1.554v1.358h1.554v3.346c0 1.526.77 2.254 2.226 2.254zm3.961 2.73V27.22c0-.196-.014-.378-.056-.658.434.7 1.022 1.19 2.17 1.19 1.736 0 3.066-1.414 3.066-3.626 0-2.17-1.19-3.682-2.996-3.682-1.078 0-1.806.476-2.24 1.204.042-.28.056-.462.056-.672v-.308h-1.708v9.688h1.708zm1.694-3.948c-1.036 0-1.764-.938-1.764-2.31 0-1.414.742-2.296 1.764-2.296 1.092 0 1.75.952 1.75 2.296 0 1.372-.7 2.31-1.75 2.31zm7.88 1.344c2.058 0 3.514-1.372 3.514-3.64 0-2.24-1.456-3.668-3.514-3.668-2.044 0-3.5 1.428-3.5 3.668 0 2.268 1.442 3.64 3.5 3.64zm0-1.344c-1.064 0-1.764-.84-1.764-2.296 0-1.484.728-2.31 1.764-2.31 1.05 0 1.778.826 1.778 2.31 0 1.456-.714 2.296-1.778 2.296zm7.551 1.344c1.26 0 1.876-.686 2.142-1.19-.056.238-.056.42-.056.658v.28h1.708v-9.8h-1.708v3.276c0 .21 0 .42.056.672-.392-.658-1.05-1.204-2.114-1.204-1.596 0-3.15 1.218-3.15 3.668 0 2.408 1.316 3.64 3.122 3.64zm.406-1.344c-1.022 0-1.792-.896-1.792-2.31 0-1.358.77-2.296 1.792-2.296s1.778.896 1.778 2.296c0 1.372-.756 2.31-1.778 2.31z" fill="#12100C"/> - </g> - <defs> - <linearGradient id="paint0_linear" x1="33.806" y1="13.629" x2="22.389" y2="30.86" gradientUnits="userSpaceOnUse"> - <stop stop-color="#FFB45B"/> - <stop offset="1" stop-color="#FF8A00"/> - </linearGradient> - <filter id="filter0_d" x="0" y=".5" width="160" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> - <feFlood flood-opacity="0" result="BackgroundImageFix"/> - <feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/> - <feOffset dy=".5"/> - <feGaussianBlur stdDeviation="1"/> - <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/> - <feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/> - <feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/> - </filter> - </defs> -</svg>
\ No newline at end of file |