From 43a54a64e32a0454e3fc01680dc1892a12233e5f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 18 Dec 2023 14:37:29 +0100 Subject: [PATCH 01/94] [FORGEJO] temporarily remove .github & .gitea --- .gitea/issue_template.md | 42 ---- .github/FUNDING.yml | 2 - .github/ISSUE_TEMPLATE/bug-report.yaml | 91 --------- .github/ISSUE_TEMPLATE/config.yml | 17 -- .github/ISSUE_TEMPLATE/feature-request.yaml | 24 --- .github/ISSUE_TEMPLATE/ui.bug-report.yaml | 66 ------ .github/actionlint.yaml | 5 - .github/labeler.yml | 36 ---- .github/pull_request_template.md | 9 - .github/workflows/cron-licenses.yml | 29 --- .github/workflows/cron-lock.yml | 22 -- .github/workflows/cron-translations.yml | 49 ----- .github/workflows/disk-clean.yml | 25 --- .github/workflows/files-changed.yml | 97 --------- .github/workflows/pull-compliance.yml | 182 ----------------- .github/workflows/pull-db-tests.yml | 215 -------------------- .github/workflows/pull-docker-dryrun.yml | 35 ---- .github/workflows/pull-e2e-tests.yml | 32 --- .github/workflows/pull-labeler.yml | 20 -- .github/workflows/release-nightly.yml | 134 ------------ .github/workflows/release-tag-rc.yml | 132 ------------ .github/workflows/release-tag-version.yml | 143 ------------- 22 files changed, 1407 deletions(-) delete mode 100644 .gitea/issue_template.md delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.yaml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature-request.yaml delete mode 100644 .github/ISSUE_TEMPLATE/ui.bug-report.yaml delete mode 100644 .github/actionlint.yaml delete mode 100644 .github/labeler.yml delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/cron-licenses.yml delete mode 100644 .github/workflows/cron-lock.yml delete mode 100644 .github/workflows/cron-translations.yml delete mode 100644 .github/workflows/disk-clean.yml delete mode 100644 .github/workflows/files-changed.yml delete mode 100644 .github/workflows/pull-compliance.yml delete mode 100644 .github/workflows/pull-db-tests.yml delete mode 100644 .github/workflows/pull-docker-dryrun.yml delete mode 100644 .github/workflows/pull-e2e-tests.yml delete mode 100644 .github/workflows/pull-labeler.yml delete mode 100644 .github/workflows/release-nightly.yml delete mode 100644 .github/workflows/release-tag-rc.yml delete mode 100644 .github/workflows/release-tag-version.yml diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md deleted file mode 100644 index 9ad186cca7..0000000000 --- a/.gitea/issue_template.md +++ /dev/null @@ -1,42 +0,0 @@ - - - - -- Gitea version (or commit ref): -- Git version: -- Operating system: - - - -- Database (use `[x]`): - - [ ] PostgreSQL - - [ ] MySQL - - [ ] MSSQL - - [ ] SQLite -- Can you reproduce the bug at https://try.gitea.io: - - [ ] Yes (provide example URL) - - [ ] No -- Log gist: - - - - -## Description - - -... - - -## Screenshots - - diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 624a2d97db..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -open_collective: gitea -custom: https://www.bountysource.com/teams/gitea diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml deleted file mode 100644 index 94c1bd0ab7..0000000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ /dev/null @@ -1,91 +0,0 @@ -name: Bug Report -description: Found something you weren't expecting? Report it here! -labels: ["type/bug"] -body: - - type: markdown - attributes: - value: | - NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue. - - type: markdown - attributes: - value: | - 1. Please speak English, this is the language all maintainers can speak and write. - 2. Please ask questions or configuration/deploy problems on our Discord - server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). - 3. Make sure you are using the latest release and - take a moment to check that your issue hasn't been reported before. - 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq) - 5. It's really important to provide pertinent details and logs (https://docs.gitea.com/help/support), - incomplete details will be handled as an invalid report. - - type: textarea - id: description - attributes: - label: Description - description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below) - If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services. - - type: input - id: gitea-ver - attributes: - label: Gitea Version - description: Gitea version (or commit reference) of your instance - validations: - required: true - - type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on the Gitea demo site? - description: | - If so, please provide a URL in the Description field - URL of Gitea demo: https://try.gitea.io - options: - - "Yes" - - "No" - validations: - required: true - - type: markdown - attributes: - value: | - It's really important to provide pertinent logs - Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help - In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini - - type: input - id: logs - attributes: - label: Log Gist - description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden - - type: textarea - id: screenshots - attributes: - label: Screenshots - description: If this issue involves the Web Interface, please provide one or more screenshots - - type: input - id: git-ver - attributes: - label: Git Version - description: The version of git running on the server - - type: input - id: os-ver - attributes: - label: Operating System - description: The operating system you are using to run Gitea - - type: textarea - id: run-info - attributes: - label: How are you running Gitea? - description: | - Please include information on whether you built Gitea yourself, used one of our downloads, are using https://try.gitea.io or are using some other package - Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc. - If you are using a package or systemd tell us what distribution you are using - validations: - required: true - - type: dropdown - id: database - attributes: - label: Database - description: What database system are you running? - options: - - PostgreSQL - - MySQL/MariaDB - - MSSQL - - SQLite diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index e769873f47..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Security Concern - url: https://tinyurl.com/security-gitea - about: For security concerns, please send a mail to security@gitea.io instead of opening a public issue. - - name: Discord Server - url: https://discord.gg/Gitea - about: Please ask questions and discuss configuration or deployment problems here. - - name: Discourse Forum - url: https://discourse.gitea.io - about: Questions and configuration or deployment problems can also be discussed on our forum. - - name: Frequently Asked Questions - url: https://docs.gitea.com/help/faq - about: Please check if your question isn't mentioned here. - - name: Crowdin Translations - url: https://crowdin.com/project/gitea - about: Translations are managed here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml deleted file mode 100644 index 3c9953019d..0000000000 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Feature Request -description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here! -labels: ["type/proposal"] -body: - - type: markdown - attributes: - value: | - 1. Please speak English, this is the language all maintainers can speak and write. - 2. Please ask questions or configuration/deploy problems on our Discord - server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). - 3. Please take a moment to check that your feature hasn't already been suggested. - - type: textarea - id: description - attributes: - label: Feature Description - placeholder: | - I think it would be great if Gitea had... - validations: - required: true - - type: textarea - id: screenshots - attributes: - label: Screenshots - description: If you can, provide screenshots of an implementation on another site e.g. GitHub diff --git a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml deleted file mode 100644 index 387aee897b..0000000000 --- a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: Web Interface Bug Report -description: Something doesn't look quite as it should? Report it here! -labels: ["type/bug", "topic/ui"] -body: - - type: markdown - attributes: - value: | - NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue. - - type: markdown - attributes: - value: | - 1. Please speak English, this is the language all maintainers can speak and write. - 2. Please ask questions or configuration/deploy problems on our Discord - server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). - 3. Please take a moment to check that your issue doesn't already exist. - 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq) - 5. Please give all relevant information below for bug reports, because - incomplete details will be handled as an invalid report. - 6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript - error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us - DEBUG level logs. (See https://docs.gitea.com/administration/logging-config#collecting-logs-for-help) - - type: textarea - id: description - attributes: - label: Description - description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below) - If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. - - type: textarea - id: screenshots - attributes: - label: Screenshots - description: Please provide at least 1 screenshot showing the issue. - validations: - required: true - - type: input - id: gitea-ver - attributes: - label: Gitea Version - description: Gitea version (or commit reference) your instance is running - validations: - required: true - - type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on the Gitea demo site? - description: | - If so, please provide a URL in the Description field - URL of Gitea demo: https://try.gitea.io - options: - - "Yes" - - "No" - validations: - required: true - - type: input - id: os-ver - attributes: - label: Operating System - description: The operating system you are using to access Gitea - - type: input - id: browser-ver - attributes: - label: Browser Version - description: The browser and version that you are using to access Gitea - validations: - required: true diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml deleted file mode 100644 index 023fb05a29..0000000000 --- a/.github/actionlint.yaml +++ /dev/null @@ -1,5 +0,0 @@ -self-hosted-runner: - labels: - - actuated-4cpu-8gb - - actuated-4cpu-16gb - - nscloud diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 8a5ab26975..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,36 +0,0 @@ -modifies/docs: - - "**/*.md" - - "docs/**" - -modifies/frontend: - - "web_src/**/*" - -modifies/templates: - - all: ["templates/**", "!templates/swagger/v1_json.tmpl"] - -modifies/api: - - "routers/api/**" - - "templates/swagger/v1_json.tmpl" - -modifies/cli: - - "cmd/**" - -modifies/translation: - - "options/locale/*.ini" - -modifies/migrations: - - "models/migrations/**/*" - -modifies/internal: - - "Makefile" - - "Dockerfile" - - "Dockerfile.rootless" - - "docker/**" - - "webpack.config.js" - - ".eslintrc.yaml" - - ".golangci.yml" - - ".markdownlint.yaml" - - ".spectral.yaml" - - ".stylelintrc.yaml" - - ".yamllint.yaml" - - ".github/**" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index b752abb794..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,9 +0,0 @@ - -Please check the following: -1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports. -2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md . -3. Describe what your pull request does and which issue you're targeting (if any). -4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily. -5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`. -6. Delete all these tips before posting. - diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml deleted file mode 100644 index cd8386ecc5..0000000000 --- a/.github/workflows/cron-licenses.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: cron-licenses - -on: - schedule: - - cron: "7 0 * * 1" # every Monday at 00:07 UTC - workflow_dispatch: - -jobs: - cron-licenses: - runs-on: ubuntu-latest - if: github.repository == 'go-gitea/gitea' - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make generate-license generate-gitignore - timeout-minutes: 40 - - name: push translations to repo - uses: appleboy/git-push-action@v0.0.3 - with: - author_email: "teabot@gitea.io" - author_name: GiteaBot - branch: main - commit: true - commit_message: "[skip ci] Updated licenses and gitignores" - remote: "git@github.com:go-gitea/gitea.git" - ssh_key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/cron-lock.yml b/.github/workflows/cron-lock.yml deleted file mode 100644 index 746ec49bc6..0000000000 --- a/.github/workflows/cron-lock.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: cron-lock - -on: - schedule: - - cron: "0 0 * * *" # every day at 00:00 UTC - workflow_dispatch: - -permissions: - issues: write - pull-requests: write - -concurrency: - group: lock - -jobs: - action: - runs-on: ubuntu-latest - if: github.repository == 'go-gitea/gitea' - steps: - - uses: dessant/lock-threads@v5 - with: - issue-inactive-days: 45 diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml deleted file mode 100644 index 390aae7c07..0000000000 --- a/.github/workflows/cron-translations.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: cron-translations - -on: - schedule: - - cron: "7 0 * * *" # every day at 00:07 UTC - workflow_dispatch: - -jobs: - crowdin-pull: - runs-on: ubuntu-latest - if: github.repository == 'go-gitea/gitea' - steps: - - uses: actions/checkout@v4 - - name: download from crowdin - uses: docker://jonasfranz/crowdin - env: - CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} - PLUGIN_DOWNLOAD: true - PLUGIN_EXPORT_DIR: options/locale/ - PLUGIN_IGNORE_BRANCH: true - PLUGIN_PROJECT_IDENTIFIER: gitea - - name: update locales - run: ./build/update-locales.sh - - name: push translations to repo - uses: appleboy/git-push-action@v0.0.3 - with: - author_email: "teabot@gitea.io" - author_name: GiteaBot - branch: main - commit: true - commit_message: "[skip ci] Updated translations via Crowdin" - remote: "git@github.com:go-gitea/gitea.git" - ssh_key: ${{ secrets.DEPLOY_KEY }} - crowdin-push: - runs-on: ubuntu-latest - if: github.repository == 'go-gitea/gitea' - steps: - - uses: actions/checkout@v4 - - name: push translations to crowdin - uses: docker://jonasfranz/crowdin - env: - CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} - PLUGIN_UPLOAD: true - PLUGIN_EXPORT_DIR: options/locale/ - PLUGIN_IGNORE_BRANCH: true - PLUGIN_PROJECT_IDENTIFIER: gitea - PLUGIN_FILES: | - locale_en-US.ini: options/locale/locale_en-US.ini - PLUGIN_BRANCH: main diff --git a/.github/workflows/disk-clean.yml b/.github/workflows/disk-clean.yml deleted file mode 100644 index 8abe8891c7..0000000000 --- a/.github/workflows/disk-clean.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: disk-clean - -on: - workflow_call: - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: false - swap-storage: true diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml deleted file mode 100644 index e7039053af..0000000000 --- a/.github/workflows/files-changed.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: files-changed - -on: - workflow_call: - outputs: - backend: - value: ${{ jobs.detect.outputs.backend }} - frontend: - value: ${{ jobs.detect.outputs.frontend }} - docs: - value: ${{ jobs.detect.outputs.docs }} - actions: - value: ${{ jobs.detect.outputs.actions }} - templates: - value: ${{ jobs.detect.outputs.templates }} - docker: - value: ${{ jobs.detect.outputs.docker }} - swagger: - value: ${{ jobs.detect.outputs.swagger }} - yaml: - value: ${{ jobs.detect.outputs.yaml }} - -jobs: - detect: - runs-on: ubuntu-latest - timeout-minutes: 3 - outputs: - backend: ${{ steps.changes.outputs.backend }} - frontend: ${{ steps.changes.outputs.frontend }} - docs: ${{ steps.changes.outputs.docs }} - actions: ${{ steps.changes.outputs.actions }} - templates: ${{ steps.changes.outputs.templates }} - docker: ${{ steps.changes.outputs.docker }} - swagger: ${{ steps.changes.outputs.swagger }} - yaml: ${{ steps.changes.outputs.yaml }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v2 - id: changes - with: - filters: | - backend: - - "**/*.go" - - "templates/**/*.tmpl" - - "assets/emoji.json" - - "go.mod" - - "go.sum" - - "Makefile" - - ".golangci.yml" - - ".editorconfig" - - frontend: - - "**/*.js" - - "web_src/**" - - "assets/emoji.json" - - "package.json" - - "package-lock.json" - - "Makefile" - - ".eslintrc.yaml" - - ".stylelintrc.yaml" - - ".npmrc" - - docs: - - "**/*.md" - - "docs/**" - - ".markdownlint.yaml" - - "package.json" - - "package-lock.json" - - actions: - - ".github/workflows/*" - - "Makefile" - - templates: - - "templates/**/*.tmpl" - - "pyproject.toml" - - "poetry.lock" - - docker: - - "Dockerfile" - - "Dockerfile.rootless" - - "docker/**" - - "Makefile" - - swagger: - - "templates/swagger/v1_json.tmpl" - - "Makefile" - - "package.json" - - "package-lock.json" - - ".spectral.yaml" - - yaml: - - "**/*.yml" - - "**/*.yaml" - - ".yamllint.yaml" - - "pyproject.toml" - - "poetry.lock" diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml deleted file mode 100644 index 0472d9a9f0..0000000000 --- a/.github/workflows/pull-compliance.yml +++ /dev/null @@ -1,182 +0,0 @@ -name: compliance - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - lint-backend: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make deps-backend deps-tools - - run: make lint-backend - env: - TAGS: bindata sqlite sqlite_unlock_notify - - lint-templates: - if: needs.files-changed.outputs.templates == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - run: pip install poetry - - run: make deps-py - - run: make lint-templates - - lint-yaml: - if: needs.files-changed.outputs.yaml == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - run: pip install poetry - - run: make deps-py - - run: make lint-yaml - - lint-swagger: - if: needs.files-changed.outputs.swagger == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend - - run: make lint-swagger - - lint-go-windows: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make deps-backend deps-tools - - run: make lint-go-windows lint-go-vet - env: - TAGS: bindata sqlite sqlite_unlock_notify - GOOS: windows - GOARCH: amd64 - - lint-go-gogit: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make deps-backend deps-tools - - run: make lint-go - env: - TAGS: bindata gogit sqlite sqlite_unlock_notify - - checks-backend: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make deps-backend deps-tools - - run: make --always-make checks-backend # ensure the "go-licenses" make target runs - - frontend: - if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend - - run: make lint-frontend - - run: make checks-frontend - - run: make test-frontend - - run: make frontend - - backend: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - # no frontend build here as backend should be able to build - # even without any frontend files - - run: make deps-backend - - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag - - name: build-backend-arm64 - run: make backend # test cross compile - env: - GOOS: linux - GOARCH: arm64 - TAGS: bindata gogit - - name: build-backend-windows - run: go build -o gitea_windows - env: - GOOS: windows - GOARCH: amd64 - TAGS: bindata gogit - - name: build-backend-386 - run: go build -o gitea_linux_386 # test if compatible with 32 bit - env: - GOOS: linux - GOARCH: 386 - - docs: - if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend - - run: make lint-md - - run: make docs - - actions: - if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make lint-actions diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml deleted file mode 100644 index a3886bf618..0000000000 --- a/.github/workflows/pull-db-tests.yml +++ /dev/null @@ -1,215 +0,0 @@ -name: db-tests - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - test-pgsql: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - services: - pgsql: - image: postgres:12 - env: - POSTGRES_DB: test - POSTGRES_PASSWORD: postgres - ports: - - "5432:5432" - ldap: - image: gitea/test-openldap:latest - ports: - - "389:389" - - "636:636" - minio: - # as github actions doesn't support "entrypoint", we need to use a non-official image - # that has a custom entrypoint set to "minio server /data" - image: bitnami/minio:2023.8.31 - env: - MINIO_ROOT_USER: 123456 - MINIO_ROOT_PASSWORD: 12345678 - ports: - - "9000:9000" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - name: Add hosts to /etc/hosts - run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts' - - run: make deps-backend - - run: make backend - env: - TAGS: bindata - - run: make test-pgsql-migration test-pgsql - timeout-minutes: 50 - env: - TAGS: bindata gogit - RACE_ENABLED: true - TEST_TAGS: gogit - TEST_LDAP: 1 - USE_REPO_TEST_DIR: 1 - - test-sqlite: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - run: make deps-backend - - run: make backend - env: - TAGS: bindata gogit sqlite sqlite_unlock_notify - - run: make test-sqlite-migration test-sqlite - timeout-minutes: 50 - env: - TAGS: bindata gogit sqlite sqlite_unlock_notify - RACE_ENABLED: true - TEST_TAGS: gogit sqlite sqlite_unlock_notify - USE_REPO_TEST_DIR: 1 - - test-unit: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - services: - elasticsearch: - image: elasticsearch:7.5.0 - env: - discovery.type: single-node - ports: - - "9200:9200" - meilisearch: - image: getmeili/meilisearch:v1.2.0 - env: - MEILI_ENV: development # disable auth - ports: - - "7700:7700" - redis: - image: redis - options: >- # wait until redis has started - --health-cmd "redis-cli ping" - --health-interval 5s - --health-timeout 3s - --health-retries 10 - ports: - - 6379:6379 - minio: - image: bitnami/minio:2021.3.17 - env: - MINIO_ACCESS_KEY: 123456 - MINIO_SECRET_KEY: 12345678 - ports: - - "9000:9000" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - name: Add hosts to /etc/hosts - run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts' - - run: make deps-backend - - run: make backend - env: - TAGS: bindata - - name: unit-tests - run: make unit-test-coverage test-check - env: - TAGS: bindata - RACE_ENABLED: true - GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} - - name: unit-tests-gogit - run: make unit-test-coverage test-check - env: - TAGS: bindata gogit - RACE_ENABLED: true - GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} - - test-mysql: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_DATABASE: testgitea - ports: - - "3306:3306" - elasticsearch: - image: elasticsearch:7.5.0 - env: - discovery.type: single-node - ports: - - "9200:9200" - smtpimap: - image: tabascoterrier/docker-imap-devel:latest - ports: - - "25:25" - - "143:143" - - "587:587" - - "993:993" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - name: Add hosts to /etc/hosts - run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts' - - run: make deps-backend - - run: make backend - env: - TAGS: bindata - - name: run tests - run: make test-mysql-migration integration-test-coverage - env: - TAGS: bindata - RACE_ENABLED: true - USE_REPO_TEST_DIR: 1 - TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" - - test-mssql: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - services: - mssql: - image: mcr.microsoft.com/mssql/server:2017-latest - env: - ACCEPT_EULA: Y - MSSQL_PID: Standard - SA_PASSWORD: MwantsaSecurePassword1 - ports: - - "1433:1433" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - name: Add hosts to /etc/hosts - run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts' - - run: make deps-backend - - run: make backend - env: - TAGS: bindata - - run: make test-mssql-migration test-mssql - timeout-minutes: 50 - env: - TAGS: bindata - USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/pull-docker-dryrun.yml b/.github/workflows/pull-docker-dryrun.yml deleted file mode 100644 index f74277de67..0000000000 --- a/.github/workflows/pull-docker-dryrun.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: docker-dryrun - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - regular: - if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/build-push-action@v5 - with: - push: false - tags: gitea/gitea:linux-amd64 - - rootless: - if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/build-push-action@v5 - with: - push: false - file: Dockerfile.rootless - tags: gitea/gitea:linux-amd64 diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml deleted file mode 100644 index 5a249db9f8..0000000000 --- a/.github/workflows/pull-e2e-tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: e2e-tests - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - test-e2e: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend frontend deps-backend - - run: npx playwright install --with-deps - - run: make test-e2e-sqlite - timeout-minutes: 40 - env: - USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/pull-labeler.yml b/.github/workflows/pull-labeler.yml deleted file mode 100644 index edd2f6d16e..0000000000 --- a/.github/workflows/pull-labeler.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: labeler - -on: - pull_request_target: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - label: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/labeler@v4 - with: - dot: true diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml deleted file mode 100644 index 80e6683919..0000000000 --- a/.github/workflows/release-nightly.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: release-nightly - -on: - push: - branches: [main, release/v*] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - disk-clean: - uses: ./.github/workflows/disk-clean.yml - nightly-binary: - runs-on: nscloud - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend deps-backend - # xgo build - - run: make release - env: - TAGS: bindata sqlite sqlite_unlock_notify - - name: import gpg key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPGSIGN_KEY }} - passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} - - name: sign binaries - run: | - for f in dist/release/*; do - echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" - done - # clean branch name to get the folder name in S3 - - name: Get cleaned branch name - id: clean_name - run: | - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') - echo "Cleaned name is ${REF_NAME}" - echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" - - name: configure aws - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ secrets.AWS_REGION }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: upload binaries to s3 - run: | - aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress - nightly-docker-rootful: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - name: Get cleaned branch name - id: clean_name - run: | - # if main then say nightly otherwise cleanup name - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - echo "branch=nightly" >> "$GITHUB_OUTPUT" - exit 0 - fi - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') - echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT" - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: fetch go modules - run: make vendor - - name: build rootful docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: gitea/gitea:${{ steps.clean_name.outputs.branch }} - nightly-docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - name: Get cleaned branch name - id: clean_name - run: | - # if main then say nightly otherwise cleanup name - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - echo "branch=nightly" >> "$GITHUB_OUTPUT" - exit 0 - fi - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') - echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT" - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: fetch go modules - run: make vendor - - name: build rootless docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - file: Dockerfile.rootless - tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless diff --git a/.github/workflows/release-tag-rc.yml b/.github/workflows/release-tag-rc.yml deleted file mode 100644 index 12d1e1e4be..0000000000 --- a/.github/workflows/release-tag-rc.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: release-tag-rc - -on: - push: - tags: - - "v1*-rc*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false - -jobs: - binary: - runs-on: nscloud - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend deps-backend - # xgo build - - run: make release - env: - TAGS: bindata sqlite sqlite_unlock_notify - - name: import gpg key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPGSIGN_KEY }} - passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} - - name: sign binaries - run: | - for f in dist/release/*; do - echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" - done - # clean branch name to get the folder name in S3 - - name: Get cleaned branch name - id: clean_name - run: | - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//') - echo "Cleaned name is ${REF_NAME}" - echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" - - name: configure aws - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ secrets.AWS_REGION }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: upload binaries to s3 - run: | - aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress - - name: Install GH CLI - uses: dev-hanz-ops/install-gh-cli-action@v0.1.0 - with: - gh-cli-version: 2.39.1 - - name: create github release - run: | - gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - docker-rootful: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/metadata-action@v5 - id: meta - with: - images: gitea/gitea - flavor: | - latest=false - # 1.2.3-rc0 - tags: | - type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootful docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/metadata-action@v5 - id: meta - with: - images: gitea/gitea - # each tag below will have the suffix of -rootless - flavor: | - latest=false - suffix=-rootless - # 1.2.3-rc0 - tags: | - type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootless docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - file: Dockerfile.rootless - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release-tag-version.yml b/.github/workflows/release-tag-version.yml deleted file mode 100644 index e0e93633e8..0000000000 --- a/.github/workflows/release-tag-version.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: release-tag-version - -on: - push: - tags: - - "v1.*" - - "!v1*-rc*" - - "!v1*-dev" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false - -jobs: - binary: - runs-on: nscloud - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: make deps-frontend deps-backend - # xgo build - - run: make release - env: - TAGS: bindata sqlite sqlite_unlock_notify - - name: import gpg key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPGSIGN_KEY }} - passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} - - name: sign binaries - run: | - for f in dist/release/*; do - echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" - done - # clean branch name to get the folder name in S3 - - name: Get cleaned branch name - id: clean_name - run: | - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//') - echo "Cleaned name is ${REF_NAME}" - echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" - - name: configure aws - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ secrets.AWS_REGION }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: upload binaries to s3 - run: | - aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress - - name: Install GH CLI - uses: dev-hanz-ops/install-gh-cli-action@v0.1.0 - with: - gh-cli-version: 2.39.1 - - name: create github release - run: | - gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-from-tag dist/release/* - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - docker-rootful: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/metadata-action@v5 - id: meta - with: - images: gitea/gitea - # this will generate tags in the following format: - # latest - # 1 - # 1.2 - # 1.2.3 - tags: | - type=semver,pattern={{major}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootful docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/metadata-action@v5 - id: meta - with: - images: gitea/gitea - # each tag below will have the suffix of -rootless - flavor: | - suffix=-rootless,onlatest=true - # this will generate tags in the following format (with -rootless suffix added): - # latest - # 1 - # 1.2 - # 1.2.3 - tags: | - type=semver,pattern={{major}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootless docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - file: Dockerfile.rootless - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} From 08da63cc4daacabf53ed18f4e521375b49bea8fe Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 3 Jul 2023 09:45:12 +0200 Subject: [PATCH 02/94] [CI] DEFAULT_ACTIONS_URL = https://code.forgejo.org [CI] Revert "Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581)" This reverts commit 67bd9d4f1eedb4728031504d0dd09d014c0f3e6f. (cherry picked from commit 0547e94023a545fafe82e280dd809e7efd6d86e2) (cherry picked from commit d21ad654ad0abc243913532326e916899b0e387c) (cherry picked from commit b905e9d8386c58206234a417769cc17b3be34b62) (cherry picked from commit 251a5bf235b1723bc2bc324f9e8c03a8668bb5ae) (cherry picked from commit b370e4769423bec92b0f265f3e3b2b683640024d) (cherry picked from commit 2cc28d078507027749c14a5448e949ab54b79c66) (cherry picked from commit ed870a39e98fbb69c435a3a3ef0434fe6163ebe7) (cherry picked from commit 7bb0c4654ecbbd2feee2c74034c1e2cdca0d6828) (cherry picked from commit bab1f552c385e3c7d0faa33d28fb8087780ea834) Conflicts: custom/conf/app.example.ini modules/setting/actions.go https://codeberg.org/forgejo/forgejo/pulls/1413 [CI] DEFAULT_ACTIONS_URL = https://codeberg.org (cherry picked from commit 52b364ddbd9ac82b9e6f9c1767db2d6b36165011) (cherry picked from commit 99887cd5673f6da49664b590ad60c83fdbe25a4a) (cherry picked from commit cd5788782aa5c2ee8baecd57ca1e7882f0854453) (cherry picked from commit 71c698a704d307c568f247710550d48f27cca4ce) (cherry picked from commit 71386241dd741a4fa0b67d59a07d84ac31e0b870) (cherry picked from commit b7ab05aeac12c44acd117d5a4e8d7b4da2ba4aa7) (cherry picked from commit e78b9ca59c0af867f94d9c9bfae48f8cc9381224) (cherry picked from commit edb3adf4606af94ed0ab0bd844ef626a39a99297) (cherry picked from commit 3e400881975340be9148c4549a744395a6dac665) [BRANDING] DEFAULT_ACTIONS_URL = https://code.forgejo.org (cherry picked from commit d0e4512c902dec669da36a055a2ea54adb107e0f) (cherry picked from commit 8ba6e047095e9ecb107d77361664fa83b03ddaa2) (cherry picked from commit 63490810449b4189ed8538a22182fde1bc89c057) (cherry picked from commit e06bd444951d1fd94a71ce3d591a8f397f456363) (cherry picked from commit d58219d8e13f0b4007108d78f8f6f96a1d842c2c) (cherry picked from commit 052f2c2aa45ae1aa1d59aaf713db4f771f62773b) (cherry picked from commit 29dc39538631f65eaaf5dcc4eeb747fbc68d7498) (cherry picked from commit 9eef3f59f3a1347ccc7d6d3704c9f5b40a3b6555) (cherry picked from commit d650391fedd5b2cac313e29d51cc8689d885a594) (cherry picked from commit c2e6e8c55d955f1e2b781c983f05319dddcc4386) (cherry picked from commit e28a47741dc668421989b6b2310365a6611b23b7) [CI] DEFAULT_ACTIONS_URL support for self & github (squash) Refs: https://codeberg.org/forgejo/forgejo/issues/1062 (cherry picked from commit 74cc25376ecd1dbab57abffe286ae1f918057cfd) (cherry picked from commit 405430708ffbebcfd2cefdcdfd24a540985b817c) (cherry picked from commit 0274a6dee7f383bcd6b65b995b991b5ab0ee635a) (cherry picked from commit be5cda0fd03b265367c551aefed83456be257075) (cherry picked from commit d27474849fc4dd4ec958c04b7be06eced8b74d6e) (cherry picked from commit 4a5e9e2d81f89b5c9e6782d1c24880d62f802d7f) (cherry picked from commit 65b31906b27c7a6ecaecf74af748e046c51aa7a8) (cherry picked from commit 13cf0b0963bb110db7229dc5cd4d202e7dec11fb) Conflicts: custom/conf/app.example.ini modules/setting/actions.go https://codeberg.org/forgejo/forgejo/pulls/1413 (cherry picked from commit 49529badce0a43a07a786b22e2a8705a6a1dbe63) Conflicts: custom/conf/app.example.ini docs/content/administration/config-cheat-sheet.en-us.md modules/setting/actions.go https://codeberg.org/forgejo/forgejo/pulls/1460 (cherry picked from commit 00327b9b1f8512ddb93a07b57fcaee53b701478b) (cherry picked from commit 3b322e43d5695d540a52259abdde74505241dda9) (cherry picked from commit 492cc5205908263a2733ba06a6562237406d4c11) Conflicts: modules/setting/actions.go https://codeberg.org/forgejo/forgejo/pulls/1573 (cherry picked from commit 9027b655df24bf47f49cc25d3547b6e49f66dde5) (cherry picked from commit 47643830286025dbff1538e9a6ffc23b05ea3e4b) (cherry picked from commit fbb00fd1cf9ecf30292aa3053f41076d7bb9027e) (cherry picked from commit 417cd6c801bb14b38f672fea3371486c12636ebf) (cherry picked from commit 6b70773ad817f6f3958e958a58c3d918e7d7f00e) (cherry picked from commit 9ba069327d0c5179bdae7e22ca580f3c460e9ac1) Conflicts: modules/setting/actions.go https://codeberg.org/forgejo/forgejo/pulls/1827 (cherry picked from commit 727edf19ee48648d1464f3bb38f85d82900870fa) (cherry picked from commit 689326ce2093701e57371759eda23ed9b7781286) (cherry picked from commit 745d60aec426e40a8ac98199e5f342113b39b871) (cherry picked from commit cb4ae4582c24552167e692871e697cc02384c054) (cherry picked from commit 48d5ffe1c0345f612e96acb2459c80431fa94993) Conflicts: custom/conf/app.example.ini https://codeberg.org/forgejo/forgejo/pulls/2068 (cherry picked from commit bbd4725bfdd82aa801ec0541c7dbdef9b39dcb1d) (cherry picked from commit 04eda91d10889febaee3f1b824defb2c0c9fb493) (cherry picked from commit d3621e46349645ad5e194ba6a21d4f607c403c8c) --- custom/conf/app.example.ini | 7 +++---- modules/setting/actions.go | 29 +++++------------------------ modules/setting/actions_test.go | 31 ++++--------------------------- 3 files changed, 12 insertions(+), 55 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index b0875123b7..7543119e8c 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -2582,10 +2582,9 @@ LEVEL = Info ; [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 -;; Default artifact retention time in days. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step. +;; Default address to get action plugins, e.g. the default value means downloading from "https://code.forgejo.org/actions/checkout" for "uses: actions/checkout@v3" +;DEFAULT_ACTIONS_URL = https://code.forgejo.org +;; Default artifact retention time in days, default is 90 days ;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 diff --git a/modules/setting/actions.go b/modules/setting/actions.go index 9fd484c3b8..e9b735dae8 100644 --- a/modules/setting/actions.go +++ b/modules/setting/actions.go @@ -7,8 +7,6 @@ import ( "fmt" "strings" "time" - - "code.gitea.io/gitea/modules/log" ) // Actions settings @@ -25,7 +23,7 @@ var ( SkipWorkflowStrings []string `ìni:"SKIP_WORKFLOW_STRINGS"` }{ Enabled: true, - DefaultActionsURL: defaultActionsURLGitHub, + DefaultActionsURL: defaultActionsURLForgejo, SkipWorkflowStrings: []string{"[skip ci]", "[ci skip]", "[no ci]", "[skip actions]", "[actions skip]"}, } ) @@ -39,18 +37,14 @@ func (url defaultActionsURL) URL() string { case defaultActionsURLSelf: return strings.TrimSuffix(AppURL, "/") default: - // This should never happen, but just in case, use GitHub as fallback - return "https://github.com" + return string(url) } } const ( - defaultActionsURLGitHub = "github" // https://github.com - defaultActionsURLSelf = "self" // the root URL of the self-hosted Gitea instance - // DefaultActionsURL only supports GitHub and the self-hosted Gitea. - // It's intentionally not supported more, so please be cautious before adding more like "gitea" or "gitlab". - // If you get some trouble with `uses: username/action_name@version` in your workflow, - // please consider to use `uses: https://the_url_you_want_to_use/username/action_name@version` instead. + defaultActionsURLForgejo = "https://code.forgejo.org" + defaultActionsURLGitHub = "github" // https://github.com + defaultActionsURLSelf = "self" // the root URL of the self-hosted instance ) func loadActionsFrom(rootCfg ConfigProvider) error { @@ -60,19 +54,6 @@ func loadActionsFrom(rootCfg ConfigProvider) error { return fmt.Errorf("failed to map Actions settings: %v", err) } - if urls := string(Actions.DefaultActionsURL); urls != defaultActionsURLGitHub && urls != defaultActionsURLSelf { - url := strings.Split(urls, ",")[0] - if strings.HasPrefix(url, "https://") || strings.HasPrefix(url, "http://") { - log.Error("[actions] DEFAULT_ACTIONS_URL does not support %q as custom URL any longer, fallback to %q", - urls, - defaultActionsURLGitHub, - ) - Actions.DefaultActionsURL = defaultActionsURLGitHub - } else { - return fmt.Errorf("unsupported [actions] DEFAULT_ACTIONS_URL: %q", urls) - } - } - // don't support to read configuration from [actions] Actions.LogStorage, err = getStorage(rootCfg, "actions_log", "", nil) if err != nil { diff --git a/modules/setting/actions_test.go b/modules/setting/actions_test.go index 3645a3f5da..01f5bf74a5 100644 --- a/modules/setting/actions_test.go +++ b/modules/setting/actions_test.go @@ -110,7 +110,6 @@ func Test_getDefaultActionsURLForActions(t *testing.T) { tests := []struct { name string iniStr string - wantErr assert.ErrorAssertionFunc wantURL string }{ { @@ -118,8 +117,7 @@ func Test_getDefaultActionsURLForActions(t *testing.T) { iniStr: ` [actions] `, - wantErr: assert.NoError, - wantURL: "https://github.com", + wantURL: "https://code.forgejo.org", }, { name: "github", @@ -127,7 +125,6 @@ func Test_getDefaultActionsURLForActions(t *testing.T) { [actions] DEFAULT_ACTIONS_URL = github `, - wantErr: assert.NoError, wantURL: "https://github.com", }, { @@ -136,35 +133,15 @@ DEFAULT_ACTIONS_URL = github [actions] DEFAULT_ACTIONS_URL = self `, - wantErr: assert.NoError, wantURL: "http://test_get_default_actions_url_for_actions:3000", }, - { - name: "custom url", - iniStr: ` -[actions] -DEFAULT_ACTIONS_URL = https://gitea.com -`, - wantErr: assert.NoError, - wantURL: "https://github.com", - }, { name: "custom urls", iniStr: ` [actions] -DEFAULT_ACTIONS_URL = https://gitea.com,https://github.com +DEFAULT_ACTIONS_URL = https://example.com `, - wantErr: assert.NoError, - wantURL: "https://github.com", - }, - { - name: "invalid", - iniStr: ` -[actions] -DEFAULT_ACTIONS_URL = gitea -`, - wantErr: assert.Error, - wantURL: "https://github.com", + wantURL: "https://example.com", }, } @@ -172,7 +149,7 @@ DEFAULT_ACTIONS_URL = gitea t.Run(tt.name, func(t *testing.T) { cfg, err := NewConfigProviderFromData(tt.iniStr) require.NoError(t, err) - if !tt.wantErr(t, loadActionsFrom(cfg)) { + if !assert.NoError(t, loadActionsFrom(cfg)) { return } assert.EqualValues(t, tt.wantURL, Actions.DefaultActionsURL.URL()) From b6ab4733959176aacfb25183e9f2f5e57195e35d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 9 Jul 2023 14:52:21 +0200 Subject: [PATCH 03/94] [CLI] implement forgejo-cli (cherry picked from commit 2555e315f7561302484b15576d34c5da0d4cdb12) (cherry picked from commit 51b9c9092e21a451695ee0154e7d49753574f525) [CLI] implement forgejo-cli (squash) support initDB (cherry picked from commit 5c31ae602a45f1d9a90b86bece5393bc9faddf25) (cherry picked from commit bbf76489a73bad83d68ca7c8e7a75cf8e27b2198) Conflicts: because of d0dbe52e76f3038777c3b50066e3636105387ca3 upgrade to https://pkg.go.dev/github.com/urfave/cli/v2 (cherry picked from commit b6c1bcc008fcff0e297d570a0069bf41bc74e53d) [CLI] implement forgejo-cli actions (cherry picked from commit 08be2b226e46d9f41e08f66e936b317bcfb4a257) (cherry picked from commit b6cfa88c6e2ae00e30c832ce4cf93c9e3f2cd6e4) (cherry picked from commit 59704200de59b65a4f37c39569a3b43e1ee38862) [CLI] implement forgejo-cli actions generate-secret (cherry picked from commit 6f7905c8ecf17d5f74ac9a71a453d6768c212b6d) (cherry picked from commit e085d6d2737e6238a4ff00f19f40cf839ac16b34) [CLI] implement forgejo-cli actions generate-secret (squash) NoInit (cherry picked from commit 962c944eb20268a394030495c3caab3e3d4bd8b7) [CLI] implement forgejo-cli actions register (cherry picked from commit 2f95143000e4ccc94ef14332777b58fe778edbd6) (cherry picked from commit 42f2f8731e876564b6627a43a248f262f50c04cd) [CLI] implement forgejo-cli actions register (squash) no private Do not go through the private API, directly modify the database (cherry picked from commit 1ba7c0d39d0ecd190b7d9c517bd26af6c84341aa) [CLI] implement forgejo-cli actions (cherry picked from commit 6f7905c8ecf17d5f74ac9a71a453d6768c212b6d) (cherry picked from commit e085d6d2737e6238a4ff00f19f40cf839ac16b34) [CLI] implement forgejo-cli actions generate-secret (squash) NoInit (cherry picked from commit 962c944eb20268a394030495c3caab3e3d4bd8b7) (cherry picked from commit 4c121ef022597e66d902c17e0f46839c26924b18) Conflicts: cmd/forgejo/actions.go tests/integration/cmd_forgejo_actions_test.go (cherry picked from commit 36997a48e38286579850abe4b55e75a235b56537) [CLI] implement forgejo-cli actions (squash) restore --version Refs: https://codeberg.org/forgejo/forgejo/issues/1134 (cherry picked from commit 9739eb52d8f94d32f61068d7209958e8d2582818) [CI] implement forgejo-cli (squash) the actions subcommand needs config (cherry picked from commit def638475122a26082ab3835842c84cd03839154) Conflicts: cmd/main.go https://codeberg.org/forgejo/forgejo/pulls/1209 (cherry picked from commit a1758a391043123903607338cb11490161ac946d) (cherry picked from commit 935fa650c77b151752a58f621d846b166b97cd79) (cherry picked from commit cd21026bc94922043dce8e2a5baba68111d1e569) (cherry picked from commit 1700b8973a58f0fc3469492d8a39b931019d2461) (cherry picked from commit 1def42a37945cfe88947803f9afe9468fb8798fe) (cherry picked from commit 839d97521d59a012b06e6c2b9b0655c56b41b6cd) (cherry picked from commit fd8c13be6b45f9aa939be482c0a4e5a60c89344c) (cherry picked from commit 588e5d552f044d91218a07fa46e84259d4892c5d) (cherry picked from commit 151a726620f662ff9af37316dfda38a6bd6744bb) [v1.22] [CLI] implement forgejo-cli https://codeberg.org/forgejo/forgejo/pulls/1541 (cherry picked from commit 46708de7b9a3efac74aced8361327a39f45b6892) (cherry picked from commit a8e5c1369ee3ee197579a30aeba519b4384360aa) (cherry picked from commit c8a32aaf24fd851927432f140fcc59a274824d33) Conflicts: models/actions/main_test.go https://codeberg.org/forgejo/forgejo/pulls/1656 (cherry picked from commit 79f4553063c4f4ee70c98f95d9e62facd9d33c67) (cherry picked from commit 0379da0cf5b14e7915f2f38502bd00036723071d) (cherry picked from commit 331d58c085d6533ebcc528c1ac69d4f99e8e9acd) (cherry picked from commit 89705502c477ec833bd7ce46c3cedc53fbd454bc) (cherry picked from commit 4723d5febf4a5748b2ca038bc95235995ebb8c11) (cherry picked from commit e71b26013039d5d029ec4c38befd25e6a447b3f1) (cherry picked from commit 6a376a5b48b0b5187f492ddd73c72896cc8ae0a8) Conflicts: cmd/main.go https://codeberg.org/forgejo/forgejo/pulls/1969 (cherry picked from commit 6ba97cf4b5bae19426fef9d65a20bc5527e41a90) (cherry picked from commit e0a6ebfeca1ff20d53fe8d0baf4a737d6e10fce1) (cherry picked from commit 5702aeab2d25fa1f79fb1d11ec359a5460dc0f91) (cherry picked from commit f919c4d6c11423ac2d3ab624d9a6390661c07aa7) (cherry picked from commit a26799a88aa2f320b498372717019fa601545931) --- cmd/forgejo/actions.go | 243 ++++++++++++++++++ cmd/forgejo/forgejo.go | 147 +++++++++++ cmd/main.go | 37 ++- models/actions/forgejo.go | 68 +++++ models/actions/forgejo_test.go | 29 +++ modules/private/forgejo_actions.go | 32 +++ routers/private/actions.go | 7 +- tests/integration/cmd_forgejo_actions_test.go | 209 +++++++++++++++ tests/integration/cmd_forgejo_test.go | 36 +++ 9 files changed, 806 insertions(+), 2 deletions(-) create mode 100644 cmd/forgejo/actions.go create mode 100644 cmd/forgejo/forgejo.go create mode 100644 models/actions/forgejo.go create mode 100644 models/actions/forgejo_test.go create mode 100644 modules/private/forgejo_actions.go create mode 100644 tests/integration/cmd_forgejo_actions_test.go create mode 100644 tests/integration/cmd_forgejo_test.go diff --git a/cmd/forgejo/actions.go b/cmd/forgejo/actions.go new file mode 100644 index 0000000000..afda831227 --- /dev/null +++ b/cmd/forgejo/actions.go @@ -0,0 +1,243 @@ +// Copyright The Forgejo Authors. +// SPDX-License-Identifier: MIT + +package forgejo + +import ( + "context" + "encoding/hex" + "fmt" + "io" + "os" + "strings" + + actions_model "code.gitea.io/gitea/models/actions" + "code.gitea.io/gitea/modules/private" + "code.gitea.io/gitea/modules/setting" + private_routers "code.gitea.io/gitea/routers/private" + + "github.com/urfave/cli/v2" +) + +func CmdActions(ctx context.Context) *cli.Command { + return &cli.Command{ + Name: "actions", + Usage: "Commands for managing Forgejo Actions", + Subcommands: []*cli.Command{ + SubcmdActionsGenerateRunnerToken(ctx), + SubcmdActionsGenerateRunnerSecret(ctx), + SubcmdActionsRegister(ctx), + }, + } +} + +func SubcmdActionsGenerateRunnerToken(ctx context.Context) *cli.Command { + return &cli.Command{ + Name: "generate-runner-token", + Usage: "Generate a new token for a runner to use to register with the server", + Action: prepareWorkPathAndCustomConf(ctx, func(cliCtx *cli.Context) error { return RunGenerateActionsRunnerToken(ctx, cliCtx) }), + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "scope", + Aliases: []string{"s"}, + Value: "", + Usage: "{owner}[/{repo}] - leave empty for a global runner", + }, + }, + } +} + +func SubcmdActionsGenerateRunnerSecret(ctx context.Context) *cli.Command { + return &cli.Command{ + Name: "generate-secret", + Usage: "Generate a secret suitable for input to the register subcommand", + Action: func(cliCtx *cli.Context) error { return RunGenerateSecret(ctx, cliCtx) }, + } +} + +func SubcmdActionsRegister(ctx context.Context) *cli.Command { + return &cli.Command{ + Name: "register", + Usage: "Idempotent registration of a runner using a shared secret", + Action: prepareWorkPathAndCustomConf(ctx, func(cliCtx *cli.Context) error { return RunRegister(ctx, cliCtx) }), + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "secret", + Usage: "the secret the runner will use to connect as a 40 character hexadecimal string", + }, + &cli.StringFlag{ + Name: "secret-stdin", + Usage: "the secret the runner will use to connect as a 40 character hexadecimal string, read from stdin", + }, + &cli.StringFlag{ + Name: "secret-file", + Usage: "path to the file containing the secret the runner will use to connect as a 40 character hexadecimal string", + }, + &cli.StringFlag{ + Name: "scope", + Aliases: []string{"s"}, + Value: "", + Usage: "{owner}[/{repo}] - leave empty for a global runner", + }, + &cli.StringFlag{ + Name: "labels", + Value: "", + Usage: "comma separated list of labels supported by the runner (e.g. docker,ubuntu-latest,self-hosted) (not required since v1.21)", + }, + &cli.StringFlag{ + Name: "name", + Value: "runner", + Usage: "name of the runner (default runner)", + }, + &cli.StringFlag{ + Name: "version", + Value: "", + Usage: "version of the runner (not required since v1.21)", + }, + }, + } +} + +func readSecret(ctx context.Context, cliCtx *cli.Context) (string, error) { + if cliCtx.IsSet("secret") { + return cliCtx.String("secret"), nil + } + if cliCtx.IsSet("secret-stdin") { + buf, err := io.ReadAll(ContextGetStdin(ctx)) + if err != nil { + return "", err + } + return string(buf), nil + } + if cliCtx.IsSet("secret-file") { + path := cliCtx.String("secret-file") + buf, err := os.ReadFile(path) + if err != nil { + return "", err + } + return string(buf), nil + } + return "", fmt.Errorf("at least one of the --secret, --secret-stdin, --secret-file options is required") +} + +func validateSecret(secret string) error { + secretLen := len(secret) + if secretLen != 40 { + return fmt.Errorf("the secret must be exactly 40 characters long, not %d: generate-secret can provide a secret matching the requirements", secretLen) + } + if _, err := hex.DecodeString(secret); err != nil { + return fmt.Errorf("the secret must be an hexadecimal string: %w", err) + } + return nil +} + +func RunRegister(ctx context.Context, cliCtx *cli.Context) error { + if !ContextGetNoInit(ctx) { + var cancel context.CancelFunc + ctx, cancel = installSignals(ctx) + defer cancel() + + if err := initDB(ctx); err != nil { + return err + } + } + setting.MustInstalled() + + secret, err := readSecret(ctx, cliCtx) + if err != nil { + return err + } + if err := validateSecret(secret); err != nil { + return err + } + scope := cliCtx.String("scope") + labels := cliCtx.String("labels") + name := cliCtx.String("name") + version := cliCtx.String("version") + + // + // There are two kinds of tokens + // + // - "registration token" only used when a runner interacts to + // register + // + // - "token" obtained after a successful registration and stored by + // the runner to authenticate + // + // The register subcommand does not need a "registration token", it + // needs a "token". Using the same name is confusing and secret is + // preferred for this reason in the cli. + // + // The ActionsRunnerRegister argument is token to be consistent with + // the internal naming. It is still confusing to the developer but + // not to the user. + // + owner, repo, err := private_routers.ParseScope(ctx, scope) + if err != nil { + return err + } + + runner, err := actions_model.RegisterRunner(ctx, owner, repo, secret, strings.Split(labels, ","), name, version) + if err != nil { + return fmt.Errorf("error while registering runner: %v", err) + } + + if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.UUID); err != nil { + panic(err) + } + return nil +} + +func RunGenerateSecret(ctx context.Context, cliCtx *cli.Context) error { + runner := actions_model.ActionRunner{} + if err := runner.GenerateToken(); err != nil { + return err + } + if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.Token); err != nil { + panic(err) + } + return nil +} + +func RunGenerateActionsRunnerToken(ctx context.Context, cliCtx *cli.Context) error { + if !ContextGetNoInit(ctx) { + var cancel context.CancelFunc + ctx, cancel = installSignals(ctx) + defer cancel() + } + + setting.MustInstalled() + + scope := cliCtx.String("scope") + + respText, extra := private.GenerateActionsRunnerToken(ctx, scope) + if extra.HasError() { + return handleCliResponseExtra(ctx, extra) + } + if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", respText.Text); err != nil { + panic(err) + } + return nil +} + +func prepareWorkPathAndCustomConf(ctx context.Context, action cli.ActionFunc) func(cliCtx *cli.Context) error { + return func(cliCtx *cli.Context) error { + if !ContextGetNoInit(ctx) { + var args setting.ArgWorkPathAndCustomConf + // from children to parent, check the global flags + for _, curCtx := range cliCtx.Lineage() { + if curCtx.IsSet("work-path") && args.WorkPath == "" { + args.WorkPath = curCtx.String("work-path") + } + if curCtx.IsSet("custom-path") && args.CustomPath == "" { + args.CustomPath = curCtx.String("custom-path") + } + if curCtx.IsSet("config") && args.CustomConf == "" { + args.CustomConf = curCtx.String("config") + } + } + setting.InitWorkPathAndCommonConfig(os.Getenv, args) + } + return action(cliCtx) + } +} diff --git a/cmd/forgejo/forgejo.go b/cmd/forgejo/forgejo.go new file mode 100644 index 0000000000..affb39157a --- /dev/null +++ b/cmd/forgejo/forgejo.go @@ -0,0 +1,147 @@ +// Copyright The Forgejo Authors. +// SPDX-License-Identifier: MIT + +package forgejo + +import ( + "context" + "fmt" + "io" + "os" + "os/signal" + "syscall" + + "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/private" + "code.gitea.io/gitea/modules/setting" + + "github.com/urfave/cli/v2" +) + +type key int + +const ( + noInitKey key = iota + 1 + noExitKey + stdoutKey + stderrKey + stdinKey +) + +func CmdForgejo(ctx context.Context) *cli.Command { + return &cli.Command{ + Name: "forgejo-cli", + Usage: "Forgejo CLI", + Flags: []cli.Flag{}, + Subcommands: []*cli.Command{ + CmdActions(ctx), + }, + } +} + +func ContextSetNoInit(ctx context.Context, value bool) context.Context { + return context.WithValue(ctx, noInitKey, value) +} + +func ContextGetNoInit(ctx context.Context) bool { + value, ok := ctx.Value(noInitKey).(bool) + return ok && value +} + +func ContextSetNoExit(ctx context.Context, value bool) context.Context { + return context.WithValue(ctx, noExitKey, value) +} + +func ContextGetNoExit(ctx context.Context) bool { + value, ok := ctx.Value(noExitKey).(bool) + return ok && value +} + +func ContextSetStderr(ctx context.Context, value io.Writer) context.Context { + return context.WithValue(ctx, stderrKey, value) +} + +func ContextGetStderr(ctx context.Context) io.Writer { + value, ok := ctx.Value(stderrKey).(io.Writer) + if !ok { + return os.Stderr + } + return value +} + +func ContextSetStdout(ctx context.Context, value io.Writer) context.Context { + return context.WithValue(ctx, stdoutKey, value) +} + +func ContextGetStdout(ctx context.Context) io.Writer { + value, ok := ctx.Value(stderrKey).(io.Writer) + if !ok { + return os.Stdout + } + return value +} + +func ContextSetStdin(ctx context.Context, value io.Reader) context.Context { + return context.WithValue(ctx, stdinKey, value) +} + +func ContextGetStdin(ctx context.Context) io.Reader { + value, ok := ctx.Value(stdinKey).(io.Reader) + if !ok { + return os.Stdin + } + return value +} + +// copied from ../cmd.go +func initDB(ctx context.Context) error { + setting.MustInstalled() + setting.LoadDBSetting() + setting.InitSQLLoggersForCli(log.INFO) + + if setting.Database.Type == "" { + log.Fatal(`Database settings are missing from the configuration file: %q. +Ensure you are running in the correct environment or set the correct configuration file with -c. +If this is the intended configuration file complete the [database] section.`, setting.CustomConf) + } + if err := db.InitEngine(ctx); err != nil { + return fmt.Errorf("unable to initialize the database using the configuration in %q. Error: %w", setting.CustomConf, err) + } + return nil +} + +// copied from ../cmd.go +func installSignals(ctx context.Context) (context.Context, context.CancelFunc) { + ctx, cancel := context.WithCancel(ctx) + go func() { + // install notify + signalChannel := make(chan os.Signal, 1) + + signal.Notify( + signalChannel, + syscall.SIGINT, + syscall.SIGTERM, + ) + select { + case <-signalChannel: + case <-ctx.Done(): + } + cancel() + signal.Reset() + }() + + return ctx, cancel +} + +func handleCliResponseExtra(ctx context.Context, extra private.ResponseExtra) error { + if false && extra.UserMsg != "" { + if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", extra.UserMsg); err != nil { + panic(err) + } + } + if ContextGetNoExit(ctx) { + return extra.Error + } + return cli.Exit(extra.Error, 1) +} diff --git a/cmd/main.go b/cmd/main.go index 02dd660e9e..c0afc138ed 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,10 +4,13 @@ package cmd import ( + "context" "fmt" "os" + "path/filepath" "strings" + "code.gitea.io/gitea/cmd/forgejo" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -113,6 +116,36 @@ func prepareWorkPathAndCustomConf(action cli.ActionFunc) func(ctx *cli.Context) } func NewMainApp(version, versionExtra string) *cli.App { + path, err := os.Executable() + if err != nil { + panic(err) + } + executable := filepath.Base(path) + + var subCmdsStandalone []*cli.Command = make([]*cli.Command, 0, 10) + var subCmdWithConfig []*cli.Command = make([]*cli.Command, 0, 10) + + // + // If the executable is forgejo-cli, provide a Forgejo specific CLI + // that is NOT compatible with Gitea. + // + if executable == "forgejo-cli" { + subCmdsStandalone = append(subCmdsStandalone, forgejo.CmdActions(context.Background())) + } else { + // + // Otherwise provide a Gitea compatible CLI which includes Forgejo + // specific additions under the forgejo-cli subcommand. It allows + // admins to migration from Gitea to Forgejo by replacing the gitea + // binary and rename it to forgejo if they want. + // + subCmdsStandalone = append(subCmdsStandalone, forgejo.CmdForgejo(context.Background())) + subCmdWithConfig = append(subCmdWithConfig, CmdActions) + } + + return innerNewMainApp(version, versionExtra, subCmdsStandalone, subCmdWithConfig) +} + +func innerNewMainApp(version, versionExtra string, subCmdsStandaloneArgs, subCmdWithConfigArgs []*cli.Command) *cli.App { app := cli.NewApp() app.Name = "Gitea" app.HelpName = "gitea" @@ -137,15 +170,17 @@ func NewMainApp(version, versionExtra string) *cli.App { CmdMigrateStorage, CmdDumpRepository, CmdRestoreRepository, - CmdActions, } + subCmdWithConfig = append(subCmdWithConfig, subCmdWithConfigArgs...) + // these sub-commands do not need the config file, and they do not depend on any path or environment variable. subCmdStandalone := []*cli.Command{ CmdCert, CmdGenerate, CmdDocs, } + subCmdStandalone = append(subCmdStandalone, subCmdsStandaloneArgs...) app.DefaultCommand = CmdWeb.Name diff --git a/models/actions/forgejo.go b/models/actions/forgejo.go new file mode 100644 index 0000000000..243262facd --- /dev/null +++ b/models/actions/forgejo.go @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: MIT + +package actions + +import ( + "context" + "encoding/hex" + "fmt" + + auth_model "code.gitea.io/gitea/models/auth" + "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/modules/util" + + gouuid "github.com/google/uuid" +) + +func RegisterRunner(ctx context.Context, ownerID, repoID int64, token string, labels []string, name, version string) (*ActionRunner, error) { + uuid, err := gouuid.FromBytes([]byte(token[:16])) + if err != nil { + return nil, fmt.Errorf("gouuid.FromBytes %v", err) + } + uuidString := uuid.String() + + var runner ActionRunner + + has, err := db.GetEngine(ctx).Where("uuid=?", uuidString).Get(&runner) + if err != nil { + return nil, fmt.Errorf("GetRunner %v", err) + } else if !has { + // + // The runner does not exist yet, create it + // + saltBytes, err := util.CryptoRandomBytes(16) + if err != nil { + return nil, fmt.Errorf("CryptoRandomBytes %v", err) + } + salt := hex.EncodeToString(saltBytes) + + hash := auth_model.HashToken(token, salt) + + runner = ActionRunner{ + UUID: uuidString, + TokenHash: hash, + TokenSalt: salt, + } + + if err := CreateRunner(ctx, &runner); err != nil { + return &runner, fmt.Errorf("can't create new runner %w", err) + } + } + + // + // Update the existing runner + // + name, _ = util.SplitStringAtByteN(name, 255) + + runner.Name = name + runner.OwnerID = ownerID + runner.RepoID = repoID + runner.Version = version + runner.AgentLabels = labels + + if err := UpdateRunner(ctx, &runner, "name", "owner_id", "repo_id", "version", "agent_labels"); err != nil { + return &runner, fmt.Errorf("can't update the runner %+v %w", runner, err) + } + + return &runner, nil +} diff --git a/models/actions/forgejo_test.go b/models/actions/forgejo_test.go new file mode 100644 index 0000000000..a8583c3d00 --- /dev/null +++ b/models/actions/forgejo_test.go @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT + +package actions + +import ( + "crypto/subtle" + "testing" + + auth_model "code.gitea.io/gitea/models/auth" + "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/models/unittest" + + "github.com/stretchr/testify/assert" +) + +func TestActions_RegisterRunner(t *testing.T) { + assert.NoError(t, unittest.PrepareTestDatabase()) + ownerID := int64(0) + repoID := int64(0) + token := "0123456789012345678901234567890123456789" + labels := []string{} + name := "runner" + version := "v1.2.3" + runner, err := RegisterRunner(db.DefaultContext, ownerID, repoID, token, labels, name, version) + assert.NoError(t, err) + assert.EqualValues(t, name, runner.Name) + + assert.EqualValues(t, 1, subtle.ConstantTimeCompare([]byte(runner.TokenHash), []byte(auth_model.HashToken(token, runner.TokenSalt))), "the token cannot be verified with the same method as routers/api/actions/runner/interceptor.go as of 8228751c55d6a4263f0fec2932ca16181c09c97d") +} diff --git a/modules/private/forgejo_actions.go b/modules/private/forgejo_actions.go new file mode 100644 index 0000000000..133d5e253f --- /dev/null +++ b/modules/private/forgejo_actions.go @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT + +package private + +import ( + "context" + + "code.gitea.io/gitea/modules/setting" +) + +type ActionsRunnerRegisterRequest struct { + Token string + Scope string + Labels []string + Name string + Version string +} + +func ActionsRunnerRegister(ctx context.Context, token, scope string, labels []string, name, version string) (string, ResponseExtra) { + reqURL := setting.LocalURL + "api/internal/actions/register" + + req := newInternalRequest(ctx, reqURL, "POST", ActionsRunnerRegisterRequest{ + Token: token, + Scope: scope, + Labels: labels, + Name: name, + Version: version, + }) + + resp, extra := requestJSONResp(req, &ResponseText{}) + return resp.Text, extra +} diff --git a/routers/private/actions.go b/routers/private/actions.go index 886f23b1c2..1325913e1b 100644 --- a/routers/private/actions.go +++ b/routers/private/actions.go @@ -4,6 +4,7 @@ package private import ( + gocontext "context" "errors" "fmt" "net/http" @@ -64,7 +65,11 @@ func GenerateActionsRunnerToken(ctx *context.PrivateContext) { ctx.PlainText(http.StatusOK, token.Token) } -func parseScope(ctx *context.PrivateContext, scope string) (ownerID, repoID int64, err error) { +func ParseScope(ctx gocontext.Context, scope string) (ownerID, repoID int64, err error) { + return parseScope(ctx, scope) +} + +func parseScope(ctx gocontext.Context, scope string) (ownerID, repoID int64, err error) { ownerID = 0 repoID = 0 if scope == "" { diff --git a/tests/integration/cmd_forgejo_actions_test.go b/tests/integration/cmd_forgejo_actions_test.go new file mode 100644 index 0000000000..44211007f5 --- /dev/null +++ b/tests/integration/cmd_forgejo_actions_test.go @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: MIT + +package integration + +import ( + gocontext "context" + "net/url" + "os" + "strings" + "testing" + + actions_model "code.gitea.io/gitea/models/actions" + repo_model "code.gitea.io/gitea/models/repo" + "code.gitea.io/gitea/models/unittest" + user_model "code.gitea.io/gitea/models/user" + + "github.com/stretchr/testify/assert" +) + +func Test_CmdForgejo_Actions(t *testing.T) { + onGiteaRun(t, func(*testing.T, *url.URL) { + token, err := cmdForgejoCaptureOutput(t, []string{"forgejo", "forgejo-cli", "actions", "generate-runner-token"}) + assert.NoError(t, err) + assert.EqualValues(t, 40, len(token)) + + secret, err := cmdForgejoCaptureOutput(t, []string{"forgejo", "forgejo-cli", "actions", "generate-secret"}) + assert.NoError(t, err) + assert.EqualValues(t, 40, len(secret)) + + _, err = cmdForgejoCaptureOutput(t, []string{"forgejo", "forgejo-cli", "actions", "register"}) + assert.ErrorContains(t, err, "at least one of the --secret") + + for _, testCase := range []struct { + testName string + scope string + secret string + errorMessage string + }{ + { + testName: "bad user", + scope: "baduser", + secret: "0123456789012345678901234567890123456789", + errorMessage: "user does not exist", + }, + { + testName: "bad repo", + scope: "org25/badrepo", + secret: "0123456789012345678901234567890123456789", + errorMessage: "repository does not exist", + }, + { + testName: "secret length != 40", + scope: "org25", + secret: "0123456789", + errorMessage: "40 characters long", + }, + { + testName: "secret is not a hexadecimal string", + scope: "org25", + secret: "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ", + errorMessage: "must be an hexadecimal string", + }, + } { + t.Run(testCase.testName, func(t *testing.T) { + cmd := []string{"forgejo", "forgejo-cli", "actions", "register", "--secret", testCase.secret, "--scope", testCase.scope} + output, err := cmdForgejoCaptureOutput(t, cmd) + assert.ErrorContains(t, err, testCase.errorMessage) + assert.EqualValues(t, "", output) + }) + } + + secret = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" + expecteduuid := "44444444-4444-4444-4444-444444444444" + + for _, testCase := range []struct { + testName string + secretOption func() string + stdin []string + }{ + { + testName: "secret from argument", + secretOption: func() string { + return "--secret=" + secret + }, + }, + { + testName: "secret from stdin", + secretOption: func() string { + return "--secret-stdin" + }, + stdin: []string{secret}, + }, + { + testName: "secret from file", + secretOption: func() string { + secretFile := t.TempDir() + "/secret" + assert.NoError(t, os.WriteFile(secretFile, []byte(secret), 0o644)) + return "--secret-file=" + secretFile + }, + }, + } { + t.Run(testCase.testName, func(t *testing.T) { + cmd := []string{"forgejo", "forgejo-cli", "actions", "register", testCase.secretOption(), "--scope=org26"} + uuid, err := cmdForgejoCaptureOutput(t, cmd, testCase.stdin...) + assert.NoError(t, err) + assert.EqualValues(t, expecteduuid, uuid) + }) + } + + secret = "0123456789012345678901234567890123456789" + expecteduuid = "30313233-3435-3637-3839-303132333435" + + for _, testCase := range []struct { + testName string + scope string + secret string + name string + labels string + version string + uuid string + }{ + { + testName: "org", + scope: "org25", + secret: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + uuid: "41414141-4141-4141-4141-414141414141", + }, + { + testName: "user and repo", + scope: "user2/repo2", + secret: "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + uuid: "42424242-4242-4242-4242-424242424242", + }, + { + testName: "labels", + scope: "org25", + name: "runnerName", + labels: "label1,label2,label3", + version: "v1.2.3", + secret: "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", + uuid: "43434343-4343-4343-4343-434343434343", + }, + { + testName: "insert a runner", + scope: "user10/repo6", + name: "runnerName", + labels: "label1,label2,label3", + version: "v1.2.3", + secret: secret, + uuid: expecteduuid, + }, + { + testName: "update an existing runner", + scope: "user5/repo4", + name: "runnerNameChanged", + labels: "label1,label2,label3,more,label", + version: "v1.2.3-suffix", + secret: secret, + uuid: expecteduuid, + }, + } { + t.Run(testCase.testName, func(t *testing.T) { + cmd := []string{ + "forgejo", "forgejo-cli", "actions", "register", + "--secret", testCase.secret, "--scope", testCase.scope, + } + if testCase.name != "" { + cmd = append(cmd, "--name", testCase.name) + } + if testCase.labels != "" { + cmd = append(cmd, "--labels", testCase.labels) + } + if testCase.version != "" { + cmd = append(cmd, "--version", testCase.version) + } + // + // Run twice to verify it is idempotent + // + for i := 0; i < 2; i++ { + uuid, err := cmdForgejoCaptureOutput(t, cmd) + assert.NoError(t, err) + if assert.EqualValues(t, testCase.uuid, uuid) { + ownerName, repoName, found := strings.Cut(testCase.scope, "/") + action, err := actions_model.GetRunnerByUUID(gocontext.Background(), uuid) + assert.NoError(t, err) + + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: action.OwnerID}) + assert.Equal(t, ownerName, user.Name, action.OwnerID) + + if found { + repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: action.RepoID}) + assert.Equal(t, repoName, repo.Name, action.RepoID) + } + if testCase.name != "" { + assert.EqualValues(t, testCase.name, action.Name) + } + if testCase.labels != "" { + labels := strings.Split(testCase.labels, ",") + assert.EqualValues(t, labels, action.AgentLabels) + } + if testCase.version != "" { + assert.EqualValues(t, testCase.version, action.Version) + } + } + } + }) + } + }) +} diff --git a/tests/integration/cmd_forgejo_test.go b/tests/integration/cmd_forgejo_test.go new file mode 100644 index 0000000000..76f5a6fc08 --- /dev/null +++ b/tests/integration/cmd_forgejo_test.go @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT + +package integration + +import ( + "bytes" + "context" + "strings" + "testing" + + "code.gitea.io/gitea/cmd/forgejo" + + "github.com/urfave/cli/v2" +) + +func cmdForgejoCaptureOutput(t *testing.T, args []string, stdin ...string) (string, error) { + buf := new(bytes.Buffer) + + app := cli.NewApp() + app.Writer = buf + app.ErrWriter = buf + ctx := context.Background() + ctx = forgejo.ContextSetNoInit(ctx, true) + ctx = forgejo.ContextSetNoExit(ctx, true) + ctx = forgejo.ContextSetStdout(ctx, buf) + ctx = forgejo.ContextSetStderr(ctx, buf) + if len(stdin) > 0 { + ctx = forgejo.ContextSetStdin(ctx, strings.NewReader(strings.Join(stdin, ""))) + } + app.Commands = []*cli.Command{ + forgejo.CmdForgejo(ctx), + } + err := app.Run(args) + + return buf.String(), err +} From 57069811d1d4d89bee498d8cbd9e23e212e48b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sat, 19 Nov 2022 11:41:18 +0100 Subject: [PATCH 04/94] [CI] implementation: publish forgejo- binaries instead of gitea- (cherry picked from commit 6d910daafb28b79402b8190fa749f4ff18991505) (cherry picked from commit d447861cc911aa89539cbbcdbbf0e68d0bc23e53) (cherry picked from commit dc6e9d87990f72d870100934be32a5fc1dc119ad) (cherry picked from commit ef232fa20c99c6c52599025967a5af2f5839bdce) (cherry picked from commit 290c55517a84f6e8b80459372b9b63ec19cadcb4) (cherry picked from commit db48af1784e94851c066845324c3e680e79ab7c3) (cherry picked from commit 85f33237a2f5da88ec2fcab76ea91ee3cec56065) (cherry picked from commit 76899ee33e8196c66f882fca5facf5268c8fabf8) (cherry picked from commit 148b3ee9cb03aa614b59ab98d2d8c11f343d38d1) (cherry picked from commit 1f6ad8f465819cc6adb8061845822398a33e14e1) (cherry picked from commit c330afdba3354ff59591bd07046b6993bfeea777) (cherry picked from commit b1f87075a79c8e0d1a8626958f90bfee4d003de1) (cherry picked from commit 7da40992cc82d719094a748339c385fbc1251afe) (cherry picked from commit 7ab19ff5e528b9e1ef53e95639022facca70466e) (cherry picked from commit e61e44921bbabc7ba12da51afde1c6fe8203679b) (cherry picked from commit 83646119fb8af975a114601ee7bbaf7c5d25f93f) (cherry picked from commit 20cf748e61f35378745629dcb38b459818c8ad52) (cherry picked from commit 0a99919cec90dc1374c67199a0bbb90e7f8c7525) (cherry picked from commit 21215222a6d036551dca0b54a09c388845c3565f) (cherry picked from commit 0f6c5658d77fe47d4c67b327190f88af829905da) (cherry picked from commit 1752e43d3c0d71533680d2dcbcbb056d0c91371e) (cherry picked from commit 2332080929c9eb65d512956773bf7ac821fa6736) (cherry picked from commit 590aabf2a2a47f4a5a53a9d0b8b12486f5998400) (cherry picked from commit 87d8b7b315c3e25bd3fcf9dc9c1d359bcd107281) (cherry picked from commit ff37de38be04b8c1ca6f04b4ef5566c9f9a125ad) (cherry picked from commit cee32c9e7ab58af6cb07109df4b88420c30c6156) (cherry picked from commit 39faade524215d5527c5d24e90a9be62aa40f422) (cherry picked from commit 0e5ca477b6e7ae926cd32454a6ed372b83626b34) (cherry picked from commit 70e2730f7b2efe4c2ee9ef047583bf9ee5eed409) (cherry picked from commit 2ad4003944e0d32d1e45b9276316e189f9b5b176) (cherry picked from commit 2429de9e87e3fdbfa2df8741c9400e9f056ef124) (cherry picked from commit c133915fc1a4eb8aa1e4766e720e47de14db0d61) (cherry picked from commit c607dcaf9f01e454921e07b758bdde1c4dba5504) (cherry picked from commit 00f006637f659bd617d05d1017be7bd4b78e618b) (cherry picked from commit 0de6646475195e0cf210781c98b8fcede010b94d) (cherry picked from commit b05e83bb1e45e67d96f0b4b138ffe2df8329e01d) (cherry picked from commit cb71f139f081c14d17ee904931ab64ccd2199c20) (cherry picked from commit 2a8b08ee4fdbceb5b8196a89c017405546ec0f79) (cherry picked from commit 3ebab73c4eee7b43ab0a30ad1f32c23ac969cbac) (cherry picked from commit 07626c088c2e9927bf200803178530be515831e8) (cherry picked from commit 844e9bc9999f2b94e2fc0f727dec06d128042b8e) (cherry picked from commit c315e247514fee9b2fcd3a91e16237b8986b78f0) (cherry picked from commit f5f2b41f3cdfc6258191859a7c1914b52b868c09) (cherry picked from commit 09134424a8c3c5136373c7760cf3d3dd26382610) (cherry picked from commit 6fc63d48c4b2a568ddafb92d566e607977cc1b1b) (cherry picked from commit a0be5c783e145601ca80eadfff7e104c980d1f32) (cherry picked from commit 124bad8230535626187165341c369668bb71c4f2) --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 068dda5f52..ce67c0bcf0 100644 --- a/Makefile +++ b/Makefile @@ -803,7 +803,10 @@ endif .PHONY: release-linux release-linux: | $(DIST_DIRS) - CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) . + CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) . +ifeq ($(CI),true) + cp /build/* $(DIST)/binaries +endif .PHONY: release-darwin release-darwin: | $(DIST_DIRS) @@ -831,8 +834,8 @@ release-sources: | $(DIST_DIRS) # bsdtar needs a ^ to prevent matching subdirectories $(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./) # use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s - $(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'")) - tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz . + $(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./forgejo-src-$(VERSION)/'" || echo "--transform 's|^./|forgejo-src-$(VERSION)/|'")) + tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/forgejo-src-$(VERSION).tar.gz . rm -f $(STORED_VERSION_FILE) .PHONY: release-docs From 59d0824a3d09e0d88367ffea9f6046e90a66dbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Fri, 25 Nov 2022 10:11:23 +0100 Subject: [PATCH 05/94] [CI] implementation: forgejo container images (cherry picked from commit dd1971d4e60f37fb76daeb6cef8b1defcc957a34) (cherry picked from commit 3981dbaf8c0dd74b0e82a7afc36809998ac775a2) (cherry picked from commit 8dff3cc2d1a51980439e9ca8f1cad592403c558e) (cherry picked from commit e7673e5d2237733e4e17b9386c4bb25bb88fe2e2) (cherry picked from commit 326174064ba6dbd379ea82e9643e23fe684ad96f) (cherry picked from commit eb769dbde4fb0d7a8a4bd74b6bcdf1f1f180f840) (cherry picked from commit 335829ade20a187c7fd423909231d198a59545bd) (cherry picked from commit 5e8e4f549d2224a00387764e93fdbde34e324c3d) Conflicts: Dockerfile Dockerfile.rootless (cherry picked from commit b777fc91d0ba5b1a061bd9cc57c4818a3357b42a) (cherry picked from commit 02cda642ec7ce2b69de7f0ff4fb4f0d70941f54e) (cherry picked from commit 96ef93f3bc1b618831f04e1ae5d5c7c74e2ed36c) (cherry picked from commit aa424551f24364dd43d9b7739b723bb1d914eeaf) Conflicts: Dockerfile Dockerfile.rootless (cherry picked from commit e54fa86e4904047e5670e68a9dd89e76530564a4) (cherry picked from commit 043fa6d6649272f14a65ee2c9cac15b090e66bc9) (cherry picked from commit 805b16248015e8d7ab8c4f514969cff333d432c8) (cherry picked from commit 86bf362a3c8386cc4530c0c4cba46097ed20d8af) (cherry picked from commit 13e0007959fb5e2496b3bbec916036bd2a05a558) (cherry picked from commit 00ff6f7cb3c54ae3a8ed2069b0dd0dddd98e7e6e) (cherry picked from commit 95c7d8e883da495facfbac39db55b5b710ea25a7) (cherry picked from commit fb033d2bb613c34b7f61c2bad14136f8f110081e) (cherry picked from commit 1147910a552db9fdf7f4ef0a35e9b1d2405b0e69) (cherry picked from commit 6590b6e99c9c31389f6b948976fba3fea8da7eb7) (cherry picked from commit 78938113e4908df1d1e5181c1aa7605e7bc5747d) (cherry picked from commit 57338224f172e30a72f03f565aa47876e1213e77) (cherry picked from commit 4266cbcdd415de2deaea8620fe9b7b53866171ba) (cherry picked from commit bdc766a5a2304fc1826649ac747a2724fed6e7ab) (cherry picked from commit 6fb9ad85046fedf381a948906841098eb4ac010f) (cherry picked from commit c4e6383240c4188fd65bf751aaf8f38466fe60e7) (cherry picked from commit 490fa55b3abab2450073bc2358893687a06305cc) (cherry picked from commit 802c8e72be88b342d3a285cd76a4d3207813d54f) (cherry picked from commit 2b1efe20303be52f7ce142bafe48228822a1350c) (cherry picked from commit fdcdd7389adafc25a158fc510256039e8f98bb2d) (cherry picked from commit b9ae491650c7b8008149cda504439f092ba019ea) (cherry picked from commit e7867c6512957822e6b9fde3dab2288714481f72) (cherry picked from commit 0a43263fa6ad3dd7c20f7a7a8a60720d2a2ab7ea) (cherry picked from commit 64bb6b89820d2202489151a84e00b62e8b580826) (cherry picked from commit dcc1fd6292950fa0ce0cf932c62bc6e016d11b2f) (cherry picked from commit b0250fd53307638c76327ae9a7f20c1ebf79cbe9) (cherry picked from commit 427b05999684f6fac7fee1268d7d61380ae3b800) (cherry picked from commit b6058e28cb7854d7af7073da0534a8ea50381e8b) (cherry picked from commit b91a41dd792cf92dafcc7eba5b08890d351c5456) (cherry picked from commit b8bcb2272660eba1bee4ba5ea332dbdaee7018f1) (cherry picked from commit 69ae87f11f21a96fbe70b893444a6a84830696ea) Conflicts: Dockerfile Dockerfile.rootless https://codeberg.org/forgejo/forgejo/pulls/2029 (cherry picked from commit a4a846a8d510c3de9afc640a67325d4591e3101b) (cherry picked from commit a1a947ce0327af55de1b1682637f5fbbde404d14) (cherry picked from commit 55bd48007f6c45e51546091a644fcd4aa8baa6c0) (cherry picked from commit f012eb7cb09666dbb47c7496084d309abd908171) --- Dockerfile | 2 +- Dockerfile.rootless | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 325b0255df..67c5398917 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \ RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete FROM docker.io/library/alpine:3.19 -LABEL maintainer="maintainers@gitea.io" +LABEL maintainer="contact@forgejo.org" EXPOSE 22 3000 diff --git a/Dockerfile.rootless b/Dockerfile.rootless index 6f27c698ac..a41c27b3e2 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -40,7 +40,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \ RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete FROM docker.io/library/alpine:3.19 -LABEL maintainer="maintainers@gitea.io" +LABEL maintainer="contact@forgejo.org" EXPOSE 2222 3000 From b4fb5f64c68089a9fb28f63e705f68fce29c568e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Mon, 20 Feb 2023 23:17:52 +0100 Subject: [PATCH 06/94] [CI] set PASSWORD_HASH_ALGO = argon2 for integration tests (cherry picked from commit 1d7ce2a39c841e77492ef08c0e86c3544ecca88d) (cherry picked from commit 3af8757583ab9bf8fc5eb05ed1e6901a34682512) (cherry picked from commit 0b818152096d58e402e3c8bbc2415695af0cdfb9) (cherry picked from commit 7180a3222a00c33ec7dc9bcaa7e5a1e3ae924735) (cherry picked from commit 069044f4a6dd7457662e5ca296c714275d16becf) (cherry picked from commit dd1438f38995e397399d8957fca696f82b73707e) (cherry picked from commit 4ae6b5d64d59902ce003199b5d652d6c4799ffcf) (cherry picked from commit c572666d78d0f2cf2a33d5a50ea363430ac9a0a9) (cherry picked from commit de0a4480bc3e40d61aa5342d93a2ef510abe3826) (cherry picked from commit 60272ef4f73608407ffedd27892376b6c36a7069) (cherry picked from commit a68fdde4becef625ce4e654ba6ea8ebee55251e5) (cherry picked from commit ff448cf3a698dd45c713b734fce3e374c99940bf) (cherry picked from commit 208498caaab339d4543abfb2b77de3c5793a73c8) (cherry picked from commit 1abd3efad842f276f1c768ab40213200b62a0d3b) (cherry picked from commit 818c7f4ca9d59afd75d6cb9597c67cb0564cf775) (cherry picked from commit 1e552bbe44f79d9a2f5567a0180505b9a41d39d3) (cherry picked from commit 88dbd6da1d7b4a7faf9dda2d25d68f3202c250a5) (cherry picked from commit b1c86fb7775dd34511f4d5069db1bd3e5ef68e7a) (cherry picked from commit 185b1e25b12b56c9ae904adb787854da9b74ddc2) (cherry picked from commit 0af35605ae8a2594ae0b594278748242bce9d8e0) (cherry picked from commit 350975b63f12df508e7d8d01845032d32f30035c) (cherry picked from commit 2788142515ff6bb316a120be60556f39659ee9ea) (cherry picked from commit b418a53717b247e10d2dda26d1d236400d423a94) (cherry picked from commit 086cde3f10d786cd3c05bf59e359f08a23183d91) (cherry picked from commit 3e4818c779bd894b4b86a3672d24623fa45e1824) (cherry picked from commit f2bf1fe64f9ebf8460a93805289fdba2d5cad6d3) (cherry picked from commit db4eb288ee464c9a799ff2e059c0a5aa632e633b) (cherry picked from commit f8db31821b8089d5c9390f902854b7817a0381ef) (cherry picked from commit 2b13c06f499110ba76d3121d1c2f09df3023564f) (cherry picked from commit 3fd0092056a4e0f43ff59b2123539ddb1ea0afcc) (cherry picked from commit 6f7662507f26c34a3de54b3e69ea65ab10921163) (cherry picked from commit 8a15e41887ee3a72fdb5b7718d2750d48615205b) Conflicts: tests/mysql8.ini.tmpl https://codeberg.org/forgejo/forgejo/pulls/1573 (cherry picked from commit 56e67e34e2b4d07bc516aa38bf691b5a195821fe) (cherry picked from commit 6a049a939babf4422ac18f2561a77afea9218861) (cherry picked from commit 454fe7f5e1113d310375bfbc8ebd44b53ce75e2d) (cherry picked from commit 93fa4406b74a1019be44f4b40b80d43a777c0e73) (cherry picked from commit eab1c7222755e06e4308ed3b2c5d7b23c96f54bb) (cherry picked from commit 8228adfd26616743138de4ab279d2714e8dcc8cf) (cherry picked from commit ffdbe1bac8d7beddef775bb46a8c33342ee93528) (cherry picked from commit 7df440771403bae81fa9c0def90bdbe95a4dd53b) (cherry picked from commit 9d8c4bc7cad4d56528a19d7892b0f08e21dd252a) (cherry picked from commit 6696e09b1f644bc176d2ca0129d85d8de23d3e4c) (cherry picked from commit 1bdc0e345807800e2deffc8f9677d708a06a4828) (cherry picked from commit e2d1598475f5278c7aa14379086d775bbcec7b9a) (cherry picked from commit 6e0928ae00ba06b14b4d8d3326102ef4f2a91b89) (cherry picked from commit eede74e7096f200677909d59b32a18808d143605) --- tests/mssql.ini.tmpl | 1 + tests/mysql.ini.tmpl | 1 + tests/pgsql.ini.tmpl | 1 + tests/sqlite.ini.tmpl | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/mssql.ini.tmpl b/tests/mssql.ini.tmpl index 07997f62ed..6aa27e1e60 100644 --- a/tests/mssql.ini.tmpl +++ b/tests/mssql.ini.tmpl @@ -96,6 +96,7 @@ COLORIZE = true LEVEL = Debug [security] +PASSWORD_HASH_ALGO = argon2 DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb diff --git a/tests/mysql.ini.tmpl b/tests/mysql.ini.tmpl index 0fddde46de..6b5f11eb22 100644 --- a/tests/mysql.ini.tmpl +++ b/tests/mysql.ini.tmpl @@ -94,6 +94,7 @@ COLORIZE = true LEVEL = Debug [security] +PASSWORD_HASH_ALGO = argon2 DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb diff --git a/tests/pgsql.ini.tmpl b/tests/pgsql.ini.tmpl index 486cfc945c..53d302a932 100644 --- a/tests/pgsql.ini.tmpl +++ b/tests/pgsql.ini.tmpl @@ -97,6 +97,7 @@ COLORIZE = true LEVEL = Debug [security] +PASSWORD_HASH_ALGO = argon2 DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb diff --git a/tests/sqlite.ini.tmpl b/tests/sqlite.ini.tmpl index 1cbcd8b2e5..b167867177 100644 --- a/tests/sqlite.ini.tmpl +++ b/tests/sqlite.ini.tmpl @@ -93,6 +93,7 @@ COLORIZE = true LEVEL = Debug [security] +PASSWORD_HASH_ALGO = argon2 DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb From 98dbce5e147432194d6f177133dcaabe04309712 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 16 May 2023 07:58:42 +0200 Subject: [PATCH 07/94] [CI] disable redis test, no redis server yet in CI (cherry picked from commit e1bbfa36197ebab97954e8195f7d36adf7c85d56) (cherry picked from commit 91245ca9179a46047a351247dacecdace557111d) (cherry picked from commit 705d0558be2c90d06e9e5b883044fd0b275b1113) (cherry picked from commit 9247594970c9db109e3e6ca3fd87485450df921c) (cherry picked from commit 9db1158a487e00e588810459fe402cc2ccea43f7) (cherry picked from commit 3b36b77d87a90fbea03fc16638657e19328ccedc) (cherry picked from commit 162fa1d8ae3753dd8ee51698555e495f2c63d925) (cherry picked from commit d03d0afbb565c8bc8b723e10c8c70b69e7af7b80) (cherry picked from commit 7b8f92f7871b838bc2eefa34e7dc48bcd141d1d5) (cherry picked from commit 035abca9691d33e319062325dae402da66683c43) (cherry picked from commit a8fbf6bb56046665cb2cde0ffcc753f56b2f0f2d) (cherry picked from commit 3be681d037b07880236cae1aa70245e5eb4d1497) (cherry picked from commit 7e5d471c832ee3fea378ecc97835b038bd55a8e1) (cherry picked from commit 323801d935fec2c6d460192b62fa12b5204da76e) (cherry picked from commit 3fdfe4bfea623111f1f97e50b71b98a63c8b38e7) (cherry picked from commit 58a07421a4508ca298c1c3a45d33d49737ee98d8) (cherry picked from commit dbb71a4c8502b640857d3500dda12ab4b5d74b29) (cherry picked from commit d442113520d21149e155d1e62bbeb6a35a6aec08) (cherry picked from commit d3329f01f8c7145c422b159509f544ec83604a51) (cherry picked from commit 069a1d68b856898e2913d1d4456deb7f1e976a6c) (cherry picked from commit 14919e609a4dd9ae9ca19880ffc459def8bea273) (cherry picked from commit 49b76be1068d1f83169956bb141116481a7e6a3c) (cherry picked from commit 0fe9f257d2bd277f5cd620fe04e4b80b5abcd585) (cherry picked from commit b583bebeab3d0b182df6b5d087522a4fb89ba3e9) (cherry picked from commit 5c616e43a64451d607b6ee24400708d2704fd4db) (cherry picked from commit 854bcea9051dc615cfd6d3e8cb03986e9058fd65) (cherry picked from commit c2acb181c57e6ffef37df1a3a3b1b63c326cdd43) (cherry picked from commit 1cb07e71d14118871ae40a82adabcde851a3e172) (cherry picked from commit 5d3f09e6351614a8db979995299ac1b94ebf08ee) (cherry picked from commit f8bf1c8d42be0eb40f4d4fdc72e7e4cefa842e52) (cherry picked from commit a471ed4576607a4e13cac980016c9e2a702d9fd5) (cherry picked from commit 95c755f4e34bb753a0f94f87f02a17256d7d1619) (cherry picked from commit 1d8bc5215f6918e11d8beb1f7e252b04d9c15bb6) (cherry picked from commit 45c1e7b8d0920db98556ecfdf0d1111c2ffcb66e) (cherry picked from commit 2eb4d93af7b5679228dc38578a746242250e5d92) --- modules/queue/base_redis_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/queue/base_redis_test.go b/modules/queue/base_redis_test.go index 19fbccbc8f..be8bfbfe37 100644 --- a/modules/queue/base_redis_test.go +++ b/modules/queue/base_redis_test.go @@ -56,8 +56,8 @@ func TestBaseRedis(t *testing.T) { }() if !waitRedisReady("redis://127.0.0.1:6379/0", 0) { redisServer = redisServerCmd(t) - if redisServer == nil && os.Getenv("CI") == "" { - t.Skip("redis-server not found") + if true { + t.Skip("redis-server not found in Forgejo test yet") return } assert.NoError(t, redisServer.Start()) From 984081f08d108acc47d312307b1c3beee3058202 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 1 Aug 2023 08:44:46 +0200 Subject: [PATCH 08/94] [CI] disable meilisearch/elasticsearch test, no server yet in CI (cherry picked from commit a1381d9146fba42cb97d72d38525fa3e721bfb03) (cherry picked from commit 74714e02461fb47fcc0901211668e4529fac68d0) (cherry picked from commit 7749dbfe6684498a47e3037088e7bef3542b6ce5) (cherry picked from commit 437924971136eaed795f77edd3d3dfffa5f68103) (cherry picked from commit a69f55bebf82a0b68bc0f66bc029eaea836cddb7) (cherry picked from commit 24dd5fbfdbc27c887dbc24661c1005fb2e14e3c6) (cherry picked from commit dda856d6b83936fd1c96c84544b086cbd8f63115) (cherry picked from commit bc14f4fa97fffe82d1c666e961e313f88433cb9e) (cherry picked from commit 78fef4f1379d8854901151d4bc62135c73db868e) (cherry picked from commit 69e013cc515e2a50006d8d02f575ff6490d272ff) (cherry picked from commit f173c6a2734b2dccf1424d27cd8e10fc296e44a4) (cherry picked from commit 92f9d02547017770deafd1f715c32ae4479b8ded) (cherry picked from commit c99d51e665370ceb71b96b3fb65184090c7e4442) (cherry picked from commit aa0650fd2b42738a5e564c229c3eb63b8ca77f9b) (cherry picked from commit 0a8ef91302368751df22a1967857283222bc097f) (cherry picked from commit 7b54fe01c2ded0bbbcae6b89d9e330ca4f6ab744) (cherry picked from commit 0e154f366f14d106d14f500f605380c29b5a3f21) (cherry picked from commit 02d88ee16d23b9ebb04bf1af843fc5d2074783ce) (cherry picked from commit 411924e0172a7b10de7513f2e7f60ab5341b13e4) (cherry picked from commit f4e9ca6db59f2c5c638a0560d4ea99833d61520b) (cherry picked from commit cd80126a23573dd5aea1e9674ee0bfa34c63ec5a) (cherry picked from commit da626702f9743fc6e1dd77d21aff5fc3afe75912) (cherry picked from commit 4b81d0bd046fef267bb10d2ca0cbd342c87fd4e2) (cherry picked from commit 53ac2606694fa060879a0f4c82f6164c6f42a4d0) --- modules/indexer/issues/elasticsearch/elasticsearch_test.go | 1 + modules/indexer/issues/meilisearch/meilisearch_test.go | 1 + tests/mysql.ini.tmpl | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/indexer/issues/elasticsearch/elasticsearch_test.go b/modules/indexer/issues/elasticsearch/elasticsearch_test.go index ffd85b1aa1..6989532ae5 100644 --- a/modules/indexer/issues/elasticsearch/elasticsearch_test.go +++ b/modules/indexer/issues/elasticsearch/elasticsearch_test.go @@ -14,6 +14,7 @@ import ( ) func TestElasticsearchIndexer(t *testing.T) { + t.Skip("elasticsearch not found in Forgejo test yet") // The elasticsearch instance started by pull-db-tests.yml > test-unit > services > elasticsearch url := "http://elastic:changeme@elasticsearch:9200" diff --git a/modules/indexer/issues/meilisearch/meilisearch_test.go b/modules/indexer/issues/meilisearch/meilisearch_test.go index 3d7237268e..8a6b0a61d3 100644 --- a/modules/indexer/issues/meilisearch/meilisearch_test.go +++ b/modules/indexer/issues/meilisearch/meilisearch_test.go @@ -14,6 +14,7 @@ import ( ) func TestMeilisearchIndexer(t *testing.T) { + t.Skip("meilisearch not found in Forgejo test yet") // The meilisearch instance started by pull-db-tests.yml > test-unit > services > meilisearch url := "http://meilisearch:7700" key := "" // auth has been disabled in test environment diff --git a/tests/mysql.ini.tmpl b/tests/mysql.ini.tmpl index 6b5f11eb22..47f2a099af 100644 --- a/tests/mysql.ini.tmpl +++ b/tests/mysql.ini.tmpl @@ -12,8 +12,6 @@ SSL_MODE = disable [indexer] REPO_INDEXER_ENABLED = true REPO_INDEXER_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mysql/indexers/repos.bleve -ISSUE_INDEXER_TYPE = elasticsearch -ISSUE_INDEXER_CONN_STR = http://elastic:changeme@elasticsearch:9200 [queue.issue_indexer] TYPE = level From a427f8dae539e9b38b8ca0e86ebb09cc2940e5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Tue, 30 May 2023 00:57:10 +0200 Subject: [PATCH 09/94] [CI] Search .forgejo/workflows first (cherry picked from commit 8b11cab677503be78b1deb17ed9dd5fb1c823a7d) (cherry picked from commit be5927069674a17a4c09e7f0aa530bc4630851a9) (cherry picked from commit e068f8b191585e2910d8a45ea78bfa1b78015bed) (cherry picked from commit 7855bb0c60b5ec2a972ae04e4515ee5adb19a5e7) (cherry picked from commit 45c4c8f44383dced75ab83f7c817b52e78968fab) (cherry picked from commit 89520d67ffe0062e1accd39763e1e7dd5058d83a) (cherry picked from commit 15eeb417a4b8bb948f888c73e20135c1e0fd1f63) (cherry picked from commit 6db53a26432f02ae50da948483e2010bd962f9ce) (cherry picked from commit 2f689b321fa275b6412f0b8686edc7aba97c3565) (cherry picked from commit 04dc478314c3b4927cca78c354ca46ee217f035a) (cherry picked from commit a554624f40f51c1c75d754d6cca14f7626bb599e) (cherry picked from commit abca05f0d1c29680bba897cc0de7037053915ced) (cherry picked from commit dc13e7eb22f2bde817f3845c646574d8f39c1b18) (cherry picked from commit a161c5740eb5e76c13354ba2388fa34ae925fd8b) (cherry picked from commit 06d33e2773f01b576ba050afe2b88718a7999434) (cherry picked from commit f536275161cc4bf5d2f163bd68a4c4498c9fff3d) (cherry picked from commit 84ac6f314a1840d45bdecb2ccd4482fb925fd2c2) (cherry picked from commit 1e8126edfc3a6c78cda35f053bd0ac40ba9874ef) (cherry picked from commit 0287ac3416563e0af05c3aeabc338b791c74ddb2) (cherry picked from commit 3e5fca2aaea299013691f102b10417ac33988df0) (cherry picked from commit 03b220bfeb86caa82eec2a67caf9a08460cf76c0) (cherry picked from commit 1d033f4aaf2b7db1ae98e91d96ef3b8a0b07539e) (cherry picked from commit 2ee9e3e9a395357885f16fa8a22a24cda79f637f) (cherry picked from commit d28c2849931e7de2ae1660513774047bf6868e1a) (cherry picked from commit 239df83859f88f7833f5796ee1f0811732c6e9a2) (cherry picked from commit 96ae0c2e5d4fafbead44db52297e21242da0a6d0) (cherry picked from commit 49aef71b322395674a5360bac7b93561e773ea35) (cherry picked from commit 38b56d108d3f27faa0dc191518e6dbcb775fd7bf) (cherry picked from commit 30f8d9ec3adecf4025fc3547e9a745d700f68d83) (cherry picked from commit d5318618509f5d8bdef999445357553ab1c4cb5c) (cherry picked from commit a75707deaa52cd3fedfda766460bcc8f2d7dea92) (cherry picked from commit b1c73918b2ddaa4a59d9e7405b3b5bea5ccd496a) (cherry picked from commit 53919170919bfcd3dca00ecbeb0778eadb0af075) --- modules/actions/workflows.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index cbc7e011d1..8a44e9dbe2 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -40,11 +40,14 @@ func IsWorkflow(path string) bool { return false } - return strings.HasPrefix(path, ".gitea/workflows") || strings.HasPrefix(path, ".github/workflows") + return strings.HasPrefix(path, ".forgejo/workflows") || strings.HasPrefix(path, ".gitea/workflows") || strings.HasPrefix(path, ".github/workflows") } func ListWorkflows(commit *git.Commit) (git.Entries, error) { - tree, err := commit.SubTree(".gitea/workflows") + tree, err := commit.SubTree(".forgejo/workflows") + if _, ok := err.(git.ErrNotExist); ok { + tree, err = commit.SubTree(".gitea/workflows") + } if _, ok := err.(git.ErrNotExist); ok { tree, err = commit.SubTree(".github/workflows") } From 929b75ee39cd6d1a462bbd0c20597c357949c953 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 28 May 2023 15:31:52 +0200 Subject: [PATCH 10/94] [CI] Forgejo Actions based CI for PR & branches (cherry picked from commit f9d75d4705ece5c119f2fd5e2bfbaf630d0bf739) (cherry picked from commit 64f76f4ab269daa6a584305164732c68be0161c5) (cherry picked from commit 5d024541551f1be98444923f0fa327a855104725) [CI] Forgejo Actions workflows (cherry picked from commit 3ff59b5379ebf761f32875f9d869a1d18f79741c) (cherry picked from commit 8af826a6f7c70d03079ec68f10230041695017cd) (cherry picked from commit d7c09d9cc80037a28d488da142ae2a2a99f59ac9) [CI] use the docker label instead of ubuntu-latest (cherry picked from commit b6a6470db6c8bae9963e204f9c8c408f309e81e3) [CI] all tests need compliance before proceeding (cherry picked from commit b35c496f2c3034164b9bb3a3550f35026adf9372) (cherry picked from commit 36a4148a8ec654ae9fa5a6925a3b8606b96aebcc) (cherry picked from commit 7ffcffa653808a284f422fdc31f6ea07874b585d) (cherry picked from commit 8a246d296e502c181c6ee779d1773c9e78ca7acf) (cherry picked from commit dd0b6e1826ba7699f967de2c00c1332909a53473) [CI] Forgejo Actions based release process (squash) MySQL optimization Refs: https://codeberg.org/forgejo/forgejo/issues/976 (cherry picked from commit b4b8c489e6e9fe36349eced5d4249467b25df2a7) (cherry picked from commit 1e861db4afdc32549784381a96b16dac508ec1c0) (cherry picked from commit a6c0e00330ded851c2f524039259f0b723d793e4) (cherry picked from commit f97b336465fd6be15079e756c9ee3a580f0aa339) (cherry picked from commit 6d65d5f0d6f798556a8f9e547896be03a5ee2f87) (cherry picked from commit 79bfbadbed3bf84b96f2c027d119a4aa5c60d5e2) (cherry picked from commit e86c40a34a97fc568c724ee5f8ee5b2bf46ebf19) (cherry picked from commit da0c454adbcf1b5dbb95d9d74afaa371e32351a0) (cherry picked from commit b49d892cda968b22ad6c29caade042690d96f2e2) [CI] enable minio tests (cherry picked from commit 4d8f4380311b872061bd20f561424662ecd8d817) (cherry picked from commit c4eeb0a61ef579c21b0382edd61c62adebe93b28) [CI] Forgejo Actions based CI for PR & branches (squash) cleanup (cherry picked from commit 80eb20e84267552c971096693558734f0ec7afdd) (cherry picked from commit d2ff589858961e4f25bc1d903cdf57df1db4c316) (cherry picked from commit f6eedecb67fce992605bb1fcdd93c866ec47a9d4) (cherry picked from commit cf458091e245e1c70944e940a214d5127f304303) (cherry picked from commit ddd322cb2de165126080b222c1b09b2a91fea182) (cherry picked from commit f0f5729b6467bea053d532c4c64c54a0fe737c98) Conflicts: .github/workflows/pull-db-tests.yml https://codeberg.org/forgejo/forgejo/pulls/1573 (cherry picked from commit bb347aedd4e5030eea46ce22176a0444619df6b8) (cherry picked from commit 0f5ebe8c3e78cef6f310ee9097a8413df904c08a) (cherry picked from commit 9101cb4715ed88c6a3f0ad14443758d9bc9c61ed) (cherry picked from commit ab118fe4efd96e9bb7134065643f094a379bb192) [CI] Forgejo Actions based CI for PR & branches (squash) use node:20-bookworm No longer use the custom test-env image, it is unecessary technical debt. Also upgrade to bitnami/minio:2023.8.31 to align with what Gitea tests (cherry picked from commit d9b77fd2735a52043b4f8f1baaaa2e15073db621) (cherry picked from commit ef8f099f9ea03d216324ceff348fe643240341dc) (cherry picked from commit 6d3c675d203ba838de1f0540977f5e7e9f62f055) (cherry picked from commit fc00ff45f2e810cc2a84bf57cdb2765830e5b07f) (cherry picked from commit b7f02b9846b8c7087a4827a9c87f48eafd2ba1a2) (cherry picked from commit d23d86e56728f4a263a0567c14e2dc20407baaff) (cherry picked from commit e68e65460c40d343a3ada858c0c48d03a6a14bbb) (cherry picked from commit 96f93a1fdb9f2c6ecbd05ac24c5375f3e0d631df) (cherry picked from commit 2ff3080018633212075935ec6644654184009a2e) (cherry picked from commit 8ea00bcff471b877e442f7b78bb46880c9e396f0) (cherry picked from commit 85be961970b0d374d9816348a8a1b51289f7c787) (cherry picked from commit 387b279fc33d79be1f0f0b35b32f5c17b0d64c9c) (cherry picked from commit 219be7aa85fbf2bd5cb9daead3544b27f6200d83) --- .forgejo/workflows/testing.yml | 189 +++++++++++++++++++++++++++++++++ modules/storage/minio_test.go | 2 +- 2 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/testing.yml diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml new file mode 100644 index 0000000000..b4b9d1fd19 --- /dev/null +++ b/.forgejo/workflows/testing.yml @@ -0,0 +1,189 @@ +name: testing + +on: + pull_request: + push: + branches: + - 'forgejo*' + - 'v*/forgejo*' + +jobs: + lint-backend: + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + check-latest: true + - run: make deps-backend deps-tools + - run: make lint-backend + env: + TAGS: bindata sqlite sqlite_unlock_notify + checks-backend: + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + check-latest: true + - run: make deps-backend deps-tools + - run: make --always-make checks-backend # ensure the "go-licenses" make target runs + test-unit: + runs-on: docker + needs: [lint-backend, checks-backend] + container: + image: 'docker.io/node:20-bookworm' + services: + minio: + image: 'docker.io/bitnami/minio:2023.8.31' + env: + MINIO_ROOT_USER: 123456 + MINIO_ROOT_PASSWORD: 12345678 + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + - run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata + - run: | + su forgejo -c 'make unit-test-coverage test-check' + timeout-minutes: 50 + env: + RACE_ENABLED: 'true' + TAGS: bindata + test-mysql: + runs-on: docker + needs: [lint-backend, checks-backend] + container: + image: 'docker.io/node:20-bookworm' + services: + mysql: + image: 'docker.io/mysql:8-debian' + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + # + # See also https://codeberg.org/forgejo/forgejo/issues/976 + # + cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000'] + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: "1.21" + - name: install dependencies + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get install --no-install-recommends -qq -y git-lfs + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata + - run: | + su forgejo -c 'make test-mysql-migration test-mysql' + timeout-minutes: 50 + env: + TAGS: bindata + USE_REPO_TEST_DIR: 1 + test-pgsql: + runs-on: docker + needs: [lint-backend, checks-backend] + container: + image: 'docker.io/node:20-bookworm' + services: + minio: + image: bitnami/minio:2021.3.17 + env: + MINIO_ACCESS_KEY: 123456 + MINIO_SECRET_KEY: 12345678 + pgsql: + image: 'docker.io/postgres:15' + env: + POSTGRES_DB: test + POSTGRES_PASSWORD: postgres + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: "1.21" + - name: install dependencies + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get install --no-install-recommends -qq -y git-lfs + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata + - run: | + su forgejo -c 'make test-pgsql-migration test-pgsql' + timeout-minutes: 50 + env: + TAGS: bindata gogit + RACE_ENABLED: true + TEST_TAGS: gogit + USE_REPO_TEST_DIR: 1 + test-sqlite: + runs-on: docker + needs: [lint-backend, checks-backend] + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: "1.21" + - name: install dependencies + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get install --no-install-recommends -qq -y git-lfs + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata gogit sqlite sqlite_unlock_notify + - run: | + su forgejo -c 'make test-sqlite-migration test-sqlite' + timeout-minutes: 50 + env: + TAGS: bindata gogit sqlite sqlite_unlock_notify + RACE_ENABLED: true + TEST_TAGS: gogit sqlite sqlite_unlock_notify + USE_REPO_TEST_DIR: 1 diff --git a/modules/storage/minio_test.go b/modules/storage/minio_test.go index c6fbb91ab4..2364ced0ef 100644 --- a/modules/storage/minio_test.go +++ b/modules/storage/minio_test.go @@ -22,7 +22,7 @@ func TestMinioStorageIterator(t *testing.T) { } testStorageIterator(t, setting.MinioStorageType, &setting.Storage{ MinioConfig: setting.MinioStorageConfig{ - Endpoint: "127.0.0.1:9000", + Endpoint: "minio:9000", AccessKeyID: "123456", SecretAccessKey: "12345678", Bucket: "gitea", From df4099247f63d36e259642c0c84c3620ac3a93b0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 14 Jun 2023 13:32:20 +0200 Subject: [PATCH 11/94] [CI] Forgejo Actions based release process Refs: https://codeberg.org/forgejo/website/pulls/230 (cherry picked from commit 87d56bf6c73d726dae8aafbc7e147969f1899931) [CI] Forgejo Actions based release process (squash) base64 -w0 to avoid wrapping when the doer name is long as it creates a broken config.json (cherry picked from commit 9efdc27e49bdfb3e62401baf27b224385f9f3e5e) [CI] Forgejo Actions based release process (squash) generate .xz files and sources Generate .xz files Check .sha256 Generate the source tarbal (cherry picked from commit 7afec520c4b1032d7e67a05a41e4e2913bcd9312) [CI] Forgejo Actions based release process (squash) release notes (cherry picked from commit d8f4f4807b28297b318d2f555a76d0efef762cf7) [CI] Forgejo Actions based release process (squash) publish and sign release (cherry picked from commit a52778c74785fe57cdee3b64b4c6c8a326471532) (cherry picked from commit cf2ec6274094ac7aebda71d54c64581f528df00a) [CI] Forgejo Actions based release process (squash) version use Actions environment variables in Makefile (#25319) (#25318) uses Actions variable to determine the version. But Forgejo builds happen in a container where they are not available. Do not use them. Also verify the version of the binary is as expected for sanity check. (cherry picked from commit 6decf111a132a869f9e5c6f4d20e368b8f74309f) (cherry picked from commit 206d0b3886b2d56b585bf552e53d952b35f07284) [CI] read STORED_VERSION_FILE if available (cherry picked from commit af74085ebf51c91a51db865a66667fca511838d5) [CI] backward compatible executable compilation Add a new static-executable target to use in Dockerfiles and restore the $(EXECUTABLE) target to what it was before to for backward compatibility. The release process now builds static executables instead of dynamically linked ones which makes them more portable. It changes the requirements at compile time and is not backward compatible. In particular it may break packaging that rely on the target that currently creates a dynamically linked executable. (cherry picked from commit 84d02a174a4398b1f8ee62e08db5483a9859650f) (cherry picked from commit 854be47328cc0283119dfb78f9ba0b8306c85f75) [CI] Forgejo Actions based release process (squash) doc / ca / verbosity - Document workflow - Increase verbosity if VERBOSE=true - Download the Certificate Authority if behind the VPN (cherry picked from commit 168d5d586904835762d213b2b8815b458a38c78f) (cherry picked from commit 8756c9a72a40830441124256b7382f900a1052f8) (cherry picked from commit 2dad7ef20f3bf9ebe2425e2e28b66a4ca21c6786) [CI] Forgejo Actions based release process (squash) add assets sources-tarbal Refs: https://codeberg.org/forgejo/forgejo/issues/1115 (cherry picked from commit 5531d01f1981df665f5b8f642e9241e8ea4f4578) [CI] Forgejo Actions based release process (squash) add assets sources-tarbal bindata.go is a file, not a directory Refs: https://codeberg.org/forgejo/forgejo/issues/1115 (cherry picked from commit bd88a4477817be34ea86ebb2f460b9fe8ab5f1b7) (cherry picked from commit b408085138c578dfaacafbd4b7719ca926456855) [CI] Forgejo Actions based release process (squash) public/assets moved (cherry picked from commit d8c921d5a643ed05f2935348531996fe4d08c654) (cherry picked from commit f29e50b1a09b1a22fc2dbdb77e9a1def1196175b) [CI] Fix release notes link - Use substitution to replace all dots with dashes. - Resolves https://codeberg.org/forgejo/forgejo/issues/1163 (cherry picked from commit 96783728f53a072915cace392aa269adfe9a5c73) (cherry picked from commit c8d8bf8996beb650cd86cafb110e85e1e05917a0) [CI] pin go v1.20 for testing Refs: https://codeberg.org/forgejo/forgejo/issues/1228 (cherry picked from commit fd4b5a013ee0f31453b623d12001a8b810cd7ebc) (cherry picked from commit 00bb15f57f2ae5a11abc8b044ed99dc949e812a7) Conflicts: Dockerfile Dockerfile.rootless see https://codeberg.org/forgejo/forgejo/pulls/1303 (cherry picked from commit 6e2be54a6d95412ce770d4bab1a39c77591f44dc) (cherry picked from commit 346c418b4a8c0e1f8c9aace44b00373a4bf76732) (cherry picked from commit 49061f8422cb6aa9ddc14edb507f50477624eb7a) (cherry picked from commit 8229d59b7e1ba61959de6ecd95d9dd49bc2436dc) (cherry picked from commit 70d45d919309d8127551c8ad44538a730b795638) [CI] Forgejo Actions based release process (squash) need node 18 (cherry picked from commit 722b1f45902ecca3179a92700a2f5c1080422a04) (cherry picked from commit a91d786169fb4694aed4af68792437a0a67de3fa) [CI] Forgejo Actions based release process (squash) fix indentation (cherry picked from commit fbdf9d6abb88fd5def3d0ced488a4dd72655d433) (cherry picked from commit 2deff90a13397339796ac5a94d63b0d8cd9760a9) (cherry picked from commit 5710a27fda58093f0db1605585e730c314b933f5) [CI] Forgejo Actions based release process (squash) FQIN for docker Refs: https://codeberg.org/forgejo/forgejo/issues/1600 (cherry picked from commit f63d38deb6a9933ce996a61a099f4b79e9171581) [CI] Forgejo Actions based release process (squash) use forgejo-curl.sh (cherry picked from commit c0c3ef506fa500cb9626034c5e00913b3c31e08c) (cherry picked from commit 933ca7ec5dcab55c8593dee4a6cd13281502c41e) Conflicts: Dockerfile Dockerfile.rootless https://codeberg.org/forgejo/forgejo/pulls/1691 (cherry picked from commit 1068e48805de9d7464b41f32e1c5567d3747239a) [CI] Forgejo Actions based release process (squash) size optimization (cherry picked from commit 3c653ff7428dbf898a5131b5c817ce3b13ec0591) (cherry picked from commit 398567fc0cf9edd0be49541339800af985e8b1b6) (cherry picked from commit e585db9a970e7a84eaff06758a094a297ae6fc48) (cherry picked from commit 17e91c96e3259b0d8fa87294470339779d62aa71) [CI] Forgejo Actions based release process (squash) gitea to forgejo (cherry picked from commit 9c06a318b867ea8c60dd194ca393bac3b718b07b) (cherry picked from commit 95859da3b40306c1e07277230c2f401ef8b82a13) (cherry picked from commit e3a5f6c1ed4e5452f3664aa8d398805c3b9c0a51) (cherry picked from commit 7b9b259c75e0b2b805a2239ecf7c85a3f0dbd648) (cherry picked from commit c4a152c8dc4ab5d20c72f9f7d60ce6eee3be5cda) (cherry picked from commit b00bf599efa97a18adac134a1402418785c5bae2) (cherry picked from commit a7836ee2ee2638091f0f9ff5543548ae0bb94060) (cherry picked from commit 3ea7dcbd5b196b6fc9115d49d50678a1a5940c0b) (cherry picked from commit 454d705e830ade3a41a33341b82d4c8aff584dcd) (cherry picked from commit 35e06c3009f4a1942222dc35cc0993a623164b25) (cherry picked from commit 904468a38ffdfb8157dc4eaf92b3ba10c3a957db) (cherry picked from commit 890e86815a5a33b2930150a7460cd96b4360ac88) (cherry picked from commit bf9f94c63d8c15ce62881ccadc28681848b7ebd7) (cherry picked from commit d025d061d14929aaabbfc4603099e32cb888ac3b) (cherry picked from commit 32f209a8e1b2ee109f7ae8b150d4390318c0ff2a) (cherry picked from commit 38ef6802fca7301f4cb03769e8d6dae1e256933f) (cherry picked from commit 8a19bbd2a8160b7d3d5a1ea083507b4311070ab6) (cherry picked from commit f352dee786d2541fbe360fe8f859d3182c632240) (cherry picked from commit b53d9fc090b58848876b4f97e8ed03face85a63b) (cherry picked from commit 3dae21f4c87c82b75515d3db43c1bbd4d9f3f1ac) (cherry picked from commit 8b59e016c7a1eb3f6d0077d8e6f205b8bcefe402) (cherry picked from commit 6f54ea6a0eb0f9c4360237f78eb76c55678547e2) (cherry picked from commit ed8d90de6bb9513a2dcdc70aac446bbcaf0855c9) (cherry picked from commit 26ffd3fcace55279091fe95074a65dd1c4b7758a) (cherry picked from commit 287b3bbfb5a66e64d3490a282153bfd2393b7afa) (cherry picked from commit ab81378d0c88def332f43843eeac23ef768bb143) (cherry picked from commit f6bbe7e875e707fcbadf7434818edb897467a5ef) (cherry picked from commit 8968f34edf064e6bffc3cc7054307c6303256acd) (cherry picked from commit d3d914bba2bec4f50f9d71d347b510771df99656) (cherry picked from commit 4e4006a990dd22c23ffd6e9b7e3af6aac1855d52) (cherry picked from commit edb333569b38e38f94dbb769d793b53cdf39b96f) (cherry picked from commit 6c1a4baa15aebd1b27b742097181b1ca4afbd31c) (cherry picked from commit 51bda3bfc734eccee198d4ccb377520d7f16ccb3) (cherry picked from commit 6f5f318b8f1f9086ef981c181a97ebbcbe6e11be) (cherry picked from commit e128da23624c90f2817ccb3f15c5df9704f2c597) (cherry picked from commit 3e6735ff23ae6c6a6963629cf4bc5d8acd26f905) (cherry picked from commit 938c4441259e0ef1714d6e411bd49df15f048103) (cherry picked from commit 67f92dc9ab4ae8263c2f69e6729b3f1198943401) (cherry picked from commit ee31df71fb70c2938fcf82b5c9a518a54bd4c078) (cherry picked from commit 386f232191561867c7888ec94374f8f9505c4ff9) (cherry picked from commit 745785cd7f90cf2665f11fb9bed960a16e238fa4) (cherry picked from commit efa8564e762b5369a77a10422bd1f6dd1433c62b) Conflicts: Dockerfile Dockerfile.rootless https://codeberg.org/forgejo/forgejo/pulls/2029 (cherry picked from commit f3dfb143216501411f2e2f522bcce64debfdc07d) (cherry picked from commit 5a0346ee95f2f30e8955ad886500e9f1c6508c18) (cherry picked from commit 7a2a6517f2a09cec7bba873696724455134b5734) (cherry picked from commit 87dcc87da9e20977a7e2c2104312a23c9d5dacb4) --- .forgejo/actions/build-release/action.yml | 154 ++++++++++++++ .forgejo/actions/publish-release/action.yml | 110 ++++++++++ .forgejo/testdata/build-release/Dockerfile | 3 + .forgejo/testdata/build-release/Makefile | 5 + .../build-release/modules/public/bindata.go | 0 .../public/assets/css/placeholder | 0 .../public/assets/fonts/placeholder | 0 .../public/assets/js/placeholder | 0 .../workflows/build-release-integration.yml | 99 +++++++++ .forgejo/workflows/build-release.yml | 190 ++++++++++++++++++ .forgejo/workflows/publish-release.yml | 60 ++++++ Dockerfile | 43 ++-- Dockerfile.rootless | 48 +++-- Makefile | 33 +-- 14 files changed, 689 insertions(+), 56 deletions(-) create mode 100644 .forgejo/actions/build-release/action.yml create mode 100644 .forgejo/actions/publish-release/action.yml create mode 100644 .forgejo/testdata/build-release/Dockerfile create mode 100644 .forgejo/testdata/build-release/Makefile create mode 100644 .forgejo/testdata/build-release/modules/public/bindata.go create mode 100644 .forgejo/testdata/build-release/public/assets/css/placeholder create mode 100644 .forgejo/testdata/build-release/public/assets/fonts/placeholder create mode 100644 .forgejo/testdata/build-release/public/assets/js/placeholder create mode 100644 .forgejo/workflows/build-release-integration.yml create mode 100644 .forgejo/workflows/build-release.yml create mode 100644 .forgejo/workflows/publish-release.yml diff --git a/.forgejo/actions/build-release/action.yml b/.forgejo/actions/build-release/action.yml new file mode 100644 index 0000000000..01fdfdedfc --- /dev/null +++ b/.forgejo/actions/build-release/action.yml @@ -0,0 +1,154 @@ +name: 'Build release' +author: 'Forgejo authors' +description: | + Build release + +inputs: + forgejo: + description: 'URL of the Forgejo instance where the release is uploaded' + required: true + owner: + description: 'User or organization where the release is uploaded, relative to the Forgejo instance' + required: true + repository: + description: 'Repository where the release is uploaded, relative to the owner' + required: true + doer: + description: 'Name of the user authoring the release' + required: true + tag-version: + description: 'Version of the release derived from the tag withint the leading v' + required: true + suffix: + description: 'Suffix to add to the image tag' + token: + description: 'token' + required: true + dockerfile: + description: 'path to the dockerfile' + default: 'Dockerfile' + platforms: + description: 'Coma separated list of platforms' + default: 'linux/amd64,linux/arm64' + release-notes: + description: 'Full text of the release notes' + default: 'Release notes placeholder' + binary-name: + description: 'Name of the binary' + binary-path: + description: 'Path of the binary within the container to extract into binary-name' + verbose: + description: 'Increase the verbosity level' + default: 'false' + +runs: + using: "composite" + steps: + - run: echo "${{ github.action_path }}" >> $GITHUB_PATH + shell: bash + + - name: Install dependencies + run: | + apt-get install -y -qq xz-utils + + - name: set -x if verbose is required + id: verbose + run: | + if ${{ inputs.verbose }} ; then + echo "shell=set -x" >> "$GITHUB_OUTPUT" + fi + + - name: Create the insecure and buildx-config variables for the container registry + id: registry + run: | + ${{ steps.verbose.outputs.shell }} + url="${{ inputs.forgejo }}" + hostport=${url##http*://} + hostport=${hostport%%/} + echo "host-port=${hostport}" >> "$GITHUB_OUTPUT" + if ! [[ $url =~ ^http:// ]] ; then + exit 0 + fi + cat >> "$GITHUB_OUTPUT" < /etc/docker/daemon.json < ~/.docker/config.json + env: + CI_REGISTRY: "${{ steps.registry.outputs.host-port }}" + + - name: Build the container image for each architecture + uses: https://github.com/docker/build-push-action@v4 + # workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released + env: + ACTIONS_RUNTIME_TOKEN: '' + with: + context: . + push: true + file: ${{ inputs.dockerfile }} + platforms: ${{ inputs.platforms }} + tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }} + + - name: Extract the binary from the container images into the release directory + if: inputs.binary-name != '' + run: | + ${{ steps.verbose.outputs.shell }} + mkdir -p release + cd release + for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do + arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g') + docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }} + binary="${{ inputs.binary-name }}-${{ inputs.tag-version }}-linux" + docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch + chmod +x $binary-$arch + # the displayed version has a + instead of the first -, deal with it + pattern=$(echo "${{ inputs.tag-version }}" | tr - .) + if ! ./$binary-$arch --version | grep "$pattern" ; then + echo "ERROR: expected version pattern $pattern not found in the output of $binary-$arch --version" + ./$binary-$arch --version + exit 1 + fi + xz --keep -9 $binary-$arch + shasum -a 256 $binary-$arch > $binary-$arch.sha256 + shasum -a 256 $binary-$arch.xz > $binary-$arch.xz.sha256 + docker rm forgejo-$arch + done + + - name: publish release + if: inputs.binary-name != '' + uses: https://code.forgejo.org/actions/forgejo-release@v1 + with: + direction: upload + release-dir: release + release-notes: "${{ inputs.release-notes }}" + token: ${{ inputs.token }} + verbose: ${{ steps.verbose.outputs.value }} diff --git a/.forgejo/actions/publish-release/action.yml b/.forgejo/actions/publish-release/action.yml new file mode 100644 index 0000000000..42b6097ee0 --- /dev/null +++ b/.forgejo/actions/publish-release/action.yml @@ -0,0 +1,110 @@ +name: 'Publish release' +author: 'Forgejo authors' +description: | + Publish release + +inputs: + forgejo: + description: 'URL of the Forgejo instance where the release is uploaded (e.g. https://codeberg.org)' + required: true + from-owner: + description: 'the owner from which a release is to be copied (e.g forgejo-integration)' + required: true + to-owner: + description: 'the owner to which a release is to be copied (e.g. forgejo-experimental). It has be an organization in which doer has the required permissions. Or be the same as the doer' + required: true + repo: + description: 'the repository from which a release is to be copied relative to from-owner and to-owner' + default: 'forgejo' + ref-name: + description: 'ref_name of the tag of the release to be copied (e.g. github.ref_name)' + required: true + doer: + description: 'Name of the user authoring the release (e.g. release-team). The user must be authorized to create packages in to-owner and releases in to-owner/repo' + required: true + token: + description: 'application token created on forgejo by the doer, with a scope allowing it to create packages in to-owner and releases in to-owner/repo' + required: true + gpg-private-key: + description: 'GPG Private Key to sign the release artifacts' + gpg-passphrase: + description: 'Passphrase of the GPG Private Key' + verbose: + description: 'Increase the verbosity level' + default: 'false' + +runs: + using: "composite" + steps: + - id: hostport + run: | + url="${{ inputs.forgejo }}" + hostport=${url##http*://} + hostport=${hostport%%/} + echo "value=$hostport" >> "$GITHUB_OUTPUT" + + - id: tag-version + run: | + version="${{ inputs.ref-name }}" + version=${version##*v} + echo "value=$version" >> "$GITHUB_OUTPUT" + + - name: Create the release notes + id: release-notes + run: | + anchor=${{ steps.tag-version.outputs.value }} + anchor=${anchor//./-} + cat >> "$GITHUB_OUTPUT" < /app/gitea/gitea ; chmod +x /app/gitea/gitea diff --git a/.forgejo/testdata/build-release/Makefile b/.forgejo/testdata/build-release/Makefile new file mode 100644 index 0000000000..406acd06d2 --- /dev/null +++ b/.forgejo/testdata/build-release/Makefile @@ -0,0 +1,5 @@ +VERSION ?= $(shell cat VERSION 2>/dev/null) +sources-tarbal: + mkdir -p dist/release + echo $(VERSION) > VERSION + sources=forgejo-src-$(VERSION).tar.gz ; tar --transform 's|^./|forgejo-src-$(VERSION)/|' -czf dist/release/forgejo-src-$(VERSION).tar.gz . ; cd dist/release ; shasum -a 256 $$sources > $$sources.sha256 diff --git a/.forgejo/testdata/build-release/modules/public/bindata.go b/.forgejo/testdata/build-release/modules/public/bindata.go new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.forgejo/testdata/build-release/public/assets/css/placeholder b/.forgejo/testdata/build-release/public/assets/css/placeholder new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.forgejo/testdata/build-release/public/assets/fonts/placeholder b/.forgejo/testdata/build-release/public/assets/fonts/placeholder new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.forgejo/testdata/build-release/public/assets/js/placeholder b/.forgejo/testdata/build-release/public/assets/js/placeholder new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml new file mode 100644 index 0000000000..2920729d33 --- /dev/null +++ b/.forgejo/workflows/build-release-integration.yml @@ -0,0 +1,99 @@ +name: Integration tests for the release process + +on: + push: + paths: + - Makefile + - Dockerfile + - Dockerfile.rootless + - docker/** + - .forgejo/actions/build-release/action.yml + - .forgejo/workflows/build-release.yml + - .forgejo/workflows/build-release-integration.yml + +jobs: + release-simulation: + runs-on: self-hosted + if: secrets.ROLE != 'forgejo-integration' && secrets.ROLE != 'forgejo-experimental' && secrets.ROLE != 'forgejo-release' + steps: + - uses: actions/checkout@v3 + + - id: forgejo + uses: https://code.forgejo.org/actions/setup-forgejo@v1 + with: + user: root + password: admin1234 + image-version: 1.19 + lxc-ip-prefix: 10.0.9 + + - name: publish the forgejo release + run: | + set -x + + version=1.2.3 + cat > /etc/docker/daemon.json < $binary$suffix + if test "$suffix" = .xz ; then + unxz --keep $binary$suffix + fi + chmod +x $binary + ./$binary --version | grep $version + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256 + shasum -a 256 --check $binary$suffix.sha256 + rm $binary$suffix + done + done + + sources=forgejo-src-$version.tar.gz + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256 + shasum -a 256 --check $sources.sha256 + + docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version + docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml new file mode 100644 index 0000000000..e080504261 --- /dev/null +++ b/.forgejo/workflows/build-release.yml @@ -0,0 +1,190 @@ +name: Build release + +on: + push: + tags: 'v*' + +jobs: + release: + runs-on: self-hosted + # root is used for testing, allow it + if: secrets.ROLE == 'forgejo-integration' || github.repository_owner == 'root' + steps: + - uses: actions/checkout@v3 + + - name: Increase the verbosity when there are no secrets + id: verbose + run: | + if test -z "${{ secrets.TOKEN }}"; then + value=true + else + value=false + fi + echo "value=$value" >> "$GITHUB_OUTPUT" + + - name: Sanitize the name of the repository + id: repository + run: | + set -x # comment out + repository="${{ github.repository }}" + echo "value=${repository##*/}" >> "$GITHUB_OUTPUT" + + - name: When in a test environment, create a token + id: token + if: ${{ secrets.TOKEN == '' }} + run: | + apt-get -qq install -y jq + url="${{ env.GITHUB_SERVER_URL }}" + hostport=${url##http*://} + hostport=${hostport%%/} + doer=root + api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens + curl -sS -X DELETE $api/release + token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1) + echo "value=${token}" >> "$GITHUB_OUTPUT" + + - uses: https://code.forgejo.org/actions/setup-node@v3 + with: + node-version: 18 + + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.20" + check-latest: true + + - name: Create the version from ref_name + id: tag-version + run: | + version="${{ github.ref_name }}" + version=${version##*v} + echo "value=$version" >> "$GITHUB_OUTPUT" + + - name: Create the release notes + id: release-notes + run: | + cat >> "$GITHUB_OUTPUT" < 2.0.1 + # css-loader: 6.8.1 => 6.8.1 + # esbuild-loader: 3.0.1 => 3.0.1 + # license-checker-webpack-plugin: 0.2.1 => 0.2.1 + # monaco-editor-webpack-plugin: 7.0.1 => 7.0.1 + # vue-loader: 17.2.2 => 17.2.2 + # webpack: 5.87.0 => 5.87.0 + # webpack-cli: 5.1.4 => 5.1.4 + # + chown -R $(id -u) . + make VERSION=$version TAGS=bindata sources-tarbal + mv dist/release release + + ( + tmp=$(mktemp -d) + tar --directory $tmp -zxvf release/*$version*.tar.gz + cd $tmp/* + # + # Verify `make frontend` files are available + # + test -d public/assets/css + test -d public/assets/fonts + test -d public/assets/js + # + # Verify `make generate` files are available + # + test -f modules/public/bindata.go + # + # Sanity check to verify that the source tarbal knows the + # version and is able to rebuild itself from it. + # + # When in sources the version is determined with git. + # When in the tarbal the version is determined from a VERSION file. + # + make sources-tarbal + tarbal=$(echo dist/release/*$version*.tar.gz) + if ! test -f $tarbal ; then + echo $tarbal does not exist + find dist release + exit 1 + fi + ) + + - name: build container & release (when TOKEN secret is not set) + if: ${{ secrets.TOKEN == '' }} + uses: ./.forgejo/actions/build-release + with: + forgejo: "${{ env.GITHUB_SERVER_URL }}" + owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" + repository: "${{ steps.repository.outputs.value }}" + doer: root + tag-version: "${{ steps.tag-version.outputs.value }}" + token: ${{ steps.token.outputs.value }} + platforms: linux/amd64,linux/arm64,linux/arm/v6 + release-notes: "${{ steps.release-notes.outputs.value }}" + binary-name: forgejo + binary-path: /app/gitea/gitea + verbose: ${{ steps.verbose.outputs.value }} + + - name: build rootless container (when TOKEN secret is not set) + if: ${{ secrets.TOKEN == '' }} + uses: ./.forgejo/actions/build-release + with: + forgejo: "${{ env.GITHUB_SERVER_URL }}" + owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" + repository: "${{ steps.repository.outputs.value }}" + doer: root + tag-version: "${{ steps.tag-version.outputs.value }}" + token: ${{ steps.token.outputs.value }} + platforms: linux/amd64,linux/arm64,linux/arm/v6 + suffix: -rootless + dockerfile: Dockerfile.rootless + verbose: ${{ steps.verbose.outputs.value }} + + - name: build container & release (when TOKEN secret is set) + if: ${{ secrets.TOKEN != '' }} + uses: ./.forgejo/actions/build-release + with: + forgejo: "${{ env.GITHUB_SERVER_URL }}" + owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" + repository: "${{ steps.repository.outputs.value }}" + doer: "${{ secrets.DOER }}" + tag-version: "${{ steps.tag-version.outputs.value }}" + token: "${{ secrets.TOKEN }}" + platforms: linux/amd64,linux/arm64,linux/arm/v6 + release-notes: "${{ steps.release-notes.outputs.value }}" + binary-name: forgejo + binary-path: /app/gitea/gitea + verbose: ${{ steps.verbose.outputs.value }} + + - name: build rootless container (when TOKEN secret is set) + if: ${{ secrets.TOKEN != '' }} + uses: ./.forgejo/actions/build-release + with: + forgejo: "${{ env.GITHUB_SERVER_URL }}" + owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" + repository: "${{ steps.repository.outputs.value }}" + doer: "${{ secrets.DOER }}" + tag-version: "${{ steps.tag-version.outputs.value }}" + token: "${{ secrets.TOKEN }}" + platforms: linux/amd64,linux/arm64,linux/arm/v6 + suffix: -rootless + dockerfile: Dockerfile.rootless + verbose: ${{ steps.verbose.outputs.value }} diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml new file mode 100644 index 0000000000..c76e78cc12 --- /dev/null +++ b/.forgejo/workflows/publish-release.yml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: MIT +# +# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process +# +# https://codeberg.org/forgejo-experimental/forgejo +# +# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental +# +# ROLE: forgejo-experimental +# FORGEJO: https://codeberg.org +# FROM_OWNER: forgejo-integration +# TO_OWNER: forgejo-experimental +# DOER: forgejo-experimental-ci +# TOKEN: +# +# https://forgejo.octopuce.forgejo.org/forgejo/forgejo +# +# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo +# +# ROLE: forgejo-release +# FORGEJO: https://codeberg.org +# FROM_OWNER: forgejo-integration +# TO_OWNER: forgejo +# DOER: release-team +# TOKEN: +# GPG_PRIVATE_KEY: +# GPG_PASSPHRASE: +# +name: Pubish release + +on: + push: + tags: 'v*' + +jobs: + publish: + runs-on: self-hosted + if: secrets.DOER != '' && secrets.FORGEJO != '' && secrets.TO_OWNER != '' && secrets.FROM_OWNER != '' && secrets.TOKEN != '' + steps: + - name: install the certificate authority + if: secrets.ROLE == 'forgejo-release' + run: | + apt-get install -qq -y wget + wget --no-check-certificate -O /usr/local/share/ca-certificates/enough.crt https://forgejo.octopuce.forgejo.org/forgejo/enough/raw/branch/main/certs/2023-05-13/ca.crt + update-ca-certificates --fresh + + - uses: actions/checkout@v3 + + - name: copy & sign binaries and container images from one owner to another + uses: ./.forgejo/actions/publish-release + with: + forgejo: ${{ secrets.FORGEJO }} + from-owner: ${{ secrets.FROM_OWNER }} + to-owner: ${{ secrets.TO_OWNER }} + ref-name: ${{ github.ref_name }} + doer: ${{ secrets.DOER }} + token: ${{ secrets.TOKEN }} + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + verbose: ${{ secrets.VERBOSE }} diff --git a/Dockerfile b/Dockerfile index 67c5398917..98d1d707b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -# Build stage -FROM docker.io/library/golang:1.21-alpine3.19 AS build-env +FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx + +FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.19 as build-env ARG GOPROXY ENV GOPROXY ${GOPROXY:-direct} @@ -9,24 +10,33 @@ ARG TAGS="sqlite sqlite_unlock_notify" ENV TAGS "bindata timetzdata $TAGS" ARG CGO_EXTRA_CFLAGS -# Build deps -RUN apk --no-cache add \ - build-base \ - git \ - nodejs \ - npm \ - && rm -rf /var/cache/apk/* +# +# Transparently cross compile for the target platform +# +COPY --from=xx / / +ARG TARGETPLATFORM +RUN apk --no-cache add clang lld +RUN xx-apk --no-cache add gcc musl-dev +ENV CGO_ENABLED=1 +RUN xx-go --wrap +# +# for go generate and binfmt to find +# without it the generate phase will fail with +# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1 +# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory +# why exactly is it needed? where is binfmt involved? +# +RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true + +RUN apk --no-cache add build-base git nodejs npm -# Setup repo COPY . ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -# Checkout version if set -RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ - && make clean-all build - -# Begin env-to-ini build -RUN go build contrib/environment-to-ini/environment-to-ini.go +RUN make clean-all +RUN make frontend +RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini +RUN make go-check generate-backend static-executable && xx-verify gitea # Copy local files COPY docker/root /tmp/local @@ -81,6 +91,7 @@ ENTRYPOINT ["/usr/bin/entrypoint"] CMD ["/bin/s6-svscan", "/etc/s6"] COPY --from=build-env /tmp/local / +RUN cd /usr/local/bin ; ln -s gitea forgejo COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh diff --git a/Dockerfile.rootless b/Dockerfile.rootless index a41c27b3e2..0c09df61a9 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -1,5 +1,6 @@ -# Build stage -FROM docker.io/library/golang:1.21-alpine3.19 AS build-env +FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx + +FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.19 as build-env ARG GOPROXY ENV GOPROXY ${GOPROXY:-direct} @@ -9,24 +10,33 @@ ARG TAGS="sqlite sqlite_unlock_notify" ENV TAGS "bindata timetzdata $TAGS" ARG CGO_EXTRA_CFLAGS -#Build deps -RUN apk --no-cache add \ - build-base \ - git \ - nodejs \ - npm \ - && rm -rf /var/cache/apk/* +# +# Transparently cross compile for the target platform +# +COPY --from=xx / / +ARG TARGETPLATFORM +RUN apk --no-cache add clang lld +RUN xx-apk --no-cache add gcc musl-dev +ENV CGO_ENABLED=1 +RUN xx-go --wrap +# +# for go generate and binfmt to find +# without it the generate phase will fail with +# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1 +# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory +# why exactly is it needed? where is binfmt involved? +# +RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true + +RUN apk --no-cache add build-base git nodejs npm -# Setup repo COPY . ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -# Checkout version if set -RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ - && make clean-all build - -# Begin env-to-ini build -RUN go build contrib/environment-to-ini/environment-to-ini.go +RUN make clean-all +RUN make frontend +RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini +RUN make go-check generate-backend static-executable && xx-verify gitea # Copy local files COPY docker/rootless /tmp/local @@ -69,18 +79,19 @@ RUN mkdir -p /var/lib/gitea /etc/gitea RUN chown git:git /var/lib/gitea /etc/gitea COPY --from=build-env /tmp/local / +RUN cd /usr/local/bin ; ln -s gitea forgejo COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh -# git:git +#git:git USER 1000:1000 ENV GITEA_WORK_DIR /var/lib/gitea ENV GITEA_CUSTOM /var/lib/gitea/custom ENV GITEA_TEMP /tmp/gitea ENV TMPDIR /tmp/gitea -# TODO add to docs the ability to define the ini to load (useful to test and revert a config) +#TODO add to docs the ability to define the ini to load (useful to test and revert a config) ENV GITEA_APP_INI /etc/gitea/app.ini ENV HOME "/var/lib/gitea/git" VOLUME ["/var/lib/gitea", "/etc/gitea"] @@ -88,3 +99,4 @@ WORKDIR /var/lib/gitea ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"] CMD [] + diff --git a/Makefile b/Makefile index ce67c0bcf0..48bbc5cbcc 100644 --- a/Makefile +++ b/Makefile @@ -83,31 +83,14 @@ endif STORED_VERSION_FILE := VERSION HUGO_VERSION ?= 0.111.3 -GITHUB_REF_TYPE ?= branch -GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) -ifneq ($(GITHUB_REF_TYPE),branch) - VERSION ?= $(subst v,,$(GITHUB_REF_NAME)) - GITEA_VERSION ?= $(VERSION) +STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null) +ifneq ($(STORED_VERSION),) + GITEA_VERSION ?= $(STORED_VERSION) else - ifneq ($(GITHUB_REF_NAME),) - VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME)) - else - VERSION ?= main - endif - - STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null) - ifneq ($(STORED_VERSION),) - GITEA_VERSION ?= $(STORED_VERSION) - else - GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') - endif -endif - -# if version = "main" then update version to "nightly" -ifeq ($(VERSION),main) - VERSION := main-nightly + GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') endif +VERSION = ${GITEA_VERSION} LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" @@ -788,9 +771,15 @@ security-check: $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ) CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ +static-executable: $(GO_SOURCES) $(TAGS_PREREQ) + CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE) + .PHONY: release release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check +# just the sources, with all assets builtin and frontend resources generated +sources-tarbal: frontend generate vendor release-sources release-check + $(DIST_DIRS): mkdir -p $(DIST_DIRS) From aa3a7249f7faf14363089783460da19744df35d1 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Mon, 21 Aug 2023 14:38:29 +0000 Subject: [PATCH 12/94] [CI] update DNS on experimental release (#1298) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1298 Co-authored-by: oliverpool Co-committed-by: oliverpool (cherry picked from commit 2aebc5ab4d58a90ed79e5487776d4f3eeea3b33f) (cherry picked from commit 8d66b6e7bcc1f2eae06e1dee65b4b8736f217824) (cherry picked from commit c782935f1b3d54a928f81a4dcd19bbca52c6f77c) (cherry picked from commit 51e071da7304badd0f301771322bde7a86d33ef5) (cherry picked from commit 81dbc87e1639510c1026541eb944267e9cbdb78b) (cherry picked from commit 7a9820474341ae05e39e7de92cfe7501014dc91d) (cherry picked from commit c679954950fb7641f3b281b3d33ae5dfb23aef8a) (cherry picked from commit 8e4a03f302db5270967cb82ef0371429ba512f85) (cherry picked from commit 5846953f61fe9202f49a1b9330369fea0d664149) (cherry picked from commit ffda919030dee2c9801676a4470545269302ff88) (cherry picked from commit f923b26d1e2287bbb0f03c16fe741c2c34d934dc) (cherry picked from commit abfe5ec45d72098058af864fefb82414e2e4b99c) (cherry picked from commit 35a7f5eb201a879af362f989d16fc61c3c68af1d) (cherry picked from commit c996d51bd60cbf5c66be6a9ef830b88e4519e14d) (cherry picked from commit c9d4a3d917960c997d4bb206f1ffaafa8308cd44) (cherry picked from commit ae22f9c34ffa429a3ac133091e02368d3125874f) (cherry picked from commit 9c4eee7aab6c72879f6c3dfe36c6b985cab29d8c) (cherry picked from commit 6245948d6cb7c8ee47d56850782ce5240f896cb2) (cherry picked from commit a286163c0bb2ebc57f80f75934c9be1ead663703) (cherry picked from commit 0bad00bb1c8182c3564f8a5915ae93eef987e95c) (cherry picked from commit 7653151793b1eec0886ff28f4dfb1ccb321137cc) (cherry picked from commit 614cc71c88d852d271c14184b6ad8087bcf4b6cd) --- .forgejo/workflows/publish-release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml index c76e78cc12..f7ab4586fb 100644 --- a/.forgejo/workflows/publish-release.yml +++ b/.forgejo/workflows/publish-release.yml @@ -58,3 +58,22 @@ jobs: gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} verbose: ${{ secrets.VERBOSE }} + + + - name: set up go for the DNS update below + uses: https://code.forgejo.org/actions/setup-go@v4 + if: secrets.ROLE == 'forgejo-experimental' + with: + go-version: ">=1.21" + check-latest: true + - name: update the _release.experimental DNS record + if: secrets.ROLE == 'forgejo-experimental' + uses: https://code.forgejo.org/actions/ovh-dns-update@v1 + with: + subdomain: _release.experimental + domain: forgejo.com # there is a CNAME from .org to .com (for security reasons) + record-id: 5283602601 + value: v=${{ github.ref_name }} + ovh-app-key: ${{ secrets.OVH_APP_KEY }} + ovh-app-secret: ${{ secrets.OVH_APP_SECRET }} + ovh-consumer-key: ${{ secrets.OVH_CON_KEY }} From 5d05f7f9f6c6a7d97fcaff0fd440aaa7b94853c9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 22 Aug 2023 08:19:54 +0200 Subject: [PATCH 13/94] [CI] lint-go-vet: do not include gitea-vet (cherry picked from commit 8cbbab7fefa62c66faba72d6f8ddcec33c5e6423) (cherry picked from commit 51113f0f29e2e7f9281ea568b8acddf6c26accb0) (cherry picked from commit 0d061e411f60bb4533460e1558646cdbc6a45aae) (cherry picked from commit 1eb4e7e691bf496b152916e11b991b16786752e2) (cherry picked from commit 3c3760f3b608303cc11e1cc3fea574e8166aeddc) (cherry picked from commit c11907373dfb8df7f974c726f46aee20727a9d3e) (cherry picked from commit d990fcf4469df8a4edede97e2c0980536ca98d86) (cherry picked from commit 62fd8a0b399802ca76bee0140f35357b2ddfd762) (cherry picked from commit 0663a2534101c0c6ed2fefd2eb84ce7f89bea4af) (cherry picked from commit c20d4386e530b56d9342a1403c682e86b5d25ada) (cherry picked from commit 5981040a197e002e6235194e92f4bad140572b49) (cherry picked from commit b62809313fdad4a50592d7f1035c6eeeb69949fb) (cherry picked from commit 205512ef96d305dd63415af280fd57cf0ffbc504) (cherry picked from commit 8b923cf770cbeaf113c509cacda859760c60ce0f) (cherry picked from commit bdc50fff48717c6597fe82cd3cb822b640dbb0a8) (cherry picked from commit 35da9d23164ef235bbd41793ed16b749b1b98e73) (cherry picked from commit f185ba6d03d99767f20d0df231eb27caf901a5a5) (cherry picked from commit dfe5502f566ec4b41cf24d13e22995f3ed33cc2d) (cherry picked from commit 193fd9bec794f8a15b6556b444e22c64ae604e8c) (cherry picked from commit 1e3af954eef66dfc7277274ee21c202403f023b9) (cherry picked from commit 0430ad731201780cea0f642754f63227af241766) --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 48bbc5cbcc..e5409eb92e 100644 --- a/Makefile +++ b/Makefile @@ -396,8 +396,7 @@ lint-go-windows: .PHONY: lint-go-vet lint-go-vet: @echo "Running go vet..." - @GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet - @$(GO) vet -vettool=gitea-vet $(GO_PACKAGES) + @$(GO) vet $(GO_PACKAGES) .PHONY: lint-editorconfig lint-editorconfig: From 7e6ccb52ff5159e39bc4d9d4bbd9b432a77e8703 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 22 Aug 2023 08:20:19 +0200 Subject: [PATCH 14/94] [CI] Makefile: release: only supported platforms (cherry picked from commit 16381262c5231f5dddf94d3dac7274366f4ca991) (cherry picked from commit c93f41dcef679f35cb51f93b34b21cfd202ed68a) (cherry picked from commit cf17c69487cd5ad9e5338d6dadd49c208d604ca1) (cherry picked from commit 174b8cf3275cfb4efd483b04ad6cb6eaca069030) (cherry picked from commit ae1b8dd441b9902b098620dbbf4e88592460f91e) (cherry picked from commit 1b56d9049f2954b852fea1ae6e0c52076fdb4a0c) (cherry picked from commit 6b00196175db59d2c6b71a8aa01308265c92f26c) (cherry picked from commit 087b38c3f381cd589ccc708df102cf1594c09912) (cherry picked from commit 70fcc63816e57f277293b10a23777c4ad796e212) (cherry picked from commit 81e2f27426ec91c0a9ab7dd6f0eed11e360beb56) (cherry picked from commit 9741a9960b6bef27e36e679764cfa63b5cb7066b) (cherry picked from commit 0625fc7ad86344ab45d50a85ee68391994f2ca07) (cherry picked from commit e7758aaa94471aecc08071400a1dbeaa1adc71be) (cherry picked from commit be254326876508aa6c333cd22cd25a0198d2f5cd) (cherry picked from commit 64c6d2f26327883af5b61e5436d38070de61f2fa) (cherry picked from commit 3445ae53e3bbda1db229ae849b893657fb6ec268) (cherry picked from commit 3e359ef3cde62848bcc7f12b792baf731359ea10) (cherry picked from commit 3c44026cc5169bd728d1f60dd3b37ffdb6adecf0) (cherry picked from commit 9528250188f6a50bfc728174e491cdbb6859029d) (cherry picked from commit 840a307a2541d2747a5fa7371febf07600463547) (cherry picked from commit 1c486047ac2f9fab513d5df46f5f80765b6b1200) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e5409eb92e..6fd3d0cd09 100644 --- a/Makefile +++ b/Makefile @@ -774,7 +774,7 @@ static-executable: $(GO_SOURCES) $(TAGS_PREREQ) CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE) .PHONY: release -release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check +release: frontend generate release-linux release-copy release-compress vendor release-sources release-check # just the sources, with all assets builtin and frontend resources generated sources-tarbal: frontend generate vendor release-sources release-check From 225d6f7ab7966a358e138afe7038d27b093102f4 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 22 Aug 2023 08:20:40 +0200 Subject: [PATCH 15/94] [CI] gitignore: emacs backups (cherry picked from commit 5e418789d930ef8dc27bc5cb32f96350f5d64e06) (cherry picked from commit 3af6fd2ad38bfbe98ad72e20257704bced7988fa) (cherry picked from commit 6926787d67778f2a3bb2c9d79137a74b894e8b7d) (cherry picked from commit fe58e86a97d4ab0017908a55a9a1f240e241e3f8) (cherry picked from commit 5bf7ead6255889b5cc4ae81c3ce52d6d09e0aef3) (cherry picked from commit 44480ea79426581df15242d6ee7222be97709268) (cherry picked from commit 813848cebe61752568b9c28b9e912170e70bffb8) (cherry picked from commit 9c8d889e782ccaf3b3e71bd3abdc0777b2fd5cf5) (cherry picked from commit 914b1dcaf6d71354fd66c8c81121ad1f3e251e46) (cherry picked from commit 5449933efa74474273d882e7eb7c7840cc2990b0) (cherry picked from commit 67f007b8244c827bf9a9597834c8657440ce89f9) (cherry picked from commit cf93863cd2378b3f239b853ed5b7985fc342cd24) (cherry picked from commit 82177a0f667754d8234765551a4359b4b05b8086) (cherry picked from commit 3ef1fe468ac20e609b20eb7e93ed8cc2356c130a) (cherry picked from commit 305c935508cec1d4d41bac897c77f0ab80c51a7a) (cherry picked from commit 268f12c53c60d46372d448af7d5ce8cef3998d21) (cherry picked from commit 2e6c29fb2f5a3cb800b4d5881de8861f34b29fcb) (cherry picked from commit 173aa4b3b1823f4b1cf9f1e4b4c0cc7c8c07b470) (cherry picked from commit 9112b323d18317f0cf542fdbd98868a4f8382982) (cherry picked from commit 54031769ee355b4888aa4128df822ab154e4ee50) (cherry picked from commit afc287c17901c292c1b41270ceed4086c2f7faca) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 814d910315..4802ea347e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Emacs +*~ + # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a From 69894fbc82612428bb3788b79b30c4d5b2363cf2 Mon Sep 17 00:00:00 2001 From: Gusted Date: Wed, 6 Dec 2023 23:49:48 +0100 Subject: [PATCH 16/94] [CI] Switch to non-coverage unit test (squash) - Currently the collected coverage is not being used by the CI, so use the non-coverage variant to not have the overhead of collecting coverage. (cherry picked from commit 9b3032c14b968933b0cc5bdad6e68cf582d01958) (cherry picked from commit b0fded409d958b19cda827cff5d112bb1057a0f7) (cherry picked from commit 14b5efb1c48cd07c0dab6eea17e1e27ed780c168) (cherry picked from commit 30bd28eed315a31ce45c2efdc49600fc22021526) (cherry picked from commit 54bb708ce7bb6f00a8b29c7a3b8a81d4d195d128) (cherry picked from commit f1664c360b9afca8c392807f93bfeb558985a26a) (cherry picked from commit cd8648178d038a0c81801797dab8368d1aee3c58) --- .forgejo/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index b4b9d1fd19..353549c9a4 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -61,7 +61,7 @@ jobs: env: TAGS: bindata - run: | - su forgejo -c 'make unit-test-coverage test-check' + su forgejo -c 'make test-backend test-check' timeout-minutes: 50 env: RACE_ENABLED: 'true' From 22e63701a8c43ce0b9ee3043cf9ec87d022b71f9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 19 Dec 2023 15:35:06 +0100 Subject: [PATCH 17/94] [CI] Forgejo Actions based release process (squash) lint fix (cherry picked from commit 34513098e557b07c51f8b98e909137ed9d4e0598) (cherry picked from commit a87a48acfb2ba8e5d5379598bd7de83c7891732f) (cherry picked from commit 21db8f4950f2f3eab270b6c51932213a8a84ee0c) (cherry picked from commit eb0a7e5093e314271cfe889ab1cdc814663de682) (cherry picked from commit 328fbcb7067bff58146a1f7460ce8d372d18ce3f) --- .forgejo/workflows/build-release-integration.yml | 2 +- .forgejo/workflows/publish-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index 2920729d33..1935b86716 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -80,7 +80,7 @@ jobs: for suffix in '' '.xz' ; do curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix > $binary$suffix if test "$suffix" = .xz ; then - unxz --keep $binary$suffix + unxz --keep $binary$suffix fi chmod +x $binary ./$binary --version | grep $version diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml index f7ab4586fb..d824815b5e 100644 --- a/.forgejo/workflows/publish-release.yml +++ b/.forgejo/workflows/publish-release.yml @@ -28,7 +28,7 @@ # name: Pubish release -on: +on: push: tags: 'v*' From 805c72c9ce82d91e72c77819b9fca52b635077c5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 19 Dec 2023 15:35:38 +0100 Subject: [PATCH 18/94] [CI] Forgejo Actions based CI for PR & branches (squash) lint workflows (cherry picked from commit 074f49937ebd87078bfb9a057dec1e30c9b116a7) (cherry picked from commit 0c1c7d61e216003803fddfed66f11a090bb477d1) (cherry picked from commit 4e4dc0e0e4071bfcf130bd2d99a016f7b5648c88) (cherry picked from commit 95dcd5a91adb671dbb9b2039d3160624cb83e6aa) (cherry picked from commit e260fbc44592c0b4db843d9d793251373a275a7f) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6fd3d0cd09..531de4c612 100644 --- a/Makefile +++ b/Makefile @@ -400,7 +400,7 @@ lint-go-vet: .PHONY: lint-editorconfig lint-editorconfig: - $(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .github/workflows + $(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .forgejo/workflows .PHONY: lint-actions lint-actions: From e603cd3dcf3384e3b753aa64f620e6771eff03f1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 16 Dec 2023 16:24:55 +0100 Subject: [PATCH 19/94] [CI] upload the forgejo under test as an artifact for end-to-end (cherry picked from commit ded1f27ebbae7e5e09973ce15551827cff4a00d1) (cherry picked from commit e452b184557bf170688ca042b3a01af7a233d2ed) [CI] upload the forgejo under test as an artifact for end-to-end (squash) use forgejo-pr cascade a PR to https://code.forgejo.org/forgejo/end-to-end on the forgejo-pr branch which will only run end-to-end tests relevant to a Forgejo PR and not the entire end-to-end suite. (cherry picked from commit 011de92174ad29ee9b3b72d5c845b52ef229f66f) (cherry picked from commit 50290011b255e2a548ed1ef608af947cfc557288) [CI] upload the forgejo under test as an artifact for end-to-end (squash) after build (cherry picked from commit ba35f42e3d1d4ca0132d3edd09c4647940cf5e17) (cherry picked from commit ddf43faecb9a833137dbbb783fddf0b4765b0e87) [CI] upload the forgejo under test as an artifact for end-to-end (squash) do not display env (cherry picked from commit d186ec3db49d8a23d4eb6328e6393c107b166a79) (cherry picked from commit 20e9d4bffb90260dc9699db81ccdd23dd695f8da) [CI] upload the forgejo under test as an artifact for end-to-end (squash) merge feature branches (cherry picked from commit 83cd7a3ad992202c02510e807bdea0f1ab865461) (cherry picked from commit 75fd819ee5161ad9591fe95744e538d805dfb9bb) (cherry picked from commit c6d021692951b1b2dc1209422df766becaa8fe22) (cherry picked from commit 4a0ee31376ce60f498a0844e0aa4dd5f5bf321a4) (cherry picked from commit 5f440052fb67e11e5b6522e87b9b657384da7218) --- .forgejo/cascading-pr-end-to-end | 21 +++++ .../workflows/cascade-setup-end-to-end.yml | 82 +++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100755 .forgejo/cascading-pr-end-to-end create mode 100644 .forgejo/workflows/cascade-setup-end-to-end.yml diff --git a/.forgejo/cascading-pr-end-to-end b/.forgejo/cascading-pr-end-to-end new file mode 100755 index 0000000000..975888b245 --- /dev/null +++ b/.forgejo/cascading-pr-end-to-end @@ -0,0 +1,21 @@ +#!/bin/bash + +set -ex + +end_to_end=$1 +end_to_end_pr=$2 +forgejo=$3 +forgejo_pr=$4 + +head_url=$(jq --raw-output .head.repo.html_url < $forgejo_pr) +test "$head_url" != null +branch=$(jq --raw-output .head.ref < $forgejo_pr) +test "$branch" != null +cd $end_to_end +echo $head_url $branch 7.0.0+0-gitea-1.22.0 > forgejo/sources/1.22 +date > last-upgrade + +base_url=$(jq --raw-output .base.repo.html_url < $forgejo_pr) +test "$base_url" != null +test "$GITHUB_RUN_NUMBER" +echo $base_url/actions/runs/$GITHUB_RUN_NUMBER/artifacts/forgejo > forgejo/binary-url diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml new file mode 100644 index 0000000000..8f0c736d38 --- /dev/null +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: MIT +on: + pull_request_target: + types: + - labeled + +env: + FEATURE_BRANCHES: "privacy i18n moderation branding dependency" + +jobs: + info: + runs-on: docker + container: + image: node:20-bookworm + steps: + - name: event + run: | + echo github.event.pull_request.head.repo.fork = ${{ github.event.pull_request.head.repo.fork }} + echo github.event.action = ${{ github.event.action }} + echo github.event.pull_request.merged = ${{ github.event.pull_request.merged }} + echo github.event.pull_request.labels.*.name + cat <<'EOF' + ${{ toJSON(github.event.pull_request.labels.*.name) }} + EOF + + build: + if: github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + with: + fetch-depth: '0' + show-progress: 'false' + - name: adduser forgejo + run: | + git config --add safe.directory '*' + git config user.email "you@example.com" + git config user.name "Your Name" + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - name: merge feature branches + run: | + su forgejo -c 'set -ex ; for b in ${{ env.FEATURE_BRANCHES }} ; do git merge -m $b origin/forgejo-$b ; done' + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + - name: make deps-backend + run: | + su forgejo -c 'make deps-backend' + - name: make forgejo + run: | + su forgejo -c 'make generate-backend static-executable && ln gitea forgejo' + env: + TAGS: bindata sqlite sqlite_unlock_notify + - uses: actions/upload-artifact@v3 + with: + name: forgejo + path: forgejo + + cascade: + if: github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') + needs: [build] + runs-on: docker + container: + image: node:20-bookworm + steps: + - uses: actions/checkout@v4 + - uses: actions/cascading-pr@v1 + with: + origin-url: ${{ env.GITHUB_SERVER_URL }} + origin-repo: ${{ github.repository }} + origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }} + origin-pr: ${{ github.event.pull_request.number }} + destination-url: https://code.forgejo.org + destination-fork-repo: cascading-pr/end-to-end + destination-repo: forgejo/end-to-end + destination-branch: forgejo-pr + destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }} + close-merge: true + update: .forgejo/cascading-pr-end-to-end From f817d97f85fff41392ff3017245b80a3ab73cf8a Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 28 Dec 2023 17:23:09 +0100 Subject: [PATCH 20/94] [CI] Forgejo Actions based release process (squash) refactor (#2053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://codeberg.org/forgejo/forgejo/issues/2051 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2053 Reviewed-by: Loïc Dachary Co-authored-by: Earl Warren Co-committed-by: Earl Warren (cherry picked from commit 01abf4d505b092886ed22cdb903ec834061cd7d6) [CI] Forgejo Actions based release process (squash) no ownca The private Forgejo instance trusted with the release signing keys no longer requires the installation of the ownca certificate authority. Refs: https://codeberg.org/forgejo/docs/pulls/338 (cherry picked from commit 72f9ae796d7d7328e87129485e83251708f3d2fb) (cherry picked from commit b0ca4236d76bcc24dfeecba54b602af542355c7d) (cherry picked from commit 81619cf8b5e1650eeb8cb315ee7fa70d0c2d82ba) (cherry picked from commit 2cb32c1a2bd1dd58bb51b81b06e5453608cf0b5d) --- .forgejo/actions/build-release/action.yml | 154 ------------------ .forgejo/actions/publish-release/action.yml | 110 ------------- .../workflows/build-release-integration.yml | 8 +- .forgejo/workflows/build-release.yml | 82 ++-------- .../workflows/cascade-setup-end-to-end.yml | 5 +- .forgejo/workflows/publish-release.yml | 61 ++++--- .forgejo/workflows/testing.yml | 6 + 7 files changed, 56 insertions(+), 370 deletions(-) delete mode 100644 .forgejo/actions/build-release/action.yml delete mode 100644 .forgejo/actions/publish-release/action.yml diff --git a/.forgejo/actions/build-release/action.yml b/.forgejo/actions/build-release/action.yml deleted file mode 100644 index 01fdfdedfc..0000000000 --- a/.forgejo/actions/build-release/action.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: 'Build release' -author: 'Forgejo authors' -description: | - Build release - -inputs: - forgejo: - description: 'URL of the Forgejo instance where the release is uploaded' - required: true - owner: - description: 'User or organization where the release is uploaded, relative to the Forgejo instance' - required: true - repository: - description: 'Repository where the release is uploaded, relative to the owner' - required: true - doer: - description: 'Name of the user authoring the release' - required: true - tag-version: - description: 'Version of the release derived from the tag withint the leading v' - required: true - suffix: - description: 'Suffix to add to the image tag' - token: - description: 'token' - required: true - dockerfile: - description: 'path to the dockerfile' - default: 'Dockerfile' - platforms: - description: 'Coma separated list of platforms' - default: 'linux/amd64,linux/arm64' - release-notes: - description: 'Full text of the release notes' - default: 'Release notes placeholder' - binary-name: - description: 'Name of the binary' - binary-path: - description: 'Path of the binary within the container to extract into binary-name' - verbose: - description: 'Increase the verbosity level' - default: 'false' - -runs: - using: "composite" - steps: - - run: echo "${{ github.action_path }}" >> $GITHUB_PATH - shell: bash - - - name: Install dependencies - run: | - apt-get install -y -qq xz-utils - - - name: set -x if verbose is required - id: verbose - run: | - if ${{ inputs.verbose }} ; then - echo "shell=set -x" >> "$GITHUB_OUTPUT" - fi - - - name: Create the insecure and buildx-config variables for the container registry - id: registry - run: | - ${{ steps.verbose.outputs.shell }} - url="${{ inputs.forgejo }}" - hostport=${url##http*://} - hostport=${hostport%%/} - echo "host-port=${hostport}" >> "$GITHUB_OUTPUT" - if ! [[ $url =~ ^http:// ]] ; then - exit 0 - fi - cat >> "$GITHUB_OUTPUT" < /etc/docker/daemon.json < ~/.docker/config.json - env: - CI_REGISTRY: "${{ steps.registry.outputs.host-port }}" - - - name: Build the container image for each architecture - uses: https://github.com/docker/build-push-action@v4 - # workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released - env: - ACTIONS_RUNTIME_TOKEN: '' - with: - context: . - push: true - file: ${{ inputs.dockerfile }} - platforms: ${{ inputs.platforms }} - tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }} - - - name: Extract the binary from the container images into the release directory - if: inputs.binary-name != '' - run: | - ${{ steps.verbose.outputs.shell }} - mkdir -p release - cd release - for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do - arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g') - docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }} - binary="${{ inputs.binary-name }}-${{ inputs.tag-version }}-linux" - docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch - chmod +x $binary-$arch - # the displayed version has a + instead of the first -, deal with it - pattern=$(echo "${{ inputs.tag-version }}" | tr - .) - if ! ./$binary-$arch --version | grep "$pattern" ; then - echo "ERROR: expected version pattern $pattern not found in the output of $binary-$arch --version" - ./$binary-$arch --version - exit 1 - fi - xz --keep -9 $binary-$arch - shasum -a 256 $binary-$arch > $binary-$arch.sha256 - shasum -a 256 $binary-$arch.xz > $binary-$arch.xz.sha256 - docker rm forgejo-$arch - done - - - name: publish release - if: inputs.binary-name != '' - uses: https://code.forgejo.org/actions/forgejo-release@v1 - with: - direction: upload - release-dir: release - release-notes: "${{ inputs.release-notes }}" - token: ${{ inputs.token }} - verbose: ${{ steps.verbose.outputs.value }} diff --git a/.forgejo/actions/publish-release/action.yml b/.forgejo/actions/publish-release/action.yml deleted file mode 100644 index 42b6097ee0..0000000000 --- a/.forgejo/actions/publish-release/action.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: 'Publish release' -author: 'Forgejo authors' -description: | - Publish release - -inputs: - forgejo: - description: 'URL of the Forgejo instance where the release is uploaded (e.g. https://codeberg.org)' - required: true - from-owner: - description: 'the owner from which a release is to be copied (e.g forgejo-integration)' - required: true - to-owner: - description: 'the owner to which a release is to be copied (e.g. forgejo-experimental). It has be an organization in which doer has the required permissions. Or be the same as the doer' - required: true - repo: - description: 'the repository from which a release is to be copied relative to from-owner and to-owner' - default: 'forgejo' - ref-name: - description: 'ref_name of the tag of the release to be copied (e.g. github.ref_name)' - required: true - doer: - description: 'Name of the user authoring the release (e.g. release-team). The user must be authorized to create packages in to-owner and releases in to-owner/repo' - required: true - token: - description: 'application token created on forgejo by the doer, with a scope allowing it to create packages in to-owner and releases in to-owner/repo' - required: true - gpg-private-key: - description: 'GPG Private Key to sign the release artifacts' - gpg-passphrase: - description: 'Passphrase of the GPG Private Key' - verbose: - description: 'Increase the verbosity level' - default: 'false' - -runs: - using: "composite" - steps: - - id: hostport - run: | - url="${{ inputs.forgejo }}" - hostport=${url##http*://} - hostport=${hostport%%/} - echo "value=$hostport" >> "$GITHUB_OUTPUT" - - - id: tag-version - run: | - version="${{ inputs.ref-name }}" - version=${version##*v} - echo "value=$version" >> "$GITHUB_OUTPUT" - - - name: Create the release notes - id: release-notes - run: | - anchor=${{ steps.tag-version.outputs.value }} - anchor=${anchor//./-} - cat >> "$GITHUB_OUTPUT" <> "$GITHUB_OUTPUT" - - name: Sanitize the name of the repository id: repository run: | - set -x # comment out repository="${{ github.repository }}" echo "value=${repository##*/}" >> "$GITHUB_OUTPUT" - - name: When in a test environment, create a token - id: token - if: ${{ secrets.TOKEN == '' }} - run: | - apt-get -qq install -y jq - url="${{ env.GITHUB_SERVER_URL }}" - hostport=${url##http*://} - hostport=${hostport%%/} - doer=root - api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens - curl -sS -X DELETE $api/release - token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1) - echo "value=${token}" >> "$GITHUB_OUTPUT" - - uses: https://code.forgejo.org/actions/setup-node@v3 with: - node-version: 18 + node-version: 20 - uses: https://code.forgejo.org/actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: ">=1.21" check-latest: true - - name: Create the version from ref_name + - name: version from ref_name id: tag-version run: | version="${{ github.ref_name }}" version=${version##*v} echo "value=$version" >> "$GITHUB_OUTPUT" - - name: Create the release notes + - name: release notes id: release-notes run: | + anchor=${{ steps.tag-version.outputs.value }} + anchor=${anchor//./-} cat >> "$GITHUB_OUTPUT" < +# vars.ROLE: forgejo-experimental +# vars.FORGEJO: https://codeberg.org +# vars.FROM_OWNER: forgejo-integration +# vars.TO_OWNER: forgejo-experimental +# vars.REPO: forgejo +# vars.DOER: forgejo-experimental-ci +# secrets.TOKEN: # -# https://forgejo.octopuce.forgejo.org/forgejo/forgejo +# http://private.forgejo.org/forgejo/forgejo # # Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo # -# ROLE: forgejo-release -# FORGEJO: https://codeberg.org -# FROM_OWNER: forgejo-integration -# TO_OWNER: forgejo -# DOER: release-team -# TOKEN: -# GPG_PRIVATE_KEY: -# GPG_PASSPHRASE: +# vars.ROLE: forgejo-release +# vars.FORGEJO: https://codeberg.org +# vars.FROM_OWNER: forgejo-integration +# vars.TO_OWNER: forgejo +# vars.REPO: forgejo +# vars.DOER: release-team +# secrets.TOKEN: +# secrets.GPG_PRIVATE_KEY: +# secrets.GPG_PASSPHRASE: # name: Pubish release @@ -35,39 +37,34 @@ on: jobs: publish: runs-on: self-hosted - if: secrets.DOER != '' && secrets.FORGEJO != '' && secrets.TO_OWNER != '' && secrets.FROM_OWNER != '' && secrets.TOKEN != '' + if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != '' steps: - - name: install the certificate authority - if: secrets.ROLE == 'forgejo-release' - run: | - apt-get install -qq -y wget - wget --no-check-certificate -O /usr/local/share/ca-certificates/enough.crt https://forgejo.octopuce.forgejo.org/forgejo/enough/raw/branch/main/certs/2023-05-13/ca.crt - update-ca-certificates --fresh - - uses: actions/checkout@v3 - - name: copy & sign binaries and container images from one owner to another - uses: ./.forgejo/actions/publish-release + - name: copy & sign + uses: https://code.forgejo.org/forgejo/forgejo-build-publish/publish@v1 with: - forgejo: ${{ secrets.FORGEJO }} - from-owner: ${{ secrets.FROM_OWNER }} - to-owner: ${{ secrets.TO_OWNER }} + forgejo: ${{ vars.FORGEJO }} + from-owner: ${{ vars.FROM_OWNER }} + to-owner: ${{ vars.TO_OWNER }} + repo: ${{ vars.REPO }} ref-name: ${{ github.ref_name }} - doer: ${{ secrets.DOER }} + release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#{ANCHOR}" + doer: ${{ vars.DOER }} token: ${{ secrets.TOKEN }} gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - verbose: ${{ secrets.VERBOSE }} + verbose: ${{ vars.VERBOSE }} - name: set up go for the DNS update below + if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' uses: https://code.forgejo.org/actions/setup-go@v4 - if: secrets.ROLE == 'forgejo-experimental' with: go-version: ">=1.21" check-latest: true - name: update the _release.experimental DNS record - if: secrets.ROLE == 'forgejo-experimental' + if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' uses: https://code.forgejo.org/actions/ovh-dns-update@v1 with: subdomain: _release.experimental diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index 353549c9a4..f8fcac3c1c 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -9,6 +9,7 @@ on: jobs: lint-backend: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker container: image: 'docker.io/node:20-bookworm' @@ -23,6 +24,7 @@ jobs: env: TAGS: bindata sqlite sqlite_unlock_notify checks-backend: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker container: image: 'docker.io/node:20-bookworm' @@ -35,6 +37,7 @@ jobs: - run: make deps-backend deps-tools - run: make --always-make checks-backend # ensure the "go-licenses" make target runs test-unit: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker needs: [lint-backend, checks-backend] container: @@ -67,6 +70,7 @@ jobs: RACE_ENABLED: 'true' TAGS: bindata test-mysql: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker needs: [lint-backend, checks-backend] container: @@ -109,6 +113,7 @@ jobs: TAGS: bindata USE_REPO_TEST_DIR: 1 test-pgsql: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker needs: [lint-backend, checks-backend] container: @@ -154,6 +159,7 @@ jobs: TEST_TAGS: gogit USE_REPO_TEST_DIR: 1 test-sqlite: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker needs: [lint-backend, checks-backend] container: From 33b4f02d90fec41d8525b22f312afa564c955067 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 3 Jan 2024 15:33:47 +0100 Subject: [PATCH 21/94] [CI] Forgejo Actions e2e tests (cherry picked from commit 430f7d651902ab1e3e44ae27d9821d9132ee8a63) (cherry picked from commit b33f3e2fe82d1e8d5368024938333e6a8c907e76) (cherry picked from commit 5d4f9e47165a3c0adb30a078e6605b62cadbfc50) --- .forgejo/workflows/e2e.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .forgejo/workflows/e2e.yml diff --git a/.forgejo/workflows/e2e.yml b/.forgejo/workflows/e2e.yml new file mode 100644 index 0000000000..f7c46dd062 --- /dev/null +++ b/.forgejo/workflows/e2e.yml @@ -0,0 +1,37 @@ +name: e2e + +on: + pull_request: + paths: + - Makefile + - .forgejo/workflows/e2e.yml + - tests/e2e/** + +jobs: + test-e2e: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: "~1.21" + check-latest: true + - run: | + apt-get -qq update + apt-get -qq install -q sudo + sed -i -e 's/%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + adduser forgejo sudo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-frontend frontend deps-backend' + - run: | + su forgejo -c 'make test-e2e-sqlite' + timeout-minutes: 40 + env: + DEPS_PLAYWRIGHT: 1 + USE_REPO_TEST_DIR: 1 From 861c05c2f308b0e7f4300b3f743830bb010588a3 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 3 Jan 2024 17:32:30 +0100 Subject: [PATCH 22/94] [CI] cascade release with end-to-end (cherry picked from commit ab37e03bf34800a7780a653e998ad6f7a97f08f4) (cherry picked from commit 2b527169f1f73574bcd5cb49e43ee87986f85996) (cherry picked from commit 5fed32742e62315e0b0f483563f6f3f3e57af0fa) --- .forgejo/cascading-release-end-to-end | 12 ++++++++++ .forgejo/workflows/build-release.yml | 33 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 .forgejo/cascading-release-end-to-end diff --git a/.forgejo/cascading-release-end-to-end b/.forgejo/cascading-release-end-to-end new file mode 100755 index 0000000000..7b43c89ed8 --- /dev/null +++ b/.forgejo/cascading-release-end-to-end @@ -0,0 +1,12 @@ +#!/bin/bash + +set -ex + +end_to_end=$1 +end_to_end_pr=$2 +forgejo=$3 +forgejo_ref=$4 + +cd $end_to_end +date > last-upgrade +echo $FORGEJO_BINARY > forgejo/binary-url diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index 4a196e1208..ab773f8579 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -1,3 +1,19 @@ +# +# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process +# +# https://codeberg.org/forgejo-integration/forgejo +# +# Builds a release from a codeberg.org/forgejo-integration tag +# +# vars.ROLE: forgejo-integration +# +# secrets.DOER: forgejo-experimental-ci +# secrets.TOKEN: scope read:user, write:repository, write:package +# +# secrets.CASCADE_ORIGIN_TOKEN: scope read:user, write:repository, write:issue +# secrets.CASCADE_DESTINATION_TOKEN: scope read:user, write:repository, write:issue +# vars.CASCADE_DESTINATION_DOER: forgejo-ci +# name: Build release on: @@ -134,3 +150,20 @@ jobs: suffix: -rootless dockerfile: Dockerfile.rootless verbose: ${{ vars.VERBOSE || 'false' }} + + - name: end-to-end tests + if: ${{ secrets.TOKEN != '' }} + uses: https://code.forgejo.org/actions/cascading-pr@v1 + with: + origin-url: ${{ env.GITHUB_SERVER_URL }} + origin-repo: ${{ github.repository }} + origin-token: ${{ secrets.CASCADE_ORIGIN_TOKEN }} + origin-ref: refs/heads/forgejo + destination-url: https://code.forgejo.org + destination-fork-repo: ${{ vars.CASCADE_DESTINATION_DOER }}/end-to-end + destination-repo: forgejo/end-to-end + destination-branch: forgejo-pr + destination-token: ${{ secrets.CASCADE_DESTINATION_TOKEN }} + update: .forgejo/cascading-release-end-to-end + env: + FORGEJO_BINARY: "${{ env.GITHUB_SERVER_URL }}/${{ github.repository }}/releases/download/v${{ steps.tag-version.outputs.value }}/forgejo-${{ steps.tag-version.outputs.value }}-linux-amd64" From e00eb6d9b32cbb294defb420e0305c544b9af239 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 4 Jan 2024 00:56:17 +0100 Subject: [PATCH 23/94] [CI] Forgejo Actions e2e tests (squash) do not try in simulation (cherry picked from commit f67a3f952cac7b9390b9dd2752bdf215a82e04b0) (cherry picked from commit 23502a9b9fa92013d91295d8c9278601b31228c5) (cherry picked from commit f8f345ae188fbf8f62e1471e7cc62a2db33d3e0e) --- .forgejo/workflows/build-release-integration.yml | 8 ++++++++ .forgejo/workflows/build-release.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index 89155e9d59..32e67964ba 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -9,6 +9,14 @@ on: - docker/** - .forgejo/workflows/build-release.yml - .forgejo/workflows/build-release-integration.yml + pull_request: + paths: + - Makefile + - Dockerfile + - Dockerfile.rootless + - docker/** + - .forgejo/workflows/build-release.yml + - .forgejo/workflows/build-release-integration.yml jobs: release-simulation: diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index ab773f8579..e02bf15901 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -152,7 +152,7 @@ jobs: verbose: ${{ vars.VERBOSE || 'false' }} - name: end-to-end tests - if: ${{ secrets.TOKEN != '' }} + if: ${{ secrets.TOKEN != '' && vars.ROLE == 'forgejo-integration' }} uses: https://code.forgejo.org/actions/cascading-pr@v1 with: origin-url: ${{ env.GITHUB_SERVER_URL }} From ba3df0131412c2eb41a3312558bc4df5881caad5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 4 Jan 2024 17:48:46 +0100 Subject: [PATCH 24/94] [CI] push forgejo branches to the specified destination (cherry picked from commit 22abd100cbab75673c53e4fb36fa574ada660aee) (cherry picked from commit 4e2c30cb5bcd7a4e2b2385a774062492e741a9e9) (cherry picked from commit 1ddc08747c8819e8967c95d54d3e273ef3831570) --- .forgejo/workflows/mirror.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .forgejo/workflows/mirror.yml diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml new file mode 100644 index 0000000000..fd419be49d --- /dev/null +++ b/.forgejo/workflows/mirror.yml @@ -0,0 +1,25 @@ +name: mirror + +on: + push: + branches: + - 'forgejo' + - 'v*/forgejo' + +jobs: + mirror: + if: ${{ secrets.MIRROR_TOKEN != '' }} + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - name: git push {v*/,}forgejo + run: | + git init --bare . + git remote add origin ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }} + git fetch origin refs/heads/forgejo:refs/mirror/forgejo + git ls-remote origin refs/heads/v*/forgejo | while read sha full_ref ; do + ref=${full_ref#refs/heads/} + git fetch origin $full_ref:refs/mirror/$ref + done + git push --force https://any:${{ secrets.MIRROR_TOKEN }}@${{ vars.MIRROR_DESTINATION }} refs/mirror/*:refs/heads/* From cd264666220a69d0159ce0ee996104ff25b4a5f2 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 8 Jan 2024 15:58:44 +0100 Subject: [PATCH 25/94] [CI] Forgejo Actions e2e tests (squash) generate (cherry picked from commit 9cd0b93ad243f05e7dd17055782ac922dc91b6f0) (cherry picked from commit ef1ddf0568444f2e9ea05a0e03d7e9d89f501cef) --- .forgejo/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/e2e.yml b/.forgejo/workflows/e2e.yml index f7c46dd062..2104f6a067 100644 --- a/.forgejo/workflows/e2e.yml +++ b/.forgejo/workflows/e2e.yml @@ -30,7 +30,7 @@ jobs: - run: | su forgejo -c 'make deps-frontend frontend deps-backend' - run: | - su forgejo -c 'make test-e2e-sqlite' + su forgejo -c 'make generate test-e2e-sqlite' timeout-minutes: 40 env: DEPS_PLAYWRIGHT: 1 From e8021f281f905e4499db4e67c91326932bfd613f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 15 Jan 2024 19:01:28 +0000 Subject: [PATCH 26/94] [CI] push forgejo branches to the specified destination (squash) verbose (cherry picked from commit 848685d68d8bf7b7a38fea221db5e474cd30ea79) --- .forgejo/workflows/mirror.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index fd419be49d..3a4099db5d 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -20,6 +20,8 @@ jobs: git fetch origin refs/heads/forgejo:refs/mirror/forgejo git ls-remote origin refs/heads/v*/forgejo | while read sha full_ref ; do ref=${full_ref#refs/heads/} + echo git fetch origin $full_ref:refs/mirror/$ref git fetch origin $full_ref:refs/mirror/$ref done + echo git push --force https://${{ vars.MIRROR_DESTINATION }} refs/mirror/*:refs/heads/* git push --force https://any:${{ secrets.MIRROR_TOKEN }}@${{ vars.MIRROR_DESTINATION }} refs/mirror/*:refs/heads/* From 2e43bd580d35254ebfb894ce818c622e3e5ea437 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 22 Jan 2024 11:18:06 +0000 Subject: [PATCH 27/94] [CI] Forgejo Actions based CI for PR & branches (squash) install git >= 2.42 --- .forgejo/workflows/testing.yml | 38 ++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index f8fcac3c1c..de1298eff8 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -57,6 +57,14 @@ jobs: git config --add safe.directory '*' adduser --quiet --comment forgejo --disabled-password forgejo chown -R forgejo:forgejo . + - name: install git >= 2.42 + run: | + export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get -q install -qq -y git + rm /etc/apt/sources.list.d/testing.list + apt-get update -qq - run: | su forgejo -c 'make deps-backend' - run: | @@ -90,11 +98,14 @@ jobs: - uses: https://code.forgejo.org/actions/setup-go@v4 with: go-version: "1.21" - - name: install dependencies + - name: install dependencies & git >= 2.42 run: | export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list apt-get update -qq - apt-get install --no-install-recommends -qq -y git-lfs - name: setup user and permissions run: | git config --add safe.directory '*' @@ -134,11 +145,14 @@ jobs: - uses: https://code.forgejo.org/actions/setup-go@v4 with: go-version: "1.21" - - name: install dependencies + - name: install dependencies & git >= 2.42 run: | export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list apt-get update -qq - apt-get install --no-install-recommends -qq -y git-lfs - name: setup user and permissions run: | git config --add safe.directory '*' @@ -154,9 +168,8 @@ jobs: su forgejo -c 'make test-pgsql-migration test-pgsql' timeout-minutes: 50 env: - TAGS: bindata gogit + TAGS: bindata RACE_ENABLED: true - TEST_TAGS: gogit USE_REPO_TEST_DIR: 1 test-sqlite: if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} @@ -169,11 +182,14 @@ jobs: - uses: https://code.forgejo.org/actions/setup-go@v4 with: go-version: "1.21" - - name: install dependencies + - name: install dependencies & git >= 2.42 run: | export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list apt-get update -qq - apt-get install --no-install-recommends -qq -y git-lfs - name: setup user and permissions run: | git config --add safe.directory '*' @@ -184,12 +200,12 @@ jobs: - run: | su forgejo -c 'make backend' env: - TAGS: bindata gogit sqlite sqlite_unlock_notify + TAGS: bindata sqlite sqlite_unlock_notify - run: | su forgejo -c 'make test-sqlite-migration test-sqlite' timeout-minutes: 50 env: - TAGS: bindata gogit sqlite sqlite_unlock_notify + TAGS: bindata sqlite sqlite_unlock_notify RACE_ENABLED: true - TEST_TAGS: gogit sqlite sqlite_unlock_notify + TEST_TAGS: sqlite sqlite_unlock_notify USE_REPO_TEST_DIR: 1 From a1ca01f37f6d929f39f970d0cf23b88e44f61329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Tue, 15 Nov 2022 18:30:01 +0100 Subject: [PATCH 28/94] delete Gitea specific files that need rewriting for Forgejo Although it would be possible to modify these files, it would create conflicts when rebasing. Instead, this commit removes them entirely and another commit can start from scratch, borrowing content from the original files. The drawback of this approach is that some content updates from Gitea that also need updating in Forgejo will have to be copy/pasted instead of being merged. (cherry picked from commit eb85782115f2f453e13561848925760b1abddb16) (cherry picked from commit 34401f2004445f225a479b8258180f498ac87847) (cherry picked from commit ef43b1c6910a01a5f9dbd054e23372f6f17f4d9e) (cherry picked from commit d17fe25e2f915e778eb968c20939dc253f47bcd5) (cherry picked from commit 3f65dea3e7a5d0983d96d7011385125bd0063ff1) (cherry picked from commit 3cacb64a1bae713467d3d9b7ebfe626930f2bd35) (cherry picked from commit b531b014b751233b46e3220c25108fe95531621b) (cherry picked from commit adf6e7a840c7f7201eddec3ab2b305200b19fc43) (cherry picked from commit 68c19d977d6aa8e8eb5714f5915b6557379887c0) (cherry picked from commit 31aa8647ecaf91704652e149fb5d0e891645412d) (cherry picked from commit be70dd7208c2b40842cb83affa77f6d15ac4d840) (cherry picked from commit 7f44bb60b16843b0e127a7e5fc89736a1d35d145) (cherry picked from commit 5098f1224b10ac7b35c1d4c9ece8fbd066a616e8) (cherry picked from commit dc7a8591442772f9801bfff7a77f1c8806bedb5c) (cherry picked from commit f1e78dd0067f8d0e9a6ea4dc292ebebdb8b8bcda) (cherry picked from commit c41ba7a148d1b35df392a7d2af9a52461e1cb217) (cherry picked from commit f1da66a918a68237894e220d206a5e0251ec85d0) (cherry picked from commit 99194a3664dc94296f7e1397be45b6fde9e3e718) (cherry picked from commit 52f356f6a9dbbbd4e2c68fde99f7c35a3e6f2bd0) (cherry picked from commit c93ffa72ae35bbdc6cc470823648a1aed0185b5d) (cherry picked from commit 477c7454d39e813e2bc5107bf84105060acfe743) (cherry picked from commit 413df23a407547b1a0d480185be9efc388b464eb) [DOCS] delete Gitea specific files that need rewriting for Forgejo (squash) (cherry picked from commit df78cedd053e624bcc30b048eac9d6ab10ff5749) (cherry picked from commit 3b9178b3e5ee1aedff79a6ff5b62fb700f480682) (cherry picked from commit 9044dcb0e7bb410bbc8a83c8d3610fa6c8355e25) (cherry picked from commit e138685bacc14138aad46bea2756dc4f6d6b46c0) (cherry picked from commit 2f1f3fd6b8a7b054bf854ea94ef91c8f87bce996) (cherry picked from commit 0b47d02df6c93129d825aa1b9d3f481b6cf7f505) (cherry picked from commit 7625ca6c42b6a333e3a2e25dd3df2744a4180e32) (cherry picked from commit e0d720a728cf24eaeb1416ac1c5b8de6655ccd44) (cherry picked from commit 19aa974d120fe5ade8436e5ea0fab6a83f1b9db1) (cherry picked from commit bb637d398cb02e2d0059a1e7660b88bfe87e3315) (cherry picked from commit 5357fc952d29b5f38ad95b3c94fca22e16217578) (cherry picked from commit bee03950445384c4d985617793175bb7b27810a1) (cherry picked from commit 5e574bfc8f761ad631aaadda6fa4c44ac826153b) (cherry picked from commit 9593225c5bfbf0ac5cddd62359c812b755995397) (cherry picked from commit f6e5faee613947755c85807ab6b06fe8008aed9b) (cherry picked from commit 02f2a9a47a9084a6218d67f773d474febbb5fa54) (cherry picked from commit 68695685c1042e273800a4dad5f21cb009ac32ff) (cherry picked from commit 9ae53997a4188a333021dfda42eb620213db2471) (cherry picked from commit d87a6b4908290fb16188042048b50718bbe383ea) (cherry picked from commit 891b628aa19efff43ad18dd45983887802e84e10) (cherry picked from commit 0b290c23ea14d960732872cbf5c91177ddce11cc) (cherry picked from commit 9cfae4f0aa4bf3b3175f64f93d3e5c66e785db56) (cherry picked from commit bd811bcc18784f57840d6cae502e125770025c19) (cherry picked from commit cf89915013cf0ef65065c191968b628a2a735729) (cherry picked from commit 7a519b8ba4acc5ad47b59ff7cab67b1b3d08ae9c) (cherry picked from commit 11283e0d37f083eacd6c548673654ad1624744b6) --- CODE_OF_CONDUCT.md | 96 -------- CONTRIBUTING.md | 579 --------------------------------------------- README.md | 182 -------------- README_ZH.md | 102 -------- SECURITY.md | 85 ------- 5 files changed, 1044 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 README.md delete mode 100644 README_ZH.md delete mode 100644 SECURITY.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 979831eb9b..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,96 +0,0 @@ -# Gitea Community Code of Conduct - -## About - -Online communities include people from many different backgrounds. The Gitea contributors are committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity and expression, sexual orientation, disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality, race, age, religion, or similar personal characteristics. - -The first goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Gitea effectively, productively, and respectfully. - -The second goal is to provide a mechanism for resolving conflicts in the community when they arise. - -The third goal of the Code of Conduct is to make our community welcoming to people from different backgrounds. Diversity is critical to the project; for Gitea to be successful, it needs contributors and users from all backgrounds. - -We believe that healthy debate and disagreement are essential to a healthy project and community. However, it is never ok to be disrespectful. We value diverse opinions, but we value respectful behavior more. - -## Community values - -These are the values to which people in the Gitea community should aspire. - -- **Be friendly and welcoming.** -- **Be patient.** - - Remember that people have varying communication styles and that not everyone is using their native language. (Meaning and tone can be lost in translation.) -- **Be thoughtful.** - - Productive communication requires effort. Think about how your words will be interpreted. - - Remember that sometimes it is best to refrain entirely from commenting. -- **Be respectful.** - - In particular, respect differences of opinion. -- **Be charitable.** - - Interpret the arguments of others in good faith, do not seek to disagree. - - When we do disagree, try to understand why. -- **Be constructive.** - - Avoid derailing: stay on topic; if you want to talk about something else, start a new conversation. - - Avoid unconstructive criticism: don't merely decry the current state of affairs; offer—or at least solicit—suggestions as to how things may be improved. - - Avoid snarking (pithy, unproductive, sniping comments) - - Avoid discussing potentially offensive or sensitive issues; this all too often leads to unnecessary conflict. - - Avoid microaggressions (brief and commonplace verbal, behavioral and environmental indignities that communicate hostile, derogatory or negative slights and insults to a person or group). -- **Be responsible.** - - What you say and do matters. Take responsibility for your words and actions, including their consequences, whether intended or otherwise. - -People are complicated. You should expect to be misunderstood and to misunderstand others; when this inevitably occurs, resist the urge to be defensive or assign blame. Try not to take offense where no offense was intended. Give people the benefit of the doubt. Even if the intent was to provoke, do not rise to it. It is the responsibility of all parties to de-escalate conflict when it arises. - -## Code of Conduct - -### Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. - -### Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -- The use of sexualized language or imagery and unwelcome sexual attention or advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others’ private information, such as a physical or electronic address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a professional setting - -### Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject: comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, as well as to ban (temporarily or permanently) any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful. - -### Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project Stewards have a reasonable belief that an individual’s behavior may have a negative impact on the project or its community. - -### Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. - -Reports should be directed to the Gitea Project Stewards at conduct@gitea.com. It is the Project Stewards’ duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the technical-oversight-committee. - -We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. Under normal circumstances, we will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. If there is a consensus between maintainers that such an endeavor would be useless (i.e. in case of an obvious spammer), we reserve the right to take action without notifying the accused first. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyone’s safety, we may take action without notice. - -### Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -## Summary - -- Treat everyone with respect and kindness. -- Be thoughtful in how you communicate. -- Don’t be destructive or inflammatory. -- If you encounter an issue, please mail conduct@gitea.com. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index b43ce01ff2..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,579 +0,0 @@ -# Contribution Guidelines - -
Table of Contents - -- [Contribution Guidelines](#contribution-guidelines) - - [Introduction](#introduction) - - [Issues](#issues) - - [How to report issues](#how-to-report-issues) - - [Types of issues](#types-of-issues) - - [Discuss your design before the implementation](#discuss-your-design-before-the-implementation) - - [Building Gitea](#building-gitea) - - [Dependencies](#dependencies) - - [Backend](#backend) - - [Frontend](#frontend) - - [Design guideline](#design-guideline) - - [Styleguide](#styleguide) - - [Copyright](#copyright) - - [Testing](#testing) - - [Translation](#translation) - - [Code review](#code-review) - - [Pull request format](#pull-request-format) - - [PR title and summary](#pr-title-and-summary) - - [Milestone](#milestone) - - [Labels](#labels) - - [Breaking PRs](#breaking-prs) - - [What is a breaking PR?](#what-is-a-breaking-pr) - - [How to handle breaking PRs?](#how-to-handle-breaking-prs) - - [Maintaining open PRs](#maintaining-open-prs) - - [Getting PRs merged](#getting-prs-merged) - - [Final call](#final-call) - - [Commit messages](#commit-messages) - - [PR Co-authors](#pr-co-authors) - - [PRs targeting `main`](#prs-targeting-main) - - [Backport PRs](#backport-prs) - - [Documentation](#documentation) - - [API v1](#api-v1) - - [GitHub API compatibility](#github-api-compatibility) - - [Adding/Maintaining API routes](#addingmaintaining-api-routes) - - [When to use what HTTP method](#when-to-use-what-http-method) - - [Requirements for API routes](#requirements-for-api-routes) - - [Backports and Frontports](#backports-and-frontports) - - [What is backported?](#what-is-backported) - - [How to backport?](#how-to-backport) - - [Format of backport PRs](#format-of-backport-prs) - - [Frontports](#frontports) - - [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco) - - [Release Cycle](#release-cycle) - - [Maintainers](#maintainers) - - [Technical Oversight Committee (TOC)](#technical-oversight-committee-toc) - - [Current TOC members](#current-toc-members) - - [Previous TOC/owners members](#previous-tocowners-members) - - [Governance Compensation](#governance-compensation) - - [TOC \& Working groups](#toc--working-groups) - - [Roadmap](#roadmap) - - [Versions](#versions) - - [Releasing Gitea](#releasing-gitea) - -
- -## Introduction - -This document explains how to contribute changes to the Gitea project. \ -It assumes you have followed the [installation instructions](https://docs.gitea.com/category/installation). \ -Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io). - -For configuring IDEs for Gitea development, see the [contributed IDE configurations](contrib/ide/). - -## Issues - -### How to report issues - -Please search the issues on the issue tracker with a variety of related keywords to ensure that your issue has not already been reported. - -If your issue has not been reported yet, [open an issue](https://github.com/go-gitea/gitea/issues/new) -and answer the questions so we can understand and reproduce the problematic behavior. \ -Please write clear and concise instructions so that we can reproduce the behavior — even if it seems obvious. \ -The more detailed and specific you are, the faster we can fix the issue. \ -It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. , as perhaps your problem has already been fixed on a current version. \ -Please follow the guidelines described in [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for your report. - -Please be kind, remember that Gitea comes at no cost to you, and you're getting free help. - -### Types of issues - -Typically, issues fall in one of the following categories: - -- `bug`: Something in the frontend or backend behaves unexpectedly -- `security issue`: bug that has serious implications such as leaking another users data. Please do not file such issues on the public tracker and send a mail to security@gitea.io instead -- `feature`: Completely new functionality. You should describe this feature in enough detail that anyone who reads the issue can understand how it is supposed to be implemented -- `enhancement`: An existing feature should get an upgrade -- `refactoring`: Parts of the code base don't conform with other parts and should be changed to improve Gitea's maintainability - -### Discuss your design before the implementation - -We welcome submissions. \ -If you want to change or add something, please let everyone know what you're working on — [file an issue](https://github.com/go-gitea/gitea/issues/new) or comment on an existing one before starting your work! - -Significant changes such as new features must go through the change proposal process before they can be accepted. \ -This is mainly to save yourself the trouble of implementing it, only to find out that your proposed implementation has some potential problems. \ -Furthermore, this process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside -the goals for the project and tools. - -Pull requests should not be the place for architecture discussions. - -## Building Gitea - -See the [development setup instructions](https://docs.gitea.com/development/hacking-on-gitea). - -## Dependencies - -### Backend - -Go dependencies are managed using [Go Modules](https://golang.org/cmd/go/#hdr-Module_maintenance). \ -You can find more details in the [go mod documentation](https://go.dev/ref/mod) and the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules). - -Pull requests should only modify `go.mod` and `go.sum` where it is related to your change, be it a bugfix or a new feature. \ -Apart from that, these files should only be modified by Pull Requests whose only purpose is to update dependencies. - -The `go.mod`, `go.sum` update needs to be justified as part of the PR description, -and must be verified by the reviewers and/or merger to always reference -an existing upstream commit. - -### Frontend - -For the frontend, we use [npm](https://www.npmjs.com/). - -The same restrictions apply for frontend dependencies as for backend dependencies, with the exceptions that the files for it are `package.json` and `package-lock.json`, and that new versions must always reference an existing version. - -## Design guideline - -Depending on your change, please read the - -- [backend development guideline](https://docs.gitea.com/contributing/guidelines-backend) -- [frontend development guideline](https://docs.gitea.com/contributing/guidelines-frontend) -- [refactoring guideline](https://docs.gitea.com/contributing/guidelines-refactoring) - -## Styleguide - -You should always run `make fmt` before committing to conform to Gitea's styleguide. - -## Copyright - -New code files that you contribute should use the standard copyright header: - -``` -// Copyright The Gitea Authors. All rights reserved. -// SPDX-License-Identifier: MIT -``` - -Afterwards, copyright should only be modified when the copyright author changes. - -## Testing - -Before submitting a pull request, run all tests to make sure your changes don't cause a regression elsewhere. - -Here's how to run the test suite: - -- code lint - -| | | -| :-------------------- | :---------------------------------------------------------------- | -|``make lint`` | lint everything (not needed if you only change the front- **or** backend) | -|``make lint-frontend`` | lint frontend files | -|``make lint-backend`` | lint backend files | - -- run tests (we suggest running them on Linux) - -| Command | Action | | -| :------------------------------------- | :----------------------------------------------- | ------------ | -|``make test[\#SpecificTestName]`` | run unit test(s) | -|``make test-sqlite[\#SpecificTestName]``| run [integration](tests/integration) test(s) for SQLite |[More details](tests/integration/README.md) | -|``make test-e2e-sqlite[\#SpecificTestName]``| run [end-to-end](tests/e2e) test(s) for SQLite |[More details](tests/e2e/README.md) | - -## Translation - -All translation work happens on [Crowdin](https://crowdin.com/project/gitea). -The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini). -It is synced regularly with Crowdin. \ -Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \ -Once a language has reached a **satisfactory percentage** of translated keys (~25%), it will be synced back into this repo and included in the next released version. - -The tool `go run build/backport-locale.go` can be used to backport locales from the main branch to release branches that were missed. - -## Code review - -### Pull request format - -Please try to make your pull request easy to review for us. \ -For that, please read the [*Best Practices for Faster Reviews*](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) guide. \ -It has lots of useful tips for any project you may want to contribute to. \ -Some of the key points: - -- Make small pull requests. \ - The smaller, the faster to review and the more likely it will be merged soon. -- Don't make changes unrelated to your PR. \ - Maybe there are typos on some comments, maybe refactoring would be welcome on a function... \ - but if that is not related to your PR, please make *another* PR for that. -- Split big pull requests into multiple small ones. \ - An incremental change will be faster to review than a huge PR. -- Allow edits by maintainers. This way, the maintainers will take care of merging the PR later on instead of you. - -### PR title and summary - -In the PR title, describe the problem you are fixing, not how you are fixing it. \ -Use the first comment as a summary of your PR. \ -In the PR summary, you can describe exactly how you are fixing this problem. - -Keep this summary up-to-date as the PR evolves. \ -If your PR changes the UI, you must add **after** screenshots in the PR summary. \ -If you are not implementing a new feature, you should also post **before** screenshots for comparison. - -If you are implementing a new feature, your PR will only be merged if your screenshots are up to date.\ -Furthermore, feature PRs will only be merged if their summary contains a clear usage description (understandable for users) and testing description (understandable for reviewers). -You should strive to combine both into a single description. - -Another requirement for merging PRs is that the PR is labeled correctly.\ -However, this is not your job as a contributor, but the job of the person merging your PR.\ -If you think that your PR was labeled incorrectly, or notice that it was merged without labels, please let us know. - -If your PR closes some issues, you must note that in a way that both GitHub and Gitea understand, i.e. by appending a paragraph like - -```text -Fixes/Closes/Resolves #. -Fixes/Closes/Resolves #. -``` - -to your summary. \ -Each issue that will be closed must stand on a separate line. - -### Milestone - -A PR should only be assigned to a milestone if it will likely be merged into the given version. \ -As a rule of thumb, assume that a PR will stay open for an additional month for every 100 added lines. \ -PRs without a milestone may not be merged. - -### Labels - -Almost all labels used inside Gitea can be classified as one of the following: - -- `modifies/…`: Determines which parts of the codebase are affected. These labels will be set through the CI. -- `topic/…`: Determines the conceptual component of Gitea that is affected, i.e. issues, projects, or authentication. At best, PRs should only target one component but there might be overlap. Must be set manually. -- `type/…`: Determines the type of an issue or PR (feature, refactoring, docs, bug, …). If GitHub supported scoped labels, these labels would be exclusive, so you should set **exactly** one, not more or less (every PR should fall into one of the provided categories, and only one). -- `issue/…` / `pr/…`: Labels that are specific to issues or PRs respectively and that are only necessary in a given context, i.e. `issue/not-a-bug` or `pr/need-2-approvals` - -Every PR should be labeled correctly with every label that applies. - -There are also some labels that will be managed automatically.\ -In particular, these are - -- the amount of pending required approvals -- has all `backport`s or needs a manual backport - -### Breaking PRs - -#### What is a breaking PR? - -A PR is breaking if it meets one of the following criteria: - -- It changes API output in an incompatible way for existing users -- It removes a setting that an admin could previously set (i.e. via `app.ini`) -- An admin must do something manually to restore the old behavior - -In particular, this means that adding new settings is not breaking.\ -Changing the default value of a setting or replacing the setting with another one is breaking, however. - -#### How to handle breaking PRs? - -If your PR has a breaking change, you must add two things to the summary of your PR: - -1. A reasoning why this breaking change is necessary -2. A `BREAKING` section explaining in simple terms (understandable for a typical user) how this PR affects users and how to mitigate these changes. This section can look for example like - -```md -## :warning: BREAKING :warning: -``` - -Breaking PRs will not be merged as long as not both of these requirements are met. - -### Maintaining open PRs - -The moment you create a non-draft PR or the moment you convert a draft PR to a non-draft PR is the moment code review starts for it. \ -Once that happens, do not rebase or squash your branch anymore as it makes it difficult to review the new changes. \ -Merge the base branch into your branch only when you really need to, i.e. because of conflicting changes in the mean time. \ -This reduces unnecessary CI runs. \ -Don't worry about merge commits messing up your commit history as every PR will be squash merged. \ -This means that all changes are joined into a single new commit whose message is as described below. - -### Getting PRs merged - -Changes to Gitea must be reviewed before they are accepted — no matter who -makes the change, even if they are an owner or a maintainer. \ -The only exception are critical bugs that prevent Gitea from being compiled or started. \ -Specifically, we require two approvals from maintainers for every PR. \ -Once this criteria has been met, your PR receives the `lgtm/done` label. \ -From this point on, your only responsibility is to fix merge conflicts or respond to/implement requests by maintainers. \ -It is the responsibility of the maintainers from this point to get your PR merged. - -If a PR has the `lgtm/done` label and there are no open discussions or merge conflicts anymore, any maintainer can add the `reviewed/wait-merge` label. \ -This label means that the PR is part of the merge queue and will be merged as soon as possible. \ -The merge queue will be cleared in the order of the list below: - - - -Gitea uses it's own tool, the to automate parts of the review process. \ -This tool does the things listed below automatically: - -- create a backport PR if needed once the initial PR was merged -- remove the PR from the merge queue after the PR merged -- keep the oldest branch in the merge queue up to date with merges - -### Final call - -If a PR has been ignored for more than 7 days with no comments or reviews, and the author or any maintainer believes it will not survive a long wait (such as a refactoring PR), they can send "final call" to the TOC by mentioning them in a comment. - -After another 7 days, if there is still zero approval, this is considered a polite refusal, and the PR will be closed to avoid wasting further time. Therefore, the "final call" has a cost, and should be used cautiously. - -However, if there are no objections from maintainers, the PR can be merged with only one approval from the TOC (not the author). - -### Commit messages - -Mergers are able and required to rewrite the PR title and summary (the first comment of a PR) so that it can produce an easily understandable commit message if necessary. \ -The final commit message should no longer contain any uncertainty such as `hopefully, won't happen anymore`. Replace uncertainty with certainty. - -#### PR Co-authors - -A person counts as a PR co-author the moment they (co-)authored a commit that is not simply a `Merge base branch into branch` commit. \ -Mergers are required to remove such "false-positive" co-authors when writing the commit message. \ -The true co-authors must remain in the commit message. - -#### PRs targeting `main` - -The commit message of PRs targeting `main` is always - -```bash -$PR_TITLE ($PR_INDEX) - -$REWRITTEN_PR_SUMMARY -``` - -#### Backport PRs - -The commit message of backport PRs is always - -```bash -$PR_TITLE ($INITIAL_PR_INDEX) ($BACKPORT_PR_INDEX) - -$REWRITTEN_PR_SUMMARY -``` - -## Documentation - -If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR. - -## API v1 - -The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest). - -### GitHub API compatibility - -Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \ -If Gitea provides functionality that GitHub does not, a new endpoint can be created. \ -If information is provided by Gitea that is not provided by the GitHub API, a new field can be used that doesn't collide with any GitHub fields. \ -Updating an existing API should not remove existing fields unless there is a really good reason to do so. \ -The same applies to status responses. If you notice a problem, feel free to leave a comment in the code for future refactoring to API v2 (which is currently not planned). - -### Adding/Maintaining API routes - -All expected results (errors, success, fail messages) must be documented ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)). \ -All JSON input types must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91)) \ -and referenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go). \ -They can then be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318). \ -All JSON responses must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68)) \ -and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16)) \ -They can be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279). - -### When to use what HTTP method - -In general, HTTP methods are chosen as follows: - -- **GET** endpoints return the requested object(s) and status **OK (200)** -- **DELETE** endpoints return the status **No Content (204)** and no content either -- **POST** endpoints are used to **create** new objects (e.g. a User) and return the status **Created (201)** and the created object -- **PUT** endpoints are used to **add/assign** existing Objects (e.g. a user to a team) and return the status **No Content (204)** and no content either -- **PATCH** endpoints are used to **edit/change** an existing object and return the changed object and the status **OK (200)** - -### Requirements for API routes - -All parameters of endpoints changing/editing an object must be optional (except the ones to identify the object, which are required). - -Endpoints returning lists must - -- support pagination (`page` & `limit` options in query) -- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444)) - -## Backports and Frontports - -### What is backported? - -We backport PRs given the following circumstances: - -1. Feature freeze is active, but `-rc0` has not been released yet. Here, we backport as much as possible. -2. `rc0` has been released. Here, we only backport bug- and security-fixes, and small enhancements. Large PRs such as refactors are not backported anymore. -3. We never backport new features. -4. We never backport breaking changes except when - 1. The breaking change has no effect on the vast majority of users - 2. The component triggering the breaking change is marked as experimental - -### How to backport? - -In the past, it was necessary to manually backport your PRs. \ -Now, that's not a requirement anymore as our [backport bot](https://github.com/GiteaBot) tries to create backports automatically once the PR is merged when the PR - -- does not have the label `backport/manual` -- has the label `backport/` - -The `backport/manual` label signifies either that you want to backport the change yourself, or that there were conflicts when backporting, thus you **must** do it yourself. - -### Format of backport PRs - -The title of backport PRs should be - -``` - (#) -``` - -The first two lines of the summary of the backporting PR should be - -``` -Backport # - -``` - -with the rest of the summary and labels matching the original PR. - -### Frontports - -Frontports behave exactly as described above for backports. - -## Developer Certificate of Origin (DCO) - -We consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the certifications and terms of the [DCO](DCO) and [MIT license](LICENSE). \ -No further action is required. \ -You can also decide to sign off your commits by adding the following line at the end of your commit messages: - -``` -Signed-off-by: Joe Smith -``` - -If you set the `user.name` and `user.email` Git config options, you can add the line to the end of your commits automatically with `git commit -s`. - -We assume in good faith that the information you provide is legally binding. - -## Release Cycle - -We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \ -The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \ -All the feature pull requests should be -merged before feature freeze. And, during the frozen period, a corresponding -release branch is open for fixes backported from main branch. Release candidates -are made during this period for user testing to -obtain a final version that is maintained in this branch. - -During a development cycle, we may also publish any necessary minor releases -for the previous version. For example, if the latest, published release is -v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are -still possible. - -## Maintainers - -To make sure every PR is checked, we have [maintainers](MAINTAINERS). \ -Every PR **must** be reviewed by at least two maintainers (or owners) before it can get merged. \ -For refactoring PRs after a week and documentation only PRs, the approval of only one maintainer is enough. \ -A maintainer should be a contributor of Gitea and contributed at least -4 accepted PRs. A contributor should apply as a maintainer in the -[Discord](https://discord.gg/Gitea) `#develop` channel. The team maintainers may invite the contributor. A maintainer -should spend some time on code reviews. If a maintainer has no -time to do that, they should apply to leave the maintainers team -and we will give them the honor of being a member of the [advisors -team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if -an advisor has time to code review, we will gladly welcome them back -to the maintainers team. If a maintainer is inactive for more than 3 -months and forgets to leave the maintainers team, the owners may move -him or her from the maintainers team to the advisors team. -For security reasons, Maintainers should use 2FA for their accounts and -if possible provide GPG signed commits. -https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/ -https://help.github.com/articles/signing-commits-with-gpg/ - -## Technical Oversight Committee (TOC) - -At the start of 2023, the `Owners` team was dissolved. Instead, the governance charter proposed a technical oversight committee (TOC) which expands the ownership team of the Gitea project from three elected positions to six positions. Three positions would be elected as it has been over the past years, and the other three would consist of appointed members from the Gitea company. -https://blog.gitea.com/quarterly-23q1/ - -When the new community members have been elected, the old members will give up ownership to the newly elected members. For security reasons, TOC members or any account with write access (like a bot) must use 2FA. -https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/ - -### Current TOC members - -- 2023-01-01 ~ 2023-12-31 - https://blog.gitea.com/quarterly-23q1/ - - Company - - [Jason Song](https://gitea.com/wolfogre) - - [Lunny Xiao](https://gitea.com/lunny) - - [Matti Ranta](https://gitea.com/techknowlogick) - - Community - - [6543](https://gitea.com/6543) <6543@obermui.de> - - [Andrew Thornton](https://gitea.com/zeripath) - - [John Olheiser](https://gitea.com/jolheiser) - -### Previous TOC/owners members - -Here's the history of the owners and the time they served: - -- [Lunny Xiao](https://gitea.com/lunny) - 2016, 2017, [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872) -- [Kim Carlbäcker](https://github.com/bkcsoft) - 2016, 2017 -- [Thomas Boerger](https://gitea.com/tboerger) - 2016, 2017 -- [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) - [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801) -- [Matti Ranta](https://gitea.com/techknowlogick) - [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872) -- [Andrew Thornton](https://gitea.com/zeripath) - [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872) - -## Governance Compensation - -Each member of the community elected TOC will be granted $500 each month as compensation for their work. - -Furthermore, any community release manager for a specific release or LTS will be compensated $500 for the delivery of said release. - -These funds will come from community sources like the OpenCollective rather than directly from the company. -Only non-company members are eligible for this compensation, and if a member of the community TOC takes the responsibility of release manager, they would only be compensated for their TOC duties. -Gitea Ltd employees are not eligible to receive any funds from the OpenCollective unless it is reimbursement for a purchase made for the Gitea project itself. - -## TOC & Working groups - -With Gitea covering many projects outside of the main repository, several groups will be created to help focus on specific areas instead of requiring maintainers to be a jack-of-all-trades. Maintainers are of course more than welcome to be part of multiple groups should they wish to contribute in multiple places. - -The currently proposed groups are: - -- **Core Group**: maintain the primary Gitea repository -- **Integration Group**: maintain the Gitea ecosystem's related tools, including go-sdk/tea/changelog/bots etc. -- **Documentation Group**: maintain related documents and repositories -- **Translation Group**: coordinate with translators and maintain translations -- **Security Group**: managed by TOC directly, members are decided by TOC, maintains security patches/responsible for security items - -## Roadmap - -Each year a roadmap will be discussed with the entire Gitea maintainers team, and feedback will be solicited from various stakeholders. -TOC members need to review the roadmap every year and work together on the direction of the project. - -When a vote is required for a proposal or other change, the vote of community elected TOC members count slightly more than the vote of company elected TOC members. With this approach, we both avoid ties and ensure that changes align with the mission statement and community opinion. - -You can visit our roadmap on the wiki. - -## Versions - -Gitea has the `main` branch as a tip branch and has version branches -such as `release/v1.19`. `release/v1.19` is a release branch and we will -tag `v1.19.0` for binary download. If `v1.19.0` has bugs, we will accept -pull requests on the `release/v1.19` branch and publish a `v1.19.1` tag, -after bringing the bug fix also to the main branch. - -Since the `main` branch is a tip version, if you wish to use Gitea -in production, please download the latest release tag version. All the -branches will be protected via GitHub, all the PRs to every branch must -be reviewed by two maintainers and must pass the automatic tests. - -## Releasing Gitea - -- Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future. -- Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on Discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours. -- If this is a big version first you have to create PR for changelog on branch `main` with PRs with label `changelog` and after it has been merged do following steps: - - Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`. - - When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin` -- If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged. -- Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`. -- And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.) -- If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version. -- Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release. -- Verify all release assets were correctly published through CI on dl.gitea.com and GitHub releases. Once ACKed: - - bump the version of https://dl.gitea.com/gitea/version.json - - merge the blog post PR - - announce the release in discord `#announcements` diff --git a/README.md b/README.md deleted file mode 100644 index 5ab5ab8586..0000000000 --- a/README.md +++ /dev/null @@ -1,182 +0,0 @@ -

- - Gitea - -

-

Gitea - Git with a cup of tea

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - Contribute with Gitpod - - - - - - - - - - -

- -

- View this document in Chinese -

- -## Purpose - -The goal of this project is to make the easiest, fastest, and most -painless way of setting up a self-hosted Git service. - -As Gitea is written in Go, it works across **all** the platforms and -architectures that are supported by Go, including Linux, macOS, and -Windows on x86, amd64, ARM and PowerPC architectures. -This project has been -[forked](https://blog.gitea.com/welcome-to-gitea/) from -[Gogs](https://gogs.io) since November of 2016, but a lot has changed. - -For online demonstrations, you can visit [try.gitea.io](https://try.gitea.io). - -For accessing free Gitea service (with a limited number of repositories), you can visit [gitea.com](https://gitea.com/user/login). - -To quickly deploy your own dedicated Gitea instance on Gitea Cloud, you can start a free trial at [cloud.gitea.com](https://cloud.gitea.com). - -## Building - -From the root of the source tree, run: - - TAGS="bindata" make build - -or if SQLite support is required: - - TAGS="bindata sqlite sqlite_unlock_notify" make build - -The `build` target is split into two sub-targets: - -- `make backend` which requires [Go Stable](https://go.dev/dl/), the required version is defined in [go.mod](/go.mod). -- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater. - -Internet connectivity is required to download the go and npm modules. When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js. - -Parallelism (`make -j `) is not supported. - -More info: https://docs.gitea.com/installation/install-from-source - -## Using - - ./gitea web - -NOTE: If you're interested in using our APIs, we have experimental -support with [documentation](https://try.gitea.io/api/swagger). - -## Contributing - -Expected workflow is: Fork -> Patch -> Push -> Pull Request - -NOTES: - -1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.** -2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks! - -## Translating - -Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there. - -You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up. - -https://docs.gitea.com/contributing/localization - -[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea) - -## Further information - -For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com/). -If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/). - -We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea). - -The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea). - -## Authors - -- [Maintainers](https://github.com/orgs/go-gitea/people) -- [Contributors](https://github.com/go-gitea/gitea/graphs/contributors) -- [Translators](options/locale/TRANSLATORS) - -## Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)] - - - -## Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)] - - - - - - - - - - - - -## FAQ - -**How do you pronounce Gitea?** - -Gitea is pronounced [/ɡɪ’ti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g. - -**Why is this not hosted on a Gitea instance?** - -We're [working on it](https://github.com/go-gitea/gitea/issues/1029). - -## License - -This project is licensed under the MIT License. -See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file -for the full license text. - -## Screenshots - -Looking for an overview of the interface? Check it out! - -|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)| -|:---:|:---:|:---:| -|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)| -|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png) -![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)| diff --git a/README_ZH.md b/README_ZH.md deleted file mode 100644 index b9384a9825..0000000000 --- a/README_ZH.md +++ /dev/null @@ -1,102 +0,0 @@ -

- - Gitea - -

-

Gitea - Git with a cup of tea

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - Contribute with Gitpod - - - - - - - - - - -

- -

- View this document in English -

- -## 目标 - -Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86,amd64,还包括 ARM 和 PowerPC。 - -如果你想试用在线演示,请访问 [try.gitea.io](https://try.gitea.io/)。 - -如果你想使用免费的 Gitea 服务(有仓库数量限制),请访问 [gitea.com](https://gitea.com/user/login)。 - -如果你想在 Gitea Cloud 上快速部署你自己独享的 Gitea 实例,请访问 [cloud.gitea.com](https://cloud.gitea.com) 开始免费试用。 - -## 提示 - -1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**. -2. 所有的安全问题,请私下发送邮件给 **security@gitea.io**。谢谢! -3. 如果你要使用API,请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea). - -## 文档 - -关于如何安装请访问我们的 [文档站](https://docs.gitea.com/zh-cn/category/installation),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。 - -## 贡献流程 - -Fork -> Patch -> Push -> Pull Request - -## 翻译 - -多语言翻译是基于Crowdin进行的. -[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea) - -## 作者 - -* [Maintainers](https://github.com/orgs/go-gitea/people) -* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors) -* [Translators](options/locale/TRANSLATORS) - -## 授权许可 - -本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。 - -## 截图 - -|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)| -|:---:|:---:|:---:| -|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)| -|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png) -![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)| diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 4c7d437844..0000000000 --- a/SECURITY.md +++ /dev/null @@ -1,85 +0,0 @@ -# Reporting security issues - -The Gitea maintainers take security seriously. - -If you discover a security issue, please bring it to their attention right away! - -Previous vulnerabilities are listed at https://about.gitea.com/security. - -## Reporting a Vulnerability - -Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`. - -## Protecting Security Information - -Due to the sensitive nature of security information, you can use the below GPG public key to encrypt your mail body. - -The PGP key is valid until June 24, 2024. - -``` -Key ID: 6FCD2D5B -Key Type: RSA -Expires: 6/24/2024 -Key Size: 4096/4096 -Fingerprint: 3DE0 3D1E 144A 7F06 9359 99DC AAFD 2381 6FCD 2D5B -``` - -UserID: Gitea Security - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGK1Z/4BEADFMqXA9DeeChmSxUjF0Be5sq99ZUhgrZjcN/wOzz0wuCJZC0l8 -4uC+d6mfv7JpJYlzYzOK97/x5UguKHkYNZ6mm1G9KHaXmoIBDLKDzfPdJopVNv2r -OajijaE0uMCnMjadlg5pbhMLRQG8a9J32yyaz7ZEAw72Ab31fvvcA53NkuqO4j2w -k7dtFQzhbNOYV0VffQT90WDZdalYHB1JHyEQ+70U9OjVD5ggNYSzX98Eu3Hjn7V7 -kqFrcAxr5TE1elf0IXJcuBJtFzQSTUGlQldKOHtGTGgGjj9r/FFAE5ioBgVD05bV -rEEgIMM/GqYaG/nbNpWE6P3mEc2Mnn3pZaRJL0LuF26TLjnqEcMMDp5iIhLdFzXR -3tMdtKgQFu+Mtzs3ipwWARYgHyU09RJsI2HeBx7RmZO/Xqrec763Z7zdJ7SpCn0Z -q+pHZl24JYR0Kf3T/ZiOC0cGd2QJqpJtg5J6S/OqfX9NH6MsCczO8pUC1N/aHH2X -CTme2nF56izORqDWKoiICteL3GpYsCV9nyCidcCmoQsS+DKvE86YhIhVIVWGRY2F -lzpAjnN9/KLtQroutrm+Ft0mdjDiJUeFVl1cOHDhoyfCsQh62HumoyZoZvqzQd6e -AbN11nq6aViMe2Q3je1AbiBnRnQSHxt1Tc8X4IshO3MQK1Sk7oPI6LA5oQARAQAB -tCJHaXRlYSBTZWN1cml0eSA8c2VjdXJpdHlAZ2l0ZWEuaW8+iQJXBBMBCABBFiEE -PeA9HhRKfwaTWZncqv0jgW/NLVsFAmK1Z/4CGwMFCQPCZwAFCwkIBwICIgIGFQoJ -CAsCBBYCAwECHgcCF4AACgkQqv0jgW/NLVvnyxAAhxyNnWzw/rQO2qhzqicmZM94 -njSbOg+U2qMBvCdaqCQQeC+uaMmMzkDPanUUmLcyCkWqfCjPNjeSXAkE9npepVJI -4HtmgxZQ94OU/h3CLbft+9GVRzUkVI29TSYGdvNtV2/BkNGoFFnKWQr119um0o6A -bgha2Uy5uY8o3ZIoiKkiHRaEoWIjjeBxJxYAojsZY4YElUmsQ3ik2joG6rhFesTa -ofVt/bL8G2xzpOG26WGIxBbqf2qjV6OtZ0hu/vtTPHeIWMLq0Mz0V3PEDQWfkGPE -i2RYxxYDs2xzJhSQWqTNVLSq0m5xTJnbHhQPfdCX4C2jvFKgLdfmytQq49S7jiJb -Z03HVOZ/PsyBlQfH9xJi06R5yQCMEA8h8Z5r3/NXW09kQ6OFRe6xshoTcxZGRPTo -srhwr3uPbmCRh+YEl7qBLU6+BC5k8IRTZXqhrj/aPJu3MxgbgwV8u3vLoFSXM2lb -a61FgeCQ0O7lkgVswwF0RppCaH9Ul3ZDapet/vCRg4NVwm9zOI/8q/Vj0FKA1GDR -JhRu8+Ce8zlFL65D34t+PprAzSeTlbv9um3x/ZIjCco7EEKSBylt+AZj/VyA6+e5 -kjOQwRRc6dFJWBcorsSI2dG+H+QMF7ZabzmeCcz1v9HjLOPzYHoZAHhCmSppWTvX -AJy6+lhfW2OUTqQeYSi5Ag0EYrVn/gEQALrFLQjCR3GjuHSindz0rd3Fnx/t7Sen -T+p07yCSSoSlmnJHCQmwh4vfg1blyz0zZ4vkIhtpHsEgc+ZAG+WQXSsJ2iRz+eSN -GwoOQl4XC3n+QWkc1ws+btr48+6UqXIQU+F8TPQyx/PIgi2nZXJB7f5+mjCqsk46 -XvH4nTr4kJjuqMSR/++wvre2qNQRa/q/dTsK0OaN/mJsdX6Oi+aGNaQJUhIG7F+E -ZDMkn/O6xnwWNzy/+bpg43qH/Gk0eakOmz5NmQLRkV58SZLiJvuCUtkttf6CyhnX -03OcWaajv5W8qA39dBYQgDrrPbBWUnwfO3yMveqhwV4JjDoe8sPAyn1NwzakNYqP -RzsWyLrLS7R7J9s3FkZXhQw/QQcsaSMcGNQO047dm1P83N8JY5aEpiRo9zSWjoiw -qoExANj5lUTZPe8M50lI182FrcjAN7dClO3QI6pg7wy0erMxfFly3j8UQ91ysS9T -s+GsP9I3cmWWQcKYxWHtE8xTXnNCVPFZQj2nwhJzae8ypfOtulBRA3dUKWGKuDH/ -axFENhUsT397aOU3qkP/od4a64JyNIEo4CTTSPVeWd7njsGqli2U3A4xL2CcyYvt -D/MWcMBGEoLSNTswwKdom4FaJpn5KThnK/T0bQcmJblJhoCtppXisbexZnCpuS0x -Zdlm2T14KJ3LABEBAAGJAjwEGAEIACYWIQQ94D0eFEp/BpNZmdyq/SOBb80tWwUC -YrVn/gIbDAUJA8JnAAAKCRCq/SOBb80tWyTBD/9AGpW6QoDF7zYjHAozH9S5RGCA -Y7E82dG/0xmFUwPprAG0BKmmgU6TiipyVGmKIXGYYYU92pMnbvXkYQMoa+WJNncN -D3fY52UeXeffTf4cFpStlzi9xgYtOLhFamzYu/4xhkjOX+xhOSXscCiFRyT8cF3B -O6c5BHU+Zj0/rGPgOyPUbx7l7B9MubB/41nNX35k08e+8T3wtWDb4XF+15HnRfva -6fblO8wgU25Orv2Rm1jnKGa9DxJ8nE40IMrqDapENtDuL+zKJsvR0+ptWvEyL56U -GtJJG5un6mXiLKuRQT0DEv4MdZRHDgDstDnqcbEiazVEbUuvhZZob6lRY2A19m1+ -7zfnDxkhqCA1RCnv4fdvcPdCMMFHwLpdhjgW0aI/uwgwrvsEz5+JRlnLvdQHlPAg -q7l2fGcBSpz9U0ayyfRPjPntsNCtZl1UDxGLeciPkZhyG84zEWQbk/j52ZpRN+Ik -ALpRLa8RBFmFSmXDUmwQrmm1EmARyQXwweKU31hf8ZGbCp2lPuRYm1LuGiirXSVP -GysjRAJgW+VRpBKOzFQoUAUbReVWSaCwT8s17THzf71DdDb6CTj31jMLLYWwBpA/ -i73DgobDZMIGEZZC1EKqza8eh11xfyHFzGec03tbh+lIen+5IiRtWiEWkDS9ll0G -zgS/ZdziCvdAutqnGA== -=gZWO ------END PGP PUBLIC KEY BLOCK----- - -``` - -Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it. From 85d91c420b17e7e62f4a22f950fa31c29c4be60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sat, 17 Dec 2022 14:06:28 +0100 Subject: [PATCH 29/94] [DOCS] CONTRIBUTING Refs: https://codeberg.org/forgejo/forgejo/issues/8 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/153 Refs: https://codeberg.org/forgejo/forgejo/issues/123 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/299 (cherry picked from commit 08dcef0c8cc9cdf5d786a925f18c1ec0cf3364da) [DOCS] CONTRIBUTING/RELEASE: https://forgejo.org/docs/admin Because the version is not displayed on the landing page of Forgejo, there cannot be a link to a versionned documentation. There must exist a link that points to the latest version on the website for the forgejo instance to display. Better but more complicated approaches could be to: * Embed the documentation in Forgejo * Allow the admin to not display the help * Allow the admin to display a versionned help or not (cherry picked from commit 83cc38923935dcc7edca22756d6fc10988a58540) (cherry picked from commit 5df52b8a4f6ebd184999a19dd10138a8e3980869) (cherry picked from commit 9a66b3d70b6e7d2a3ee146d3708d48d8f9bfe305) [DOCS] CONTRIBUTING/RELEASE: reminder to update FORGEJO_VERSION (cherry picked from commit 2a4d0bd164e55fc981d9437d8220a9c1e00ca59b) (cherry picked from commit d68576ba6762f4af2ed8133fe123fa84c136a90c) [DOCS] CONTRIBUTING: updates * Remove obsolete description of the well being & moderation team and replace them with a link to the moderation email. * Remove description of the governance process and replace with a link to the governance readme that did not exist at the time. * Add links to the Forgejo documentation (cherry picked from commit df749da27225ee13b5e00b689b397b24afebd044) (cherry picked from commit 4da39128c50e5e754f1404a5b79669a8218344be) (cherry picked from commit f442ca6f4032bbd61185e488e5a513f4e4264559) (cherry picked from commit 031928c447e4cbc293de03f6befbba05691810fc) (cherry picked from commit 1e6ba47216f8cab267f555eb488f4e80ef503fcf) (cherry picked from commit 8916a1f8c6358a85c2484a465a73a5d657fcb048) (cherry picked from commit 663e28c41247e98b34cbd6cd32ce1b891f386989) (cherry picked from commit d56b130baaa4dd13bc64f2f149753b7a2e40ae01) [DOCS] CONTRIBUTING (squash) (cherry picked from commit 0dc4b6e5c93e1abc1502149603839ebe30ab4e5a) (cherry picked from commit 52f2163807abc5dcb35ebee32f695368be720105) (cherry picked from commit 47d0ae3e10385b7568474c4f3cae1eb79961838b) (cherry picked from commit 7757a5c34cd61bfc7a96766c6c55baba9d571c3f) (cherry picked from commit 5b4d25bd037d9142fe274bfdeb6ac43cf371ae95) (cherry picked from commit 78798cc25e90200474cb1051f97a97e2d8091568) (cherry picked from commit 3001fb8c7b3eecd6935b3c66f87981d77c0c64d9) (cherry picked from commit da27bf1bc5a3a4ee9b9bcbd34a9d81d503410de8) (cherry picked from commit 2fb13da8ed918fce8cc3a4471aefaba78836ffa5) (cherry picked from commit ea19e0efb33710f36cf2ca300424eca7301922a5) [DOCS] Add link to build instructions in CONTRIBUTING.md (cherry picked from commit 50d86aa4ad740938e6089fc7ebde231653da7f9e) Replace 'v1.20' with 'next' (cherry picked from commit 3e99f49fc5a9c104f2656a330d497c92368994fc) (cherry picked from commit f5c89e88cfe05b4ecc753674a24284b2a2af634c) (cherry picked from commit 8e70433dac072af935676dc42f41b1ef66a0eedd) (cherry picked from commit 31cc99588c0d456beb0b8493f919b06df3782371) fixes 404 links in CONTRIBUTING.md (cherry picked from commit b7326919ab20feaf5650cfb8d284dc074b835e62) (cherry picked from commit cd88e7d177101a9e3be9ef8c19f1220115ae3851) (cherry picked from commit 09d33f2050aafe9ffdd8412b1eacdd8aa172dfd1) (cherry picked from commit 8ea49fc0c7b693ae348738f63a8a6e82fbfeebdc) (cherry picked from commit a434c76f4b30a376643e3716d14bd0514e9af364) (cherry picked from commit c61e1b879717406586ea7c60d5fdea6782637e86) (cherry picked from commit 1ce9dc9defc22837dedfb52f0e8fbf78719204c8) (cherry picked from commit a90927d0b1b57f06625ef53c2860617f67608b92) (cherry picked from commit 17ca38d29a63d691817a09d3c53dc29ce1b8d0e2) (cherry picked from commit 70986dddc958c284a55eca2b8a758d2030a9aebe) (cherry picked from commit 667b4e740734bbb69438021d6813249d65392fb1) (cherry picked from commit dd3a3807780d1125c0b2ab2b47349577ca0073ca) (cherry picked from commit a22b8979e5882a58fcb369408b505d031f491589) (cherry picked from commit 87d1125ad00b0130e5b56f8b303f599f9d8fc6ef) (cherry picked from commit df6ebcc40b742815413741453729cbd3145b3200) (cherry picked from commit 9bac1dbf63c35a40e593e29c7a98e889fce6c3fb) (cherry picked from commit dc5e1998b31c5acf342164f4723c417d4ad5dc14) (cherry picked from commit 4c4878477edb8fa2653b94192a3980062d188140) (cherry picked from commit 9adf97d004f412aeb1e25cf3a63f4509c54b6ba5) (cherry picked from commit 3993bd23c4284766f04c4ace09cc4e92df59cdaa) (cherry picked from commit 1e04d81657005b47cdb11d93006cd174b6b86f2c) (cherry picked from commit 2aa2ff63f0ff09c7a048d415e7940dda16b2c373) (cherry picked from commit d2326d8aa4c81e5b99f8bd4a7d587903111792d9) --- CONTRIBUTING.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..2344d371cc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,24 @@ +# Forgejo Contributor Guide + +The Forgejo project is run by a community of people who are expected to follow this guide when cooperating on a simple bug fix as well as when changing the governance. For more information about the project, take a look at [the documentation explaining what Forgejo provides](README.md). + +Sensitive security-related issues should be reported to [security@forgejo.org](mailto:security@forgejo.org) using [encryption](https://keyoxide.org/security@forgejo.org). + +## For everyone involved + +- [Documentation](https://forgejo.org/docs/next/) +- [Code of Conduct](https://forgejo.org/docs/latest/developer/coc/) +- [Bugs, features, security and others discussions](https://forgejo.org/docs/latest/developer/discussions/) +- [Governance](https://forgejo.org/docs/latest/developer/governance/) +- [Sustainability and funding](https://codeberg.org/forgejo/sustainability/src/branch/main/README.md) + +## For contributors + +- [Developer Certificate of Origin (DCO)](https://forgejo.org/docs/latest/developer/dco/) +- [Development workflow](https://forgejo.org/docs/latest/developer/workflow/) +- [Compiling from source](https://forgejo.org/docs/latest/developer/from-source/) + +## For maintainers + +- [Release management](https://forgejo.org/docs/latest/developer/release/) +- [Secrets](https://forgejo.org/docs/latest/developer/secrets/) From 8d5277a7e1913b9dc2941553c657dadea499aa99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sat, 17 Dec 2022 14:06:57 +0100 Subject: [PATCH 30/94] [DOCS] README (cherry picked from commit a47b4745861ba2ab7485974d27334aed44feeac3) (cherry picked from commit 2fcc61c1d929380884dd9aeb143c202a2be0eef9) (cherry picked from commit 67debe2247c83753173efba53c60845f522857b5) (cherry picked from commit b90ffbb309bc76968588a024d2ced081989295ea) (cherry picked from commit 07a744814855a8bcb8d196c6c31f9bde7cfcf249) (cherry picked from commit a7fe270c08c25e6db42c32019b4a1a0720a57ec1) (cherry picked from commit 2f15389a9cafa00001c84396a1a88a14c3250e5c) (cherry picked from commit 16ba587f5dbbfa36398ca55e5210e5233211e224) (cherry picked from commit 683a23b2ca29f3638a2bd703dad567ae2896f261) (cherry picked from commit 3e5de3f656fa769317bf1cd1e508682f89e90000) (cherry picked from commit 5789005c4355f9d6b76a2288376b3b45a7939ba0) (cherry picked from commit 75c0f11079bc1e376b55186c4994bea71a54cd15) (cherry picked from commit e78a272e111066950ad5a365e504e1aacb4de5b7) (cherry picked from commit 464a534a3a712111b5578523bb657cd36cb10f64) (cherry picked from commit 7c0b73ca6fc28696fd580d7f858f8d814436e9a6) (cherry picked from commit e66b8edbc6fa1120ea4e66d586ea46c06a865a05) (cherry picked from commit a91864340d75d16e6afce18e7e5b974cfae8719f) (cherry picked from commit 504905bc882ad075f821fb4fcd86560191bdada9) (cherry picked from commit 650137433f44d65570947c8dbad6fb51b18f8a68) (cherry picked from commit 3e00bdaf2a2d47d168108cd130829d6d864fa4b4) (cherry picked from commit 43efcc1a29449c802b18a09387af67c24e71b189) (cherry picked from commit 4984ba13c57fdade1a5744713c98a60e650a5b9a) (cherry picked from commit 02b7928710ad9446b93598801dff0afae828136a) (cherry picked from commit 0db0feaee25187bcd4c28c9e66d3d0eabaad7a8d) (cherry picked from commit 94d141bc7f488ab0e6512218cac409b63cf83700) (cherry picked from commit 392fb1589178338b8285df7b348754e79611590e) (cherry picked from commit c5699a7bb71962321b131c9ac4413f8710de0d56) (cherry picked from commit b975597a781c745463d9db80a220733d99a12e28) (cherry picked from commit 5395e74d72285490f25067c8ac72899a3e23f3e7) (cherry picked from commit bc8060dee4355667680dab8935a7abd504ceefbd) (cherry picked from commit 3b64f1477a50319c3dbf638c89ef04dbd2fc12af) (cherry picked from commit d40378e1c767194b2207d359378a976f1f0c9090) (cherry picked from commit a713f7e3f9f6f8231d2cba82833d8eabec8b0dd4) (cherry picked from commit 87f65ccf78eb19e573971c8c16a76f60d610a5d5) (cherry picked from commit 049ea571a90853cb9bc1ce054313055884f76513) (cherry picked from commit 433d1d7baae7e72b32b8d2febdf0bf01d925bbf3) (cherry picked from commit 21bed2af1de216304dac33c33865bb70e31e416d) (cherry picked from commit fe700ca4015e62d83b40ed5409de023ab8959f4c) (cherry picked from commit 2f5c0479a9ca2f779c5feed1abb32aad4fc62cd0) (cherry picked from commit f7afcdba8a4fb1e6f60ec3c2d6ffb256d6f3413f) (cherry picked from commit 323e99d9f5c2526b332748da2802c3b5d4f54bc7) (cherry picked from commit aa6a3edf2f0de500c417b1a82c804fe74ef46757) (cherry picked from commit 754a8b4b305e3f6656ada4898ed0eaa987cfc7c8) (cherry picked from commit 52f173647a77a9ed4252472618cbcfa74254618a) (cherry picked from commit 559dcf0ccf96f0562f9015e692de56747eaa30f1) (cherry picked from commit 393f09eaf9e31dd6471623f21eb1cba0070ef325) (cherry picked from commit a3eb61aef38190b3f3d343decc1985c5a9dadd69) --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..e223979d42 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +
+ +

Welcome to Forgejo

+
+ +Hi there! Tired of big platforms playing monopoly? +Providing Git hosting for your project, friends, company or community? +**Forgejo** (/for'd͡ʒe.jo/ inspired by forĝejo – the Esperanto word for *forge*) has you covered with its intuitive interface, +light and easy hosting and a lot of builtin functionality. + +Forgejo was [created in 2022](https://forgejo.org/2022-12-15-hello-forgejo/) +because we think that the project should be owned by an independent community. +If you second that, then Forgejo is for you! +Our promise: **Independent Free/Libre Software forever!** + +## What does Forgejo offer? + + + +If you like any of the following, Forgejo is literally meant for you: + +- Lightweight: Forgejo can easily be hosted on nearly **every machine**. + Running on a Raspberry? Small cloud instance? No problem! +- Project management: Besides Git hosting, Forgejo offers issues, + pull requests, wikis, kanban boards and much more to **coordinate with your team**. +- Publishing: Have something to share? Use **releases** to host your software for download, + or use the **package registry** to publish it for docker, npm and many other package managers. +- Customizable: Want to change your look? Change some settings? + There are many **config switches** to make Forgejo work exactly like you want. +- Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. + If you have **advanced needs**, Forgejo has you covered. +- Privacy: From update checker to default settings: Forgejo is built to be **privacy first** for you and your crew. +- Federation: (WIP) We are actively working to connect software forges with each other through **ActivityPub**, + and create a collaborative network of personal instances. + +## Learn more + +Dive into the [documentation](https://forgejo.org/docs/latest/), subscribe to releases and blog post on [our website](https://forgejo.org), find us on the Fediverse or hop into [our Matrix room](https://matrix.to/#/#forgejo-chat:matrix.org) if you have any questions or want to get involved. + + +## Get involved + +If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please [take a look at the contribution guide](CONTRIBUTING.md). From 28d7612b3edbb0a7d911a0d1b257d0fe00600cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sat, 17 Dec 2022 14:07:07 +0100 Subject: [PATCH 31/94] [WORKFLOW] issues & pr templates (cherry picked from commit 9dd224f00c02151642523f31c98b819a2ea9b1b7) (cherry picked from commit 710af007bccb62c65dd51ae46c77a297c0c58e43) (cherry picked from commit 2ccd6e2bd60dbc829b98b75daef3b1360cd708e7) (cherry picked from commit b90dc5fc4f90b7a916348378a089a9d54b23ce60) (cherry picked from commit bf25d98a981800979073be008d254bfe0efe58bf) (cherry picked from commit d7c71e598540ffe7586e99d0c9a8af53b564e5df) [WORKFLOW] Add Forgejo Next and reproducing to issue template (cherry picked from commit 17a3988fe09125755148380bc906f369b45b9764) (cherry picked from commit 9ee5b3a619591143bb00bc26ec01fb350f2a0dfa) (cherry picked from commit bebdd8d5f31cfab4e9fbe90d453305d264a99479) (cherry picked from commit be7bb96d5c2303dbda5999ac20d32559e2085eed) (cherry picked from commit 4ae659d63a095dacd01de798db83a8817a97dbf9) (cherry picked from commit 82426f376d13d38c39364edfc58bf675cfd6918b) (cherry picked from commit 1cb28e36712554961f16d912a443f86f535b3f42) (cherry picked from commit c6a2db94c4b7861319fc63bc5e9304b2d4e61a22) (cherry picked from commit 90d3eb2d1303dfd126c77721c1f3013b7da12db0) (cherry picked from commit 3c3e656f582a0b3fdc8106ee7a30b4b3eb0b7c64) (cherry picked from commit 54ece82417746fd725671309b68528db38796247) (cherry picked from commit 55a042485a4c1d00ddddfb156c8db995af8b4819) (cherry picked from commit 4e984aeba6e27fe86d11bebeffd5922bbdb7e7be) (cherry picked from commit 52ea3f32b6f015e97ae84770d7254edcb1ff47d0) (cherry picked from commit 00b0d0621efd3be8078d2dc9f0924f6ea16dd756) (cherry picked from commit dc4acfa6db3cf9cce5cbf71cbda139541ca4b3d8) (cherry picked from commit 0d26574fe3759057b66c43a64302a8f9c11ff17e) (cherry picked from commit 81acdf5a84a9151b60977b5ca48018ea7ac739c3) (cherry picked from commit bcb063e157a3fd9d58777f381b7fb894c4fb7149) (cherry picked from commit 3e3bd36e6d526e53cdca3edd4da024efa351bf8e) (cherry picked from commit 7767bafbffea48f1c1f06a7feefdbd72ba203496) (cherry picked from commit c98e1afb4ccfaef14976b27304c07a3b5de5e6fb) (cherry picked from commit 8ebc60b9495b6e7e4823f13880ae4582ee52281f) (cherry picked from commit 59555d146e6a52aead047302a2affd5b73616e4a) (cherry picked from commit 8ec25e8838b96aa4af135113663b8b4d28f5b8bf) (cherry picked from commit 6e568c70d75a7aef7d64acc66991cae3cb26e378) (cherry picked from commit 5a36052803d92ce51e3855889bb438e1ac0c7c7d) (cherry picked from commit c7e6dc6b13b6d25f4c72a08f3e42fe931e309ec2) (cherry picked from commit 005557f7ef4eb4ae14a8b454efab8b262c012e34) (cherry picked from commit c643b2ef5879438d806cb93e244a1d8635408e3d) (cherry picked from commit 8533627ee4ca96c43444f5962533a5a04ccfaddb) (cherry picked from commit a9ce3d681cf2bb5c5e7d0dffb2635a5d43e65d76) (cherry picked from commit e5efb10515b0dc37a5421f307eba6d9e86d68451) (cherry picked from commit b0d00464ef242deb9b639729de201f72005f6af5) (cherry picked from commit f54c25fa7d7b7752dcb46d0ec1138074256827af) (cherry picked from commit b686249a4a41d35dfddb69087f42664c14fd3599) (cherry picked from commit a55bc0abd37ed234eece6be333ceaff6fcec4626) (cherry picked from commit bcb5e3480275799d5b6dc7af961a010fc1e5907c) (cherry picked from commit e40a2d3e1542afba443cf671d84377d5eb0ef817) (cherry picked from commit 412ef602c91b0c940947ba4274865c7bc9f70ae5) (cherry picked from commit 536922186de8d43cf59202b2eec7df2c868eebef) (cherry picked from commit 51c622012428b7ac6d5b50b884a6985ae86e22b5) --- .gitea/ISSUE_TEMPLATE/bug-report.md | 57 ++++++++++++++++++++++++ .gitea/ISSUE_TEMPLATE/feature-request.md | 24 ++++++++++ .gitea/pull_request_template.md | 4 ++ 3 files changed, 85 insertions(+) create mode 100644 .gitea/ISSUE_TEMPLATE/bug-report.md create mode 100644 .gitea/ISSUE_TEMPLATE/feature-request.md create mode 100644 .gitea/pull_request_template.md diff --git a/.gitea/ISSUE_TEMPLATE/bug-report.md b/.gitea/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000000..d334ea6e63 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,57 @@ +--- +name: "Bug Report" +about: "Found something you weren't expecting? Report it here!" +title: "[BUG] " +--- + + +- Can you reproduce the problem on [Forgejo Next](https://next.forgejo.org/)? +- Forgejo version (or commit ref): +- Git version: +- Operating system: +- Database (use `[x]`): + - [ ] PostgreSQL + - [ ] MySQL + - [ ] MSSQL + - [ ] SQLite +- How are you running Forgejo? + + +## Description + + +## Reproducing + + +## Logs + + +## Screenshots + diff --git a/.gitea/ISSUE_TEMPLATE/feature-request.md b/.gitea/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000000..3708f2514e --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,24 @@ +--- +name: "Feature Request" +about: "Got an idea for a feature that Forgejo doesn't have yet? Submit it here!" +title: "[FEAT] " +--- + + +## Needs and benefits + + +## Feature Description + + +## Screenshots + diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md new file mode 100644 index 0000000000..a94ec46201 --- /dev/null +++ b/.gitea/pull_request_template.md @@ -0,0 +1,4 @@ + From 538ca28ee88cdbfaa2414d58163d377d1768ce56 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 10 Sep 2023 16:47:22 +0200 Subject: [PATCH 32/94] [TESTS] add GOLANGCI_LINT_ARGS to control golangci calls It is for instance useful with: GOLANGCI_LINT_ARGS="--concurrency $(expr $(nproc) / 2)" make lint-backend on a laptop where overcommitting the CPU degrades the UI performances. (cherry picked from commit 76023319c4275645b9c8c3bd896c1e60e1d57ae7) (cherry picked from commit 55eb05b03db15355745af83e612406baccc2b126) (cherry picked from commit 49c84de3dff883c89a3c0115ab7e0a06aad7bb45) (cherry picked from commit e8e26f08a6f31fc68797d6e0a927e75565abc350) (cherry picked from commit 401aa12cac3ad50ffa21c5e141d72e1d7cfd45ff) (cherry picked from commit 4ae8f663ad287269e1dc8bee19b3edcf41a431f8) (cherry picked from commit 2d87e4953b93204d2da530315e03bf311cd22e10) (cherry picked from commit e79be7d80e24effa110d4752525ab704ab6b16c0) (cherry picked from commit 65e367399867e13a9565e2553901be60036e27d8) (cherry picked from commit 54e5a5dca264a83ade0cbcf52a5f66660b8a4d86) (cherry picked from commit 99e8725e680bd0b7a297ac163aef0e5fecac2363) (cherry picked from commit c2048b352f955978bd8caa67f606cd0d8431b791) (cherry picked from commit ad142d18a8326c147b076e058cdd2a637f2ef80a) (cherry picked from commit 489d42770e1224b20a0b815be31a13bfe4e03a7f) (cherry picked from commit 2de9069ed409071f423b3c6a4032cdc8dbb2be2b) (cherry picked from commit 782d8ef6df8b02086ab0486ab0cfcc5b62b4d7ce) (cherry picked from commit 2068b26cd93bcec3f99af3bafcb3c7cd6a71ca15) (cherry picked from commit 1857f062dd1423d279a619a2588bc1b41a512f74) (cherry picked from commit beced6a2cca433d6dc4d680b2b241be7de65081f) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 531de4c612..ee19f458b6 100644 --- a/Makefile +++ b/Makefile @@ -380,11 +380,11 @@ lint-md: node_modules .PHONY: lint-go lint-go: - $(GO) run $(GOLANGCI_LINT_PACKAGE) run + $(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) .PHONY: lint-go-fix lint-go-fix: - $(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix + $(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix # workaround step for the lint-go-windows CI task because 'go run' can not # have distinct GOOS/GOARCH for its build and run steps From b44dae67f388f4266f5bb6ffd1cceb169b3fac75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Mon, 2 Jan 2023 22:49:15 +0100 Subject: [PATCH 33/94] [DOCS] RELEASE-NOTES.md (cherry picked from commit b07123ee7b441946bdeacf38dfbabde705427f63) (cherry picked from commit ca85c880b476428b407c30b4b1776b2e008c9330) (cherry picked from commit 723ead94cb63e8d703f0159a02e2fcaff2f1bb30) (cherry picked from commit ff148318da221be77813675437026985a19107a7) [DOCS] RELEASE-NOTES: 1.19.0 (cherry picked from commit e84e43887beae3a2f18afb8ef71fdc17078413bc) [DOCS] RELEASE-NOTES: add scoped access tokens (cherry picked from commit 688f831853ef179d511cc7594dd23cc46ccef654) [DOCS] RELEASE-NOTES: Scoped labels (cherry picked from commit 747479a07b3b7b329016337025eddbc82c4073a4) [DOCS] RELEASE-NOTES: OIDC groups (cherry picked from commit 10c505fe8941b81824f08e4c6a39d12517c182bc) [DOCS] RELEASE-NOTES: Copy Link is broken On firefox it fails with Uncaught TypeError: navigator.clipboard is undefined On chromium it fails with Uncaught TypeError: Cannot read properties of undefined (reading 'writeText') (cherry picked from commit 148b2ff093fa87672aa09d09484b7803bbdecc39) [DOCS] RELEASE-NOTES: Copy citation (cherry picked from commit d0f217735f506d0f4fb414f38860d821cd1925b5) [DOCS] RELEASE-NOTES: Support org/user level projects (cherry picked from commit de845c7bcf4637f442a612fafb6a663c7dc69473) [DOCS] RELEASE-NOTES: v1.19 has a documentation (cherry picked from commit 9a5b46da32fa12c32215a0c0a8b233c14a10c9b0) [DOCS] RELEASE-NOTES: do not split webhook section (cherry picked from commit 00ed02032124ca75644ec2365f054c56d7e68d20) [DOCS] RELEASE-NOTES: Incoming emails (cherry picked from commit 06c455b33bf39a7595a31a983dbaab7e28795f55) [DOCS] RELEASE-NOTES: secrets are an implementation detail (cherry picked from commit 8236dc3a573f9cdb892894416268d3a115c77fd1) [DOCS] RELEASE-NOTES: Prohibit fork if user reached maximum (cherry picked from commit 0f80b8c696ef8c407466605588f341b710a023ab) [DOCS] RELEASE-NOTES: scoped tokens: do not duplicate the docs (cherry picked from commit 9bc4793c078e115ab5d59fda89fb43765dcb0526) [DOCS] RELEASE-NOTES: rss feed for tags and releases (cherry picked from commit 599b36fada5f12a3fb4e0eed4f787606af701e46) [DOCS] RELEASE-NOTES: protected branches wildcard (cherry picked from commit 2b316c495056b9ae9191f51f550eb0a5c76ae6c1) [DOCS] RELEASE-NOTES: disable releases (cherry picked from commit 9a60773f1dcaf241b43707c2009e0223d0b3eed9) [DOCS] RELEASE-NOTES: review box (cherry picked from commit 09867dd1220c66c6ad468f9f0a0a22740510f373) [DOCS] RELEASE-NOTES: asciicast support (cherry picked from commit ea9658379b25f9c1dec487fd5d9139d37735e113) [DOCS] RELEASE-NOTES: attention blocks (cherry picked from commit 70b387750b2fea65e68aa2b1486ffcfef0dbd2fd) [DOCS] RELEASE-NOTES: commit cross reference (cherry picked from commit fe706dad13db9f3ad4fd6699b20337712e7a674b) [DOCS] RELEASE-NOTES: strip user completion border case (cherry picked from commit 33ca51b4b699ba347d395796d80eebab09b1a2f6) [DOCS] RELEASE-NOTES: card preview (cherry picked from commit 626cd78ca6d2c95dcd90c33d0f9e3e99f48912e7) [DOCS] RELEASE-NOTES: raw copy button (cherry picked from commit edfb467d64190df7b8056e5ced164678ea5a1ea7) [DOCS] RELEASE-NOTES: allow edits by maintainers by default (cherry picked from commit 7006405bc6113f4b7acd26d91d1f928022d00bdf) [DOCS] RELEASE-NOTES: database auto migration is a little arcane (cherry picked from commit 78030fa9af4a05e2092d54e18e7b2dee2037c299) [DOCS] RELEASE-NOTES: fix typos & minor rewording (cherry picked from commit ae1d47f656df2c11c140095d8710361ebe545af5) (cherry picked from commit ad08ca9955304663367fa66e8d2097b78bc5b438) [DOCS] RELEASE-NOTES: webhook authorization header (cherry picked from commit c35e2c4f6f985be5763363ae2b03e5d23378f0d2) [DOCS] RELEASE-NOTES: video element in markdown (cherry picked from commit bcb0bd51d2114a7f086358b568928c3feeefea57) [DOCS] RELEASE-NOTES: move scoped labels to the documentation (cherry picked from commit c5eedaf4f398ca232ca65f132d504425dd8ac3ba) [DOCS] RELEASE-NOTES: cosmetic improvements (cherry picked from commit b93df350d96c0cb8b6b6b924a1dd8af1551f2263) [DOCS] RELEASE-NOTES: 1.19.0-0 is really : 1.19.0-2 (cherry picked from commit 60d770c2c95d841c597f619e73582bbdfcdb0143) [DOCS] RELEASE-NOTES: relevant repositories (cherry picked from commit de6ed5b87f845bb86f4d3aa4085f373958797ebe) (cherry picked from commit 71d91fdf22d04cb8d0c88eac87a9a59e1c558bd7) [DOCS] RELEASE-NOTES: semantic version (cherry picked from commit af062d77f0641426aa048e5975585b01652aea01) [DOCS] RELEASE-NOTES: reflogs (cherry picked from commit 084713d8aae787e2db76219f29840f006967ff92) (cherry picked from commit 90ad322a56bd67f717e32e8a1a419033add3655a) [DOCS] RELEASE-NOTES: fix broken link to OIDC mapping (cherry picked from commit 802a252eb5ddb411574cd7a8c9645fffd88de469) [DOCS] RELEASE-NOTES: Fix spaces (cherry picked from commit a605d36ab63cba34770b14e0073ee6b9dbb3b511) [DOCS] RELEASE-NOTES: SemVer (cherry picked from commit 7b29c90035f243944340952c234e2caec84527e7) (cherry picked from commit 82799195c9208d43a6c6d8da1fd6f7560f224b09) (cherry picked from commit 5d9c2e9ec67ea7d39532d61bbf5aed3e1161d669) [DOCS] RELEASE-NOTES: 1.19.0-3 (cherry picked from commit c599b2947d9da682da156fad459be76f09bda999) (cherry picked from commit 8a37027ae78f42f211e179bc4080488485982a87) [DOCS] RELEASE-NOTES: v1.19.1-0 (cherry picked from commit 89b9e96cc778a6cc2a063201252e9e2c1042a355) (cherry picked from commit 2b4e881a4e43ea0ab522e4d8c127a2b4ccdb10d7) [DOCS] RELEASE-NOTES: 1.19.2-0 (cherry picked from commit 0c0d2ec46cbc34d42b36af7e4096ee8e149a77ae) (cherry picked from commit 437b8caae4d3045c00f671758dd287f005805cf6) [DOCS] RELEASE-NOTES: 1.19.3-0 (cherry picked from commit 040740917e24c7d97ace3f46723e88163bafb533) [DOCS] RELEASE-NOTES: 1.19.3-0 (fix typo) (cherry picked from commit 24516cb22ab3768d076d5da87afa5f135e4409da) (cherry picked from commit 429c8e652549072d0c695b7c3e7c9f447aea8b5b) (cherry picked from commit 8247bddb45de2e5a275551d50a84ccfe5cc28e7d) (cherry picked from commit d77d7b7be72d0de250d97cdedb9381a1cdc1562e) (cherry picked from commit a64c899b1dde2ebeb620569b16cf982eb519e475) (cherry picked from commit 0803eaa2e3b470f866e48fde7c6253666bfc5982) (cherry picked from commit 8538f2897e49027e6f30e477401a97ddf22beb5b) (cherry picked from commit 45b9037d3c0c243ffaab84b22d89e00371a2851e) (cherry picked from commit 928705f8701cb2736c8bd8de688d60345f80f991) (cherry picked from commit 19e683468c5bfaef5dc4c4a7cedbbdff3af7691c) (cherry picked from commit 5ae55e8e347c015ca5ce50e10f49d2d509d070fa) (cherry picked from commit 7c224d84cf1de8ce566533cbab48572735fce8ef) [DOCS] RELEASE-NOTES: 1.20.0 (cherry picked from commit 3fbcdd235b67c2292162949b1fd24e4fe1a55753) (cherry picked from commit e7a621acae5ce34c91db41848a4a2bc3e1fae6f6) (cherry picked from commit 70adac6d6659de22a87f2bdbee7297f677fc7b51) [DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) rewording (cherry picked from commit 1b79fab57d370f65b1a22fdec264889044d6ec17) [DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) time (cherry picked from commit cfd599a13224f3413abf7e75859224f4e48a3028) [DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) wiki (cherry picked from commit 6aa2ab41c60af2bb348971bd5e1110f7abf98727) pick changes from #829 (cherry picked from commit f5995981015fda2d012597aacfddb62d2b328230) [DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) ui (cherry picked from commit 5f0aa769b1691b0f12273d8e48ffda67fbe0ed02) features (cherry picked from commit d1e788ff4e3eeb9cb07cfc7ceb682b7d8414ab89) typos (cherry picked from commit 088d4b2d61b6c8210cde54a1e001860d2ec0cebc) Mirror Settings (cherry picked from commit 161412affd711b6a6ea4e3284d791137c69a6e6a) features (cherry picked from commit 10cb0379e2c557d43ce17ef3153e877684605a58) fix typo (cherry picked from commit aee096b04098b5a2ecaa75a40701ea7ddf4ad022) TODO (cherry picked from commit 0d4e0bb4a973f7bd2f6653ff18f2f0830d04da18) typo (cherry picked from commit b76a3c1a84333699c292f33027a80099587322ff) (cherry picked from commit 4c354196c2202a1f0b3635ad741ad66cbe1989ab) (cherry picked from commit 6323c6d1a28272f4694e9b213c25164ba1d03312) [DOCS] RELEASE-NOTES: 1.20.0 (squash) Woodpecker CI archive repository (cherry picked from commit 154ee5bc9c8a91980db646ce6f17da55445a111c) [DOCS] RELEASE-NOTES: 1.20.0 (squash) (cherry picked from commit 656f95544814cfcd6bd28e01e2baf5a524d4a273) [DOCS] RELEASE-NOTES: 1.19.4-0 (cherry picked from commit 85bd99717683c53cbf133989a20323a7c4f993a9) [DOCS] RELEASE-NOTES: 1.19.4-0 (squash) fix typo (cherry picked from commit e5c364c586ef4b848b91a855ce62291780c37307) (cherry picked from commit c123048e51a42167ade8feeba09c69d24f6ba5f6) (cherry picked from commit ad2fedb6931df445b4a54a776144862ce78e023a) [DOCS] RELEASE-NOTES: 1.20.0 (squash) blog Pick changes from https://blog.gitea.com/release-of-1.20.0/ (cherry picked from commit c8068a9d7b93abbbc852a307f48dda0aef40db86) [DOCS] RELEASE-NOTES: 1.20.0 (squash) Gitea release notes Review https://github.com/go-gitea/gitea/releases/tag/v1.20.0 (cherry picked from commit dd58b50403894f84936e26680ce6791f045358e5) [DOCS] RELEASE-NOTES: 1.20.0 (squash) commits git log --no-merges --oneline 64ed262e1..gitea/release/v1.20 . ':(exclude,glob)docs/**' ':(exclude)CONTRIBUTING.md' ':(exclude)MAINTAINERS' ':(exclude,glob).github/**' ':(exclude)CHANGELOG.md' ':(exclude,glob)options/locale/**' ':(exclude,glob)options/license/**' ':(exclude,glob)snap/**' ':(exclude).drone.yml' ':(exclude)custom/conf/app.example.ini' 9159964ad Avoid opening/closing PRs which are already merged (#25883) (#25903) 9369b3831 Skip unuseful error message in dev mode when watching local filesystem (#25919) (#25927) 6e82d0bb7 Add shutting down notice (#25920) (#25922) 36b9a86bd Fix incorrect milestone count when provide a keyword (#25880) (#25904) de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881) de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881) 186f07bbf Make `add line comment` buttons focusable (#25894) (#25896) 45b1f4dd3 Add support for different Maven POM encoding (#25873) (#25890) 026e745b9 Fix incorrect release count (#25879) (#25887) c334be828 Fix empty project displayed in issue sidebar (#25802) (#25854) 353dcc5ad Fix the error message when the token is incorrect (#25701) (#25836) abe9c641c Show correct SSL Mode on "install page" (#25818) (#25838) 052e65e63 Fix incorrect oldest sort in project list (#25806) (#25835) c1a10be07 Fix activity type match in `matchPullRequestEvent` (#25746) (#25796) 2b79d3fd5 For API attachments, use API URL (#25639) (#25814) b4460cf54 Make "install page" respect environment config (#25648) (#25799) a1bc2aa05 Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809) d713cf615 Fix WORK_DIR for docker (root) image (#25738) (#25811) 012b804a9 Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764) 372b622c2 Revert package access change from #23879 (#25707) (#25785) 06bcdfe77 Remove unused code (#25734) (#25788) a5a3c8141 Fix notification list bugs (#25781) (#25787) ea2c9de3c Test if container blob is accessible before mounting (#22759) (#25784) 348a6bf70 Always pass 6-digit hex color to monaco (#25780) (#25782) 91dadeddd Translate untranslated string in issues list (#25759) (#25761) 32eaba1b4 Hide `add file` button for pull mirrors (#25748) (#25751) 917ca5ded Several fixes for mobile UI (#25634) (#25689) e595dfeec Allow/fix review (approve/reject) of empty PRs (#25690) (#25732) 03cacf971 Check `ctx.Written()` for `GetActionIssue` (#25698) (#25711) 68e0c802f Show correct naming for 1 comment (#25704) (#25712) 09668b2e2 Correct permissions for `.ssh` and `authorized_keys` (#25721) (#25730) 04eea29ec Fix tags header and pretty format numbers (#25624) (#25694) 511be9fe6 Fix position of org follow button (#25688) (#25692) 24e64fe37 Replace `interface{}` with `any` (#25686) (#25687) 4e310133f Prevent duplicate image loading (#25675) (#25684) 491f36d32 Actions list enhancements (#25601) (#25678) 5510ed34f Fix the nil pointer when assigning issues to projects (#25665) (#25677) 39fce5750 Prevent SVG shrinking (#25652) (#25669) 1f9037604 Fix show more for image on diff page (#25672) (#25673) 0af6542a3 Add unit test for repository collaboration (#25640) (#25658) 69bdcf41f Log the real reason when authentication fails (but don't show the user) (#25414) (#25660) e610b0389 Fix UI misalignment on user setting page (#25629) (#25656) 13ffa287b Fix bug of branches API with tests(#25578) (#25579) (cherry picked from commit 3e9e862e5ed30e82f3b4da1b14f7865fb05464e4) [DOCS] RELEASE-NOTES: 1.20.0 (squash) reorder breaking (cherry picked from commit 4e4cdddc5549caa62629955b3803fcf808219c2e) address rome-user review (cherry picked from commit 8791fe88b1653ce536ba0596b2defcc6d80fbff1) [DOCS] RELEASE-NOTES: 1.20.0 (squash) reword breaking - removed the section about the changed themes: it is an internal detail and redundant with the above warning regarding themes & templates (cherry picked from commit b34e9a7b19e445639144a4cd5371ae23cf0dc77d) [DOCS] RELEASE-NOTES: 1.20.0 (squash) minor rewording The CI & Actions sections were grouped together. (cherry picked from commit ed236e1ee89eeecfaee28fe44e738dc2d96592b3) [DOCS] RELEASE-NOTES: 1.20.1-0 (squash) (cherry picked from commit 3c11eb1de542e2c56446108aec9b3b4d3cb8c117) [DOCS] RELEASE-NOTES: 1.20.1-0 (squash) Forgejo features/optimizations (cherry picked from commit c516fd0c7a8251420b5fdbc1e27083ae8a552560) [DOCS] RELEASE-NOTES: 1.20.1-0 (squash) fix typo in Alpine version (cherry picked from commit 1c2a5b516203db744364387e6d5673c65341f8ac) [DOCS] RELEASE-NOTES: 1.20.1-0 (squash) comment out obsoleted queue keys (cherry picked from commit 8c0d9459c5e1fde85bb6e728e53ce137a87dd69d) [DOCS] RELEASE-NOTES: 1.20.1-0 (squash) WORK_PATH breaking change (cherry picked from commit f4ea3b27f51fb2ecfb9d08bb3547fea067afa766) (cherry picked from commit 0557568f613fe072df32c1620bb7e0e060bdd71a) [DOCS] RELEASE-NOTES.md (squash) obsolete queue `app.ini` keys (cherry picked from commit e0c943ac3bbd7779c56e77225829eb3ce46b6c93) [DOCS] RELEASE-NOTES.md (squash) v1.20.2-0 (cherry picked from commit f2c654d1c8f0ed983db7374936962753f430523b) [DOCS] RELEASE-NOTES.md (squash) fix LFS issue link (cherry picked from commit 2461355f2a372229b41a2326ac50bfc7c26a3244) (cherry picked from commit 750652d75ab408736a2b3be77404163087f98a4e) (cherry picked from commit 6899dbdc118da8cbae2f986f1601ae228926c4e5) (cherry picked from commit 88b988d08447d46010e885f703c3890c252e200e) [DOCS] RELEASE-NOTES.md (squash) v1.20.3-0 (cherry picked from commit d566e78d68e79af56a1ed40e25e95f8ad612790c) (cherry picked from commit 65439eafa43683b304606a06b7c1bbed6f2bdbe9) (cherry picked from commit a76cc5b8bcbcefc7a54ee9b0381dcb54cb3fe5bf) (cherry picked from commit b4e1ad6020ccb107da6e005af3a1bf182d735930) [DOCS] RELEASE-NOTES.md (squash) v1.20.4-0 (cherry picked from commit 8a910c0c339faa59d46a6d838b5614b6f04a5e61) [DOCS] RELEASE-NOTES.md (squash) link to upgrade docs Refs: https://codeberg.org/forgejo/forgejo/issues/1199 (cherry picked from commit d4e9030873d2a3ae6dd379837aa1026a30a50aa2) (cherry picked from commit 7da7b9cef4711fab8a35e477743b6fdc8cce70ce) (cherry picked from commit 73b64ea8959ec6f5fd6be666d47b546cc523d9cf) [DOCS] RELEASE-NOTES.md (squash) v1.20.4-1 [DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 (cherry picked from commit e618ea55a54f5cfbd593f8c06be5d94bc0ba69ef) (cherry picked from commit f3ee9864160ba4120f1fd10c0b4d4925970e4b1a) [DOCS] RELEASE-NOTES.md (squash) 1.20.5-0 (cherry picked from commit ce5541c78b42cfd441f4af7db004a3fa3af493b5) [DOCS] RELEASE-NOTES.md (squash) 1.20.5-0 is a security release (cherry picked from commit 5dd66c06e3aa24d355f0cba7a24ecd6ec43b2021) slug of the blog post changed (cherry picked from commit fc5b52049f8f2e2271ef41a633efe3b7f04d05e7) apply caesar rewording suggestions (cherry picked from commit 59e9648b7114121fca92c0ba5eb92272b1c45643) [DOCS] RELEASE-NOTES.md (squash) typo (cherry picked from commit e8daead2a16303d59d33d0287427cf0428fa8453) (cherry picked from commit 8af0a2007df9f08c71c79cbb1a55d03fbf499dfa) (cherry picked from commit 329a04e094b4981d29d0c2e989bb24c77212229b) (cherry picked from commit 216a62de3093b7bb0f7f163292acd682e933ca49) (cherry picked from commit 855440d4b3634b99bd164cd1aa7bb70151f465d2) (cherry picked from commit 6cb87ca0fe026cc0cbffc458c969deb4eba4363a) (cherry picked from commit d2bf04bfa34b5dc7b2b26735087c9ee3f5324546) [DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 [DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 new features (UI split) [DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 complete release notes. (cherry picked from commit cd0fbfc8ede694b41b1c8672a0f47a8aaaae473b) RSA keylength 3072 is a breaking change (cherry picked from commit ac6defb51595d571904ab9e558353ba9bf649836) new features chroma update from 2.7.0 to 2.9.1 (cherry picked from commit ffd249070aa7f0d563b5d0de65791be4f45b9813) new features go-enry/linguist update from v7.25.0 to v7.27.0 go-enry 2.8.6 (cherry picked from commit 1e72c0608f64123ac03d1a5b955511ad2cfaa50f) add links to documentation for new features (cherry picked from commit ab0ff5d2d03ba582fc5cd72090f985ceb8024ebb) v1.21.0-9 will be the release number (cherry picked from commit afed47fa40b853be74b679ce25510fbf2234d0a2) links to go-enry & chroma releases to measure the gap (cherry picked from commit deb7645550d526fe523c5fbd894c9160c8aa76b8) [DOCS] RELEASE-NOTES.md (squash) v1.20.5-1 (cherry picked from commit ab1556628deaa39bd6d1779529702ad3531d8edf) proofread (cherry picked from commit fd672635b22ab25d05d3cd74dd7c956e2768c6c4) [DOCS] RELEASE-NOTES.md (squash) v1.20.6-0 (cherry picked from commit 90ddda34135f5672eb30639afe44c09753a0129d) [DOCS] RELEASE-NOTES.md (squash) v1.21.1-0 (cherry picked from commit 079d4fdca16f3b642fccb2d927c89c2f6dd75b20) [DOCS] RELEASE-NOTES.md (squash) v1.21.1-0 (cherry picked from commit f3d15ef97c565fe0b75f3359e1a208e649aa8cd2) (cherry picked from commit 881b438f2d1fa57ed18e41b1cd2c1cd9e4f094f8) (cherry picked from commit 6080cf05c921ba77530cecee0fc113a43e1ac07b) [DOCS] RELEASE-NOTES.md (squash) v1.21.2-0 (cherry picked from commit 9f4ca4cdf99a2c192f1541f1a982f86545c93514) [DOCS] RELEASE-NOTES.md (squash) v1.21.2-0 (cherry picked from commit 363477855e11eca01d05d2e677281365d3f9431e) [DOCS] RELEASE-NOTES.md (squash) move customized files make it more prominently visible (cherry picked from commit 6c992b5d93820058087355bb973457e026d56a04) [DOCS] RELEASE-NOTES.md (squash) API pull/issue breaking change (cherry picked from commit a8cbc2deb85fdf5b7fd51ac006e98bcc5a2a8685) (cherry picked from commit 58657fff8600a0612d770bfd754b6e6f627af82f) (cherry picked from commit ecf8b1531ba86fe76c71148b8fd872c196a0fcab) [DOCS] RELEASE-NOTES.md (squash) v1.21.2-1 (cherry picked from commit 1d24c09f4977e43f002f591db0183236160344d6) [DOCS] RELEASE-NOTES.md (squash) v1.20.6-1 (cherry picked from commit 8821315c337d37672ee7aa16c026aa53e3a428fb) [DOCS] RELEASE-NOTES.md (squash) v1.20.6-1 reorder (cherry picked from commit 9159916fa19d538ae23b7c93db226f4e90acc6cb) (cherry picked from commit 165099c0c6f915fb147848faced2519fd155d08b) [DOCS] RELEASE-NOTES.md (squash) v1.21.3-0 (cherry picked from commit 5e1d37b76ce9c20cc6f6db42292c3e938a1f15f8) [DOCS] RELEASE-NOTES.md (squash) v1.21.3-0 Reword the security fix description. (cherry picked from commit 142bed073d3aed71c8d002be98056163912be267) (cherry picked from commit cff9b5db4aa75e9fb28d349a8d90b8ed910e62d2) [DOCS] RELEASE-NOTES (squash) mention addition of `auth-required` in Cargo registry I'm including this under bug fixes even though it was labelled as an enhancement upstream because stabilization of private registry authentication predates the introduction of this change. Feel free to change the category if you don't think this assessment is appropriate. Refs: https://codeberg.org/forgejo/forgejo/pulls/2038 (cherry picked from commit 1057df6db53faf61f38714f6d7b39d41718334d0) (cherry picked from commit 566c32bdf6be42d0874b64ce73a36c3316ab5f82) (cherry picked from commit 45f5657cdc8d031f7cc859dd49fca828e987097e) (cherry picked from commit cb222316c23cc27b824de5d982366d673ac42979) --- RELEASE-NOTES.md | 1535 +++++++++++++++++ .../images/forgejo-v1.18.0-rc1-2-landing.jpg | Bin 0 -> 108791 bytes .../images/forgejo-v1.19-citation-dialog.png | Bin 0 -> 14459 bytes .../images/forgejo-v1.19-citation-link.png | Bin 0 -> 20716 bytes .../images/forgejo-v1.19-note-warning.png | Bin 0 -> 26889 bytes releases/images/forgejo-v1.19-oidc-part1.png | Bin 0 -> 31091 bytes releases/images/forgejo-v1.19-oidc-part2.png | Bin 0 -> 33754 bytes .../images/forgejo-v1.19-raw-copy-after.png | Bin 0 -> 20867 bytes .../images/forgejo-v1.19-raw-copy-before.png | Bin 0 -> 18495 bytes releases/images/forgejo-v1.19-relevant.png | Bin 0 -> 41638 bytes releases/images/forgejo-v1.19.0-0-rc0.png | Bin 0 -> 131219 bytes 11 files changed, 1535 insertions(+) create mode 100644 RELEASE-NOTES.md create mode 100644 releases/images/forgejo-v1.18.0-rc1-2-landing.jpg create mode 100644 releases/images/forgejo-v1.19-citation-dialog.png create mode 100644 releases/images/forgejo-v1.19-citation-link.png create mode 100644 releases/images/forgejo-v1.19-note-warning.png create mode 100644 releases/images/forgejo-v1.19-oidc-part1.png create mode 100644 releases/images/forgejo-v1.19-oidc-part2.png create mode 100644 releases/images/forgejo-v1.19-raw-copy-after.png create mode 100644 releases/images/forgejo-v1.19-raw-copy-before.png create mode 100644 releases/images/forgejo-v1.19-relevant.png create mode 100644 releases/images/forgejo-v1.19.0-0-rc0.png diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md new file mode 100644 index 0000000000..c3514bcfd9 --- /dev/null +++ b/RELEASE-NOTES.md @@ -0,0 +1,1535 @@ +# Release Notes + +A Forgejo release is published shortly after a Gitea release is published and they have [matching release numbers](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING/RELEASE.md#release-numbering). Additional Forgejo releases may be published to address urgent security issues or bug fixes. + +The Forgejo admin should carefully read the required manual actions before upgrading. A point release (e.g. v1.21.1-0 or v1.21.2-0) does not require manual actions but others might (e.g. v1.20, v1.21). + +## 1.21.3-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.21/forgejo) included in the `Forgejo v1.21.3-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.21.2-1..v1.21.3-0 +``` + +This stable release includes bug fixes. It was built with an updated version of the [Go Cryptography](https://pkg.go.dev/golang.org/x/crypto) package that fixes [CVE-2023-48795](https://go.dev/issue/64784). As explained in the [corresponding Go issue](https://github.com/golang/vulndb/issues/2402): "The impact of this attack is relatively limited, as it does not compromise confidentiality of the channel." + +* Recommended Action + + We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.21/admin/upgrade/) to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.21/user/semver/) + + The semantic version was updated to `6.0.3+0-gitea-1.21.3` + +* Security fix + + * The [Go Cryptography](https://pkg.go.dev/golang.org/x/crypto) package [is upgraded](https://codeberg.org/forgejo/forgejo/commit/9515a0ea38c179a2811e489079a68bbcc79f3cd3) to fix [CVE-2023-48795](https://go.dev/issue/64784). + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Fix a regression](https://codeberg.org/forgejo/forgejo/commit/dbd896ce42b2c5a1f4b4a69289fa3a38a875d04d) in how the markdown anchors are generated. For instance the anchor for `A.B.C` is `A-B-C` but was incorrectly set to `ABC`. + * [Fix the branch name of scheduled actions](https://codeberg.org/forgejo/forgejo/commit/580f29d9a2f8986c02b6ac30f2f3c177866cc81a) which [was sometime incorrectly set](https://codeberg.org/forgejo/forgejo/issues/1926). + * [Fix a visual glitch](https://codeberg.org/forgejo/forgejo/commit/b0874a0912ee97b11047bb2bd7d370b93c298d2a) when [setting an emoji in the web UI](https://codeberg.org/forgejo/forgejo/issues/1990). + * [Recently Docker started to use the optional `POST /v2/token` endpoint](https://codeberg.org/forgejo/forgejo/commit/a77398cd344be76e1cd2474063d917b286f8e9b1) which should respond with a `404 Not Found` status code instead of the current `405 Method Not Allowed`. + * [Fix a missing leading ssh:// when using a port other than 22](https://codeberg.org/forgejo/forgejo/commit/1475c1fcc4f1d5d526260a3f2068ae62c2ccaae3) when Git URLs are displayed in the web UI. + * [Allow disabling the detection of ambiguous unicode characters](https://codeberg.org/forgejo/forgejo/commit/cd5a0ec1c88edc238469657731e209a0080e9bfc) with the new setting `AMBIGUOUS_UNICODE_DETECTION=false`. + * [Fix a regression with the issue references rendering in wiki pages](https://codeberg.org/forgejo/forgejo/commit/40fa6a526a1cb42889eddd5135f2749cc092fff5). + * [Fix merging artifact chunks error when minio storage basepath is set](https://codeberg.org/forgejo/forgejo/commit/bea2c52572d62781228099812e56b2e7051e7ab0) + * [Fix missing information in the blame page web UI](https://codeberg.org/forgejo/forgejo/commit/1f8d01c74d75c0b426b7b7a95cc1ca3bfe1b853c). + +## 1.21.2-1 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.21/forgejo) included in the `Forgejo v1.21.2-1` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.21.2-0..v1.21.2-1 +``` + +This stable release contains a **security fix**, as explained in the [v1.21.2-1 companion blog post](https://forgejo.org/2023-12-release-v1-21-2-1/). + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.21/admin/upgrade/) to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.21/user/semver/) + + The semantic version was updated to `6.0.2+0-gitea-1.21.2` + +* Security fix + + The project page [of private users](https://forgejo.org/2023-12-release-v1-21-2-1/) is no longer publicly visible. + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * The default preferred licenses for the [[repository].PREFERRED_LICENSES](https://forgejo.org/docs/v1.21/admin/config-cheat-sheet/#repository-repository) setting were incorrect and have been [fixed to be `Apache-2.0` and `MIT`](https://codeberg.org/forgejo/forgejo/commit/5258e8f63d649b016d5c5d0e37422723bef26dac). + * A failed cron job can [no longer cause the Forgejo instance to shutdown](https://codeberg.org/forgejo/forgejo/commit/026a4bb02d8ac0b0dd90eb8a89c25ae18abca34f). + * A pull request merged by a workflow using the [automatic token](https://forgejo.org/docs/v1.21/user/actions/#automatic-token) with the `auto merge` flag [no longer cause an error 500 when displaying the pull request page](https://codeberg.org/forgejo/forgejo/commit/4148fb27dbc337a433b41d6d450d48fad73239cc). + * [Tentative fix for when the database branch cache is out of sync with the branches found in Git repositories](https://codeberg.org/forgejo/forgejo/commit/14750f3d11c8d065d3f9af31b8b4ee8d28acd0a5). When in doubt it is recommended to click on `Sync missed branches from git data to databases` in the `/admin` dashboard. + +## 1.21.2-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.21/forgejo) included in the `Forgejo v1.21.2-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.21.1-0..v1.21.2-0 +``` + +This stable release includes bug fixes. It was built with Go v1.21.5 that fixes [CVE-2023-39326](https://groups.google.com/g/golang-announce/c/iLGK3x6yuNo) which a malicious HTTP client can exploit to cause a server to automatically read a large amount of data. It allows for memory exhaustion in the situation that HTTP chuncked encoding requests can reach Forgejo. + +* Recommended Action + + We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.21/admin/upgrade/) to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.21/user/semver/) + + The semantic version was updated to `6.0.1+0-gitea-1.21.2` + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [OAuth2 uses the link_account page when the email or username is missing](https://codeberg.org/forgejo/forgejo/commit/e6fb2107f2843a09c3a72c3629bcee50c4797a6c) + * [Avoid conflicts of issue and PR numbers in GitLab migration](https://codeberg.org/forgejo/forgejo/commit/272d0a4c20987e33fa132fc94d996e0c6fdb86d7) + * [Only pass selected repository IDs to pagination](https://codeberg.org/forgejo/forgejo/commit/2552bb7b6ec51a094c9d800589991b1556fba798) + * [Add download URL for executable files](https://codeberg.org/forgejo/forgejo/commit/958a20865b897daaa4c26a3ba4b195ba2e854223) + * [Fix Forgejo repositories migration to also include issues, prs etc.](https://codeberg.org/forgejo/forgejo/commit/61fc5c514a6b3f99560b0df5e4cdb7df94763984) + * [Fix template substitution bug preventing notifications to be sent on new user registration](https://codeberg.org/forgejo/forgejo/commit/bc0078a50a6ab341ca4af15ce5d3fd221e6e9e0d) + * [When searching for issues, require that all terms are matched instead of one of them](https://codeberg.org/forgejo/forgejo/commit/13c0df40de319db2c4c2ec11a9a9dc5cf9eaf681) + * [Ignore temporary files when calculating the size of a repository](https://codeberg.org/forgejo/forgejo/commit/b17113bb06b57211b9c264b6953a783e7d0bb9a2) + * [Convert git commit summary to valid UTF8](https://codeberg.org/forgejo/forgejo/commit/346635605da024c3a0a6e7f4d63de1632459f4d6) + * [Fix incorrect default value of `[attachment].MAX_SIZE`](https://codeberg.org/forgejo/forgejo/commit/52f8fde69f121af6f72685fd08dc45b4b3e89004) + * [Fix object does not exist error when checking citation file](https://codeberg.org/forgejo/forgejo/commit/1ce155c5a695f07a9252b4ffc8c9ae7d48ebf7ec) + +* Improvements + + * [new doctor check: fix-push-mirrors-without-git-remote](https://codeberg.org/forgejo/forgejo/commit/1fea3ce6592afca7f8d16c147effd343244746fa) + * [Add `HEAD` support for RPM registry](https://codeberg.org/forgejo/forgejo/commit/ce3a24ef5f80413514e8de28ff47e77acccf0d2b) + +## 1.21.1-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.21/forgejo) included in the `Forgejo v1.21.1-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges origin/v1.20/forgejo..origin/v1.21/forgejo +``` + +- **[Forgejo Semantic Version](https://forgejo.org/docs/v1.21/user/semver/):** + The semantic version was updated to `6.0.0+0-gitea-1.21.0` because it contains breaking changes. + +- **Breaking:** + Note that the modifications related to CSS, templates or assets (images, fonts, etc.) are not documented here. + Although they can be extracted and modified, Forgejo does not provide any guarantee that such changes + will be portable from one version to another (even a patch version). A [Q&A discussion is available](https://codeberg.org/forgejo/discussions/issues/84) + to share tips and tricks. A new section was also added + [to the developer documentation about interface customization](https://forgejo.org/docs/v1.21/developer/customization/). + - If you have custom asset files, e.g. custom themes, inside `custom/public/*` (css included), you need to transfer these files to `custom/public/assets/*` for them to be detected. Read more [in the documentation](https://forgejo.org/docs/v1.21/developer/customization/) and the [Q&A discussion dedicated to interface customization](https://codeberg.org/forgejo/discussions/issues/84). + - Git [branches are stored in the databases](https://codeberg.org/forgejo/forgejo/commit/6e19484f4d3bf372212f2da462110a1a8c10cbf2) to reduce the calls to a git process and improve performances. After upgrading, login as an admin, go to the `/admin` page and click run **Sync missed branches from git data to databases**. If this is not done there will be messages such as `LoadBranches: branch does not exist` in the logs. + - [Some Forgejo CLI options have changed](https://codeberg.org/forgejo/forgejo/commit/d0dbe52e76f3038777c3b50066e3636105387ca3) and scripts may need to be updated. For instance `--verbose` is no longer a global option and is implemented on a per sub-command basis. Check `forgejo --help` or `forgejo docs` for more information. + - [Remove "CHARSET" config option for MySQL and always use "utf8mb4"](https://codeberg.org/forgejo/forgejo/commit/ce46834b938eb687152a680669ada95a26304178). It has been a requirement for years and specifying anything else is likely to cause issues. Existing MySQL databases still using `utf8` can be converted using the CLI: `forgejo doctor convert`. + - [Restrict certificate type for builtin SSH server](https://codeberg.org/forgejo/forgejo/pulls/1172). This is a breaking change for setups where the builtin SSH server is being used and for some reason host certificates were being used for authentication. + - [Set SSH_AUTHORIZED_KEYS_BACKUP to false by default](https://codeberg.org/forgejo/forgejo/commit/469d89b95a1ce18dd34808a95c7230375e828e24). There is no automatic cleanup of these backups and can end up using a significant amount of disk space over time. + - [The minimum RSA keylength is now 3072 instead of 2048](https://codeberg.org/forgejo/forgejo/commit/c533991519816313dfaa0ddcec183756a97b9348). + - Prior to this release, a token scoped to read or write permissions on issues was allowed to access both issues and pull requests, regardless of the restrictions imposed to the team in which they belong. In a team it is possible to grant finer grained permissions, for instance to allow a user to access issues but not pull requests. These restrictions are [now enforced](https://codeberg.org/forgejo/forgejo/commit/f4310d74ee65500ef02064256808530e09da76a0) and API calls that previously succeeded on `/api/v1/repos/{org}/{repo}/issues` or other endpoints common to both issues and pull requests could return 404. Granting the user the necessary permissions in the team in which they belong will allow them to use that endpoint again. +- **Forgejo Actions:** + It is now enabled by default but should still be considered alpha stage and subject to unannounced breaking changes. + - The API can now be used to manage secrets for [users](https://code.forgejo.org/api/swagger/#/user/updateUserSecret), [organizations](https://code.forgejo.org/api/swagger/#/organization/orgListActionsSecrets) and [repositories](https://code.forgejo.org/api/swagger/#/repository/updateRepoSecret). + - [Registration tokens can register multiple runners](https://codeberg.org/forgejo/forgejo/commit/9b698362a333de2c388499f1a64d39545b0263bd) instead of a single one. Read more [about runner registration](https://forgejo.org/docs/v1.21/admin/actions/#registration). + - [Add](https://codeberg.org/forgejo/forgejo/commit/35a653d7edbe0d693649604b8309bfc578dd988b) support for [variables in addition to secrets](https://forgejo.org/docs/v1.21/user/actions/#variables). + - [Add](https://codeberg.org/forgejo/forgejo/commit/0d55f64e6cd3de2e1e5c0ee795605823efb14231) support for [recurring actions similar to cron jobs](https://forgejo.org/docs/v1.21/user/actions/#onschedule). + - [Add](https://codeberg.org/forgejo/forgejo/commit/19872063a3c14256a1d89b2a104d63e7538a3a28) the possibility to [disable workflows from the user interface](https://forgejo.org/docs/v1.21/user/actions/#list-of-runners-and-their-tasks). + - [Add](https://codeberg.org/forgejo/forgejo/commit/460a2b0edffe71d9e64633beaa1071fcf4a33369) automatic [cleanup of artificats](https://forgejo.org/docs/v1.21/user/actions/#artifacts). + - [Add](https://codeberg.org/forgejo/forgejo/commit/44781f9f5c4ede618660d8cfe42437f0e8dc22a0) automatic cancelation [of jobs when pushing new commits](https://forgejo.org/docs/v1.21/user/actions/#auto-cancelation-of-workflows) to a PR. + - [Add](https://codeberg.org/forgejo/forgejo/commit/f3d293d2bbe0b2eab047bdd403046069cffbc0c4) support for [uploading multiple artificats](https://forgejo.org/docs/v1.21/user/actions/#artifacts). + - [Add](https://codeberg.org/forgejo/forgejo/commit/48e5a74f215d78813a816c57fc5a85a909a003d5) support for the [`pull_request_target` event](https://forgejo.org/docs/v1.21/user/actions/#onpull_request_target) which has access to secrets because it runs using the workflows from the base branch instead of the pull request. + - [Add](https://codeberg.org/forgejo/forgejo/commit/8228751c55d6a4263f0fec2932ca16181c09c97d) support for reading labels from the runner [instead of specifying them during registration](https://forgejo.org/docs/v1.21/admin/actions/#registration). +- **Features:** + - With the Chroma upgrade from [2.7.0](https://github.com/alecthomas/chroma/releases/tag/v2.7.0) to [2.10.0](https://github.com/alecthomas/chroma/releases/tag/v2.10.0) syntax highlighting is now available for [Smali](https://github.com/alecthomas/chroma/pull/765), [DHCP](https://github.com/alecthomas/chroma/pull/772), [WebGPU Shading Language](https://github.com/alecthomas/chroma/pull/776), [AutoHotkey](https://github.com/alecthomas/chroma/commit/4779f9035a3aaea3ec650f0923657c12e12dd35a), [AutoIt](https://github.com/alecthomas/chroma/commit/029798b351baa9c3d0dd5ec16e87ab98486d843c), [tal (uxntal)](https://github.com/alecthomas/chroma/commit/e422a6286fdc61393deb09afd270293eb590d023), [ArangoDB Query Language (AQL)](https://github.com/alecthomas/chroma/pull/794), [BIND DNS Zone](https://github.com/alecthomas/chroma/pull/796), [Odin](https://github.com/alecthomas/chroma/pull/802), [Sourcepawn](https://github.com/alecthomas/chroma/pull/804), [CPP](https://github.com/alecthomas/chroma/pull/813), [C](https://github.com/alecthomas/chroma/pull/815). New files and extensions are associated as follows: [.tpp as a c++](https://github.com/alecthomas/chroma/pull/817), [.eex as a Elixir](https://github.com/alecthomas/chroma/pull/820), [Pipfile and poetry.lock as a TOML](https://github.com/alecthomas/chroma/pull/821), [ISCdhcpd filename](https://github.com/alecthomas/chroma/pull/822), [.twig](https://github.com/alecthomas/chroma/pull/833), [Mathematica](https://github.com/alecthomas/chroma/pull/836). + - With the go-enry upgrade from [v2.8.4](https://github.com/go-enry/go-enry/releases/tag/v2.8.4) to [v2.8.6](https://github.com/go-enry/go-enry/releases/tag/v2.8.6), language detection in the repository now includes: + - Bluespec BH: [atom-haskell/language-haskell](https://github.com/atom-haskell/language-haskell) + - D2: [terrastruct/d2-vscode](https://github.com/terrastruct/d2-vscode) + - Go Workspace: [golang/vscode-go](https://github.com/golang/vscode-go) + - Gradle Kotlin DSL: [nishtahir/language-kotlin](https://github.com/nishtahir/language-kotlin) + - Hosts File: [Alhadis/language-etc](https://github.com/Alhadis/language-etc) + - LOLCODE: [KrazIvan/LOLCODE-grammar-vscode](https://github.com/KrazIvan/LOLCODE-grammar-vscode) + - MDX: [wooorm/markdown-tm-language](https://github.com/wooorm/markdown-tm-language) + - Nasal: [BobDotCom/Nasal.tmbundle](https://github.com/BobDotCom/Nasal.tmbundle) + - Nushell: [hustcer/nu-grammar](https://github.com/hustcer/nu-grammar) + - Pact: [kadena-io/pact-atom](https://github.com/kadena-io/pact-atom) + - RBS: [soutaro/vscode-rbs-syntax](https://github.com/soutaro/vscode-rbs-syntax) + - Rez: [textmate/rez.tmbundle](https://github.com/textmate/rez.tmbundle) + - Sweave: [textmate/sweave.tmbundle](https://github.com/textmate/sweave.tmbundle) + - TL-Verilog: [adamint/tlv-vscode](https://github.com/adamint/tlv-vscode) + - Typst: [michidk/typst-grammar](https://github.com/michidk/typst-grammar) + - WDL: [broadinstitute/wdl-sublime-syntax-highlighter](https://github.com/broadinstitute/wdl-sublime-syntax-highlighter) + - WGSL: [wgsl-analyzer/wgsl-analyzer](https://github.com/wgsl-analyzer/wgsl-analyzer) + - WebAssembly Interface Type: [bytecodealliance/vscode-wit](https://github.com/bytecodealliance/vscode-wit) + - [Newly pushed branches show in the web UI with a link to create a PR](https://codeberg.org/forgejo/forgejo/commit/6375419468edc95fdfac94aac3b0e10b23743557). Read more [about the `New Pull Request` button](https://forgejo.org/docs/v1.21/user/pull-requests-and-git-flow/#create-a-pull-request). + - Labels that are no longer useful [can be archived](https://codeberg.org/forgejo/forgejo/commit/cafce3b4b5afb3f254a48e87f1516d7b5dc209b6). They can no longer be selected but they remain on existing issues. Read more [about archiving labels](https://forgejo.org/docs/v1.21/user/labels/#archiving-labels). + - The blame view now [takes into account](https://codeberg.org/forgejo/forgejo/commit/ed64f1c2b835bf9332bf8347be9675ef29c8274b) the [`.git-blame-ignore-revs`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile) file. + - [Pre-register OAuth2 applications for git credential helpers](https://codeberg.org/forgejo/forgejo/commit/63ab92d7971e4931e98f014f2c5385d2242fa780). Read more in the git authentication section of the [user guide](https://forgejo.org/docs/v1.21/user/oauth2-provider/#git-authentication) and the [administrator guide](https://forgejo.org/docs/v1.21/admin/oauth2-provider/#git-authentication). + - Admins can be [notified via email](https://codeberg.org/forgejo/forgejo/commit/9b7bbae8c4cd5dc4d36726f10870462c8985e543) when a new user registers to help fight spam bots by setting `[admin].SEND_NOTIFICATION_EMAIL_ON_NEW_USER = true`. + - When a page display the history of changes for a file, [file rename are detected and displayed](https://codeberg.org/forgejo/forgejo/commit/ea23594cdbb12c32dc28638f65bf40e37d344e5f). + - Packages [can be configured to redirect requests to the S3 server](https://codeberg.org/forgejo/forgejo/commit/c890454769562e0ec2978e123aaf3d9a43e5ef4f) for clients that support this feature. + - When a PR contains multiple commits, it is now possible [review to each commit independently](https://codeberg.org/forgejo/forgejo/commit/55532061c83d38d33ef48bdc5eeac0f652844e8a). Read more [about selecting commits for review](https://forgejo.org/docs/v1.21/user/pull-requests-and-git-flow/#reviews). + - Issues can [be deleted in batch](https://codeberg.org/forgejo/forgejo/commit/a1c5057fe81c25dfd1777e9625eb5480c45897ea). + - An email can be associated with [an Organisations](https://codeberg.org/forgejo/forgejo/commit/6598d0291cf7dfeb00cb5e5d18faf2bf46fad596). + - The CODEOWNERS file is [interpreted to automatically set reviewers on PRs](https://codeberg.org/forgejo/forgejo/commit/3bdd48016f659c440d6e8bb57386fab7ad7b357b). The CODEOWNERS file is loaded from these paths in this order: `./CODEOWNERS`, `./docs/CODEOWNERS`. + - Issue search [were reworked entirely](https://codeberg.org/forgejo/forgejo/commit/1e76a824bcd71acd59cdfb2c4547806bc34b3d86) to fix the shortcomings of the previous implementation. + - [Allow "latest" to be used as a release tag when downloading a file](https://codeberg.org/forgejo/forgejo/commit/a7d9a70552410d797cefc87b177b33ca4a1a60c4). + - [Authentication via reverse proxy is available and disabled by default](https://codeberg.org/forgejo/forgejo/commit/e97e883ad50774f249c8c694598c25a17227299b). + - [Add API for changing avatars](https://codeberg.org/forgejo/forgejo/commit/254a82842addb1475611789107c3720e37394879). +- **User Interface:** + - [Show OpenID Connect and OAuth on the signup page](https://codeberg.org/forgejo/forgejo/commit/63b53af933d748f9b4e0f1273e3701b4c3d08ac3). + - [Show branches and tags that contain the commit being displayed](https://codeberg.org/forgejo/forgejo/commit/bd6ef718548767ff209048eb8443a067106908bf) + - [Add 'Show on a map' button to the location in the usr profile](https://codeberg.org/forgejo/forgejo/commit/d58c5425799335ea57f27461f99ddd1078e9b2de). + - [Render plaintext task list items for markdown files](https://codeberg.org/forgejo/forgejo/commit/eaea530d6bc84b23e6ff14ff8c2a74aa3b67ecd0). + - The administrators user details page [was modified](https://codeberg.org/forgejo/forgejo/commit/5b5bb8d3546e6504b689b01d3ac4897dda3aee3d). + - When mirroring a repository fails, [a `Retry` button allows to re-create it](https://codeberg.org/forgejo/forgejo/commit/865d2221c0f4b2a8623ff9299930c9bab0da2c78). + - Package cleanup [can be triggered from from administration web interface](https://codeberg.org/forgejo/forgejo/commit/0c6ae61229bce9d9ad3d359cee927464968a2dd1). + - In the page displaying the [list of branches, it is now possible to search them by name](https://codeberg.org/forgejo/forgejo/commit/47b878858ada27fc4c74eeadcc1e467d2da90e04). + - [Display all user types (including bots) org types on the administration web interface](https://codeberg.org/forgejo/forgejo/commit/198a9ca6350954a6d3327a408021fec2bc0fc805). + - [Improve opengraph previews](https://codeberg.org/forgejo/forgejo/commit/5743d7cb5bcd85c88ad7d128e0162893a074418b). + - [Render code blocks in the repository description](https://codeberg.org/forgejo/forgejo/commit/3d109861ddf95846905143b4cf39129bf253161e). + - [Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips](https://codeberg.org/forgejo/forgejo/commit/d2e4039def61d9cc9952be462216001125327270) next to the author. + - It is no longer possible to [change the run user in the installation page](https://codeberg.org/forgejo/forgejo/commit/d17a848fe275c3e8734a4dfcaf2eae8ca0dc361c). + - [Update emoji set](https://codeberg.org/forgejo/forgejo/commit/e882398c5acb99db555553acc2da89db73713710) to [Unicode 15](https://unicode.org/versions/Unicode15.0.0/). + - [Improve the image diff user interface](https://codeberg.org/forgejo/forgejo/commit/09faf43ef822ca4dbdfb2a2714ad43a782acf6e8). + - Allow [rebuilding the issue index from the cron task list in the admin panel](https://codeberg.org/forgejo/forgejo/commit/47fddaadc8b4c8d4d4359d6209b9fe06d6387a30). +- **Enhancements:** + - [Improve the privacy of the user profile settings](https://codeberg.org/forgejo/forgejo/commit/ff90c87c878b03e7beabac5f19396e0db2c25a1e). + - [Add the upload URL to the release API](https://codeberg.org/forgejo/forgejo/commit/a9ce570298d4541bc1b5598dc080d9e4541de17b). + - [Allow editing existing push mirrors from the settings page of a repository](https://codeberg.org/forgejo/forgejo/commit/ab388deb0e52c058a19dbd844bdd890f7cf84d51). + - [Add a link to the OpenID issuer URL in the WebFinger response](https://codeberg.org/forgejo/forgejo/commit/df55f9b189174767296e562389948e5250f1df73). + - [Support copy protected branches with template repositories](https://codeberg.org/forgejo/forgejo/commit/037c9895a7406b42f88991295382db18f98dbef9). + - [In the administration web interface, split the lfs size from repository size](https://codeberg.org/forgejo/forgejo/commit/4aba8a6a5ff96f0995ada7e183c7864f8f5bc05c). +- **Bug fixes:** + - [Allow empty Conan files](https://codeberg.org/forgejo/forgejo/commit/d513628db90415a27e887c3cf349309b3ad44d55). + - [Fix the incorrect route path in the user edit page. ](https://codeberg.org/forgejo/forgejo/commit/323135b97b219d7fb10557fb9d9156c6bef3ae62). + - [Add auth-required to config.json for Cargo sparse registry](https://codeberg.org/forgejo/forgejo/commit/a587d2526163153a4d992527fe6040d578beaa83). + - [Rewrite the DiffFileTreeItem and fix misalignment ](https://codeberg.org/forgejo/forgejo/commit/48c4a7e75cf2717f00c9691ca26688aa4db0a17a). + - [Do not "guess" the file encoding/BOM when using API to upload files](https://codeberg.org/forgejo/forgejo/commit/22eeede885327fca0328b7d5b153e7a6c4211ffa). +- **Security:** + - [Do not show the profile README when a repository is private](https://codeberg.org/forgejo/forgejo/commit/6a7a5ea32ab61a608b52029f778e8df76b04f489). + - A [security.txt files is provided by default](https://codeberg.org/forgejo/forgejo/pulls/1201/files) and other static files [can also be added](https://codeberg.org/forgejo/forgejo/commit/52fb9367734100847249d074e2bc17f2aa91053e). + +## 1.20.6-1 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.6-1` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.6-0..v1.20.6-1 +``` + +This stable release contains a **security fix**. + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.8+0-gitea-1.20.6` + +* Security fix + + The project page [of private users](https://forgejo.org/2023-12-release-v1-21-2-1/) is no longer publicly visible. + +* Bug fix + + * [Consider executable files as a valid case when returning a downloadURL for them](https://codeberg.org/forgejo/forgejo/issues/1825). They are just regular files with the difference being the executable permission bit being set. + +* New doctor check and fix + + * Adds a [new doctor check: fix-push-mirrors-without-git-remote](https://codeberg.org/forgejo/forgejo/pulls/1853). The new check looks for push mirrors that do not have their remotes configured in git. If automatic fixing is enabled, it will remove these push mirrors from the database. + +## 1.20.6-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.6-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.5-1..v1.20.6-0 +``` + +This stable release contains a **security fix**, as explained in the [v1.20.6-0 companion blog post](https://forgejo.org/2023-11-release-v1-20-6-0/). + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.7+0-gitea-1.20.6` + +* Breaking change + + Prior to this release, a token scoped to read or write permissions on issues was allowed to access both issues and pull requests, regardless of the restrictions imposed to the team in which they belong. In a team it is possible to grant finer grained permissions, for instance to allow a user to access issues but not pull requests. These restrictions are now enforced and API calls that previously succeeded on `/api/v1/repos/{org}/{repo}/issues` or other endpoints common to both issues and pull requests could return 404. Granting the user the necessary permissions in the team in which they belong will allow them to use that endpoint again. + +* Security fix + + Additional API and web [endpoints now fail](https://forgejo.org/2023-11-release-v1-20-6-0/) when given manually crafted identifiers. + +## 1.20.5-1 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.5-1` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.5-0..v1.20.5-1 +``` + +This stable release contains **critical security fixes**, as explained in the [v1.20.5-1 companion blog post](https://forgejo.org/2023-11-release-v1-20-5-1/). + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.6+0-gitea-1.20.5` + +* Security fixes + + * API and web [endpoints now fail](https://forgejo.org/2023-11-release-v1-20-5-1/) when given manually crafted identifiers. + * When an extension is added to the URL of a user profile (e.g. `/myuser.rss`) it is now [verified to be visible](https://codeberg.org/forgejo/forgejo/commit/d7408d8b0b04afd2a3c8e23cc908e7bd3849f34d). + * `docker login` now fails with basic auth [when 2FA is enabled](https://codeberg.org/forgejo/forgejo/commit/44df78edd40076b349d50dc5fb02af417a44cfab). + +* Bug fixes + + The most prominent bug fixes are described below. Others can be found in the list of commits included in the release as described above. + + * Create the ActionTaskOutput [table for new Forgejo instances](https://codeberg.org/forgejo/forgejo/commit/c0ccd4c2d7ac586276ab65bd2dfbf4eba7e71cd6). + * [Restricted users only see repos in orgs which their team was assigned to](https://codeberg.org/forgejo/forgejo/commit/f302373eb4ea04f3b655d8f8bb27bc3ff3027276). + * Release assets are now [taken into account during a migration](https://codeberg.org/forgejo/forgejo/commit/1fd3cc32170ff9a36419083541bb2e1ad612df92) from GitLab, Forgejo or Gitea. + * When `webhook.PROXY_URL` is set, the `ALLOWED_HOST_LIST` setting is [now properly enforced](https://codeberg.org/forgejo/forgejo/commit/d6798ae0159e58b427e9ad894ca3e0ee272efdb2). + * It is now possible to access `///attachments/` [with an application token](https://codeberg.org/forgejo/forgejo/commit/f142ae18c093d4cb5ccc7eeec8beac0212e466a0) and the attachments API download URL is usable. + +## 1.20.5-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.5-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.4-1..v1.20.5-0 +``` + +This stable release contains an **important security fix**, as explained in the [v1.20.5-0 companion blog post](https://forgejo.org/2023-10-release-v1-20-5-0/). + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.5+0-gitea-1.20.5` + +* Security fix + + * When a user logs into Forgejo, they can click the **Remember This Device** checkbox and their browser will store a **Long-term authentication** token provided by the server, in a cookie that will allow them to stay logged in for an extended period of time. The implementation was inherently insecure and was [reworked](https://codeberg.org/forgejo/forgejo/commit/51988ef52bc93b63184d28395d10bf3b76914ad0). Read more about this issue in the [v1.20.5-0 blog post](https://forgejo.org/2023-10-release-v1-20-5-0/). + +* Bug fixes + + The most prominent bug fixes are described below. Others can be found in the list of commits included in the release as described above. + + * [Fix the display of pull requests waiting for review](https://codeberg.org/forgejo/forgejo/commit/4b23f11864) on the `/pulls` page. It incorrectly included all reviews. + * [Fix a v1.20 regression preventing access to files with OAuth2 tokens](https://codeberg.org/forgejo/forgejo/commit/3e8c3b7c09) in private repositories. + * [Fix](https://codeberg.org/forgejo/forgejo/commit/101cfc1f82) a bug by which the `doctor` command [complains the `deleted_branch` table is missing](https://codeberg.org/forgejo/forgejo/issues/1522) although it should not. + * [Fix the release URL in webhooks](https://codeberg.org/forgejo/forgejo/commit/1b1f878204) so that `URL` points to the API URL and `HTMLURL` points to the web page. + * [Fix organization field being null in POST /orgs/{orgid}/teams](https://codeberg.org/forgejo/forgejo/commit/f8bf284794). + +## 1.20.4-1 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.4-1` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.4-0..v1.20.4-1 +``` + +This stable release includes bug fixes. + +* Recommended Action + + We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.4+0-gitea-1.20.4` + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Fix the followers and following list that only showed the first page](https://codeberg.org/forgejo/forgejo/commit/c041114a20fcaaf0931da81dcb542a930e8f9c5f) + * [Fix issue templates preventing the creation of any new issues when blank issues are not authorized](https://codeberg.org/forgejo/forgejo/commit/64a418dfc778665f56cb20d678f3c10dbb62ddca) (regression introduced in v1.20.4-0) + +## 1.20.4-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.4-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.3-0..v1.20.4-0 +``` + +This stable release includes bug fixes and two features. + +* Recommended Action + + We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.3+0-gitea-1.20.4` + +* Features + + * [Log slow SQL queries](https://codeberg.org/forgejo/forgejo/commit/fa25b9eec63c073e16f4595459880e4ee8797913) to help identify bottlenecks on large Forgejo instances + * [Add `branch_filter` to hooks API endpoints](https://codeberg.org/forgejo/forgejo/commit/19a49e763a013dec4c3fcf3e9e2be89c7009bb3b) + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Ignore the trailing slashes when comparing oauth2 redirect_uri](https://codeberg.org/forgejo/forgejo/commit/2f6d011503a35a1eede96f5a13b2a9868c06b3ae) + * [Fix the reopen logic for agit flow pull request](https://codeberg.org/forgejo/forgejo/commit/5abca17b644ded3c3ab8869db1d34f9bd678f18e) + * [Fix the missing display of user projects](https://codeberg.org/forgejo/forgejo/commit/ef46b01168e251fad92ed46102b5faad75a5bcb1) + * [Fix](https://codeberg.org/forgejo/forgejo/commit/08762875d7362ee207bbd320123cbb0ad4cf70d2) issue templates [that failed to save checkboxes](https://codeberg.org/forgejo/forgejo/pulls/1317) + * [Fix accessibility issues preventing focus and selection](https://codeberg.org/forgejo/forgejo/commit/66016b3fe3a9646e5d9c8b4c2d88b1da7a908ccf) + * [Fix being unable to use a repo that prohibits accepting PRs as a PR source](https://codeberg.org/forgejo/forgejo/commit/1d228e6ee93525bd630c4a915febd98d159f1824) + * [Forgejo doctor database fix](https://codeberg.org/forgejo/forgejo/commit/0b1175f21b403ff59c0c3f7a759de8d0fe13bee8) to repair a condition preventing the owner of an organization from creating a repository + * [Fix dashboard filters having no effect](https://codeberg.org/forgejo/forgejo/commit/a6c2201dd41706a000ca96bdcd3e89df96e342fd) + * [Also check the email blocklists when adding new emails to existing accounts](https://codeberg.org/forgejo/forgejo/commit/d5845521a842418ae8f6dfcad8368ba2a6035f54) + * [Sync tags when adopting repos](https://codeberg.org/forgejo/forgejo/commit/6b5ef0fad754a863eb7d91eefa8301dd9a5a84b5) + * [Fix an error when pushing a new branch and there is a requirement that all commits are signed](https://codeberg.org/forgejo/forgejo/commit/193e04c43b556e0a25c260149429945ba2164efa) + +## 1.20.3-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.3-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.2-0..v1.20.3-0 +``` + +This stable release includes bug fixes and a safeguard against a +regression that may lead to data loss. The `[storage*]` sections in the +`app.ini` file may cause the files for some subsystems - Attachments, +LFS, Avatars, Repository avatars, Repository archives, Packages - to +be merged together or misplaced. The safeguard detects this situation +and Forgejo will not start to prevent data loss. If your instance is in +this situation, [follow the instructions in the companion blog post](https://forgejo.org/2023-08-release-v1-20-3-0/). + +* Recommended Action + + We recommend that all Forgejo installations are upgraded to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.2+0-gitea-1.20.3` + +* Breaking changes + + * [Fix some bugs in how the storage sections are interpreted](https://codeberg.org/forgejo/forgejo/commit/815682c88) in the `app.ini` file. Read more about this issue in the [v1.20.3-0 blog post](https://forgejo.org/2023-08-release-v1-20-3-0/) + * [Add sanity checks](https://codeberg.org/forgejo/forgejo/commit/ee0e4848e) to detect an `app.ini` configuration that [needs manual fixing to preserve storage](https://forgejo.org/2023-08-release-v1-20-3-0/) + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the the review and stayed at the beginning of the page + * [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf) + * [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20) + * [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674) + * [Allow html code to be parsed in markdown files](https://codeberg.org/forgejo/forgejo/commit/e7d0475e1) + * [Fix incorrect color of the selected assignees when creating an issue](https://codeberg.org/forgejo/forgejo/commit/c7d7490b2) + * [Add missing MinIO region on client initialization](https://codeberg.org/forgejo/forgejo/commit/927cbe62b) + * [Add pull request review request webhook event](https://codeberg.org/forgejo/forgejo/commit/99c8dab9d) + * [Fix bad url in the wiki due to incorrect unescaping](https://codeberg.org/forgejo/forgejo/commit/e0f6956a4) + * [Fix the sort menu that was broken when displaying a custom profile from the `.profile` repository](https://codeberg.org/forgejo/forgejo/commit/fa92a6a4c) + * [Workaround](https://codeberg.org/forgejo/forgejo/commit/3d211dea2) MariaDB [performance issue on large Forgejo instances](https://codeberg.org/forgejo/forgejo/issues/1161) + * [Display human-readable text](https://codeberg.org/forgejo/forgejo/commit/2729bb3c6) instead of [numerical file modes](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) + * [The CLI exit code now is different from zero when an error occurs](https://codeberg.org/forgejo/forgejo/commit/089af9ab1) + * [Fix error when a Debian package has a double newline character at the end of the control block](https://codeberg.org/forgejo/forgejo/commit/dd7180846) + * [Fix a condition that would cause git related tasks to hang for longer than necessary in the queues and use too many resources as a result](https://codeberg.org/forgejo/forgejo/commit/36f8fbe1b) + * [Fix the topic validation rule and suport dots](https://codeberg.org/forgejo/forgejo/commit/a578b75d7) + * [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646) + * [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26) + * [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833) + * [Fix API leaking the user email when the caller is not authentified](https://codeberg.org/forgejo/forgejo/commit/d89003cc1) + +## 1.20.2-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.2-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.20.1-0..v1.20.2-0 +``` + +This stable release includes bug fixes and displays [warnings in the administration panel](https://codeberg.org/forgejo/forgejo/commit/28f4029e40) when deprecated entries are found in `app.ini`. + +* Recommended Action + + We recommend that all Forgejo installations are upgraded to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/) + + The semantic version was updated to `5.0.1+0-gitea-1.20.2` + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Add missing assets to the Forgejo sources tarbal](https://codeberg.org/forgejo/forgejo/commit/e14d239005) + * [Fix user type selection error when creating a user](https://codeberg.org/forgejo/forgejo/commit/268569b462) and selecting `public` or `private`. + * [Fix access check for org-level project](https://codeberg.org/forgejo/forgejo/commit/5afb0294f4) + * [Warn instead of reporting an error when a webhook cannot be found](https://codeberg.org/forgejo/forgejo/commit/4c3dcdf815) + * [Set MAX_WORKERS](https://codeberg.org/forgejo/forgejo/commit/5a4b19435d) to a value lower than 10 if the number of available CPUs is low to avoid overloading the host. + * [Fix bug when pushing to a pull request which enabled dismiss approval automatically](https://codeberg.org/forgejo/forgejo/commit/4640c53386) + * [Fix handling of plenty Nuget package versions](https://codeberg.org/forgejo/forgejo/commit/7bb8526736) + * [Update email-setup.en-us.md](https://codeberg.org/forgejo/forgejo/commit/31f2ce3998) + * [Fix bugs](https://codeberg.org/forgejo/forgejo/commit/9654d71bb2) in [LFS meta garbage collection](https://codeberg.org/forgejo/forgejo/issues/1113) + * [Fix UI regression of asciinema player](https://codeberg.org/forgejo/forgejo/commit/f3c26de1f4) + * [Fix LFS object list style](https://codeberg.org/forgejo/forgejo/commit/f20cfc291c) + * [Fix CLI allowing creation of multiple user access tokens with the same name](https://codeberg.org/forgejo/forgejo/commit/b699e1d340) + * [Fix](https://codeberg.org/forgejo/forgejo/commit/f4a8f10f64) router logger [preventing separating the logs in different files](https://codeberg.org/forgejo/forgejo/issues/1123). + * [added ssh mirror workaround description](https://codeberg.org/forgejo/forgejo/commit/d9d38b6244) + * [Fix wrong workflow status when rerun a job in an already finished workflow](https://codeberg.org/forgejo/forgejo/commit/e2101ae572) + * [Fix escape problems in the branch selector](https://codeberg.org/forgejo/forgejo/commit/9fae415030) + * [Fix handling of Debian files with trailing slash](https://codeberg.org/forgejo/forgejo/commit/4be3270e87) + * [fix Missing 404 swagger response docs for /admin/users/{username}](https://codeberg.org/forgejo/forgejo/commit/1cd4d4b00e) + * [Use stderr as fallback if the log file can't be opened](https://codeberg.org/forgejo/forgejo/commit/942d02f8e9) + +## 1.20.1-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.1-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/forgejo +``` + +- **[Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/):** + The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes. +- **Breaking:** + - [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated. + - If your `app.ini` has one of the the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used. + - The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189) + - The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79) + - The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements: + * `[git.reflog].ENABLED` → `[git.config].core.logAllRefUpdates` + * `[git.reflog].EXPIRATION` → `[git.config].gc.reflogExpire` + - The [logger](https://codeberg.org/forgejo/forgejo/commit/4647660776436f0a83129b4ceb8426b1fb0599bb) used to display Forgejo's was refactored and has new settings, different from the previous one found at `log..` in `app.ini`. Check the [documentation](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#log-log) and `app.example.ini` for more information. The SMTP logger was removed. + - Forgejo will refuse to start if [the refactored path & config system](https://codeberg.org/forgejo/forgejo/commit/061b68e99) does not pass sanity checks (e.g. WORK_PATH must be absolute). + - Manually set [WORK_PATH](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#overall-default) in `app.ini`. + If the `app.ini` file is writable by the user under which the Forgejo server runs and `WORK_PATH` is not set, + the server will add it. Otherwise it will log an error starting with `Unable to update WORK_PATH`. + One of the consequences of not setting `WORK_PATH` in `app.ini` is that pushing to a repository via ssh is + [likely to fail as explained in the corresponding bug report](https://codeberg.org/forgejo/forgejo/issues/1118). + Read the technical details in the [commit that implements the WORK_PATH change](https://codeberg.org/forgejo/forgejo/commit/061b68e99). + - The user profile can be customized with [a Markdown file](https://codeberg.org/forgejo/forgejo/commit/c090f87a8db5b51e0aa9c7278b38ddc862c048ac). + The profile page of a user is rendered using the `README.md` file of the `.profile` repository, if it exists. It is a + breaking change because **it will display the .profile/README.md of a pre-existing repository, private or not**. + - The [API endpoint pagination](https://codeberg.org/forgejo/forgejo/commit/0a3c4d4a595cc7e12462dde393ed64186260f26b) for team members was fixed: it now starts at 1 instead of 0, just like all other paginated API endpoints. + - The `SSH_KEYGEN_PATH` variable in `app.ini` now defaults to using the [Go SSH key parsing instead of the `ssh-keygen` binary](https://codeberg.org/forgejo/forgejo/commit/7a8a4f54321f208ebbb0f708a5f0e49c4cd4cc04). When `START_SSH_SERVER` is true, the decision to use the Go SSH key parsing or an external binary will now depend on the value of `SSH_KEYGEN_PATH` instead of always using the Go SSH key parsing. + - The storage settings were [refactored](https://codeberg.org/forgejo/forgejo/commit/d6dd6d641b593c54fe1a1041c153111ce81dbc20). Read more about [storage settings](https://forgejo.org/docs/v1.20/admin/storage/). + - [The [repository.editor] PREVIEWABLE_FILE_MODES setting was removed](https://codeberg.org/forgejo/forgejo/commit/84daddc2fa74393cdc13371b0cc44f0444cfdae0). This setting served no practical purpose and was not working correctly. Instead a preview tab is always shown in the file editor when supported. + - In addition to the already deprecated options inside [queue], many options have been dropped as well. Those are WRAP_IF_NECESSARY, MAX_ATTEMPTS, TIMEOUT, WORKERS, BLOCK_TIMEOUT, BOOST_TIMEOUT, BOOST_WORKERS. You can remove them from your app.ini now. Additionally, some default values have changed in this section. + - The default CSS and templates included in Forgejo were heavily refactored and a large number of variables renamed. These changes are not documented and there is a very high chance that a tempate extracted and modified for a particular Forgejo instance will no longer work as it did. Browsing through the git history of the template in the sources is the best way to figure out how and why it was modified. +- **Moderation:** + Blocking another user is desirable if they are acting maliciously or are spamming your repository. When you block a user, Forgejo does not explicitly notify them, but they may learn through an interaction with you that is blocked. [Read more about blocking users](https://forgejo.org/docs/v1.20/user/blocking-user/). +- **Package:** + New registries are available for [SWIFT](https://forgejo.org/docs/v1.20/user/packages/swift), [debian](https://forgejo.org/docs/v1.20/user/packages/debian), [RPM](https://forgejo.org/docs/v1.20/user/packages/rpm), [alpine](https://forgejo.org/docs/v1.20/user/packages/alpine), [Go](https://forgejo.org/docs/v1.20/user/packages/go) and [CRAN](https://forgejo.org/docs/v1.20/user/packages/cran). +- **Accessibility:** + numerous improvements for [issue comments](https://codeberg.org/forgejo/forgejo/commit/6c354546547cd3a9595a7db119a6480d9cd506a7), [the menu on the navbar](https://codeberg.org/forgejo/forgejo/commit/a78e0b7dade16bc6509b943fe86e74962f1b95b6), [scoped labels](https://codeberg.org/forgejo/forgejo/commit/e8935606f5f1fff3c59222ebca6d4615ab06fb0b), [checkboxes and dropdowns](https://codeberg.org/forgejo/forgejo/commit/d4f35bd681af0632da988e15306f330e020422b2), [RTL rendering support to Markdown](https://codeberg.org/forgejo/forgejo/commit/32d9c47ec7706d8f06e09b42e09a28d7a0e3c526), [file (re-)views](https://codeberg.org/forgejo/forgejo/commit/e95b42e187cde9ac4bd541cd714bdb4f5c1fd8bc), [interactive tooltips](https://codeberg.org/forgejo/forgejo/commit/87f0f7e670c6c0e6aeab8c4458bfdb9d954eacec), [using a button element](https://codeberg.org/forgejo/forgejo/commit/81fe5d61851c0e586af7d32c29171ceff9a571bb), [repository list](https://codeberg.org/forgejo/forgejo/commit/e82f1b15c7120ad13fd3b67cf7e2c6cb9915c22d) and more. +- **Time:** + The display and localization of time was improved for [tooltips](https://codeberg.org/forgejo/forgejo/commit/b7b58348317cbe0145dc453d45c886b8e2764b4c), [milestones](https://codeberg.org/forgejo/forgejo/commit/97176754beb4de23fa0f68df715c4737919c93b0), [due date and translations that contain dates](https://codeberg.org/forgejo/forgejo/commit/70bb4984cdad9a15d676708bd345b590aa42d72a), [commit graphs](https://codeberg.org/forgejo/forgejo/commit/5bc9f7fcf9aece92c3fa2a0ea56e5585261a7f28), [runners](https://codeberg.org/forgejo/forgejo/commit/62ca5825f73ad5a25ffeb6c3ef66f0eaf5d30cdf), [webhooks](https://codeberg.org/forgejo/forgejo/commit/dbb37367854d108ebfffcac27837c0afac199a8e), [tests](https://codeberg.org/forgejo/forgejo/commit/3d266dd0f3dbae7e417c0e790e266aebc0078814) and more. Previously each rendered timestamp would be static, now the real time since an event happend is show. If a comment was added 2 minutes before the page rendered it would show as "2 minutes ago" on the initial render and if another 8 minutes have passed, without a page refresh you'd see "10 minutes ago". +- **[Wiki](https://forgejo.org/docs/v1.20/user/wiki/)** + - Improve the [display of the table of content](https://codeberg.org/forgejo/forgejo/commit/1ab16e48cccc086e7f97fb3ae8a293fe47a3a452) + - Fixed a bug [preventing team users who have wiki write permission from deleting a page](https://codeberg.org/forgejo/forgejo/commit/284b41f45244bbe46fc8feee15bbfdf66d150e79) + - [Shows the External Link icon and URL in the header](https://codeberg.org/forgejo/forgejo/commit/d347208114966166ffa9655adc5b202676546c31) to indicate that the user will be sent to an external side to help prevent fishing + - Allow dash in [titles](https://codeberg.org/forgejo/forgejo/commit/b39a5bbbd610ba30651218658caaec1c86d6bca1) +- **[Actions](https://forgejo.org/docs/v1.20/user/actions/)** + - The internal CI graduated from **experimental** to **[alpha](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)**. It now has with a [user](https://forgejo.org/docs/v1.20/user/actions) documentation that includes examples and an extensive [administrator](https://forgejo.org/docs/v1.20/admin/actions) guide to set it up. + - [Forgejo Actions](https://forgejo.org/docs/v1.20/user/actions/) workflows are [now available](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/.forgejo/workflows) to run tests and publish releases for `Forgejo` itself. + - The Woodpecker CI configuration for PR verification and building releases for Forgejo v1.18 and v1.19 is no longer maintained as part of Forgejo itself and was moved to its [own repository](https://codeberg.org/forgejo-contrib/forgejo-ci-woodpecker). +- **[Templates](https://forgejo.org/docs/v1.20/user/issue-pull-request-templates/)** + - [Configuration for the issue templates](https://codeberg.org/forgejo/forgejo/commit/f384b13f1cd44be3a87df5553a0099390dacd010). [Read more about issue config](https://forgejo.org/docs/v1.20/user/issue-pull-request-templates/#syntax-for-issue-config) in the documentation. + - [Add validations.required check to the dropdown field](https://codeberg.org/forgejo/forgejo/commit/5c0745c0349f0709d0fc36fd8a97dcab86bce28a) + - [Issue template support markdown edition](https://codeberg.org/forgejo/forgejo/commit/c4303efc23ea19f16ee826809f43888ee4583ebb) + - [Use a general Eval function for expressions in templates](https://codeberg.org/forgejo/forgejo/commit/5b89670a318e52e271f65d96bfe1116d85d20988) + - [reload-templates CLI](https://codeberg.org/forgejo/forgejo/commit/3588edbb08f93aaa56defa82dffdbb202cd9aa4a) +- **User Interface and User eXperience** + - The web editor used when creating issues, adding comments, etc. [changed](https://codeberg.org/forgejo/forgejo/commit/5cc0801de90d16b4d528e62de11c9b525be5d122) from [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) which was no longer actively maintained to [GitHub markdown](https://github.com/github/markdown-toolbar-element). To help with the transition it is still possible to switch back to using EasyMDE using the double arrow button in the menubar. + - [Improve wiki sidebar and TOC](https://codeberg.org/forgejo/forgejo/commit/51789ba12) + - [Show outdated comments in the files changed tab of a pull request review](https://codeberg.org/forgejo/forgejo/commit/30a783879) + - [Redirect to package after version deletion](https://codeberg.org/forgejo/forgejo/commit/c27a3af72) + - Use a [separate admin page to show stats](https://codeberg.org/forgejo/forgejo/commit/520eb57d7642a5fca3df319e5b5d1c7c9018087c) + - [Improve avatar compression and resizing](https://codeberg.org/forgejo/forgejo/commit/82224c54e0488738dbd3b7eccf56ab08b6790627) + - [Add button to compare force pushed commits in pull requests](https://codeberg.org/forgejo/forgejo/commit/545495dcb0a4cb9d820132dde4f1127f7fe91aa4) + - [When creating a new file in a repository via the web user interface allow for a path to be pasted](https://codeberg.org/forgejo/forgejo/commit/7f9d58fab8a3c4fd1a8f18d58e36fbfab7b30f33) + - [Allows "video" HTML tag to be used in MarkDown, with the src, autoplay, and controls attributes](https://codeberg.org/forgejo/forgejo/commit/de6c718b46ebd3b7f6362c766eed328044d95ec7) + - [Add "Reviewed by you" filter for pull requests](https://codeberg.org/forgejo/forgejo/commit/10cdcb9ea8077098921d72720f9f36fcfd950452) + - [Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment](https://codeberg.org/forgejo/forgejo/commit/188c8c12c290e131fb342e3203634828652b0af5) + - If an instance chooses to disable new pull or push mirrors or mirrors entirely, an appropriate message will [now be shown to the user in the Repository Settings](https://codeberg.org/forgejo/forgejo/commit/35ce7ca25b5756441949312d79aa6382f98ce8d6) + - [Change `Close` to either `Close issue` or `Close pull request`](https://codeberg.org/forgejo/forgejo/commit/39d3711f3036db42d7ddf73dbdb125be611bcbba) + - [Make Issue/PR/projects more compact](https://codeberg.org/forgejo/forgejo/commit/4a722c9a45659e7732258397bbb3dd1039ea1952) + - [Improve RSS user interface](https://codeberg.org/forgejo/forgejo/commit/59d060622d375c4123ea88e2fa6c4f34d4fea4d3) + - [Add details summary for vertical menus in settings to allow toggling](https://codeberg.org/forgejo/forgejo/commit/58536093b3112841bc69edb542189893b57e7a47) + - [Show visibility status of email in own profile](https://codeberg.org/forgejo/forgejo/commit/5e1bd8af5f16f9db88cfeb5b80bdf731435cacfb) + - [Improve the protected branch setting page](https://codeberg.org/forgejo/forgejo/commit/72e956b79a3b2e055bb5d4d5e20e88eaa2eeec96) + - [Improve the display of the pull request branch delete button](https://codeberg.org/forgejo/forgejo/commit/774d1a0fbdadd1136b6af895f8d449b0c8db54cb) + - [Fix the color for repository transfer related buttons when having no permission to act](https://codeberg.org/forgejo/forgejo/commit/7abe958f5b507efa676fb3b2e27d30517f6d1908) + - [Add a progressbar to Milestone Page](https://codeberg.org/forgejo/forgejo/commit/7d192cb674bc475b123c84b205aca821247c5dd1) + - [Nicer display when the list of notifications is empty](https://codeberg.org/forgejo/forgejo/commit/8251b317f7b7a2b5f626a02fa3bb540a1495e81d) + - [Rename board to column in projects](https://codeberg.org/forgejo/forgejo/commit/843f81113ebe71fd725210c5a382268333865cc7) + - [Improve header bar on issue, pull requests and milestone](https://codeberg.org/forgejo/forgejo/commit/8f4dafcd4e6b0b5d307c3e060ffe908c2a96f047) + - [Add organization visibility label when displayed on the dashboard](https://codeberg.org/forgejo/forgejo/commit/97b70a0cd40e8f73cdf6ba4397087b45061de3d8) + - [Unification of registration fields order](https://codeberg.org/forgejo/forgejo/commit/b9fad73e9fcf40e81cde3304198105af6c668421) + - [Append `(comment)` when a link points at a comment rather than the whole issue](https://codeberg.org/forgejo/forgejo/commit/ca905b82df7f1d2a823d8df4448d485e5902876d) + - [Add visibility (private, limited) in the dashboard navbar](https://codeberg.org/forgejo/forgejo/commit/d949d8e074407a96dbcfa98a71ccd80527b5ad78) + - [Show all activities in the dashboard, not just the most recent ones](https://codeberg.org/forgejo/forgejo/commit/f4920c9c7f5947d3b6476610f39bc3492ab4ef3b) + - [Do not display the stars in the repository list of the dashboard](https://codeberg.org/forgejo/forgejo/commit/06c067bb0f9eeb8873ddc298819b30fc5913943f) + - [Improve the display of tags to include the tag message](https://codeberg.org/forgejo/forgejo/commit/b78c955958301dde72d8caf189531f6e53c496b4) + - [Hide the target selector if a tag exists when creating a new release](https://codeberg.org/forgejo/forgejo/commit/3de9e63fd04d61e08fcbdec035c9f138347d9f37) + - [Show the calculated commit status state of the latest commit on the default branch for each repository in the dashboard repository list](https://codeberg.org/forgejo/forgejo/commit/4810fe55e3e73edb962052df46bef125eb1817b3) + - [Sort users and orgs on the explore page by recency](https://codeberg.org/forgejo/forgejo/commit/4daf40505a5f89747982ddd2f1df2a4001720846) + - [Show the number of repositories in the user or organization profile](https://codeberg.org/forgejo/forgejo/commit/52b17bfa07fea29441cd961da4edaf1ea97fe348) + - [Review management (requesting again and discard) now happens at the top of the pull request](https://codeberg.org/forgejo/forgejo/commit/a70d853d064a97f0be1d3702a9c3912494b546ec) + - [Add markdown preview when submitting a review](https://codeberg.org/forgejo/forgejo/commit/b5c26fa825e08122843ad6d27191d399a9af1c37) + - [Support no label/assignee filter and batch clearing labels/assignees](https://codeberg.org/forgejo/forgejo/commit/b807d2f6205bf1ba60d3a543e8e1a16f7be956df) + - [Display when a repo was archived](https://codeberg.org/forgejo/forgejo/commit/c41bc4f1279c9e1e6e11d7b5fcfe7ef089fc7577) + - [Improve squash merge commit author and co-author with private emails](https://codeberg.org/forgejo/forgejo/commit/d647e74502fdf734c89b3e6592a9ad88c3005971) + - [Allow adding new files to an empty repo](https://codeberg.org/forgejo/forgejo/commit/e422342eebc18034ef586ec58f1e2fff0340091d) + - [Move `Rename branch` from repo settings page to the page of branches list](https://codeberg.org/forgejo/forgejo/commit/e8173c2c33f1dd5b0a2c044255434d414cab62d2) + - [Add "Updated" column for admin repositories list](https://codeberg.org/forgejo/forgejo/commit/94d6b5b09d49b2622c2164a03cfae45dced96c74) + - [Hide the merge box of a pull request if it is merged and the branch was deleted](https://codeberg.org/forgejo/forgejo/commit/e9b39250b285f1b9cbf9739f33c06fc57401f314) + - [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4) + - [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed) + - [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2) + - [Support searching for an issue with its number in the the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212) + - [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34) + - [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f) + - [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8) + - [Add a tooltip to `Publish Review` explaining why they are disabled](https://codeberg.org/forgejo/forgejo/commit/a8c30a45fa49a3a551b1dca882960008c254bb3d) + - [Show the file tree view by default when browsing the changes in a pull request](https://codeberg.org/forgejo/forgejo/commit/72eedfb91584720da774909d3f078b7d515c9fdd) + - [Allow both fullname search in the author dropdown search of the issue list when `DEFAULT_SHOW_FULL_NAME` is true](https://codeberg.org/forgejo/forgejo/commit/661e78bed5c0879c32c53eb60f3d6898b93e1f08) +- **Performance** + - [Improve performances when listing issues](https://codeberg.org/forgejo/forgejo/commit/9bbb4d8d6) + - [Speedup loading the list of authors in the dropdown of the list of issues](https://codeberg.org/forgejo/forgejo/commit/6eb678374b583079a0a08b7ed0c9ca220c0c0434) + - [Use minio/sha256-simd for accelerated SHA256](https://codeberg.org/forgejo/forgejo/commit/1319ba6742a8562453646763adad22379674bab5) + - [Speed up HasUserStopwatch & GetActiveStopwatch](https://codeberg.org/forgejo/forgejo/commit/ef4fc302468cc8a9fd8f65c4ebdc6f55138450d1) + - [Do not create commit graph for temporary repos](https://codeberg.org/forgejo/forgejo/commit/0268ee5c37b8ad733678f02bc15ec8642da62c10) + - [Faster git.GetDivergingCommits](https://codeberg.org/forgejo/forgejo/commit/75ea0d5dba5dbf2f84cef2d12460fdd566d43e62) + - [Order pull request conflict checking by recently updated, for each push](https://codeberg.org/forgejo/forgejo/commit/df48af22296ccce8e9bd18e5d35c9a3cdf5acb0f) + - [MySQL integration tests](https://codeberg.org/forgejo/forgejo/commit/49f68518c2a2bd36ca0106045bd84de01dec4b61) run twice faster low end machines and use an order of magnitude less disk I/O +- **Authentication** + - [Add ntlm authentication support for mail](https://codeberg.org/forgejo/forgejo/commit/8be6da3e2fd0b685aeb6b9e7fd9dee5a4571163a) + - [LDAP filters include both username and email address](https://codeberg.org/forgejo/forgejo/commit/b8c19e7a11525da4174b6f80f87ff3e844d03d8a) + - [Allow for PKCE flow without client secret](https://codeberg.org/forgejo/forgejo/commit/7d855efb1fe6b97c5d87492f67ed6aefd31b2474) + - [Add the ability to set multiple redirect URIs in the OAuth application UI](https://codeberg.org/forgejo/forgejo/commit/ca35dec18b3d3d7dd5cde4c69a10ae830961faf7) +- **Refactor:** + Many essential sub-systems were refactored: the [queue system](https://codeberg.org/forgejo/forgejo/commit/6f9c278559789066aa831c1df25b0d866103d02d) that handles background tasks such as checking pull requests, [pull mirror](https://codeberg.org/forgejo/forgejo/commit/99283415bcbaa8acfe4d249ce3040de2f3a8b006), [git internal API](https://codeberg.org/forgejo/forgejo/commit/f4538791f5fc82b173608fcf9c30e36ec01dc9d3), [routes](https://codeberg.org/forgejo/forgejo/commit/92fd3fc4fd369b6a8c0a022a32a80dec2340223a) and [web routes](https://codeberg.org/forgejo/forgejo/commit/b9a97ccd0ea1ee44db85b0fbb80b75255af7c742), [merge & update logic](https://codeberg.org/forgejo/forgejo/commit/8598356df1eb21b6e33ecb9f9268ba36c5488e7c) and [git command calls](https://codeberg.org/forgejo/forgejo/commit/542cec98f8c07e0f046a35f1d516807416536e74), [listing commits](https://codeberg.org/forgejo/forgejo/commit/ec261b63e14f84da3e2d9a6e27c8b831a7750677), [cookie](https://codeberg.org/forgejo/forgejo/commit/5b9557aef59b190c55de9ea218bf51152bc04786), [issue stats](https://codeberg.org/forgejo/forgejo/commit/38cf43d0606c13c38f459659f38e26cf31dceccb), [renaming users and organizations](https://codeberg.org/forgejo/forgejo/commit/c59a057297c782f44a81a3e630b5094a58099edb), [app.ini handling](https://codeberg.org/forgejo/forgejo/commit/de4a21fcb4476772c69c36d086549e89ed4dcf6c), [diffFileInfo / DiffTreeStore](https://codeberg.org/forgejo/forgejo/commit/ee99cf6313ba565523b3c43f61ffda4b71e2c39b).... In theory these changes are transparent to the Forgejo user and admin but the risk of subtle regressions is real: do not hesitate to [reach out](https://codeberg.org/forgejo/forgejo/issues) if you suspect anything. +- **RSS** + - [Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS](https://codeberg.org/forgejo/forgejo/commit/88033438aa8214569913899a17b19b57bd609d97) + - [Add RSS Feeds for branches and files](https://codeberg.org/forgejo/forgejo/commit/56d4893b2a996da6388801c9c8ff16b9b588ad55) +- **API** + - [Add admin API for email](https://codeberg.org/forgejo/forgejo/commit/d56bb7420184c0c2f451f4bcaa96c9b3b00c393d) + - [Add admin API to rename a user](https://codeberg.org/forgejo/forgejo/commit/03591f0f95823a0b1dcca969d2a3ed505c7e6d73) + - [Add login name and source id to admin user searching API](https://codeberg.org/forgejo/forgejo/commit/6f9cc617fcc42477dec5ccab83d06f0a96544403) + - [Add missing units to create and edit repo API](https://codeberg.org/forgejo/forgejo/commit/574d8fe6d6675c8aa05e2b75fdbc01c009efd8be) + - [Add API to manage issue dependencies](https://codeberg.org/forgejo/forgejo/commit/3cab9c6b0c050bfcb9f2f067e7dc1b0242875254) + - [Add API for activity feeds](https://codeberg.org/forgejo/forgejo/commit/6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d) + - [Add API for license templates](https://codeberg.org/forgejo/forgejo/commit/fb37eefa282543fd8ce63c361cd4cf0dfac9943c) + - [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4) + - [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3) + - [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f) + - [Add `files` and `verification` parameters to improve performances when listing the commits of a a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b) + - [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54) + - [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490) + - [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2) + - [Add API for changing/creating/deleting multiple files](https://codeberg.org/forgejo/forgejo/commit/275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2) +- **Miscellaneous Features** + - [Any URL scheme may be used for links](https://codeberg.org/forgejo/forgejo/commit/f5ce2ed292a90041abd749a8db26671645648a43). Previously, non-standard URLs (like matrix:) were not rendered unless explicitly listed in `markdown.CUSTOM_URL_SCHEMES`. Now the default if `markdown.CUSTOM_URL_SCHEMES` is not set, all schemes are allowed and markdown links ([label](URL)) render as links. + - [Always use "utf8mb4" for MySQL](https://codeberg.org/forgejo/forgejo/commit/cb3173a1e) + - [Add Adopt repository event and handler](https://codeberg.org/forgejo/forgejo/commit/9d69a4758) + - Add [meilisearch](https://www.meilisearch.com/) support to [index the content of repositories](https://codeberg.org/forgejo/forgejo/commit/92c160d8e716cb3d05215a97cf521e843596f562). + - [Add support](https://codeberg.org/forgejo/forgejo/commit/985f76dc4b0692c4d6c6f37e82500ef859557c16) for [redis v7](https://raw.githubusercontent.com/redis/redis/7.0/00-RELEASENOTES) + - Allow [webp](https://en.wikipedia.org/wiki/WebP) images [as avatars](https://codeberg.org/forgejo/forgejo/commit/65fe0fb22cfb264f0b756065d0c3ce7a17d7e55b) + - [Add support](https://codeberg.org/forgejo/forgejo/commit/58caf422e67c78f87327bc9b00f89083a2432940) for rendering [.livemd](https://livebook.dev/) + - The `forgejo forgejo-cli actions` [subcommand is added](https://codeberg.org/forgejo/forgejo/commit/d6efefbb63d59ba0251c10b6031f6b630b184eaf) to implement [offline registration with `actions register`](https://forgejo.org/docs/v1.20/admin/actions/#offline-registration) for the [Forgejo runner](https://code.forgejo.org/forgejo/runner). + - When [called as `forgejo-cli`](https://codeberg.org/forgejo/forgejo/commit/935fb85e8b2a5f6a9c9c6c0b78a234abc14df4fe) (with `ln -f forgejo forgejo-cli`), Forgejo provides a new CLI that is not backward compatible with Gitea. It contains Forgejo specific additions such as [offline registration](https://forgejo.org/docs/v1.20/admin/actions/#offline-registration) + - [Render list items](https://codeberg.org/forgejo/forgejo/commit/e1829f0728509c4c1b7810fe9f6df1aebb71b4c0) when an [org-mode](https://orgmode.org/) file is displayed + - [A user can follow an organization](https://codeberg.org/forgejo/forgejo/commit/cc64a925602d54f3439dd19f16b5280bd0377a7a) + - [When playing a video in the web UI, the player control can be dragged to play on the specified position](https://codeberg.org/forgejo/forgejo/commit/023a048f52b5bf8c4b715285245a129f04e05a8c) + - The commit status required for a pull request to be merged can now be [specified as patterns](https://codeberg.org/forgejo/forgejo/commit/e7c2231dee356df5cbe5a47c07e31e3a8d090a6f) instead of being a hard coded list + - [Support wildcard in email domain allow and block lists](https://codeberg.org/forgejo/forgejo/commit/2cb66fff60c95efbd58b797f1197f2421f4687ce). [Read more about EMAIL_DOMAIN_ALLOWLIST and EMAIL_DOMAIN_BLOCKLIST](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/). + - When [installing with docker](https://forgejo.org/docs/v1.20/admin/installation/#installation-with-docker) the value of a configuration variable can now be fetched from a file by [adding the `__FILE` suffix](https://codeberg.org/forgejo/forgejo/commit/c21605951b581440bb08b65d5907b1cd4e0ab6c5). For instance `FORGEJO__security__INTERNAL_TOKEN__FILE=/etc/forgejo/token` can be used instead of `FORGEJO__security__INTERNAL_TOKEN=tokenvalue`. + - The [new `[git.config]` section of `app.ini`](https://codeberg.org/forgejo/forgejo/commit/8080ace6fcf73a5fbe4a0dd71881228abd0c68b9) is used to `git set config`. [Read more about the defaults it contains](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#git---config-options-gitconfig). + - [Issues and pull requests can be pinned](https://codeberg.org/forgejo/forgejo/commit/aaa109466350c531b9238a61115b2877daca57d3). They will show on top of the list of issues (or pull requests) and can be re-arranged by dragging them. + - [Implement systemd-notify protocol](https://codeberg.org/forgejo/forgejo/commit/7565e5c3de051400a9e3703f707049cbb9054cf3) and allows for using `Type=notify` in service files. + - [Provide more control over the repositories that are indexed](https://codeberg.org/forgejo/forgejo/commit/033d92997fc16baee097d2b25f08e0984e628abd). [Read more about REPO_INDEXER_REPO_TYPES](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/). +- **Webhook** + - Similar to organization wide webhooks, it is now possible to have [user wide webhooks](https://codeberg.org/forgejo/forgejo/commit/2173f14708ff3b35d7821fc9b6dcb5fcd06b8494) + - [Add webhook trigger when a Pull Request review requests is created](https://codeberg.org/forgejo/forgejo/commit/309354c70ee994a1e8f261d7bc24e7473e601d02) + +* Container images upgraded to Alpine 3.18 + + The Forgejo container images are now based on [Alpine 3.18](https://alpinelinux.org/posts/Alpine-3.18.0-released.html) instead of Alpine 3.17. + +## 1.19.4-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.4-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.19.3-0..v1.19.4-0 +``` + +This stable release contains security fixes. + +* Recommended Action + + We recommend that all Forgejo installations are upgraded to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/) + + The semantic version was updated from `4.2.1+0-gitea-1.19.3` to `4.2.2+0-gitea-1.19.4`. + +* Security fixes + + * [An additional verification](https://codeberg.org/forgejo/forgejo/commit/a259a928a) was implemented to prevent [open redirects](https://en.wikipedia.org/wiki/Open_redirect). + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Fix an edge case](https://codeberg.org/forgejo/forgejo/commit/27796464c) where a user changing their `username` in their profile page could fail + * The secrets are only meaningful in the context of `Frogejo Actions`, do not display them if `Forgejo Actions` is disabled ([patch 1](https://codeberg.org/forgejo/forgejo/commit/5883db45c), [patch 2](https://codeberg.org/forgejo/forgejo/commit/5fdac0d46)) + * Actions can now be triggered on mirrored repositories ([patch 1](https://codeberg.org/forgejo/forgejo/commit/58bdcae61), [patch 2](https://codeberg.org/forgejo/forgejo/commit/8d4d6f9b2)) + * [Return `404` in the API if the requested webhooks were not found](https://codeberg.org/forgejo/forgejo/commit/16bcceeff) instead of `500` + * Ensure topics deleted via the API are [also deleted in the repository](https://codeberg.org/forgejo/forgejo/commit/5dc29fdeb) + * [Tentative fix](https://codeberg.org/forgejo/forgejo/commit/9bc4887cb) to suppress the JavaScript error **TypeError: undefined is not an object (evaluating '_i18n.textEdited')** on safari. It is unclear if that fix is effective because it could not be reproduced, please report if it still happens for you. + * [Respect original content when creating secrets](https://codeberg.org/forgejo/forgejo/commit/f6919e3e5) + * If a mirror failed and left the database in an inconsistent state, make it so the repository page [does not fail with an error `500`](https://codeberg.org/forgejo/forgejo/commit/f37fba567) + * If a user that triggered `Actions` is deleted, [allow for the page listing the tasks it launched to show](https://codeberg.org/forgejo/forgejo/commit/f9bf040a5) instead of failing with an error `500` + * [Allow the selection of milestones](https://codeberg.org/forgejo/forgejo/commit/55d062003) when acting on multiple issues in the issue list page + * [Fix the API error message when trying to create a fork that already exists](https://codeberg.org/forgejo/forgejo/commit/4dccac3db) + * [Don't display a `create page` button in a mirror wiki repository](https://codeberg.org/forgejo/forgejo/commit/7a74957c1). A mirrored repository will also mirror a wiki and changes will be overridden. + * [Do not allow for a repository to enable actions if it is not enabled in the configuration](https://codeberg.org/forgejo/forgejo/commit/257287954) + * Allow for closed PRs to be re-opened and [synchronize with the latest content of the head branch](https://codeberg.org/forgejo/forgejo/commit/306b7b5d1) + * [Fix the `close` button of projects within an organization](https://codeberg.org/forgejo/forgejo/commit/306b7b5d1). It was a noop and now effectively closes the project + +## 1.19.3-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.3-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.19.2-0..v1.19.3-0 +``` + +This stable release contains security fixes. + +* Recommended Action + + We recommend that all Forgejo installations are upgraded to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/) + + The semantic version was updated from `4.2.0+0-gitea-1.19.2` to `4.2.1+0-gitea-1.19.3` because of the rebuild with [Go version 1.20.4](https://github.com/golang/go/issues?q=milestone%3AGo1.20.4+label%3ACherryPickApproved). + +* Security fixes + + * Forgejo was recompiled with Go version v1.20.4 published 2 May 2023. It fixes [three vulnerabilities](https://github.com/golang/go/issues?q=milestone%3AGo1.20.4+label%3ACherryPickApproved) ([CVE-2023-29400](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29400), [CVE-2023-24540](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-24540), [CVE-2023-24539](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-24539)) related to the [html/template](https://pkg.go.dev/html/template) package. The [Forgejo security team](https://forgejo.org/.well-known/security.txt) analyzed the security fixes it contains and concluded that Forgejo is not affected but recommended a rebuild as a precaution. + +* Bug fixes + + The most prominent one is described here, others can be found in the list of commits included in the release as described above. + + * [Allow users that are not signed in to browse the tag list](https://codeberg.org/forgejo/forgejo/commit/e76b3f72b23bf778a562682d829744451b27d615). Requiring users to be signed in to view the tag list was a regression introduced in Forgejo v1.19.2-0. + +## 1.19.2-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.2-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.19.1-0..v1.19.2-0 +``` + +This stable release contains **important security fixes**. + +* Recommended Action + + We **strongly recommend** that all Forgejo installations are upgraded to the latest version as soon as possible. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/) + + The semantic version was updated from `4.1.0+0-gitea-1.19.1` to `4.2.0+0-gitea-1.19.2` because of the changes introduced in the internal CI. + +* Security fixes + + * Token scopes were not enforced in some cases ([patch 1](https://codeberg.org/forgejo/forgejo/commit/7c3ac69c0) and [patch 2](https://codeberg.org/forgejo/forgejo/commit/10d3ed53f1cc6d383b52637bedd7bc3679476eb4)). The [scoped token](https://forgejo.org/docs/v1.19/user/oauth2-provider/#scoped-tokens) were introduced in Forgejo v1.19 allow for the creation of application tokens that only have limited permissions, such as creating packages or accessing repositories. Prior to Forgejo v1.19 tokens could be used to perform any operation the user issuing the token could. + * [Permissions to delete secrets was not enforced](https://codeberg.org/forgejo/forgejo/commit/68d80eb56). The experimental internal CI relies on secrets managed via the web interface, for instance to communicate credentials to a job. Secrets are only used in the context of the experimental internal CI. + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Restore public access to some API endpoints](https://codeberg.org/forgejo/forgejo/commit/b00f7c3c545c6a00a747a5aea7596f45c50157ac). When [scoped token](https://forgejo.org/docs/v1.19/user/oauth2-provider/#scoped-tokens) introduced in Forgejo v1.19, some API endpoints that were previously accessible anonymously became restricted: `/orgs`, `/orgs/{org}`, `/orgs/{org}/repos`, `/orgs/{org}/public_members`, `/orgs/{org}/public_members/{username}`, `/orgs/{org}/labels`. + * [Fix 2-dot direct compare to use the right base commit](https://codeberg.org/forgejo/forgejo/commit/494e373292962de34b7ea7efd3f4a8d2f27daa26). For 2-dot direct compare, the base commit should be used in the title and templates, as is used elsewhere, not the common ancestor which is used for 3-dot compare. + * [Make CORS work](https://codeberg.org/forgejo/forgejo/commit/2e6e5bc9c96ebb760f28c08423bb0c244ca7e01c). No [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) headers were set, even if CORS was enabled in the configuration. + * [Fix issue attachment removal](https://codeberg.org/forgejo/forgejo/commit/d5f2c9d74d63443cc2abbcabc268cf1121f58e8b). When an attachment was removed from an issue or review comment, all of the image/attachment links were broken. + * [Fix wiki write permissions for users who do not have repository write permissions](https://codeberg.org/forgejo/forgejo/commit/8c465206e2fea27076fdb986ea0478729653f0b5). When a team member had write access to the wiki but not to the code repository, some operations (deleting a page for instance) were denied. + * [Respect the REGISTER_MANUAL_CONFIRM setting when registering via OAuth](https://codeberg.org/forgejo/forgejo/commit/116b6d5b27c40b248281f5fd543f7aa8df0d59d3). Contrary to the local registration, the OAuth registration flow activated a newly registered user regardless of the value of `REGISTER_MANUAL_CONFIRM`. + * [Fix tags list for repos whose release setting is disabled](https://codeberg.org/forgejo/forgejo/commit/eeee32cdc3aab4d2086b24aae670a39501c9ea99). When releases was disabled the "tags" button led to a `Not Found` page, even when tags existed. + +* Container image upgrades + + In the Forgejo container images the Git version was upgraded to [2.38.5](https://github.com/git/git/blob/master/Documentation/RelNotes/2.38.5.txt) as a precaution. The [Forgejo security team](https://forgejo.org/.well-known/security.txt) analyzed the security fixes it contains and concluded that Forgejo is not affected. + +## 1.19.1-0 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.1-0` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.19.0-3..v1.19.1-0 +``` + +This stable release includes bug fixes. Functional changes related to the experimental CI have also been backported. + +* Recommended Action + + We recommend that all installations are upgraded to the latest version. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/) + + The semantic version was updated from `4.0.0+0-gitea-1.19.0` to `4.1.0+0-gitea-1.19.1` because of the changes introduced in the internal CI. + +* Bug fixes + + The most prominent ones are described here, others can be found in the list of commits included in the release as described above. + + * [Fix RSS/ATOM/GPG/KEYS path for users (or orgs) with a dot in their name](https://codeberg.org/forgejo/forgejo/commit/085b56302cfd9a949319a3a1e32e008b4a0d0772). It is allowed for a user (or an organization) to have a dot in their name, for instance `user.name`. Because of a [bug in Chi](https://codeberg.org/forgejo/forgejo/issues/652) it was not possible to access `/user.name.png`, `/user.name.gpg`, etc. A workaround was implemented while a [proper fix is being discussed](https://github.com/go-chi/chi/pull/811). + * [Creating a tag via the web interface no longer requires a title](https://codeberg.org/forgejo/forgejo/commit/1b8ecd179bdb58427b99c2c2eb9ad5a45abf7055). + * [Use fully qualified URLs in Dockerfile](https://codeberg.org/forgejo/forgejo/commit/833a4b177596debc138e5723219fd063d067bd5b). The Dockerfile to create the Forgejo container image now uses the fully qualified image `docker.io/library/golang:1.20-alpine3.17` instead of `golang:1.20-alpine3.17`. This allows for building on platforms that don't have docker hub as the default container registry. + * [Redis use Get/Set instead of Rename when Regenerate session id](https://codeberg.org/forgejo/forgejo/commit/3a7cb1a83b4ecd89421b5656b8caeb30c2b13c7c). The old sid and new sid may be in different redis cluster slot. + * [Do not escape space between PyPI repository url and package name](https://codeberg.org/forgejo/forgejo/commit/cfde557e231417b7fb3cde3e9bab70d05b7d182f). It also adds a trailing slash to the PyPI repository URL in accordance to [Python PEP-503](https://peps.python.org/pep-0503/). + * [Fix failure when using the API and an empty rule_name to protect a branch](https://codeberg.org/forgejo/forgejo/commit/abf0386e2ef6b56c048c04cd3d6913f453c87cb1). The `rule_name` parameter for the [/repos/{owner}/{repo}/branch_protections](https://code.forgejo.org/api/swagger#/repository/repoCreateBranchProtection) API now defaults to the branch name instead of being empty. + * [Fix branch protection priority](https://codeberg.org/forgejo/forgejo/commit/580da8f35320dbd15b168bf8ccfaff6187ff87e0). Contrary to [the documentation](https://forgejo.org/docs/v1.19/user/protection/#protected-branches) it was possible for a glob rule to take precedence over a non-glob rule. + * [Fix deleting an issue when the git repo does not exist](https://codeberg.org/forgejo/forgejo/commit/1d8ae34e57e46b84a885b4f072d949344c5977c4). If a project had an issue tracker (such as the [Forgejo discussion](https://codeberg.org/forgejo/discussions/issues)) but [no git repository](https://codeberg.org/forgejo/discussions/), trying to delete an issue would fail. + * [Fix accidental overwriting of LDAP team memberships](https://codeberg.org/forgejo/forgejo/commit/66aa85429684aca45753ac9578492ed3f7507ea3). If an LDAP user is a member of two groups, the LDAP group sync only matched the last group. + +## 1.19.0-3 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.0-3` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges v1.19.0-2..v1.19.0-3 +``` + +This stable release includes security updates and bug fixes. + +* Recommended Action + + We recommend that all installations are upgraded to the latest version. + +* Security + + The [Forgejo security team](https://forgejo.org/.well-known/security.txt) analyzed the vulnerabilities fixed in the latest [Go 1.20.3 packages](https://go.dev/doc/devel/release#go1.20.minor) and [Alpine 3.17.3](https://alpinelinux.org/posts/Alpine-3.17.3-released.html) and concluded that Forgejo is not affected. + + As a precaution the Forgejo v1.19.0-3 binaries were compiled with [Go 1.20.3 packages](https://go.dev/doc/devel/release#go1.20.minor) as published on 4 April 2023 and the container images were built with [Alpine 3.17.3](https://alpinelinux.org/posts/Alpine-3.17.3-released.html) as published on 29 March 2023. + +* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/) + + The semantic version was updated from `3.0.0+0-gitea-1.19.0` to `4.0.0+0-gitea-1.19.0` because of the breaking changes described below. + +* Breaking changes + + They should not have a significant impact because they are related to experimental features (federation and CI). + + * [Use User.ID instead of User.Name in ActivityPub API for Person IRI](https://codeberg.org/forgejo/forgejo/commit/2fcd57d5ae5b5926e5b0b87e46f78ad4ac83cbbd) + + The ActivityPub id is an HTTPS URI that should remain constant, even if +the user changes their name. + + * [Actions unit is repo.actions instead of actions.actions](https://codeberg.org/forgejo/forgejo/commit/9596bd3712caec440859fce93d05e19cf95e5330) + + All instances of `actions.actions` in the `DISABLED_REPO_UNITS` or `DEFAULT_REPO_UNITS` configuration variables must be replaced with `repo.actions`. + +* Bug fixes + + They are for the most part about user interface and actions. The most prominent ones are: + + * [Do not filter repositories by default on the explore page](https://codeberg.org/forgejo/forgejo/commit/d15f20b2d2ce613cc8b36536995f29f81797c002). The behavior of the explore page is back to what it was in Forgejo v1.18. Changing it was confusing. + * [Skip LFS when disabled in dump and doctor](https://codeberg.org/forgejo/forgejo/commit/b6a2323981a7a89205a382ddf0542e205e292d3d). + * [Do not display own email on the profile](https://codeberg.org/forgejo/forgejo/commit/1fed0e1adc8dd2d27d2d7e34dda29c8e79e5e6e8). + * [Make minio package support legacy MD5 checksum](https://codeberg.org/forgejo/forgejo/commit/b73d1ac1eb7d5c985749dc721bbea7ebd14f9c83). + * [Do not triggers Webhooks and actions on closed PR](https://codeberg.org/forgejo/forgejo/commit/a04535e212b04c0f6643a4f36904a3d1bf30c63f). + +## 1.19.0-2 + +The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.0-2` release can be reviewed from the command line with: + +```shell +$ git clone https://codeberg.org/forgejo/forgejo/ +$ git -C forgejo log --oneline --no-merges origin/v1.18/forgejo..origin/v1.19/forgejo +``` + +* Breaking changes + * [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/de484e86bc) + + Forgejo access token, used with the [API](https://forgejo.org/docs/v1.19/admin/api-usage/) can now have a "scope" that limits what it can access. Existing tokens stored in the database and created before Forgejo v1.19 had unlimited access. For backward compatibility, their access will remain the same and they will continue to work as before. However, **newly created token that do not specify a scope will now only have read-only access to public user profile and public repositories**. + + For instance, the `/users/{username}/tokens` API endpoint will require the `scopes: ['all', 'sudo']` parameter and the `forgejo admin user generate-access-token` will require the `--scopes all,sudo` argument obtain tokens with ulimited access as before for admin users. + + [Read more about the scoped tokens](https://forgejo.org/docs/v1.19/user/oauth2-provider/#scoped-tokens). + + * [Disable all units except code and pulls on forks](https://codeberg.org/forgejo/forgejo/commit/2741546be) + + When forking a repository, the fork will now have issues, projects, releases, packages and wiki disabled. These can be enabled in the repository settings afterwards. To change back to the previous default behavior, configure `DEFAULT_FORK_REPO_UNITS` to be the same value as `DEFAULT_REPO_UNITS`. + + * [Filter repositories by default on the explore page](https://codeberg.org/forgejo/forgejo/commit/4d20a4a1b) + + The explore page now always filters out repositories that are considered not relevant because they are either forks or have no topic and not description and no icon. A link is shown to display all repositories, unfiltered. + + Explore repositories + + * [Remove deprecated DSA host key from Docker Container](https://codeberg.org/forgejo/forgejo/commit/f17edfaf5a31ea3f4e9152424b75c2c4986acbe3) + Since OpenSSH 7.0 and greater similarly disable the ssh-dss (DSA) public key algorithm, and recommend against its use. http://www.openssh.com/legacy.html + + * Additional restrictions on valid user names + + The algorithm for validating user names was modified and some users may have invalid names. The command `forgejo doctor --run check-user-names` will list all of them so they can be renamed. + + If a Forgejo instance has users or organizations named `forgejo-actions` and `gitea-actions`, they will also need to be renamed before the upgrade. They are now reserved names for the experimental internal CI/CD named `Actions`. + + * [Semantic version](https://forgejo.org/docs/latest/user/semver) + + Since v1.18.5, in addition to the Forgejo release number, a [semantic version](https://semver.org/#semantic-versioning-200) number (e.g. `v3.0.0`) can be obtained from the `number` key of a new `/api/forgejo/v1/version` endpoint. + + Now, it reflects the Gitea version that Forgejo depends on, is no longer prefixed with `v` (e.g. `3.0.0+0-gitea-1.19.0`), and can be obtained from the `version` key of the same endpoint. +* Features + + * [Documentation](https://forgejo.org/docs/latest/) + The first version of the [Forgejo documentation](https://forgejo.org/docs/latest/) is available and covers the administration of Forgejo, from installation to troubleshooting. + + [Read more about semantic versions](https://forgejo.codeberg.page/docs/v1.19/user/semver) + + * [Webhook authorization header](https://codeberg.org/forgejo/forgejo/commit/b6e81357bd6fb80f8ba94c513f89a210beb05313) + Forgejo webhooks can be configured to send an [authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) to the target. + + [Read more about the webhook authorization header](https://forgejo.codeberg.page/docs/v1.19/user/webhooks/#authorization-header) + + * [Incoming emails](https://codeberg.org/forgejo/forgejo/commit/fc037b4b825f0501a1489e10d7c822435d825cb7) + You can now set up Forgejo to receive incoming email. When enabled, it is now possible to reply to an email notification from Forgejo and: + * Add a comment to an issue or a pull request + * Unsubscribe to the notifications + + [Read more about incoming emails](https://forgejo.org/docs/v1.19/admin/incoming-email/) + + * Packages registries + * Support for [Cargo](https://forgejo.org/docs/v1.19/admin/packages/cargo/), [Conda](https://forgejo.org/docs/v1.19/admin/packages/conda/) and [Chef](https://forgejo.org/docs/v1.19/admin/packages/chef/) + * [Cleanup rules](https://codeberg.org/forgejo/forgejo/commit/32db62515) + * [Quota limits](https://codeberg.org/forgejo/forgejo/commit/20674dd05) + + * [Option to prohibit fork if user reached maximum limit of repositories](https://codeberg.org/forgejo/forgejo/commit/7cc7db73b) + It is possible for a user to create as many fork as they want, even when a quota on the number of repositories is imposed. The new `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT` setting can now be set to `false` so forks are prohibited if that means exceeding the quota. + + [Read more about repository configurations](https://forgejo.org/docs/v1.19/admin/config-cheat-sheet/#repository-repository) + + * [Scoped labels](https://codeberg.org/forgejo/forgejo/commit/6221a6fd5) + Labels that contain a forward slash (**/**) separator are displayed with a slightly different color before and after the separator, as a visual aid. The first part of the label defines its "scope". + + [Read more about scoped labels](https://forgejo.org/docs/v1.19/user/labels/). + + * [Support org/user level projects](https://codeberg.org/forgejo/forgejo/commit/6fe3c8b39) + It is now possible to create projects (kanban boards) for an organization or a user, in the same way it was possible for an individual repository. + + * [Map OIDC groups to Orgs/Teams](https://codeberg.org/forgejo/forgejo/commit/e8186f1c0) + When a user logs in Forgejo using an provider such as [Keycloak](https://www.keycloak.org/), they can now automatically be part of a Forgejo team, depending on the OIDC group they belong to. For instance: + + ```json + {"Developer": {"MyForgejoOrganization": ["MyForgejoTeam1", "MyForgejoTeam2"]}} + ``` + + Means that the user who is in the OIDC group `Developer` will automatically be a member of the `MyForgejoTeam1` and `MyForgejoTeam2` teams in the `MyForgejoOrganization` organization. + This mapping is set when adding a new `Authentication Source` in the `Site Administration` panel. + + OIDC Group mapping part1 + + ... + + OIDC Group mapping part2 + + [Read more about OIDC groups mapping](https://forgejo.org/docs/v1.19/user/oauth2-provider/#endpoints) + + * [RSS feed for releases and tags](https://codeberg.org/forgejo/forgejo/commit/48d71b7d6) + + A RSS feed is now available for releases at `/{owner}/{repo}/releases.rss` and tags at `/{owner}/{repo}/tags.rss`. + + * [Supports wildcard protected branch](https://codeberg.org/forgejo/forgejo/commit/2782c1439) + + Instead of selecting a branch to be protected, the name of the branch must be specified and can be a pattern such as `precious*`. + + [Read more about branch protection](https://forgejo.org/docs/v1.19/user/protection/#protected-branches). + + * [Garbage collect LFS](https://codeberg.org/forgejo/forgejo/commit/651fe4bb7) + Add a doctor command for full garbage collection of LFS: `forgejo doctor --run gc-lfs`. + + * Additions to the API + + * [Management for issue/pull and comment attachments](https://codeberg.org/forgejo/forgejo/commit/3c59d31bc) + * [Get latest release](https://codeberg.org/forgejo/forgejo/commit/4d072a4c4) + * [System hook](https://codeberg.org/forgejo/forgejo/commit/c0015979a) + + * [Option to disable releases on a repository](https://codeberg.org/forgejo/forgejo/commit/faa96553d) + + It is now possible to disable releases on a repository, in the same way it is possible to disable issues or packages. + + * [Git reflog support](https://codeberg.org/forgejo/forgejo/commit/757b4c17e) + The [git reflog](https://git-scm.com/docs/git-reflog) are now active by default on all repositories and + kept around for 90 days. It allows the Forgejo admin to recover the previous tip of a branch after an + accidental force push. + + [Read more about reflog](https://forgejo.org/docs/v1.19/admin/config-cheat-sheet/#git---reflog-settings-gitreflog) + + * [Actions](https://codeberg.org/forgejo/forgejo/commit/4011821c946e8db032be86266dd9364ccb204118): an experimental CI/CD + + It appears for the first time in this Forgejo release but is not yet fit for production. It is not fully implemented and may be insecure. However, as long as it is not enabled, it presents no risk to existing Forgejo instances. + + If a repository has a file such as `.forgejo/workflows/test.yml`, it will be interpreted, for instance to run tests and verify the code in the repository works as expected (Continuous Integration). It can also be used to create HTML pages for a website and publish them (Continous Deployment). The syntax is similar to GitHub Actions and the jobs can be controled from the Forgejo web interface. + + [Read more about Forgejo Actions](https://forgejo.codeberg.page/2023-02-27-forgejo-actions/) + + Actions + +* User Interface improvements + + * [Review box on small screens](https://codeberg.org/forgejo/forgejo/commit/1fcf96ad0) + The rendering of the review box is improved on small screens. + + * [Video element enabled in markdown](https://codeberg.org/forgejo/forgejo/commit/f8a40dafb) + The `