From af1f0dfcc6366c01ee05098c34ca8457a0248f70 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 10 Jul 2024 09:46:08 +0800 Subject: [PATCH] Remove docs sub folder since docs has been moved to https://gitea.com/gitea/docs (#31536) --- .github/workflows/files-changed.yml | 1 - .github/workflows/pull-compliance.yml | 1 - Makefile | 10 +- docs/.gitignore | 7 - docs/LICENSE | 202 --- docs/README.md | 19 - docs/README_ZH.md | 18 - docs/content/actions.en-us.md | 13 - docs/content/administration.en-us.md | 14 - docs/content/administration.zh-cn.md | 13 - docs/content/administration/_index.en-us.md | 0 docs/content/administration/_index.zh-cn.md | 0 .../adding-legal-pages.en-us.md | 40 - .../adding-legal-pages.zh-cn.md | 40 - .../backup-and-restore.en-us.md | 160 -- .../backup-and-restore.zh-cn.md | 154 -- .../administration/cmd-embedded.en-us.md | 119 -- .../administration/cmd-embedded.zh-cn.md | 101 -- .../administration/command-line.en-us.md | 571 ------- .../administration/command-line.zh-cn.md | 542 ------- .../config-cheat-sheet.zh-cn.md | 1361 ----------------- .../administration/customizing-gitea.en-us.md | 403 ----- .../administration/customizing-gitea.zh-cn.md | 91 -- .../administration/email-setup.en-us.md | 86 -- .../administration/email-setup.zh-cn.md | 85 - .../environment-variables.en-us.md | 59 - .../environment-variables.zh-cn.md | 57 - .../external-renderers.en-us.md | 192 --- .../external-renderers.zh-cn.md | 201 --- .../administration/fail2ban-setup.en-us.md | 127 -- .../administration/fail2ban-setup.zh-cn.md | 94 -- .../administration/git-lfs-support.en-us.md | 32 - .../administration/git-lfs-support.zh-cn.md | 32 - .../administration/https-support.en-us.md | 100 -- .../administration/https-support.zh-cn.md | 97 -- .../administration/logging-config.en-us.md | 294 ---- .../administration/logging-config.zh-cn.md | 272 ---- .../administration/mail-templates.en-us.md | 278 ---- .../administration/mail-templates.zh-cn.md | 261 ---- .../administration/repo-indexer.en-us.md | 65 - .../administration/repo-indexer.zh-cn.md | 59 - .../administration/reverse-proxies.en-us.md | 394 ----- .../administration/reverse-proxies.zh-cn.md | 136 -- .../search-engines-indexation.en-us.md | 40 - .../search-engines-indexation.zh-cn.md | 39 - docs/content/administration/signing.en-us.md | 175 --- docs/content/administration/signing.zh-cn.md | 142 -- docs/content/contributing.en-us.md | 13 - docs/content/contributing/_index.en-us.md | 0 docs/content/contributing/_index.zh-cn.md | 0 .../contributing/guidelines-backend.en-us.md | 124 -- .../contributing/guidelines-backend.zh-cn.md | 119 -- .../contributing/guidelines-frontend.en-us.md | 165 -- .../contributing/guidelines-frontend.zh-cn.md | 148 -- .../guidelines-refactoring.en-us.md | 49 - .../guidelines-refactoring.zh-cn.md | 49 - .../contributing/localization.de-de.md | 64 - .../contributing/localization.en-us.md | 39 - .../contributing/localization.zh-cn.md | 34 - .../content/contributing/translation.zh-cn.md | 17 - docs/content/development.en-us.md | 13 - docs/content/development.zh-cn.md | 13 - docs/content/development/_index.en-us.md | 0 docs/content/development/_index.zh-cn.md | 0 docs/content/development/api-usage.en-us.md | 132 -- docs/content/development/api-usage.zh-cn.md | 72 - .../development/hacking-on-gitea.en-us.md | 374 ----- .../development/hacking-on-gitea.zh-cn.md | 343 ----- .../content/development/integrations.en-us.md | 47 - .../content/development/integrations.zh-cn.md | 46 - docs/content/development/migrations.en-us.md | 43 - docs/content/development/migrations.zh-cn.md | 40 - .../development/oauth2-provider.en-us.md | 214 --- .../development/oauth2-provider.zh-cn.md | 137 -- docs/content/help.en-us.md | 13 - docs/content/help.zh-cn.md | 13 - docs/content/help/_index.en-us.md | 0 docs/content/help/_index.zh-cn.md | 0 docs/content/help/faq.en-us.md | 434 ------ docs/content/help/faq.zh-cn.md | 438 ------ docs/content/help/support.en-us.md | 78 - docs/content/help/support.zh-cn.md | 78 - docs/content/index.en-us.md | 86 -- docs/content/index.zh-cn.md | 77 - docs/content/installation.en-us.md | 13 - docs/content/installation.zh-cn.md | 13 - docs/content/installation/_index.en-us.md | 0 docs/content/installation/_index.zh-cn.md | 0 docs/content/installation/comparison.en-us.md | 154 -- docs/content/installation/comparison.zh-cn.md | 149 -- .../database-preparation.en-us.md | 309 ---- .../database-preparation.zh-cn.md | 309 ---- .../content/installation/from-binary.en-us.md | 238 --- .../content/installation/from-binary.zh-cn.md | 214 --- .../installation/from-package.en-us.md | 118 -- .../installation/from-package.zh-cn.md | 111 -- .../content/installation/from-source.en-us.md | 262 ---- .../content/installation/from-source.zh-cn.md | 227 --- .../installation/on-cloud-provider.en-us.md | 64 - .../installation/on-cloud-provider.zh-cn.md | 63 - .../installation/on-kubernetes.en-us.md | 72 - .../installation/on-kubernetes.zh-cn.md | 83 - .../run-as-service-in-ubuntu.en-us.md | 77 - .../run-as-service-in-ubuntu.zh-cn.md | 70 - .../installation/upgrade-from-gitea.en-us.md | 100 -- .../installation/upgrade-from-gitea.zh-cn.md | 95 -- .../installation/windows-service.en-us.md | 80 - .../installation/windows-service.zh-cn.md | 76 - .../with-docker-rootless.en-us.md | 364 ----- .../with-docker-rootless.zh-cn.md | 332 ---- .../content/installation/with-docker.en-us.md | 643 -------- .../content/installation/with-docker.zh-cn.md | 380 ----- docs/content/packages.en-us.md | 13 - docs/content/search.en-us.md | 19 - docs/content/search.nl-nl.md | 19 - docs/content/search.pt-br.md | 19 - docs/content/search.zh-cn.md | 19 - docs/content/usage.en-us.md | 13 - docs/content/usage.zh-cn.md | 13 - docs/content/usage/_index.en-us.md | 0 docs/content/usage/_index.zh-cn.md | 0 .../content/usage/actions/act-runner.en-us.md | 305 ---- .../content/usage/actions/act-runner.zh-cn.md | 260 ---- docs/content/usage/actions/badge.en-us.md | 35 - .../content/usage/actions/comparison.en-us.md | 144 -- .../content/usage/actions/comparison.zh-cn.md | 140 -- docs/content/usage/actions/design.en-us.md | 131 -- docs/content/usage/actions/design.zh-cn.md | 133 -- docs/content/usage/actions/faq.en-us.md | 184 --- docs/content/usage/actions/faq.zh-cn.md | 185 --- docs/content/usage/actions/overview.en-us.md | 51 - docs/content/usage/actions/overview.zh-cn.md | 51 - .../content/usage/actions/quickstart.en-us.md | 141 -- .../content/usage/actions/quickstart.zh-cn.md | 140 -- docs/content/usage/actions/secrets.en-us.md | 37 - docs/content/usage/actions/secrets.zh-cn.md | 37 - docs/content/usage/actions/variables.en-us.md | 41 - docs/content/usage/actions/variables.zh-cn.md | 39 - docs/content/usage/agit-support.en-us.md | 52 - docs/content/usage/agit-support.zh-cn.md | 49 - docs/content/usage/authentication.en-us.md | 351 ----- docs/content/usage/authentication.zh-cn.md | 293 ---- docs/content/usage/blame.en-us.md | 38 - docs/content/usage/blocking-users.en-us.md | 56 - docs/content/usage/clone-filter.en-us.md | 39 - docs/content/usage/clone-filter.zh-cn.md | 26 - docs/content/usage/code-owners.en-us.md | 65 - docs/content/usage/incoming-email.en-us.md | 46 - docs/content/usage/incoming-email.zh-cn.md | 46 - .../issue-pull-request-templates.en-us.md | 328 ---- .../issue-pull-request-templates.zh-cn.md | 294 ---- docs/content/usage/labels.en-us.md | 42 - docs/content/usage/labels.zh-cn.md | 42 - docs/content/usage/linked-references.en-us.md | 201 --- docs/content/usage/linked-references.zh-cn.md | 152 -- .../usage/merge-message-templates.en-us.md | 55 - .../usage/merge-message-templates.zh-cn.md | 53 - .../multi-factor-authentication.en-us.md | 35 - docs/content/usage/packages/_index.en-us.md | 0 docs/content/usage/packages/alpine.en-us.md | 130 -- docs/content/usage/packages/alpine.zh-cn.md | 129 -- docs/content/usage/packages/cargo.en-us.md | 113 -- docs/content/usage/packages/cargo.zh-cn.md | 107 -- docs/content/usage/packages/chef.en-us.md | 93 -- docs/content/usage/packages/chef.zh-cn.md | 93 -- docs/content/usage/packages/composer.en-us.md | 121 -- docs/content/usage/packages/composer.zh-cn.md | 119 -- docs/content/usage/packages/conan.en-us.md | 100 -- docs/content/usage/packages/conan.zh-cn.md | 98 -- docs/content/usage/packages/conda.en-us.md | 92 -- docs/content/usage/packages/conda.zh-cn.md | 82 - .../content/usage/packages/container.en-us.md | 100 -- .../content/usage/packages/container.zh-cn.md | 90 -- docs/content/usage/packages/cran.en-us.md | 99 -- docs/content/usage/packages/cran.zh-cn.md | 89 -- docs/content/usage/packages/debian.en-us.md | 131 -- docs/content/usage/packages/debian.zh-cn.md | 130 -- docs/content/usage/packages/generic.en-us.md | 144 -- docs/content/usage/packages/generic.zh-cn.md | 144 -- docs/content/usage/packages/go.en-us.md | 75 - docs/content/usage/packages/go.zh-cn.md | 73 - docs/content/usage/packages/helm.en-us.md | 64 - docs/content/usage/packages/helm.zh-cn.md | 64 - docs/content/usage/packages/maven.en-us.md | 163 -- docs/content/usage/packages/maven.zh-cn.md | 163 -- docs/content/usage/packages/npm.en-us.md | 141 -- docs/content/usage/packages/npm.zh-cn.md | 141 -- docs/content/usage/packages/nuget.en-us.md | 115 -- docs/content/usage/packages/nuget.zh-cn.md | 114 -- docs/content/usage/packages/overview.en-us.md | 108 -- docs/content/usage/packages/overview.zh-cn.md | 105 -- docs/content/usage/packages/pub.en-us.md | 80 - docs/content/usage/packages/pub.zh-cn.md | 80 - docs/content/usage/packages/pypi.en-us.md | 84 - docs/content/usage/packages/pypi.zh-cn.md | 84 - docs/content/usage/packages/rpm.en-us.md | 138 -- docs/content/usage/packages/rpm.zh-cn.md | 116 -- docs/content/usage/packages/rubygems.en-us.md | 124 -- docs/content/usage/packages/rubygems.zh-cn.md | 124 -- docs/content/usage/packages/storage.en-us.md | 81 - docs/content/usage/packages/storage.zh-cn.md | 81 - docs/content/usage/packages/swift.en-us.md | 99 -- docs/content/usage/packages/swift.zh-cn.md | 90 -- docs/content/usage/packages/vagrant.en-us.md | 85 - docs/content/usage/packages/vagrant.zh-cn.md | 75 - docs/content/usage/permissions.en-us.md | 86 -- docs/content/usage/permissions.zh-cn.md | 86 -- docs/content/usage/profile-readme.en-us.md | 25 - docs/content/usage/profile-readme.zh-cn.md | 24 - docs/content/usage/protected-tags.en-us.md | 55 - docs/content/usage/protected-tags.zh-cn.md | 55 - docs/content/usage/pull-request.en-us.md | 69 - docs/content/usage/pull-request.zh-cn.md | 69 - docs/content/usage/push.en-us.md | 70 - docs/content/usage/push.zh-cn.md | 68 - docs/content/usage/repo-mirror.en-us.md | 103 -- docs/content/usage/repo-mirror.zh-cn.md | 103 -- .../usage/template-repositories.en-us.md | 88 -- .../usage/template-repositories.zh-cn.md | 85 - docs/content/usage/webhooks.en-us.md | 196 --- docs/content/usage/webhooks.zh-cn.md | 194 --- docs/static/authorize.png | Bin 18951 -> 0 bytes docs/static/cloudron.svg | 53 - docs/static/gitea-push-hint.png | Bin 421775 -> 0 bytes .../images/usage/actions/enable-actions.png | Bin 59373 -> 0 bytes docs/static/images/usage/actions/labels.png | Bin 108957 -> 0 bytes docs/static/images/usage/actions/network.png | Bin 150028 -> 0 bytes .../images/usage/actions/register-runner.png | Bin 161223 -> 0 bytes docs/static/images/usage/actions/view-job.png | Bin 534917 -> 0 bytes .../images/usage/actions/view-runner.png | Bin 141813 -> 0 bytes docs/static/images/usage/profile-readme.png | Bin 33680 -> 0 bytes docs/static/octicon-versions.svg | 1 - docs/static/open-in-gitpod.svg | 23 - 233 files changed, 3 insertions(+), 26078 deletions(-) delete mode 100644 docs/.gitignore delete mode 100644 docs/LICENSE delete mode 100644 docs/README.md delete mode 100644 docs/README_ZH.md delete mode 100644 docs/content/actions.en-us.md delete mode 100644 docs/content/administration.en-us.md delete mode 100644 docs/content/administration.zh-cn.md delete mode 100644 docs/content/administration/_index.en-us.md delete mode 100644 docs/content/administration/_index.zh-cn.md delete mode 100644 docs/content/administration/adding-legal-pages.en-us.md delete mode 100644 docs/content/administration/adding-legal-pages.zh-cn.md delete mode 100644 docs/content/administration/backup-and-restore.en-us.md delete mode 100644 docs/content/administration/backup-and-restore.zh-cn.md delete mode 100644 docs/content/administration/cmd-embedded.en-us.md delete mode 100644 docs/content/administration/cmd-embedded.zh-cn.md delete mode 100644 docs/content/administration/command-line.en-us.md delete mode 100644 docs/content/administration/command-line.zh-cn.md delete mode 100644 docs/content/administration/config-cheat-sheet.zh-cn.md delete mode 100644 docs/content/administration/customizing-gitea.en-us.md delete mode 100644 docs/content/administration/customizing-gitea.zh-cn.md delete mode 100644 docs/content/administration/email-setup.en-us.md delete mode 100644 docs/content/administration/email-setup.zh-cn.md delete mode 100644 docs/content/administration/environment-variables.en-us.md delete mode 100644 docs/content/administration/environment-variables.zh-cn.md delete mode 100644 docs/content/administration/external-renderers.en-us.md delete mode 100644 docs/content/administration/external-renderers.zh-cn.md delete mode 100644 docs/content/administration/fail2ban-setup.en-us.md delete mode 100644 docs/content/administration/fail2ban-setup.zh-cn.md delete mode 100644 docs/content/administration/git-lfs-support.en-us.md delete mode 100644 docs/content/administration/git-lfs-support.zh-cn.md delete mode 100644 docs/content/administration/https-support.en-us.md delete mode 100644 docs/content/administration/https-support.zh-cn.md delete mode 100644 docs/content/administration/logging-config.en-us.md delete mode 100644 docs/content/administration/logging-config.zh-cn.md delete mode 100644 docs/content/administration/mail-templates.en-us.md delete mode 100644 docs/content/administration/mail-templates.zh-cn.md delete mode 100644 docs/content/administration/repo-indexer.en-us.md delete mode 100644 docs/content/administration/repo-indexer.zh-cn.md delete mode 100644 docs/content/administration/reverse-proxies.en-us.md delete mode 100644 docs/content/administration/reverse-proxies.zh-cn.md delete mode 100644 docs/content/administration/search-engines-indexation.en-us.md delete mode 100644 docs/content/administration/search-engines-indexation.zh-cn.md delete mode 100644 docs/content/administration/signing.en-us.md delete mode 100644 docs/content/administration/signing.zh-cn.md delete mode 100644 docs/content/contributing.en-us.md delete mode 100644 docs/content/contributing/_index.en-us.md delete mode 100644 docs/content/contributing/_index.zh-cn.md delete mode 100644 docs/content/contributing/guidelines-backend.en-us.md delete mode 100644 docs/content/contributing/guidelines-backend.zh-cn.md delete mode 100644 docs/content/contributing/guidelines-frontend.en-us.md delete mode 100644 docs/content/contributing/guidelines-frontend.zh-cn.md delete mode 100644 docs/content/contributing/guidelines-refactoring.en-us.md delete mode 100644 docs/content/contributing/guidelines-refactoring.zh-cn.md delete mode 100644 docs/content/contributing/localization.de-de.md delete mode 100644 docs/content/contributing/localization.en-us.md delete mode 100644 docs/content/contributing/localization.zh-cn.md delete mode 100644 docs/content/contributing/translation.zh-cn.md delete mode 100644 docs/content/development.en-us.md delete mode 100644 docs/content/development.zh-cn.md delete mode 100644 docs/content/development/_index.en-us.md delete mode 100644 docs/content/development/_index.zh-cn.md delete mode 100644 docs/content/development/api-usage.en-us.md delete mode 100644 docs/content/development/api-usage.zh-cn.md delete mode 100644 docs/content/development/hacking-on-gitea.en-us.md delete mode 100644 docs/content/development/hacking-on-gitea.zh-cn.md delete mode 100644 docs/content/development/integrations.en-us.md delete mode 100644 docs/content/development/integrations.zh-cn.md delete mode 100644 docs/content/development/migrations.en-us.md delete mode 100644 docs/content/development/migrations.zh-cn.md delete mode 100644 docs/content/development/oauth2-provider.en-us.md delete mode 100644 docs/content/development/oauth2-provider.zh-cn.md delete mode 100644 docs/content/help.en-us.md delete mode 100644 docs/content/help.zh-cn.md delete mode 100644 docs/content/help/_index.en-us.md delete mode 100644 docs/content/help/_index.zh-cn.md delete mode 100644 docs/content/help/faq.en-us.md delete mode 100644 docs/content/help/faq.zh-cn.md delete mode 100644 docs/content/help/support.en-us.md delete mode 100644 docs/content/help/support.zh-cn.md delete mode 100644 docs/content/index.en-us.md delete mode 100644 docs/content/index.zh-cn.md delete mode 100644 docs/content/installation.en-us.md delete mode 100644 docs/content/installation.zh-cn.md delete mode 100644 docs/content/installation/_index.en-us.md delete mode 100644 docs/content/installation/_index.zh-cn.md delete mode 100644 docs/content/installation/comparison.en-us.md delete mode 100644 docs/content/installation/comparison.zh-cn.md delete mode 100644 docs/content/installation/database-preparation.en-us.md delete mode 100644 docs/content/installation/database-preparation.zh-cn.md delete mode 100644 docs/content/installation/from-binary.en-us.md delete mode 100644 docs/content/installation/from-binary.zh-cn.md delete mode 100644 docs/content/installation/from-package.en-us.md delete mode 100644 docs/content/installation/from-package.zh-cn.md delete mode 100644 docs/content/installation/from-source.en-us.md delete mode 100644 docs/content/installation/from-source.zh-cn.md delete mode 100644 docs/content/installation/on-cloud-provider.en-us.md delete mode 100644 docs/content/installation/on-cloud-provider.zh-cn.md delete mode 100644 docs/content/installation/on-kubernetes.en-us.md delete mode 100644 docs/content/installation/on-kubernetes.zh-cn.md delete mode 100644 docs/content/installation/run-as-service-in-ubuntu.en-us.md delete mode 100644 docs/content/installation/run-as-service-in-ubuntu.zh-cn.md delete mode 100644 docs/content/installation/upgrade-from-gitea.en-us.md delete mode 100644 docs/content/installation/upgrade-from-gitea.zh-cn.md delete mode 100644 docs/content/installation/windows-service.en-us.md delete mode 100644 docs/content/installation/windows-service.zh-cn.md delete mode 100644 docs/content/installation/with-docker-rootless.en-us.md delete mode 100644 docs/content/installation/with-docker-rootless.zh-cn.md delete mode 100644 docs/content/installation/with-docker.en-us.md delete mode 100644 docs/content/installation/with-docker.zh-cn.md delete mode 100644 docs/content/packages.en-us.md delete mode 100644 docs/content/search.en-us.md delete mode 100644 docs/content/search.nl-nl.md delete mode 100644 docs/content/search.pt-br.md delete mode 100644 docs/content/search.zh-cn.md delete mode 100644 docs/content/usage.en-us.md delete mode 100644 docs/content/usage.zh-cn.md delete mode 100644 docs/content/usage/_index.en-us.md delete mode 100644 docs/content/usage/_index.zh-cn.md delete mode 100644 docs/content/usage/actions/act-runner.en-us.md delete mode 100644 docs/content/usage/actions/act-runner.zh-cn.md delete mode 100644 docs/content/usage/actions/badge.en-us.md delete mode 100644 docs/content/usage/actions/comparison.en-us.md delete mode 100644 docs/content/usage/actions/comparison.zh-cn.md delete mode 100644 docs/content/usage/actions/design.en-us.md delete mode 100644 docs/content/usage/actions/design.zh-cn.md delete mode 100644 docs/content/usage/actions/faq.en-us.md delete mode 100644 docs/content/usage/actions/faq.zh-cn.md delete mode 100644 docs/content/usage/actions/overview.en-us.md delete mode 100644 docs/content/usage/actions/overview.zh-cn.md delete mode 100644 docs/content/usage/actions/quickstart.en-us.md delete mode 100644 docs/content/usage/actions/quickstart.zh-cn.md delete mode 100644 docs/content/usage/actions/secrets.en-us.md delete mode 100644 docs/content/usage/actions/secrets.zh-cn.md delete mode 100644 docs/content/usage/actions/variables.en-us.md delete mode 100644 docs/content/usage/actions/variables.zh-cn.md delete mode 100644 docs/content/usage/agit-support.en-us.md delete mode 100644 docs/content/usage/agit-support.zh-cn.md delete mode 100644 docs/content/usage/authentication.en-us.md delete mode 100644 docs/content/usage/authentication.zh-cn.md delete mode 100644 docs/content/usage/blame.en-us.md delete mode 100644 docs/content/usage/blocking-users.en-us.md delete mode 100644 docs/content/usage/clone-filter.en-us.md delete mode 100644 docs/content/usage/clone-filter.zh-cn.md delete mode 100644 docs/content/usage/code-owners.en-us.md delete mode 100644 docs/content/usage/incoming-email.en-us.md delete mode 100644 docs/content/usage/incoming-email.zh-cn.md delete mode 100644 docs/content/usage/issue-pull-request-templates.en-us.md delete mode 100644 docs/content/usage/issue-pull-request-templates.zh-cn.md delete mode 100644 docs/content/usage/labels.en-us.md delete mode 100644 docs/content/usage/labels.zh-cn.md delete mode 100644 docs/content/usage/linked-references.en-us.md delete mode 100644 docs/content/usage/linked-references.zh-cn.md delete mode 100644 docs/content/usage/merge-message-templates.en-us.md delete mode 100644 docs/content/usage/merge-message-templates.zh-cn.md delete mode 100644 docs/content/usage/multi-factor-authentication.en-us.md delete mode 100644 docs/content/usage/packages/_index.en-us.md delete mode 100644 docs/content/usage/packages/alpine.en-us.md delete mode 100644 docs/content/usage/packages/alpine.zh-cn.md delete mode 100644 docs/content/usage/packages/cargo.en-us.md delete mode 100644 docs/content/usage/packages/cargo.zh-cn.md delete mode 100644 docs/content/usage/packages/chef.en-us.md delete mode 100644 docs/content/usage/packages/chef.zh-cn.md delete mode 100644 docs/content/usage/packages/composer.en-us.md delete mode 100644 docs/content/usage/packages/composer.zh-cn.md delete mode 100644 docs/content/usage/packages/conan.en-us.md delete mode 100644 docs/content/usage/packages/conan.zh-cn.md delete mode 100644 docs/content/usage/packages/conda.en-us.md delete mode 100644 docs/content/usage/packages/conda.zh-cn.md delete mode 100644 docs/content/usage/packages/container.en-us.md delete mode 100644 docs/content/usage/packages/container.zh-cn.md delete mode 100644 docs/content/usage/packages/cran.en-us.md delete mode 100644 docs/content/usage/packages/cran.zh-cn.md delete mode 100644 docs/content/usage/packages/debian.en-us.md delete mode 100644 docs/content/usage/packages/debian.zh-cn.md delete mode 100644 docs/content/usage/packages/generic.en-us.md delete mode 100644 docs/content/usage/packages/generic.zh-cn.md delete mode 100644 docs/content/usage/packages/go.en-us.md delete mode 100644 docs/content/usage/packages/go.zh-cn.md delete mode 100644 docs/content/usage/packages/helm.en-us.md delete mode 100644 docs/content/usage/packages/helm.zh-cn.md delete mode 100644 docs/content/usage/packages/maven.en-us.md delete mode 100644 docs/content/usage/packages/maven.zh-cn.md delete mode 100644 docs/content/usage/packages/npm.en-us.md delete mode 100644 docs/content/usage/packages/npm.zh-cn.md delete mode 100644 docs/content/usage/packages/nuget.en-us.md delete mode 100644 docs/content/usage/packages/nuget.zh-cn.md delete mode 100644 docs/content/usage/packages/overview.en-us.md delete mode 100644 docs/content/usage/packages/overview.zh-cn.md delete mode 100644 docs/content/usage/packages/pub.en-us.md delete mode 100644 docs/content/usage/packages/pub.zh-cn.md delete mode 100644 docs/content/usage/packages/pypi.en-us.md delete mode 100644 docs/content/usage/packages/pypi.zh-cn.md delete mode 100644 docs/content/usage/packages/rpm.en-us.md delete mode 100644 docs/content/usage/packages/rpm.zh-cn.md delete mode 100644 docs/content/usage/packages/rubygems.en-us.md delete mode 100644 docs/content/usage/packages/rubygems.zh-cn.md delete mode 100644 docs/content/usage/packages/storage.en-us.md delete mode 100644 docs/content/usage/packages/storage.zh-cn.md delete mode 100644 docs/content/usage/packages/swift.en-us.md delete mode 100644 docs/content/usage/packages/swift.zh-cn.md delete mode 100644 docs/content/usage/packages/vagrant.en-us.md delete mode 100644 docs/content/usage/packages/vagrant.zh-cn.md delete mode 100644 docs/content/usage/permissions.en-us.md delete mode 100644 docs/content/usage/permissions.zh-cn.md delete mode 100644 docs/content/usage/profile-readme.en-us.md delete mode 100644 docs/content/usage/profile-readme.zh-cn.md delete mode 100644 docs/content/usage/protected-tags.en-us.md delete mode 100644 docs/content/usage/protected-tags.zh-cn.md delete mode 100644 docs/content/usage/pull-request.en-us.md delete mode 100644 docs/content/usage/pull-request.zh-cn.md delete mode 100644 docs/content/usage/push.en-us.md delete mode 100644 docs/content/usage/push.zh-cn.md delete mode 100644 docs/content/usage/repo-mirror.en-us.md delete mode 100644 docs/content/usage/repo-mirror.zh-cn.md delete mode 100644 docs/content/usage/template-repositories.en-us.md delete mode 100644 docs/content/usage/template-repositories.zh-cn.md delete mode 100644 docs/content/usage/webhooks.en-us.md delete mode 100644 docs/content/usage/webhooks.zh-cn.md delete mode 100644 docs/static/authorize.png delete mode 100644 docs/static/cloudron.svg delete mode 100644 docs/static/gitea-push-hint.png delete mode 100644 docs/static/images/usage/actions/enable-actions.png delete mode 100644 docs/static/images/usage/actions/labels.png delete mode 100644 docs/static/images/usage/actions/network.png delete mode 100644 docs/static/images/usage/actions/register-runner.png delete mode 100644 docs/static/images/usage/actions/view-job.png delete mode 100644 docs/static/images/usage/actions/view-runner.png delete mode 100644 docs/static/images/usage/profile-readme.png delete mode 100644 docs/static/octicon-versions.svg delete mode 100644 docs/static/open-in-gitpod.svg diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 9a609e055..7c1fb0244 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -63,7 +63,6 @@ jobs: docs: - "**/*.md" - - "docs/**" - ".markdownlint.yaml" - "package.json" - "package-lock.json" diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index f89276fe8..429829dfe 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -191,7 +191,6 @@ jobs: cache-dependency-path: package-lock.json - run: make deps-frontend - run: make lint-md - - run: make docs actions: if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true' diff --git a/Makefile b/Makefile index 1432467bc..8236f6f59 100644 --- a/Makefile +++ b/Makefile @@ -146,7 +146,7 @@ WEB_DIRS := web_src/js web_src/css ESLINT_FILES := web_src/js tools *.js *.ts tests/e2e STYLELINT_FILES := web_src/css web_src/js/components/*.vue -SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml)) +SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml)) EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini GO_SOURCES := $(wildcard *.go) @@ -397,7 +397,7 @@ lint-swagger: node_modules .PHONY: lint-md lint-md: node_modules - npx markdownlint docs *.md + npx markdownlint *.md .PHONY: lint-spell lint-spell: @@ -797,7 +797,7 @@ $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ) CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ .PHONY: release -release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check +release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check $(DIST_DIRS): mkdir -p $(DIST_DIRS) @@ -843,10 +843,6 @@ release-sources: | $(DIST_DIRS) tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz . rm -f $(STORED_VERSION_FILE) -.PHONY: release-docs -release-docs: | $(DIST_DIRS) docs - tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs . - .PHONY: deps deps: deps-frontend deps-backend deps-tools deps-py diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 271adbb1d..000000000 --- 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 d64569567..000000000 --- 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 38958525b..000000000 --- a/docs/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Gitea: Docs - -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 -``` diff --git a/docs/README_ZH.md b/docs/README_ZH.md deleted file mode 100644 index deff4b5fc..000000000 --- a/docs/README_ZH.md +++ /dev/null @@ -1,18 +0,0 @@ -# Gitea: 文档 - -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 -``` diff --git a/docs/content/actions.en-us.md b/docs/content/actions.en-us.md deleted file mode 100644 index d8e33d378..000000000 --- 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 416b9e631..000000000 --- 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 262e5f068..000000000 --- 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 e69de29bb..000000000 diff --git a/docs/content/administration/_index.zh-cn.md b/docs/content/administration/_index.zh-cn.md deleted file mode 100644 index e69de29bb..000000000 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 1ff0c0132..000000000 --- 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 -Privacy Policy -``` - -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 3e18c6e6b..000000000 --- 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 -隐私政策 -``` - -重启 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 451ef5c94..000000000 --- a/docs/content/administration/backup-and-restore.en-us.md +++ /dev/null @@ -1,160 +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 = ` 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 -it -w <--tempdir> $(docker ps -qf 'name=^$') bash -c '/usr/local/bin/gitea dump -c ' -``` - -\*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/data/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 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. - -If you still have issues, consider running `./gitea doctor check` to inspect possible errors (or run with `--fix`). - -### 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 db7eba84f..000000000 --- a/docs/content/administration/backup-and-restore.zh-cn.md +++ /dev/null @@ -1,154 +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压缩文件。该压缩文件可以被用来进行数据恢复。 - -## 备份一致性 - -为了确保 Gitea 实例的一致性,在备份期间必须关闭它。 - -Gitea 包括数据库、文件和 Git 仓库,当它被使用时所有这些都会发生变化。例如,当迁移正在进行时,在数据库中创建一个事务,而 Git 仓库正在被复制。如果备份发生在迁移的中间,Git 仓库可能是不完整的,尽管数据库声称它是完整的,因为它是在之后被转储的。避免这种竞争条件的唯一方法是在备份期间停止 Gitea 实例。 - -## 备份命令 (`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` 文件将会包含如下内容: - -* `app.ini` - 如果原先存储在默认的 custom/ 目录之外,则是配置文件的可选副本 -* `custom/` - 所有保存在 `custom/` 目录下的配置和自定义的文件。 -* `data/` - 数据目录(APP_DATA_PATH),如果使用文件会话,则不包括会话。该目录包括 `attachments`、`avatars`、`lfs`、`indexers`、如果使用 SQLite 则包括 SQLite 文件。 -* `repos/` - 仓库目录的完整副本。 -* `gitea-db.sql` - 数据库dump出来的 SQL。 -* `log/` - Logs文件,如果用作迁移不是必须的。 - -中间备份文件将会在临时目录进行创建,如果您要重新指定临时目录,可以用 `--tempdir` 参数,或者用 `TMPDIR` 环境变量。 - -## 备份数据库 - -`gitea dump` 创建的 SQL 转储使用 XORM,Gitea 管理员可能更喜欢使用本地的 MySQL 和 PostgreSQL 转储工具。使用 XORM 转储数据库时仍然存在一些问题,可能会导致在尝试恢复时出现问题。 - -```sh -# mysql -mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql -# postgres -pg_dump -U $USER $DATABASE > gitea-db.sql -``` - -### 使用Docker (`dump`) - -在使用 Docker 时,使用 `dump` 命令有一些注意事项。 - -必须以 `gitea/conf/app.ini` 中指定的 `RUN_USER = ` 执行该命令;并且,为了让备份文件夹的压缩过程能够顺利执行,`docker exec` 命令必须在 `--tempdir` 内部执行。 - -示例: - -```none -docker exec -u -it -w <--tempdir> $(docker ps -qf 'name=^$') bash -c '/usr/local/bin/gitea dump -c ' -``` - -\*注意:`--tempdir` 指的是 Gitea 使用的 Docker 环境的临时目录;如果您没有指定自定义的 `--tempdir`,那么 Gitea 将使用 `/tmp` 或 Docker 容器的 `TMPDIR` 环境变量。对于 `--tempdir`,请相应调整您的 `docker exec` 命令选项。 - -结果应该是一个文件,存储在指定的 `--tempdir` 中,类似于:`gitea-dump-1482906742.zip` - -## 恢复命令 (`restore`) - -当前还没有恢复命令,恢复需要人工进行。主要是把文件和数据库进行恢复。 - -例如: - -```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 Docker),或者 Gitea 安装到了与之前安装不同的目录,则需要重新生成仓库 Git 钩子。 - -在 Gitea 运行时,并从 Gitea 二进制文件所在的目录执行:`./gitea admin regenerate hooks` - -这样可以确保仓库 Git 钩子中的应用程序和配置文件路径与当前安装一致。如果这些路径没有更新,仓库的 `push` 操作将失败。 - -### 使用 Docker (`restore`) - -在基于 Docker 的 Gitea 实例中,也没有恢复命令的支持。恢复过程与前面描述的步骤相同,但路径不同。 - -示例: - -```sh -# 在容器中打开 bash 会话 -docker exec --user git -it 2a83b293548e bash -# 在容器内解压您的备份文件 -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -# 恢复 Gitea 数据 -mv data/* /data/gitea -# 恢复仓库本身 -mv repos/* /data/git/gitea-repositories/ -# 调整文件权限 -chown -R git:git /data -# 重新生成 Git 钩子 -/usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks -``` - -Gitea 容器中的默认用户是 `git`(1000:1000)。请用您的 Gitea 容器 ID 或名称替换 `2a83b293548e`。 - -### 使用 Docker-rootless (`restore`) - -在 Docker-rootless 容器中的恢复工作流程只是要使用的目录不同: - -```sh -# 在容器中打开 bash 会话 -docker exec --user git -it 2a83b293548e bash -# 在容器内解压您的备份文件 -unzip gitea-dump-1610949662.zip -cd gitea-dump-1610949662 -# 恢复 app.ini -mv data/conf/app.ini /etc/gitea/app.ini -# 恢复 Gitea 数据 -mv data/* /var/lib/gitea -# 恢复仓库本身 -mv repos/* /var/lib/gitea/git/gitea-repositories -# 调整文件权限 -chown -R git:git /etc/gitea/app.ini /var/lib/gitea -# 重新生成 Git 钩子 -/usr/local/bin/gitea -c '/etc/gitea/app.ini' admin regenerate hooks -``` 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 b7f683614..000000000 --- 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 a2df1aa2f..000000000 --- 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 752a8d4c6..000000000 --- a/docs/content/administration/command-line.en-us.md +++ /dev/null @@ -1,571 +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`: The created user will be required to set a new password after the initial login, default: true. It could be disabled by `--must-change-password=false`. - - `--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`: The user is required to set a new password after the login, default: true. It could be disabled by `--must-change-password=false`. - - 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]:` or `all` where `` 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 `: The password to visit the clone_addr - - `--auth_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 `: 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 `: 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 6e6bcb608..000000000 --- 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 `:访问 `clone_addr` 的密码。 - - `--auth_token `:访问 `clone_addr` 的个人令牌。 - - `--owner_name lunny`:如果非空,数据将存储在具有所有者名称的目录中。 - - `--repo_name tango`:如果非空,数据将存储在具有存储库名称的目录中。 - - `--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 `:要还原的项目,一个或多个项目应以逗号分隔。允许的项目有 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.zh-cn.md b/docs/content/administration/config-cheat-sheet.zh-cn.md deleted file mode 100644 index 7d51c758b..000000000 --- a/docs/content/administration/config-cheat-sheet.zh-cn.md +++ /dev/null @@ -1,1361 +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安装时候设置的默认主题,自定义的主题可以通过 `{CustomPath}/public/assets/css/theme-*.css` 提供。 -- `SHOW_USER_EMAIL`: **true**: 用户的电子邮件是否应该显示在`Explore Users`页面中。 -- `THEMES`: **_empty_**: 所有可用的主题(由 `{CustomPath}/public/assets/css/theme-*.css` 提供)。允许用户选择个性化的主题, -- `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- ` 或 `ssh- , ssh- `。有关详细信息,请参阅 `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)__`。 -- `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$