From 4d4faf5103439b2e2a037459590d2c0aeff2a7f6 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 11:59:33 +0800 Subject: [PATCH 01/25] test scrpit --- .gitea/workflows/E2E-TEST.YAML | 49 + .iflow/agents/chrome-devtools-automation.md | 35 + .iflow/agents/chrome-devtools-mcp.json | 12 + .iflow/agents/index.js | 26 + autotest.txt | 11 + custom/conf/app.example.ini | 2854 ------------------- go.mod | 2 + mcp_config.json | 8 + my-auth-state.json | 35 + package-lock.json | 43 +- package.json | 1 + playwright.config.ts | 27 +- tests/e2e/1.test.e2e.ts | 85 + tests/e2e/example.test.e2e.ts | 56 - tests/e2e/utils_e2e.ts | 2 +- tests/sqlite.ini.tmpl | 2 +- 16 files changed, 312 insertions(+), 2936 deletions(-) create mode 100644 .gitea/workflows/E2E-TEST.YAML create mode 100644 .iflow/agents/chrome-devtools-automation.md create mode 100644 .iflow/agents/chrome-devtools-mcp.json create mode 100644 .iflow/agents/index.js create mode 100644 autotest.txt delete mode 100644 custom/conf/app.example.ini create mode 100644 mcp_config.json create mode 100644 my-auth-state.json create mode 100644 tests/e2e/1.test.e2e.ts delete mode 100644 tests/e2e/example.test.e2e.ts diff --git a/.gitea/workflows/E2E-TEST.YAML b/.gitea/workflows/E2E-TEST.YAML new file mode 100644 index 0000000000..d0415a82c5 --- /dev/null +++ b/.gitea/workflows/E2E-TEST.YAML @@ -0,0 +1,49 @@ +name: E2E TEST +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + test-e2e: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Docker + uses: docker/setup-buildx-action@v2 + + - name: Install Docker + run: | + sudo systemctl start docker + sudo usermod -a -G docker $USER + docker --version + + - name: Pre-build WebTerminal image for E2E tests + run: | + docker build -t devstar.cn/devstar/webterminal:latest -f docker/Dockerfile.webTerminal . + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + cache-dependency-path: package-lock.json + + - name: Install Playwright for E2E testing + run: | + npx playwright install --with-deps + - name: Run E2E tests with installation workflow + run: | + make test-e2e-sqlite + timeout-minutes: 50 + env: + USE_REPO_TEST_DIR: 1 + DOCKER_HOST: unix:///var/run/docker.sock diff --git a/.iflow/agents/chrome-devtools-automation.md b/.iflow/agents/chrome-devtools-automation.md new file mode 100644 index 0000000000..6d5ba43112 --- /dev/null +++ b/.iflow/agents/chrome-devtools-automation.md @@ -0,0 +1,35 @@ +--- +agent-type: chrome-devtools-automation +name: chrome-devtools-automation +description: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention. +when-to-use: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention. +allowed-tools: glob, list_directory, multi_edit, read_file, read_many_files, replace, search_file_content, run_shell_command, todo_read, todo_write, web_fetch, web_search, write_file, xml_escape +allowed-mcps: chrome-devtools +inherit-tools: true +inherit-mcps: true +color: green +--- + +You are a Chrome DevTools Protocol (CDP) automation expert. Your role is to help users automate Chrome browser operations for testing purposes, eliminating the need for manual testing. + +You will help users: +1. Create automation scripts that control Chrome browser via the DevTools Protocol +2. Automate UI interactions such as clicking, typing, and navigating +3. Perform automated testing workflows including form filling, button clicking, and page validation +4. Integrate browser automation with testing pipelines +5. Replace repetitive manual testing tasks with automated solutions + +When creating automation solutions, you should: +- Use the Chrome DevTools Protocol (CDP) for browser automation +- Write clear, maintainable automation scripts +- Include proper error handling and validation checks +- Structure tests to be repeatable and reliable +- Focus on eliminating manual testing efforts + +Remember to: +- Always verify that automation scripts are robust and handle edge cases +- Include appropriate wait conditions for page loading and element availability +- Provide clear documentation of automation workflows +- Ensure automation scripts are maintainable and understandable + +If a user asks about general web development topics not related to Chrome automation, explain that your specialty is Chrome DevTools automation for testing purposes. diff --git a/.iflow/agents/chrome-devtools-mcp.json b/.iflow/agents/chrome-devtools-mcp.json new file mode 100644 index 0000000000..728d22a2b7 --- /dev/null +++ b/.iflow/agents/chrome-devtools-mcp.json @@ -0,0 +1,12 @@ +{ + "name": "chrome-devtools-mcp", + "version": "1.0.0", + "description": "Chrome DevTools MCP for iFlow", + "main": "index.js", + "scripts": { + "start": "node index.js" + }, + "dependencies": { + "chrome-remote-interface": "^0.31.0" + } +} \ No newline at end of file diff --git a/.iflow/agents/index.js b/.iflow/agents/index.js new file mode 100644 index 0000000000..aa1463e18d --- /dev/null +++ b/.iflow/agents/index.js @@ -0,0 +1,26 @@ +const CDP = require('chrome-remote-interface'); + +async function connectToChrome() { + try { + const client = await CDP({ + host: '192.168.181.128', + port: 3000 + }); + + const { Page, Runtime } = client; + + await Page.enable(); + await Runtime.enable(); + + await Page.navigate({ url: 'http://192.168.181.128:3000/' }); + await Page.loadEventFired(); + + console.log('Successfully navigated to http://192.168.181.128:3000/'); + + await client.close(); + } catch (error) { + console.error('Error connecting to Chrome DevTools:', error); + } +} + +connectToChrome(); \ No newline at end of file diff --git a/autotest.txt b/autotest.txt new file mode 100644 index 0000000000..d977a70061 --- /dev/null +++ b/autotest.txt @@ -0,0 +1,11 @@ +##你是一个自动测试机器人,下面是你需要逐条执行的指令 +1.使用chrome devtools mcp打开192.168.181.128:3000/,你应该直接操作浏览器执行 +2.描述当前页面 +3.下面需要你执行几个测试用例,你能够在测试结束后生成一份文档格式的测试报告吗 +4.测试用例1(增加开发容器权限):你通过点击管理后台,进入后台管理界面,点击身份及认证,账户管理,你能看到id为1的用户,点击右侧的编辑,点击允许创建开发容器并更新账户,你要确保允许创建开发容器按钮是已经勾选的,你已经在这个位置犯了多次错误,所以请再三检查。然后尝试打开jiaojunming/test1仓库,你应该在界面上能看到开发容器,看得到就是测试成功。 +5.测试用例2(开发容器配置检查):你尝试打开jiaojunming/test1仓库,点击开发容器,应该有devcontainer.json文件,能够看到create devcontainer按钮,等待2秒后,你再打开jiaojunming/test2仓库,点击开发容器,应该本仓库没有开发容器配置。 +6.测试用例3(开发容器创建):你打开jiaojunming/test1仓库,点击create devcontainer,此时应该出现一个终端,会执行容器的创建,你需要等待,直到右侧可以看到删除容器,停止容器,open with vscode按钮等。 +7.测试用例4(停止开发容器):就在测试用例3的这个界面,点击停止开发容器,等待,直到右侧出现启动开发容器按钮。 +8.测试用例5(启动开发容器):就在测试用例3的这个界面,点击启动开发容器,等待,直到右侧可以看到open with vscode按钮,删除容器,停止容器按钮等。 +9.测试用例6(删除开发容器):就在测试用例3的这个界面,点击删除开发容器,等待,直到重新出现创建开发容器按钮。 + diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini deleted file mode 100644 index aa2fcee765..0000000000 --- a/custom/conf/app.example.ini +++ /dev/null @@ -1,2854 +0,0 @@ -; This file lists the default values used by Gitea -;; Copy required sections to your own app.ini (default is custom/conf/app.ini) -;; and modify as needed. -;; Do not copy the whole file as-is, as it contains some invalid sections for illustrative purposes. -;; If you don't know what a setting is you should not set it. -;; -;; see https://docs.gitea.com/administration/config-cheat-sheet for additional documentation. - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Default Configuration (non-`app.ini` configuration) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; These values are environment-dependent but form the basis of a lot of values. They will be -;; reported as part of the default configuration when running `gitea help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up. -;; -;; - _`AppPath`_: This is the absolute path of the running gitea binary. -;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy: -;; - The "WORK_PATH" option in "app.ini" file -;; - The `--work-path` flag passed to the binary -;; - The environment variable `$GITEA_WORK_DIR` -;; - A built-in value set at build time (see building from source) -;; - Otherwise it defaults to the directory of the _`AppPath`_ -;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_ -;; - _`CustomPath`_: This is the base directory for custom templates and other options. It is determined by using the first set thing in the following hierarchy: -;; - The `--custom-path` flag passed to the binary -;; - The environment variable `$GITEA_CUSTOM` -;; - A built-in value set at build time (see building from source) -;; - Otherwise it defaults to _`AppWorkPath`_`/custom` -;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppWorkPath`_ -;; - _`CustomConf`_: This is the path to the `app.ini` file. -;; - The `--config` flag passed to the binary -;; - A built-in value set at build time (see building from source) -;; - Otherwise it defaults to _`CustomPath`_`/conf/app.ini` -;; - If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_ -;; -;; In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; General Settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; App name that shows in every page title -APP_NAME = ; Gitea: Git with a cup of tea -;; -;; RUN_USER will automatically detect the current user - but you can set it here change it if you run locally -RUN_USER = ; git -;; -;; Application run mode, affects performance and debugging: "dev" or "prod", default is "prod" -;; Mode "dev" makes Gitea easier to develop and debug, values other than "dev" are treated as "prod" which is for production use. -;RUN_MODE = prod -;; -;; The working directory, see the comment of AppWorkPath above -;WORK_PATH = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[server] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; The protocol the server listens on. One of "http", "https", "http+unix", "fcgi" or "fcgi+unix". -;PROTOCOL = http -;; -;; Set the domain for the server. -;DOMAIN = localhost -;; -;; The AppURL is used to generate public URL links, defaults to "{PROTOCOL}://{DOMAIN}:{HTTP_PORT}/". -;; Most users should set it to the real website URL of their Gitea instance when there is a reverse proxy. -;ROOT_URL = -;; -;; Controls how to detect the public URL. -;; Although it defaults to "legacy" (to avoid breaking existing users), most instances should use the "auto" behavior, -;; especially when the Gitea instance needs to be accessed in a container network. -;; * legacy: detect the public URL from "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL". -;; * auto: always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL". -;PUBLIC_URL_DETECTION = legacy -;; -;; For development purpose only. It makes Gitea handle sub-path ("/sub-path/owner/repo/...") directly when debugging without a reverse proxy. -;; DO NOT USE IT IN PRODUCTION!!! -;USE_SUB_URL_PATH = false -;; -;; when STATIC_URL_PREFIX is empty it will follow ROOT_URL -;STATIC_URL_PREFIX = -;; -;; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket. -;; If PROTOCOL is set to "http+unix" or "fcgi+unix", this should be the name of the Unix socket file to use. -;; Relative paths will be made absolute against the _`AppWorkPath`_. -;HTTP_ADDR = 0.0.0.0 -;; -;; The port to listen on for "http" or "https" protocol. Leave empty when using a unix socket. -;HTTP_PORT = 3000 -;; -;; Expect PROXY protocol headers on connections -;USE_PROXY_PROTOCOL = false -;; -;; Use PROXY protocol in TLS Bridging mode -;PROXY_PROTOCOL_TLS_BRIDGING = false -;; -;; Timeout to wait for PROXY protocol header (set to 0 to have no timeout) -;PROXY_PROTOCOL_HEADER_TIMEOUT = 5s -;; -;; Accept PROXY protocol headers with UNKNOWN type -;PROXY_PROTOCOL_ACCEPT_UNKNOWN = false -;; -;; If REDIRECT_OTHER_PORT is true, and PROTOCOL is set to https an http server -;; will be started on PORT_TO_REDIRECT and it will redirect plain, non-secure http requests to the main -;; ROOT_URL. Defaults are false for REDIRECT_OTHER_PORT and 80 for -;; PORT_TO_REDIRECT. -;REDIRECT_OTHER_PORT = false -;PORT_TO_REDIRECT = 80 -;; -;; expect PROXY protocol header on connections to https redirector, defaults to USE_PROXY_PROTOCOL -;REDIRECTOR_USE_PROXY_PROTOCOL = -;; Minimum and maximum supported TLS versions -;SSL_MIN_VERSION=TLSv1.2 -;SSL_MAX_VERSION= -;; -;; SSL Curve Preferences -;SSL_CURVE_PREFERENCES=X25519,P256 -;; -;; SSL Cipher Suites -;SSL_CIPHER_SUITES=; Will default to "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" if aes is supported by hardware, otherwise chacha will be first. -;; -;; Timeout for any write to the connection. (Set to -1 to disable all timeouts.) -;PER_WRITE_TIMEOUT = 30s -;; -;; Timeout per Kb written to connections. -;PER_WRITE_PER_KB_TIMEOUT = 30s -;; -;; Permission for unix socket -;UNIX_SOCKET_PERMISSION = 666 -;; -;; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In -;; most cases you do not need to change the default value. Alter it only if -;; your SSH server node is not the same as HTTP node. For different protocol, the default -;; values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`. -;; If `PROTOCOL` is `fcgi` or `fcgi+unix`, the default value is `{PROTOCOL}://{HTTP_ADDR}:{HTTP_PORT}/`. -;; If listen on `0.0.0.0`, the default value is `{PROTOCOL}://localhost:{HTTP_PORT}/`. -;; Otherwise the default value is `{PROTOCOL}://{HTTP_ADDR}:{HTTP_PORT}/`. -;; Most users don't need (and shouldn't) set this value. -;LOCAL_ROOT_URL = -;; -;; When making local connections pass the PROXY protocol header, defaults to USE_PROXY_PROTOCOL -;LOCAL_USE_PROXY_PROTOCOL = -;; -;; Disable SSH feature when not available -;DISABLE_SSH = false -;; -;; Whether to use the builtin SSH server or not. -;START_SSH_SERVER = false -;; -;; Expect PROXY protocol header on connections to the built-in SSH server -;SSH_SERVER_USE_PROXY_PROTOCOL = false -;; -;; Username to use for the builtin SSH server. If blank, then it is the value of RUN_USER. -;BUILTIN_SSH_SERVER_USER = -;; -;; Domain name to be exposed in clone URL, defaults to DOMAIN or the domain part of ROOT_URL -;SSH_DOMAIN = -;; -;; SSH username displayed in clone URLs. It defaults to BUILTIN_SSH_SERVER_USER or RUN_USER. -;; If it is set to "(DOER_USERNAME)", it will use current signed-in user's username. -;; This option is only for some advanced users who have configured their SSH reverse-proxy -;; and need to use different usernames for git SSH clone. -;; Most users should just leave it blank. -;SSH_USER = -;; -;; The network interface the builtin SSH server should listen on -;SSH_LISTEN_HOST = -;; -;; Port number to be exposed in clone URL -;SSH_PORT = 22 -;; -;; The port number the builtin SSH server should listen on, defaults to SSH_PORT -;SSH_LISTEN_PORT = -;; -;; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. -;SSH_ROOT_PATH = -;; -;; Gitea will create a authorized_keys file by default when it is not using the internal ssh server -;; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off. -;SSH_CREATE_AUTHORIZED_KEYS_FILE = true -;; -;; Gitea will create a authorized_principals file by default when it is not using the internal ssh server -;; If you intend to use the AuthorizedPrincipalsCommand functionality then you should turn this off. -;SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE = true -;; -;; For the builtin SSH server, choose the supported ciphers/key-exchange-algorithms/MACs for SSH connections. -;; The supported names are listed in https://github.com/golang/crypto/blob/master/ssh/common.go. -;; Leave them empty to use the Golang crypto's recommended default values. -;; For system SSH (non-builtin SSH server), this setting has no effect. -;SSH_SERVER_CIPHERS = -;SSH_SERVER_KEY_EXCHANGES = -;SSH_SERVER_MACS = -;; -;; For the built-in SSH server, choose the keypair to offer as the host key -;; The private key should be at SSH_SERVER_HOST_KEY and the public SSH_SERVER_HOST_KEY.pub -;; relative paths are made absolute relative to the APP_DATA_PATH -;SSH_SERVER_HOST_KEYS=ssh/gitea.rsa, ssh/gogs.rsa -;; -;; Enable SSH Authorized Key Backup when rewriting all keys, default is false -;SSH_AUTHORIZED_KEYS_BACKUP = false -;; -;; Determines which principals to allow -;; - empty: if SSH_TRUSTED_USER_CA_KEYS is empty this will default to off, otherwise will default to email, username. -;; - off: Do not allow authorized principals -;; - email: the principal must match the user's email -;; - username: the principal must match the user's username -;; - anything: there will be no checking on the content of the principal -;SSH_AUTHORIZED_PRINCIPALS_ALLOW = email, username -;; -;; Enable SSH Authorized Principals Backup when rewriting all keys, default is true -;SSH_AUTHORIZED_PRINCIPALS_BACKUP = true -;; -;; Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. -;; Multiple keys should be comma separated. -;; E.g."ssh- ". or "ssh- , ssh- ". -;; For more information see "TrustedUserCAKeys" in the sshd config manpages. -;SSH_TRUSTED_USER_CA_KEYS = -;; Absolute path of the `TrustedUserCaKeys` file gitea will manage. -;; Default this `RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem -;; If you're running your own ssh server and you want to use the gitea managed file you'll also need to modify your -;; sshd_config to point to this file. The official docker image will automatically work without further configuration. -;SSH_TRUSTED_USER_CA_KEYS_FILENAME = -;; -;; Enable exposure of SSH clone URL to anonymous visitors, default is false -;SSH_EXPOSE_ANONYMOUS = false -;; -;; Timeout for any write to ssh connections. (Set to -1 to disable all timeouts.) -;; Will default to the PER_WRITE_TIMEOUT. -;SSH_PER_WRITE_TIMEOUT = 30s -;; -;; Timeout per Kb written to ssh connections. -;; Will default to the PER_WRITE_PER_KB_TIMEOUT. -;SSH_PER_WRITE_PER_KB_TIMEOUT = 30s -;; -;; Indicate whether to check minimum key size with corresponding type -;MINIMUM_KEY_SIZE_CHECK = false -;; -;; Disable CDN even in "prod" mode -;OFFLINE_MODE = true -;; -;; TLS Settings: Either ACME or manual -;; (Other common TLS configuration are found before) -;ENABLE_ACME = false -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; ACME automatic TLS settings -;; -;; ACME directory URL (e.g. LetsEncrypt's staging/testing URL: https://acme-staging-v02.api.letsencrypt.org/directory) -;; Leave empty to default to LetsEncrypt's (production) URL -;ACME_URL = -;; -;; Explicitly accept the ACME's TOS. The specific TOS cannot be retrieved at the moment. -;ACME_ACCEPTTOS = false -;; -;; If the ACME CA is not in your system's CA trust chain, it can be manually added here -;ACME_CA_ROOT = -;; -;; Email used for the ACME registration service -;; Can be left blank to initialize at first run and use the cached value -;ACME_EMAIL = -;; -;; ACME live directory (not to be confused with ACME directory URL: ACME_URL) -;; (Refer to caddy's ACME manager https://github.com/caddyserver/certmagic) -;ACME_DIRECTORY = https -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Manual TLS settings: (Only applicable if ENABLE_ACME=false) -;; -;; Generate steps: -;; $ ./gitea cert -ca=true -duration=8760h0m0s -host=myhost.example.com -;; -;; Or from a .pfx file exported from the Windows certificate store (do -;; not forget to export the private key): -;; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys -;; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes -;; Paths are relative to CUSTOM_PATH -;CERT_FILE = https/cert.pem -;KEY_FILE = https/key.pem -;; -;; Root directory containing templates and static files. -;; default is the path where Gitea is executed -;STATIC_ROOT_PATH = ; Will default to the built-in value _`StaticRootPath`_ -;; -;; Default path for App data -;APP_DATA_PATH = data ; relative paths will be made absolute with _`AppWorkPath`_ -;; -;; Base path for App's temp files, leave empty to use the managed tmp directory in APP_DATA_PATH -;APP_TEMP_PATH = -;; -;; Enable gzip compression for runtime-generated content, static resources excluded -;ENABLE_GZIP = false -;; -;; Application profiling (memory and cpu) -;; For "web" command it listens on localhost:6060 -;; For "serve" command it dumps to disk at PPROF_DATA_PATH as (cpuprofile|memprofile)__ -;ENABLE_PPROF = false -;; -;; PPROF_DATA_PATH, use an absolute path when you start gitea as service -;PPROF_DATA_PATH = data/tmp/pprof ; Path is relative to _`AppWorkPath`_ -;; -;; Landing page, can be "home", "explore", "organizations", "login", or any URL such as "/org/repo" or even "https://anotherwebsite.com" -;; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in. -;LANDING_PAGE = home -;; -;; Enables git-lfs support. true or false, default is false. -;LFS_START_SERVER = false -;; -;; Enables git-lfs SSH protocol support. true or false, default is false. -;LFS_ALLOW_PURE_SSH = false -;; -;; LFS authentication secret, change this yourself -;LFS_JWT_SECRET = -;; -;; Alternative location to specify LFS authentication secret. You cannot specify both this and LFS_JWT_SECRET, and must pick one -;LFS_JWT_SECRET_URI = file:/etc/gitea/lfs_jwt_secret -;; -;; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail. -;LFS_HTTP_AUTH_EXPIRY = 24h -;; -;; Maximum allowed LFS file size in bytes (Set to 0 for no limit). -;LFS_MAX_FILE_SIZE = 0 -;; -;; Maximum number of locks returned per page -;LFS_LOCKS_PAGING_NUM = 50 -;; -;; When clients make lfs batch requests, reject them if there are more pointers than this number -;; zero means 'unlimited' -;LFS_MAX_BATCH_SIZE = 0 -;; -;; Allow graceful restarts using SIGHUP to fork -;ALLOW_GRACEFUL_RESTARTS = true -;; -;; After a restart the parent will finish ongoing requests before -;; shutting down. Force shutdown if this process takes longer than this delay. -;; set to a negative value to disable -;GRACEFUL_HAMMER_TIME = 60s -;; -;; Allows the setting of a startup timeout and waithint for Windows as SVC service -;; 0 disables this. -;STARTUP_TIMEOUT = 0 -;; -;; Static resources, includes resources on custom/, public/ and all uploaded avatars web browser cache time. Note that this cache is disabled when RUN_MODE is "dev". Default is 6h -;STATIC_CACHE_TIME = 6h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[database] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3". -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; MySQL Configuration -;; -DB_TYPE = mysql -HOST = 127.0.0.1:3306 ; can use socket e.g. /var/run/mysqld/mysqld.sock -NAME = gitea -USER = root -;PASSWD = ;Use PASSWD = `your password` for quoting if you use special characters in the password. -;SSL_MODE = false ; either "false" (default), "true", or "skip-verify" -;CHARSET_COLLATION = ; Empty as default, Gitea will try to find a case-sensitive collation. Don't change it unless you clearly know what you need. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Postgres Configuration -;; -;DB_TYPE = postgres -;HOST = 127.0.0.1:5432 ; can use socket e.g. /var/run/postgresql/ -;NAME = gitea -;USER = root -;PASSWD = -;SCHEMA = -;SSL_MODE=disable ;either "disable" (default), "require", or "verify-full" -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; SQLite Configuration -;; -;DB_TYPE = sqlite3 -;PATH= ; defaults to data/gitea.db -;SQLITE_TIMEOUT = ; Query timeout defaults to: 500 -;SQLITE_JOURNAL_MODE = ; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; MSSQL Configuration -;; -;DB_TYPE = mssql -;HOST = 172.17.0.2:1433 -;NAME = gitea -;USER = SA -;PASSWD = MwantsaSecurePassword1 -;CHARSET_COLLATION = ; Empty as default, Gitea will try to find a case-sensitive collation. Don't change it unless you clearly know what you need. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Other settings -;; -;; For iterate buffer, default is 50 -;ITERATE_BUFFER_SIZE = 50 -;; -;; Show the database generated SQL -;LOG_SQL = false -;; -;; Maximum number of DB Connect retries -;DB_RETRIES = 10 -;; -;; Backoff time per DB retry (time.Duration) -;DB_RETRY_BACKOFF = 3s -;; -;; Max idle database connections on connection pool, default is 2 -;MAX_IDLE_CONNS = 2 -;; -;; Database connection max life time, default is 0 or 3s mysql (See #6804 & #7071 for reasoning) -;CONN_MAX_LIFETIME = 3s -;; -;; Database maximum number of open connections, default is 0 meaning no maximum -;MAX_OPEN_CONNS = 0 -;; -;; Whether execute database models migrations automatically -;AUTO_MIGRATION = true -;; -;; Threshold value (in seconds) beyond which query execution time is logged as a warning in the xorm logger -;; -;SLOW_QUERY_THRESHOLD = 5s - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[security] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Whether the installer is disabled (set to true to disable the installer) -INSTALL_LOCK = false -;; -;; Global secret key that will be used -;; This key is VERY IMPORTANT. If you lose it, the data encrypted by it (like 2FA secret) can't be decrypted anymore. -SECRET_KEY = -;; -;; Alternative location to specify secret key, instead of this file; you cannot specify both this and SECRET_KEY, and must pick one -;; This key is VERY IMPORTANT. If you lose it, the data encrypted by it (like 2FA secret) can't be decrypted anymore. -;SECRET_KEY_URI = file:/etc/gitea/secret_key -;; -;; Secret used to validate communication within Gitea binary. -INTERNAL_TOKEN = -;; -;; Alternative location to specify internal token, instead of this file; you cannot specify both this and INTERNAL_TOKEN, and must pick one -;INTERNAL_TOKEN_URI = file:/etc/gitea/internal_token -;; -;; How long to remember that a user is logged in before requiring relogin (in days) -;LOGIN_REMEMBER_DAYS = 31 -;; -;; Name of the cookie used to store the current username. -;COOKIE_USERNAME = gitea_awesome -;; -;; Name of cookie used to store authentication information. -;COOKIE_REMEMBER_NAME = gitea_incredible -;; -;; Reverse proxy authentication header name of user name, email, and full name -;REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER -;REVERSE_PROXY_AUTHENTICATION_EMAIL = X-WEBAUTH-EMAIL -;REVERSE_PROXY_AUTHENTICATION_FULL_NAME = X-WEBAUTH-FULLNAME -;; -;; Interpret X-Forwarded-For header or the X-Real-IP header and set this as the remote IP for the request -;REVERSE_PROXY_LIMIT = 1 -;; -;; List of IP addresses and networks separated by comma of trusted proxy servers. Use `*` to trust all. -;REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128 -;; -;; The minimum password length for new Users -;MIN_PASSWORD_LENGTH = 8 -;; -;; Set to true to allow users to import local server paths -;IMPORT_LOCAL_PATHS = false -;; -;; Set to false to allow users with git hook privileges to create custom git hooks. -;; Custom git hooks can be used to perform arbitrary code execution on the host operating system. -;; This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service. -;; By modifying the Gitea database, users can gain Gitea administrator privileges. -;; It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user. -;; WARNING: This maybe harmful to you website or your operating system. -;; WARNING: Setting this to true does not change existing hooks in git repos; adjust it before if necessary. -;DISABLE_GIT_HOOKS = true -;; -;; Set to true to disable webhooks feature. -;DISABLE_WEBHOOKS = false -;; -;; Set to false to allow pushes to gitea repositories despite having an incomplete environment - NOT RECOMMENDED -;ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET = true -;; -;;Comma separated list of character classes required to pass minimum complexity. -;;If left empty or no valid values are specified, the default is off (no checking) -;;Classes include "lower,upper,digit,spec" -;PASSWORD_COMPLEXITY = off -;; -;; Password Hash algorithm, either "argon2", "pbkdf2", "scrypt" or "bcrypt" -;PASSWORD_HASH_ALGO = pbkdf2 -;; -;; Set false to allow JavaScript to read CSRF cookie -;CSRF_COOKIE_HTTP_ONLY = true -;; -;; Validate against https://haveibeenpwned.com/Passwords to see if a password has been exposed -;PASSWORD_CHECK_PWN = false -;; -;; Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. -;; This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security. -;SUCCESSFUL_TOKENS_CACHE_SIZE = 20 -;; -;; Reject API tokens sent in URL query string (Accept Header-based API tokens only). This avoids security vulnerabilities -;; stemming from cached/logged plain-text API tokens. -;; In future releases, this will become the default behavior -;DISABLE_QUERY_AUTH_TOKEN = false -;; -;; On user registration, record the IP address and user agent of the user to help identify potential abuse. -;; RECORD_USER_SIGNUP_METADATA = false -;; -;; Set the two-factor auth behavior. -;; Set to "enforced", to force users to enroll into Two-Factor Authentication, users without 2FA have no access to repositories via API or web. -;TWO_FACTOR_AUTH = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[camo] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; At the moment we only support images -;; -;; if the camo is enabled -;ENABLED = false -;; url to a camo image proxy, it **is required** if camo is enabled. -;SERVER_URL = -;; HMAC to encode urls with, it **is required** if camo is enabled. -;HMAC_KEY = -;; Set to true to use camo for https too lese only non https urls are proxyed -;; ALLWAYS is deprecated and will be removed in the future -;ALWAYS = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[oauth2] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Enables OAuth2 provider -ENABLED = true -;; -;; Algorithm used to sign OAuth2 tokens. Valid values: HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, EdDSA -;JWT_SIGNING_ALGORITHM = RS256 -;; -;; Private key file path used to sign OAuth2 tokens. The path is relative to APP_DATA_PATH. -;; This setting is only needed if JWT_SIGNING_ALGORITHM is set to RS256, RS384, RS512, ES256, ES384 or ES512. -;; The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you. -;JWT_SIGNING_PRIVATE_KEY_FILE = jwt/private.pem -;; -;; OAuth2 authentication secret for access and refresh tokens, change this yourself to a unique string. CLI generate option is helpful in this case. https://docs.gitea.io/en-us/command-line/#generate -;; This setting is only needed if JWT_SIGNING_ALGORITHM is set to HS256, HS384 or HS512. -;JWT_SECRET = -;; -;; Alternative location to specify OAuth2 authentication secret. You cannot specify both this and JWT_SECRET, and must pick one -;JWT_SECRET_URI = file:/etc/gitea/oauth2_jwt_secret -;; -;; Lifetime of an OAuth2 access token in seconds -;ACCESS_TOKEN_EXPIRATION_TIME = 3600 -;; -;; Lifetime of an OAuth2 refresh token in hours -;REFRESH_TOKEN_EXPIRATION_TIME = 730 -;; -;; Check if refresh token got already used -;INVALIDATE_REFRESH_TOKENS = false -;; -;; Maximum length of oauth2 token/cookie stored on server -;MAX_TOKEN_LENGTH = 32767 -;; -;; Pre-register OAuth2 applications for some universally useful services -;; * https://github.com/hickford/git-credential-oauth -;; * https://github.com/git-ecosystem/git-credential-manager -;; * https://gitea.com/gitea/tea -;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[log] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Root path for the log files - defaults to "{AppWorkPath}/log" -;ROOT_PATH = -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Main Logger -;; -;; Either "console", "file" or "conn", default is "console" -;; Use comma to separate multiple modes, e.g. "console, file" -MODE = console -;; -;; Either "Trace", "Debug", "Info", "Warn", "Error" or "None", default is "Info" -LEVEL = Info -;; -;; Print Stacktrace with logs (rarely helpful, do not set) Either "Trace", "Debug", "Info", "Warn", "Error", default is "None" -;STACKTRACE_LEVEL = None -;; -;; Buffer length of the channel, keep it as it is if you don't know what it is. -;BUFFER_LEN = 10000 -;; -;; Sub logger modes, a single comma means use default MODE above, empty means disable it -;logger.access.MODE= -;logger.router.MODE=, -;logger.xorm.MODE=, -;; -;; Collect SSH logs (Creates log from ssh git request) -;; -;ENABLE_SSH_LOG = false -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Access Logger (Creates log in NCSA common log format) -;; -;; Print request id which parsed from request headers in access log, when access log is enabled. -;; * E.g: -;; * In request Header: X-Request-ID: test-id-123 -;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID -;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "test-id-123" -;; -;; If you configure more than one in the .ini file, it will match in the order of configuration, -;; and the first match will be finally printed in the log. -;; * E.g: -;; * In request Header: X-Trace-ID: trace-id-1q2w3e4r -;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID, X-Trace-ID, X-Req-ID -;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "trace-id-1q2w3e4r" -;; -;REQUEST_ID_HEADERS = -;; -;; Sets the template used to create the access log. -;ACCESS_LOG_TEMPLATE = {{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}" - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Log modes (aka log writers) -;; -;[log.%(WriterMode)] -;MODE=console/file/conn/... -;LEVEL= -;FLAGS = stdflags -;EXPRESSION = -;PREFIX = -;COLORIZE = false -;; -;[log.console] -;STDERR = false -;; -;[log.file] -;; Set the file_name for the logger. If this is a relative path this will be relative to ROOT_PATH -;FILE_NAME = -;; This enables automated log rotate(switch of following options), default is true -;LOG_ROTATE = true -;; Max size shift of a single file, default is 28 means 1 << 28, 256MB -;MAX_SIZE_SHIFT = 28 -;; Segment log daily, default is true -;DAILY_ROTATE = true -;; delete the log file after n days, default is 7 -;MAX_DAYS = 7 -;; compress logs with gzip -;COMPRESS = true -;; compression level see godoc for compress/gzip -;COMPRESSION_LEVEL = -1 -;; -;[log.conn] -;; Reconnect host for every single message, default is false -;RECONNECT_ON_MSG = false -;; Try to reconnect when connection is lost, default is false -;RECONNECT = false -;; Either "tcp", "unix" or "udp", default is "tcp" -;PROTOCOL = tcp -;; Host address -;ADDR = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[git] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; The path of git executable. If empty, Gitea searches through the PATH environment. -;PATH = -;; -;; The HOME directory for Git, defaults to "{APP_DATA_PATH}/home" -;HOME_PATH = -;; -;; Disables highlight of added and removed changes -;DISABLE_DIFF_HIGHLIGHT = false -;; -;; Max number of lines allowed in a single file in diff view -;MAX_GIT_DIFF_LINES = 1000 -;; -;; Max number of allowed characters in a line in diff view -;MAX_GIT_DIFF_LINE_CHARACTERS = 5000 -;; -;; Max number of files shown in diff view -;MAX_GIT_DIFF_FILES = 100 -;; -;; Set the default commits range size -;COMMITS_RANGE_SIZE = 50 -;; -;; Set the default branches range size -;BRANCHES_RANGE_SIZE = 20 -;; -;; Arguments for command 'git gc', e.g. "--aggressive --auto" -;; see more on http://git-scm.com/docs/git-gc/ -;GC_ARGS = -;; -;; If use git wire protocol version 2 when git version >= 2.18, default is true, set to false when you always want git wire protocol version 1 -;; To enable this for Git over SSH when using a OpenSSH server, add `AcceptEnv GIT_PROTOCOL` to your sshd_config file. -;ENABLE_AUTO_GIT_WIRE_PROTOCOL = true -;; -;; Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled) -;PULL_REQUEST_PUSH_MESSAGE = true -;; -;; (Go-Git only) Don't cache objects greater than this in memory. (Set to 0 to disable.) -;LARGE_OBJECT_THRESHOLD = 1048576 -;; Set to true to forcibly set core.protectNTFS=false -;DISABLE_CORE_PROTECT_NTFS=false -;; Disable the usage of using partial clones for git. -;DISABLE_PARTIAL_CLONE = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Git Operation timeout in seconds -;[git.timeout] -;DEFAULT = 360 -;MIGRATE = 600 -;MIRROR = 300 -;CLONE = 300 -;PULL = 300 -;GC = 60 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Git config options -;; This section only does "set" config, a removed config key from this section won't be removed from git config automatically. The format is `some.configKey = value`. -;[git.config] -;diff.algorithm = histogram -;core.logAllRefUpdates = true -;gc.reflogExpire = 90 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[service] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Time limit to confirm account/email registration -;ACTIVE_CODE_LIVE_MINUTES = 180 -;; -;; Time limit to perform the reset of a forgotten password -;RESET_PASSWD_CODE_LIVE_MINUTES = 180 -;; -;; Whether a new user needs to confirm their email when registering. -;REGISTER_EMAIL_CONFIRM = false -;; -;; Whether a new user needs to be confirmed manually after registration. (Requires `REGISTER_EMAIL_CONFIRM` to be disabled.) -;REGISTER_MANUAL_CONFIRM = false -;; -;; List of domain names that are allowed to be used to register on a Gitea instance, wildcard is supported -;; eg: gitea.io,example.com,*.mydomain.com -;EMAIL_DOMAIN_ALLOWLIST = -;; -;; Comma-separated list of domain names that are not allowed to be used to register on a Gitea instance, wildcard is supported -;EMAIL_DOMAIN_BLOCKLIST = -;; -;; Disallow registration, only allow admins to create accounts. -;DISABLE_REGISTRATION = false -;; -;; Allow registration only using gitea itself, it works only when DISABLE_REGISTRATION is false -;ALLOW_ONLY_INTERNAL_REGISTRATION = false -;; -;; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false -;ALLOW_ONLY_EXTERNAL_REGISTRATION = false -;; -;; User must sign in to view anything. -;; It could be set to "expensive" to block anonymous users accessing some pages which consume a lot of resources, -;; for example: block anonymous AI crawlers from accessing repo code pages. -;; The "expensive" mode is experimental and subject to change. -;REQUIRE_SIGNIN_VIEW = false -;; -;; Mail notification -;ENABLE_NOTIFY_MAIL = false -;; -;; This setting enables gitea to be signed in with HTTP BASIC Authentication using the user's password -;; If you set this to false you will not be able to access the tokens endpoints on the API with your password -;; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token -;ENABLE_BASIC_AUTHENTICATION = true -;; -;; Show the password sign-in form (for password-based login), otherwise, only show OAuth2 or passkey login methods if they are enabled. -;; If you set it to false, maybe it also needs to set ENABLE_BASIC_AUTHENTICATION to false to completely disable password-based authentication. -;ENABLE_PASSWORD_SIGNIN_FORM = true -;; -;; Allow users to sign-in with a passkey -;ENABLE_PASSKEY_AUTHENTICATION = true -;; -;; More detail: https://github.com/gogits/gogs/issues/165 -;ENABLE_REVERSE_PROXY_AUTHENTICATION = false -; Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. -;ENABLE_REVERSE_PROXY_AUTHENTICATION_API = false -;ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false -;ENABLE_REVERSE_PROXY_EMAIL = false -;ENABLE_REVERSE_PROXY_FULL_NAME = false -;; -;; Enable captcha validation for registration -;ENABLE_CAPTCHA = false -;; -;; Enable this to require captcha validation for login -;REQUIRE_CAPTCHA_FOR_LOGIN = false -;; -;; Type of captcha you want to use. Options: image, recaptcha, hcaptcha, mcaptcha, cfturnstile. -;CAPTCHA_TYPE = image -;; -;; Change this to use recaptcha.net or other recaptcha service -;RECAPTCHA_URL = https://www.google.com/recaptcha/ -;; Enable recaptcha to use Google's recaptcha service -;; Go to https://www.google.com/recaptcha/admin to sign up for a key -;RECAPTCHA_SECRET = -;RECAPTCHA_SITEKEY = -;; -;; For hCaptcha, create an account at https://accounts.hcaptcha.com/login to get your keys -;HCAPTCHA_SECRET = -;HCAPTCHA_SITEKEY = -;; -;; Change this to use demo.mcaptcha.org or your self-hosted mcaptcha.org instance. -;MCAPTCHA_URL = https://demo.mcaptcha.org -;; -;; Go to your configured mCaptcha instance and register a sitekey -;; and use your account's secret. -;MCAPTCHA_SECRET = -;MCAPTCHA_SITEKEY = -;; -;; Go to https://dash.cloudflare.com/?to=/:account/turnstile to sign up for a key -;CF_TURNSTILE_SITEKEY = -;CF_TURNSTILE_SECRET = -;; -;; Default value for KeepEmailPrivate -;; Each new user will get the value of this setting copied into their profile -;DEFAULT_KEEP_EMAIL_PRIVATE = false -;; -;; Default value for AllowCreateOrganization -;; Every new user will have rights set to create organizations depending on this setting -;DEFAULT_ALLOW_CREATE_ORGANIZATION = true -;; Default value for IsRestricted -;; Every new user will have restricted permissions depending on this setting -;DEFAULT_USER_IS_RESTRICTED = false -;; -;; Either "public", "limited" or "private", default is "public" -;; Limited is for users visible only to signed users -;; Private is for users visible only to members of their organizations -;; Public is for users visible for everyone -;DEFAULT_USER_VISIBILITY = public -;; -;; Set which visibility modes a user can have -;ALLOWED_USER_VISIBILITY_MODES = public,limited,private -;; -;; Either "public", "limited" or "private", default is "public" -;; Limited is for organizations visible only to signed users -;; Private is for organizations visible only to members of the organization -;; Public is for organizations visible to everyone -;DEFAULT_ORG_VISIBILITY = public -;; -;; Default value for DefaultOrgMemberVisible -;; True will make the membership of the users visible when added to the organisation -;DEFAULT_ORG_MEMBER_VISIBLE = false -;; -;; Default value for EnableDependencies -;; Repositories will use dependencies by default depending on this setting -;DEFAULT_ENABLE_DEPENDENCIES = true -;; -;; Dependencies can be added from any repository where the user is granted access or only from the current repository depending on this setting. -;ALLOW_CROSS_REPOSITORY_DEPENDENCIES = true -;; -;; Default map service. No external API support has been included. A service has to allow -;; searching using URL parameters, the location will be appended to the URL as escaped query parameter. -;; Disabled by default, some example values are: -;; - OpenStreetMap: https://www.openstreetmap.org/search?query= -;; - Google Maps: https://www.google.com/maps/place/ -;; - MapQuest: https://www.mapquest.com/search/ -;; - Bing Maps: https://www.bing.com/maps?where1= -; USER_LOCATION_MAP_URL = -;; -;; Enable heatmap on users profiles. -;ENABLE_USER_HEATMAP = true -;; -;; Enable Timetracking -;ENABLE_TIMETRACKING = true -;; -;; Default value for EnableTimetracking -;; Repositories will use timetracking by default depending on this setting -;DEFAULT_ENABLE_TIMETRACKING = true -;; -;; Default value for AllowOnlyContributorsToTrackTime -;; Only users with write permissions can track time if this is true -;DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME = true -;; -;; Value for the domain part of the user's email address in the git log if user -;; has set KeepEmailPrivate to true. The user's email will be replaced with a -;; concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS. Default -;; value is "noreply." + DOMAIN, where DOMAIN resolves to the value from server.DOMAIN -;; Note: do not use the notation below -;NO_REPLY_ADDRESS = ; noreply. -;; -;; Show Registration button -;SHOW_REGISTRATION_BUTTON = true -;; -;; Show milestones dashboard page - a view of all the user's milestones -;SHOW_MILESTONES_DASHBOARD_PAGE = true -;; -;; Default value for AutoWatchNewRepos -;; When adding a repo to a team or creating a new repo all team members will watch the -;; repo automatically if enabled -;AUTO_WATCH_NEW_REPOS = true -;; -;; Default value for AutoWatchOnChanges -;; Make the user watch a repository When they commit for the first time -;AUTO_WATCH_ON_CHANGES = false -;; -;; Minimum amount of time a user must exist before comments are kept when the user is deleted. -;USER_DELETE_WITH_COMMENTS_MAX_TIME = 0 -;; Valid site url schemes for user profiles -;VALID_SITE_URL_SCHEMES=http,https - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[service.explore] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Only allow signed in users to view the explore pages. -;REQUIRE_SIGNIN_VIEW = false -;; -;; Disable the users explore page. -;DISABLE_USERS_PAGE = false -;; -;; Disable the organizations explore page. -;DISABLE_ORGANIZATIONS_PAGE = false -;; -;; Disable the code explore page. -;DISABLE_CODE_PAGE = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[qos] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Enable request quality of service and overload protection. -; ENABLED = false -;; -;; The maximum number of concurrent requests that the server will -;; process before enqueueing new requests. Default is "CpuNum * 4". -; MAX_INFLIGHT = -;; -;; The maximum number of requests that can be enqueued before new -;; requests will be dropped. -; MAX_WAITING = 100 -;; -;; Target maximum wait time a request may be enqueued for. Requests -;; that are enqueued for less than this amount of time will not be -;; dropped. When wait times exceed this amount, a portion of requests -;; will be dropped until wait times have decreased below this amount. -; TARGET_WAIT_TIME = 250ms - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Other Settings -;; -;; Uncomment the [section.header] if you wish to -;; set the below settings. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Root path for storing all repository data. By default, it is set to "{APP_DATA_PATH}/gitea-repositories". -;; A relative path is interpreted as "{AppWorkPath}/{ROOT}" (use AppWorkPath as base path). -;ROOT = -;; -;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. -;SCRIPT_TYPE = bash -;; -;; DETECTED_CHARSETS_ORDER tie-break order for detected charsets. -;; If the charsets have equal confidence, tie-breaking will be done by order in this list -;; with charsets earlier in the list chosen in preference to those later. -;; Adding "defaults" will place the unused charsets at that position. -;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 -;; -;; Default ANSI charset to override non-UTF-8 charsets to -;ANSI_CHARSET = -;; -;; Force every new repository to be private -;FORCE_PRIVATE = false -;; -;; Default privacy setting when creating a new repository, allowed values: last, private, public. Default is last which means the last setting used. -;DEFAULT_PRIVATE = last -;; -;; Default private when using push-to-create -;DEFAULT_PUSH_CREATE_PRIVATE = true -;; -;; Global limit of repositories per user, applied at creation time. -1 means no limit -;MAX_CREATION_LIMIT = -1 -;; -;; Preferred Licenses to place at the top of the List -;; The name here must match the filename in options/license or custom/options/license -;PREFERRED_LICENSES = Apache License 2.0,MIT License -;; -;; Disable the ability to interact with repositories using the HTTP protocol -;DISABLE_HTTP_GIT = false -;; -;; Value for Access-Control-Allow-Origin header, default is not to present -;; WARNING: This may be harmful to your website if you do not give it a right value. -;ACCESS_CONTROL_ALLOW_ORIGIN = -;; -;; Force ssh:// clone url instead of scp-style uri when default SSH port is used -;USE_COMPAT_SSH_URI = false -;; -;; Value for the "go get" request returns the repository url as https or ssh, default is https -;GO_GET_CLONE_URL_PROTOCOL = https -;; -;; Close issues as long as a commit on any branch marks it as fixed -;DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false -;; -;; Allow users to push local repositories to Gitea and have them automatically created for a user or an org -;ENABLE_PUSH_CREATE_USER = false -;ENABLE_PUSH_CREATE_ORG = false -;; -;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions. -;DISABLED_REPO_UNITS = -;; -;; Comma separated list of default new repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions. -;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. -;; External wiki and issue tracker can't be enabled by default as it requires additional settings. -;; Disabled repo units will not be added to new repositories regardless if it is in the default list. -;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions -;; -;; Comma separated list of default forked repo units. -;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. -;DEFAULT_FORK_REPO_UNITS = repo.code,repo.pulls -;; -;; Comma separated list of default mirror repo units. -;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. -;DEFAULT_MIRROR_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.wiki,repo.projects,repo.packages -;; -;; Comma separated list of default template repo units. -;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. -;DEFAULT_TEMPLATE_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages -;; -;; Prefix archive files by placing them in a directory named after the repository -;PREFIX_ARCHIVE_FILES = true -;; -;; Disable migrating feature. -;DISABLE_MIGRATIONS = false -;; -;; Disable stars feature. -;DISABLE_STARS = false -;; -;; The default branch name of new repositories -;DEFAULT_BRANCH = main -;; -;; Allow adoption of unadopted repositories -;ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES = false -;; -;; Allow deletion of unadopted repositories -;ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false - -;; Don't allow download source archive files from UI -;DISABLE_DOWNLOAD_SOURCE_ARCHIVES = false - -;; Allow to fork repositories without maximum number limit -;ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT = true - -;; Allow to fork repositories into the same owner (user or organization) -;; This feature is experimental, not fully tested, and may be changed in the future -;ALLOW_FORK_INTO_SAME_OWNER = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.editor] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; List of file extensions for which lines should be wrapped in the Monaco editor -;; Separate extensions with a comma. To line wrap files without an extension, just put a comma -;LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,.livemd, - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.upload] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Whether repository file uploads are enabled. Defaults to `true` -;ENABLED = true -;; -;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -;ALLOWED_TYPES = -;; -;; Max size of each file in megabytes. Defaults to 50MB -;FILE_MAX_SIZE = 50 -;; -;; Max number of files per upload. Defaults to 5 -;MAX_FILES = 5 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.pull-request] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; List of prefixes used in Pull Request title to mark them as Work In Progress (matched in a case-insensitive manner) -;WORK_IN_PROGRESS_PREFIXES = WIP:,[WIP] -;; -;; List of keywords used in Pull Request comments to automatically close a related issue -;CLOSE_KEYWORDS = close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved -;; -;; List of keywords used in Pull Request comments to automatically reopen a related issue -;REOPEN_KEYWORDS = reopen,reopens,reopened -;; -;; Set default merge style for repository creating, valid options: merge, rebase, rebase-merge, squash, fast-forward-only -;DEFAULT_MERGE_STYLE = merge -;; -;; In the default merge message for squash commits include at most this many commits -;DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT = 50 -;; -;; In the default merge message for squash commits limit the size of the commit messages to this -;DEFAULT_MERGE_MESSAGE_SIZE = 5120 -;; -;; In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list -;DEFAULT_MERGE_MESSAGE_ALL_AUTHORS = false -;; -;; In default merge messages limit the number of approvers listed as Reviewed-by: to this many -;DEFAULT_MERGE_MESSAGE_MAX_APPROVERS = 10 -;; -;; In default merge messages only include approvers who are official -;DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY = true -;; -;; In default squash-merge messages include the commit message of all commits comprising the pull request. -;POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES = false -;; -;; Add co-authored-by and co-committed-by trailers if committer does not match author -;ADD_CO_COMMITTER_TRAILERS = true -;; -;; In addition to testing patches using the three-way merge method, re-test conflicting patches with git apply -;TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY = false -;; -;; Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo. -;RETARGET_CHILDREN_ON_MERGE = true -;; -;; Delay mergeable check until page view or API access, for pull requests that have not been updated in the specified days when their base branches get updated. -;; Use "-1" to always check all pull requests (old behavior). Use "0" to always delay the checks. -;DELAY_CHECK_FOR_INACTIVE_DAYS = 7 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.issue] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; List of reasons why a Pull Request or Issue can be locked -;LOCK_REASONS = Too heated,Off-topic,Resolved,Spam -;; Maximum number of pinned Issues per repo -;; Set to 0 to disable pinning Issues -;MAX_PINNED = 3 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.release] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -;ALLOWED_TYPES = -;DEFAULT_PAGING_NUM = 10 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.signing] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; GPG or SSH key to use to sign commits, Defaults to the default - that is the value of git config --get user.signingkey -;; Depending on the value of SIGNING_FORMAT this is either: -;; - openpgp: the GPG key ID -;; - ssh: the path to the ssh public key "/path/to/key.pub": where "/path/to/key" is the private key, use ssh-keygen -t ed25519 to generate a new key pair without password -;; run in the context of the RUN_USER -;; Switch to none to stop signing completely -;SIGNING_KEY = default -;; -;; If a SIGNING_KEY ID is provided and is not set to default, use the provided Name and Email address as the signer and the signing format. -;; These should match a publicized name and email address for the key. (When SIGNING_KEY is default these are set to -;; the results of git config --get user.name, git config --get user.email and git config --default openpgp --get gpg.format respectively and can only be overridden -;; by setting the SIGNING_KEY ID to the correct ID.) -;SIGNING_NAME = -;SIGNING_EMAIL = -;; SIGNING_FORMAT can be one of: -;; - openpgp (default): use GPG to sign commits -;; - ssh: use SSH to sign commits -;SIGNING_FORMAT = openpgp -;; -;; Sets the default trust model for repositories. Options are: collaborator, committer, collaboratorcommitter -;DEFAULT_TRUST_MODEL = collaborator -;; -;; Determines when gitea should sign the initial commit when creating a repository -;; Either: -;; - never -;; - pubkey: only sign if the user has a pubkey -;; - twofa: only sign if the user has logged in with twofa -;; - always -;; options other than none and always can be combined as comma separated list -;INITIAL_COMMIT = always -;; -;; Determines when to sign for CRUD actions -;; - as above -;; - parentsigned: requires that the parent commit is signed. -;CRUD_ACTIONS = pubkey, twofa, parentsigned -;; Determines when to sign Wiki commits -;; - as above -;WIKI = never -;; -;; Determines when to sign on merges -;; - basesigned: require that the parent of commit on the base repo is signed. -;; - commitssigned: require that all the commits in the head branch are signed. -;; - approved: only sign when merging an approved pr to a protected branch -;MERGES = pubkey, twofa, basesigned, commitssigned -;; -;; Determines which additional ssh keys are trusted for all signed commits regardless of the user -;; This is useful for ssh signing key rotation. -;; Exposes the provided SIGNING_NAME and SIGNING_EMAIL as the signer, regardless of the SIGNING_FORMAT value. -;; Multiple keys should be comma separated. -;; E.g."ssh- ". or "ssh- , ssh- ". -;TRUSTED_SSH_KEYS = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.mimetype_mapping] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Custom MIME type mapping for downloadable files -;.apk=application/vnd.android.package-archive - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[project] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Default templates for project boards -;PROJECT_BOARD_BASIC_KANBAN_TYPE = To Do, In Progress, Done -;PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High Priority, Low Priority, Closed - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cors] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; More information about CORS can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers -;; enable cors headers (disabled by default) -;ENABLED = false -;; -;; list of requesting origins that are allowed, eg: "https://*.example.com" -;ALLOW_DOMAIN = * -;; -;; list of methods allowed to request -;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS -;; -;; max time to cache response -;MAX_AGE = 10m -;; -;; allow request with credentials -;ALLOW_CREDENTIALS = false -;; -;; headers to permit -;HEADERS = Content-Type,User-Agent -;; -;; set X-FRAME-OPTIONS header -;X_FRAME_OPTIONS = SAMEORIGIN - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ui] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Number of repositories that are displayed on one explore page -;EXPLORE_PAGING_NUM = 20 -;; -;; Number of issues that are displayed on one page -;ISSUE_PAGING_NUM = 20 -;; -;; Number of maximum commits displayed in one activity feed -;FEED_MAX_COMMIT_NUM = 5 -;; -;; Number of items that are displayed in home feed -;FEED_PAGING_NUM = 20 -;; -;; Number of items that are displayed in a single subsitemap -;SITEMAP_PAGING_NUM = 20 -;; -;; Number of maximum commits displayed in commit graph. -;GRAPH_MAX_COMMIT_NUM = 100 -;; -;; Number of line of codes shown for a code comment -;CODE_COMMENT_LINES = 4 -;; -;; Max size of files to be displayed (default is 8MiB) -;MAX_DISPLAY_FILE_SIZE = 8388608 -;; -;; Detect ambiguous unicode characters in file contents and show warnings on the UI -;AMBIGUOUS_UNICODE_DETECTION = true -;; -;; Whether the email of the user should be shown in the Explore Users page -;SHOW_USER_EMAIL = true -;; -;; Set the default theme for the Gitea install -;DEFAULT_THEME = gitea-auto -;; -;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`. -;; Leave it empty to allow users to select any theme from "{CustomPath}/public/assets/css/theme-*.css" -;THEMES = -;; -;; The icons for file list (basic/material), this is a temporary option which will be replaced by a user setting in the future. -;FILE_ICON_THEME = material -;; -;; All available reactions users can choose on issues/prs and comments. -;; Values can be emoji alias (:smile:) or a unicode emoji. -;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png -;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes -;; -;; Change the number of users that are displayed in reactions tooltip (triggered by mouse hover). -;REACTION_MAX_USER_NUM = 10 -;; -;; Additional Emojis not defined in the utf8 standard -;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config. -;; Dont mistake it for Reactions. -;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs -;; -;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used. -;DEFAULT_SHOW_FULL_NAME = false -;; -;; Whether to search within description at repository search on explore page. -;SEARCH_REPO_DESCRIPTION = true -;; -;; Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. -;; A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic). -;ONLY_SHOW_RELEVANT_REPOS = false -;; -;; Change the sort type of the explore pages. -;; Default is "recentupdate", but you also have "alphabetically", "reverselastlogin", "newest", "oldest". -;EXPLORE_PAGING_DEFAULT_SORT = recentupdate -;; -;; The tense all timestamps should be rendered in. Possible values are `absolute` time (i.e. 1970-01-01, 11:59) and `mixed`. -;; `mixed` means most timestamps are rendered in relative time (i.e. 2 days ago). -;PREFERRED_TIMESTAMP_TENSE = mixed - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ui.admin] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Number of users that are displayed on one page -;USER_PAGING_NUM = 50 -;; -;; Number of repos that are displayed on one page -;REPO_PAGING_NUM = 50 -;; -;; Number of notices that are displayed on one page -;NOTICE_PAGING_NUM = 25 -;; -;; Number of organizations that are displayed on one page -;ORG_PAGING_NUM = 50 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ui.user] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Number of repos that are displayed on one page -;REPO_PAGING_NUM = 15 - -;; Number of orgs that are displayed on profile page -;ORG_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] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Control how often the notification endpoint is polled to update the notification -;; The timeout will increase to MAX_TIMEOUT in TIMEOUT_STEPs if the notification count is unchanged -;; Set MIN_TIMEOUT to -1 to turn off -;MIN_TIMEOUT = 10s -;MAX_TIMEOUT = 60s -;TIMEOUT_STEP = 10s -;; -;; This setting determines how often the db is queried to get the latest notification counts. -;; If the browser client supports EventSource and SharedWorker, a SharedWorker will be used in preference to polling notification. Set to -1 to disable the EventSource -;EVENT_SOURCE_UPDATE_TIME = 10s - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ui.svg] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Whether to render SVG files as images. If SVG rendering is disabled, SVG files are displayed as text and cannot be embedded in markdown files as images. -;ENABLE_RENDER = true - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ui.csv] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Maximum allowed file size in bytes to render CSV files as table. (Set to 0 for no limit). -;MAX_FILE_SIZE = 524288 -;; -;; Maximum allowed rows to render CSV files. (Set to 0 for no limit) -;MAX_ROWS = 2500 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[markdown] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Customize render options for different contexts. Set to "none" to disable the defaults, or use comma separated list: -;; * short-issue-pattern: recognized "#123" issue reference and render it as a link to the issue -;; * new-line-hard-break: render soft line breaks as hard line breaks, which means a single newline character between -;; paragraphs will cause a line break and adding trailing whitespace to paragraphs is not -;; necessary to force a line break. -;RENDER_OPTIONS_COMMENT = short-issue-pattern, new-line-hard-break -;RENDER_OPTIONS_WIKI = short-issue-pattern -;RENDER_OPTIONS_REPO_FILE = -;; -;; Comma separated list of custom URL-Schemes that are allowed as links when rendering Markdown -;; for example git,magnet,ftp (more at https://en.wikipedia.org/wiki/List_of_URI_schemes) -;; URLs starting with http and https are always displayed, whatever is put in this entry. -;; If this entry is empty, all URL schemes are allowed. -;CUSTOM_URL_SCHEMES = -;; -;; List of file extensions that should be rendered/edited as Markdown -;; Separate the extensions with a comma. To render files without any extension as markdown, just put a comma -;FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd,.livemd -;; -;; Enables math inline and block detection -;ENABLE_MATH = true -;; -;; Enable delimiters for math code block detection. Set to "none" to disable all, -;; or use comma separated list: inline-dollar, inline-parentheses, block-dollar, block-square-brackets -;; Defaults to "inline-dollar,block-dollar" to follow GitHub's behavior. -;MATH_CODE_BLOCK_DETECTION = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[ssh.minimum_key_sizes] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Define allowed algorithms and their minimum key length (use -1 to disable a type) -;ED25519 = 256 -;ECDSA = 256 -;RSA = 3071 ; we allow 3071 here because an otherwise valid 3072 bit RSA key can be reported as having 3071 bit length -;DSA = -1 ; set to 1024 to switch on - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[indexer] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Issue Indexer settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Issue indexer type, currently support: bleve, db, elasticsearch or meilisearch default is bleve -;ISSUE_INDEXER_TYPE = bleve -;; -;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve -;ISSUE_INDEXER_PATH = indexers/issues.bleve ; Relative paths will be made absolute against _`AppWorkPath`_. -;; -;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g. http://elastic:password@localhost:9200) or meilisearch (e.g. http://:apikey@localhost:7700) -;ISSUE_INDEXER_CONN_STR = -;; -;; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch. -;ISSUE_INDEXER_NAME = gitea_issues -;; -;; Timeout the indexer if it takes longer than this to start. -;; Set to -1 to disable timeout. -;STARTUP_TIMEOUT = 30s -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Repository Indexer settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; repo indexer by default disabled, since it uses a lot of disk space -;REPO_INDEXER_ENABLED = false -;; -;; repo indexer units, the items to index, could be `sources`, `forks`, `mirrors`, `templates` or any combination of them separated by a comma. -;; If empty then it defaults to `sources` only, as if you'd like to disable fully please see REPO_INDEXER_ENABLED. -;REPO_INDEXER_REPO_TYPES = sources,forks,mirrors,templates -;; -;; Code search engine type, could be `bleve` or `elasticsearch`. -;REPO_INDEXER_TYPE = bleve -;; -;; Index file used for code search. available when `REPO_INDEXER_TYPE` is bleve -;REPO_INDEXER_PATH = indexers/repos.bleve -;; -;; Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:changeme@localhost:9200 -;REPO_INDEXER_CONN_STR = -;; -;; Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch -;REPO_INDEXER_NAME = gitea_codes -;; -;; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include -;; in the index; default is empty -;REPO_INDEXER_INCLUDE = -;; -;; A comma separated list of glob patterns to exclude from the index; ; default is empty -;REPO_INDEXER_EXCLUDE = -;; -;MAX_FILE_SIZE = 1048576 -;; -;; Bleve engine has performance problems with fuzzy search, so we limit the fuzziness to 0 by default to disable it. -;; If you'd like to enable it, you can set it to a value between 0 and 2. -;TYPE_BLEVE_MAX_FUZZINESS = 0 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[queue] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Specific queues can be individually configured with [queue.name]. [queue] provides defaults -;; ([queue.issue_indexer] is special due to the old configuration described above) -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; General queue queue type, currently support: persistable-channel, channel, level, redis, dummy -;; default to persistable-channel -;TYPE = persistable-channel -;; -;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared. -;; Relative paths will be made absolute against "APP_DATA_PATH" -;DATADIR = queues/ -;; -;; Default queue length before a channel queue will block -;LENGTH = 100000 -;; -;; Batch size to send for batched queues -;BATCH_LENGTH = 20 -;; -;; Connection string for redis queues this will store the redis (or Redis cluster) connection string. -;; When `TYPE` is `persistable-channel`, this provides a directory for the underlying leveldb -;; or additional options of the form `leveldb://path/to/db?option=value&....`, and will override `DATADIR`. -;CONN_STR = "redis://127.0.0.1:6379/0" -;; -;; Provides the suffix of the default redis/disk queue name - specific queues can be overridden within in their [queue.name] sections. -;QUEUE_NAME = "_queue" -;; -;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections. -;SET_NAME = "_unique" -;; -;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10. -;MAX_WORKERS = ; (dynamic) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[admin] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Disallow regular (non-admin) users from creating organizations. -;DISABLE_REGULAR_ORG_CREATION = false -;; -;; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled -;DEFAULT_EMAIL_NOTIFICATIONS = enabled -;; Disabled features for users could be "deletion", "manage_ssh_keys", "manage_gpg_keys", "manage_mfa", "manage_credentials" more features can be disabled in future -;; - deletion: a user cannot delete their own account -;; - manage_ssh_keys: a user cannot configure ssh keys -;; - manage_gpg_keys: a user cannot configure gpg keys -;; - manage_mfa: a user cannot configure mfa devices -;; - manage_credentials: a user cannot configure emails, passwords, or openid -;USER_DISABLED_FEATURES = -;; Comma separated list of disabled features ONLY if the user has an external login type (eg. LDAP, Oauth, etc.), could be "deletion", "manage_ssh_keys", "manage_gpg_keys", "manage_mfa", "manage_credentials". This setting is independent from `USER_DISABLED_FEATURES` and supplements its behavior. -;; - deletion: a user cannot delete their own account -;; - manage_ssh_keys: a user cannot configure ssh keys -;; - manage_gpg_keys: a user cannot configure gpg keys -;; - manage_mfa: a user cannot configure mfa devices -;; - manage_credentials: a user cannot configure emails, passwords, or openid -;; - change_username: a user cannot change their username -;; - change_full_name: a user cannot change their full name -;;EXTERNAL_USER_DISABLE_FEATURES = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[openid] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; OpenID is an open, standard and decentralized authentication protocol. -;; Your identity is the address of a webpage you provide, which describes -;; how to prove you are in control of that page. -;; -;; For more info: https://en.wikipedia.org/wiki/OpenID -;; -;; Current implementation supports OpenID-2.0 -;; -;; Tested to work providers at the time of writing: -;; - Any GNUSocial node (your.hostname.tld/username) -;; - Any SimpleID provider (http://simpleid.koinic.net) -;; - http://openid.org.cn/ -;; - openid.stackexchange.com -;; - login.launchpad.net -;; - .livejournal.com -;; -;; Whether to allow signin in via OpenID -;ENABLE_OPENID_SIGNIN = true -;; -;; Whether to allow registering via OpenID -;; Do not include to rely on rhw DISABLE_REGISTRATION setting -;;ENABLE_OPENID_SIGNUP = true -;; -;; Allowed URI patterns (POSIX regexp). -;; Space separated. -;; Only these would be allowed if non-blank. -;; Example value: trusted.domain.org trusted.domain.net -;WHITELISTED_URIS = -;; -;; Forbidden URI patterns (POSIX regexp). -;; Space separated. -;; Only used if WHITELISTED_URIS is blank. -;; Example value: loadaverage.org/badguy stackexchange.com/.*spammer -;BLACKLISTED_URIS = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[oauth2_client] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Whether a new auto registered oauth2 user needs to confirm their email. -;; Do not include to use the REGISTER_EMAIL_CONFIRM setting from the `[service]` section. -;REGISTER_EMAIL_CONFIRM = -;; -;; Scopes for the openid connect oauth2 provider (separated by space, the openid scope is implicitly added). -;; Typical values are profile and email. -;; For more information about the possible values see https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims -;OPENID_CONNECT_SCOPES = -;; -;; Automatically create user accounts for new oauth2 users. -;ENABLE_AUTO_REGISTRATION = false -;; -;; The source of the username for new oauth2 accounts: -;; userid = use the userid / sub attribute -;; nickname = use the nickname attribute -;; preferred_username = use the preferred_username attribute -;; email = use the username part of the email attribute -;; Note: `nickname`, `preferred_username` and `email` options will normalize input strings using the following criteria: -;; - diacritics are removed -;; - the characters in the set ['´`] are removed -;; - the characters in the set [\s~+] are replaced with "-" -;USERNAME = nickname -;; -;; Update avatar if available from oauth2 provider. -;; Update will be performed on each login. -;UPDATE_AVATAR = false -;; -;; How to handle if an account / email already exists: -;; disabled = show an error -;; login = show an account linking login -;; auto = link directly with the account -;ACCOUNT_LINKING = login - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[webhook] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Hook task queue length, increase if webhook shooting starts hanging -;QUEUE_LENGTH = 1000 -;; -;; Deliver timeout in seconds -;DELIVER_TIMEOUT = 5 -;; -;; Webhook can only call allowed hosts for security reasons. Comma separated list, eg: external, 192.168.1.0/24, *.mydomain.com -;; Built-in: loopback (for localhost), private (for LAN/intranet), external (for public hosts on internet), * (for all hosts) -;; CIDR list: 1.2.3.0/8, 2001:db8::/32 -;; Wildcard hosts: *.mydomain.com, 192.168.100.* -;; Since 1.15.7. Default to * for 1.15.x, external for 1.16 and later -;ALLOWED_HOST_LIST = external -;; -;; Allow insecure certification -;SKIP_TLS_VERIFY = false -;; -;; Number of history information in each page -;PAGING_NUM = 10 -;; -;; Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy -;PROXY_URL = -;; -;; Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. -;PROXY_HOSTS = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[mailer] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; NOTICE: this section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older, -;; please refer to -;; https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini -;; https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md -;; -;ENABLED = false -;; -;; Buffer length of channel, keep it as it is if you don't know what it is. -;SEND_BUFFER_LEN = 100 -;; -;; Prefix displayed before subject in mail -;SUBJECT_PREFIX = -;; -;; Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". -;; - sendmail: use the operating system's `sendmail` command instead of SMTP. This is common on Linux systems. -;; - dummy: send email messages to the log as a testing phase. -;; If your provider does not explicitly say which protocol it uses but does provide a port, -;; you can set SMTP_PORT instead and this will be inferred. -;; (Before 1.18, see the notice, this was controlled via MAILER_TYPE and IS_TLS_ENABLED.) -;PROTOCOL = -;; -;; Mail server address, e.g. smtp.gmail.com. -;; For smtp+unix, this should be a path to a unix socket instead. -;; (Before 1.18, see the notice, this was combined with SMTP_PORT as HOST.) -;SMTP_ADDR = -;; -;; Mail server port. Common ports are: -;; 25: insecure SMTP -;; 465: SMTP Secure -;; 587: StartTLS -;; If no protocol is specified, it will be inferred by this setting. -;; (Before 1.18, this was combined with SMTP_ADDR as HOST.) -;SMTP_PORT = -;; -;; Enable HELO operation. Defaults to true. -;ENABLE_HELO = true -;; -;; Custom hostname for HELO operation. -;; If no value is provided, one is retrieved from system. -;HELO_HOSTNAME = -;; -;; If set to `true`, completely ignores server certificate validation errors. -;; This option is unsafe. Consider adding the certificate to the system trust store instead. -;FORCE_TRUST_SERVER_CERT = false -;; -;; Use client certificate in connection. -;USE_CLIENT_CERT = false -;CLIENT_CERT_FILE = custom/mailer/cert.pem -;CLIENT_KEY_FILE = custom/mailer/key.pem -;; -;; Mail from address, RFC 5322. This can be just an email address, or the `"Name" ` format -;FROM = -;; -;; Sometimes it is helpful to use a different address on the envelope. Set this to use ENVELOPE_FROM as the from on the envelope. Set to `<>` to send an empty address. -;ENVELOPE_FROM = -;; -;; If gitea sends mails on behave of users, it will just use the name also displayed in the WebUI. If you want e.g. `Mister X (by CodeIt) `, -;; set it to `{{ .DisplayName }} (by {{ .AppName }})`. Available Variables: `.DisplayName`, `.AppName` and `.Domain`. -;FROM_DISPLAY_NAME_FORMAT = {{ .DisplayName }} -;; -;; Mailer user name and password, if required by provider. -;USER = -;; -;; Use PASSWD = `your password` for quoting if you use special characters in the password. -;PASSWD = -;; -;; Send mails only in plain text, without HTML alternative -;SEND_AS_PLAIN_TEXT = false -;; -;; Specify an alternative sendmail binary -;SENDMAIL_PATH = sendmail -;; -;; Specify any extra sendmail arguments -;; WARNING: if your sendmail program interprets options you should set this to "--" or terminate these args with "--" -;SENDMAIL_ARGS = -;; -;; Timeout for Sendmail -;SENDMAIL_TIMEOUT = 5m -;; -;; convert \r\n to \n for Sendmail -;SENDMAIL_CONVERT_CRLF = true -;; -;; convert links of attached images to inline images. Only for images hosted in this gitea instance. -;EMBED_ATTACHMENT_IMAGES = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[mailer.override_header] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; This is empty by default, use it only if you know what you need it for. -;Reply-To = test@example.com, test2@example.com -;Content-Type = text/html; charset=utf-8 -;In-Reply-To = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[email.incoming] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Enable handling of incoming emails. -;ENABLED = false -;; -;; The email address including the %{token} placeholder that will be replaced per user/action. -;; Example: incoming+%{token}@example.com -;; The placeholder must appear in the user part of the address (before the @). -;REPLY_TO_ADDRESS = -;; -;; IMAP server host -;HOST = -;; -;; IMAP server port -;PORT = -;; -;; Username of the receiving account -;USERNAME = -;; -;; Password of the receiving account -;PASSWORD = -;; -;; Whether the IMAP server uses TLS. -;USE_TLS = false -;; -;; If set to true, completely ignores server certificate validation errors. This option is unsafe. -;SKIP_TLS_VERIFY = true -;; -;; The mailbox name where incoming mail will end up. -;MAILBOX = INBOX -;; -;; Whether handled messages should be deleted from the mailbox. -;DELETE_HANDLED_MESSAGE = true -;; -;; Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size. -;MAXIMUM_MESSAGE_SIZE = 10485760 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cache] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Either "memory", "redis", "memcache", or "twoqueue". default is "memory" -;ADAPTER = memory -;; -;; For "memory" only, GC interval in seconds, default is 60 -;INTERVAL = 60 -;; -;; For "redis" and "memcache", connection host address -;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` (or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for a Redis cluster) -;; memcache: `127.0.0.1:11211` -;; twoqueue: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` -;HOST = -;; -;; Time to keep items in cache if not used, default is 16 hours. -;; Setting it to -1 disables caching -;ITEM_TTL = 16h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Last commit cache -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cache.last_commit] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Time to keep items in cache if not used, default is 8760 hours. -;; Setting it to -1 disables caching -;ITEM_TTL = 8760h -;; -;; Only enable the cache when repository's commits count great than -;COMMITS_COUNT = 1000 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[session] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Either "memory", "file", "redis", "db", "mysql", "couchbase", "memcache" or "postgres" -;; Default is "memory". "db" will reuse the configuration in [database] -;PROVIDER = memory -;; -;; Provider config options -;; memory: doesn't have any config yet -;; file: session file path, e.g. `data/sessions` -;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` (or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for a Redis cluster) -;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` -;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_. -;; -;; Session cookie name -;COOKIE_NAME = i_like_gitea -;; -;; If you use session in https only: true or false. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL. -;COOKIE_SECURE = -;; -;; Session GC time interval in seconds, default is 86400 (1 day) -;GC_INTERVAL_TIME = 86400 -;; -;; Session life time in seconds, default is 86400 (1 day) -;SESSION_LIFE_TIME = 86400 -;; -;; SameSite settings. Either "none", "lax", or "strict" -;SAME_SITE=lax - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[picture] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;AVATAR_UPLOAD_PATH = data/avatars -;REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars -;; -;; How Gitea deals with missing repository avatars -;; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used -;REPOSITORY_AVATAR_FALLBACK = none -;REPOSITORY_AVATAR_FALLBACK_IMAGE = /img/repo_default.png -;; -;; Max Width and Height of uploaded avatars. -;; This is to limit the amount of RAM used when resizing the image. -;AVATAR_MAX_WIDTH = 4096 -;AVATAR_MAX_HEIGHT = 4096 -;; -;; The multiplication factor for rendered avatar images. -;; Larger values result in finer rendering on HiDPI devices. -;AVATAR_RENDERED_SIZE_FACTOR = 2 -;; -;; Maximum allowed file size for uploaded avatars. -;; This is to limit the amount of RAM used when resizing the image. -;AVATAR_MAX_FILE_SIZE = 1048576 -;; -;; If the uploaded file is not larger than this byte size, the image will be used as is, without resizing/converting. -;AVATAR_MAX_ORIGIN_SIZE = 262144 -;; -;; Chinese users can choose "duoshuo" -;; or a custom avatar source, like: http://cn.gravatar.com/avatar/ -;GRAVATAR_SOURCE = gravatar -;; -;; This value will always be true in offline mode. -;DISABLE_GRAVATAR = false -;; -;; Federated avatar lookup uses DNS to discover avatar associated -;; with emails, see https://www.libravatar.org -;; This value will always be false in offline mode or when Gravatar is disabled. -;ENABLE_FEDERATED_AVATAR = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[attachment] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Whether issue and pull request attachments are enabled. Defaults to `true` -;ENABLED = true -;; -;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. -;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.webp,.xls,.xlsx,.zip -;; -;; Max size of each file. Defaults to 2048MB -;MAX_SIZE = 2048 -;; -;; Max number of files per upload. Defaults to 5 -;MAX_FILES = 5 -;; -;; Storage type for attachments, `local` for local disk or `minio` for s3 compatible -;; object storage service, default is `local`. -;STORAGE_TYPE = local -;; -;; Allows the storage driver to redirect to authenticated URLs to serve files directly -;; Currently, only `minio` and `azureblob` is supported. -;SERVE_DIRECT = false -;; -;; Path for attachments. Defaults to `attachments`. Only available when STORAGE_TYPE is `local` -;; Relative paths will be resolved to `${AppDataPath}/${attachment.PATH}` -;PATH = attachments -;; -;; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -;MINIO_ENDPOINT = localhost:9000 -;; -;; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`. -;; If not provided and STORAGE_TYPE is `minio`, will search for credentials in known -;; environment variables (MINIO_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID), credentials files -;; (~/.mc/config.json, ~/.aws/credentials), and EC2 instance metadata. -;MINIO_ACCESS_KEY_ID = -;; -;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -;MINIO_SECRET_ACCESS_KEY = -;; -;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`. -;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables -;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, -;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION), -;; or the DefaultIAMRoleEndpoint if not provided otherwise. -;MINIO_IAM_ENDPOINT = -;; -;; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -;MINIO_BUCKET = gitea -;; -;; Minio location to create bucket only available when STORAGE_TYPE is `minio` -;MINIO_LOCATION = us-east-1 -;; -;; Minio base path on the bucket only available when STORAGE_TYPE is `minio` -;MINIO_BASE_PATH = attachments/ -;; -;; Minio enabled ssl only available when STORAGE_TYPE is `minio` -;MINIO_USE_SSL = false -;; -;; Minio skip SSL verification available when STORAGE_TYPE is `minio` -;MINIO_INSECURE_SKIP_VERIFY = false -;; -;; Minio checksum algorithm: default (for MinIO or AWS S3) or md5 (for Cloudflare or Backblaze) -;MINIO_CHECKSUM_ALGORITHM = default -;; -;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio` -;MINIO_BUCKET_LOOKUP_TYPE = auto -;; Azure Blob endpoint to connect only available when STORAGE_TYPE is `azureblob`, -;; e.g. https://accountname.blob.core.windows.net or http://127.0.0.1:10000/devstoreaccount1 -;AZURE_BLOB_ENDPOINT = -;; -;; Azure Blob account name to connect only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_ACCOUNT_NAME = -;; -;; Azure Blob account key to connect only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_ACCOUNT_KEY = -;; -;; Azure Blob container to store the attachments only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_CONTAINER = gitea -;; -;; override the azure blob base path if storage type is azureblob -;AZURE_BLOB_BASE_PATH = attachments/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[time] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Location the UI time display i.e. Asia/Shanghai -;; Empty means server's location setting -;DEFAULT_UI_LOCATION = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Common settings -;; -;; Setting this to true will enable all cron tasks periodically with default settings. -;ENABLED = false -;; Setting this to true will run all enabled cron tasks when Gitea starts. -;RUN_AT_START = false -;; -;; Note: ``SCHEDULE`` accept formats -;; - Full crontab specs, e.g. "* * * * * ?" -;; - Descriptors, e.g. "@midnight", "@every 1h30m" -;; See more: https://pkg.go.dev/github.com/gogs/cron@v0.0.0-20171120032916-9f6c956d3e14 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Basic cron tasks - enabled by default -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Clean up old repository archives -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.archive_cleanup] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Whether to enable the job -;ENABLED = true -;; Whether to always run at least once at start up time (if ENABLED) -;RUN_AT_START = true -;; Whether to emit notice on successful execution too -;NOTICE_ON_SUCCESS = false -;; Time interval for job to run -;SCHEDULE = @midnight -;; Archives created more than OLDER_THAN ago are subject to deletion -;OLDER_THAN = 24h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Update mirrors -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.update_mirrors] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;SCHEDULE = @every 10m -;; Enable running Update mirrors task periodically. -;ENABLED = true -;; Run Update mirrors task when Gitea starts. -;RUN_AT_START = false -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;; Limit the number of mirrors added to the queue to this number -;; (negative values mean no limit, 0 will result in no result in no mirrors being queued effectively disabling pull mirror updating.) -;PULL_LIMIT=50 -;; Limit the number of mirrors added to the queue to this number -;; (negative values mean no limit, 0 will result in no mirrors being queued effectively disabling push mirror updating) -;PUSH_LIMIT=50 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Repository health check -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.repo_health_check] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;SCHEDULE = @midnight -;; Enable running Repository health check task periodically. -;ENABLED = true -;; Run Repository health check task when Gitea starts. -;RUN_AT_START = false -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;TIMEOUT = 60s -;; Arguments for command 'git fsck', e.g. "--unreachable --tags" -;; see more on http://git-scm.com/docs/git-fsck -;ARGS = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Check repository statistics -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.check_repo_stats] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Enable running check repository statistics task periodically. -;ENABLED = true -;; Run check repository statistics task when Gitea starts. -;RUN_AT_START = true -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @midnight - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.update_migration_poster_id] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Update migrated repositories' issues and comments' posterid, it will always attempt synchronization when the instance starts. -;ENABLED = true -;; Update migrated repositories' issues and comments' posterid when starting server (default true) -;RUN_AT_START = true -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;; Interval as a duration between each synchronization. (default every 24h) -;SCHEDULE = @midnight - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Synchronize external user data (only LDAP user synchronization is supported) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.sync_external_users] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = true -;; Synchronize external user data when starting server (default false) -;RUN_AT_START = false -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;; Interval as a duration between each synchronization (default every 24h) -;SCHEDULE = @midnight -;; Create new users, update existing user data and disable users that are not in external source anymore (default) -;; or only create new users if UPDATE_EXISTING is set to false -;UPDATE_EXISTING = true - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Cleanup expired actions assets -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.cleanup_actions] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = true -;RUN_AT_START = true -;SCHEDULE = @midnight - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Clean-up deleted branches -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.deleted_branches_cleanup] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = true -;; Clean-up deleted branches when starting server (default true) -;RUN_AT_START = true -;; Notice if not success -;NOTICE_ON_SUCCESS = false -;; Interval as a duration between each synchronization (default every 24h) -;SCHEDULE = @midnight -;; deleted branches than OLDER_THAN ago are subject to deletion -;OLDER_THAN = 24h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Cleanup hook_task table -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.cleanup_hook_task_table] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Whether to enable the job -;ENABLED = true -;; Whether to always run at start up time (if ENABLED) -;RUN_AT_START = false -;; Time interval for job to run -;SCHEDULE = @midnight -;; OlderThan or PerWebhook. How the records are removed, either by age (i.e. how long ago hook_task record was delivered) or by the number to keep per webhook (i.e. keep most recent x deliveries per webhook). -;CLEANUP_TYPE = OlderThan -;; If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted. -;OLDER_THAN = 168h -;; If CLEANUP_TYPE is set to PerWebhook, this is number of hook_task records to keep for a webhook (i.e. keep the most recent x deliveries). -;NUMBER_TO_KEEP = 10 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Cleanup expired packages -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.cleanup_packages] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Whether to enable the job -;ENABLED = true -;; Whether to always run at least once at start up time (if ENABLED) -;RUN_AT_START = true -;; Whether to emit notice on successful execution too -;NOTICE_ON_SUCCESS = false -;; Time interval for job to run -;SCHEDULE = @midnight -;; Unreferenced blobs created more than OLDER_THAN ago are subject to deletion -;OLDER_THAN = 24h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Extended cron task - not enabled by default -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete all unactivated accounts -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_inactive_accounts] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @annually -;OLDER_THAN = 168h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete all repository archives -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_repo_archives] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @annually; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Garbage collect all repositories -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.git_gc_repos] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h -;TIMEOUT = 60s -;; Arguments for command 'git gc' -;; The default value is same with [git] -> GC_ARGS -;ARGS = - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Update the '.ssh/authorized_keys' file with Gitea SSH keys -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.resync_all_sshkeys] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Resynchronize pre-receive, update and post-receive hooks of all repositories. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.resync_all_hooks] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Reinitialize all missing Git repositories for which records exist -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.reinit_missing_repos] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete all repositories missing their Git files -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_missing_repos] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete generated repository avatars -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_generated_repository_avatars] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 72h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete all old actions from database -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_old_actions] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NOTICE_ON_SUCCESS = false -;SCHEDULE = @every 168h -;OLDER_THAN = 8760h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Check for new Gitea versions -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.update_checker] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = true -;RUN_AT_START = false -;ENABLE_SUCCESS_NOTICE = false -;SCHEDULE = @every 168h -;HTTP_ENDPOINT = https://dl.gitea.com/gitea/version.json - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Delete all old system notices from database -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.delete_old_system_notices] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;RUN_AT_START = false -;NO_SUCCESS_NOTICE = false -;SCHEDULE = @every 168h -;OLDER_THAN = 8760h - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Garbage collect LFS pointers in repositories -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[cron.gc_lfs] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;ENABLED = false -;; Garbage collect LFS pointers in repositories (default false) -;RUN_AT_START = false -;; Interval as a duration between each gc run (default every 24h) -;SCHEDULE = @every 24h -;; Only attempt to garbage collect LFSMetaObjects older than this (default 7 days) -;OLDER_THAN = 168h -;; Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days) -;LAST_UPDATED_MORE_THAN_AGO = 72h -; Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all. -;NUMBER_TO_CHECK_PER_REPO = 100 -;Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.) -;PROPORTION_TO_CHECK_PER_REPO = 0.6 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[mirror] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo. -;ENABLED = true -;; Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. -;DISABLE_NEW_PULL = false -;; Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. -;DISABLE_NEW_PUSH = false -;; Default interval as a duration between each check -;DEFAULT_INTERVAL = 8h -;; Min interval as a duration must be > 1m -;MIN_INTERVAL = 10m - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[api] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Enables the API documentation endpoints (/api/swagger, /api/v1/swagger, …). True or false. -;ENABLE_SWAGGER = true -;; Max number of items in a page -;MAX_RESPONSE_ITEMS = 50 -;; Default paging number of api -;DEFAULT_PAGING_NUM = 30 -;; Default and maximum number of items per page for git trees api -;DEFAULT_GIT_TREES_PER_PAGE = 1000 -;; Default max size of a blob returned by the blobs API (default is 10MiB) -;DEFAULT_MAX_BLOB_SIZE = 10485760 -;; Default max combined size of all blobs returned by the files API (default is 100MiB) -;DEFAULT_MAX_RESPONSE_SIZE = 104857600 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[i18n] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; The first locale will be used as the default if user browser's language doesn't match any locale in the list. -;LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN -;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Türkçe,Čeština,Српски,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia,മലയാളം - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[highlight.mapping] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Extension mapping to highlight class -;; e.g. .toml=ini - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[other] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Show version information about Gitea and Go in the footer -;SHOW_FOOTER_VERSION = true -;; Show template execution time in the footer -;SHOW_FOOTER_TEMPLATE_LOAD_TIME = true -;; Show the "powered by" text in the footer -;SHOW_FOOTER_POWERED_BY = true -;; Generate sitemap. Defaults to `true`. -;ENABLE_SITEMAP = true -;; Enable/Disable RSS/Atom feed -;ENABLE_FEED = true - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[markup] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Set the maximum number of characters in a mermaid source. (Set to -1 to disable limits) -;MERMAID_MAX_SOURCE_CHARACTERS = 50000 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[markup.sanitizer.1] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; The following keys can appear once to define a sanitation policy rule. -;; This section can appear multiple times by adding a unique alphanumeric suffix to define multiple rules. -;; e.g., [markup.sanitizer.1] -> [markup.sanitizer.2] -> [markup.sanitizer.TeX] -;ELEMENT = span -;ALLOW_ATTR = class -;REGEXP = ^(info|warning|error)$ -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Other markup formats e.g. asciidoc -;; -;; uncomment and enable the below section. -;; (You can add other markup formats by copying the section and adjusting -;; the section name suffix "asciidoc" to something else.) -;[markup.asciidoc] -;ENABLED = false -;; List of file extensions that should be rendered by an external command -;FILE_EXTENSIONS = .adoc,.asciidoc -;; External command to render all matching extensions -;RENDER_COMMAND = "asciidoc --out-file=- -" -;; Don't pass the file on STDIN, pass the filename as argument instead. -;IS_INPUT_FILE = false -;; How the content will be rendered. -;; * sanitized: Sanitize the content and render it inside current page, default to only allow a few HTML tags and attributes. Customized sanitizer rules can be defined in [markup.sanitizer.*] . -;; * no-sanitizer: Disable the sanitizer and render the content inside current page. It's **insecure** and may lead to XSS attack if the content contains malicious code. -;; * iframe: Render the content in a separate standalone page and embed it into current page by iframe. The iframe is in sandbox mode with same-origin disabled, and the JS code are safely isolated from parent page. -;RENDER_CONTENT_MODE=sanitized - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[metrics] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Enables metrics endpoint. True or false; default is false. -;ENABLED = false -;; If you want to add authorization, specify a token here -;TOKEN = -;; Enable issue by label metrics; default is false -;ENABLED_ISSUE_BY_LABEL = false -;; Enable issue by repository metrics; default is false -;ENABLED_ISSUE_BY_REPOSITORY = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[migrations] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Max attempts per http/https request on migrations. -;MAX_ATTEMPTS = 3 -;; -;; Backoff time per http/https request retry (seconds) -;RETRY_BACKOFF = 3 -;; -;; Allowed domains for migrating, default is blank. Blank means everything will be allowed. -;; Multiple domains could be separated by commas. -;; Wildcard is supported: "github.com, *.github.com" -;ALLOWED_DOMAINS = -;; -;; Blocklist for migrating, default is blank. Multiple domains could be separated by commas. -;; When ALLOWED_DOMAINS is not blank, this option has a higher priority to deny domains. -;; Wildcard is supported. -;BLOCKED_DOMAINS = -;; -;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) -;; If a domain is allowed by ALLOWED_DOMAINS, this option will be ignored. -;ALLOW_LOCALNETWORKS = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[federation] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Enable/Disable federation capabilities -;ENABLED = false -;; -;; Enable/Disable user statistics for nodeinfo if federation is enabled -;SHARE_USER_STATISTICS = true -;; -;; Maximum federation request and response size (MB) -;MAX_SIZE = 4 -;; -;; WARNING: Changing the settings below can break federation. -;; -;; HTTP signature algorithms -;ALGORITHMS = rsa-sha256, rsa-sha512, ed25519 -;; -;; HTTP signature digest algorithm -;DIGEST_ALGORITHM = SHA-256 -;; -;; GET headers for federation requests -;GET_HEADERS = (request-target), Date -;; -;; POST headers for federation requests -;POST_HEADERS = (request-target), Date, Digest - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[packages] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Enable/Disable package registry capabilities -;ENABLED = true -;; -;STORAGE_TYPE = local -;; override the minio base path if storage type is minio -;MINIO_BASE_PATH = packages/ -;; override the azure blob base path if storage type is azureblob -;AZURE_BLOB_BASE_PATH = packages/ -;; Allows the storage driver to redirect to authenticated URLs to serve files directly -;; Currently, only `minio` and `azureblob` is supported. -;SERVE_DIRECT = false -;; -;; Maximum count of package versions a single owner can have (`-1` means no limits) -;LIMIT_TOTAL_OWNER_COUNT = -1 -;; Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_TOTAL_OWNER_SIZE = -1 -;; Maximum size of an Alpine upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_ALPINE = -1 -;; Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CARGO = -1 -;; Maximum size of a Chef upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CHEF = -1 -;; Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_COMPOSER = -1 -;; Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CONAN = -1 -;; Maximum size of a Conda upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CONDA = -1 -;; Maximum size of a Container upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CONTAINER = -1 -;; Maximum size of a CRAN upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_CRAN = -1 -;; Maximum size of a Debian upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_DEBIAN = -1 -;; Maximum size of a Generic upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_GENERIC = -1 -;; Maximum size of a Go upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_GO = -1 -;; Maximum size of a Helm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_HELM = -1 -;; Maximum size of a Maven upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_MAVEN = -1 -;; Maximum size of a npm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_NPM = -1 -;; Maximum size of a NuGet upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_NUGET = -1 -;; Maximum size of a Pub upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_PUB = -1 -;; Maximum size of a PyPI upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_PYPI = -1 -;; Maximum size of a RPM upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_RPM = -1 -;; Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_RUBYGEMS = -1 -;; Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_SWIFT = -1 -;; Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) -;LIMIT_SIZE_VAGRANT = -1 -;; Enable RPM re-signing by default. (It will overwrite the old signature ,using v4 format, not compatible with CentOS 6 or older) -;DEFAULT_RPM_SIGN_ENABLED = false -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; default storage for attachments, lfs and avatars -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[storage] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; storage type -;STORAGE_TYPE = local - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; repo-archive storage will override storage -;; -;[repo-archive] -;STORAGE_TYPE = local -;; -;; Where your lfs files reside, default is data/lfs. -;PATH = data/repo-archive -;; -;; override the minio base path if storage type is minio -;MINIO_BASE_PATH = repo-archive/ -;; override the azure blob base path if storage type is azureblob -;AZURE_BLOB_BASE_PATH = repo-archive/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; settings for repository archives, will override storage setting -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[storage.repo-archive] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; storage type -;STORAGE_TYPE = local - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; lfs storage will override storage -;; -;[lfs] -;STORAGE_TYPE = local -;; -;; Where your lfs files reside, default is data/lfs. -;PATH = data/lfs -;; -;; Allows the storage driver to redirect to authenticated URLs to serve files directly -;; Currently, only `minio` and `azureblob` is supported. -;SERVE_DIRECT = false -;; -;; override the minio base path if storage type is minio -;MINIO_BASE_PATH = lfs/ -;; -;; override the azure blob base path if storage type is azureblob -;AZURE_BLOB_BASE_PATH = lfs/ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; settings for Gitea's LFS client (eg: mirroring an upstream lfs endpoint) -;; -;[lfs_client] -;; Limit the number of pointers in each batch request to this number -;BATCH_SIZE = 20 -;; Limit the number of concurrent upload/download operations within a batch -;BATCH_OPERATION_CONCURRENCY = 8 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; settings for packages, will override storage setting -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[storage.packages] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; storage type -;STORAGE_TYPE = local - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; customize storage -;[storage.minio] -;STORAGE_TYPE = minio -;; -;; Minio endpoint to connect only available when STORAGE_TYPE is `minio` -;MINIO_ENDPOINT = localhost:9000 -;; -;; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`. -;; If not provided and STORAGE_TYPE is `minio`, will search for credentials in known -;; environment variables (MINIO_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID), credentials files -;; (~/.mc/config.json, ~/.aws/credentials), and EC2 instance metadata. -;MINIO_ACCESS_KEY_ID = -;; -;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` -;MINIO_SECRET_ACCESS_KEY = -;; -;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`. -;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables -;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, -;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION), -;; or the DefaultIAMRoleEndpoint if not provided otherwise. -;MINIO_IAM_ENDPOINT = -;; -;; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` -;MINIO_BUCKET = gitea -;; -;; Minio location to create bucket only available when STORAGE_TYPE is `minio` -;MINIO_LOCATION = us-east-1 -;; -;; Minio enabled ssl only available when STORAGE_TYPE is `minio` -;MINIO_USE_SSL = false -;; -;; Minio skip SSL verification available when STORAGE_TYPE is `minio` -;MINIO_INSECURE_SKIP_VERIFY = false -;; -;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio` -;MINIO_BUCKET_LOOKUP_TYPE = auto - -;[storage.azureblob] -;STORAGE_TYPE = azureblob -;; -;; Azure Blob endpoint to connect only available when STORAGE_TYPE is `azureblob`, -;; e.g. https://accountname.blob.core.windows.net or http://127.0.0.1:10000/devstoreaccount1 -;AZURE_BLOB_ENDPOINT = -;; -;; Azure Blob account name to connect only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_ACCOUNT_NAME = -;; -;; Azure Blob account key to connect only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_ACCOUNT_KEY = -;; -;; Azure Blob container to store the attachments only available when STORAGE_TYPE is `azureblob` -;AZURE_BLOB_CONTAINER = gitea - -;[proxy] -;; Enable the proxy, all requests to external via HTTP will be affected -;PROXY_ENABLED = false -;; Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy/no_proxy -;PROXY_URL = -;; Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. -;PROXY_HOSTS = - -; [actions] -;; Enable/Disable actions capabilities -;ENABLED = true -;; -;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance. -;DEFAULT_ACTIONS_URL = github -;; Logs retention time in days. Old logs will be deleted after this period. -;LOG_RETENTION_DAYS = 365 -;; Log compression type, `none` for no compression, `zstd` for zstd compression. -;; Other compression types like `gzip` are NOT supported, since seekable stream is required for log view. -;; It's always recommended to use compression when using local disk as log storage if CPU or memory is not a bottleneck. -;; And for object storage services like S3, which is billed for requests, it would cause extra 2 times of get requests for each log view. -;; But it will save storage space and network bandwidth, so it's still recommended to use compression. -;LOG_COMPRESSION = zstd -;; Default artifact retention time in days. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step. -;ARTIFACT_RETENTION_DAYS = 90 -;; Timeout to stop the task which have running status, but haven't been updated for a long time -;ZOMBIE_TASK_TIMEOUT = 10m -;; Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time -;ENDLESS_TASK_TIMEOUT = 3h -;; Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time -;ABANDONED_JOB_TIMEOUT = 24h -;; Strings committers can place inside a commit message or PR title to skip executing the corresponding actions workflow -;SKIP_WORKFLOW_STRINGS = [skip ci],[ci skip],[no ci],[skip actions],[actions skip] - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; settings for action logs, will override storage setting -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[storage.actions_log] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; storage type -;STORAGE_TYPE = local - -;[global_lock] -;; Lock service type, could be memory or redis -;SERVICE_TYPE = memory -;; Ignored for the "memory" type. For "redis" use something like `redis://127.0.0.1:6379/0` -;SERVICE_CONN_STR = diff --git a/go.mod b/go.mod index da8c0d28c6..0f24e37978 100644 --- a/go.mod +++ b/go.mod @@ -330,3 +330,5 @@ exclude github.com/gofrs/uuid v4.0.0+incompatible exclude github.com/goccy/go-json v0.4.11 exclude github.com/satori/go.uuid v1.2.0 + + diff --git a/mcp_config.json b/mcp_config.json new file mode 100644 index 0000000000..f5d8d00a51 --- /dev/null +++ b/mcp_config.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "chrome-devtools": { + "command": "npx", + "args": ["chrome-devtools-mcp@latest"] + } + } +} \ No newline at end of file diff --git a/my-auth-state.json b/my-auth-state.json new file mode 100644 index 0000000000..1ce4eeb805 --- /dev/null +++ b/my-auth-state.json @@ -0,0 +1,35 @@ +{ + "cookies": [ + { + "name": "i_like_gitea", + "value": "7ea7ad364f7d5366", + "domain": "192.168.181.128", + "path": "/", + "expires": -1, + "httpOnly": true, + "secure": false, + "sameSite": "Lax" + }, + { + "name": "lang", + "value": "en-US", + "domain": "192.168.181.128", + "path": "/", + "expires": -1, + "httpOnly": true, + "secure": false, + "sameSite": "Lax" + }, + { + "name": "_csrf", + "value": "Niy6wnAHLsNWRXpD_5a3rCQnBdo6MTc2MTIyNjAxNjAyMDIyMzk5OA", + "domain": "192.168.181.128", + "path": "/", + "expires": 1761312416.027574, + "httpOnly": true, + "secure": false, + "sameSite": "Lax" + } + ], + "origins": [] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 21e29a2081..1eada431f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "gitea", + "name": "devstar", "lockfileVersion": 3, "requires": true, "packages": { @@ -21,6 +21,7 @@ "chart.js": "4.5.0", "chartjs-adapter-dayjs-4": "1.0.4", "chartjs-plugin-zoom": "2.2.0", + "chrome-remote-interface": "0.33.3", "clippie": "4.1.7", "cropperjs": "1.6.2", "css-loader": "7.1.2", @@ -5070,6 +5071,25 @@ "dev": true, "license": "(BSD-3-Clause AND Apache-2.0)" }, + "node_modules/chrome-remote-interface": { + "version": "0.33.3", + "resolved": "https://registry.npmmirror.com/chrome-remote-interface/-/chrome-remote-interface-0.33.3.tgz", + "integrity": "sha512-zNnn0prUL86Teru6UCAZ1yU1XeXljHl3gj7OrfPcarEfU62OUU4IujDPdTDW3dAWwRqN3ZMG/Chhkh2gPL/wiw==", + "license": "MIT", + "dependencies": { + "commander": "2.11.x", + "ws": "^7.2.0" + }, + "bin": { + "chrome-remote-interface": "bin/client.js" + } + }, + "node_modules/chrome-remote-interface/node_modules/commander": { + "version": "2.11.0", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "license": "MIT" + }, "node_modules/chrome-trace-event": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", @@ -14321,6 +14341,27 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmmirror.com/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xml-lexer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/xml-lexer/-/xml-lexer-0.2.2.tgz", diff --git a/package.json b/package.json index 4b4f22351b..7f6af13ff3 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "chart.js": "4.5.0", "chartjs-adapter-dayjs-4": "1.0.4", "chartjs-plugin-zoom": "2.2.0", + "chrome-remote-interface": "0.33.3", "clippie": "4.1.7", "cropperjs": "1.6.2", "css-loader": "7.1.2", diff --git a/playwright.config.ts b/playwright.config.ts index d1cd299e25..6b50337033 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,7 +9,7 @@ export default { testMatch: /.*\.test\.e2e\.ts/, // Match any .test.e2e.ts files /* Maximum time one test can run for. */ - timeout: 30 * 1000, + timeout: 500000, expect: { @@ -17,7 +17,7 @@ export default { * Maximum time expect() should wait for the condition to be met. * For example in `await expect(locator).toHaveText();` */ - timeout: 2000, + timeout: 15000, }, /* Fail the build on CI if you accidentally left test.only in the source code. */ @@ -36,10 +36,10 @@ export default { locale: 'en-US', /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 1000, + actionTimeout: 15000, /* Maximum time allowed for navigation, such as `page.goto()`. */ - navigationTimeout: 5 * 1000, + navigationTimeout: 15000, /* Base URL to use in actions like `await page.goto('/')`. */ baseURL: BASE_URL, @@ -69,26 +69,7 @@ export default { // }, // }, - { - name: 'webkit', - use: { - ...devices['Desktop Safari'], - }, - }, - /* Test against mobile viewports. */ - { - name: 'Mobile Chrome', - use: { - ...devices['Pixel 5'], - }, - }, - { - name: 'Mobile Safari', - use: { - ...devices['iPhone 12'], - }, - }, ], /* Folder for test artifacts such as screenshots, videos, traces, etc. */ diff --git a/tests/e2e/1.test.e2e.ts b/tests/e2e/1.test.e2e.ts new file mode 100644 index 0000000000..5ea886bcba --- /dev/null +++ b/tests/e2e/1.test.e2e.ts @@ -0,0 +1,85 @@ +import { test, expect } from '@playwright/test'; +import { link } from 'node:fs'; +const baseURL = process.env.GITEA_URL; +if (!baseURL) { + throw new Error("请设置 GITEA_URL 环境变量"); +} +test('DevContainer 功能和配置', async ({ page,context }) => { + + console.log("正在登陆"); + await page.goto(baseURL + '/user/login'); + await page.fill('#user_name', 'jiaojunming'); + await page.fill('#password', 'hwyhwy12'); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(baseURL + '/'); + console.log("登录成功! "); + + console.log("进入test1仓库"); + await page.goto(baseURL + '/jiaojunming/test1'); + await page.getByRole('link', { name: 'Dev Container' }).click(); + await expect(page.getByText('devcontainer.json')).toBeVisible(); + await expect(page.getByRole('button', { name: 'Create Dev Container' })).toBeVisible(); + console.log("创建开发容器"); + await page.getByRole('button', { name: 'Create Dev Container' }).click(); + console.log("正在创建"); + await expect(page.getByRole('button', { name: 'Stop Dev Container' })) + .toBeVisible({ timeout: 180000 }); + console.log("Dev container 创建成功!"); + await page.getByRole('button',{ name: 'Stop Dev Container'}).click(); + console.log("正在停止"); + await expect(page.getByRole('button',{ name: 'Start Dev Container'})).toBeVisible({ timeout: 180000}); + console.log("成功停止开发容器!"); + await page.getByRole('button',{name: 'Start Dev Container'}).click(); + console.log("正在启动开发容器"); + await expect(page.getByRole('button',{name:'Stop Dev Container'})).toBeVisible({ timeout: 180000}); + console.log("成功启动!"); + console.log("保存开发容器"); + const pagePromise = context.waitForEvent('page'); + console.log("打开webterminal"); + await page.getByRole('link',{name: 'open with WebTerminal'}).click(); + const newPage = await pagePromise; + await newPage.waitForLoadState(); // 等待新页面加载完成 + console.log("Web Terminal: 新标签页已打开!"); + //await expect(newPage.getByText('Successfully connected to the container')).toBeVisible(); 这里ttyd里的信息PlayWright看不见,容器的交互没办法自动化测试 + await page.getByRole('link', { name: 'Delete Dev Container' }).click(); + await page.locator('#delete-repo-devcontainer-of-user-modal') + .getByRole('button', { name: 'Yes' }) + .click(); + console.log('正在删除!'); + await expect(page.getByRole('button', { name: 'Create Dev Container' })).toBeVisible(); + console.log('成功删除!'); + console.log("test1 检查通过!"); + + console.log("test2仓库"); + await page.goto(baseURL + '/jiaojunming/test2'); + await page.getByRole('link', { name: 'Dev Container' }).click(); + await expect(page.getByText('Oops, it looks like there is no Dev Container Setting in this repository.')).toBeVisible(); + console.log("test2 检查通过"); + + console.log("test3仓库"); + await page.goto(baseURL + '/jiaojunming/test3'); + await page.getByRole('link', { name: 'Dev Container' }).click(); + await expect(page.getByText(' Invalid Dev Container Configuration')).toBeVisible(); + console.log("test3检查通过"); +}); +test('权限修改相关', async ({ page }) => { + console.log("正在登陆"); + await page.goto(baseURL + '/user/login'); + await page.fill('#user_name', 'jiaojunming'); + await page.fill('#password', 'hwyhwy12'); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(baseURL + '/'); + console.log("登录成功! "); + + console.log('权限配置'); + await page.goto(baseURL+'/-/admin/users/1/edit'); + const devContainerCheckbox = page.getByLabel(/May Create Devcontainers/i); + await devContainerCheckbox.uncheck(); + await page.getByRole('button', { name: 'Update User Account' }).click(); + await page.goto(baseURL + '/jiaojunming/test1'); + const devContainerLink = page.getByRole('link', { name: 'Dev Container' }); + await expect(devContainerLink).toBeHidden({ timeout: 10000 }); + console.log('权限设置成功!'); +}); + + diff --git a/tests/e2e/example.test.e2e.ts b/tests/e2e/example.test.e2e.ts deleted file mode 100644 index 1689f1b8ef..0000000000 --- a/tests/e2e/example.test.e2e.ts +++ /dev/null @@ -1,56 +0,0 @@ -import {test, expect} from '@playwright/test'; -import {login_user, save_visual, load_logged_in_context} from './utils_e2e.ts'; - -test.beforeAll(async ({browser}, workerInfo) => { - await login_user(browser, workerInfo, 'user2'); -}); - -test('homepage', async ({page}) => { - const response = await page.goto('/'); - expect(response?.status()).toBe(200); // Status OK - await expect(page).toHaveTitle(/^Gitea: Git with a cup of tea\s*$/); - await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg'); -}); - -test('register', async ({page}, workerInfo) => { - const response = await page.goto('/user/sign_up'); - expect(response?.status()).toBe(200); // Status OK - await page.locator('input[name=user_name]').fill(`e2e-test-${workerInfo.workerIndex}`); - await page.locator('input[name=email]').fill(`e2e-test-${workerInfo.workerIndex}@test.com`); - await page.locator('input[name=password]').fill('test123test123'); - await page.locator('input[name=retype]').fill('test123test123'); - await page.click('form button.ui.primary.button:visible'); - // Make sure we routed to the home page. Else login failed. - expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/`); - await expect(page.locator('.secondary-nav span>img.ui.avatar')).toBeVisible(); - await expect(page.locator('.ui.positive.message.flash-success')).toHaveText('Account was successfully created. Welcome!'); - - save_visual(page); -}); - -test('login', async ({page}, workerInfo) => { - const response = await page.goto('/user/login'); - expect(response?.status()).toBe(200); // Status OK - - await page.locator('input[name=user_name]').fill(`user2`); - await page.locator('input[name=password]').fill(`password`); - await page.click('form button.ui.primary.button:visible'); - - await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle - - expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/`); - - save_visual(page); -}); - -test('logged in user', async ({browser}, workerInfo) => { - const context = await load_logged_in_context(browser, workerInfo, 'user2'); - const page = await context.newPage(); - - await page.goto('/'); - - // Make sure we routed to the home page. Else login failed. - expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/`); - - save_visual(page); -}); diff --git a/tests/e2e/utils_e2e.ts b/tests/e2e/utils_e2e.ts index 3e92e0d3c2..6eaef4cb10 100644 --- a/tests/e2e/utils_e2e.ts +++ b/tests/e2e/utils_e2e.ts @@ -22,7 +22,7 @@ export async function login_user(browser: Browser, workerInfo: WorkerInfo, user: await page.locator('input[name=password]').fill(LOGIN_PASSWORD); await page.click('form button.ui.primary.button:visible'); - await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle + //await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle expect(page.url(), {message: `Failed to login user ${user}`}).toBe(`${workerInfo.project.use.baseURL}/`); diff --git a/tests/sqlite.ini.tmpl b/tests/sqlite.ini.tmpl index 938f203633..31ac00c070 100644 --- a/tests/sqlite.ini.tmpl +++ b/tests/sqlite.ini.tmpl @@ -1,5 +1,5 @@ APP_NAME = Gitea: Git with a cup of tea -RUN_MODE = prod +RUN_MODE = dev [database] DB_TYPE = sqlite3 From cc7f5ccff92fa89f5fc7991bb89679287e905c23 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 12:01:35 +0800 Subject: [PATCH 02/25] test scrpit --- .gitea/workflows/E2E-TEST.YAML | 49 ---------------------------------- mcp_config.json | 8 ------ my-auth-state.json | 35 ------------------------ 3 files changed, 92 deletions(-) delete mode 100644 .gitea/workflows/E2E-TEST.YAML delete mode 100644 mcp_config.json delete mode 100644 my-auth-state.json diff --git a/.gitea/workflows/E2E-TEST.YAML b/.gitea/workflows/E2E-TEST.YAML deleted file mode 100644 index d0415a82c5..0000000000 --- a/.gitea/workflows/E2E-TEST.YAML +++ /dev/null @@ -1,49 +0,0 @@ -name: E2E TEST -on: - push: - branches: - - main - pull_request: - branches: - - main -jobs: - test-e2e: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup Docker - uses: docker/setup-buildx-action@v2 - - - name: Install Docker - run: | - sudo systemctl start docker - sudo usermod -a -G docker $USER - docker --version - - - name: Pre-build WebTerminal image for E2E tests - run: | - docker build -t devstar.cn/devstar/webterminal:latest -f docker/Dockerfile.webTerminal . - - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - - uses: actions/setup-node@v4 - with: - node-version: 24 - cache: npm - cache-dependency-path: package-lock.json - - - name: Install Playwright for E2E testing - run: | - npx playwright install --with-deps - - name: Run E2E tests with installation workflow - run: | - make test-e2e-sqlite - timeout-minutes: 50 - env: - USE_REPO_TEST_DIR: 1 - DOCKER_HOST: unix:///var/run/docker.sock diff --git a/mcp_config.json b/mcp_config.json deleted file mode 100644 index f5d8d00a51..0000000000 --- a/mcp_config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "mcpServers": { - "chrome-devtools": { - "command": "npx", - "args": ["chrome-devtools-mcp@latest"] - } - } -} \ No newline at end of file diff --git a/my-auth-state.json b/my-auth-state.json deleted file mode 100644 index 1ce4eeb805..0000000000 --- a/my-auth-state.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "cookies": [ - { - "name": "i_like_gitea", - "value": "7ea7ad364f7d5366", - "domain": "192.168.181.128", - "path": "/", - "expires": -1, - "httpOnly": true, - "secure": false, - "sameSite": "Lax" - }, - { - "name": "lang", - "value": "en-US", - "domain": "192.168.181.128", - "path": "/", - "expires": -1, - "httpOnly": true, - "secure": false, - "sameSite": "Lax" - }, - { - "name": "_csrf", - "value": "Niy6wnAHLsNWRXpD_5a3rCQnBdo6MTc2MTIyNjAxNjAyMDIyMzk5OA", - "domain": "192.168.181.128", - "path": "/", - "expires": 1761312416.027574, - "httpOnly": true, - "secure": false, - "sameSite": "Lax" - } - ], - "origins": [] -} \ No newline at end of file From b33e4adbe1dbf5b7c1ed980856ca44390ae11399 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 12:03:16 +0800 Subject: [PATCH 03/25] test script --- tests/e2e/{1.test.e2e.ts => devcontainer.test.e2e.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/e2e/{1.test.e2e.ts => devcontainer.test.e2e.ts} (100%) diff --git a/tests/e2e/1.test.e2e.ts b/tests/e2e/devcontainer.test.e2e.ts similarity index 100% rename from tests/e2e/1.test.e2e.ts rename to tests/e2e/devcontainer.test.e2e.ts From 38908ac0aace2243f17c6a9ee208a9dd227beb36 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 12:50:48 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/conf/app.example.ini | 2854 +++++++++++++++++++++++++++++++++++ 1 file changed, 2854 insertions(+) create mode 100644 custom/conf/app.example.ini diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini new file mode 100644 index 0000000000..aa2fcee765 --- /dev/null +++ b/custom/conf/app.example.ini @@ -0,0 +1,2854 @@ +; This file lists the default values used by Gitea +;; Copy required sections to your own app.ini (default is custom/conf/app.ini) +;; and modify as needed. +;; Do not copy the whole file as-is, as it contains some invalid sections for illustrative purposes. +;; If you don't know what a setting is you should not set it. +;; +;; see https://docs.gitea.com/administration/config-cheat-sheet for additional documentation. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Default Configuration (non-`app.ini` configuration) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; These values are environment-dependent but form the basis of a lot of values. They will be +;; reported as part of the default configuration when running `gitea help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up. +;; +;; - _`AppPath`_: This is the absolute path of the running gitea binary. +;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy: +;; - The "WORK_PATH" option in "app.ini" file +;; - The `--work-path` flag passed to the binary +;; - The environment variable `$GITEA_WORK_DIR` +;; - A built-in value set at build time (see building from source) +;; - Otherwise it defaults to the directory of the _`AppPath`_ +;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_ +;; - _`CustomPath`_: This is the base directory for custom templates and other options. It is determined by using the first set thing in the following hierarchy: +;; - The `--custom-path` flag passed to the binary +;; - The environment variable `$GITEA_CUSTOM` +;; - A built-in value set at build time (see building from source) +;; - Otherwise it defaults to _`AppWorkPath`_`/custom` +;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppWorkPath`_ +;; - _`CustomConf`_: This is the path to the `app.ini` file. +;; - The `--config` flag passed to the binary +;; - A built-in value set at build time (see building from source) +;; - Otherwise it defaults to _`CustomPath`_`/conf/app.ini` +;; - If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_ +;; +;; In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; General Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; App name that shows in every page title +APP_NAME = ; Gitea: Git with a cup of tea +;; +;; RUN_USER will automatically detect the current user - but you can set it here change it if you run locally +RUN_USER = ; git +;; +;; Application run mode, affects performance and debugging: "dev" or "prod", default is "prod" +;; Mode "dev" makes Gitea easier to develop and debug, values other than "dev" are treated as "prod" which is for production use. +;RUN_MODE = prod +;; +;; The working directory, see the comment of AppWorkPath above +;WORK_PATH = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[server] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; The protocol the server listens on. One of "http", "https", "http+unix", "fcgi" or "fcgi+unix". +;PROTOCOL = http +;; +;; Set the domain for the server. +;DOMAIN = localhost +;; +;; The AppURL is used to generate public URL links, defaults to "{PROTOCOL}://{DOMAIN}:{HTTP_PORT}/". +;; Most users should set it to the real website URL of their Gitea instance when there is a reverse proxy. +;ROOT_URL = +;; +;; Controls how to detect the public URL. +;; Although it defaults to "legacy" (to avoid breaking existing users), most instances should use the "auto" behavior, +;; especially when the Gitea instance needs to be accessed in a container network. +;; * legacy: detect the public URL from "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL". +;; * auto: always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL". +;PUBLIC_URL_DETECTION = legacy +;; +;; For development purpose only. It makes Gitea handle sub-path ("/sub-path/owner/repo/...") directly when debugging without a reverse proxy. +;; DO NOT USE IT IN PRODUCTION!!! +;USE_SUB_URL_PATH = false +;; +;; when STATIC_URL_PREFIX is empty it will follow ROOT_URL +;STATIC_URL_PREFIX = +;; +;; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket. +;; If PROTOCOL is set to "http+unix" or "fcgi+unix", this should be the name of the Unix socket file to use. +;; Relative paths will be made absolute against the _`AppWorkPath`_. +;HTTP_ADDR = 0.0.0.0 +;; +;; The port to listen on for "http" or "https" protocol. Leave empty when using a unix socket. +;HTTP_PORT = 3000 +;; +;; Expect PROXY protocol headers on connections +;USE_PROXY_PROTOCOL = false +;; +;; Use PROXY protocol in TLS Bridging mode +;PROXY_PROTOCOL_TLS_BRIDGING = false +;; +;; Timeout to wait for PROXY protocol header (set to 0 to have no timeout) +;PROXY_PROTOCOL_HEADER_TIMEOUT = 5s +;; +;; Accept PROXY protocol headers with UNKNOWN type +;PROXY_PROTOCOL_ACCEPT_UNKNOWN = false +;; +;; If REDIRECT_OTHER_PORT is true, and PROTOCOL is set to https an http server +;; will be started on PORT_TO_REDIRECT and it will redirect plain, non-secure http requests to the main +;; ROOT_URL. Defaults are false for REDIRECT_OTHER_PORT and 80 for +;; PORT_TO_REDIRECT. +;REDIRECT_OTHER_PORT = false +;PORT_TO_REDIRECT = 80 +;; +;; expect PROXY protocol header on connections to https redirector, defaults to USE_PROXY_PROTOCOL +;REDIRECTOR_USE_PROXY_PROTOCOL = +;; Minimum and maximum supported TLS versions +;SSL_MIN_VERSION=TLSv1.2 +;SSL_MAX_VERSION= +;; +;; SSL Curve Preferences +;SSL_CURVE_PREFERENCES=X25519,P256 +;; +;; SSL Cipher Suites +;SSL_CIPHER_SUITES=; Will default to "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" if aes is supported by hardware, otherwise chacha will be first. +;; +;; Timeout for any write to the connection. (Set to -1 to disable all timeouts.) +;PER_WRITE_TIMEOUT = 30s +;; +;; Timeout per Kb written to connections. +;PER_WRITE_PER_KB_TIMEOUT = 30s +;; +;; Permission for unix socket +;UNIX_SOCKET_PERMISSION = 666 +;; +;; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In +;; most cases you do not need to change the default value. Alter it only if +;; your SSH server node is not the same as HTTP node. For different protocol, the default +;; values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`. +;; If `PROTOCOL` is `fcgi` or `fcgi+unix`, the default value is `{PROTOCOL}://{HTTP_ADDR}:{HTTP_PORT}/`. +;; If listen on `0.0.0.0`, the default value is `{PROTOCOL}://localhost:{HTTP_PORT}/`. +;; Otherwise the default value is `{PROTOCOL}://{HTTP_ADDR}:{HTTP_PORT}/`. +;; Most users don't need (and shouldn't) set this value. +;LOCAL_ROOT_URL = +;; +;; When making local connections pass the PROXY protocol header, defaults to USE_PROXY_PROTOCOL +;LOCAL_USE_PROXY_PROTOCOL = +;; +;; Disable SSH feature when not available +;DISABLE_SSH = false +;; +;; Whether to use the builtin SSH server or not. +;START_SSH_SERVER = false +;; +;; Expect PROXY protocol header on connections to the built-in SSH server +;SSH_SERVER_USE_PROXY_PROTOCOL = false +;; +;; Username to use for the builtin SSH server. If blank, then it is the value of RUN_USER. +;BUILTIN_SSH_SERVER_USER = +;; +;; Domain name to be exposed in clone URL, defaults to DOMAIN or the domain part of ROOT_URL +;SSH_DOMAIN = +;; +;; SSH username displayed in clone URLs. It defaults to BUILTIN_SSH_SERVER_USER or RUN_USER. +;; If it is set to "(DOER_USERNAME)", it will use current signed-in user's username. +;; This option is only for some advanced users who have configured their SSH reverse-proxy +;; and need to use different usernames for git SSH clone. +;; Most users should just leave it blank. +;SSH_USER = +;; +;; The network interface the builtin SSH server should listen on +;SSH_LISTEN_HOST = +;; +;; Port number to be exposed in clone URL +;SSH_PORT = 22 +;; +;; The port number the builtin SSH server should listen on, defaults to SSH_PORT +;SSH_LISTEN_PORT = +;; +;; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. +;SSH_ROOT_PATH = +;; +;; Gitea will create a authorized_keys file by default when it is not using the internal ssh server +;; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off. +;SSH_CREATE_AUTHORIZED_KEYS_FILE = true +;; +;; Gitea will create a authorized_principals file by default when it is not using the internal ssh server +;; If you intend to use the AuthorizedPrincipalsCommand functionality then you should turn this off. +;SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE = true +;; +;; For the builtin SSH server, choose the supported ciphers/key-exchange-algorithms/MACs for SSH connections. +;; The supported names are listed in https://github.com/golang/crypto/blob/master/ssh/common.go. +;; Leave them empty to use the Golang crypto's recommended default values. +;; For system SSH (non-builtin SSH server), this setting has no effect. +;SSH_SERVER_CIPHERS = +;SSH_SERVER_KEY_EXCHANGES = +;SSH_SERVER_MACS = +;; +;; For the built-in SSH server, choose the keypair to offer as the host key +;; The private key should be at SSH_SERVER_HOST_KEY and the public SSH_SERVER_HOST_KEY.pub +;; relative paths are made absolute relative to the APP_DATA_PATH +;SSH_SERVER_HOST_KEYS=ssh/gitea.rsa, ssh/gogs.rsa +;; +;; Enable SSH Authorized Key Backup when rewriting all keys, default is false +;SSH_AUTHORIZED_KEYS_BACKUP = false +;; +;; Determines which principals to allow +;; - empty: if SSH_TRUSTED_USER_CA_KEYS is empty this will default to off, otherwise will default to email, username. +;; - off: Do not allow authorized principals +;; - email: the principal must match the user's email +;; - username: the principal must match the user's username +;; - anything: there will be no checking on the content of the principal +;SSH_AUTHORIZED_PRINCIPALS_ALLOW = email, username +;; +;; Enable SSH Authorized Principals Backup when rewriting all keys, default is true +;SSH_AUTHORIZED_PRINCIPALS_BACKUP = true +;; +;; Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. +;; Multiple keys should be comma separated. +;; E.g."ssh- ". or "ssh- , ssh- ". +;; For more information see "TrustedUserCAKeys" in the sshd config manpages. +;SSH_TRUSTED_USER_CA_KEYS = +;; Absolute path of the `TrustedUserCaKeys` file gitea will manage. +;; Default this `RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem +;; If you're running your own ssh server and you want to use the gitea managed file you'll also need to modify your +;; sshd_config to point to this file. The official docker image will automatically work without further configuration. +;SSH_TRUSTED_USER_CA_KEYS_FILENAME = +;; +;; Enable exposure of SSH clone URL to anonymous visitors, default is false +;SSH_EXPOSE_ANONYMOUS = false +;; +;; Timeout for any write to ssh connections. (Set to -1 to disable all timeouts.) +;; Will default to the PER_WRITE_TIMEOUT. +;SSH_PER_WRITE_TIMEOUT = 30s +;; +;; Timeout per Kb written to ssh connections. +;; Will default to the PER_WRITE_PER_KB_TIMEOUT. +;SSH_PER_WRITE_PER_KB_TIMEOUT = 30s +;; +;; Indicate whether to check minimum key size with corresponding type +;MINIMUM_KEY_SIZE_CHECK = false +;; +;; Disable CDN even in "prod" mode +;OFFLINE_MODE = true +;; +;; TLS Settings: Either ACME or manual +;; (Other common TLS configuration are found before) +;ENABLE_ACME = false +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ACME automatic TLS settings +;; +;; ACME directory URL (e.g. LetsEncrypt's staging/testing URL: https://acme-staging-v02.api.letsencrypt.org/directory) +;; Leave empty to default to LetsEncrypt's (production) URL +;ACME_URL = +;; +;; Explicitly accept the ACME's TOS. The specific TOS cannot be retrieved at the moment. +;ACME_ACCEPTTOS = false +;; +;; If the ACME CA is not in your system's CA trust chain, it can be manually added here +;ACME_CA_ROOT = +;; +;; Email used for the ACME registration service +;; Can be left blank to initialize at first run and use the cached value +;ACME_EMAIL = +;; +;; ACME live directory (not to be confused with ACME directory URL: ACME_URL) +;; (Refer to caddy's ACME manager https://github.com/caddyserver/certmagic) +;ACME_DIRECTORY = https +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Manual TLS settings: (Only applicable if ENABLE_ACME=false) +;; +;; Generate steps: +;; $ ./gitea cert -ca=true -duration=8760h0m0s -host=myhost.example.com +;; +;; Or from a .pfx file exported from the Windows certificate store (do +;; not forget to export the private key): +;; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys +;; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes +;; Paths are relative to CUSTOM_PATH +;CERT_FILE = https/cert.pem +;KEY_FILE = https/key.pem +;; +;; Root directory containing templates and static files. +;; default is the path where Gitea is executed +;STATIC_ROOT_PATH = ; Will default to the built-in value _`StaticRootPath`_ +;; +;; Default path for App data +;APP_DATA_PATH = data ; relative paths will be made absolute with _`AppWorkPath`_ +;; +;; Base path for App's temp files, leave empty to use the managed tmp directory in APP_DATA_PATH +;APP_TEMP_PATH = +;; +;; Enable gzip compression for runtime-generated content, static resources excluded +;ENABLE_GZIP = false +;; +;; Application profiling (memory and cpu) +;; For "web" command it listens on localhost:6060 +;; For "serve" command it dumps to disk at PPROF_DATA_PATH as (cpuprofile|memprofile)__ +;ENABLE_PPROF = false +;; +;; PPROF_DATA_PATH, use an absolute path when you start gitea as service +;PPROF_DATA_PATH = data/tmp/pprof ; Path is relative to _`AppWorkPath`_ +;; +;; Landing page, can be "home", "explore", "organizations", "login", or any URL such as "/org/repo" or even "https://anotherwebsite.com" +;; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in. +;LANDING_PAGE = home +;; +;; Enables git-lfs support. true or false, default is false. +;LFS_START_SERVER = false +;; +;; Enables git-lfs SSH protocol support. true or false, default is false. +;LFS_ALLOW_PURE_SSH = false +;; +;; LFS authentication secret, change this yourself +;LFS_JWT_SECRET = +;; +;; Alternative location to specify LFS authentication secret. You cannot specify both this and LFS_JWT_SECRET, and must pick one +;LFS_JWT_SECRET_URI = file:/etc/gitea/lfs_jwt_secret +;; +;; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail. +;LFS_HTTP_AUTH_EXPIRY = 24h +;; +;; Maximum allowed LFS file size in bytes (Set to 0 for no limit). +;LFS_MAX_FILE_SIZE = 0 +;; +;; Maximum number of locks returned per page +;LFS_LOCKS_PAGING_NUM = 50 +;; +;; When clients make lfs batch requests, reject them if there are more pointers than this number +;; zero means 'unlimited' +;LFS_MAX_BATCH_SIZE = 0 +;; +;; Allow graceful restarts using SIGHUP to fork +;ALLOW_GRACEFUL_RESTARTS = true +;; +;; After a restart the parent will finish ongoing requests before +;; shutting down. Force shutdown if this process takes longer than this delay. +;; set to a negative value to disable +;GRACEFUL_HAMMER_TIME = 60s +;; +;; Allows the setting of a startup timeout and waithint for Windows as SVC service +;; 0 disables this. +;STARTUP_TIMEOUT = 0 +;; +;; Static resources, includes resources on custom/, public/ and all uploaded avatars web browser cache time. Note that this cache is disabled when RUN_MODE is "dev". Default is 6h +;STATIC_CACHE_TIME = 6h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[database] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3". +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; MySQL Configuration +;; +DB_TYPE = mysql +HOST = 127.0.0.1:3306 ; can use socket e.g. /var/run/mysqld/mysqld.sock +NAME = gitea +USER = root +;PASSWD = ;Use PASSWD = `your password` for quoting if you use special characters in the password. +;SSL_MODE = false ; either "false" (default), "true", or "skip-verify" +;CHARSET_COLLATION = ; Empty as default, Gitea will try to find a case-sensitive collation. Don't change it unless you clearly know what you need. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Postgres Configuration +;; +;DB_TYPE = postgres +;HOST = 127.0.0.1:5432 ; can use socket e.g. /var/run/postgresql/ +;NAME = gitea +;USER = root +;PASSWD = +;SCHEMA = +;SSL_MODE=disable ;either "disable" (default), "require", or "verify-full" +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; SQLite Configuration +;; +;DB_TYPE = sqlite3 +;PATH= ; defaults to data/gitea.db +;SQLITE_TIMEOUT = ; Query timeout defaults to: 500 +;SQLITE_JOURNAL_MODE = ; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; MSSQL Configuration +;; +;DB_TYPE = mssql +;HOST = 172.17.0.2:1433 +;NAME = gitea +;USER = SA +;PASSWD = MwantsaSecurePassword1 +;CHARSET_COLLATION = ; Empty as default, Gitea will try to find a case-sensitive collation. Don't change it unless you clearly know what you need. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Other settings +;; +;; For iterate buffer, default is 50 +;ITERATE_BUFFER_SIZE = 50 +;; +;; Show the database generated SQL +;LOG_SQL = false +;; +;; Maximum number of DB Connect retries +;DB_RETRIES = 10 +;; +;; Backoff time per DB retry (time.Duration) +;DB_RETRY_BACKOFF = 3s +;; +;; Max idle database connections on connection pool, default is 2 +;MAX_IDLE_CONNS = 2 +;; +;; Database connection max life time, default is 0 or 3s mysql (See #6804 & #7071 for reasoning) +;CONN_MAX_LIFETIME = 3s +;; +;; Database maximum number of open connections, default is 0 meaning no maximum +;MAX_OPEN_CONNS = 0 +;; +;; Whether execute database models migrations automatically +;AUTO_MIGRATION = true +;; +;; Threshold value (in seconds) beyond which query execution time is logged as a warning in the xorm logger +;; +;SLOW_QUERY_THRESHOLD = 5s + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[security] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Whether the installer is disabled (set to true to disable the installer) +INSTALL_LOCK = false +;; +;; Global secret key that will be used +;; This key is VERY IMPORTANT. If you lose it, the data encrypted by it (like 2FA secret) can't be decrypted anymore. +SECRET_KEY = +;; +;; Alternative location to specify secret key, instead of this file; you cannot specify both this and SECRET_KEY, and must pick one +;; This key is VERY IMPORTANT. If you lose it, the data encrypted by it (like 2FA secret) can't be decrypted anymore. +;SECRET_KEY_URI = file:/etc/gitea/secret_key +;; +;; Secret used to validate communication within Gitea binary. +INTERNAL_TOKEN = +;; +;; Alternative location to specify internal token, instead of this file; you cannot specify both this and INTERNAL_TOKEN, and must pick one +;INTERNAL_TOKEN_URI = file:/etc/gitea/internal_token +;; +;; How long to remember that a user is logged in before requiring relogin (in days) +;LOGIN_REMEMBER_DAYS = 31 +;; +;; Name of the cookie used to store the current username. +;COOKIE_USERNAME = gitea_awesome +;; +;; Name of cookie used to store authentication information. +;COOKIE_REMEMBER_NAME = gitea_incredible +;; +;; Reverse proxy authentication header name of user name, email, and full name +;REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER +;REVERSE_PROXY_AUTHENTICATION_EMAIL = X-WEBAUTH-EMAIL +;REVERSE_PROXY_AUTHENTICATION_FULL_NAME = X-WEBAUTH-FULLNAME +;; +;; Interpret X-Forwarded-For header or the X-Real-IP header and set this as the remote IP for the request +;REVERSE_PROXY_LIMIT = 1 +;; +;; List of IP addresses and networks separated by comma of trusted proxy servers. Use `*` to trust all. +;REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128 +;; +;; The minimum password length for new Users +;MIN_PASSWORD_LENGTH = 8 +;; +;; Set to true to allow users to import local server paths +;IMPORT_LOCAL_PATHS = false +;; +;; Set to false to allow users with git hook privileges to create custom git hooks. +;; Custom git hooks can be used to perform arbitrary code execution on the host operating system. +;; This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service. +;; By modifying the Gitea database, users can gain Gitea administrator privileges. +;; It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user. +;; WARNING: This maybe harmful to you website or your operating system. +;; WARNING: Setting this to true does not change existing hooks in git repos; adjust it before if necessary. +;DISABLE_GIT_HOOKS = true +;; +;; Set to true to disable webhooks feature. +;DISABLE_WEBHOOKS = false +;; +;; Set to false to allow pushes to gitea repositories despite having an incomplete environment - NOT RECOMMENDED +;ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET = true +;; +;;Comma separated list of character classes required to pass minimum complexity. +;;If left empty or no valid values are specified, the default is off (no checking) +;;Classes include "lower,upper,digit,spec" +;PASSWORD_COMPLEXITY = off +;; +;; Password Hash algorithm, either "argon2", "pbkdf2", "scrypt" or "bcrypt" +;PASSWORD_HASH_ALGO = pbkdf2 +;; +;; Set false to allow JavaScript to read CSRF cookie +;CSRF_COOKIE_HTTP_ONLY = true +;; +;; Validate against https://haveibeenpwned.com/Passwords to see if a password has been exposed +;PASSWORD_CHECK_PWN = false +;; +;; Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. +;; This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security. +;SUCCESSFUL_TOKENS_CACHE_SIZE = 20 +;; +;; Reject API tokens sent in URL query string (Accept Header-based API tokens only). This avoids security vulnerabilities +;; stemming from cached/logged plain-text API tokens. +;; In future releases, this will become the default behavior +;DISABLE_QUERY_AUTH_TOKEN = false +;; +;; On user registration, record the IP address and user agent of the user to help identify potential abuse. +;; RECORD_USER_SIGNUP_METADATA = false +;; +;; Set the two-factor auth behavior. +;; Set to "enforced", to force users to enroll into Two-Factor Authentication, users without 2FA have no access to repositories via API or web. +;TWO_FACTOR_AUTH = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[camo] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; At the moment we only support images +;; +;; if the camo is enabled +;ENABLED = false +;; url to a camo image proxy, it **is required** if camo is enabled. +;SERVER_URL = +;; HMAC to encode urls with, it **is required** if camo is enabled. +;HMAC_KEY = +;; Set to true to use camo for https too lese only non https urls are proxyed +;; ALLWAYS is deprecated and will be removed in the future +;ALWAYS = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[oauth2] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Enables OAuth2 provider +ENABLED = true +;; +;; Algorithm used to sign OAuth2 tokens. Valid values: HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, EdDSA +;JWT_SIGNING_ALGORITHM = RS256 +;; +;; Private key file path used to sign OAuth2 tokens. The path is relative to APP_DATA_PATH. +;; This setting is only needed if JWT_SIGNING_ALGORITHM is set to RS256, RS384, RS512, ES256, ES384 or ES512. +;; The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you. +;JWT_SIGNING_PRIVATE_KEY_FILE = jwt/private.pem +;; +;; OAuth2 authentication secret for access and refresh tokens, change this yourself to a unique string. CLI generate option is helpful in this case. https://docs.gitea.io/en-us/command-line/#generate +;; This setting is only needed if JWT_SIGNING_ALGORITHM is set to HS256, HS384 or HS512. +;JWT_SECRET = +;; +;; Alternative location to specify OAuth2 authentication secret. You cannot specify both this and JWT_SECRET, and must pick one +;JWT_SECRET_URI = file:/etc/gitea/oauth2_jwt_secret +;; +;; Lifetime of an OAuth2 access token in seconds +;ACCESS_TOKEN_EXPIRATION_TIME = 3600 +;; +;; Lifetime of an OAuth2 refresh token in hours +;REFRESH_TOKEN_EXPIRATION_TIME = 730 +;; +;; Check if refresh token got already used +;INVALIDATE_REFRESH_TOKENS = false +;; +;; Maximum length of oauth2 token/cookie stored on server +;MAX_TOKEN_LENGTH = 32767 +;; +;; Pre-register OAuth2 applications for some universally useful services +;; * https://github.com/hickford/git-credential-oauth +;; * https://github.com/git-ecosystem/git-credential-manager +;; * https://gitea.com/gitea/tea +;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[log] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Root path for the log files - defaults to "{AppWorkPath}/log" +;ROOT_PATH = +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Main Logger +;; +;; Either "console", "file" or "conn", default is "console" +;; Use comma to separate multiple modes, e.g. "console, file" +MODE = console +;; +;; Either "Trace", "Debug", "Info", "Warn", "Error" or "None", default is "Info" +LEVEL = Info +;; +;; Print Stacktrace with logs (rarely helpful, do not set) Either "Trace", "Debug", "Info", "Warn", "Error", default is "None" +;STACKTRACE_LEVEL = None +;; +;; Buffer length of the channel, keep it as it is if you don't know what it is. +;BUFFER_LEN = 10000 +;; +;; Sub logger modes, a single comma means use default MODE above, empty means disable it +;logger.access.MODE= +;logger.router.MODE=, +;logger.xorm.MODE=, +;; +;; Collect SSH logs (Creates log from ssh git request) +;; +;ENABLE_SSH_LOG = false +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Access Logger (Creates log in NCSA common log format) +;; +;; Print request id which parsed from request headers in access log, when access log is enabled. +;; * E.g: +;; * In request Header: X-Request-ID: test-id-123 +;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID +;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "test-id-123" +;; +;; If you configure more than one in the .ini file, it will match in the order of configuration, +;; and the first match will be finally printed in the log. +;; * E.g: +;; * In request Header: X-Trace-ID: trace-id-1q2w3e4r +;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID, X-Trace-ID, X-Req-ID +;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "trace-id-1q2w3e4r" +;; +;REQUEST_ID_HEADERS = +;; +;; Sets the template used to create the access log. +;ACCESS_LOG_TEMPLATE = {{.Ctx.RemoteHost}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}" "{{.Ctx.Req.UserAgent}}" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Log modes (aka log writers) +;; +;[log.%(WriterMode)] +;MODE=console/file/conn/... +;LEVEL= +;FLAGS = stdflags +;EXPRESSION = +;PREFIX = +;COLORIZE = false +;; +;[log.console] +;STDERR = false +;; +;[log.file] +;; Set the file_name for the logger. If this is a relative path this will be relative to ROOT_PATH +;FILE_NAME = +;; This enables automated log rotate(switch of following options), default is true +;LOG_ROTATE = true +;; Max size shift of a single file, default is 28 means 1 << 28, 256MB +;MAX_SIZE_SHIFT = 28 +;; Segment log daily, default is true +;DAILY_ROTATE = true +;; delete the log file after n days, default is 7 +;MAX_DAYS = 7 +;; compress logs with gzip +;COMPRESS = true +;; compression level see godoc for compress/gzip +;COMPRESSION_LEVEL = -1 +;; +;[log.conn] +;; Reconnect host for every single message, default is false +;RECONNECT_ON_MSG = false +;; Try to reconnect when connection is lost, default is false +;RECONNECT = false +;; Either "tcp", "unix" or "udp", default is "tcp" +;PROTOCOL = tcp +;; Host address +;ADDR = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[git] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; The path of git executable. If empty, Gitea searches through the PATH environment. +;PATH = +;; +;; The HOME directory for Git, defaults to "{APP_DATA_PATH}/home" +;HOME_PATH = +;; +;; Disables highlight of added and removed changes +;DISABLE_DIFF_HIGHLIGHT = false +;; +;; Max number of lines allowed in a single file in diff view +;MAX_GIT_DIFF_LINES = 1000 +;; +;; Max number of allowed characters in a line in diff view +;MAX_GIT_DIFF_LINE_CHARACTERS = 5000 +;; +;; Max number of files shown in diff view +;MAX_GIT_DIFF_FILES = 100 +;; +;; Set the default commits range size +;COMMITS_RANGE_SIZE = 50 +;; +;; Set the default branches range size +;BRANCHES_RANGE_SIZE = 20 +;; +;; Arguments for command 'git gc', e.g. "--aggressive --auto" +;; see more on http://git-scm.com/docs/git-gc/ +;GC_ARGS = +;; +;; If use git wire protocol version 2 when git version >= 2.18, default is true, set to false when you always want git wire protocol version 1 +;; To enable this for Git over SSH when using a OpenSSH server, add `AcceptEnv GIT_PROTOCOL` to your sshd_config file. +;ENABLE_AUTO_GIT_WIRE_PROTOCOL = true +;; +;; Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled) +;PULL_REQUEST_PUSH_MESSAGE = true +;; +;; (Go-Git only) Don't cache objects greater than this in memory. (Set to 0 to disable.) +;LARGE_OBJECT_THRESHOLD = 1048576 +;; Set to true to forcibly set core.protectNTFS=false +;DISABLE_CORE_PROTECT_NTFS=false +;; Disable the usage of using partial clones for git. +;DISABLE_PARTIAL_CLONE = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Git Operation timeout in seconds +;[git.timeout] +;DEFAULT = 360 +;MIGRATE = 600 +;MIRROR = 300 +;CLONE = 300 +;PULL = 300 +;GC = 60 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Git config options +;; This section only does "set" config, a removed config key from this section won't be removed from git config automatically. The format is `some.configKey = value`. +;[git.config] +;diff.algorithm = histogram +;core.logAllRefUpdates = true +;gc.reflogExpire = 90 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[service] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Time limit to confirm account/email registration +;ACTIVE_CODE_LIVE_MINUTES = 180 +;; +;; Time limit to perform the reset of a forgotten password +;RESET_PASSWD_CODE_LIVE_MINUTES = 180 +;; +;; Whether a new user needs to confirm their email when registering. +;REGISTER_EMAIL_CONFIRM = false +;; +;; Whether a new user needs to be confirmed manually after registration. (Requires `REGISTER_EMAIL_CONFIRM` to be disabled.) +;REGISTER_MANUAL_CONFIRM = false +;; +;; List of domain names that are allowed to be used to register on a Gitea instance, wildcard is supported +;; eg: gitea.io,example.com,*.mydomain.com +;EMAIL_DOMAIN_ALLOWLIST = +;; +;; Comma-separated list of domain names that are not allowed to be used to register on a Gitea instance, wildcard is supported +;EMAIL_DOMAIN_BLOCKLIST = +;; +;; Disallow registration, only allow admins to create accounts. +;DISABLE_REGISTRATION = false +;; +;; Allow registration only using gitea itself, it works only when DISABLE_REGISTRATION is false +;ALLOW_ONLY_INTERNAL_REGISTRATION = false +;; +;; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false +;ALLOW_ONLY_EXTERNAL_REGISTRATION = false +;; +;; User must sign in to view anything. +;; It could be set to "expensive" to block anonymous users accessing some pages which consume a lot of resources, +;; for example: block anonymous AI crawlers from accessing repo code pages. +;; The "expensive" mode is experimental and subject to change. +;REQUIRE_SIGNIN_VIEW = false +;; +;; Mail notification +;ENABLE_NOTIFY_MAIL = false +;; +;; This setting enables gitea to be signed in with HTTP BASIC Authentication using the user's password +;; If you set this to false you will not be able to access the tokens endpoints on the API with your password +;; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token +;ENABLE_BASIC_AUTHENTICATION = true +;; +;; Show the password sign-in form (for password-based login), otherwise, only show OAuth2 or passkey login methods if they are enabled. +;; If you set it to false, maybe it also needs to set ENABLE_BASIC_AUTHENTICATION to false to completely disable password-based authentication. +;ENABLE_PASSWORD_SIGNIN_FORM = true +;; +;; Allow users to sign-in with a passkey +;ENABLE_PASSKEY_AUTHENTICATION = true +;; +;; More detail: https://github.com/gogits/gogs/issues/165 +;ENABLE_REVERSE_PROXY_AUTHENTICATION = false +; Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. +;ENABLE_REVERSE_PROXY_AUTHENTICATION_API = false +;ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false +;ENABLE_REVERSE_PROXY_EMAIL = false +;ENABLE_REVERSE_PROXY_FULL_NAME = false +;; +;; Enable captcha validation for registration +;ENABLE_CAPTCHA = false +;; +;; Enable this to require captcha validation for login +;REQUIRE_CAPTCHA_FOR_LOGIN = false +;; +;; Type of captcha you want to use. Options: image, recaptcha, hcaptcha, mcaptcha, cfturnstile. +;CAPTCHA_TYPE = image +;; +;; Change this to use recaptcha.net or other recaptcha service +;RECAPTCHA_URL = https://www.google.com/recaptcha/ +;; Enable recaptcha to use Google's recaptcha service +;; Go to https://www.google.com/recaptcha/admin to sign up for a key +;RECAPTCHA_SECRET = +;RECAPTCHA_SITEKEY = +;; +;; For hCaptcha, create an account at https://accounts.hcaptcha.com/login to get your keys +;HCAPTCHA_SECRET = +;HCAPTCHA_SITEKEY = +;; +;; Change this to use demo.mcaptcha.org or your self-hosted mcaptcha.org instance. +;MCAPTCHA_URL = https://demo.mcaptcha.org +;; +;; Go to your configured mCaptcha instance and register a sitekey +;; and use your account's secret. +;MCAPTCHA_SECRET = +;MCAPTCHA_SITEKEY = +;; +;; Go to https://dash.cloudflare.com/?to=/:account/turnstile to sign up for a key +;CF_TURNSTILE_SITEKEY = +;CF_TURNSTILE_SECRET = +;; +;; Default value for KeepEmailPrivate +;; Each new user will get the value of this setting copied into their profile +;DEFAULT_KEEP_EMAIL_PRIVATE = false +;; +;; Default value for AllowCreateOrganization +;; Every new user will have rights set to create organizations depending on this setting +;DEFAULT_ALLOW_CREATE_ORGANIZATION = true +;; Default value for IsRestricted +;; Every new user will have restricted permissions depending on this setting +;DEFAULT_USER_IS_RESTRICTED = false +;; +;; Either "public", "limited" or "private", default is "public" +;; Limited is for users visible only to signed users +;; Private is for users visible only to members of their organizations +;; Public is for users visible for everyone +;DEFAULT_USER_VISIBILITY = public +;; +;; Set which visibility modes a user can have +;ALLOWED_USER_VISIBILITY_MODES = public,limited,private +;; +;; Either "public", "limited" or "private", default is "public" +;; Limited is for organizations visible only to signed users +;; Private is for organizations visible only to members of the organization +;; Public is for organizations visible to everyone +;DEFAULT_ORG_VISIBILITY = public +;; +;; Default value for DefaultOrgMemberVisible +;; True will make the membership of the users visible when added to the organisation +;DEFAULT_ORG_MEMBER_VISIBLE = false +;; +;; Default value for EnableDependencies +;; Repositories will use dependencies by default depending on this setting +;DEFAULT_ENABLE_DEPENDENCIES = true +;; +;; Dependencies can be added from any repository where the user is granted access or only from the current repository depending on this setting. +;ALLOW_CROSS_REPOSITORY_DEPENDENCIES = true +;; +;; Default map service. No external API support has been included. A service has to allow +;; searching using URL parameters, the location will be appended to the URL as escaped query parameter. +;; Disabled by default, some example values are: +;; - OpenStreetMap: https://www.openstreetmap.org/search?query= +;; - Google Maps: https://www.google.com/maps/place/ +;; - MapQuest: https://www.mapquest.com/search/ +;; - Bing Maps: https://www.bing.com/maps?where1= +; USER_LOCATION_MAP_URL = +;; +;; Enable heatmap on users profiles. +;ENABLE_USER_HEATMAP = true +;; +;; Enable Timetracking +;ENABLE_TIMETRACKING = true +;; +;; Default value for EnableTimetracking +;; Repositories will use timetracking by default depending on this setting +;DEFAULT_ENABLE_TIMETRACKING = true +;; +;; Default value for AllowOnlyContributorsToTrackTime +;; Only users with write permissions can track time if this is true +;DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME = true +;; +;; Value for the domain part of the user's email address in the git log if user +;; has set KeepEmailPrivate to true. The user's email will be replaced with a +;; concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS. Default +;; value is "noreply." + DOMAIN, where DOMAIN resolves to the value from server.DOMAIN +;; Note: do not use the notation below +;NO_REPLY_ADDRESS = ; noreply. +;; +;; Show Registration button +;SHOW_REGISTRATION_BUTTON = true +;; +;; Show milestones dashboard page - a view of all the user's milestones +;SHOW_MILESTONES_DASHBOARD_PAGE = true +;; +;; Default value for AutoWatchNewRepos +;; When adding a repo to a team or creating a new repo all team members will watch the +;; repo automatically if enabled +;AUTO_WATCH_NEW_REPOS = true +;; +;; Default value for AutoWatchOnChanges +;; Make the user watch a repository When they commit for the first time +;AUTO_WATCH_ON_CHANGES = false +;; +;; Minimum amount of time a user must exist before comments are kept when the user is deleted. +;USER_DELETE_WITH_COMMENTS_MAX_TIME = 0 +;; Valid site url schemes for user profiles +;VALID_SITE_URL_SCHEMES=http,https + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[service.explore] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Only allow signed in users to view the explore pages. +;REQUIRE_SIGNIN_VIEW = false +;; +;; Disable the users explore page. +;DISABLE_USERS_PAGE = false +;; +;; Disable the organizations explore page. +;DISABLE_ORGANIZATIONS_PAGE = false +;; +;; Disable the code explore page. +;DISABLE_CODE_PAGE = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[qos] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Enable request quality of service and overload protection. +; ENABLED = false +;; +;; The maximum number of concurrent requests that the server will +;; process before enqueueing new requests. Default is "CpuNum * 4". +; MAX_INFLIGHT = +;; +;; The maximum number of requests that can be enqueued before new +;; requests will be dropped. +; MAX_WAITING = 100 +;; +;; Target maximum wait time a request may be enqueued for. Requests +;; that are enqueued for less than this amount of time will not be +;; dropped. When wait times exceed this amount, a portion of requests +;; will be dropped until wait times have decreased below this amount. +; TARGET_WAIT_TIME = 250ms + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Other Settings +;; +;; Uncomment the [section.header] if you wish to +;; set the below settings. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Root path for storing all repository data. By default, it is set to "{APP_DATA_PATH}/gitea-repositories". +;; A relative path is interpreted as "{AppWorkPath}/{ROOT}" (use AppWorkPath as base path). +;ROOT = +;; +;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. +;SCRIPT_TYPE = bash +;; +;; DETECTED_CHARSETS_ORDER tie-break order for detected charsets. +;; If the charsets have equal confidence, tie-breaking will be done by order in this list +;; with charsets earlier in the list chosen in preference to those later. +;; Adding "defaults" will place the unused charsets at that position. +;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 +;; +;; Default ANSI charset to override non-UTF-8 charsets to +;ANSI_CHARSET = +;; +;; Force every new repository to be private +;FORCE_PRIVATE = false +;; +;; Default privacy setting when creating a new repository, allowed values: last, private, public. Default is last which means the last setting used. +;DEFAULT_PRIVATE = last +;; +;; Default private when using push-to-create +;DEFAULT_PUSH_CREATE_PRIVATE = true +;; +;; Global limit of repositories per user, applied at creation time. -1 means no limit +;MAX_CREATION_LIMIT = -1 +;; +;; Preferred Licenses to place at the top of the List +;; The name here must match the filename in options/license or custom/options/license +;PREFERRED_LICENSES = Apache License 2.0,MIT License +;; +;; Disable the ability to interact with repositories using the HTTP protocol +;DISABLE_HTTP_GIT = false +;; +;; Value for Access-Control-Allow-Origin header, default is not to present +;; WARNING: This may be harmful to your website if you do not give it a right value. +;ACCESS_CONTROL_ALLOW_ORIGIN = +;; +;; Force ssh:// clone url instead of scp-style uri when default SSH port is used +;USE_COMPAT_SSH_URI = false +;; +;; Value for the "go get" request returns the repository url as https or ssh, default is https +;GO_GET_CLONE_URL_PROTOCOL = https +;; +;; Close issues as long as a commit on any branch marks it as fixed +;DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false +;; +;; Allow users to push local repositories to Gitea and have them automatically created for a user or an org +;ENABLE_PUSH_CREATE_USER = false +;ENABLE_PUSH_CREATE_ORG = false +;; +;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions. +;DISABLED_REPO_UNITS = +;; +;; Comma separated list of default new repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions. +;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. +;; External wiki and issue tracker can't be enabled by default as it requires additional settings. +;; Disabled repo units will not be added to new repositories regardless if it is in the default list. +;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions +;; +;; Comma separated list of default forked repo units. +;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. +;DEFAULT_FORK_REPO_UNITS = repo.code,repo.pulls +;; +;; Comma separated list of default mirror repo units. +;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. +;DEFAULT_MIRROR_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.wiki,repo.projects,repo.packages +;; +;; Comma separated list of default template repo units. +;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. +;DEFAULT_TEMPLATE_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages +;; +;; Prefix archive files by placing them in a directory named after the repository +;PREFIX_ARCHIVE_FILES = true +;; +;; Disable migrating feature. +;DISABLE_MIGRATIONS = false +;; +;; Disable stars feature. +;DISABLE_STARS = false +;; +;; The default branch name of new repositories +;DEFAULT_BRANCH = main +;; +;; Allow adoption of unadopted repositories +;ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES = false +;; +;; Allow deletion of unadopted repositories +;ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false + +;; Don't allow download source archive files from UI +;DISABLE_DOWNLOAD_SOURCE_ARCHIVES = false + +;; Allow to fork repositories without maximum number limit +;ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT = true + +;; Allow to fork repositories into the same owner (user or organization) +;; This feature is experimental, not fully tested, and may be changed in the future +;ALLOW_FORK_INTO_SAME_OWNER = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.editor] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; List of file extensions for which lines should be wrapped in the Monaco editor +;; Separate extensions with a comma. To line wrap files without an extension, just put a comma +;LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,.livemd, + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.upload] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Whether repository file uploads are enabled. Defaults to `true` +;ENABLED = true +;; +;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. +;ALLOWED_TYPES = +;; +;; Max size of each file in megabytes. Defaults to 50MB +;FILE_MAX_SIZE = 50 +;; +;; Max number of files per upload. Defaults to 5 +;MAX_FILES = 5 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.pull-request] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; List of prefixes used in Pull Request title to mark them as Work In Progress (matched in a case-insensitive manner) +;WORK_IN_PROGRESS_PREFIXES = WIP:,[WIP] +;; +;; List of keywords used in Pull Request comments to automatically close a related issue +;CLOSE_KEYWORDS = close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved +;; +;; List of keywords used in Pull Request comments to automatically reopen a related issue +;REOPEN_KEYWORDS = reopen,reopens,reopened +;; +;; Set default merge style for repository creating, valid options: merge, rebase, rebase-merge, squash, fast-forward-only +;DEFAULT_MERGE_STYLE = merge +;; +;; In the default merge message for squash commits include at most this many commits +;DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT = 50 +;; +;; In the default merge message for squash commits limit the size of the commit messages to this +;DEFAULT_MERGE_MESSAGE_SIZE = 5120 +;; +;; In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list +;DEFAULT_MERGE_MESSAGE_ALL_AUTHORS = false +;; +;; In default merge messages limit the number of approvers listed as Reviewed-by: to this many +;DEFAULT_MERGE_MESSAGE_MAX_APPROVERS = 10 +;; +;; In default merge messages only include approvers who are official +;DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY = true +;; +;; In default squash-merge messages include the commit message of all commits comprising the pull request. +;POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES = false +;; +;; Add co-authored-by and co-committed-by trailers if committer does not match author +;ADD_CO_COMMITTER_TRAILERS = true +;; +;; In addition to testing patches using the three-way merge method, re-test conflicting patches with git apply +;TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY = false +;; +;; Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo. +;RETARGET_CHILDREN_ON_MERGE = true +;; +;; Delay mergeable check until page view or API access, for pull requests that have not been updated in the specified days when their base branches get updated. +;; Use "-1" to always check all pull requests (old behavior). Use "0" to always delay the checks. +;DELAY_CHECK_FOR_INACTIVE_DAYS = 7 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.issue] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; List of reasons why a Pull Request or Issue can be locked +;LOCK_REASONS = Too heated,Off-topic,Resolved,Spam +;; Maximum number of pinned Issues per repo +;; Set to 0 to disable pinning Issues +;MAX_PINNED = 3 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.release] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. +;ALLOWED_TYPES = +;DEFAULT_PAGING_NUM = 10 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.signing] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; GPG or SSH key to use to sign commits, Defaults to the default - that is the value of git config --get user.signingkey +;; Depending on the value of SIGNING_FORMAT this is either: +;; - openpgp: the GPG key ID +;; - ssh: the path to the ssh public key "/path/to/key.pub": where "/path/to/key" is the private key, use ssh-keygen -t ed25519 to generate a new key pair without password +;; run in the context of the RUN_USER +;; Switch to none to stop signing completely +;SIGNING_KEY = default +;; +;; If a SIGNING_KEY ID is provided and is not set to default, use the provided Name and Email address as the signer and the signing format. +;; These should match a publicized name and email address for the key. (When SIGNING_KEY is default these are set to +;; the results of git config --get user.name, git config --get user.email and git config --default openpgp --get gpg.format respectively and can only be overridden +;; by setting the SIGNING_KEY ID to the correct ID.) +;SIGNING_NAME = +;SIGNING_EMAIL = +;; SIGNING_FORMAT can be one of: +;; - openpgp (default): use GPG to sign commits +;; - ssh: use SSH to sign commits +;SIGNING_FORMAT = openpgp +;; +;; Sets the default trust model for repositories. Options are: collaborator, committer, collaboratorcommitter +;DEFAULT_TRUST_MODEL = collaborator +;; +;; Determines when gitea should sign the initial commit when creating a repository +;; Either: +;; - never +;; - pubkey: only sign if the user has a pubkey +;; - twofa: only sign if the user has logged in with twofa +;; - always +;; options other than none and always can be combined as comma separated list +;INITIAL_COMMIT = always +;; +;; Determines when to sign for CRUD actions +;; - as above +;; - parentsigned: requires that the parent commit is signed. +;CRUD_ACTIONS = pubkey, twofa, parentsigned +;; Determines when to sign Wiki commits +;; - as above +;WIKI = never +;; +;; Determines when to sign on merges +;; - basesigned: require that the parent of commit on the base repo is signed. +;; - commitssigned: require that all the commits in the head branch are signed. +;; - approved: only sign when merging an approved pr to a protected branch +;MERGES = pubkey, twofa, basesigned, commitssigned +;; +;; Determines which additional ssh keys are trusted for all signed commits regardless of the user +;; This is useful for ssh signing key rotation. +;; Exposes the provided SIGNING_NAME and SIGNING_EMAIL as the signer, regardless of the SIGNING_FORMAT value. +;; Multiple keys should be comma separated. +;; E.g."ssh- ". or "ssh- , ssh- ". +;TRUSTED_SSH_KEYS = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[repository.mimetype_mapping] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Custom MIME type mapping for downloadable files +;.apk=application/vnd.android.package-archive + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[project] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Default templates for project boards +;PROJECT_BOARD_BASIC_KANBAN_TYPE = To Do, In Progress, Done +;PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High Priority, Low Priority, Closed + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cors] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; More information about CORS can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers +;; enable cors headers (disabled by default) +;ENABLED = false +;; +;; list of requesting origins that are allowed, eg: "https://*.example.com" +;ALLOW_DOMAIN = * +;; +;; list of methods allowed to request +;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS +;; +;; max time to cache response +;MAX_AGE = 10m +;; +;; allow request with credentials +;ALLOW_CREDENTIALS = false +;; +;; headers to permit +;HEADERS = Content-Type,User-Agent +;; +;; set X-FRAME-OPTIONS header +;X_FRAME_OPTIONS = SAMEORIGIN + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ui] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Number of repositories that are displayed on one explore page +;EXPLORE_PAGING_NUM = 20 +;; +;; Number of issues that are displayed on one page +;ISSUE_PAGING_NUM = 20 +;; +;; Number of maximum commits displayed in one activity feed +;FEED_MAX_COMMIT_NUM = 5 +;; +;; Number of items that are displayed in home feed +;FEED_PAGING_NUM = 20 +;; +;; Number of items that are displayed in a single subsitemap +;SITEMAP_PAGING_NUM = 20 +;; +;; Number of maximum commits displayed in commit graph. +;GRAPH_MAX_COMMIT_NUM = 100 +;; +;; Number of line of codes shown for a code comment +;CODE_COMMENT_LINES = 4 +;; +;; Max size of files to be displayed (default is 8MiB) +;MAX_DISPLAY_FILE_SIZE = 8388608 +;; +;; Detect ambiguous unicode characters in file contents and show warnings on the UI +;AMBIGUOUS_UNICODE_DETECTION = true +;; +;; Whether the email of the user should be shown in the Explore Users page +;SHOW_USER_EMAIL = true +;; +;; Set the default theme for the Gitea install +;DEFAULT_THEME = gitea-auto +;; +;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`. +;; Leave it empty to allow users to select any theme from "{CustomPath}/public/assets/css/theme-*.css" +;THEMES = +;; +;; The icons for file list (basic/material), this is a temporary option which will be replaced by a user setting in the future. +;FILE_ICON_THEME = material +;; +;; All available reactions users can choose on issues/prs and comments. +;; Values can be emoji alias (:smile:) or a unicode emoji. +;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png +;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes +;; +;; Change the number of users that are displayed in reactions tooltip (triggered by mouse hover). +;REACTION_MAX_USER_NUM = 10 +;; +;; Additional Emojis not defined in the utf8 standard +;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config. +;; Dont mistake it for Reactions. +;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs +;; +;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used. +;DEFAULT_SHOW_FULL_NAME = false +;; +;; Whether to search within description at repository search on explore page. +;SEARCH_REPO_DESCRIPTION = true +;; +;; Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. +;; A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic). +;ONLY_SHOW_RELEVANT_REPOS = false +;; +;; Change the sort type of the explore pages. +;; Default is "recentupdate", but you also have "alphabetically", "reverselastlogin", "newest", "oldest". +;EXPLORE_PAGING_DEFAULT_SORT = recentupdate +;; +;; The tense all timestamps should be rendered in. Possible values are `absolute` time (i.e. 1970-01-01, 11:59) and `mixed`. +;; `mixed` means most timestamps are rendered in relative time (i.e. 2 days ago). +;PREFERRED_TIMESTAMP_TENSE = mixed + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ui.admin] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Number of users that are displayed on one page +;USER_PAGING_NUM = 50 +;; +;; Number of repos that are displayed on one page +;REPO_PAGING_NUM = 50 +;; +;; Number of notices that are displayed on one page +;NOTICE_PAGING_NUM = 25 +;; +;; Number of organizations that are displayed on one page +;ORG_PAGING_NUM = 50 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ui.user] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Number of repos that are displayed on one page +;REPO_PAGING_NUM = 15 + +;; Number of orgs that are displayed on profile page +;ORG_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] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Control how often the notification endpoint is polled to update the notification +;; The timeout will increase to MAX_TIMEOUT in TIMEOUT_STEPs if the notification count is unchanged +;; Set MIN_TIMEOUT to -1 to turn off +;MIN_TIMEOUT = 10s +;MAX_TIMEOUT = 60s +;TIMEOUT_STEP = 10s +;; +;; This setting determines how often the db is queried to get the latest notification counts. +;; If the browser client supports EventSource and SharedWorker, a SharedWorker will be used in preference to polling notification. Set to -1 to disable the EventSource +;EVENT_SOURCE_UPDATE_TIME = 10s + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ui.svg] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Whether to render SVG files as images. If SVG rendering is disabled, SVG files are displayed as text and cannot be embedded in markdown files as images. +;ENABLE_RENDER = true + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ui.csv] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Maximum allowed file size in bytes to render CSV files as table. (Set to 0 for no limit). +;MAX_FILE_SIZE = 524288 +;; +;; Maximum allowed rows to render CSV files. (Set to 0 for no limit) +;MAX_ROWS = 2500 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[markdown] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Customize render options for different contexts. Set to "none" to disable the defaults, or use comma separated list: +;; * short-issue-pattern: recognized "#123" issue reference and render it as a link to the issue +;; * new-line-hard-break: render soft line breaks as hard line breaks, which means a single newline character between +;; paragraphs will cause a line break and adding trailing whitespace to paragraphs is not +;; necessary to force a line break. +;RENDER_OPTIONS_COMMENT = short-issue-pattern, new-line-hard-break +;RENDER_OPTIONS_WIKI = short-issue-pattern +;RENDER_OPTIONS_REPO_FILE = +;; +;; Comma separated list of custom URL-Schemes that are allowed as links when rendering Markdown +;; for example git,magnet,ftp (more at https://en.wikipedia.org/wiki/List_of_URI_schemes) +;; URLs starting with http and https are always displayed, whatever is put in this entry. +;; If this entry is empty, all URL schemes are allowed. +;CUSTOM_URL_SCHEMES = +;; +;; List of file extensions that should be rendered/edited as Markdown +;; Separate the extensions with a comma. To render files without any extension as markdown, just put a comma +;FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd,.livemd +;; +;; Enables math inline and block detection +;ENABLE_MATH = true +;; +;; Enable delimiters for math code block detection. Set to "none" to disable all, +;; or use comma separated list: inline-dollar, inline-parentheses, block-dollar, block-square-brackets +;; Defaults to "inline-dollar,block-dollar" to follow GitHub's behavior. +;MATH_CODE_BLOCK_DETECTION = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[ssh.minimum_key_sizes] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Define allowed algorithms and their minimum key length (use -1 to disable a type) +;ED25519 = 256 +;ECDSA = 256 +;RSA = 3071 ; we allow 3071 here because an otherwise valid 3072 bit RSA key can be reported as having 3071 bit length +;DSA = -1 ; set to 1024 to switch on + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[indexer] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Issue Indexer settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Issue indexer type, currently support: bleve, db, elasticsearch or meilisearch default is bleve +;ISSUE_INDEXER_TYPE = bleve +;; +;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve +;ISSUE_INDEXER_PATH = indexers/issues.bleve ; Relative paths will be made absolute against _`AppWorkPath`_. +;; +;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g. http://elastic:password@localhost:9200) or meilisearch (e.g. http://:apikey@localhost:7700) +;ISSUE_INDEXER_CONN_STR = +;; +;; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch. +;ISSUE_INDEXER_NAME = gitea_issues +;; +;; Timeout the indexer if it takes longer than this to start. +;; Set to -1 to disable timeout. +;STARTUP_TIMEOUT = 30s +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Repository Indexer settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; repo indexer by default disabled, since it uses a lot of disk space +;REPO_INDEXER_ENABLED = false +;; +;; repo indexer units, the items to index, could be `sources`, `forks`, `mirrors`, `templates` or any combination of them separated by a comma. +;; If empty then it defaults to `sources` only, as if you'd like to disable fully please see REPO_INDEXER_ENABLED. +;REPO_INDEXER_REPO_TYPES = sources,forks,mirrors,templates +;; +;; Code search engine type, could be `bleve` or `elasticsearch`. +;REPO_INDEXER_TYPE = bleve +;; +;; Index file used for code search. available when `REPO_INDEXER_TYPE` is bleve +;REPO_INDEXER_PATH = indexers/repos.bleve +;; +;; Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:changeme@localhost:9200 +;REPO_INDEXER_CONN_STR = +;; +;; Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch +;REPO_INDEXER_NAME = gitea_codes +;; +;; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include +;; in the index; default is empty +;REPO_INDEXER_INCLUDE = +;; +;; A comma separated list of glob patterns to exclude from the index; ; default is empty +;REPO_INDEXER_EXCLUDE = +;; +;MAX_FILE_SIZE = 1048576 +;; +;; Bleve engine has performance problems with fuzzy search, so we limit the fuzziness to 0 by default to disable it. +;; If you'd like to enable it, you can set it to a value between 0 and 2. +;TYPE_BLEVE_MAX_FUZZINESS = 0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[queue] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Specific queues can be individually configured with [queue.name]. [queue] provides defaults +;; ([queue.issue_indexer] is special due to the old configuration described above) +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; General queue queue type, currently support: persistable-channel, channel, level, redis, dummy +;; default to persistable-channel +;TYPE = persistable-channel +;; +;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared. +;; Relative paths will be made absolute against "APP_DATA_PATH" +;DATADIR = queues/ +;; +;; Default queue length before a channel queue will block +;LENGTH = 100000 +;; +;; Batch size to send for batched queues +;BATCH_LENGTH = 20 +;; +;; Connection string for redis queues this will store the redis (or Redis cluster) connection string. +;; When `TYPE` is `persistable-channel`, this provides a directory for the underlying leveldb +;; or additional options of the form `leveldb://path/to/db?option=value&....`, and will override `DATADIR`. +;CONN_STR = "redis://127.0.0.1:6379/0" +;; +;; Provides the suffix of the default redis/disk queue name - specific queues can be overridden within in their [queue.name] sections. +;QUEUE_NAME = "_queue" +;; +;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections. +;SET_NAME = "_unique" +;; +;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10. +;MAX_WORKERS = ; (dynamic) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[admin] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Disallow regular (non-admin) users from creating organizations. +;DISABLE_REGULAR_ORG_CREATION = false +;; +;; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled +;DEFAULT_EMAIL_NOTIFICATIONS = enabled +;; Disabled features for users could be "deletion", "manage_ssh_keys", "manage_gpg_keys", "manage_mfa", "manage_credentials" more features can be disabled in future +;; - deletion: a user cannot delete their own account +;; - manage_ssh_keys: a user cannot configure ssh keys +;; - manage_gpg_keys: a user cannot configure gpg keys +;; - manage_mfa: a user cannot configure mfa devices +;; - manage_credentials: a user cannot configure emails, passwords, or openid +;USER_DISABLED_FEATURES = +;; Comma separated list of disabled features ONLY if the user has an external login type (eg. LDAP, Oauth, etc.), could be "deletion", "manage_ssh_keys", "manage_gpg_keys", "manage_mfa", "manage_credentials". This setting is independent from `USER_DISABLED_FEATURES` and supplements its behavior. +;; - deletion: a user cannot delete their own account +;; - manage_ssh_keys: a user cannot configure ssh keys +;; - manage_gpg_keys: a user cannot configure gpg keys +;; - manage_mfa: a user cannot configure mfa devices +;; - manage_credentials: a user cannot configure emails, passwords, or openid +;; - change_username: a user cannot change their username +;; - change_full_name: a user cannot change their full name +;;EXTERNAL_USER_DISABLE_FEATURES = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[openid] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; OpenID is an open, standard and decentralized authentication protocol. +;; Your identity is the address of a webpage you provide, which describes +;; how to prove you are in control of that page. +;; +;; For more info: https://en.wikipedia.org/wiki/OpenID +;; +;; Current implementation supports OpenID-2.0 +;; +;; Tested to work providers at the time of writing: +;; - Any GNUSocial node (your.hostname.tld/username) +;; - Any SimpleID provider (http://simpleid.koinic.net) +;; - http://openid.org.cn/ +;; - openid.stackexchange.com +;; - login.launchpad.net +;; - .livejournal.com +;; +;; Whether to allow signin in via OpenID +;ENABLE_OPENID_SIGNIN = true +;; +;; Whether to allow registering via OpenID +;; Do not include to rely on rhw DISABLE_REGISTRATION setting +;;ENABLE_OPENID_SIGNUP = true +;; +;; Allowed URI patterns (POSIX regexp). +;; Space separated. +;; Only these would be allowed if non-blank. +;; Example value: trusted.domain.org trusted.domain.net +;WHITELISTED_URIS = +;; +;; Forbidden URI patterns (POSIX regexp). +;; Space separated. +;; Only used if WHITELISTED_URIS is blank. +;; Example value: loadaverage.org/badguy stackexchange.com/.*spammer +;BLACKLISTED_URIS = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[oauth2_client] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Whether a new auto registered oauth2 user needs to confirm their email. +;; Do not include to use the REGISTER_EMAIL_CONFIRM setting from the `[service]` section. +;REGISTER_EMAIL_CONFIRM = +;; +;; Scopes for the openid connect oauth2 provider (separated by space, the openid scope is implicitly added). +;; Typical values are profile and email. +;; For more information about the possible values see https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims +;OPENID_CONNECT_SCOPES = +;; +;; Automatically create user accounts for new oauth2 users. +;ENABLE_AUTO_REGISTRATION = false +;; +;; The source of the username for new oauth2 accounts: +;; userid = use the userid / sub attribute +;; nickname = use the nickname attribute +;; preferred_username = use the preferred_username attribute +;; email = use the username part of the email attribute +;; Note: `nickname`, `preferred_username` and `email` options will normalize input strings using the following criteria: +;; - diacritics are removed +;; - the characters in the set ['´`] are removed +;; - the characters in the set [\s~+] are replaced with "-" +;USERNAME = nickname +;; +;; Update avatar if available from oauth2 provider. +;; Update will be performed on each login. +;UPDATE_AVATAR = false +;; +;; How to handle if an account / email already exists: +;; disabled = show an error +;; login = show an account linking login +;; auto = link directly with the account +;ACCOUNT_LINKING = login + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[webhook] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Hook task queue length, increase if webhook shooting starts hanging +;QUEUE_LENGTH = 1000 +;; +;; Deliver timeout in seconds +;DELIVER_TIMEOUT = 5 +;; +;; Webhook can only call allowed hosts for security reasons. Comma separated list, eg: external, 192.168.1.0/24, *.mydomain.com +;; Built-in: loopback (for localhost), private (for LAN/intranet), external (for public hosts on internet), * (for all hosts) +;; CIDR list: 1.2.3.0/8, 2001:db8::/32 +;; Wildcard hosts: *.mydomain.com, 192.168.100.* +;; Since 1.15.7. Default to * for 1.15.x, external for 1.16 and later +;ALLOWED_HOST_LIST = external +;; +;; Allow insecure certification +;SKIP_TLS_VERIFY = false +;; +;; Number of history information in each page +;PAGING_NUM = 10 +;; +;; Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy +;PROXY_URL = +;; +;; Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. +;PROXY_HOSTS = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[mailer] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; NOTICE: this section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older, +;; please refer to +;; https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini +;; https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md +;; +;ENABLED = false +;; +;; Buffer length of channel, keep it as it is if you don't know what it is. +;SEND_BUFFER_LEN = 100 +;; +;; Prefix displayed before subject in mail +;SUBJECT_PREFIX = +;; +;; Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". +;; - sendmail: use the operating system's `sendmail` command instead of SMTP. This is common on Linux systems. +;; - dummy: send email messages to the log as a testing phase. +;; If your provider does not explicitly say which protocol it uses but does provide a port, +;; you can set SMTP_PORT instead and this will be inferred. +;; (Before 1.18, see the notice, this was controlled via MAILER_TYPE and IS_TLS_ENABLED.) +;PROTOCOL = +;; +;; Mail server address, e.g. smtp.gmail.com. +;; For smtp+unix, this should be a path to a unix socket instead. +;; (Before 1.18, see the notice, this was combined with SMTP_PORT as HOST.) +;SMTP_ADDR = +;; +;; Mail server port. Common ports are: +;; 25: insecure SMTP +;; 465: SMTP Secure +;; 587: StartTLS +;; If no protocol is specified, it will be inferred by this setting. +;; (Before 1.18, this was combined with SMTP_ADDR as HOST.) +;SMTP_PORT = +;; +;; Enable HELO operation. Defaults to true. +;ENABLE_HELO = true +;; +;; Custom hostname for HELO operation. +;; If no value is provided, one is retrieved from system. +;HELO_HOSTNAME = +;; +;; If set to `true`, completely ignores server certificate validation errors. +;; This option is unsafe. Consider adding the certificate to the system trust store instead. +;FORCE_TRUST_SERVER_CERT = false +;; +;; Use client certificate in connection. +;USE_CLIENT_CERT = false +;CLIENT_CERT_FILE = custom/mailer/cert.pem +;CLIENT_KEY_FILE = custom/mailer/key.pem +;; +;; Mail from address, RFC 5322. This can be just an email address, or the `"Name" ` format +;FROM = +;; +;; Sometimes it is helpful to use a different address on the envelope. Set this to use ENVELOPE_FROM as the from on the envelope. Set to `<>` to send an empty address. +;ENVELOPE_FROM = +;; +;; If gitea sends mails on behave of users, it will just use the name also displayed in the WebUI. If you want e.g. `Mister X (by CodeIt) `, +;; set it to `{{ .DisplayName }} (by {{ .AppName }})`. Available Variables: `.DisplayName`, `.AppName` and `.Domain`. +;FROM_DISPLAY_NAME_FORMAT = {{ .DisplayName }} +;; +;; Mailer user name and password, if required by provider. +;USER = +;; +;; Use PASSWD = `your password` for quoting if you use special characters in the password. +;PASSWD = +;; +;; Send mails only in plain text, without HTML alternative +;SEND_AS_PLAIN_TEXT = false +;; +;; Specify an alternative sendmail binary +;SENDMAIL_PATH = sendmail +;; +;; Specify any extra sendmail arguments +;; WARNING: if your sendmail program interprets options you should set this to "--" or terminate these args with "--" +;SENDMAIL_ARGS = +;; +;; Timeout for Sendmail +;SENDMAIL_TIMEOUT = 5m +;; +;; convert \r\n to \n for Sendmail +;SENDMAIL_CONVERT_CRLF = true +;; +;; convert links of attached images to inline images. Only for images hosted in this gitea instance. +;EMBED_ATTACHMENT_IMAGES = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[mailer.override_header] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This is empty by default, use it only if you know what you need it for. +;Reply-To = test@example.com, test2@example.com +;Content-Type = text/html; charset=utf-8 +;In-Reply-To = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[email.incoming] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Enable handling of incoming emails. +;ENABLED = false +;; +;; The email address including the %{token} placeholder that will be replaced per user/action. +;; Example: incoming+%{token}@example.com +;; The placeholder must appear in the user part of the address (before the @). +;REPLY_TO_ADDRESS = +;; +;; IMAP server host +;HOST = +;; +;; IMAP server port +;PORT = +;; +;; Username of the receiving account +;USERNAME = +;; +;; Password of the receiving account +;PASSWORD = +;; +;; Whether the IMAP server uses TLS. +;USE_TLS = false +;; +;; If set to true, completely ignores server certificate validation errors. This option is unsafe. +;SKIP_TLS_VERIFY = true +;; +;; The mailbox name where incoming mail will end up. +;MAILBOX = INBOX +;; +;; Whether handled messages should be deleted from the mailbox. +;DELETE_HANDLED_MESSAGE = true +;; +;; Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size. +;MAXIMUM_MESSAGE_SIZE = 10485760 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cache] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Either "memory", "redis", "memcache", or "twoqueue". default is "memory" +;ADAPTER = memory +;; +;; For "memory" only, GC interval in seconds, default is 60 +;INTERVAL = 60 +;; +;; For "redis" and "memcache", connection host address +;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` (or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for a Redis cluster) +;; memcache: `127.0.0.1:11211` +;; twoqueue: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` +;HOST = +;; +;; Time to keep items in cache if not used, default is 16 hours. +;; Setting it to -1 disables caching +;ITEM_TTL = 16h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Last commit cache +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cache.last_commit] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Time to keep items in cache if not used, default is 8760 hours. +;; Setting it to -1 disables caching +;ITEM_TTL = 8760h +;; +;; Only enable the cache when repository's commits count great than +;COMMITS_COUNT = 1000 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[session] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Either "memory", "file", "redis", "db", "mysql", "couchbase", "memcache" or "postgres" +;; Default is "memory". "db" will reuse the configuration in [database] +;PROVIDER = memory +;; +;; Provider config options +;; memory: doesn't have any config yet +;; file: session file path, e.g. `data/sessions` +;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` (or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for a Redis cluster) +;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` +;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_. +;; +;; Session cookie name +;COOKIE_NAME = i_like_gitea +;; +;; If you use session in https only: true or false. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL. +;COOKIE_SECURE = +;; +;; Session GC time interval in seconds, default is 86400 (1 day) +;GC_INTERVAL_TIME = 86400 +;; +;; Session life time in seconds, default is 86400 (1 day) +;SESSION_LIFE_TIME = 86400 +;; +;; SameSite settings. Either "none", "lax", or "strict" +;SAME_SITE=lax + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[picture] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;AVATAR_UPLOAD_PATH = data/avatars +;REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars +;; +;; How Gitea deals with missing repository avatars +;; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used +;REPOSITORY_AVATAR_FALLBACK = none +;REPOSITORY_AVATAR_FALLBACK_IMAGE = /img/repo_default.png +;; +;; Max Width and Height of uploaded avatars. +;; This is to limit the amount of RAM used when resizing the image. +;AVATAR_MAX_WIDTH = 4096 +;AVATAR_MAX_HEIGHT = 4096 +;; +;; The multiplication factor for rendered avatar images. +;; Larger values result in finer rendering on HiDPI devices. +;AVATAR_RENDERED_SIZE_FACTOR = 2 +;; +;; Maximum allowed file size for uploaded avatars. +;; This is to limit the amount of RAM used when resizing the image. +;AVATAR_MAX_FILE_SIZE = 1048576 +;; +;; If the uploaded file is not larger than this byte size, the image will be used as is, without resizing/converting. +;AVATAR_MAX_ORIGIN_SIZE = 262144 +;; +;; Chinese users can choose "duoshuo" +;; or a custom avatar source, like: http://cn.gravatar.com/avatar/ +;GRAVATAR_SOURCE = gravatar +;; +;; This value will always be true in offline mode. +;DISABLE_GRAVATAR = false +;; +;; Federated avatar lookup uses DNS to discover avatar associated +;; with emails, see https://www.libravatar.org +;; This value will always be false in offline mode or when Gravatar is disabled. +;ENABLE_FEDERATED_AVATAR = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[attachment] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Whether issue and pull request attachments are enabled. Defaults to `true` +;ENABLED = true +;; +;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. +;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.webp,.xls,.xlsx,.zip +;; +;; Max size of each file. Defaults to 2048MB +;MAX_SIZE = 2048 +;; +;; Max number of files per upload. Defaults to 5 +;MAX_FILES = 5 +;; +;; Storage type for attachments, `local` for local disk or `minio` for s3 compatible +;; object storage service, default is `local`. +;STORAGE_TYPE = local +;; +;; Allows the storage driver to redirect to authenticated URLs to serve files directly +;; Currently, only `minio` and `azureblob` is supported. +;SERVE_DIRECT = false +;; +;; Path for attachments. Defaults to `attachments`. Only available when STORAGE_TYPE is `local` +;; Relative paths will be resolved to `${AppDataPath}/${attachment.PATH}` +;PATH = attachments +;; +;; Minio endpoint to connect only available when STORAGE_TYPE is `minio` +;MINIO_ENDPOINT = localhost:9000 +;; +;; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`. +;; If not provided and STORAGE_TYPE is `minio`, will search for credentials in known +;; environment variables (MINIO_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID), credentials files +;; (~/.mc/config.json, ~/.aws/credentials), and EC2 instance metadata. +;MINIO_ACCESS_KEY_ID = +;; +;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` +;MINIO_SECRET_ACCESS_KEY = +;; +;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`. +;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables +;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, +;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION), +;; or the DefaultIAMRoleEndpoint if not provided otherwise. +;MINIO_IAM_ENDPOINT = +;; +;; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` +;MINIO_BUCKET = gitea +;; +;; Minio location to create bucket only available when STORAGE_TYPE is `minio` +;MINIO_LOCATION = us-east-1 +;; +;; Minio base path on the bucket only available when STORAGE_TYPE is `minio` +;MINIO_BASE_PATH = attachments/ +;; +;; Minio enabled ssl only available when STORAGE_TYPE is `minio` +;MINIO_USE_SSL = false +;; +;; Minio skip SSL verification available when STORAGE_TYPE is `minio` +;MINIO_INSECURE_SKIP_VERIFY = false +;; +;; Minio checksum algorithm: default (for MinIO or AWS S3) or md5 (for Cloudflare or Backblaze) +;MINIO_CHECKSUM_ALGORITHM = default +;; +;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio` +;MINIO_BUCKET_LOOKUP_TYPE = auto +;; Azure Blob endpoint to connect only available when STORAGE_TYPE is `azureblob`, +;; e.g. https://accountname.blob.core.windows.net or http://127.0.0.1:10000/devstoreaccount1 +;AZURE_BLOB_ENDPOINT = +;; +;; Azure Blob account name to connect only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_ACCOUNT_NAME = +;; +;; Azure Blob account key to connect only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_ACCOUNT_KEY = +;; +;; Azure Blob container to store the attachments only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_CONTAINER = gitea +;; +;; override the azure blob base path if storage type is azureblob +;AZURE_BLOB_BASE_PATH = attachments/ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[time] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Location the UI time display i.e. Asia/Shanghai +;; Empty means server's location setting +;DEFAULT_UI_LOCATION = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Common settings +;; +;; Setting this to true will enable all cron tasks periodically with default settings. +;ENABLED = false +;; Setting this to true will run all enabled cron tasks when Gitea starts. +;RUN_AT_START = false +;; +;; Note: ``SCHEDULE`` accept formats +;; - Full crontab specs, e.g. "* * * * * ?" +;; - Descriptors, e.g. "@midnight", "@every 1h30m" +;; See more: https://pkg.go.dev/github.com/gogs/cron@v0.0.0-20171120032916-9f6c956d3e14 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Basic cron tasks - enabled by default +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Clean up old repository archives +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.archive_cleanup] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Whether to enable the job +;ENABLED = true +;; Whether to always run at least once at start up time (if ENABLED) +;RUN_AT_START = true +;; Whether to emit notice on successful execution too +;NOTICE_ON_SUCCESS = false +;; Time interval for job to run +;SCHEDULE = @midnight +;; Archives created more than OLDER_THAN ago are subject to deletion +;OLDER_THAN = 24h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Update mirrors +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.update_mirrors] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;SCHEDULE = @every 10m +;; Enable running Update mirrors task periodically. +;ENABLED = true +;; Run Update mirrors task when Gitea starts. +;RUN_AT_START = false +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;; Limit the number of mirrors added to the queue to this number +;; (negative values mean no limit, 0 will result in no result in no mirrors being queued effectively disabling pull mirror updating.) +;PULL_LIMIT=50 +;; Limit the number of mirrors added to the queue to this number +;; (negative values mean no limit, 0 will result in no mirrors being queued effectively disabling push mirror updating) +;PUSH_LIMIT=50 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Repository health check +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.repo_health_check] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;SCHEDULE = @midnight +;; Enable running Repository health check task periodically. +;ENABLED = true +;; Run Repository health check task when Gitea starts. +;RUN_AT_START = false +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;TIMEOUT = 60s +;; Arguments for command 'git fsck', e.g. "--unreachable --tags" +;; see more on http://git-scm.com/docs/git-fsck +;ARGS = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Check repository statistics +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.check_repo_stats] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Enable running check repository statistics task periodically. +;ENABLED = true +;; Run check repository statistics task when Gitea starts. +;RUN_AT_START = true +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @midnight + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.update_migration_poster_id] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Update migrated repositories' issues and comments' posterid, it will always attempt synchronization when the instance starts. +;ENABLED = true +;; Update migrated repositories' issues and comments' posterid when starting server (default true) +;RUN_AT_START = true +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;; Interval as a duration between each synchronization. (default every 24h) +;SCHEDULE = @midnight + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Synchronize external user data (only LDAP user synchronization is supported) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.sync_external_users] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = true +;; Synchronize external user data when starting server (default false) +;RUN_AT_START = false +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;; Interval as a duration between each synchronization (default every 24h) +;SCHEDULE = @midnight +;; Create new users, update existing user data and disable users that are not in external source anymore (default) +;; or only create new users if UPDATE_EXISTING is set to false +;UPDATE_EXISTING = true + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Cleanup expired actions assets +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.cleanup_actions] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = true +;RUN_AT_START = true +;SCHEDULE = @midnight + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Clean-up deleted branches +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.deleted_branches_cleanup] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = true +;; Clean-up deleted branches when starting server (default true) +;RUN_AT_START = true +;; Notice if not success +;NOTICE_ON_SUCCESS = false +;; Interval as a duration between each synchronization (default every 24h) +;SCHEDULE = @midnight +;; deleted branches than OLDER_THAN ago are subject to deletion +;OLDER_THAN = 24h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Cleanup hook_task table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.cleanup_hook_task_table] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Whether to enable the job +;ENABLED = true +;; Whether to always run at start up time (if ENABLED) +;RUN_AT_START = false +;; Time interval for job to run +;SCHEDULE = @midnight +;; OlderThan or PerWebhook. How the records are removed, either by age (i.e. how long ago hook_task record was delivered) or by the number to keep per webhook (i.e. keep most recent x deliveries per webhook). +;CLEANUP_TYPE = OlderThan +;; If CLEANUP_TYPE is set to OlderThan, then any delivered hook_task records older than this expression will be deleted. +;OLDER_THAN = 168h +;; If CLEANUP_TYPE is set to PerWebhook, this is number of hook_task records to keep for a webhook (i.e. keep the most recent x deliveries). +;NUMBER_TO_KEEP = 10 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Cleanup expired packages +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.cleanup_packages] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Whether to enable the job +;ENABLED = true +;; Whether to always run at least once at start up time (if ENABLED) +;RUN_AT_START = true +;; Whether to emit notice on successful execution too +;NOTICE_ON_SUCCESS = false +;; Time interval for job to run +;SCHEDULE = @midnight +;; Unreferenced blobs created more than OLDER_THAN ago are subject to deletion +;OLDER_THAN = 24h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Extended cron task - not enabled by default +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete all unactivated accounts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_inactive_accounts] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @annually +;OLDER_THAN = 168h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete all repository archives +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_repo_archives] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @annually; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Garbage collect all repositories +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.git_gc_repos] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h +;TIMEOUT = 60s +;; Arguments for command 'git gc' +;; The default value is same with [git] -> GC_ARGS +;ARGS = + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Update the '.ssh/authorized_keys' file with Gitea SSH keys +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.resync_all_sshkeys] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Resynchronize pre-receive, update and post-receive hooks of all repositories. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.resync_all_hooks] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Reinitialize all missing Git repositories for which records exist +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.reinit_missing_repos] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete all repositories missing their Git files +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_missing_repos] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete generated repository avatars +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_generated_repository_avatars] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 72h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete all old actions from database +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_old_actions] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NOTICE_ON_SUCCESS = false +;SCHEDULE = @every 168h +;OLDER_THAN = 8760h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Check for new Gitea versions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.update_checker] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = true +;RUN_AT_START = false +;ENABLE_SUCCESS_NOTICE = false +;SCHEDULE = @every 168h +;HTTP_ENDPOINT = https://dl.gitea.com/gitea/version.json + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Delete all old system notices from database +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.delete_old_system_notices] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;RUN_AT_START = false +;NO_SUCCESS_NOTICE = false +;SCHEDULE = @every 168h +;OLDER_THAN = 8760h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Garbage collect LFS pointers in repositories +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[cron.gc_lfs] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;ENABLED = false +;; Garbage collect LFS pointers in repositories (default false) +;RUN_AT_START = false +;; Interval as a duration between each gc run (default every 24h) +;SCHEDULE = @every 24h +;; Only attempt to garbage collect LFSMetaObjects older than this (default 7 days) +;OLDER_THAN = 168h +;; Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days) +;LAST_UPDATED_MORE_THAN_AGO = 72h +; Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all. +;NUMBER_TO_CHECK_PER_REPO = 100 +;Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.) +;PROPORTION_TO_CHECK_PER_REPO = 0.6 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[mirror] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo. +;ENABLED = true +;; Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. +;DISABLE_NEW_PULL = false +;; Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`. +;DISABLE_NEW_PUSH = false +;; Default interval as a duration between each check +;DEFAULT_INTERVAL = 8h +;; Min interval as a duration must be > 1m +;MIN_INTERVAL = 10m + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[api] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Enables the API documentation endpoints (/api/swagger, /api/v1/swagger, …). True or false. +;ENABLE_SWAGGER = true +;; Max number of items in a page +;MAX_RESPONSE_ITEMS = 50 +;; Default paging number of api +;DEFAULT_PAGING_NUM = 30 +;; Default and maximum number of items per page for git trees api +;DEFAULT_GIT_TREES_PER_PAGE = 1000 +;; Default max size of a blob returned by the blobs API (default is 10MiB) +;DEFAULT_MAX_BLOB_SIZE = 10485760 +;; Default max combined size of all blobs returned by the files API (default is 100MiB) +;DEFAULT_MAX_RESPONSE_SIZE = 104857600 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[i18n] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; The first locale will be used as the default if user browser's language doesn't match any locale in the list. +;LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN +;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Türkçe,Čeština,Српски,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia,മലയാളം + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[highlight.mapping] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Extension mapping to highlight class +;; e.g. .toml=ini + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[other] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Show version information about Gitea and Go in the footer +;SHOW_FOOTER_VERSION = true +;; Show template execution time in the footer +;SHOW_FOOTER_TEMPLATE_LOAD_TIME = true +;; Show the "powered by" text in the footer +;SHOW_FOOTER_POWERED_BY = true +;; Generate sitemap. Defaults to `true`. +;ENABLE_SITEMAP = true +;; Enable/Disable RSS/Atom feed +;ENABLE_FEED = true + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[markup] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Set the maximum number of characters in a mermaid source. (Set to -1 to disable limits) +;MERMAID_MAX_SOURCE_CHARACTERS = 50000 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[markup.sanitizer.1] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; The following keys can appear once to define a sanitation policy rule. +;; This section can appear multiple times by adding a unique alphanumeric suffix to define multiple rules. +;; e.g., [markup.sanitizer.1] -> [markup.sanitizer.2] -> [markup.sanitizer.TeX] +;ELEMENT = span +;ALLOW_ATTR = class +;REGEXP = ^(info|warning|error)$ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Other markup formats e.g. asciidoc +;; +;; uncomment and enable the below section. +;; (You can add other markup formats by copying the section and adjusting +;; the section name suffix "asciidoc" to something else.) +;[markup.asciidoc] +;ENABLED = false +;; List of file extensions that should be rendered by an external command +;FILE_EXTENSIONS = .adoc,.asciidoc +;; External command to render all matching extensions +;RENDER_COMMAND = "asciidoc --out-file=- -" +;; Don't pass the file on STDIN, pass the filename as argument instead. +;IS_INPUT_FILE = false +;; How the content will be rendered. +;; * sanitized: Sanitize the content and render it inside current page, default to only allow a few HTML tags and attributes. Customized sanitizer rules can be defined in [markup.sanitizer.*] . +;; * no-sanitizer: Disable the sanitizer and render the content inside current page. It's **insecure** and may lead to XSS attack if the content contains malicious code. +;; * iframe: Render the content in a separate standalone page and embed it into current page by iframe. The iframe is in sandbox mode with same-origin disabled, and the JS code are safely isolated from parent page. +;RENDER_CONTENT_MODE=sanitized + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[metrics] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Enables metrics endpoint. True or false; default is false. +;ENABLED = false +;; If you want to add authorization, specify a token here +;TOKEN = +;; Enable issue by label metrics; default is false +;ENABLED_ISSUE_BY_LABEL = false +;; Enable issue by repository metrics; default is false +;ENABLED_ISSUE_BY_REPOSITORY = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[migrations] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Max attempts per http/https request on migrations. +;MAX_ATTEMPTS = 3 +;; +;; Backoff time per http/https request retry (seconds) +;RETRY_BACKOFF = 3 +;; +;; Allowed domains for migrating, default is blank. Blank means everything will be allowed. +;; Multiple domains could be separated by commas. +;; Wildcard is supported: "github.com, *.github.com" +;ALLOWED_DOMAINS = +;; +;; Blocklist for migrating, default is blank. Multiple domains could be separated by commas. +;; When ALLOWED_DOMAINS is not blank, this option has a higher priority to deny domains. +;; Wildcard is supported. +;BLOCKED_DOMAINS = +;; +;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) +;; If a domain is allowed by ALLOWED_DOMAINS, this option will be ignored. +;ALLOW_LOCALNETWORKS = false + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[federation] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Enable/Disable federation capabilities +;ENABLED = false +;; +;; Enable/Disable user statistics for nodeinfo if federation is enabled +;SHARE_USER_STATISTICS = true +;; +;; Maximum federation request and response size (MB) +;MAX_SIZE = 4 +;; +;; WARNING: Changing the settings below can break federation. +;; +;; HTTP signature algorithms +;ALGORITHMS = rsa-sha256, rsa-sha512, ed25519 +;; +;; HTTP signature digest algorithm +;DIGEST_ALGORITHM = SHA-256 +;; +;; GET headers for federation requests +;GET_HEADERS = (request-target), Date +;; +;; POST headers for federation requests +;POST_HEADERS = (request-target), Date, Digest + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[packages] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Enable/Disable package registry capabilities +;ENABLED = true +;; +;STORAGE_TYPE = local +;; override the minio base path if storage type is minio +;MINIO_BASE_PATH = packages/ +;; override the azure blob base path if storage type is azureblob +;AZURE_BLOB_BASE_PATH = packages/ +;; Allows the storage driver to redirect to authenticated URLs to serve files directly +;; Currently, only `minio` and `azureblob` is supported. +;SERVE_DIRECT = false +;; +;; Maximum count of package versions a single owner can have (`-1` means no limits) +;LIMIT_TOTAL_OWNER_COUNT = -1 +;; Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_TOTAL_OWNER_SIZE = -1 +;; Maximum size of an Alpine upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_ALPINE = -1 +;; Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CARGO = -1 +;; Maximum size of a Chef upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CHEF = -1 +;; Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_COMPOSER = -1 +;; Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CONAN = -1 +;; Maximum size of a Conda upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CONDA = -1 +;; Maximum size of a Container upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CONTAINER = -1 +;; Maximum size of a CRAN upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_CRAN = -1 +;; Maximum size of a Debian upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_DEBIAN = -1 +;; Maximum size of a Generic upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_GENERIC = -1 +;; Maximum size of a Go upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_GO = -1 +;; Maximum size of a Helm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_HELM = -1 +;; Maximum size of a Maven upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_MAVEN = -1 +;; Maximum size of a npm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_NPM = -1 +;; Maximum size of a NuGet upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_NUGET = -1 +;; Maximum size of a Pub upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_PUB = -1 +;; Maximum size of a PyPI upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_PYPI = -1 +;; Maximum size of a RPM upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_RPM = -1 +;; Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_RUBYGEMS = -1 +;; Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_SWIFT = -1 +;; Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`) +;LIMIT_SIZE_VAGRANT = -1 +;; Enable RPM re-signing by default. (It will overwrite the old signature ,using v4 format, not compatible with CentOS 6 or older) +;DEFAULT_RPM_SIGN_ENABLED = false +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; default storage for attachments, lfs and avatars +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[storage] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; storage type +;STORAGE_TYPE = local + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; repo-archive storage will override storage +;; +;[repo-archive] +;STORAGE_TYPE = local +;; +;; Where your lfs files reside, default is data/lfs. +;PATH = data/repo-archive +;; +;; override the minio base path if storage type is minio +;MINIO_BASE_PATH = repo-archive/ +;; override the azure blob base path if storage type is azureblob +;AZURE_BLOB_BASE_PATH = repo-archive/ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; settings for repository archives, will override storage setting +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[storage.repo-archive] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; storage type +;STORAGE_TYPE = local + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; lfs storage will override storage +;; +;[lfs] +;STORAGE_TYPE = local +;; +;; Where your lfs files reside, default is data/lfs. +;PATH = data/lfs +;; +;; Allows the storage driver to redirect to authenticated URLs to serve files directly +;; Currently, only `minio` and `azureblob` is supported. +;SERVE_DIRECT = false +;; +;; override the minio base path if storage type is minio +;MINIO_BASE_PATH = lfs/ +;; +;; override the azure blob base path if storage type is azureblob +;AZURE_BLOB_BASE_PATH = lfs/ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; settings for Gitea's LFS client (eg: mirroring an upstream lfs endpoint) +;; +;[lfs_client] +;; Limit the number of pointers in each batch request to this number +;BATCH_SIZE = 20 +;; Limit the number of concurrent upload/download operations within a batch +;BATCH_OPERATION_CONCURRENCY = 8 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; settings for packages, will override storage setting +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[storage.packages] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; storage type +;STORAGE_TYPE = local + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; customize storage +;[storage.minio] +;STORAGE_TYPE = minio +;; +;; Minio endpoint to connect only available when STORAGE_TYPE is `minio` +;MINIO_ENDPOINT = localhost:9000 +;; +;; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`. +;; If not provided and STORAGE_TYPE is `minio`, will search for credentials in known +;; environment variables (MINIO_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID), credentials files +;; (~/.mc/config.json, ~/.aws/credentials), and EC2 instance metadata. +;MINIO_ACCESS_KEY_ID = +;; +;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio` +;MINIO_SECRET_ACCESS_KEY = +;; +;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`. +;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables +;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, +;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION), +;; or the DefaultIAMRoleEndpoint if not provided otherwise. +;MINIO_IAM_ENDPOINT = +;; +;; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio` +;MINIO_BUCKET = gitea +;; +;; Minio location to create bucket only available when STORAGE_TYPE is `minio` +;MINIO_LOCATION = us-east-1 +;; +;; Minio enabled ssl only available when STORAGE_TYPE is `minio` +;MINIO_USE_SSL = false +;; +;; Minio skip SSL verification available when STORAGE_TYPE is `minio` +;MINIO_INSECURE_SKIP_VERIFY = false +;; +;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio` +;MINIO_BUCKET_LOOKUP_TYPE = auto + +;[storage.azureblob] +;STORAGE_TYPE = azureblob +;; +;; Azure Blob endpoint to connect only available when STORAGE_TYPE is `azureblob`, +;; e.g. https://accountname.blob.core.windows.net or http://127.0.0.1:10000/devstoreaccount1 +;AZURE_BLOB_ENDPOINT = +;; +;; Azure Blob account name to connect only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_ACCOUNT_NAME = +;; +;; Azure Blob account key to connect only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_ACCOUNT_KEY = +;; +;; Azure Blob container to store the attachments only available when STORAGE_TYPE is `azureblob` +;AZURE_BLOB_CONTAINER = gitea + +;[proxy] +;; Enable the proxy, all requests to external via HTTP will be affected +;PROXY_ENABLED = false +;; Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy/no_proxy +;PROXY_URL = +;; Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts. +;PROXY_HOSTS = + +; [actions] +;; Enable/Disable actions capabilities +;ENABLED = true +;; +;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance. +;DEFAULT_ACTIONS_URL = github +;; Logs retention time in days. Old logs will be deleted after this period. +;LOG_RETENTION_DAYS = 365 +;; Log compression type, `none` for no compression, `zstd` for zstd compression. +;; Other compression types like `gzip` are NOT supported, since seekable stream is required for log view. +;; It's always recommended to use compression when using local disk as log storage if CPU or memory is not a bottleneck. +;; And for object storage services like S3, which is billed for requests, it would cause extra 2 times of get requests for each log view. +;; But it will save storage space and network bandwidth, so it's still recommended to use compression. +;LOG_COMPRESSION = zstd +;; Default artifact retention time in days. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step. +;ARTIFACT_RETENTION_DAYS = 90 +;; Timeout to stop the task which have running status, but haven't been updated for a long time +;ZOMBIE_TASK_TIMEOUT = 10m +;; Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time +;ENDLESS_TASK_TIMEOUT = 3h +;; Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time +;ABANDONED_JOB_TIMEOUT = 24h +;; Strings committers can place inside a commit message or PR title to skip executing the corresponding actions workflow +;SKIP_WORKFLOW_STRINGS = [skip ci],[ci skip],[no ci],[skip actions],[actions skip] + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; settings for action logs, will override storage setting +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;[storage.actions_log] +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; storage type +;STORAGE_TYPE = local + +;[global_lock] +;; Lock service type, could be memory or redis +;SERVICE_TYPE = memory +;; Ignored for the "memory" type. For "redis" use something like `redis://127.0.0.1:6379/0` +;SERVICE_CONN_STR = From a99c05bd6e83e30dae875faf9568ee3af443453b Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 12:52:58 +0800 Subject: [PATCH 05/25] 1 --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 0f24e37978..da8c0d28c6 100644 --- a/go.mod +++ b/go.mod @@ -330,5 +330,3 @@ exclude github.com/gofrs/uuid v4.0.0+incompatible exclude github.com/goccy/go-json v0.4.11 exclude github.com/satori/go.uuid v1.2.0 - - From d3f24edcbc8a0102629423959b36a02ffbd80fae Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 16:33:20 +0800 Subject: [PATCH 06/25] new --- .env.e2e | 13 +++++++++ tests/README.md | 9 ++++++ tests/e2e/devcontainer.test.e2e.ts | 45 +++++++++++++++++++----------- 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 .env.e2e create mode 100644 tests/README.md diff --git a/.env.e2e b/.env.e2e new file mode 100644 index 0000000000..f719cc10f4 --- /dev/null +++ b/.env.e2e @@ -0,0 +1,13 @@ +export GITEA_URL="http://192.168.181.128:3000" + +export TEST_USER="jiaojunming" +export TEST_PASS="hwyhwy12" + +export TEST_REPO_VALID="jiaojunming/test1" +export TEST_REPO_EMPTY="jiaojunming/test2" +export TEST_REPO_INVALID="jiaojunming/test3" + +export TEST_USER_ADMIN="jiaojunming" +export TEST_PASS_ADMIN="hwyhwy12" +export TEST_ADMIN_USER_ID="1" +export TEST_REPO_ADMIN="jiaojunming/test1" \ No newline at end of file diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000000..f8710db726 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,9 @@ +使用PLAYWRIGHT测试框架执行test/e2e下的自动测试脚本 + +1.在custom/conf下的app.ini中关闭验证码:ENABLE_CAPTCHA = false +2.在执行脚本前请下载相关依赖:npx playwright install +3.请在.env.e2e文件中配置相关项: +GITEA_URL:devstar实例的url,TEST_USER:测试用户,TEST_REPO_VALID:一个干净的,有合理json配置的仓库,TEST_USER_ADMIN:管理员账号(可以是测试用户),TEST_ADMIN_USER_ID:管理员用户的id(管理后台查看) +4.在项目根目录执行命令source .env.e2e && npx playwright test ,生成的报告在test/e2e下 + + diff --git a/tests/e2e/devcontainer.test.e2e.ts b/tests/e2e/devcontainer.test.e2e.ts index 5ea886bcba..f6e4f2a783 100644 --- a/tests/e2e/devcontainer.test.e2e.ts +++ b/tests/e2e/devcontainer.test.e2e.ts @@ -1,21 +1,34 @@ import { test, expect } from '@playwright/test'; import { link } from 'node:fs'; -const baseURL = process.env.GITEA_URL; -if (!baseURL) { - throw new Error("请设置 GITEA_URL 环境变量"); +const { + GITEA_URL, + TEST_USER, + TEST_PASS, + TEST_REPO_VALID, + TEST_REPO_EMPTY, + TEST_REPO_INVALID, + TEST_USER_ADMIN, + TEST_PASS_ADMIN, + TEST_ADMIN_USER_ID, + TEST_REPO_ADMIN +} = process.env; + +// 检查关键配置是否存在 +if (!GITEA_URL || !TEST_USER || !TEST_PASS || !TEST_REPO_VALID) { +  throw new Error("请确保 .env.e2e 配置文件已加载,并包含 GITEA_URL, TEST_USER, TEST_PASS, TEST_REPO_VALID"); } test('DevContainer 功能和配置', async ({ page,context }) => { console.log("正在登陆"); - await page.goto(baseURL + '/user/login'); - await page.fill('#user_name', 'jiaojunming'); - await page.fill('#password', 'hwyhwy12'); + await page.goto(GITEA_URL + '/user/login'); + await page.fill('#user_name',TEST_USER); + await page.fill('#password', TEST_PASS); await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(baseURL + '/'); + await expect(page).toHaveURL(GITEA_URL + '/'); console.log("登录成功! "); console.log("进入test1仓库"); - await page.goto(baseURL + '/jiaojunming/test1'); + await page.goto(GITEA_URL + '/'+ TEST_REPO_VALID); await page.getByRole('link', { name: 'Dev Container' }).click(); await expect(page.getByText('devcontainer.json')).toBeVisible(); await expect(page.getByRole('button', { name: 'Create Dev Container' })).toBeVisible(); @@ -51,32 +64,32 @@ test('DevContainer 功能和配置', async ({ page,context }) => { console.log("test1 检查通过!"); console.log("test2仓库"); - await page.goto(baseURL + '/jiaojunming/test2'); + await page.goto(GITEA_URL + '/'+ TEST_REPO_EMPTY); await page.getByRole('link', { name: 'Dev Container' }).click(); await expect(page.getByText('Oops, it looks like there is no Dev Container Setting in this repository.')).toBeVisible(); console.log("test2 检查通过"); console.log("test3仓库"); - await page.goto(baseURL + '/jiaojunming/test3'); + await page.goto(GITEA_URL+ '/' + TEST_REPO_INVALID); await page.getByRole('link', { name: 'Dev Container' }).click(); await expect(page.getByText(' Invalid Dev Container Configuration')).toBeVisible(); console.log("test3检查通过"); }); test('权限修改相关', async ({ page }) => { console.log("正在登陆"); - await page.goto(baseURL + '/user/login'); - await page.fill('#user_name', 'jiaojunming'); - await page.fill('#password', 'hwyhwy12'); + await page.goto(GITEA_URL + '/user/login'); + await page.fill('#user_name', TEST_USER_ADMIN); + await page.fill('#password', TEST_PASS_ADMIN); await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(baseURL + '/'); + await expect(page).toHaveURL(GITEA_URL + '/'); console.log("登录成功! "); console.log('权限配置'); - await page.goto(baseURL+'/-/admin/users/1/edit'); + await page.goto(GITEA_URL+ '/-/admin/users/' + TEST_ADMIN_USER_ID + '/edit'); const devContainerCheckbox = page.getByLabel(/May Create Devcontainers/i); await devContainerCheckbox.uncheck(); await page.getByRole('button', { name: 'Update User Account' }).click(); - await page.goto(baseURL + '/jiaojunming/test1'); + await page.goto(GITEA_URL + '/' + TEST_REPO_ADMIN); const devContainerLink = page.getByRole('link', { name: 'Dev Container' }); await expect(devContainerLink).toBeHidden({ timeout: 10000 }); console.log('权限设置成功!'); From 16c817fa9bd2d3bd6b55e5dfdf97e22179c0571e Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 24 Oct 2025 16:42:10 +0800 Subject: [PATCH 07/25] new --- .iflow/agents/chrome-devtools-automation.md | 35 --------------------- .iflow/agents/chrome-devtools-mcp.json | 12 ------- .iflow/agents/index.js | 26 --------------- autotest.txt | 11 ------- package-lock.json | 30 +----------------- package.json | 1 - 6 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 .iflow/agents/chrome-devtools-automation.md delete mode 100644 .iflow/agents/chrome-devtools-mcp.json delete mode 100644 .iflow/agents/index.js delete mode 100644 autotest.txt diff --git a/.iflow/agents/chrome-devtools-automation.md b/.iflow/agents/chrome-devtools-automation.md deleted file mode 100644 index 6d5ba43112..0000000000 --- a/.iflow/agents/chrome-devtools-automation.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -agent-type: chrome-devtools-automation -name: chrome-devtools-automation -description: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention. -when-to-use: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention. -allowed-tools: glob, list_directory, multi_edit, read_file, read_many_files, replace, search_file_content, run_shell_command, todo_read, todo_write, web_fetch, web_search, write_file, xml_escape -allowed-mcps: chrome-devtools -inherit-tools: true -inherit-mcps: true -color: green ---- - -You are a Chrome DevTools Protocol (CDP) automation expert. Your role is to help users automate Chrome browser operations for testing purposes, eliminating the need for manual testing. - -You will help users: -1. Create automation scripts that control Chrome browser via the DevTools Protocol -2. Automate UI interactions such as clicking, typing, and navigating -3. Perform automated testing workflows including form filling, button clicking, and page validation -4. Integrate browser automation with testing pipelines -5. Replace repetitive manual testing tasks with automated solutions - -When creating automation solutions, you should: -- Use the Chrome DevTools Protocol (CDP) for browser automation -- Write clear, maintainable automation scripts -- Include proper error handling and validation checks -- Structure tests to be repeatable and reliable -- Focus on eliminating manual testing efforts - -Remember to: -- Always verify that automation scripts are robust and handle edge cases -- Include appropriate wait conditions for page loading and element availability -- Provide clear documentation of automation workflows -- Ensure automation scripts are maintainable and understandable - -If a user asks about general web development topics not related to Chrome automation, explain that your specialty is Chrome DevTools automation for testing purposes. diff --git a/.iflow/agents/chrome-devtools-mcp.json b/.iflow/agents/chrome-devtools-mcp.json deleted file mode 100644 index 728d22a2b7..0000000000 --- a/.iflow/agents/chrome-devtools-mcp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "chrome-devtools-mcp", - "version": "1.0.0", - "description": "Chrome DevTools MCP for iFlow", - "main": "index.js", - "scripts": { - "start": "node index.js" - }, - "dependencies": { - "chrome-remote-interface": "^0.31.0" - } -} \ No newline at end of file diff --git a/.iflow/agents/index.js b/.iflow/agents/index.js deleted file mode 100644 index aa1463e18d..0000000000 --- a/.iflow/agents/index.js +++ /dev/null @@ -1,26 +0,0 @@ -const CDP = require('chrome-remote-interface'); - -async function connectToChrome() { - try { - const client = await CDP({ - host: '192.168.181.128', - port: 3000 - }); - - const { Page, Runtime } = client; - - await Page.enable(); - await Runtime.enable(); - - await Page.navigate({ url: 'http://192.168.181.128:3000/' }); - await Page.loadEventFired(); - - console.log('Successfully navigated to http://192.168.181.128:3000/'); - - await client.close(); - } catch (error) { - console.error('Error connecting to Chrome DevTools:', error); - } -} - -connectToChrome(); \ No newline at end of file diff --git a/autotest.txt b/autotest.txt deleted file mode 100644 index d977a70061..0000000000 --- a/autotest.txt +++ /dev/null @@ -1,11 +0,0 @@ -##你是一个自动测试机器人,下面是你需要逐条执行的指令 -1.使用chrome devtools mcp打开192.168.181.128:3000/,你应该直接操作浏览器执行 -2.描述当前页面 -3.下面需要你执行几个测试用例,你能够在测试结束后生成一份文档格式的测试报告吗 -4.测试用例1(增加开发容器权限):你通过点击管理后台,进入后台管理界面,点击身份及认证,账户管理,你能看到id为1的用户,点击右侧的编辑,点击允许创建开发容器并更新账户,你要确保允许创建开发容器按钮是已经勾选的,你已经在这个位置犯了多次错误,所以请再三检查。然后尝试打开jiaojunming/test1仓库,你应该在界面上能看到开发容器,看得到就是测试成功。 -5.测试用例2(开发容器配置检查):你尝试打开jiaojunming/test1仓库,点击开发容器,应该有devcontainer.json文件,能够看到create devcontainer按钮,等待2秒后,你再打开jiaojunming/test2仓库,点击开发容器,应该本仓库没有开发容器配置。 -6.测试用例3(开发容器创建):你打开jiaojunming/test1仓库,点击create devcontainer,此时应该出现一个终端,会执行容器的创建,你需要等待,直到右侧可以看到删除容器,停止容器,open with vscode按钮等。 -7.测试用例4(停止开发容器):就在测试用例3的这个界面,点击停止开发容器,等待,直到右侧出现启动开发容器按钮。 -8.测试用例5(启动开发容器):就在测试用例3的这个界面,点击启动开发容器,等待,直到右侧可以看到open with vscode按钮,删除容器,停止容器按钮等。 -9.测试用例6(删除开发容器):就在测试用例3的这个界面,点击删除开发容器,等待,直到重新出现创建开发容器按钮。 - diff --git a/package-lock.json b/package-lock.json index 1eada431f4..b856776e06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "devstar", + "name": "gitea", "lockfileVersion": 3, "requires": true, "packages": { @@ -21,7 +21,6 @@ "chart.js": "4.5.0", "chartjs-adapter-dayjs-4": "1.0.4", "chartjs-plugin-zoom": "2.2.0", - "chrome-remote-interface": "0.33.3", "clippie": "4.1.7", "cropperjs": "1.6.2", "css-loader": "7.1.2", @@ -5084,12 +5083,6 @@ "chrome-remote-interface": "bin/client.js" } }, - "node_modules/chrome-remote-interface/node_modules/commander": { - "version": "2.11.0", - "resolved": "https://registry.npmmirror.com/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "license": "MIT" - }, "node_modules/chrome-trace-event": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", @@ -14341,27 +14334,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmmirror.com/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/xml-lexer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/xml-lexer/-/xml-lexer-0.2.2.tgz", diff --git a/package.json b/package.json index 7f6af13ff3..4b4f22351b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "chart.js": "4.5.0", "chartjs-adapter-dayjs-4": "1.0.4", "chartjs-plugin-zoom": "2.2.0", - "chrome-remote-interface": "0.33.3", "clippie": "4.1.7", "cropperjs": "1.6.2", "css-loader": "7.1.2", From 257941c5e5b00c0fe704306f36d3af0692673369 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 31 Oct 2025 16:18:47 +0800 Subject: [PATCH 08/25] new test script --- .env.e2e | 6 +- tests/README.md | 4 +- tests/e2e/devcontainer.test.e2e.ts | 137 +++++++++++++++++++++++------ 3 files changed, 117 insertions(+), 30 deletions(-) diff --git a/.env.e2e b/.env.e2e index f719cc10f4..a795eadde6 100644 --- a/.env.e2e +++ b/.env.e2e @@ -7,7 +7,7 @@ export TEST_REPO_VALID="jiaojunming/test1" export TEST_REPO_EMPTY="jiaojunming/test2" export TEST_REPO_INVALID="jiaojunming/test3" -export TEST_USER_ADMIN="jiaojunming" -export TEST_PASS_ADMIN="hwyhwy12" +export TEST_USER_ADMIN="" +export TEST_PASS_ADMIN="" export TEST_ADMIN_USER_ID="1" -export TEST_REPO_ADMIN="jiaojunming/test1" \ No newline at end of file +export TEST_REPO_ADMIN="" diff --git a/tests/README.md b/tests/README.md index f8710db726..2cf1e7c05c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,7 +3,7 @@ 1.在custom/conf下的app.ini中关闭验证码:ENABLE_CAPTCHA = false 2.在执行脚本前请下载相关依赖:npx playwright install 3.请在.env.e2e文件中配置相关项: -GITEA_URL:devstar实例的url,TEST_USER:测试用户,TEST_REPO_VALID:一个干净的,有合理json配置的仓库,TEST_USER_ADMIN:管理员账号(可以是测试用户),TEST_ADMIN_USER_ID:管理员用户的id(管理后台查看) -4.在项目根目录执行命令source .env.e2e && npx playwright test ,生成的报告在test/e2e下 +GITEA_URL:devstar实例的url,TEST_USER:测试用户,现在这个测试用户需要是管理员,这样测试结束时会清理掉所有痕迹 +4.在项目根目录执行命令source .env.e2e && npx playwright test tests/e2e/devcontainer.test.e2e.ts ,生成的报告在test/e2e下 diff --git a/tests/e2e/devcontainer.test.e2e.ts b/tests/e2e/devcontainer.test.e2e.ts index f6e4f2a783..e804983251 100644 --- a/tests/e2e/devcontainer.test.e2e.ts +++ b/tests/e2e/devcontainer.test.e2e.ts @@ -4,17 +4,12 @@ const { GITEA_URL, TEST_USER, TEST_PASS, - TEST_REPO_VALID, - TEST_REPO_EMPTY, - TEST_REPO_INVALID, - TEST_USER_ADMIN, - TEST_PASS_ADMIN, TEST_ADMIN_USER_ID, - TEST_REPO_ADMIN } = process.env; +const repoName = `e2e-devcontainer-test`; // 检查关键配置是否存在 -if (!GITEA_URL || !TEST_USER || !TEST_PASS || !TEST_REPO_VALID) { +if (!GITEA_URL || !TEST_USER || !TEST_PASS ) {   throw new Error("请确保 .env.e2e 配置文件已加载,并包含 GITEA_URL, TEST_USER, TEST_PASS, TEST_REPO_VALID"); } test('DevContainer 功能和配置', async ({ page,context }) => { @@ -25,13 +20,85 @@ test('DevContainer 功能和配置', async ({ page,context }) => { await page.fill('#password', TEST_PASS); await page.getByRole('button', { name: 'Sign In' }).click(); await expect(page).toHaveURL(GITEA_URL + '/'); - console.log("登录成功! "); - console.log("进入test1仓库"); - await page.goto(GITEA_URL + '/'+ TEST_REPO_VALID); + console.log(`正在创建新仓库: ${repoName}`); + await page.goto(GITEA_URL + '/repo/create'); + await page.fill('input[name="repo_name"]', repoName); + await page.getByRole('button', { name: 'Create Repository' }).click(); + await expect(page).toHaveURL(GITEA_URL + '/' + TEST_USER + '/' + repoName); + + console.log("仓库创建成功."); + await expect(page).toHaveURL(GITEA_URL + '/' + TEST_USER + '/' + repoName); + + console.log("正在点击 'Dev Container' 标签页..."); await page.getByRole('link', { name: 'Dev Container' }).click(); + + console.log("正在点击 'Create' (创建模板) 按钮..."); + await page.getByRole('button', { name: /Create/i }).click(); + + console.log("模板已创建. 正在点击 'Edit' 按钮..."); await expect(page.getByText('devcontainer.json')).toBeVisible(); - await expect(page.getByRole('button', { name: 'Create Dev Container' })).toBeVisible(); + await page.getByRole('link', { name: 'Edit' }).click(); + + console.log("已跳转到编辑器. 正在修改内容"); + const newJsonAsObject = { + "name": "Gitea DevContainer", + "image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "version": "lts" + }, + "ghcr.io/devcontainers/features/git-lfs:1.2.2": {}, + "ghcr.io/devcontainers-extra/features/poetry:2": {}, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.12" + }, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} + }, + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint", + "golang.go", + "stylelint.vscode-stylelint", + "DavidAnson.vscode-markdownlint", + "Vue.volar", + "ms-azuretools.vscode-docker", + "vitest.explorer", + "cweijan.vscode-database-client2", + "GitHub.vscode-pull-request-github", + "Azurite.azurite" + ] + } + }, + "portsAttributes": { + "3000": { + "label": "Gitea Web", + "onAutoForward": "notify" + } + }, + "postCreateCommand": "make deps" + }; + + // 转换为JSON 字符串 + const newJsonString = JSON.stringify(newJsonAsObject); + + // 设置焦点 + await page.locator('.view-lines > div:nth-child(20)').click(); + console.log("正在手动删除模板内容 "); + for (let i = 0; i < 500; i++) { + await page.keyboard.press('Backspace'); + } + // 粘贴字符串 + console.log("正在粘贴JSON 内容..."); + await page.keyboard.insertText(newJsonString); + await page.getByRole('button', { name: 'Commit Changes' }).click(); + console.log("devcontainer.json 修改并提交成功."); + console.log("正在导航回 Dev Container 标签页进行验证..."); + await page.getByRole('link', { name: 'Dev Container' }).click(); + console.log("创建开发容器"); await page.getByRole('button', { name: 'Create Dev Container' }).click(); console.log("正在创建"); @@ -53,7 +120,7 @@ test('DevContainer 功能和配置', async ({ page,context }) => { const newPage = await pagePromise; await newPage.waitForLoadState(); // 等待新页面加载完成 console.log("Web Terminal: 新标签页已打开!"); - //await expect(newPage.getByText('Successfully connected to the container')).toBeVisible(); 这里ttyd里的信息PlayWright看不见,容器的交互没办法自动化测试 + //await expect(newPage.getByText('Successfully connected to the container')).toBeVisible(); //这里ttyd里的信息PlayWright看不见,容器的交互没办法自动化测试 await page.getByRole('link', { name: 'Delete Dev Container' }).click(); await page.locator('#delete-repo-devcontainer-of-user-modal') .getByRole('button', { name: 'Yes' }) @@ -63,23 +130,23 @@ test('DevContainer 功能和配置', async ({ page,context }) => { console.log('成功删除!'); console.log("test1 检查通过!"); - console.log("test2仓库"); - await page.goto(GITEA_URL + '/'+ TEST_REPO_EMPTY); - await page.getByRole('link', { name: 'Dev Container' }).click(); - await expect(page.getByText('Oops, it looks like there is no Dev Container Setting in this repository.')).toBeVisible(); - console.log("test2 检查通过"); + //console.log("test2仓库"); + //await page.goto(GITEA_URL + '/'+ TEST_REPO_EMPTY); + //await page.getByRole('link', { name: 'Dev Container' }).click(); + //await expect(page.getByText('Oops, it looks like there is no Dev Container Setting in this repository.')).toBeVisible(); + //console.log("test2 检查通过"); - console.log("test3仓库"); - await page.goto(GITEA_URL+ '/' + TEST_REPO_INVALID); - await page.getByRole('link', { name: 'Dev Container' }).click(); - await expect(page.getByText(' Invalid Dev Container Configuration')).toBeVisible(); - console.log("test3检查通过"); + //console.log("test3仓库"); + //await page.goto(GITEA_URL+ '/' + TEST_REPO_INVALID); + //await page.getByRole('link', { name: 'Dev Container' }).click(); + //await expect(page.getByText(' Invalid Dev Container Configuration')).toBeVisible(); + //console.log("test3检查通过"); }); test('权限修改相关', async ({ page }) => { console.log("正在登陆"); await page.goto(GITEA_URL + '/user/login'); - await page.fill('#user_name', TEST_USER_ADMIN); - await page.fill('#password', TEST_PASS_ADMIN); + await page.fill('#user_name', TEST_USER); + await page.fill('#password', TEST_PASS); await page.getByRole('button', { name: 'Sign In' }).click(); await expect(page).toHaveURL(GITEA_URL + '/'); console.log("登录成功! "); @@ -89,10 +156,30 @@ test('权限修改相关', async ({ page }) => { const devContainerCheckbox = page.getByLabel(/May Create Devcontainers/i); await devContainerCheckbox.uncheck(); await page.getByRole('button', { name: 'Update User Account' }).click(); - await page.goto(GITEA_URL + '/' + TEST_REPO_ADMIN); + await page.goto(GITEA_URL + '/' + "e2e-devcontainer-test"); const devContainerLink = page.getByRole('link', { name: 'Dev Container' }); await expect(devContainerLink).toBeHidden({ timeout: 10000 }); console.log('权限设置成功!'); + + console.log('现在恢复原环境'); + await page.goto(GITEA_URL+ '/-/admin/users/' + TEST_ADMIN_USER_ID + '/edit'); + await devContainerCheckbox.check(); + await page.getByRole('button', { name: 'Update User Account' }).click(); + + console.log('现在清理测试仓库'); + console.log("正在导航到仓库设置页面..."); + await page.goto(GITEA_URL + '/' + TEST_USER + '/' + repoName + '/settings'); + + console.log("正在点击 'Delete This Repository' 按钮..."); + await page.getByRole('button', { name: 'Delete This Repository' }).click(); + await page.locator('#delete-repo-modal').waitFor(); + console.log(`正在输入 '${repoName}' 进行确认...`); + await page.locator('#repo_name_to_delete').fill(repoName); + + console.log("正在点击最终的删除确认按钮..."); + await page.getByRole('button', { name: 'Delete Repository' }).click(); + + }); From b0ec1135c05197dce5becc67457385b064b71b15 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 31 Oct 2025 16:26:50 +0800 Subject: [PATCH 09/25] 1 --- .env .e2e | 6 ++++++ .env.e2e | 13 ------------- 2 files changed, 6 insertions(+), 13 deletions(-) create mode 100644 .env .e2e delete mode 100644 .env.e2e diff --git a/.env .e2e b/.env .e2e new file mode 100644 index 0000000000..0ae935f566 --- /dev/null +++ b/.env .e2e @@ -0,0 +1,6 @@ +export GITEA_URL="" + +export TEST_USER="" +export TEST_PASS="" +export TEST_ADMIN_USER_ID="1" + diff --git a/.env.e2e b/.env.e2e deleted file mode 100644 index a795eadde6..0000000000 --- a/.env.e2e +++ /dev/null @@ -1,13 +0,0 @@ -export GITEA_URL="http://192.168.181.128:3000" - -export TEST_USER="jiaojunming" -export TEST_PASS="hwyhwy12" - -export TEST_REPO_VALID="jiaojunming/test1" -export TEST_REPO_EMPTY="jiaojunming/test2" -export TEST_REPO_INVALID="jiaojunming/test3" - -export TEST_USER_ADMIN="" -export TEST_PASS_ADMIN="" -export TEST_ADMIN_USER_ID="1" -export TEST_REPO_ADMIN="" From a556d823e22e893a8d9f58f983375da66a3f576b Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 31 Oct 2025 16:27:23 +0800 Subject: [PATCH 10/25] 1 --- .env .e2e => .env.e2e | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .env .e2e => .env.e2e (100%) diff --git a/.env .e2e b/.env.e2e similarity index 100% rename from .env .e2e rename to .env.e2e From 087519a37273c1e71aae46aca66448dc8a79cb0b Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Mon, 3 Nov 2025 15:14:27 +0800 Subject: [PATCH 11/25] 1 --- package-lock.json | 13 ------------- tests/README.md | 9 --------- tests/e2e/README.md | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 tests/README.md diff --git a/package-lock.json b/package-lock.json index b856776e06..21e29a2081 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5070,19 +5070,6 @@ "dev": true, "license": "(BSD-3-Clause AND Apache-2.0)" }, - "node_modules/chrome-remote-interface": { - "version": "0.33.3", - "resolved": "https://registry.npmmirror.com/chrome-remote-interface/-/chrome-remote-interface-0.33.3.tgz", - "integrity": "sha512-zNnn0prUL86Teru6UCAZ1yU1XeXljHl3gj7OrfPcarEfU62OUU4IujDPdTDW3dAWwRqN3ZMG/Chhkh2gPL/wiw==", - "license": "MIT", - "dependencies": { - "commander": "2.11.x", - "ws": "^7.2.0" - }, - "bin": { - "chrome-remote-interface": "bin/client.js" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index 2cf1e7c05c..0000000000 --- a/tests/README.md +++ /dev/null @@ -1,9 +0,0 @@ -使用PLAYWRIGHT测试框架执行test/e2e下的自动测试脚本 - -1.在custom/conf下的app.ini中关闭验证码:ENABLE_CAPTCHA = false -2.在执行脚本前请下载相关依赖:npx playwright install -3.请在.env.e2e文件中配置相关项: -GITEA_URL:devstar实例的url,TEST_USER:测试用户,现在这个测试用户需要是管理员,这样测试结束时会清理掉所有痕迹 -4.在项目根目录执行命令source .env.e2e && npx playwright test tests/e2e/devcontainer.test.e2e.ts ,生成的报告在test/e2e下 - - diff --git a/tests/e2e/README.md b/tests/e2e/README.md index db083793d8..3c05fe120f 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -1,4 +1,23 @@ # End to end tests +使用PLAYWRIGHT测试框架执行test/e2e下的自动测试脚本 + +1.在custom/conf下的app.ini中关闭验证码:ENABLE_CAPTCHA = false +2.在执行脚本前请下载相关依赖:npx playwright install +3.请在.env.e2e文件中配置相关项: +GITEA_URL:devstar实例的url,TEST_USER:测试用户,TEST_USER_ADMIN:管理员在实例里的id,现在这个测试用户需要是管理员,测试结束时会清理掉所有痕迹 +4.在项目根目录执行命令source .env.e2e && npx playwright test tests/e2e/devcontainer.test.e2e.ts ,生成的报告在test/e2e下 + + + + + + + + + + + + E2e tests largely follow the same syntax as [integration tests](../integration). Whereas integration tests are intended to mock and stress the back-end, server-side code, e2e tests the interface between front-end and back-end, as well as visual regressions with both assertions and visual comparisons. From 5cba473dd891c57fe35ab8ee0a349337b8ba226e Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 13:14:18 +0800 Subject: [PATCH 12/25] new --- .dockerignore | 3 + .env.e2e | 6 - .gitignore | 3 + Makefile | 5 + docker-compose.test.yml | 50 +++++++ run-e2e-tests.sh | 56 ++++++++ tests/e2e/Dockerfile | 24 ++++ tests/e2e/README.md | 18 +-- tests/e2e/global-setup.ts | 78 +++++++++++ tests/e2e/package.json | 20 +++ tests/e2e/playwright.config.ts | 47 +++++++ .../e2e/{ => specs}/devcontainer.test.e2e.ts | 128 +++++++++--------- 12 files changed, 348 insertions(+), 90 deletions(-) delete mode 100644 .env.e2e create mode 100644 docker-compose.test.yml create mode 100755 run-e2e-tests.sh create mode 100644 tests/e2e/Dockerfile create mode 100644 tests/e2e/global-setup.ts create mode 100644 tests/e2e/package.json create mode 100644 tests/e2e/playwright.config.ts rename tests/e2e/{ => specs}/devcontainer.test.e2e.ts (70%) diff --git a/.dockerignore b/.dockerignore index 843f12a7be..477b8cfd52 100644 --- a/.dockerignore +++ b/.dockerignore @@ -60,6 +60,7 @@ cpu.out /tests/e2e/reports /tests/e2e/test-artifacts /tests/e2e/test-snapshots +/tests/e2e/test-data /tests/*.ini /node_modules /yarn.lock @@ -69,6 +70,8 @@ cpu.out /public/assets/css /public/assets/fonts /public/assets/img/avatar +/reports/ +/test-data/ /vendor /VERSION /.air diff --git a/.env.e2e b/.env.e2e deleted file mode 100644 index 0ae935f566..0000000000 --- a/.env.e2e +++ /dev/null @@ -1,6 +0,0 @@ -export GITEA_URL="" - -export TEST_USER="" -export TEST_PASS="" -export TEST_ADMIN_USER_ID="1" - diff --git a/.gitignore b/.gitignore index 0791a17c71..870e9b3619 100644 --- a/.gitignore +++ b/.gitignore @@ -69,11 +69,14 @@ cpu.out /tests/e2e/gitea-e2e-* /tests/e2e/indexers-* /tests/e2e/reports +/tests/e2e/test-data /tests/e2e/test-artifacts /tests/e2e/test-snapshots /tests/*.ini /tests/**/*.git/**/*.sample /node_modules +/test-data +/reports /.venv /yarn.lock /yarn-error.log diff --git a/Makefile b/Makefile index a1c3c961e8..11633f84ab 100644 --- a/Makefile +++ b/Makefile @@ -925,6 +925,11 @@ docker: docker build --disable-content-trust=false -t $(DOCKER_REF) . # support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" . +.PHONY: e2e-test +e2e-test: + @echo "正在启动E2E-TEST..." + @./run-e2e-tests.sh + # This endif closes the if at the top of the file endif diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000000..abe4a73aee --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,50 @@ +version: '3.8' + +services: + # 服务一: DevStar + devstar: + # 我们不再拉取镜像 + # image: mengning997/devstar-studio:latest + # pull_policy: always + # 我们告诉 Compose 在本地构建 + build: + context: . + dockerfile: docker/Dockerfile.devstar # + + image: devstar-e2e-test:latest # + pull_policy: never + ports: + - "80:3000" + - "2222:2222" + volumes: + # 挂载 Docker Socket,允许 DevStar 创建 Devcontainer + - /var/run/docker.sock:/var/run/docker.sock + # 挂载数据卷,使用相对路径,保证测试环境可移植 + - ./tests/e2e/test-data/devstar_data:/var/lib/gitea + - ./tests/e2e/test-data/devstar_data:/etc/gitea + # 健康检查。test-runner 会等待这个检查通过 + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"] + interval: 10s + timeout: 5s + retries: 30 + # 服务二: Playwright + test-runner: + # 从 'tests/' 目录下的 Dockerfile 构建 + build: + context: ./tests/e2e + # 等待 devstar 的 "healthcheck" 通过后,才启动 + depends_on: + devstar: + condition: service_healthy + environment: + # 将 DevStar 的 URL 传给 Playwright + - DEVSTAR_URL=http://devstar:3000 + volumes: + # 也挂载 Docker Socket + - /var/run/docker.sock:/var/run/docker.sock + # 将测试报告写回到宿主机的 ./reports 目录 + - ./tests/e2e/reports:/app/playwright-report + # 覆盖默认命令,强制运行测试并生成我们想要的报告 + command: > + npx playwright test diff --git a/run-e2e-tests.sh b/run-e2e-tests.sh new file mode 100755 index 0000000000..debe96fc29 --- /dev/null +++ b/run-e2e-tests.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# 这是一个“一键运行”E2E 测试的脚本 +# 它会处理所有清理、权限、拉取和执行工作 +# 任何命令失败立即退出 +set -e + +echo "===== [1/5] 清理旧的测试环境... =====" +# 彻底销毁旧的 compose 环境,-v 会删除关联的数据卷 +docker compose -f docker-compose.test.yml down -v --remove-orphans +docker image prune -f +docker builder prune -f +# 清理并重建报告和数据目录 +sudo rm -rf ./tests/e2e/reports ./tests/e2e/test-data +mkdir -p ./tests/e2e/reports/html ./tests/e2e/test-data/devstar_data +echo "清理完成。" +echo "" + +echo "===== [2/5] 设置权限... =====" +# 容器内的用户(通常 UID 1000)需要写入数据目录 +chmod -R 777 ./tests/e2e/test-data/devstar_data + +# 【关键】允许容器访问宿主机的 Docker Socket +sudo chmod 666 /var/run/docker.sock +echo "权限设置完成。" +echo "" + +echo "===== [3/5] 构建/拉取依赖镜像... =====" +# 根据 Dockerfile 里的注释 ,我们必须先在本地构建这两个“地基” +echo "正在构建 dev-container 基础镜像..." +docker build -t devstar.cn/devstar/devstar-dev-container:latest -f docker/Dockerfile.devContainer . + +echo "正在构建 runtime-container 基础镜像..." +docker build -t devstar.cn/devstar/devstar-runtime-container:latest -f docker/Dockerfile.runtimeContainer . + +echo "===== [4/5] 启动并运行测试... =====" +# --build: 确保 test-runner 镜像是最新的 +# --abort-on-container-exit: 如果 devstar 挂了, 测试立即停止 +# --exit-code-from test-runner: 运行结束后,将 test-runner 的退出码(0=成功, 1=失败)作为本命令的退出码 +docker compose -f docker-compose.test.yml up \ + --build \ + --abort-on-container-exit \ + --exit-code-from test-runner + +# 捕获 test-runner 的退出码 +EXIT_CODE=$? +echo "" +echo "" + +echo "===== [5/5] 测试运行完成 =====" +echo "HTML 报告已生成在: ./reports/html" +ls -l ./reports/html +echo "" + +# 以 test-runner 的退出码退出 +# 这将告诉 CI (或你自己) 测试是成功还是失败 +exit $EXIT_CODE diff --git a/tests/e2e/Dockerfile b/tests/e2e/Dockerfile new file mode 100644 index 0000000000..5732261019 --- /dev/null +++ b/tests/e2e/Dockerfile @@ -0,0 +1,24 @@ +# +# 这是 "test-runner" 服务的 Dockerfile +# 它构建了一个包含所有浏览器和我们测试代码的镜像 +# + +# 1. 使用微软官方的 Playwright 镜像 +# 它已经内置了所有浏览器 (Chromium, Firefox, WebKit) 和操作系统依赖 +FROM mcr.microsoft.com/playwright:v1.53.2-jammy + +# 2. 设置工作目录 +WORKDIR /app + +# 3. 复制 "依赖清单" 文件 +COPY package*.json ./ + +# 4. 安装我们的 npm 依赖 (即 @playwright/test) +RUN npm install + +# 5. 复制我们所有的测试代码到容器中 +# (包括 playwright.config.ts, global-setup.ts 和 specs/ 目录) +COPY . . + +# 6. 默认命令 +CMD ["npx", "playwright", "test"] diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 3c05fe120f..85cdd596da 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -1,22 +1,6 @@ # End to end tests 使用PLAYWRIGHT测试框架执行test/e2e下的自动测试脚本 - -1.在custom/conf下的app.ini中关闭验证码:ENABLE_CAPTCHA = false -2.在执行脚本前请下载相关依赖:npx playwright install -3.请在.env.e2e文件中配置相关项: -GITEA_URL:devstar实例的url,TEST_USER:测试用户,TEST_USER_ADMIN:管理员在实例里的id,现在这个测试用户需要是管理员,测试结束时会清理掉所有痕迹 -4.在项目根目录执行命令source .env.e2e && npx playwright test tests/e2e/devcontainer.test.e2e.ts ,生成的报告在test/e2e下 - - - - - - - - - - - +1.执行make e2e-test执行自动化测试 E2e tests largely follow the same syntax as [integration tests](../integration). diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts new file mode 100644 index 0000000000..42ec6d0ee2 --- /dev/null +++ b/tests/e2e/global-setup.ts @@ -0,0 +1,78 @@ + + import { chromium, type FullConfig } from '@playwright/test';async function globalSetup(config: FullConfig) { + + const { baseURL } = config.projects[0].use; + + if (!baseURL) { + + throw new Error('baseURL is not defined in playwright.config.ts'); + + } + + + + const browser = await chromium.launch(); + + const page = await browser.newPage(); + try { + + await page.goto(baseURL!, { timeout: 15000 }); + + + + console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); + + + + await page.getByRole('textbox', { name: 'Server Domain *' }).click(); + await page.getByRole('textbox', { name: 'Server Domain *' }).fill('172.17.0.1'); + await page.getByRole('textbox', { name: 'Gitea Base URL *' }).click(); + await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill('http://172.17.0.1:80'); + await page.getByText('Server and Third-Party Service Settings').click(); + await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); + + await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); + + + await page.getByText('Administrator Account Settings').click(); + await page.getByRole('textbox', { name: 'Administrator Username' }).click(); + await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser'); + await page.getByRole('textbox', { name: 'Email Address' }).click(); + await page.getByRole('textbox', { name: 'Email Address' }).fill('ilovcatlyn750314@gmail.com'); + await page.getByRole('textbox', { name: 'Password', exact: true }).click(); + await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); + await page.getByRole('textbox', { name: 'Confirm Password' }).click(); + await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); + + + + + + await page.getByRole('button', { name: 'Install Gitea'}).click(); // 'Install' (英文) 或 '安装' (中文) 都能匹配 + + + + // 4. 等待安装完成 + + await page.waitForTimeout(240*1000); + + console.log('[GlobalSetup] 安装成功!'); + + + + } catch (error) { + + // 5. 截图并报错 + + console.error('[GlobalSetup] 自动化安装失败!'); + + await page.screenshot({ path: 'playwright-report/global-setup-failure.png' }); + + console.error('[GlobalSetup] 失败截图已保存到: ./reports/global-setup-failure.png'); + + throw new Error(`[GlobalSetup] 自动化安装失败。查看截图。 \n原始错误: ${error}`); + + } + await browser.close(); + +}export default globalSetup; diff --git a/tests/e2e/package.json b/tests/e2e/package.json new file mode 100644 index 0000000000..b8ace7087a --- /dev/null +++ b/tests/e2e/package.json @@ -0,0 +1,20 @@ +{ + "name": "devstar-e2e-runner", + "version": "1.0.0", + "description": "Isolated E2E test runner for DevStar Studio", + "main": "index.js", + "scripts": { + "test": "npx playwright test" + }, + "keywords": [ + "playwright", + "e2e", + "devstar" + ], + "author": "", + "license": "ISC", + "devDependencies": { + "@playwright/test": "1.53.2" + }, + "dependencies": {} +} diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts new file mode 100644 index 0000000000..5b4fd553dc --- /dev/null +++ b/tests/e2e/playwright.config.ts @@ -0,0 +1,47 @@ +import { devices } from '@playwright/test'; +import { env } from 'node:process'; +import type { PlaywrightTestConfig } from '@playwright/test'; + +const BASE_URL = env.DEVSTAR_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000'; + +export default { + testDir: './specs', + + + testMatch: /specs\/.*\.ts/, + + timeout: 500000, // + expect: { + timeout: 15000, // + }, + forbidOnly: Boolean(env.CI), + retries: env.CI ? 2 : 0, + + reporter: env.CI ? 'list' : [['list'], ['html', { + outputFolder: 'playwright-report/html', // 写入 /app/playwright-report/html + open: 'never' + }]], + + use: { + headless: true, + locale: 'en-US', + actionTimeout: 15000, + navigationTimeout: 15000, + baseURL: BASE_URL, + trace: 'on-first-retry', + screenshot: 'only-on-failure', + }, + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + ], + + outputDir: 'playwright-report/test-artifacts/', + snapshotDir: 'playwright-report/test-snapshots/', + globalSetup: require.resolve('./global-setup.ts'), + +} satisfies PlaywrightTestConfig; diff --git a/tests/e2e/devcontainer.test.e2e.ts b/tests/e2e/specs/devcontainer.test.e2e.ts similarity index 70% rename from tests/e2e/devcontainer.test.e2e.ts rename to tests/e2e/specs/devcontainer.test.e2e.ts index e804983251..1095462619 100644 --- a/tests/e2e/devcontainer.test.e2e.ts +++ b/tests/e2e/specs/devcontainer.test.e2e.ts @@ -1,19 +1,12 @@ import { test, expect } from '@playwright/test'; import { link } from 'node:fs'; -const { - GITEA_URL, - TEST_USER, - TEST_PASS, - TEST_ADMIN_USER_ID, -} = process.env; +const GITEA_URL= `http://devstar:3000`; +const TEST_USER= `testuser`; +const TEST_PASS= `12345678`; +const TEST_ADMIN_USER_ID=`1`; const repoName = `e2e-devcontainer-test`; -// 检查关键配置是否存在 -if (!GITEA_URL || !TEST_USER || !TEST_PASS ) { -  throw new Error("请确保 .env.e2e 配置文件已加载,并包含 GITEA_URL, TEST_USER, TEST_PASS, TEST_REPO_VALID"); -} test('DevContainer 功能和配置', async ({ page,context }) => { - console.log("正在登陆"); await page.goto(GITEA_URL + '/user/login'); await page.fill('#user_name',TEST_USER); @@ -35,69 +28,70 @@ test('DevContainer 功能和配置', async ({ page,context }) => { console.log("正在点击 'Create' (创建模板) 按钮..."); await page.getByRole('button', { name: /Create/i }).click(); + await page.waitForTimeout(10000); console.log("模板已创建. 正在点击 'Edit' 按钮..."); await expect(page.getByText('devcontainer.json')).toBeVisible(); - await page.getByRole('link', { name: 'Edit' }).click(); - - console.log("已跳转到编辑器. 正在修改内容"); - const newJsonAsObject = { - "name": "Gitea DevContainer", - "image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm", - "features": { - "ghcr.io/devcontainers/features/node:1": { - "version": "lts" - }, - "ghcr.io/devcontainers/features/git-lfs:1.2.2": {}, - "ghcr.io/devcontainers-extra/features/poetry:2": {}, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.12" - }, - "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} - }, - "customizations": { - "vscode": { - "settings": {}, - "extensions": [ - "editorconfig.editorconfig", - "dbaeumer.vscode-eslint", - "golang.go", - "stylelint.vscode-stylelint", - "DavidAnson.vscode-markdownlint", - "Vue.volar", - "ms-azuretools.vscode-docker", - "vitest.explorer", - "cweijan.vscode-database-client2", - "GitHub.vscode-pull-request-github", - "Azurite.azurite" - ] - } - }, - "portsAttributes": { - "3000": { - "label": "Gitea Web", - "onAutoForward": "notify" - } - }, - "postCreateCommand": "make deps" - }; + //await page.getByRole('link', { name: 'Edit' }).click(); + await page.waitForTimeout(5000); + //console.log("已跳转到编辑器. 正在修改内容"); + //const newJsonAsObject = { + //"name": "Gitea DevContainer", + //"image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm", + //"features": { + //"ghcr.io/devcontainers/features/node:1": { + //"version": "lts" + //}, + // "ghcr.io/devcontainers/features/git-lfs:1.2.2": {}, + // "ghcr.io/devcontainers-extra/features/poetry:2": {}, + // "ghcr.io/devcontainers/features/python:1": { + // "version": "3.12" + // }, + //"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} + //}, + //"customizations": { + // "vscode": { + // "settings": {}, + // "extensions": [ + // "editorconfig.editorconfig", + // "dbaeumer.vscode-eslint", + // "golang.go", + // "stylelint.vscode-stylelint", + /// "DavidAnson.vscode-markdownlint", + // "Vue.volar", + // "ms-azuretools.vscode-docker", + //// "vitest.explorer", + // "cweijan.vscode-database-client2", + // "GitHub.vscode-pull-request-github", + // "Azurite.azurite" + //] + // } + //}, + //"portsAttributes": { + //"3000": { + // "label": "Gitea Web", + // "onAutoForward": "notify" + // } + // }, + //"postCreateCommand": "make deps" + // }; // 转换为JSON 字符串 - const newJsonString = JSON.stringify(newJsonAsObject); + //const newJsonString = JSON.stringify(newJsonAsObject); // 设置焦点 - await page.locator('.view-lines > div:nth-child(20)').click(); - console.log("正在手动删除模板内容 "); - for (let i = 0; i < 500; i++) { - await page.keyboard.press('Backspace'); - } - // 粘贴字符串 - console.log("正在粘贴JSON 内容..."); - await page.keyboard.insertText(newJsonString); - await page.getByRole('button', { name: 'Commit Changes' }).click(); - console.log("devcontainer.json 修改并提交成功."); - console.log("正在导航回 Dev Container 标签页进行验证..."); - await page.getByRole('link', { name: 'Dev Container' }).click(); + // await page.locator('.view-lines > div:nth-child(20)').click(); + // console.log("正在手动删除模板内容 "); + //for (let i = 0; i < 500; i++) { + // await page.keyboard.press('Backspace'); + // } + /// 粘贴字符串 + //console.log("正在粘贴JSON 内容..."); + // await page.keyboard.insertText(newJsonString); + //await page.getByRole('button', { name: 'Commit Changes' }).click(); + //console.log("devcontainer.json 修改并提交成功."); + //console.log("正在导航回 Dev Container 标签页进行验证..."); + //await page.getByRole('link', { name: 'Dev Container' }).click(); console.log("创建开发容器"); await page.getByRole('button', { name: 'Create Dev Container' }).click(); From 25ebc112d160d06f87d4be61d7233da6c772a36d Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 16:05:30 +0800 Subject: [PATCH 13/25] 1 --- .dockerignore | 2 -- .gitignore | 2 -- 2 files changed, 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 477b8cfd52..02eb328c13 100644 --- a/.dockerignore +++ b/.dockerignore @@ -70,8 +70,6 @@ cpu.out /public/assets/css /public/assets/fonts /public/assets/img/avatar -/reports/ -/test-data/ /vendor /VERSION /.air diff --git a/.gitignore b/.gitignore index 870e9b3619..87323b6756 100644 --- a/.gitignore +++ b/.gitignore @@ -75,8 +75,6 @@ cpu.out /tests/*.ini /tests/**/*.git/**/*.sample /node_modules -/test-data -/reports /.venv /yarn.lock /yarn-error.log From 1fc326dbae631a6da4439530061cbe6f2a236000 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 17:21:18 +0800 Subject: [PATCH 14/25] 1 --- Makefile | 2 +- tests/e2e/.dockerignore | 11 ++++++++ .../e2e/docker-compose.test.yml | 10 +++---- tests/e2e/global-setup.ts | 28 ++----------------- .../e2e/run-e2e-tests.sh | 10 +++++-- tests/e2e/utils_e2e.ts | 2 +- tests/sqlite.ini.tmpl | 2 +- 7 files changed, 30 insertions(+), 35 deletions(-) create mode 100644 tests/e2e/.dockerignore rename docker-compose.test.yml => tests/e2e/docker-compose.test.yml (87%) rename run-e2e-tests.sh => tests/e2e/run-e2e-tests.sh (86%) diff --git a/Makefile b/Makefile index 11633f84ab..7742e91132 100644 --- a/Makefile +++ b/Makefile @@ -928,7 +928,7 @@ docker: .PHONY: e2e-test e2e-test: @echo "正在启动E2E-TEST..." - @./run-e2e-tests.sh + @./tests/e2e/run-e2e-tests.sh # This endif closes the if at the top of the file diff --git a/tests/e2e/.dockerignore b/tests/e2e/.dockerignore new file mode 100644 index 0000000000..f0d0cf7e83 --- /dev/null +++ b/tests/e2e/.dockerignore @@ -0,0 +1,11 @@ +# 1. 忽略 Node.js 依赖目录 +/node_modules +# 2. 忽略本地的测试报告和结果 +/reports +/test-data +/test-artifacts +/Readme.md +/utils_e2e.ts +/utils_e2e_test.go +/e2e_test.go + diff --git a/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml similarity index 87% rename from docker-compose.test.yml rename to tests/e2e/docker-compose.test.yml index abe4a73aee..22fb127282 100644 --- a/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -8,7 +8,7 @@ services: # pull_policy: always # 我们告诉 Compose 在本地构建 build: - context: . + context: ../.. dockerfile: docker/Dockerfile.devstar # image: devstar-e2e-test:latest # @@ -20,8 +20,8 @@ services: # 挂载 Docker Socket,允许 DevStar 创建 Devcontainer - /var/run/docker.sock:/var/run/docker.sock # 挂载数据卷,使用相对路径,保证测试环境可移植 - - ./tests/e2e/test-data/devstar_data:/var/lib/gitea - - ./tests/e2e/test-data/devstar_data:/etc/gitea + - ./test-data/devstar_data:/var/lib/gitea + - ./test-data/devstar_data:/etc/gitea # 健康检查。test-runner 会等待这个检查通过 healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"] @@ -32,7 +32,7 @@ services: test-runner: # 从 'tests/' 目录下的 Dockerfile 构建 build: - context: ./tests/e2e + context: . # 等待 devstar 的 "healthcheck" 通过后,才启动 depends_on: devstar: @@ -44,7 +44,7 @@ services: # 也挂载 Docker Socket - /var/run/docker.sock:/var/run/docker.sock # 将测试报告写回到宿主机的 ./reports 目录 - - ./tests/e2e/reports:/app/playwright-report + - ./reports:/app/playwright-report # 覆盖默认命令,强制运行测试并生成我们想要的报告 command: > npx playwright test diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index 42ec6d0ee2..11163b7e89 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -9,31 +9,21 @@ } - - const browser = await chromium.launch(); const page = await browser.newPage(); try { - await page.goto(baseURL!, { timeout: 15000 }); - - console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); - - await page.getByRole('textbox', { name: 'Server Domain *' }).click(); await page.getByRole('textbox', { name: 'Server Domain *' }).fill('172.17.0.1'); await page.getByRole('textbox', { name: 'Gitea Base URL *' }).click(); await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill('http://172.17.0.1:80'); await page.getByText('Server and Third-Party Service Settings').click(); await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); - await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); - - await page.getByText('Administrator Account Settings').click(); await page.getByRole('textbox', { name: 'Administrator Username' }).click(); await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser'); @@ -43,23 +33,11 @@ await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); await page.getByRole('textbox', { name: 'Confirm Password' }).click(); await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); - - - - - - await page.getByRole('button', { name: 'Install Gitea'}).click(); // 'Install' (英文) 或 '安装' (中文) 都能匹配 - - + await page.getByRole('button', { name: 'Install Gitea'}).click(); // 'Install' (英文) 或 '安装' (中文) 都能匹配 // 4. 等待安装完成 - - await page.waitForTimeout(240*1000); - - console.log('[GlobalSetup] 安装成功!'); - - - + await page.waitForTimeout(240*1000); + console.log('[GlobalSetup] 安装成功!'); } catch (error) { // 5. 截图并报错 diff --git a/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh similarity index 86% rename from run-e2e-tests.sh rename to tests/e2e/run-e2e-tests.sh index debe96fc29..231618e51d 100755 --- a/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -3,10 +3,16 @@ # 它会处理所有清理、权限、拉取和执行工作 # 任何命令失败立即退出 set -e +# +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +# +PROJECT_ROOT=$( cd -- "$SCRIPT_DIR/../.." &> /dev/null && pwd ) +# +cd "$PROJECT_ROOT" echo "===== [1/5] 清理旧的测试环境... =====" # 彻底销毁旧的 compose 环境,-v 会删除关联的数据卷 -docker compose -f docker-compose.test.yml down -v --remove-orphans +docker compose -f tests/e2e/docker-compose.test.yml down -v --remove-orphans docker image prune -f docker builder prune -f # 清理并重建报告和数据目录 @@ -36,7 +42,7 @@ echo "===== [4/5] 启动并运行测试... =====" # --build: 确保 test-runner 镜像是最新的 # --abort-on-container-exit: 如果 devstar 挂了, 测试立即停止 # --exit-code-from test-runner: 运行结束后,将 test-runner 的退出码(0=成功, 1=失败)作为本命令的退出码 -docker compose -f docker-compose.test.yml up \ +docker compose -f ./tests/e2e/docker-compose.test.yml up \ --build \ --abort-on-container-exit \ --exit-code-from test-runner diff --git a/tests/e2e/utils_e2e.ts b/tests/e2e/utils_e2e.ts index 6eaef4cb10..3e92e0d3c2 100644 --- a/tests/e2e/utils_e2e.ts +++ b/tests/e2e/utils_e2e.ts @@ -22,7 +22,7 @@ export async function login_user(browser: Browser, workerInfo: WorkerInfo, user: await page.locator('input[name=password]').fill(LOGIN_PASSWORD); await page.click('form button.ui.primary.button:visible'); - //await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle expect(page.url(), {message: `Failed to login user ${user}`}).toBe(`${workerInfo.project.use.baseURL}/`); diff --git a/tests/sqlite.ini.tmpl b/tests/sqlite.ini.tmpl index 31ac00c070..938f203633 100644 --- a/tests/sqlite.ini.tmpl +++ b/tests/sqlite.ini.tmpl @@ -1,5 +1,5 @@ APP_NAME = Gitea: Git with a cup of tea -RUN_MODE = dev +RUN_MODE = prod [database] DB_TYPE = sqlite3 From fb1637a0f478fc319c97e83fb9149c862c969020 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 18:18:45 +0800 Subject: [PATCH 15/25] 1 --- playwright.config.ts | 75 ++++++++----------------------- tests/e2e/docker-compose.test.yml | 1 + tests/e2e/playwright.config.ts | 47 ------------------- 3 files changed, 20 insertions(+), 103 deletions(-) delete mode 100644 tests/e2e/playwright.config.ts diff --git a/playwright.config.ts b/playwright.config.ts index 6b50337033..72ac46f2ac 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,79 +1,42 @@ -import {devices} from '@playwright/test'; -import {env} from 'node:process'; -import type {PlaywrightTestConfig} from '@playwright/test'; +import { devices } from '@playwright/test'; +import { env } from 'node:process'; +import type { PlaywrightTestConfig } from '@playwright/test'; -const BASE_URL = env.GITEA_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000'; +const BASE_URL = env.DEVSTAR_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000'; export default { - testDir: './tests/e2e/', - testMatch: /.*\.test\.e2e\.ts/, // Match any .test.e2e.ts files - - /* Maximum time one test can run for. */ - timeout: 500000, - + testDir: './specs', + testMatch: /specs\/.*\.ts/, + timeout: 500000, expect: { - - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 15000, + timeout: 15000, }, - - /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: Boolean(env.CI), - - /* Retry on CI only */ retries: env.CI ? 2 : 0, + reporter: env.CI ? 'list' : [['list'], ['html', { + outputFolder: 'playwright-report/html', + open: 'never' + }]], - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: env.CI ? 'list' : [['list'], ['html', {outputFolder: 'tests/e2e/reports/', open: 'never'}]], - - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { - headless: true, // set to false to debug - + headless: true, locale: 'en-US', - - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 15000, - - /* Maximum time allowed for navigation, such as `page.goto()`. */ - navigationTimeout: 15000, - - /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: BASE_URL, - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + actionTimeout: 15000, + navigationTimeout: 15000, + baseURL: BASE_URL, trace: 'on-first-retry', - screenshot: 'only-on-failure', }, - - /* Configure projects for major browsers */ projects: [ { name: 'chromium', - - /* Project-specific settings. */ use: { ...devices['Desktop Chrome'], }, }, - - // disabled because of https://github.com/go-gitea/gitea/issues/21355 - // { - // name: 'firefox', - // use: { - // ...devices['Desktop Firefox'], - // }, - // }, - - ], + outputDir: 'playwright-report/test-artifacts/', + snapshotDir: 'playwright-report/test-snapshots/', + globalSetup: require.resolve('./global-setup.ts'), - /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - outputDir: 'tests/e2e/test-artifacts/', - /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - snapshotDir: 'tests/e2e/test-snapshots/', } satisfies PlaywrightTestConfig; diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index 22fb127282..da57ef5432 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -43,6 +43,7 @@ services: volumes: # 也挂载 Docker Socket - /var/run/docker.sock:/var/run/docker.sock + - ../../playwright.config.ts:/app/playwright.config.ts # 将测试报告写回到宿主机的 ./reports 目录 - ./reports:/app/playwright-report # 覆盖默认命令,强制运行测试并生成我们想要的报告 diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts deleted file mode 100644 index 5b4fd553dc..0000000000 --- a/tests/e2e/playwright.config.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { devices } from '@playwright/test'; -import { env } from 'node:process'; -import type { PlaywrightTestConfig } from '@playwright/test'; - -const BASE_URL = env.DEVSTAR_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000'; - -export default { - testDir: './specs', - - - testMatch: /specs\/.*\.ts/, - - timeout: 500000, // - expect: { - timeout: 15000, // - }, - forbidOnly: Boolean(env.CI), - retries: env.CI ? 2 : 0, - - reporter: env.CI ? 'list' : [['list'], ['html', { - outputFolder: 'playwright-report/html', // 写入 /app/playwright-report/html - open: 'never' - }]], - - use: { - headless: true, - locale: 'en-US', - actionTimeout: 15000, - navigationTimeout: 15000, - baseURL: BASE_URL, - trace: 'on-first-retry', - screenshot: 'only-on-failure', - }, - projects: [ - { - name: 'chromium', - use: { - ...devices['Desktop Chrome'], - }, - }, - ], - - outputDir: 'playwright-report/test-artifacts/', - snapshotDir: 'playwright-report/test-snapshots/', - globalSetup: require.resolve('./global-setup.ts'), - -} satisfies PlaywrightTestConfig; From 6b4feabe81fce1c9d66e94ad864f0048c03d43c0 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 19:52:09 +0800 Subject: [PATCH 16/25] 1 --- Makefile | 2 +- playwright.config.ts | 17 ++++++++++++---- tests/e2e/docker-compose.test.yml | 5 +---- tests/e2e/run-e2e-tests.sh | 34 ++++++++++++++++++++++++------- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 7742e91132..9022cb31ef 100644 --- a/Makefile +++ b/Makefile @@ -928,7 +928,7 @@ docker: .PHONY: e2e-test e2e-test: @echo "正在启动E2E-TEST..." - @./tests/e2e/run-e2e-tests.sh + @TARGET_URL=$(TARGET_URL) ./tests/e2e/run-e2e-tests.sh # This endif closes the if at the top of the file diff --git a/playwright.config.ts b/playwright.config.ts index 72ac46f2ac..b56d2df9eb 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,15 +4,17 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const BASE_URL = env.DEVSTAR_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000'; -export default { +const config: PlaywrightTestConfig = { testDir: './specs', - testMatch: /specs\/.*\.ts/, + testMatch: /specs\/.*\.ts/, + timeout: 500000, expect: { timeout: 15000, }, forbidOnly: Boolean(env.CI), retries: env.CI ? 2 : 0, + reporter: env.CI ? 'list' : [['list'], ['html', { outputFolder: 'playwright-report/html', open: 'never' @@ -37,6 +39,13 @@ export default { ], outputDir: 'playwright-report/test-artifacts/', snapshotDir: 'playwright-report/test-snapshots/', - globalSetup: require.resolve('./global-setup.ts'), +}; -} satisfies PlaywrightTestConfig; +if (BASE_URL.includes('http://devstar:3000')) { + console.log(' 已启用安装'); + config.globalSetup = require.resolve('./global-setup.ts'); +} else { + console.log(` 已跳过 安装`); +} + +export default config satisfies PlaywrightTestConfig; diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index da57ef5432..d5162a12c3 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -34,12 +34,9 @@ services: build: context: . # 等待 devstar 的 "healthcheck" 通过后,才启动 - depends_on: - devstar: - condition: service_healthy environment: # 将 DevStar 的 URL 传给 Playwright - - DEVSTAR_URL=http://devstar:3000 + - DEVSTAR_URL=${DEVSTAR_URL:-http://devstar:3000} volumes: # 也挂载 Docker Socket - /var/run/docker.sock:/var/run/docker.sock diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index 231618e51d..d69c708010 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -39,13 +39,33 @@ echo "正在构建 runtime-container 基础镜像..." docker build -t devstar.cn/devstar/devstar-runtime-container:latest -f docker/Dockerfile.runtimeContainer . echo "===== [4/5] 启动并运行测试... =====" -# --build: 确保 test-runner 镜像是最新的 -# --abort-on-container-exit: 如果 devstar 挂了, 测试立即停止 -# --exit-code-from test-runner: 运行结束后,将 test-runner 的退出码(0=成功, 1=失败)作为本命令的退出码 -docker compose -f ./tests/e2e/docker-compose.test.yml up \ - --build \ - --abort-on-container-exit \ - --exit-code-from test-runner + +# 检查从 Makefile 传来的 TARGET_URL 变量是否为空 +if [ -n "$TARGET_URL" ]; then + # --- [A] URL 模式 --- + echo "URL模式" + + # 1. 将目标 URL 导出为 DEVSTAR_URL, 供 docker-compose.yml 读取 + export DEVSTAR_URL=$TARGET_URL + # 2. [关键] 只启动 test-runner 服务 + # 我们不需要 devstar, 也不需要 --abort-on-container-exit + docker compose -f tests/e2e/docker-compose.test.yml up \ + --build \ + --exit-code-from test-runner \ + test-runner +else + # --- [B] 构建模式 --- + echo "==> 模式: [构建模式]. 正在本地启动 devstar..." + + # 1. 导出内部 URL (这会成为 compose 里的默认值) + export DEVSTAR_URL="http://devstar:3000" + echo "即将执行: docker compose -f tests/e2e/docker-compose.test.yml up --build --wait --exit-code-from test-runner" + # 2. [关键] 运行你原来的命令, 启动所有服务 + docker compose -f tests/e2e/docker-compose.test.yml up \ + --build \ + --wait \ + --exit-code-from test-runner +fi # 捕获 test-runner 的退出码 EXIT_CODE=$? From 5918d57139aecae29d97f35f6d299f52e06de4d5 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Wed, 12 Nov 2025 20:54:15 +0800 Subject: [PATCH 17/25] 1 --- tests/e2e/docker-compose.override.yml | 5 +++++ tests/e2e/run-e2e-tests.sh | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 tests/e2e/docker-compose.override.yml diff --git a/tests/e2e/docker-compose.override.yml b/tests/e2e/docker-compose.override.yml new file mode 100644 index 0000000000..14e18b8289 --- /dev/null +++ b/tests/e2e/docker-compose.override.yml @@ -0,0 +1,5 @@ +services: + test-runner: + depends_on: + devstar: + condition: service_healthy diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index d69c708010..63b2e0f410 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -49,7 +49,9 @@ if [ -n "$TARGET_URL" ]; then export DEVSTAR_URL=$TARGET_URL # 2. [关键] 只启动 test-runner 服务 # 我们不需要 devstar, 也不需要 --abort-on-container-exit - docker compose -f tests/e2e/docker-compose.test.yml up \ + command docker compose \ + -f tests/e2e/docker-compose.test.yml \ + up \ --build \ --exit-code-from test-runner \ test-runner @@ -61,9 +63,12 @@ else export DEVSTAR_URL="http://devstar:3000" echo "即将执行: docker compose -f tests/e2e/docker-compose.test.yml up --build --wait --exit-code-from test-runner" # 2. [关键] 运行你原来的命令, 启动所有服务 - docker compose -f tests/e2e/docker-compose.test.yml up \ + command docker compose \ + -f tests/e2e/docker-compose.test.yml \ + -f tests/e2e/docker-compose.override.yml \ + up \ --build \ - --wait \ + --abort-on-container-exit \ --exit-code-from test-runner fi @@ -74,7 +79,7 @@ echo "" echo "===== [5/5] 测试运行完成 =====" echo "HTML 报告已生成在: ./reports/html" -ls -l ./reports/html +ls -l ./tests/e2e/reports/html echo "" # 以 test-runner 的退出码退出 From c6ad67556bdf4b8856e5e888cd74dcad14927d4b Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Thu, 13 Nov 2025 14:13:38 +0800 Subject: [PATCH 18/25] 1 --- Makefile | 15 ++++++++++++--- tests/e2e/docker-compose.test.yml | 13 ++----------- tests/e2e/run-e2e-tests.sh | 8 +------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 9022cb31ef..bcb3e639db 100644 --- a/Makefile +++ b/Makefile @@ -196,6 +196,7 @@ go-check: fi .PHONY: git-check + make e2e-test TARGET_URL="192.168" git-check: @if git lfs >/dev/null 2>&1 ; then : ; else \ echo "Gitea requires git with lfs support to run tests." ; \ @@ -918,15 +919,23 @@ generate-manpage: ## generate manpage .PHONY: devstar devstar: docker build -t devstar-studio:latest -f docker/Dockerfile.devstar . - + .PHONY: docker docker: docker build -t devstar.cn/devstar/webterminal:latest -f docker/Dockerfile.webTerminal . docker build --disable-content-trust=false -t $(DOCKER_REF) . -# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" . +# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" + + +ifeq ($(TARGET_URL),) + E2E_DEPS = devstar +else + E2E_DEPS = +endif + .PHONY: e2e-test -e2e-test: +e2e-test: $(E2E_DEPS) @echo "正在启动E2E-TEST..." @TARGET_URL=$(TARGET_URL) ./tests/e2e/run-e2e-tests.sh diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index d5162a12c3..fa14509aff 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -3,23 +3,14 @@ version: '3.8' services: # 服务一: DevStar devstar: - # 我们不再拉取镜像 - # image: mengning997/devstar-studio:latest - # pull_policy: always - # 我们告诉 Compose 在本地构建 - build: - context: ../.. - dockerfile: docker/Dockerfile.devstar # - - image: devstar-e2e-test:latest # + #现在make devstar负责构建镜像 + image: devstar-studio:latest pull_policy: never ports: - "80:3000" - "2222:2222" volumes: - # 挂载 Docker Socket,允许 DevStar 创建 Devcontainer - /var/run/docker.sock:/var/run/docker.sock - # 挂载数据卷,使用相对路径,保证测试环境可移植 - ./test-data/devstar_data:/var/lib/gitea - ./test-data/devstar_data:/etc/gitea # 健康检查。test-runner 会等待这个检查通过 diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index 63b2e0f410..16f14e216e 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -14,7 +14,6 @@ echo "===== [1/5] 清理旧的测试环境... =====" # 彻底销毁旧的 compose 环境,-v 会删除关联的数据卷 docker compose -f tests/e2e/docker-compose.test.yml down -v --remove-orphans docker image prune -f -docker builder prune -f # 清理并重建报告和数据目录 sudo rm -rf ./tests/e2e/reports ./tests/e2e/test-data mkdir -p ./tests/e2e/reports/html ./tests/e2e/test-data/devstar_data @@ -31,12 +30,7 @@ echo "权限设置完成。" echo "" echo "===== [3/5] 构建/拉取依赖镜像... =====" -# 根据 Dockerfile 里的注释 ,我们必须先在本地构建这两个“地基” -echo "正在构建 dev-container 基础镜像..." -docker build -t devstar.cn/devstar/devstar-dev-container:latest -f docker/Dockerfile.devContainer . - -echo "正在构建 runtime-container 基础镜像..." -docker build -t devstar.cn/devstar/devstar-runtime-container:latest -f docker/Dockerfile.runtimeContainer . +#现在make devstar 处理镜像的构建 echo "===== [4/5] 启动并运行测试... =====" From b3fe3a78e01f4099ac8541042c9dc46479db33af Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Thu, 13 Nov 2025 15:28:27 +0800 Subject: [PATCH 19/25] 1 --- Makefile | 2 -- tests/e2e/docker-compose.test.yml | 1 + tests/e2e/global-setup.ts | 9 ++++++--- tests/e2e/run-e2e-tests.sh | 18 +++++++++++++++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index bcb3e639db..fb9a53d859 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,6 @@ go-check: fi .PHONY: git-check - make e2e-test TARGET_URL="192.168" git-check: @if git lfs >/dev/null 2>&1 ; then : ; else \ echo "Gitea requires git with lfs support to run tests." ; \ @@ -919,7 +918,6 @@ generate-manpage: ## generate manpage .PHONY: devstar devstar: docker build -t devstar-studio:latest -f docker/Dockerfile.devstar . - .PHONY: docker docker: docker build -t devstar.cn/devstar/webterminal:latest -f docker/Dockerfile.webTerminal . diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index fa14509aff..a79a2a5cda 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -28,6 +28,7 @@ services: environment: # 将 DevStar 的 URL 传给 Playwright - DEVSTAR_URL=${DEVSTAR_URL:-http://devstar:3000} + - DOCKER_HOST_GATEWAY=${DOCKER_HOST_GATEWAY} volumes: # 也挂载 Docker Socket - /var/run/docker.sock:/var/run/docker.sock diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index 11163b7e89..8b9e46b327 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -8,7 +8,10 @@ throw new Error('baseURL is not defined in playwright.config.ts'); } - + const hostGateway = process.env.DOCKER_HOST_GATEWAY || '172.17.0.1'; + + const giteaBaseURL = `http://${hostGateway}:80`; + const serverDomain = hostGateway; const browser = await chromium.launch(); const page = await browser.newPage(); @@ -18,9 +21,9 @@ console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); await page.getByRole('textbox', { name: 'Server Domain *' }).click(); - await page.getByRole('textbox', { name: 'Server Domain *' }).fill('172.17.0.1'); + await page.getByRole('textbox', { name: 'Server Domain *' }).fill(hostGateway); await page.getByRole('textbox', { name: 'Gitea Base URL *' }).click(); - await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill('http://172.17.0.1:80'); + await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill(giteaBaseURL); await page.getByText('Server and Third-Party Service Settings').click(); await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index 16f14e216e..1a01c7b7b1 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -31,9 +31,25 @@ echo "" echo "===== [3/5] 构建/拉取依赖镜像... =====" #现在make devstar 处理镜像的构建 +docker pull mengning997/webterminal:latest +docker tag mengning997/webterminal:latest devstar.cn/devstar/webterminal:latest + +echo "===== 现在检测Docker宿主机网关=====" +DOCKER_HOST_GATEWAY="172.17.0.1" +if [ "$OS_TYPE" = "Darwin" ]; then + DOCKER_HOST_GATEWAY="host.docker.internal" +elif [ "$OS_TYPE" = "Linux" ]; then + LINUX_IP=$(ip addr show docker0 | grep -Po 'inet \K[\d\.]+') + if [ -n "$LINUX_IP" ]; then + DOCKER_HOST_GATEWAY=$LINUX_IP + else + echo "警告: 无法动态检测 'docker0' IP, 回退到 172.17.0.1" + fi +fi +echo "==> 宿主机网关被设置为: $DOCKER_HOST_GATEWAY" +export DOCKER_HOST_GATEWAY echo "===== [4/5] 启动并运行测试... =====" - # 检查从 Makefile 传来的 TARGET_URL 变量是否为空 if [ -n "$TARGET_URL" ]; then # --- [A] URL 模式 --- From 109fdd8136a5c3b10ac8b2662e3a7ace2b4da4a7 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Thu, 13 Nov 2025 21:13:14 +0800 Subject: [PATCH 20/25] fix --- playwright.config.ts | 13 +-- tests/e2e/docker-compose.test.yml | 9 +- tests/e2e/global-setup.ts | 115 +++++++++++++---------- tests/e2e/run-e2e-tests.sh | 57 +++++++---- tests/e2e/specs/devcontainer.test.e2e.ts | 47 +++++---- tests/e2e/specs/utils.e2e.test.ts | 48 ++++++++++ 6 files changed, 190 insertions(+), 99 deletions(-) create mode 100644 tests/e2e/specs/utils.e2e.test.ts diff --git a/playwright.config.ts b/playwright.config.ts index b56d2df9eb..3fed80c178 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -41,11 +41,12 @@ const config: PlaywrightTestConfig = { snapshotDir: 'playwright-report/test-snapshots/', }; -if (BASE_URL.includes('http://devstar:3000')) { - console.log(' 已启用安装'); - config.globalSetup = require.resolve('./global-setup.ts'); -} else { - console.log(` 已跳过 安装`); -} +const skipInstall = env.E2E_SKIP_INSTALL === 'true'; +if (skipInstall) { + console.log(`已跳过 global-setup.`); +} else { + console.log(`[Playwright Config] 探测结果: E2E_SKIP_INSTALL is not 'true'. 已启用 global-setup.`); + config.globalSetup = require.resolve('./global-setup.ts'); +} export default config satisfies PlaywrightTestConfig; diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index a79a2a5cda..4f2a428b8a 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -26,9 +26,12 @@ services: context: . # 等待 devstar 的 "healthcheck" 通过后,才启动 environment: - # 将 DevStar 的 URL 传给 Playwright - - DEVSTAR_URL=${DEVSTAR_URL:-http://devstar:3000} - - DOCKER_HOST_GATEWAY=${DOCKER_HOST_GATEWAY} + - DEVSTAR_URL=${DEVSTAR_URL} + - E2E_SKIP_INSTALL=${E2E_SKIP_INSTALL} + - E2E_USERNAME=${E2E_USERNAME} + - E2E_PASSWORD=${E2E_PASSWORD} + - E2E_ADMIN_ID=${E2E_ADMIN_ID} + - E2E_MODE=${E2E_MODE} volumes: # 也挂载 Docker Socket - /var/run/docker.sock:/var/run/docker.sock diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index 8b9e46b327..7bb126addb 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -1,59 +1,70 @@ - import { chromium, type FullConfig } from '@playwright/test';async function globalSetup(config: FullConfig) { - - const { baseURL } = config.projects[0].use; +import { chromium, type FullConfig } from '@playwright/test'; +import { env } from 'node:process'; +import { URL } from 'url'; +async function globalSetup(config: FullConfig) { + const mode = env.E2E_MODE; + const {baseURL} = config.projects[0].use; + const isInstalledMode=env.E2E_SKIP_INSTALL; + const DEFAULT_E2E_USER = 'testuser'; + const DEFAULT_E2E_PASS = '12345678'; if (!baseURL) { - - throw new Error('baseURL is not defined in playwright.config.ts'); - + throw new Error('[GlobalSetup] 致命错误: baseURL 或 storageState 未定义!'); } - const hostGateway = process.env.DOCKER_HOST_GATEWAY || '172.17.0.1'; - - const giteaBaseURL = `http://${hostGateway}:80`; - const serverDomain = hostGateway; const browser = await chromium.launch(); - const page = await browser.newPage(); - try { - await page.goto(baseURL!, { timeout: 15000 }); - - console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); - - await page.getByRole('textbox', { name: 'Server Domain *' }).click(); - await page.getByRole('textbox', { name: 'Server Domain *' }).fill(hostGateway); - await page.getByRole('textbox', { name: 'Gitea Base URL *' }).click(); - await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill(giteaBaseURL); - await page.getByText('Server and Third-Party Service Settings').click(); - await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); - await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); - await page.getByText('Administrator Account Settings').click(); - await page.getByRole('textbox', { name: 'Administrator Username' }).click(); - await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser'); - await page.getByRole('textbox', { name: 'Email Address' }).click(); - await page.getByRole('textbox', { name: 'Email Address' }).fill('ilovcatlyn750314@gmail.com'); - await page.getByRole('textbox', { name: 'Password', exact: true }).click(); - await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); - await page.getByRole('textbox', { name: 'Confirm Password' }).click(); - await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); - await page.getByRole('button', { name: 'Install Gitea'}).click(); // 'Install' (英文) 或 '安装' (中文) 都能匹配 - - // 4. 等待安装完成 - await page.waitForTimeout(240*1000); - console.log('[GlobalSetup] 安装成功!'); - } catch (error) { - - // 5. 截图并报错 - - console.error('[GlobalSetup] 自动化安装失败!'); - - await page.screenshot({ path: 'playwright-report/global-setup-failure.png' }); - - console.error('[GlobalSetup] 失败截图已保存到: ./reports/global-setup-failure.png'); - - throw new Error(`[GlobalSetup] 自动化安装失败。查看截图。 \n原始错误: ${error}`); - + if (mode === 'url') { + try { + const url1=env.DEVSTAR_URL; + const url2 = `http://${url1}`; + await page.goto(url2, { timeout: 15000 }); + console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); + // (你提供的所有 "testuser" 安装步骤...) + await page.getByText('Server and Third-Party Service Settings').click(); + await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); + await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); + await page.getByText('Administrator Account Settings').click(); + await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser'); + await page.getByRole('textbox', { name: 'Email Address' }).fill('ilovcatlyn750314@gmail.com'); + await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); + await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); + await page.getByRole('button', { name: 'Install Gitea'}).click(); + await page.waitForTimeout(90000); + } catch (error) { + console.error('[GlobalSetup] "URL 模式" 登录失败:', error); + await page.screenshot({ path: 'playwright-report/global-setup-login-failure.png' }); + throw error; + } + } else if (mode === 'compose') { + console.log('[GlobalSetup] 模式: 构建(Compose). 正在执行构建模式的安装脚本...'); + try { + const hostGateway = env.DOCKER_HOST_GATEWAY || '172.17.0.1'; + const giteaBaseURL = `http://${hostGateway}:80`; + const serverDomain = hostGateway; + const browser = await chromium.launch(); + await page.goto(baseURL, { timeout: 15000 }); + console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); + await page.getByRole('textbox', { name: 'Server Domain *' }).fill(serverDomain); + await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill(giteaBaseURL); + // (你提供的所有 "testuser" 安装步骤...) + await page.getByText('Server and Third-Party Service Settings').click(); + await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); + await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); + await page.getByText('Administrator Account Settings').click(); + await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser'); + await page.getByRole('textbox', { name: 'Email Address' }).fill('ilovcatlyn750314@gmail.com'); + await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); + await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); + await page.getByRole('button', { name: 'Install Gitea'}).click(); + await page.waitForTimeout(90000); + } catch (error) { + console.error('[GlobalSetup] "构建模式" 安装失败:', error); + await page.screenshot({ path: 'playwright-report/global-setup-failure.png' }); + throw error; + } + } else { + throw new Error(`[GlobalSetup] 未知的 E2E_MODE: "${mode}"`); } - await browser.close(); - -}export default globalSetup; +} +export default globalSetup; \ No newline at end of file diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index 1a01c7b7b1..f11aa2eb16 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -29,36 +29,52 @@ sudo chmod 666 /var/run/docker.sock echo "权限设置完成。" echo "" -echo "===== [3/5] 构建/拉取依赖镜像... =====" -#现在make devstar 处理镜像的构建 -docker pull mengning997/webterminal:latest -docker tag mengning997/webterminal:latest devstar.cn/devstar/webterminal:latest +if [ -z "$TARGET_URL" ]; then -echo "===== 现在检测Docker宿主机网关=====" -DOCKER_HOST_GATEWAY="172.17.0.1" -if [ "$OS_TYPE" = "Darwin" ]; then + echo "===== [3/5] 构建模式: 构建/拉取依赖镜像... =====" + #现在make devstar 处理镜像的构建 + docker pull mengning997/webterminal:latest + docker tag mengning997/webterminal:latest devstar.cn/devstar/webterminal:latest + + echo "===== 现在检测Docker宿主机网关=====" + DOCKER_HOST_GATEWAY="172.17.0.1" + if [ "$OS_TYPE" = "Darwin" ]; then DOCKER_HOST_GATEWAY="host.docker.internal" -elif [ "$OS_TYPE" = "Linux" ]; then + elif [ "$OS_TYPE" = "Linux" ]; then LINUX_IP=$(ip addr show docker0 | grep -Po 'inet \K[\d\.]+') - if [ -n "$LINUX_IP" ]; then - DOCKER_HOST_GATEWAY=$LINUX_IP - else + if [ -n "$LINUX_IP" ]; then + DOCKER_HOST_GATEWAY=$LINUX_IP + else echo "警告: 无法动态检测 'docker0' IP, 回退到 172.17.0.1" + fi fi + export DOCKER_HOST_GATEWAY +else + echo "===== [3/5] URL 模式: 跳过依赖镜像和网关检测。 =====" fi -echo "==> 宿主机网关被设置为: $DOCKER_HOST_GATEWAY" -export DOCKER_HOST_GATEWAY - echo "===== [4/5] 启动并运行测试... =====" # 检查从 Makefile 传来的 TARGET_URL 变量是否为空 if [ -n "$TARGET_URL" ]; then # --- [A] URL 模式 --- - echo "URL模式" - - # 1. 将目标 URL 导出为 DEVSTAR_URL, 供 docker-compose.yml 读取 + echo " 模式: [URL模式]. 目标: $TARGET_URL" export DEVSTAR_URL=$TARGET_URL - # 2. [关键] 只启动 test-runner 服务 - # 我们不需要 devstar, 也不需要 --abort-on-container-exit + export E2E_MODE="url" + echo " 正在检查安装状态..." + PATH_TO_CHECK="/user/login" + EXPECTED_CODE_IF_INSTALLED="200" + PROBE_URL="${TARGET_URL}${PATH_TO_CHECK}" + HTTP_CODE=$(curl -L -s -o /dev/null -w "%{http_code}" "$PROBE_URL") + + if [ "$HTTP_CODE" -eq "$EXPECTED_CODE_IF_INSTALLED" ]; then + echo " 探测结果: 目标已安装 (在 ${PROBE_URL} 收到 HTTP ${HTTP_CODE})." + export E2E_SKIP_INSTALL="true" + export E2E_USERNAME + export E2E_PASSWORD + export E2E_ADMIN_ID + else + echo "没有安装,下面执行安装脚本! " + export E2E_SKIP_INSTALL="false" + fi command docker compose \ -f tests/e2e/docker-compose.test.yml \ up \ @@ -71,6 +87,8 @@ else # 1. 导出内部 URL (这会成为 compose 里的默认值) export DEVSTAR_URL="http://devstar:3000" + export E2E_MODE="compose" + export E2E_SKIP_INSTALL="false" echo "即将执行: docker compose -f tests/e2e/docker-compose.test.yml up --build --wait --exit-code-from test-runner" # 2. [关键] 运行你原来的命令, 启动所有服务 command docker compose \ @@ -81,7 +99,6 @@ else --abort-on-container-exit \ --exit-code-from test-runner fi - # 捕获 test-runner 的退出码 EXIT_CODE=$? echo "" diff --git a/tests/e2e/specs/devcontainer.test.e2e.ts b/tests/e2e/specs/devcontainer.test.e2e.ts index 1095462619..6f6713c564 100644 --- a/tests/e2e/specs/devcontainer.test.e2e.ts +++ b/tests/e2e/specs/devcontainer.test.e2e.ts @@ -1,18 +1,28 @@ import { test, expect } from '@playwright/test'; import { link } from 'node:fs'; +import { env } from 'node:process'; +import { Login } from './utils.e2e.test'; -const GITEA_URL= `http://devstar:3000`; -const TEST_USER= `testuser`; -const TEST_PASS= `12345678`; -const TEST_ADMIN_USER_ID=`1`; -const repoName = `e2e-devcontainer-test`; +const isAlreadyInstalled = env.E2E_SKIP_INSTALL === 'true'; +const url1=env.DEVSTAR_URL; +const url2 = `http://${url1}`; +const GITEA_URL = (env.E2E_MODE === 'url') ? url2 : 'http://devstar:3000'; +const TEST_USER = isAlreadyInstalled ? env.E2E_USERNAME : 'testuser'; +const TEST_PASS = isAlreadyInstalled ? env.E2E_PASSWORD : '12345678'; +const TEST_ADMIN_USER_ID=isAlreadyInstalled?env.E2E_ADMIN_ID:'1'; +const repoName='e2e-test-repo'; +test.describe('devcontainer 相关测试',()=>{ +test.beforeEach(async ({ page }) => { + + await Login(page); + }); test('DevContainer 功能和配置', async ({ page,context }) => { - console.log("正在登陆"); - await page.goto(GITEA_URL + '/user/login'); - await page.fill('#user_name',TEST_USER); - await page.fill('#password', TEST_PASS); - await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(GITEA_URL + '/'); + //console.log("正在登陆"); + //await page.goto(GITEA_URL + '/user/login'); + //await page.fill('#user_name',TEST_USER); + //await page.fill('#password', TEST_PASS); + //await page.getByRole('button', { name: 'Sign In' }).click(); + //await expect(page).toHaveURL(GITEA_URL + '/'); console.log(`正在创建新仓库: ${repoName}`); await page.goto(GITEA_URL + '/repo/create'); @@ -137,13 +147,13 @@ test('DevContainer 功能和配置', async ({ page,context }) => { //console.log("test3检查通过"); }); test('权限修改相关', async ({ page }) => { - console.log("正在登陆"); - await page.goto(GITEA_URL + '/user/login'); - await page.fill('#user_name', TEST_USER); - await page.fill('#password', TEST_PASS); - await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(GITEA_URL + '/'); - console.log("登录成功! "); + //console.log("正在登陆"); + //await page.goto(GITEA_URL + '/user/login'); + //await page.fill('#user_name', TEST_USER); + //await page.fill('#password', TEST_PASS); + //await page.getByRole('button', { name: 'Sign In' }).click(); + //await expect(page).toHaveURL(GITEA_URL + '/'); + //console.log("登录成功! "); console.log('权限配置'); await page.goto(GITEA_URL+ '/-/admin/users/' + TEST_ADMIN_USER_ID + '/edit'); @@ -175,5 +185,6 @@ test('权限修改相关', async ({ page }) => { }); +}) diff --git a/tests/e2e/specs/utils.e2e.test.ts b/tests/e2e/specs/utils.e2e.test.ts new file mode 100644 index 0000000000..8b0e1c3158 --- /dev/null +++ b/tests/e2e/specs/utils.e2e.test.ts @@ -0,0 +1,48 @@ +import { type Page, expect } from '@playwright/test'; +import { env } from 'node:process'; + +const DEFAULT_E2E_USER = 'testuser'; +const DEFAULT_E2E_PASS = '12345678'; +const mode=env.E2E_MODE; + +export async function Login(page: Page) { + + const isInstalled = env.E2E_SKIP_INSTALL === 'true'; + + let username: string | undefined; + let password: string | undefined; +if(mode === 'url'){ + const url1=env.DEVSTAR_URL; + const url2 = `http://${url1}`; + if (isInstalled) { + // 【"已安装" 模式 + username = env.E2E_USERNAME || DEFAULT_E2E_USER; + password = env.E2E_PASSWORD || DEFAULT_E2E_PASS; + console.log(`"已安装"模式, 尝试用 ${username} 登录...`); + } else { + // 【"未安装" 模式】 + username = DEFAULT_E2E_USER; + password = DEFAULT_E2E_PASS; + console.log(`[LoginHelper] "刚安装"模式, 尝试用 ${username} 登录...`); + } + + // 4. (检查验证码和执行登录的逻辑) + await page.goto(url2 + '/user/login'); + const captchaInput = page.locator('input[name="captcha"]'); + if (await captchaInput.isVisible()) { + throw new Error('登录失败: 检测到验证码! 请禁用它。'); + } + await page.fill('#user_name',username); + await page.fill('#password', password); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(url2 + '/'); + console.log(`[LoginHelper] 登录成功!`); +} +else if(mode=='compose'){ + await page.fill('#user_name',username); + await page.fill('#password', password); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(env.DEVSTAR_URL+ '/'); + console.log(`[LoginHelper] 登录成功!`); +} +} \ No newline at end of file From 446e343eab457ae3ae801aa007d0e8a34d8e79ff Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 14 Nov 2025 09:25:43 +0800 Subject: [PATCH 21/25] fix --- playwright.config.ts | 2 +- tests/e2e/README.md | 100 ++---------------- ...r.test.e2e.ts => devcontainer.e2e.test.ts} | 12 ++- tests/e2e/specs/utils.e2e.test.ts | 48 --------- tests/e2e/specs/utils.e2e.ts | 76 +++++++++++++ 5 files changed, 91 insertions(+), 147 deletions(-) rename tests/e2e/specs/{devcontainer.test.e2e.ts => devcontainer.e2e.test.ts} (94%) delete mode 100644 tests/e2e/specs/utils.e2e.test.ts create mode 100644 tests/e2e/specs/utils.e2e.ts diff --git a/playwright.config.ts b/playwright.config.ts index 3fed80c178..8f3b1c0392 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -6,7 +6,7 @@ const BASE_URL = env.DEVSTAR_URL?.replace?.(/\/$/g, '') || 'http://localhost:300 const config: PlaywrightTestConfig = { testDir: './specs', - testMatch: /specs\/.*\.ts/, + testMatch: /specs\/.*\.test\.ts/, timeout: 500000, expect: { diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 85cdd596da..776bdc428a 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -1,95 +1,7 @@ -# End to end tests -使用PLAYWRIGHT测试框架执行test/e2e下的自动测试脚本 -1.执行make e2e-test执行自动化测试 +##E2E端到端测试流程 +1.运行E2E测试流程: +准备工作:make devstar 构建本地代码的devstar镜像,public/assets/install.sh start --image=devstar-studio:latest启动devstar容器 +请将devstar对应的url填写为TARGET_URL,执行make e2e-test TAGRET_URL="....",会自动化安装并测试,注意这里的url绝对不可以是localhost! +如果有已存在的实例需要测试,请额外在命令行输入E2E_USERNAME="my-admin" E2E_PASSWORD="my-pass" E2E_ADMIN_ID=""(后台管理可见,账号对应的id) make devstar TARGET_URL="...." - -E2e tests largely follow the same syntax as [integration tests](../integration). -Whereas integration tests are intended to mock and stress the back-end, server-side code, e2e tests the interface between front-end and back-end, as well as visual regressions with both assertions and visual comparisons. -They can be run with make commands for the appropriate backends, namely: -```shell -make test-sqlite -make test-pgsql -make test-mysql -make test-mssql -``` - -Make sure to perform a clean front-end build before running tests: -``` -make clean frontend -``` - -## Install playwright system dependencies -``` -npx playwright install-deps -``` - - -## Run all tests via local act_runner -``` -act_runner exec -W ./.github/workflows/pull-e2e-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest -``` - -## Run sqlite e2e tests -Start tests -``` -make test-e2e-sqlite -``` - -## Run MySQL e2e tests -Setup a MySQL database inside docker -``` -docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -p 3306:3306 --rm --name mysql mysql:latest #(just ctrl-c to stop db and clean the container) -docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --rm --name elasticsearch elasticsearch:7.6.0 #(in a second terminal, just ctrl-c to stop db and clean the container) -``` -Start tests based on the database container -``` -TEST_MYSQL_HOST=localhost:3306 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-e2e-mysql -``` - -## Run pgsql e2e tests -Setup a pgsql database inside docker -``` -docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:latest #(just ctrl-c to stop db and clean the container) -``` -Start tests based on the database container -``` -TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-e2e-pgsql -``` - -## Run mssql e2e tests -Setup a mssql database inside docker -``` -docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container) -``` -Start tests based on the database container -``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql -``` - -## Running individual tests - -Example command to run `example.test.e2e.ts` test file: - -_Note: unlike integration tests, this filtering is at the file level, not function_ - -For SQLite: - -``` -make test-e2e-sqlite#example -``` - -For other databases(replace `mssql` to `mysql` or `pgsql`): - -``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql#example -``` - -## Visual testing - -Although the main goal of e2e is assertion testing, we have added a framework for visual regress testing. If you are working on front-end features, please use the following: - - Check out `main`, `make clean frontend`, and run e2e tests with `VISUAL_TEST=1` to generate outputs. This will initially fail, as no screenshots exist. You can run the e2e tests again to assert it passes. - - Check out your branch, `make clean frontend`, and run e2e tests with `VISUAL_TEST=1`. You should be able to assert you front-end changes don't break any other tests unintentionally. - -VISUAL_TEST=1 will create screenshots in tests/e2e/test-snapshots. The test will fail the first time this is enabled (until we get visual test image persistence figured out), because it will be testing against an empty screenshot folder. - -ACCEPT_VISUAL=1 will overwrite the snapshot images with new images. +注意:make e2e-test命令会依赖make devstar创建容器,所以如果已经启动了devstar容器,请务必加上TARGET_URL参数 diff --git a/tests/e2e/specs/devcontainer.test.e2e.ts b/tests/e2e/specs/devcontainer.e2e.test.ts similarity index 94% rename from tests/e2e/specs/devcontainer.test.e2e.ts rename to tests/e2e/specs/devcontainer.e2e.test.ts index 6f6713c564..30459a38c7 100644 --- a/tests/e2e/specs/devcontainer.test.e2e.ts +++ b/tests/e2e/specs/devcontainer.e2e.test.ts @@ -1,15 +1,19 @@ import { test, expect } from '@playwright/test'; import { link } from 'node:fs'; import { env } from 'node:process'; -import { Login } from './utils.e2e.test'; +import { Login } from './utils.e2e'; + +const DEFAULT_E2E_USER = 'testuser'; +const DEFAULT_E2E_PASS = '12345678'; +const DEFAULT_ADMIN_ID = '1'; const isAlreadyInstalled = env.E2E_SKIP_INSTALL === 'true'; const url1=env.DEVSTAR_URL; const url2 = `http://${url1}`; const GITEA_URL = (env.E2E_MODE === 'url') ? url2 : 'http://devstar:3000'; -const TEST_USER = isAlreadyInstalled ? env.E2E_USERNAME : 'testuser'; -const TEST_PASS = isAlreadyInstalled ? env.E2E_PASSWORD : '12345678'; -const TEST_ADMIN_USER_ID=isAlreadyInstalled?env.E2E_ADMIN_ID:'1'; +const TEST_USER = isAlreadyInstalled ? (env.E2E_USERNAME || DEFAULT_E2E_USER) : DEFAULT_E2E_USER; +const TEST_PASS = isAlreadyInstalled ? (env.E2E_PASSWORD || DEFAULT_E2E_PASS) : DEFAULT_E2E_PASS; +const TEST_ADMIN_USER_ID = isAlreadyInstalled ? (env.E2E_ADMIN_ID || DEFAULT_ADMIN_ID) : DEFAULT_ADMIN_ID; const repoName='e2e-test-repo'; test.describe('devcontainer 相关测试',()=>{ test.beforeEach(async ({ page }) => { diff --git a/tests/e2e/specs/utils.e2e.test.ts b/tests/e2e/specs/utils.e2e.test.ts deleted file mode 100644 index 8b0e1c3158..0000000000 --- a/tests/e2e/specs/utils.e2e.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { type Page, expect } from '@playwright/test'; -import { env } from 'node:process'; - -const DEFAULT_E2E_USER = 'testuser'; -const DEFAULT_E2E_PASS = '12345678'; -const mode=env.E2E_MODE; - -export async function Login(page: Page) { - - const isInstalled = env.E2E_SKIP_INSTALL === 'true'; - - let username: string | undefined; - let password: string | undefined; -if(mode === 'url'){ - const url1=env.DEVSTAR_URL; - const url2 = `http://${url1}`; - if (isInstalled) { - // 【"已安装" 模式 - username = env.E2E_USERNAME || DEFAULT_E2E_USER; - password = env.E2E_PASSWORD || DEFAULT_E2E_PASS; - console.log(`"已安装"模式, 尝试用 ${username} 登录...`); - } else { - // 【"未安装" 模式】 - username = DEFAULT_E2E_USER; - password = DEFAULT_E2E_PASS; - console.log(`[LoginHelper] "刚安装"模式, 尝试用 ${username} 登录...`); - } - - // 4. (检查验证码和执行登录的逻辑) - await page.goto(url2 + '/user/login'); - const captchaInput = page.locator('input[name="captcha"]'); - if (await captchaInput.isVisible()) { - throw new Error('登录失败: 检测到验证码! 请禁用它。'); - } - await page.fill('#user_name',username); - await page.fill('#password', password); - await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(url2 + '/'); - console.log(`[LoginHelper] 登录成功!`); -} -else if(mode=='compose'){ - await page.fill('#user_name',username); - await page.fill('#password', password); - await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(env.DEVSTAR_URL+ '/'); - console.log(`[LoginHelper] 登录成功!`); -} -} \ No newline at end of file diff --git a/tests/e2e/specs/utils.e2e.ts b/tests/e2e/specs/utils.e2e.ts new file mode 100644 index 0000000000..73bbd667bb --- /dev/null +++ b/tests/e2e/specs/utils.e2e.ts @@ -0,0 +1,76 @@ +import { type Page, expect } from '@playwright/test'; +import { env } from 'node:process'; + +const DEFAULT_E2E_USER = 'testuser'; +const DEFAULT_E2E_PASS = '12345678'; +const mode=env.E2E_MODE; + +export async function Login(page: Page) { + +const isInstalled = env.E2E_SKIP_INSTALL === 'true'; + +let username: string | undefined; +let password: string | undefined; +let wasUsingDefault = false; +if(mode === 'url'){ + const url1=env.DEVSTAR_URL; + const url2 = `http://${url1}`; + if (isInstalled) { + // 【"已安装" 模式 + + username = env.E2E_USERNAME || DEFAULT_E2E_USER; + password = env.E2E_PASSWORD || DEFAULT_E2E_PASS; + if (!env.E2E_USERNAME) { + wasUsingDefault = true; + } + console.log(`"已安装"模式, 尝试用 ${username} 登录...`); + } else { + // 【"未安装" 模式】 + username = DEFAULT_E2E_USER; + password = DEFAULT_E2E_PASS; + wasUsingDefault=true; + console.log(` "刚安装"模式, 尝试用 ${username} 登录...`); + } + try { + await page.goto(url2 + '/user/login'); + const captchaInput = page.locator('input[name="captcha"]'); + if (await captchaInput.isVisible()) { + throw new Error('检测到验证码 (CAPTCHA)! E2E 测试无法继续。'); + } + await page.fill('#user_name',username); + await page.fill('#password', password); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(url2 + '/'); + console.log(`[LoginHelper] 用户 [${username}] 登录成功!`); + } catch (error) { + console.error(`[LoginHelper] 登录失败! 原始错误: ${error.message}`); + + let hint: string; + + if (error.message.includes('CAPTCHA')) { + // 提示 1: 验证码 + hint = `请禁用验证码!\n` ; + } else if (wasUsingDefault) { + // 提示 2: 你没输入, 且默认值失败了 + hint = `1. 登录失败, 且你没有提供 README.md 里描述的环境变量。\n` + + `2. 脚本自动尝试了默认用户 (${DEFAULT_E2E_USER}),但失败了。\n` + + `3. 请检查默认用户 (${DEFAULT_E2E_USER}) 在该目标上是否存在, 且密码是否正确。`; + + } else { + hint = `1. 登录失败, 你提供了 E2E_USERNAME (${username})。\n` + + `2. 请检查你传入的 E2E_USERNAME 和 E2E_PASSWORD 环境变量是否正确。`; + } + + throw new Error( + `[LoginHelper] 登录失败。\n\n${hint}\n` + ); + } +} +else if(mode=='compose'){ + await page.fill('#user_name',username); + await page.fill('#password', password); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(env.DEVSTAR_URL+ '/'); + console.log(`[LoginHelper] 登录成功!`); +} +} From 8d1f62028c06ec35a41345eb886299e3ceef4a98 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 14 Nov 2025 09:53:34 +0800 Subject: [PATCH 22/25] new readme --- tests/e2e/README.md | 19 ++++++++++++++----- tests/e2e/global-setup.ts | 3 +-- tests/e2e/specs/devcontainer.e2e.test.ts | 3 +-- tests/e2e/specs/utils.e2e.ts | 5 ++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 776bdc428a..6e9e3c3fe3 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -1,7 +1,16 @@ ##E2E端到端测试流程 -1.运行E2E测试流程: -准备工作:make devstar 构建本地代码的devstar镜像,public/assets/install.sh start --image=devstar-studio:latest启动devstar容器 -请将devstar对应的url填写为TARGET_URL,执行make e2e-test TAGRET_URL="....",会自动化安装并测试,注意这里的url绝对不可以是localhost! -如果有已存在的实例需要测试,请额外在命令行输入E2E_USERNAME="my-admin" E2E_PASSWORD="my-pass" E2E_ADMIN_ID=""(后台管理可见,账号对应的id) make devstar TARGET_URL="...." -注意:make e2e-test命令会依赖make devstar创建容器,所以如果已经启动了devstar容器,请务必加上TARGET_URL参数 +``` + +make devstar + +public/assets/install.sh start --image=devstar-studio:latest + +make e2e-test TAGRET_URL="..." # 使用默认账号testuser 密码12345678 + +E2E_USERNAME="your_name" E2E_PASSWORD="your_password" E2E_ADMIN_ID="your_id" make e2e-test TAGRET_URL="..." # 使用你的账号和密码,id是后台管理账号对应的id +`` + + +##注意:Url不可以是localhost,这样容器无法访问,也无法正常安装webterminal + diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index 7bb126addb..df8468078a 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -17,8 +17,7 @@ async function globalSetup(config: FullConfig) { if (mode === 'url') { try { const url1=env.DEVSTAR_URL; - const url2 = `http://${url1}`; - await page.goto(url2, { timeout: 15000 }); + await page.goto(url1, { timeout: 15000 }); console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); // (你提供的所有 "testuser" 安装步骤...) await page.getByText('Server and Third-Party Service Settings').click(); diff --git a/tests/e2e/specs/devcontainer.e2e.test.ts b/tests/e2e/specs/devcontainer.e2e.test.ts index 30459a38c7..3a50e1b744 100644 --- a/tests/e2e/specs/devcontainer.e2e.test.ts +++ b/tests/e2e/specs/devcontainer.e2e.test.ts @@ -9,8 +9,7 @@ const DEFAULT_E2E_PASS = '12345678'; const DEFAULT_ADMIN_ID = '1'; const isAlreadyInstalled = env.E2E_SKIP_INSTALL === 'true'; const url1=env.DEVSTAR_URL; -const url2 = `http://${url1}`; -const GITEA_URL = (env.E2E_MODE === 'url') ? url2 : 'http://devstar:3000'; +const GITEA_URL = (env.E2E_MODE === 'url') ? url1 : 'http://devstar:3000'; const TEST_USER = isAlreadyInstalled ? (env.E2E_USERNAME || DEFAULT_E2E_USER) : DEFAULT_E2E_USER; const TEST_PASS = isAlreadyInstalled ? (env.E2E_PASSWORD || DEFAULT_E2E_PASS) : DEFAULT_E2E_PASS; const TEST_ADMIN_USER_ID = isAlreadyInstalled ? (env.E2E_ADMIN_ID || DEFAULT_ADMIN_ID) : DEFAULT_ADMIN_ID; diff --git a/tests/e2e/specs/utils.e2e.ts b/tests/e2e/specs/utils.e2e.ts index 73bbd667bb..2f880cf539 100644 --- a/tests/e2e/specs/utils.e2e.ts +++ b/tests/e2e/specs/utils.e2e.ts @@ -14,7 +14,6 @@ let password: string | undefined; let wasUsingDefault = false; if(mode === 'url'){ const url1=env.DEVSTAR_URL; - const url2 = `http://${url1}`; if (isInstalled) { // 【"已安装" 模式 @@ -32,7 +31,7 @@ if(mode === 'url'){ console.log(` "刚安装"模式, 尝试用 ${username} 登录...`); } try { - await page.goto(url2 + '/user/login'); + await page.goto(url1 + '/user/login'); const captchaInput = page.locator('input[name="captcha"]'); if (await captchaInput.isVisible()) { throw new Error('检测到验证码 (CAPTCHA)! E2E 测试无法继续。'); @@ -40,7 +39,7 @@ if(mode === 'url'){ await page.fill('#user_name',username); await page.fill('#password', password); await page.getByRole('button', { name: 'Sign In' }).click(); - await expect(page).toHaveURL(url2 + '/'); + await expect(page).toHaveURL(url1+ '/'); console.log(`[LoginHelper] 用户 [${username}] 登录成功!`); } catch (error) { console.error(`[LoginHelper] 登录失败! 原始错误: ${error.message}`); From 5e2987d1358fcf67511cfa84739a642dc171cc62 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 14 Nov 2025 10:07:47 +0800 Subject: [PATCH 23/25] 1 --- tests/e2e/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 6e9e3c3fe3..4a8f19e4b6 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -12,5 +12,9 @@ E2E_USERNAME="your_name" E2E_PASSWORD="your_password" E2E_ADMIN_ID="your_id" mak `` -##注意:Url不可以是localhost,这样容器无法访问,也无法正常安装webterminal - +##注意:url不可以是localhost,这样容器无法访问,也无法正常安装webterminal +##说明:目前有两种测试的用法, + 主要的流程是通过make devstar 本地代码构建镜像,public/assets/install.sh start --image=devstar-studio:latest 通过install.sh脚本创建容器,并在make e2e-test TAGRET_URL="..."中输入devstar容器的url,如果首次安装会执行安装脚本,如果已经安装过,请输入你的账号,密码,id,否则按默认账号和密码登录。 + 单机部署CI使用make e2e-test,由脚本执行容器的创建,安装和测试,需要docker环境和项目代码。 + + From 7d06daf60663c083e5286dc9a8145be6d02d33e3 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Fri, 14 Nov 2025 16:30:29 +0800 Subject: [PATCH 24/25] last --- tests/e2e/README.md | 4 +- tests/e2e/global-setup.ts | 2 - tests/e2e/run-e2e-tests.sh | 7 +- tests/e2e/specs/devcontainer.e2e.test.ts | 125 ++++++++++------------- tests/e2e/specs/utils.e2e.ts | 4 +- 5 files changed, 63 insertions(+), 79 deletions(-) diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 4a8f19e4b6..75579183f8 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -14,7 +14,7 @@ E2E_USERNAME="your_name" E2E_PASSWORD="your_password" E2E_ADMIN_ID="your_id" mak ##注意:url不可以是localhost,这样容器无法访问,也无法正常安装webterminal ##说明:目前有两种测试的用法, - 主要的流程是通过make devstar 本地代码构建镜像,public/assets/install.sh start --image=devstar-studio:latest 通过install.sh脚本创建容器,并在make e2e-test TAGRET_URL="..."中输入devstar容器的url,如果首次安装会执行安装脚本,如果已经安装过,请输入你的账号,密码,id,否则按默认账号和密码登录。 - 单机部署CI使用make e2e-test,由脚本执行容器的创建,安装和测试,需要docker环境和项目代码。 +1.主要的流程是通过make devstar 本地代码构建镜像,public/assets/install.sh start --image=devstar-studio:latest 通过install.sh脚本创建容器,并在make e2e-test TAGRET_URL="..."中输入devstar容器的url,如果首次安装会执行安装脚本,如果已经安装过,请输入你的账号,密码,id,否则按默认账号和密码登录。 +2.单机CI使用make e2e-test,由脚本执行容器的创建,安装和测试,需要docker环境和项目代码。 diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index df8468078a..d994981ead 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -19,7 +19,6 @@ async function globalSetup(config: FullConfig) { const url1=env.DEVSTAR_URL; await page.goto(url1, { timeout: 15000 }); console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); - // (你提供的所有 "testuser" 安装步骤...) await page.getByText('Server and Third-Party Service Settings').click(); await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); @@ -46,7 +45,6 @@ async function globalSetup(config: FullConfig) { console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...'); await page.getByRole('textbox', { name: 'Server Domain *' }).fill(serverDomain); await page.getByRole('textbox', { name: 'Gitea Base URL *' }).fill(giteaBaseURL); - // (你提供的所有 "testuser" 安装步骤...) await page.getByText('Server and Third-Party Service Settings').click(); await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck(); await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck(); diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index f11aa2eb16..10822d6342 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -21,7 +21,7 @@ echo "清理完成。" echo "" echo "===== [2/5] 设置权限... =====" -# 容器内的用户(通常 UID 1000)需要写入数据目录 +# 容器内的用户需要写入数据目录 chmod -R 777 ./tests/e2e/test-data/devstar_data # 【关键】允许容器访问宿主机的 Docker Socket @@ -85,12 +85,12 @@ else # --- [B] 构建模式 --- echo "==> 模式: [构建模式]. 正在本地启动 devstar..." - # 1. 导出内部 URL (这会成为 compose 里的默认值) + # 1. 导出内部 URL export DEVSTAR_URL="http://devstar:3000" export E2E_MODE="compose" export E2E_SKIP_INSTALL="false" echo "即将执行: docker compose -f tests/e2e/docker-compose.test.yml up --build --wait --exit-code-from test-runner" - # 2. [关键] 运行你原来的命令, 启动所有服务 + # 2. 启动所有服务 command docker compose \ -f tests/e2e/docker-compose.test.yml \ -f tests/e2e/docker-compose.override.yml \ @@ -110,5 +110,4 @@ ls -l ./tests/e2e/reports/html echo "" # 以 test-runner 的退出码退出 -# 这将告诉 CI (或你自己) 测试是成功还是失败 exit $EXIT_CODE diff --git a/tests/e2e/specs/devcontainer.e2e.test.ts b/tests/e2e/specs/devcontainer.e2e.test.ts index 3a50e1b744..c419c868e1 100644 --- a/tests/e2e/specs/devcontainer.e2e.test.ts +++ b/tests/e2e/specs/devcontainer.e2e.test.ts @@ -20,12 +20,6 @@ test.beforeEach(async ({ page }) => { await Login(page); }); test('DevContainer 功能和配置', async ({ page,context }) => { - //console.log("正在登陆"); - //await page.goto(GITEA_URL + '/user/login'); - //await page.fill('#user_name',TEST_USER); - //await page.fill('#password', TEST_PASS); - //await page.getByRole('button', { name: 'Sign In' }).click(); - //await expect(page).toHaveURL(GITEA_URL + '/'); console.log(`正在创建新仓库: ${repoName}`); await page.goto(GITEA_URL + '/repo/create'); @@ -45,66 +39,66 @@ test('DevContainer 功能和配置', async ({ page,context }) => { console.log("模板已创建. 正在点击 'Edit' 按钮..."); await expect(page.getByText('devcontainer.json')).toBeVisible(); - //await page.getByRole('link', { name: 'Edit' }).click(); + await page.getByRole('link', { name: 'Edit' }).click(); await page.waitForTimeout(5000); - //console.log("已跳转到编辑器. 正在修改内容"); - //const newJsonAsObject = { - //"name": "Gitea DevContainer", - //"image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm", - //"features": { - //"ghcr.io/devcontainers/features/node:1": { - //"version": "lts" - //}, - // "ghcr.io/devcontainers/features/git-lfs:1.2.2": {}, - // "ghcr.io/devcontainers-extra/features/poetry:2": {}, - // "ghcr.io/devcontainers/features/python:1": { - // "version": "3.12" - // }, - //"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} - //}, - //"customizations": { - // "vscode": { - // "settings": {}, - // "extensions": [ - // "editorconfig.editorconfig", - // "dbaeumer.vscode-eslint", - // "golang.go", - // "stylelint.vscode-stylelint", - /// "DavidAnson.vscode-markdownlint", - // "Vue.volar", - // "ms-azuretools.vscode-docker", - //// "vitest.explorer", - // "cweijan.vscode-database-client2", - // "GitHub.vscode-pull-request-github", - // "Azurite.azurite" - //] - // } - //}, - //"portsAttributes": { - //"3000": { - // "label": "Gitea Web", - // "onAutoForward": "notify" - // } - // }, - //"postCreateCommand": "make deps" - // }; + console.log("已跳转到编辑器. 正在修改内容"); + const newJsonAsObject = { + "name": "Gitea DevContainer", + "image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "version": "lts" + }, + "ghcr.io/devcontainers/features/git-lfs:1.2.2": {}, + "ghcr.io/devcontainers-extra/features/poetry:2": {}, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.12" + }, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} + }, + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint", + "golang.go", + "stylelint.vscode-stylelint", + "DavidAnson.vscode-markdownlint", + "Vue.volar", + "ms-azuretools.vscode-docker", + "vitest.explorer", + "cweijan.vscode-database-client2", + "GitHub.vscode-pull-request-github", + "Azurite.azurite" + ] + } + }, + "portsAttributes": { + "3000": { + "label": "Gitea Web", + "onAutoForward": "notify" + } + }, + "postCreateCommand": "make deps" + }; - // 转换为JSON 字符串 - //const newJsonString = JSON.stringify(newJsonAsObject); + //转换为JSON 字符串 + const newJsonString = JSON.stringify(newJsonAsObject); // 设置焦点 - // await page.locator('.view-lines > div:nth-child(20)').click(); - // console.log("正在手动删除模板内容 "); - //for (let i = 0; i < 500; i++) { - // await page.keyboard.press('Backspace'); - // } - /// 粘贴字符串 - //console.log("正在粘贴JSON 内容..."); - // await page.keyboard.insertText(newJsonString); - //await page.getByRole('button', { name: 'Commit Changes' }).click(); - //console.log("devcontainer.json 修改并提交成功."); - //console.log("正在导航回 Dev Container 标签页进行验证..."); - //await page.getByRole('link', { name: 'Dev Container' }).click(); + await page.locator('.view-lines > div:nth-child(20)').click(); + console.log("正在手动删除模板内容 "); + for (let i = 0; i < 500; i++) { + await page.keyboard.press('Backspace'); + } + //粘贴字符串 + console.log("正在粘贴JSON 内容..."); + await page.keyboard.insertText(newJsonString); + await page.getByRole('button', { name: 'Commit Changes' }).click(); + console.log("devcontainer.json 修改并提交成功."); + console.log("正在导航回 Dev Container 标签页进行验证..."); + await page.getByRole('link', { name: 'Dev Container' }).click(); console.log("创建开发容器"); await page.getByRole('button', { name: 'Create Dev Container' }).click(); @@ -150,13 +144,6 @@ test('DevContainer 功能和配置', async ({ page,context }) => { //console.log("test3检查通过"); }); test('权限修改相关', async ({ page }) => { - //console.log("正在登陆"); - //await page.goto(GITEA_URL + '/user/login'); - //await page.fill('#user_name', TEST_USER); - //await page.fill('#password', TEST_PASS); - //await page.getByRole('button', { name: 'Sign In' }).click(); - //await expect(page).toHaveURL(GITEA_URL + '/'); - //console.log("登录成功! "); console.log('权限配置'); await page.goto(GITEA_URL+ '/-/admin/users/' + TEST_ADMIN_USER_ID + '/edit'); diff --git a/tests/e2e/specs/utils.e2e.ts b/tests/e2e/specs/utils.e2e.ts index 2f880cf539..1085eca328 100644 --- a/tests/e2e/specs/utils.e2e.ts +++ b/tests/e2e/specs/utils.e2e.ts @@ -15,7 +15,7 @@ let wasUsingDefault = false; if(mode === 'url'){ const url1=env.DEVSTAR_URL; if (isInstalled) { - // 【"已安装" 模式 + // "已安装" 模式 username = env.E2E_USERNAME || DEFAULT_E2E_USER; password = env.E2E_PASSWORD || DEFAULT_E2E_PASS; @@ -24,7 +24,7 @@ if(mode === 'url'){ } console.log(`"已安装"模式, 尝试用 ${username} 登录...`); } else { - // 【"未安装" 模式】 + // "未安装" 模式 username = DEFAULT_E2E_USER; password = DEFAULT_E2E_PASS; wasUsingDefault=true; From dfcf75d7d183182da6411dbcbbbf974d40759362 Mon Sep 17 00:00:00 2001 From: jiaojm <13763605353@163.com> Date: Sat, 15 Nov 2025 22:12:47 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86readme?= =?UTF-8?q?=EF=BC=8Cid=E7=9A=84=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=EF=BC=8CE2E=5FNAME=E7=9A=84=E5=91=BD=E4=BB=A4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E4=B8=80=E4=BA=9B=E6=BD=9C=E5=9C=A8=E7=9A=84?= =?UTF-8?q?sudo=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- tests/e2e/Dockerfile | 5 ++--- tests/e2e/README.md | 6 +++--- tests/e2e/docker-compose.test.yml | 2 +- tests/e2e/global-setup.ts | 1 + tests/e2e/run-e2e-tests.sh | 15 ++++++++++----- tests/e2e/specs/devcontainer.e2e.test.ts | 8 +++++++- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index fb9a53d859..6263144e5e 100644 --- a/Makefile +++ b/Makefile @@ -935,7 +935,7 @@ endif .PHONY: e2e-test e2e-test: $(E2E_DEPS) @echo "正在启动E2E-TEST..." - @TARGET_URL=$(TARGET_URL) ./tests/e2e/run-e2e-tests.sh + @TARGET_URL=$(TARGET_URL) E2E_USERNAME=$(E2E_USERNAME) E2E_PASSWORD=$(E2E_PASSWORD) ./tests/e2e/run-e2e-tests.sh # This endif closes the if at the top of the file diff --git a/tests/e2e/Dockerfile b/tests/e2e/Dockerfile index 5732261019..681f919230 100644 --- a/tests/e2e/Dockerfile +++ b/tests/e2e/Dockerfile @@ -1,6 +1,5 @@ # # 这是 "test-runner" 服务的 Dockerfile -# 它构建了一个包含所有浏览器和我们测试代码的镜像 # # 1. 使用微软官方的 Playwright 镜像 @@ -13,10 +12,10 @@ WORKDIR /app # 3. 复制 "依赖清单" 文件 COPY package*.json ./ -# 4. 安装我们的 npm 依赖 (即 @playwright/test) +# 4. 安装npm 依赖 (即 @playwright/test) RUN npm install -# 5. 复制我们所有的测试代码到容器中 +# 5. 复制所有的测试代码到容器中 # (包括 playwright.config.ts, global-setup.ts 和 specs/ 目录) COPY . . diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 75579183f8..00dcd11ea8 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -6,15 +6,15 @@ make devstar public/assets/install.sh start --image=devstar-studio:latest -make e2e-test TAGRET_URL="..." # 使用默认账号testuser 密码12345678 +make e2e-test TARGET_URL="..." # 使用默认账号testuser 密码12345678 -E2E_USERNAME="your_name" E2E_PASSWORD="your_password" E2E_ADMIN_ID="your_id" make e2e-test TAGRET_URL="..." # 使用你的账号和密码,id是后台管理账号对应的id +make e2e-test TARGET_URL="..." E2E_USERNAME="your_name" E2E_PASSWORD="your_password" # 使用你的账号和密码 `` ##注意:url不可以是localhost,这样容器无法访问,也无法正常安装webterminal ##说明:目前有两种测试的用法, -1.主要的流程是通过make devstar 本地代码构建镜像,public/assets/install.sh start --image=devstar-studio:latest 通过install.sh脚本创建容器,并在make e2e-test TAGRET_URL="..."中输入devstar容器的url,如果首次安装会执行安装脚本,如果已经安装过,请输入你的账号,密码,id,否则按默认账号和密码登录。 +1.主要的流程是通过make devstar 本地代码构建镜像,public/assets/install.sh start --image=devstar-studio:latest 通过install.sh脚本创建容器,并在make e2e-test TARGET_URL="..."中输入devstar容器的url,如果首次安装会执行安装脚本,如果已经安装过,请输入你的账号,密码,否则按默认账号和密码登录。 2.单机CI使用make e2e-test,由脚本执行容器的创建,安装和测试,需要docker环境和项目代码。 diff --git a/tests/e2e/docker-compose.test.yml b/tests/e2e/docker-compose.test.yml index 4f2a428b8a..1b5e851483 100644 --- a/tests/e2e/docker-compose.test.yml +++ b/tests/e2e/docker-compose.test.yml @@ -25,12 +25,12 @@ services: build: context: . # 等待 devstar 的 "healthcheck" 通过后,才启动 + user: "${CURRENT_UID}:${CURRENT_GID}" environment: - DEVSTAR_URL=${DEVSTAR_URL} - E2E_SKIP_INSTALL=${E2E_SKIP_INSTALL} - E2E_USERNAME=${E2E_USERNAME} - E2E_PASSWORD=${E2E_PASSWORD} - - E2E_ADMIN_ID=${E2E_ADMIN_ID} - E2E_MODE=${E2E_MODE} volumes: # 也挂载 Docker Socket diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index d994981ead..e144b1d154 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -54,6 +54,7 @@ async function globalSetup(config: FullConfig) { await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678'); await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678'); await page.getByRole('button', { name: 'Install Gitea'}).click(); + console.log("安装中,请耐心等待"); await page.waitForTimeout(90000); } catch (error) { console.error('[GlobalSetup] "构建模式" 安装失败:', error); diff --git a/tests/e2e/run-e2e-tests.sh b/tests/e2e/run-e2e-tests.sh index 10822d6342..c170eb2980 100755 --- a/tests/e2e/run-e2e-tests.sh +++ b/tests/e2e/run-e2e-tests.sh @@ -7,7 +7,8 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # PROJECT_ROOT=$( cd -- "$SCRIPT_DIR/../.." &> /dev/null && pwd ) - +export CURRENT_UID=$(id -u) +export CURRENT_GID=$(id -g) # cd "$PROJECT_ROOT" echo "===== [1/5] 清理旧的测试环境... =====" @@ -15,7 +16,7 @@ echo "===== [1/5] 清理旧的测试环境... =====" docker compose -f tests/e2e/docker-compose.test.yml down -v --remove-orphans docker image prune -f # 清理并重建报告和数据目录 -sudo rm -rf ./tests/e2e/reports ./tests/e2e/test-data +rm -rf ./tests/e2e/reports ./tests/e2e/test-data mkdir -p ./tests/e2e/reports/html ./tests/e2e/test-data/devstar_data echo "清理完成。" echo "" @@ -25,9 +26,13 @@ echo "===== [2/5] 设置权限... =====" chmod -R 777 ./tests/e2e/test-data/devstar_data # 【关键】允许容器访问宿主机的 Docker Socket -sudo chmod 666 /var/run/docker.sock -echo "权限设置完成。" -echo "" +if [ -z "$TARGET_URL" ]; then + sudo chmod 666 /var/run/docker.sock + echo "权限设置完成。" + echo "" +else + echo "跳过docker.sock权限修改 =====" +fi if [ -z "$TARGET_URL" ]; then diff --git a/tests/e2e/specs/devcontainer.e2e.test.ts b/tests/e2e/specs/devcontainer.e2e.test.ts index c419c868e1..ad909ae4fb 100644 --- a/tests/e2e/specs/devcontainer.e2e.test.ts +++ b/tests/e2e/specs/devcontainer.e2e.test.ts @@ -146,7 +146,13 @@ test('DevContainer 功能和配置', async ({ page,context }) => { test('权限修改相关', async ({ page }) => { console.log('权限配置'); - await page.goto(GITEA_URL+ '/-/admin/users/' + TEST_ADMIN_USER_ID + '/edit'); + await page.getByRole('link', { name: 'Site Administration' }).click(); + await page.getByText('Identity & Access').click(); + await page.getByRole('link', { name: 'User Accounts' }).click(); + await page.getByRole('row') + .filter({ hasText: TEST_USER }) + .getByRole('link', { name: 'Edit' }) + .click(); const devContainerCheckbox = page.getByLabel(/May Create Devcontainers/i); await devContainerCheckbox.uncheck(); await page.getByRole('button', { name: 'Update User Account' }).click();