diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index be34bfd02d..9e290fb6a5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Gitea DevContainer", - "image": "mcr.microsoft.com/devcontainers/go:1.20", + "image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye", "features": { // installs nodejs into container "ghcr.io/devcontainers/features/node:1": { @@ -23,7 +23,8 @@ "Vue.volar", "ms-azuretools.vscode-docker", "zixuanchen.vitest-explorer", - "qwtel.sqlite-viewer" + "qwtel.sqlite-viewer", + "GitHub.vscode-pull-request-github" ] } }, diff --git a/.dockerignore b/.dockerignore index 2a41420889..80cbeb040c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -75,10 +75,10 @@ cpu.out /yarn.lock /yarn-error.log /npm-debug.log* -/public/js -/public/css -/public/fonts -/public/img/webpack +/public/assets/js +/public/assets/css +/public/assets/fonts +/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* diff --git a/.drone.yml b/.drone.yml index 5d4e13038b..3084351770 100644 --- a/.drone.yml +++ b/.drone.yml @@ -41,11 +41,10 @@ steps: path: /go - name: static - image: techknowlogick/xgo:go-1.20.x + image: techknowlogick/xgo:go-1.21.x pull: always commands: - # Upgrade to node 20 once https://github.com/techknowlogick/xgo/issues/163 is resolved - - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs + - curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get -qqy install nodejs - export PATH=$PATH:$GOPATH/bin - make release environment: @@ -155,7 +154,7 @@ steps: when: event: exclude: - - pull_request + - pull_request - name: publish-rootless image: plugins/docker:latest @@ -177,7 +176,7 @@ steps: when: event: exclude: - - pull_request + - pull_request --- kind: pipeline @@ -221,7 +220,7 @@ steps: when: event: exclude: - - pull_request + - pull_request - name: publish-rootless image: plugins/docker:latest @@ -242,7 +241,7 @@ steps: when: event: exclude: - - pull_request + - pull_request --- kind: pipeline @@ -290,7 +289,7 @@ steps: when: event: exclude: - - pull_request + - pull_request - name: publish-rootless image: plugins/docker:latest @@ -312,7 +311,7 @@ steps: when: event: exclude: - - pull_request + - pull_request --- kind: pipeline @@ -356,7 +355,7 @@ steps: when: event: exclude: - - pull_request + - pull_request - name: publish-rootless image: plugins/docker:latest @@ -377,7 +376,7 @@ steps: when: event: exclude: - - pull_request + - pull_request --- kind: pipeline @@ -414,7 +413,7 @@ steps: trigger: ref: - - "refs/tags/**" + - "refs/tags/**" paths: exclude: - "docs/**" diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 8b9123c988..846823abc7 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -156,7 +156,7 @@ rules: import/no-restricted-paths: [0] import/no-self-import: [2] import/no-unassigned-import: [0] - import/no-unresolved: [2, {commonjs: true, ignore: [\?.+$, ^vitest/]}] + import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}] import/no-unused-modules: [2, {unusedExports: true}] import/no-useless-path-segments: [2, {commonjs: true}] import/no-webpack-loader-syntax: [2] @@ -420,9 +420,8 @@ rules: no-restricted-exports: [0] no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename] no-restricted-imports: [0] - no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement] + no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression] no-return-assign: [0] - no-return-await: [0] no-script-url: [2] no-self-assign: [2, {props: true}] no-self-compare: [2] @@ -666,7 +665,6 @@ rules: unicorn/no-unnecessary-await: [2] unicorn/no-unreadable-array-destructuring: [0] unicorn/no-unreadable-iife: [2] - unicorn/no-unsafe-regex: [0] unicorn/no-unused-properties: [2] unicorn/no-useless-fallback-in-spread: [2] unicorn/no-useless-length-check: [2] diff --git a/.gitattributes b/.gitattributes index 7e7a139c9a..467b8a47b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ * text=auto eol=lf *.tmpl linguist-language=Handlebars /assets/*.json linguist-generated -/public/img/svg/*.svg linguist-generated +/public/assets/img/svg/*.svg linguist-generated /templates/swagger/v1_json.tmpl linguist-generated /vendor/** -text -eol linguist-vendored /web_src/fomantic/build/** linguist-generated diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md index 95b97e4de5..9ad186cca7 100644 --- a/.gitea/issue_template.md +++ b/.gitea/issue_template.md @@ -5,7 +5,7 @@ 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.io/en-us/faq) + 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. --> @@ -26,7 +26,7 @@ - [ ] No - Log gist: - + ## Description diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 9dacad0d5f..c482affbbd 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -1,94 +1,91 @@ name: Bug Report description: Found something you weren't expecting? Report it here! -labels: kind/bug +labels: ["kind/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.io/en-us/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. You must give us DEBUG level logs. - Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems - In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -- 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.io/en-us/logging-configuration/#debugging-problems - 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 - - MSSQL - - SQLite + - 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 index 9bb5bb8e88..e769873f47 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -8,9 +8,9 @@ contact_links: 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. + about: Questions and configuration or deployment problems can also be discussed on our forum. - name: Frequently Asked Questions - url: https://docs.gitea.io/en-us/faq + 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 diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml index b481e0c2de..71aaa09423 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -2,23 +2,23 @@ name: Feature Request description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here! labels: ["kind/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 + - 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 index 80db52d7f1..ef0a1014e5 100644 --- a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml @@ -2,65 +2,65 @@ name: Web Interface Bug Report description: Something doesn't look quite as it should? Report it here! labels: ["kind/bug", "kind/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.io/en-us/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.io/en-us/logging-configuration/#debugging-problems) -- 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 + - 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/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..ee6c7d6ae8 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,32 @@ +kind/docs: + - "**/*.md" + - "docs/**" + +kind/ui: + - "web_src/**/*" + - all: ["templates/**", "!templates/swagger/v1_json.tmpl"] + +kind/api: + - "templates/swagger/v1_json.tmpl" + - "routers/api/**" + +kind/build: + - "Makefile" + - "Dockerfile" + - "Dockerfile.rootless" + - "docker/**" + - "webpack.config.js" + +theme/package-registry: + - "modules/packages/**" + +kind/cli: + - "cmd/**" + +kind/lint: + - ".eslintrc.yaml" + - ".golangci.yml" + - ".markdownlint.yaml" + - ".spectral.yaml" + - ".stylelintrc.yaml" + - ".yamllint.yaml" diff --git a/.github/stale.yml b/.github/stale.yml index 6a9f341cbf..ebe95acf53 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -9,8 +9,8 @@ daysUntilClose: 14 # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - - status/blocked - - kind/security + - status/blocked + - kind/security - lgtm/done - reviewed/confirmed - priority/critical @@ -27,7 +27,7 @@ staleLabel: stale # Comment to post when marking as stale. Set to `false` to disable markComment: > - This issue has been automatically marked as stale because it has not had recent activity. + This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index 700d45a3c8..acdf7cd364 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - run: make generate-license generate-gitignore timeout-minutes: 40 diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 0c382567cc..48db7a732e 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -17,6 +17,8 @@ on: value: ${{ jobs.detect.outputs.docker }} swagger: value: ${{ jobs.detect.outputs.swagger }} + yaml: + value: ${{ jobs.detect.outputs.yaml }} jobs: detect: @@ -30,6 +32,7 @@ jobs: templates: ${{ steps.changes.outputs.templates }} docker: ${{ steps.changes.outputs.docker }} swagger: ${{ steps.changes.outputs.swagger }} + yaml: ${{ steps.changes.outputs.yaml }} steps: - uses: actions/checkout@v3 - uses: dorny/paths-filter@v2 @@ -43,6 +46,8 @@ jobs: - "go.mod" - "go.sum" - "Makefile" + - ".golangci.yml" + - ".editorconfig" frontend: - "**/*.js" @@ -51,16 +56,21 @@ jobs: - "package.json" - "package-lock.json" - "Makefile" + - ".eslintrc.yaml" + - ".stylelintrc.yaml" + - ".npmrc" docs: - "**/*.md" - "docs/**" + - ".markdownlint.yaml" actions: - ".github/workflows/*" templates: - "templates/**/*.tmpl" + - "pyproject.toml" - "poetry.lock" docker: @@ -71,3 +81,12 @@ jobs: swagger: - "templates/swagger/v1_json.tmpl" + - "Makefile" + - "package.json" + - "package-lock.json" + - ".spectral.yaml" + + yaml: + - "**/*.yml" + - "**/*.yaml" + - ".yamllint.yaml" diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index c8bef283a9..bcbd218846 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - run: make deps-backend deps-tools - run: make lint-backend @@ -39,6 +39,19 @@ jobs: - 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@v3 + - 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 @@ -59,7 +72,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - run: make deps-backend deps-tools - run: make lint-go-windows lint-go-vet @@ -76,7 +89,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - run: make deps-backend deps-tools - run: make lint-go @@ -91,7 +104,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + 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 @@ -119,7 +132,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true # no frontend build here as backend should be able to build # even without any frontend files @@ -154,7 +167,7 @@ jobs: node-version: 20 - run: make deps-frontend - run: make lint-md - - run: make docs # test if build could succeed + - run: make docs actions: if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true' diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 12e5e64e80..bbe589d5c8 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" 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' @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - run: make deps-backend - run: make backend @@ -88,7 +88,7 @@ jobs: mysql: image: mysql:5.7 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ALLOW_EMPTY_PASSWORD: true MYSQL_DATABASE: test ports: - "3306:3306" @@ -98,6 +98,12 @@ jobs: discovery.type: single-node ports: - "9200:9200" + meilisearch: + image: getmeili/meilisearch:v1.2.0 + env: + MEILI_ENV: development # disable auth + ports: + - "7700:7700" smtpimap: image: tabascoterrier/docker-imap-devel:latest ports: @@ -125,10 +131,10 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" 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: '[ -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: @@ -154,7 +160,7 @@ jobs: mysql: image: mysql:5.7 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ALLOW_EMPTY_PASSWORD: true MYSQL_DATABASE: test ports: - "3306:3306" @@ -175,7 +181,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" 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' @@ -199,7 +205,7 @@ jobs: mysql8: image: mysql:8 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ALLOW_EMPTY_PASSWORD: true MYSQL_DATABASE: testgitea ports: - "3306:3306" @@ -207,7 +213,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts' @@ -238,7 +244,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" 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' diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml index 6577cfd240..7b950bfd38 100644 --- a/.github/workflows/pull-e2e-tests.yml +++ b/.github/workflows/pull-e2e-tests.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/pull-labeler.yml b/.github/workflows/pull-labeler.yml new file mode 100644 index 0000000000..c62142b9d2 --- /dev/null +++ b/.github/workflows/pull-labeler.yml @@ -0,0 +1,21 @@ +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 + sync-labels: true diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 0e94f5217c..8387f615d9 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -14,7 +14,7 @@ jobs: - run: git fetch --unshallow --quiet --tags --force - uses: actions/setup-go@v4 with: - go-version: ">=1.20" + go-version: "~1.21" check-latest: true - uses: actions/setup-node@v3 with: diff --git a/.gitignore b/.gitignore index 6851be742c..e3b9c3c43e 100644 --- a/.gitignore +++ b/.gitignore @@ -72,10 +72,11 @@ cpu.out /yarn.lock /yarn-error.log /npm-debug.log* -/public/js -/public/css -/public/fonts -/public/img/webpack +/public/assets/js +/public/assets/css +/public/assets/fonts +/public/assets/licenses.txt +/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* diff --git a/.gitpod.yml b/.gitpod.yml index 000f534e85..35b22c45ae 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -35,6 +35,7 @@ vscode: - ms-azuretools.vscode-docker - zixuanchen.vitest-explorer - qwtel.sqlite-viewer + - GitHub.vscode-pull-request-github ports: - name: Gitea diff --git a/.golangci.yml b/.golangci.yml index 7c35bdd2a8..069dc13c99 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,7 +29,7 @@ linters: fast: false run: - go: "1.20" + go: "1.21" timeout: 10m skip-dirs: - node_modules @@ -75,7 +75,7 @@ linters-settings: - name: modifies-value-receiver gofumpt: extra-rules: true - lang-version: "1.20" + lang-version: "1.21" depguard: rules: main: diff --git a/.ignore b/.ignore index cd869d51cb..5c945ab981 100644 --- a/.ignore +++ b/.ignore @@ -5,4 +5,5 @@ /modules/public/bindata.go /modules/templates/bindata.go /vendor +/public/assets node_modules diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index a96589f1e8..f30d79d71f 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -84,6 +84,7 @@ rules: media-feature-name-value-allowed-list: null media-feature-name-value-no-unknown: true media-feature-range-notation: null + media-query-no-invalid: true named-grid-areas-no-invalid: true no-descending-specificity: null no-duplicate-at-import-rules: true diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000000..c0fce7c301 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,48 @@ +extends: default + +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + brackets: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + comments: + require-starting-space: true + ignore-shebangs: true + min-spaces-from-content: 1 + + comments-indentation: + level: error + + document-start: + level: error + present: false + ignore: | + /.drone.yml + + document-end: + present: false + + empty-lines: + max: 1 + + indentation: + spaces: 2 + + line-length: disable + + truthy: + allowed-values: ["true", "false", "on", "off"] + +ignore: | + .venv + node_modules + /models/fixtures + /models/migrations/fixtures diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d3aa3a8b..8ef677b88c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,766 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has -been added to each release, please refer to the [blog](https://blog.gitea.io). +been added to each release, please refer to the [blog](https://blog.gitea.com). + +## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08 + +* SECURITY + * Check blocklist for emails when adding them to account (#26812) (#26831) +* ENHANCEMENTS + * Add `branch_filter` to hooks API endpoints (#26599) (#26632) + * Fix incorrect "tabindex" attributes (#26733) (#26734) + * Use line-height: normal by default (#26635) (#26708) + * Fix unable to display individual-level project (#26198) (#26636) +* BUGFIXES + * Fix wrong review requested number (#26784) (#26880) + * Avoid double-unescaping of form value (#26853) (#26863) + * Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled (#26813) (#26847) + * Sync tags when adopting repos (#26816) (#26834) + * Fix verifyCommits error when push a new branch (#26664) (#26810) + * Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806) + * Fix some slice append usages (#26778) (#26798) + * Add fix incorrect can_create_org_repo for org owner team (#26683) (#26791) + * Fix bug for ctx usage (#26763) + * Make issue template field template access correct template data (#26698) (#26709) + * Use correct minio error (#26634) (#26639) + * Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) + * Set errwriter for urfave/cli v1 (#26616) + * Fix reopen logic for agit flow pull request (#26399) (#26613) + * Fix context filter has no effect in dashboard (#26695) (#26811) + * Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785) (#26790) + * Fix Page Not Found error (#26768) + +## [1.20.3](https://github.com/go-gitea/gitea/releases/tag/v1.20.3) - 2023-08-20 + +* BREAKING + * Fix the wrong derive path (#26271) (#26318) +* SECURITY + * Fix API leaking Usermail if not logged in (#25097) (#26350) +* FEATURES + * Add ThreadID parameter for Telegram webhooks (#25996) (#26480) +* ENHANCEMENTS + * Add minimum polyfill to support "relative-time-element" in PaleMoon (#26575) (#26578) + * Fix dark theme highlight for "NameNamespace" (#26519) (#26527) + * Detect ogg mime-type as audio or video (#26494) (#26505) + * Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498) + * Move dropzone progress bar to bottom to show filename when uploading (#26492) (#26497) + * Remove last newline from config file (#26468) (#26471) + * Minio: add missing region on client initialization (#26412) (#26438) + * Add pull request review request webhook event (#26401) (#26407) + * Fix text truncate (#26354) (#26384) + * Fix incorrect color of selected assignees when create issue (#26324) (#26372) + * Display human-readable text instead of cryptic filemodes (#26352) (#26358) + * Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345) + * Fix the topic validation rule and suport dots (#26286) (#26303) + * Fix due date rendering the wrong date in issue (#26268) (#26274) + * Don't autosize textarea in diff view (#26233) (#26244) + * Fix commit compare style (#26209) (#26226) + * Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211) +* BUGFIXES + * Use "input" event instead of "keyup" event for migration form (#26602) (#26605) + * Do not use deprecated log config options by default (#26592) (#26600) + * Fix "issueReposQueryPattern does not match query" (#26556) (#26564) + * Sync repo's IsEmpty status correctly (#26517) (#26560) + * Fix project filter bugs (#26490) (#26558) + * Use `hidden` over `clip` for text truncation (#26520) (#26522) + * Set "type=button" for editor's toolbar buttons (#26510) (#26518) + * Fix NuGet search endpoints (#25613) (#26499) + * Fix storage path logic especially for relative paths (#26441) (#26481) + * Close stdout correctly for "git blame" (#26470) (#26473) + * Check first if minio bucket exists before trying to create it (#26420) (#26465) + * Avoiding accessing undefined tributeValues #26461 (#26462) + * Call git.InitSimple for runRepoSyncReleases (#26396) (#26450) + * Add transaction when creating pull request created dirty data (#26259) (#26437) + * Fix wrong middleware sequence (#26428) (#26436) + * Fix admin queue page title and fix CI failures (#26409) (#26421) + * Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405) + * Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) + * Fix incorrect CLI exit code and duplicate error message (#26346) (#26347) + * Prevent newline errors with Debian packages (#26332) (#26342) + * Fix bug with sqlite load read (#26305) (#26339) + * Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330) + * Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316) + * Clarify the logger's MODE config option (#26267) (#26281) + * Use shared template for webhook icons (#26242) (#26246) + * Fix pull request check list is limited (#26179) (#26245) + * Fix attachment clipboard copy on insecure origin (#26224) (#26231) + * Fix access check for org-level project (#26182) (#26223) +* MISC + * Improve profile readme rendering (#25988) (#26453) + * [docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357) + * Upgrade x/net to 0.13.0 (#26301) + +## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/v1.20.2) - 2023-07-29 + +* ENHANCEMENTS + * Calculate MAX_WORKERS default value by CPU number (#26177) (#26183) + * Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154) +* BUGFIXES + * Fix allowed user types setting problem (#26200) (#26206) + * Fix handling of plenty Nuget package versions (#26075) (#26173) + * Fix UI regression of asciinema player (#26159) (#26162) + * Fix LFS object list style (#26133) (#26147) + * Fix allowed user types setting problem (#26200) (#26206) + * Prevent primary key update on migration (#26192) (#26199) + * Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158) + * Fix bugs in LFS meta garbage collection (#26122) (#26157) + * Update xorm version (#26128) (#26150) + * Remove "misc" scope check from public API endpoints (#26134) (#26149) + * Fix CLI allowing creation of access tokens with existing name (#26071) (#26144) + * Fix incorrect router logger (#26137) (#26143) + * Improve commit graph alignment and truncating (#26112) (#26127) + * Avoid writing config file if not installed (#26107) (#26113) + * Fix escape problems in the branch selector (#25875) (#26103) + * Fix handling of Debian files with trailing slash (#26087) (#26098) + * Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089) + * Use stderr as fallback if the log file can't be opened (#26074) (#26083) + * Increase table cell horizontal padding (#26140) (#26142) + * Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124) + * Fix duplicated url prefix on issue context menu (#26066) (#26067) + +## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/v1.20.1) - 2023-07-22 + +* SECURITY + * Disallow dangerous URL schemes (#25960) (#25964) +* ENHANCEMENTS + * Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972) + * Make pending commit status yellow again (#25935) (#25968) +* BUGFIXES + * Fix version in rpm repodata/primary.xml.gz (#26009) (#26048) + * Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013) + * ParseScope with owner/repo always sets owner to zero (#25987) (#25989) + * Fix SSPI auth panic (#25955) (#25969) + * Avoid creating directories when loading config (#25944) (#25957) + * Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937) + * Ignore `runs-on` with expressions when warning no matched runners (#25917) (#25933) + * Avoid opening/closing PRs which are already merged (#25883) (#25903) +* DOCS + * RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020) + * Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019) + * Update path related documents (#25417) (#25982) +* MISC + * Adding remaining enum for migration repo model type. (#26021) (#26034) + * Fix the route for pull-request's authors (#26016) (#26018) + * Fix commit status color on dashboard repolist (#25993) (#25998) + * Avoid hard-coding height in language dropdown menu (#25986) (#25997) + * Add shutting down notice (#25920) (#25922) + * Fix incorrect milestone count when provide a keyword (#25880) (#25904) + +## [1.20.0](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) - 2023-07-16 + +* BREAKING + * Fix WORK_DIR for docker (root) image (#25738) (#25811) + * Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604) + * Refactor path & config system (#25330) (#25416) + * Fix all possible setting error related storages and added some tests (#23911) (#25244) + * Use a separate admin page to show global stats, remove `actions` stat (#25062) + * Remove the service worker (#25010) + * Remove meta tags `theme-color` and `default-theme` (#24960) + * Use `[git.config]` for reflog cleaning up (#24958) + * Allow all URL schemes in Markdown links by default (#24805) + * Redesign Scoped Access Tokens (#24767) + * Fix team members API endpoint pagination (#24754) + * Rewrite logger system (#24726) + * Increase default LFS auth timeout from 20m to 24h (#24628) + * Rewrite queue (#24505) + * Remove unused setting `time.FORMAT` (#24430) + * Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) + * Correct the access log format (#24085) + * Reserve ".png" suffix for user/org names (#23992) + * Prefer native parser for SSH public key parsing (#23798) + * Editor preview support for external renderers (#23333) + * Add Gitea Profile Readmes (#23260) + * Refactor `ctx` in templates (#23105) +* SECURITY + * Test if container blob is accessible before mounting (#22759) (#25784) + * Set type="password" on all auth_token fields (#22175) +* FEATURES + * Add button on diff header to copy file name, misc diff header tweaks (#24986) + * API endpoint for changing/creating/deleting multiple files (#24887) + * Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860) + * Add up and down arrows to selected lookup repositories (#24727) + * Add Go package registry (#24687) + * Add status indicator on main home screen for each repo (#24638) + * Support for status check pattern (#24633) + * Implement Cargo HTTP index (#24452) + * Add Debian package registry (#24426) + * Add the ability to pin Issues (#24406) + * Add follow organization and fix the logic of following page (#24345) + * Allow `webp` images as avatars (#24248) + * Support upload `outputs` and use `needs` context on Actions (#24230) + * Allow adding new files to an empty repo (#24164) + * Make wiki title supports dashes and improve wiki name related features (#24143) + * Add monospace toggle button to textarea (#24034) + * Use auto-updating, natively hoverable, localized time elements (#23988) + * Add ntlm authentication support for mail (#23811) + * Add CLI command to register runner tokens (#23762) + * Add Alpine package registry (#23714) + * Expand/Collapse all changed files (#23639) + * Add unset default project column (#23531) + * Add activity feeds API (#23494) + * Add RPM registry (#23380) + * Add meilisearch support (#23136) + * Add API for License templates (#23009) + * Add admin API email endpoints (#22792) + * Add user rename endpoint to admin api (#22789) + * Add API for gitignore templates (#22783) + * Implement actions artifacts (#22738) + * Add RSS Feeds for branches and files (#22719) + * Display when a repo was archived (#22664) + * Add Swift package registry (#22404) + * Add CRAN package registry (#22331) + * Add user webhooks (#21563) + * Implement systemd-notify protocol (#21151) + * Implement Issue Config (#20956) + * Add API to manage issue dependencies (#17935) +* API + * Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571) + * Fix `Permission` in API returned repository struct (#25388) (#25441) + * Add API for Label templates (#24602) + * Filters for GetAllCommits (#24568) + * Add ability to specify '--not' from GetAllCommits (#24409) + * Support uploading file to empty repo by API (#24357) + * Add absent repounits to create/edit repo API (#23500) + * Add login name and source id for admin user searching API (#23376) + * Create a branch directly from commit on the create branch API (#22956) +* ENHANCEMENTS + * Make `add line comment` buttons focusable (#25894) (#25896) + * Always pass 6-digit hex color to monaco (#25780) (#25782) + * Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764) + * Hide `add file` button for pull mirrors (#25748) (#25751) + * Allow/fix review (approve/reject) of empty PRs (#25690) (#25732) + * Fix tags header and pretty format numbers (#25624) (#25694) + * Actions list enhancements (#25601) (#25678) + * Fix show more for image on diff page (#25672) (#25673) + * Prevent SVG shrinking (#25652) (#25669) + * Fix UI misalignment on user setting page (#25629) (#25656) + * Use css on labels (#25626) (#25636) + * Read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602) + * Redirect to package after version deletion (#25594) (#25599) + * Reduce table padding globally (#25568) (#25577) + * Change `Regenerate Secret` button display (#25534) (#25541) + * Fix rerun icon on action view component (#25531) (#25536) + * Move some regexp out of functions (#25430) (#25445) + * Diff page enhancements (#25398) (#25437) + * Various UI fixes (#25264) (#25431) + * Fix label list divider (#25312) (#25372) + * Fix UI on mobile view (#25315) (#25340) + * When viewing a file, hide the add button (#25320) (#25339) + * Show if File is Executable (#25287) (#25300) + * Fix edit OAuth application width (#25262) (#25263) + * Use flex to align SVG and text (#25163) (#25260) + * Revert overflow: overlay (revert #21850) (#25231) (#25239) + * Use inline SVG for built-in OAuth providers (#25171) (#25234) + * Change access token UI to select dropdowns (#25109) (#25230) + * Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211) + * Minor arc-green color tweaks (#25175) (#25205) + * Button and color enhancements (#24989) (#25176) + * Fix mobile navbar and misc cleanups (#25134) (#25169) + * Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161) + * Improve notification icon and navbar (#25111) (#25124) + * Add details summary for vertical menus in settings to allow toggling (#25098) + * Don't display `select all issues` checkbox when no issues are available (#25086) + * Use RepositoryList instead of []*Repository (#25074) + * Add ability to set multiple redirect URIs in OAuth application UI (#25072) + * Use git command instead of the ini package to remove the `origin` remote (#25066) + * Remove cancel button from branch protection form (#25063) + * Show file tree by default (#25052) + * Add Progressbar to Milestone Page (#25050) + * Minor UI improvements: logo alignment, auth map editor, auth name display (#25043) + * Allow for PKCE flow without client secret + add docs (#25033) + * Refactor INI package (first step) (#25024) + * Various style fixes (#25008) + * Fix delete user account modal (#25004) + * Refactor diffFileInfo / DiffTreeStore (#24998) + * Add user level action runners (#24995) + * Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988) + * Add step start time to `ViewStepLog` (#24980) + * Add dark mode to API Docs (#24971) + * Display file mode for new file and file mode changes (#24966) + * Make the 500 page load themes (#24953) + * Show `bot` label next to username when rendering autor link if the user is a bot (#24943) + * Repo list improvements, fix bold helper classes (#24935) + * Improve queue and logger context (#24924) + * Improve RunMode / dev mode (#24886) + * Improve some Forms (#24878) + * Add show timestamp/seconds and fullscreen options to action page (#24876) + * Fix double border and adjust width for user profile page (#24870) + * Improve Actions CSS (#24864) + * Fix `@font-face` overrides (#24855) + * Remove `In your repositories` link in milestones dashboard (#24853) + * Fix missing yes/no in delete time log modal (#24851) + * Show new pull request button also on subdirectories and files (#24842) + * Make environment-to-ini support loading key value from file (#24832) + * Support wildcard in email domain allow/block list (#24831) + * Use `CommentList` instead of `[]*Comment` (#24828) + * Add RTL rendering support to Markdown (#24816) + * Rework notifications list (#24812) + * Mute repo names in dashboard repo list (#24811) + * Fix max width and margin of comment box on conversation page (#24809) + * Some refactors for issues stats (#24793) + * Rework label colors (#24790) + * Fix OAuth login loading state (#24788) + * Remove duplicated issues options and some more refactors (#24787) + * Decouple the different contexts from each other (#24786) + * Remove background on user dashboard filter bar (#24779) + * Improve and fix bugs surrounding reactions (#24760) + * Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758) + * Fix WEBP image copying (#24743) + * Rework OAuth login buttons, swap github logo to monocolor (#24740) + * Consolidate the two review boxes into one (#24738) + * Unification of registration fields order (#24737) + * Refactor Pull Mirror and fix out-of-sync bugs (#24732) + * Improvements for action detail page (#24718) + * Fix flash of unstyled content in action view page (#24712) + * Don't filter action runs based on state (#24711) + * Optimize actions list by removing an unnecessary `git` call (#24710) + * Support no label/assignee filter and batch clearing labels/assignees (#24707) + * Add icon support for safari (#24697) + * Use standard HTTP library to serve files (#24693) + * Improve button-ghost, remove tertiary button (#24692) + * Only hide tooltip tippy instances (#24688) + * Support migrating storage for actions log via command line (#24679) + * Remove highlight in repo list (#24675) + * Add markdown preview to Submit Review Textarea (#24672) + * Update pin and add pin-slash (#24669) + * Improve empty notifications display (#24668) + * Support SSH for go get (#24664) + * Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) + * Only show one tippy at a time (#24648) + * Notification list enhancements, fix striped tables on dark theme (#24639) + * Improve queue & process & stacktrace (#24636) + * Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) + * Remove fluid on compare diff page (#24627) + * Add a tooltip to the job rerun button (#24617) + * Attach a tooltip to the action status icon (#24614) + * Make the actions control button look like an actual button (#24611) + * Remove unnecessary code (#24610) + * Make repo migration cancelable and fix various bugs (#24605) + * Improve updating Actions tasks (#24600) + * Attach a tooltip to the action control button (#24595) + * Make repository response support HTTP range request (#24592) + * Improve Gitea's web context, decouple "issue template" code into service package (#24590) + * Modify luminance calculation and extract related functions into single files (#24586) + * Simplify template helper functions (#24570) + * Split "modules/context.go" to separate files (#24569) + * Add org visibility label to non-organization's dashboard (#24558) + * Update LDAP filters to include both username and email address (#24547) + * Review fixes and enhancements (#24526) + * Display warning when user try to rename default branch (#24512) + * Fix color for transfer related buttons when having no permission to act (#24510) + * Rework button coloring, add focus and active colors (#24507) + * New webhook trigger for receiving Pull Request review requests (#24481) + * Add goto issue id function (#24479) + * Fix incorrect webhook time and use relative-time to display it (#24477) + * RSS icon fixes (#24476) + * Replace `N/A` with `-` everywhere (#24474) + * Pass 'not' to commit count (#24473) + * Enhance stylelint rule config, remove dead CSS (#24472) + * Remove `font-awesome` and fomantic `icon` module (#24471) + * Improve "new-menu" (#24465) + * Remove fomantic breadcrumb module (#24463) + * Improve template system and panic recovery (#24461) + * Make Issue/PR/projects more compact, misc CSS tweaks (#24459) + * Replace remaining fontawesome dropdown icons with SVG (#24455) + * Remove all direct references to font-awesome (#24448) + * Move links out of translation (#24446) + * Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442) + * Hide 'Mirror Settings' when unneeded, improve hints (#24433) + * Add "Updated" column for admin repositories list (#24429) + * Improve issue list filter (#24425) + * Rework header bar on issue, pull requests and milestone (#24420) + * Improve template helper (#24417) + * Make repo size style matches others (commits/branches/tags) (#24408) + * Support markdown editor for issue template (#24400) + * Improve commit date in commit graph (#24399) + * Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393) + * Merge setting.InitXXX into one function with options (#24389) + * Move `Rename branch` from repo settings page to the page of branches list (#24380) + * Improve protected branch setting page (#24379) + * Display 'Unknown' when runner.version is empty (#24378) + * Display owner of a runner as a tooltip instead of static text (#24377) + * Fix incorrect last online time in runner_edit.tmpl (#24376) + * Fix unclear `IsRepositoryExist` logic (#24374) + * Add custom helm repo name generated from url (#24363) + * Replace placeholders in licenses (#24354) + * Add rerun workflow button and refactor to use SVG octicons (#24350) + * Fix runner button height (#24338) + * Restore bold on repolist (#24337) + * Improve RSS (#24335) + * Refactor "route" related code, fix Safari cookie bug (#24330) + * Alert error message if open dependencies are included in the issues that try to batch close (#24329) + * Add missed column title in runner management page (#24328) + * Automatically select the org when click create repo from org dashboard (#24325) + * Modify width of ui container, fine tune css for settings pages and org header (#24315) + * Fix config list overflow and layout (#24312) + * Improve some modal action buttons (#24289) + * Move code from module to service (#24287) + * Sort users and orgs on explore by recency by default (#24279) + * Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) + * Show workflow config error on file view also (#24267) + * Improve template helper functions: string/slice (#24266) + * Use more specific test methods (#24265) + * Add `DumpVar` helper function to help debugging templates (#24262) + * Limit avatar upload to valid image files (#24258) + * Improve emoji and mention matching (#24255) + * Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246) + * Refactor config provider (#24245) + * Improve test logger (#24235) + * Default show closed actions list if all actions was closed (#24234) + * Add missing badges in user profile for /projects and /packages (#24232) + * Add repository counter badge to repository tab (#24205) + * Move secrets and runners settings to actions settings (#24200) + * Require at least one unit to be enabled (#24189) + * Use same action status svg icons on actions list as on action page (#24178) + * Use secondary pointing menu for tabs on user/organization home page (#24162) + * Improve Wiki TOC (#24137) + * Refactor locale number (#24134) + * Localize activity heatmap (except tooltip) (#24131) + * Fix duplicate modals when clicking on "remove all" repository button (#24129) + * Add runner check in repo action page (#24124) + * Support triggering workflows by wiki related events (#24119) + * Refactor cookie (#24107) + * Remove untranslatable `on_date` key (#24106) + * Refactor delete_modal_actions template and use it for project column related actions (#24097) + * Improve git log for debugging (#24095) + * Add option to search for users is active join a team (#24093) + * Add PDF rendering via PDFObject (#24086) + * Refactor web route (#24080) + * Make more functions use ctx instead of db.DefaultContext (#24068) + * Make HTML template functions support context (#24056) + * Refactor rename user and rename organization (#24052) + * Localize milestone related time strings (#24051) + * Expand selected file when clicking file tree (#24041) + * Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040) + * Add placeholder and aria attributes to release and wiki edit page (#24031) + * Add new user types `reserved`, `bot`, and `remote` (#24026) + * Allow adding SSH keys even if SSH server is disabled (#24025) + * Use a general approach to access custom/static/builtin assets (#24022) + * Update github.com/google/go-github to v52 (#24004) + * Replace tribute with text-expander-element for textarea (#23985) + * Group template helper functions, remove `Printf`, improve template error messages (#23982) + * Drop "unrolled/render" package (#23965) + * Add job.duration in web ui (#23963) + * Tweak pull request branch delete ui (#23951) + * Merge template functions "dict/Dict/mergeinto" (#23932) + * Use a general Eval function for expressions in templates. (#23927) + * Clean template/helper.go (#23922) + * Actions: Use default branch as ref when a branch/tag delete occurs (#23910) + * Add tooltips for MD editor buttons and add `muted` class for buttons (#23896) + * Improve markdown editor: width, height, preferred (#23895) + * Make Release Download URLs predictable (#23891) + * Remove fomantic ".link" selector and styles (#23888) + * Added close/open button to details page of milestone (#23877) + * Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) + * Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) + * Make first section on home page full width (#23854) + * Use different SVG for pending and running actions (#23836) + * Display image size for multiarch container images (#23821) + * Improve action log display with control chars (#23820) + * Fix dropdown direction behavior (#23806) + * Fix incorrect/Improve error handle in edit user page (#23805) + * Use clippie module to copy to clipboard (#23801) + * Make minio package support legacy MD5 checksum (#23768) + * Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) + * Refactor docs (#23752) + * Fix markup background, improve wiki rendering (#23750) + * Make label templates have consistent behavior and priority (#23749) + * Improve LoadUnitConfig to handle invalid or duplicate units (#23736) + * Append `(comment)` when a link points at a comment rather than the whole issue (#23734) + * Clean some legacy files and move some build files (#23699) + * Refactor repo commit list (#23690) + * Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) + * Add aria attributes to interactive time tooltips. (#23661) + * Fix long project name display in issue list and in related dropdown (#23653) + * Use data-tooltip-content for tippy tooltip (#23649) + * Fix new issue/pull request btn margin when it is next to sort (#23647) + * Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626) + * Allow new file and edit file preview if it has editable extension (#23624) + * Replace a few fontawesome icons with svg (#23602) + * `Publish Review` buttons should indicate why they are disabled (#23598) + * Convert issue list checkboxes to native (#23596) + * Set opaque background on markup and images (#23578) + * Use a general approach to show tooltip, fix temporary tooltip bug (#23574) + * Improve `` to make it output `svg` node and optimize performance (#23570) + * Enable color for consistency checks diffs (#23563) + * Fix dropdown icon misalignment when using fomantic icon (#23558) + * Decouple the issue-template code from comment_tab.tmpl (#23556) + * Remove `id="comment-form"` dead code, fix tag (#23555) + * Diff improvements (#23553) + * Sort Python package descriptors by version to mimic PyPI format (#23550) + * Use a general approch to improve a11y for all checkboxes and dropdowns. (#23542) + * Fix long name ui issues and label ui issue (#23541) + * Return `repository` in npm package metadata endpoint (#23539) + * Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538) + * Remove stars in dashboard repo list (#23530) + * Update mini-css-extract-plugin, remove postcss (#23520) + * Change `Close` to either `Close issue` or `Close pull request` (#23506) + * Fix theme-auto loading (#23504) + * Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) + * Display the version of runner in the runner list (#23490) + * Replace Less with CSS (#23481) + * Fix `.locale.Tr` function not found in delete modal (#23468) + * Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) + * Add project type descriptions in issue badge and improve project icons (#23437) + * Use context for `RepositoryList.LoadAttributes` (#23435) + * Refactor branch/tag selector to Vue SFC (#23421) + * Keep (add if not existing) xmlns attribute for generated SVG images (#23410) + * Refactor dashboard repo list to Vue SFC (#23405) + * Add workflow error notification in ui (#23404) + * Refactor branch/tag selector dropdown (first step) (#23394) + * Reduce duplicate and useless code in options (#23369) + * Convert `
` to ` diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index a0b6fd9bb0..4cf30f58e6 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -4,6 +4,12 @@ {{.locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .TotalCount}}, {{.locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}, {{.locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}}) +
+
+ {{.CsrfTokenHtml}} + +
+
@@ -56,8 +62,8 @@ {{end}} {{.Package.Type.Name}} - {{.Package.Name}} - + {{.Package.Name}} + {{.Version.Version}} {{.Creator.Name}} {{if .Repository}} diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl index 4ed9dbb9aa..efca8c1f2f 100644 --- a/templates/admin/queue.tmpl +++ b/templates/admin/queue.tmpl @@ -11,6 +11,7 @@ {{.locale.Tr "admin.monitor.queue.type"}} {{.locale.Tr "admin.monitor.queue.exemplar"}} {{.locale.Tr "admin.monitor.queue.numberworkers"}} + {{.locale.Tr "admin.monitor.queue.activeworkers"}} {{.locale.Tr "admin.monitor.queue.numberinqueue"}} @@ -21,9 +22,10 @@ {{$q.GetName}} {{$q.GetType}} {{$q.GetItemTypeName}} - {{$sum := $q.GetWorkerNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} - {{$sum = $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} - {{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}} + {{$q.GetWorkerNumber}} + {{$q.GetWorkerActiveNumber}} + {{$sum := $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} + {{$.locale.Tr "admin.monitor.queue.review_add"}} {{end}} diff --git a/templates/admin/queue_manage.tmpl b/templates/admin/queue_manage.tmpl index c8ae07a19a..a46d9462ec 100644 --- a/templates/admin/queue_manage.tmpl +++ b/templates/admin/queue_manage.tmpl @@ -11,6 +11,7 @@ {{.locale.Tr "admin.monitor.queue.type"}} {{.locale.Tr "admin.monitor.queue.exemplar"}} {{.locale.Tr "admin.monitor.queue.numberworkers"}} + {{.locale.Tr "admin.monitor.queue.activeworkers"}} {{.locale.Tr "admin.monitor.queue.maxnumberworkers"}} {{.locale.Tr "admin.monitor.queue.numberinqueue"}} @@ -20,10 +21,11 @@ {{.Queue.GetName}} {{.Queue.GetType}} {{.Queue.GetItemTypeName}} - {{$sum := .Queue.GetWorkerNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} - {{if lt $sum 0}}-{{else}}{{.Queue.GetWorkerMaxNumber}}{{end}} + {{.Queue.GetWorkerNumber}} + {{.Queue.GetWorkerActiveNumber}} + {{.Queue.GetWorkerMaxNumber}} - {{$sum = .Queue.GetQueueItemNumber}} + {{$sum := .Queue.GetQueueItemNumber}} {{if lt $sum 0}} - {{else}} diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index 15e51e4aca..b0e282bcc7 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -27,7 +27,7 @@
-
+
{{svg "octicon-code" 16}}{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}}
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 96e09156d1..e99a4532d3 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -159,7 +159,7 @@
{{.CsrfTokenHtml}} - {{if not (DisableGravatar $.Context)}} + {{if not .DisableGravatar}}
@@ -186,7 +186,7 @@
- +
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 3742b4ae85..b3e0caa169 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -68,36 +68,35 @@ {{.locale.Tr "email"}} {{.locale.Tr "admin.users.activated"}} - {{.locale.Tr "admin.users.admin"}} {{.locale.Tr "admin.users.restricted"}} {{.locale.Tr "admin.users.2fa"}} - {{.locale.Tr "admin.users.repos"}} {{.locale.Tr "admin.users.created"}} {{.locale.Tr "admin.users.last_login"}} {{SortArrow "lastlogin" "reverselastlogin" $.SortType false}} - {{.locale.Tr "admin.users.edit"}} {{range .Users}} {{.ID}} - {{.Name}} - + + {{.Name}} + {{if .IsAdmin}} + {{$.locale.Tr "admin.users.admin"}} + {{end}} + + {{.Email}} {{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} - {{if .IsAdmin}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} - {{.NumRepos}} {{DateTime "short" .CreatedUnix}} {{if .LastLoginUnix}} {{DateTime "short" .LastLoginUnix}} {{else}} {{$.locale.Tr "admin.users.never_login"}} {{end}} - {{svg "octicon-pencil"}} {{end}} diff --git a/templates/admin/user/view.tmpl b/templates/admin/user/view.tmpl new file mode 100644 index 0000000000..fd3017607c --- /dev/null +++ b/templates/admin/user/view.tmpl @@ -0,0 +1,48 @@ +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin view user")}} + +
+
+
+

+ {{.Title}} + +

+
+ {{template "admin/user/view_details" .}} +
+
+
+

+ {{ctx.Locale.Tr "admin.emails"}} +
+ {{.EmailsTotal}} +
+

+
+ {{template "admin/user/view_emails" .}} +
+
+
+

+ {{ctx.Locale.Tr "admin.repositories"}} +
+ {{.ReposTotal}} +
+

+
+ {{template "explore/repo_list" .}} +
+

+ {{ctx.Locale.Tr "settings.organization"}} +
+ {{.OrgsTotal}} +
+

+
+ {{template "explore/user_list" .}} +
+
+ +{{template "admin/layout_footer" .}} diff --git a/templates/admin/user/view_details.tmpl b/templates/admin/user/view_details.tmpl new file mode 100644 index 0000000000..ceb3b9a055 --- /dev/null +++ b/templates/admin/user/view_details.tmpl @@ -0,0 +1,65 @@ +
+
+
+ {{ctx.AvatarUtils.Avatar .User 48}} +
+
+
+ {{template "shared/user/name" .User}} + {{if .User.IsAdmin}} + {{ctx.Locale.Tr "admin.users.admin"}} + {{end}} +
+
+ {{ctx.Locale.Tr "admin.users.auth_source"}}: + {{if eq .LoginSource.ID 0}} + {{ctx.Locale.Tr "admin.users.local"}} + {{else}} + {{.LoginSource.Name}} + {{end}} +
+
+ {{ctx.Locale.Tr "admin.users.activated"}}: + {{if .User.IsActive}} + {{svg "octicon-check"}} + {{else}} + {{svg "octicon-x"}} + {{end}} +
+
+ {{ctx.Locale.Tr "admin.users.restricted"}}: + {{if .User.IsRestricted}} + {{svg "octicon-check"}} + {{else}} + {{svg "octicon-x"}} + {{end}} +
+
+ {{ctx.Locale.Tr "settings.visibility"}}: + {{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}} + {{if .User.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}} +
+
+ {{ctx.Locale.Tr "admin.users.2fa"}}: + {{if .TwoFactorEnabled}} + {{svg "octicon-check"}} + {{else}} + {{svg "octicon-x"}} + {{end}} +
+ {{if .User.Location}} +
+ {{svg "octicon-location"}}{{.User.Location}} +
+ {{end}} + {{if .User.Website}} +
+ + {{svg "octicon-link"}} + {{.User.Website}} + +
+ {{end}} +
+
+
diff --git a/templates/admin/user/view_emails.tmpl b/templates/admin/user/view_emails.tmpl new file mode 100644 index 0000000000..22ce305a88 --- /dev/null +++ b/templates/admin/user/view_emails.tmpl @@ -0,0 +1,19 @@ +
+ {{range .Emails}} +
+
+
+ {{.Email}} + {{if .IsPrimary}} +
{{ctx.Locale.Tr "settings.primary"}}
+ {{end}} + {{if .IsActivated}} +
{{ctx.Locale.Tr "settings.activated"}}
+ {{else}} +
{{ctx.Locale.Tr "settings.requires_activation"}}
+ {{end}} +
+
+
+ {{end}} +
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index e3cac806a4..31c669a921 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -26,6 +26,8 @@ {{end}} {{end}} -{{template "custom/footer" .}} + + {{template "custom/footer" .}} + {{ctx.DataRaceCheck $.Context}} diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 3b87f25d63..ad666152a0 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,6 +1,6 @@
- {{.locale.Tr "licenses"}} + {{.locale.Tr "licenses"}} {{if .EnableSwagger}}API{{end}} {{template "custom/extra_links_footer" .}}
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 4858d0b7de..c3645209cd 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -1,5 +1,5 @@ - + {{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}}{{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} @@ -25,50 +25,16 @@ .ui.secondary.menu .dropdown.item > .menu { margin-top: 0; } -{{if .PageIsUserProfile}} - - - - - {{if .ContextUser.Description}} - - {{end}} -{{else if .Repository}} - {{if .Issue}} - - - {{if .Issue.Content}} - - {{end}} - {{else}} - - - {{if .Repository.Description}} - - {{end}} - {{end}} - - {{if (.Repository.AvatarLink $.Context)}} - - {{else}} - - {{end}} -{{else}} - - - - - -{{end}} - + {{template "base/head_opengraph" .}} {{template "base/head_style" .}} {{template "custom/header" .}} + {{ctx.DataRaceCheck $.Context}} {{template "custom/body_outer_pre" .}}
- + {{template "custom/body_inner_pre" .}} diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 35aff8e538..5a2d0ddb0b 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -48,7 +48,7 @@ {{template "custom/extra_links" .}} {{if not .IsSigned}} - {{.locale.Tr "help"}} + {{.locale.Tr "help"}} {{end}}
@@ -57,7 +57,7 @@ {{if and .IsSigned .MustChangePassword}}
+
+

Buttons

+
+
+
+
+
+

Tooltip

text with tooltip
@@ -130,9 +138,13 @@

Text with SVG

{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)
{{svg "octicon-alert"}} {{svg "octicon-x"}} text
(inline)
+ +
{{svg "octicon-alert"}} flex item with very very very very very very very very long content
+
{{svg "octicon-alert"}} flex every line
{{svg "octicon-alert"}} flex every item
+
{{svg "octicon-alert"}} flex item with very very very very very very very very long content

Button with SVG

@@ -142,6 +154,7 @@ 123
+

Input with SVG

diff --git a/templates/explore/organizations.tmpl b/templates/explore/organizations.tmpl deleted file mode 100644 index a20dd755ea..0000000000 --- a/templates/explore/organizations.tmpl +++ /dev/null @@ -1,38 +0,0 @@ -{{template "base/head" .}} -
- {{template "explore/navbar" .}} -
- {{template "explore/search" .}} - -
- {{range .Users}} -
- {{avatar $.Context .}} -
- - {{.Name}} {{.FullName}} - {{if .Visibility.IsPrivate}} - {{$.locale.Tr "repo.desc.private"}} - {{end}} - -
- {{if .Location}} - {{svg "octicon-location"}} {{.Location}} - {{end}} - {{if and .Website}} - {{svg "octicon-link"}} - {{.Website}} - {{end}} - {{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} -
-
-
- {{else}} -
{{$.locale.Tr "explore.org_no_results"}}
- {{end}} -
- - {{template "base/paginate" .}} -
-
-{{template "base/footer" .}} diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 47e9921332..260f165b73 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -1,66 +1,67 @@ -
+
{{range .Repos}} -
-
-
- {{$avatar := (repoAvatar . 32 "gt-mr-3")}} - {{if $avatar}} - {{$avatar}} - {{end}} - - {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} - -
- {{if .IsArchived}} - {{$.locale.Tr "repo.desc.archived"}} - {{end}} - {{if .IsTemplate}} - {{if .IsPrivate}} - {{$.locale.Tr "repo.desc.private_template"}} +
+
+ {{template "repo/icon" .}} +
+
+
+
+ + {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} + + + {{if .IsArchived}} + {{$.locale.Tr "repo.desc.archived"}} + {{end}} + {{if .IsTemplate}} + {{if .IsPrivate}} + {{$.locale.Tr "repo.desc.private_template"}} + {{else}} + {{if .Owner.Visibility.IsPrivate}} + {{$.locale.Tr "repo.desc.internal_template"}} + {{end}} + {{end}} {{else}} - {{if .Owner.Visibility.IsPrivate}} - {{$.locale.Tr "repo.desc.internal_template"}} + {{if .IsPrivate}} + {{$.locale.Tr "repo.desc.private"}} + {{else}} + {{if .Owner.Visibility.IsPrivate}} + {{$.locale.Tr "repo.desc.internal"}} + {{end}} {{end}} {{end}} - {{else}} - {{if .IsPrivate}} - {{$.locale.Tr "repo.desc.private"}} - {{else}} - {{if .Owner.Visibility.IsPrivate}} - {{$.locale.Tr "repo.desc.internal"}} - {{end}} - {{end}} - {{end}} + {{if .IsFork}} - {{svg "octicon-repo-forked"}} + {{svg "octicon-repo-forked"}} {{else if .IsMirror}} - {{svg "octicon-mirror"}} + {{svg "octicon-mirror"}} {{end}}
+
+ {{if .PrimaryLanguage}} + + {{.PrimaryLanguage.Language}} + + {{end}} + {{if not $.DisableStars}} + {{svg "octicon-star" 16}}{{.NumStars}} + {{end}} + {{svg "octicon-git-branch" 16}}{{.NumForks}} +
- -
-
{{$description := .DescriptionHTML $.Context}} - {{if $description}}

{{$description}}

{{end}} + {{if $description}} +
{{$description}}
+ {{end}} {{if .Topics}} -
+
{{range .Topics}} {{if ne . ""}}{{.}}{{end}} {{end}}
{{end}} -

{{$.locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.locale}}

+
{{$.locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.locale}}
{{else}} diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl index 6e150dc7f2..c056662fb8 100644 --- a/templates/explore/repo_search.tmpl +++ b/templates/explore/repo_search.tmpl @@ -19,18 +19,18 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
diff --git a/templates/explore/user_list.tmpl b/templates/explore/user_list.tmpl new file mode 100644 index 0000000000..9abbff6d9c --- /dev/null +++ b/templates/explore/user_list.tmpl @@ -0,0 +1,31 @@ +
+ {{range .Users}} +
+
+ {{ctx.AvatarUtils.Avatar . 48}} +
+
+
+ {{template "shared/user/name" .}} + {{if .Visibility.IsPrivate}} + {{ctx.Locale.Tr "repo.desc.private"}} + {{end}} +
+
+ {{if .Location}} + {{svg "octicon-location"}}{{.Location}} + {{end}} + {{if and .Email (or (and $.ShowUserEmail $.IsSigned (not .KeepEmailPrivate)) $.PageIsAdminUsers)}} + + {{svg "octicon-mail"}} + {{.Email}} + + {{end}} + {{svg "octicon-calendar"}}{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} +
+
+
+ {{else}} +
{{ctx.Locale.Tr "explore.user_no_results"}}
+ {{end}} +
diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl index 1f3b944f5e..7e15ae3d47 100644 --- a/templates/explore/users.tmpl +++ b/templates/explore/users.tmpl @@ -4,28 +4,7 @@
{{template "explore/search" .}} -
- {{range .Users}} -
- {{avatar $.Context .}} -
- {{.Name}} {{.FullName}} -
- {{if .Location}} - {{svg "octicon-location"}} {{.Location}} - {{end}} - {{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}} - {{svg "octicon-mail"}} - {{.Email}} - {{end}} - {{svg "octicon-clock"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} -
-
-
- {{else}} -
{{$.locale.Tr "explore.user_no_results"}}
- {{end}} -
+ {{template "explore/user_list" .}} {{template "base/paginate" .}}
diff --git a/templates/install.tmpl b/templates/install.tmpl index b5caab1489..c8e094b5a3 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -8,7 +8,7 @@
{{template "base/alert" .}} -

{{.locale.Tr "install.docker_helper" "https://docs.gitea.io/en-us/install-with-docker/" | Safe}}

+

{{.locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker" | Safe}}

@@ -28,7 +28,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
-
+
diff --git a/templates/mail/team_invite.tmpl b/templates/mail/team_invite.tmpl index 8357895265..d21b7843ec 100644 --- a/templates/mail/team_invite.tmpl +++ b/templates/mail/team_invite.tmpl @@ -4,10 +4,9 @@ -{{$invite_url := printf "%sorg/invite/%s" AppUrl (QueryEscape .Invite.Token)}}

{{.locale.Tr "mail.team_invite.text_1" (DotEscape .Inviter.DisplayName) (DotEscape .Team.Name) (DotEscape .Organization.DisplayName) | Str2html}}

-

{{.locale.Tr "mail.team_invite.text_2"}}

{{$invite_url}}

+

{{.locale.Tr "mail.team_invite.text_2"}}

{{.InviteURL}}

{{.locale.Tr "mail.link_not_working_do_paste"}}

{{.locale.Tr "mail.team_invite.text_3" .Invite.Email}}

diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl index 7e988ba0c7..966150aa93 100644 --- a/templates/org/create.tmpl +++ b/templates/org/create.tmpl @@ -19,15 +19,15 @@
- +
- +
- +
diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 6106fe5d2b..9348e14544 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -3,7 +3,7 @@
- {{avatar $.Context . 100}} + {{ctx.AvatarUtils.Avatar . 100}} {{.DisplayName}} {{if .Visibility.IsLimited}}
{{$.locale.Tr "org.settings.visibility.limited_shortname"}}
{{end}} diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 967b31e7a8..72be948650 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -1,7 +1,7 @@ {{template "base/head" .}}
- {{avatar $.Context .Org 140 "org-avatar"}} + {{ctx.AvatarUtils.Avatar .Org 140 "org-avatar"}}
{{.Org.DisplayName}} @@ -15,8 +15,11 @@
{{if $.RenderedDescription}}
{{$.RenderedDescription|Str2html}}
{{end}}
- {{if .Org.Location}}
{{svg "octicon-location"}} {{.Org.Location}}
{{end}} - {{if .Org.Website}}
{{svg "octicon-link"}} {{.Org.Website}}
{{end}} + {{if .Org.Location}}
{{svg "octicon-location"}} {{.Org.Location}}
{{end}} + {{if .Org.Website}}
{{svg "octicon-link"}} {{.Org.Website}}
{{end}} + {{if $.IsSigned}} + {{if .Org.Email}}
{{svg "octicon-mail"}} {{.Org.Email}}
{{end}} + {{end}}
- +
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index 5aba2b6061..cba5d9e7c1 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -19,7 +19,7 @@
{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}
- +
diff --git a/templates/package/content/cran.tmpl b/templates/package/content/cran.tmpl index 38a58bc4e7..1f3200130c 100644 --- a/templates/package/content/cran.tmpl +++ b/templates/package/content/cran.tmpl @@ -11,7 +11,7 @@
install.packages("{{.PackageDescriptor.Package.Name}}")
- +
diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index ea146d170f..b222767035 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -16,7 +16,7 @@ sudo apt update
- +
diff --git a/templates/package/content/generic.tmpl b/templates/package/content/generic.tmpl index d3e4c7a62a..01012a5f0a 100644 --- a/templates/package/content/generic.tmpl +++ b/templates/package/content/generic.tmpl @@ -11,7 +11,7 @@ curl - +
diff --git a/templates/package/content/go.tmpl b/templates/package/content/go.tmpl index 616698c414..db25cc2b92 100644 --- a/templates/package/content/go.tmpl +++ b/templates/package/content/go.tmpl @@ -7,7 +7,7 @@
GOPROXY= go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl index 11c05a12b6..44d01b6013 100644 --- a/templates/package/content/helm.tmpl +++ b/templates/package/content/helm.tmpl @@ -12,7 +12,7 @@ helm repo update
helm install {{.PackageDescriptor.Package.Name}} {{AppDomain}}/{{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index d4c991c466..f5da72d711 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -40,7 +40,7 @@
mvn dependency:get -DremoteRepositories= -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}
- +
diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index e376a45f8b..c648d96162 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -15,7 +15,7 @@
"{{.PackageDescriptor.Package.Name}}": "{{.PackageDescriptor.Version.Version}}"
- +
diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index e95d9176b8..2b3a74316c 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -11,7 +11,7 @@
dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index 840bedbd9d..075d52cf49 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -7,7 +7,7 @@
dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url=
- +
diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 460a06fcd1..1534197219 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -7,7 +7,7 @@
pip install --index-url  {{.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/rpm.tmpl b/templates/package/content/rpm.tmpl index 42965c3271..fc7af639aa 100644 --- a/templates/package/content/rpm.tmpl +++ b/templates/package/content/rpm.tmpl @@ -4,16 +4,24 @@
-
dnf config-manager --add-repo 
+
# {{.locale.Tr "packages.rpm.distro.redhat"}}
+dnf config-manager --add-repo 
+
+# {{.locale.Tr "packages.rpm.distro.suse"}}
+zypper addrepo 
-
dnf install {{$.PackageDescriptor.Package.Name}}
+
# {{.locale.Tr "packages.rpm.distro.redhat"}}
+dnf install {{$.PackageDescriptor.Package.Name}}
+
+# {{.locale.Tr "packages.rpm.distro.suse"}}
+zypper install {{$.PackageDescriptor.Package.Name}}
- +
diff --git a/templates/package/content/rubygems.tmpl b/templates/package/content/rubygems.tmpl index 2f618392e4..f94968b094 100644 --- a/templates/package/content/rubygems.tmpl +++ b/templates/package/content/rubygems.tmpl @@ -13,7 +13,7 @@ end
- +
diff --git a/templates/package/content/swift.tmpl b/templates/package/content/swift.tmpl index c227e30c34..92559491a9 100644 --- a/templates/package/content/swift.tmpl +++ b/templates/package/content/swift.tmpl @@ -17,7 +17,7 @@
swift package resolve
- +
diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl index e23acf58a6..8590b44b37 100644 --- a/templates/package/content/vagrant.tmpl +++ b/templates/package/content/vagrant.tmpl @@ -7,7 +7,7 @@
vagrant box add --box-version {{.PackageDescriptor.Version.Version}} ""
- +
diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl index abcdd7ec1c..af543328f8 100644 --- a/templates/package/settings.tmpl +++ b/templates/package/settings.tmpl @@ -38,28 +38,30 @@

{{.locale.Tr "repo.settings.danger_zone"}}

-
-
-
- -
-
-
{{.locale.Tr "packages.settings.delete"}}
-

{{.locale.Tr "packages.settings.delete.description"}}

-
-