Merge remote-tracking branch 'upstream/main' into limit-repo-size

This commit is contained in:
DmitryFrolovTri
2023-03-22 17:06:44 +00:00
671 changed files with 14765 additions and 18377 deletions
+41 -68
View File
@@ -9,8 +9,6 @@ platform:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -28,7 +26,7 @@ steps:
- make deps-frontend
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -44,7 +42,7 @@ steps:
depends_on: [deps-frontend]
- name: lint-backend
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
pull: always
commands:
- make lint-backend
@@ -58,7 +56,7 @@ steps:
path: /go
- name: lint-backend-windows
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
commands:
- make golangci-lint-windows vet
environment:
@@ -73,7 +71,7 @@ steps:
path: /go
- name: lint-backend-gogit
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
commands:
- make lint-backend
environment:
@@ -92,7 +90,7 @@ steps:
depends_on: [deps-frontend]
- name: checks-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
commands:
- make --always-make checks-backend # ensure the 'go-licenses' make target runs
depends_on: [deps-backend]
@@ -113,7 +111,7 @@ steps:
depends_on: [deps-frontend]
- name: build-backend-no-gcc
image: golang:1.19 # this step is kept as the lowest version of golang that we support
image: gitea/test_env:linux-1.19-amd64 # this step is kept as the lowest version of golang that we support
pull: always
environment:
GOPROXY: https://goproxy.io
@@ -125,7 +123,7 @@ steps:
path: /go
- name: build-backend-arm64
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
environment:
GOPROXY: https://goproxy.io
GOOS: linux
@@ -140,7 +138,7 @@ steps:
path: /go
- name: build-backend-windows
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
environment:
GOPROXY: https://goproxy.io
GOOS: windows
@@ -154,7 +152,7 @@ steps:
path: /go
- name: build-backend-386
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
environment:
GOPROXY: https://goproxy.io
GOOS: linux
@@ -180,8 +178,6 @@ depends_on:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -217,7 +213,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
when:
event:
@@ -225,7 +220,7 @@ steps:
- pull_request
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -234,13 +229,13 @@ steps:
path: /go
- name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
pull: always
commands:
- ./build/test-env-prepare.sh
- name: build
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
@@ -255,7 +250,7 @@ steps:
path: /go
- name: test-pgsql
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- timeout -s ABRT 50m make test-pgsql-migration test-pgsql
@@ -285,8 +280,6 @@ depends_on:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -319,7 +312,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
when:
event:
@@ -327,7 +319,7 @@ steps:
- pull_request
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -336,13 +328,13 @@ steps:
path: /go
- name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
pull: always
commands:
- ./build/test-env-prepare.sh
- name: build
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
@@ -357,7 +349,7 @@ steps:
path: /go
- name: unit-test
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make unit-test-coverage test-check
@@ -373,7 +365,7 @@ steps:
path: /go
- name: unit-test-gogit
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make unit-test-coverage test-check
@@ -389,7 +381,7 @@ steps:
path: /go
- name: test-mysql
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make test-mysql-migration integration-test-coverage
@@ -405,7 +397,7 @@ steps:
path: /go
- name: generate-coverage
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
commands:
- make coverage
environment:
@@ -449,8 +441,6 @@ depends_on:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -473,7 +463,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
when:
event:
@@ -481,7 +470,7 @@ steps:
- pull_request
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -490,13 +479,13 @@ steps:
path: /go
- name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
pull: always
commands:
- ./build/test-env-prepare.sh
- name: build
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
@@ -511,7 +500,7 @@ steps:
path: /go
- name: test-mysql8
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- timeout -s ABRT 50m make test-mysql8-migration test-mysql8
@@ -538,8 +527,6 @@ depends_on:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -563,7 +550,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
when:
event:
@@ -571,7 +557,7 @@ steps:
- pull_request
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -580,13 +566,13 @@ steps:
path: /go
- name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
pull: always
commands:
- ./build/test-env-prepare.sh
- name: build
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
@@ -601,7 +587,7 @@ steps:
path: /go
- name: test-mssql
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make test-mssql-migration test-mssql
@@ -627,8 +613,6 @@ depends_on:
trigger:
event:
- push
- tag
- pull_request
paths:
exclude:
@@ -643,7 +627,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
when:
event:
@@ -651,7 +634,7 @@ steps:
- pull_request
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-arm64
pull: always
commands:
- make deps-backend
@@ -660,13 +643,13 @@ steps:
path: /go
- name: prepare-test-env
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-arm64 # https://gitea.com/gitea/test-env
pull: always
commands:
- ./build/test-env-prepare.sh
- name: build
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-arm64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
@@ -681,7 +664,7 @@ steps:
path: /go
- name: test-sqlite
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
image: gitea/test_env:linux-1.20-arm64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- timeout -s ABRT 50m make test-sqlite-migration test-sqlite
@@ -733,7 +716,7 @@ steps:
depends_on: [deps-frontend]
- name: deps-backend
image: golang:1.18
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -743,7 +726,7 @@ steps:
# TODO: We should probably build all dependencies into a test image
- name: test-e2e
image: mcr.microsoft.com/playwright:v1.29.2-focal
image: mcr.microsoft.com/playwright:v1.31.2-focal
commands:
- curl -sLO https://go.dev/dl/go1.20.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
@@ -842,7 +825,7 @@ trigger:
steps:
- name: download
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- timeout -s ABRT 40m make generate-license generate-gitignore
@@ -902,7 +885,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: deps-frontend
@@ -912,7 +894,7 @@ steps:
- make deps-frontend
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -1038,7 +1020,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: deps-frontend
@@ -1048,7 +1029,7 @@ steps:
- make deps-frontend
- name: deps-backend
image: golang:1.20
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
@@ -1148,7 +1129,7 @@ trigger:
steps:
- name: build-docs
image: golang:1.20
image: gitea/test_env:linux-1.20-arm64
commands:
- cd docs
- make trans-copy clean build
@@ -1202,7 +1183,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1280,7 +1260,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1353,7 +1332,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1427,7 +1405,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1477,7 +1454,7 @@ steps:
---
kind: pipeline
type: docker
name: docker-linux-amd64-dry-run
name: docker-linux-arm64-dry-run
platform:
os: linux
@@ -1487,8 +1464,8 @@ depends_on:
- compliance
trigger:
ref:
- "refs/pull/**"
event:
- pull_request
paths:
exclude:
- docs/**
@@ -1545,7 +1522,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1623,7 +1599,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1699,7 +1674,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
@@ -1773,7 +1747,6 @@ steps:
image: docker:git
pull: always
commands:
- git config --global --add safe.directory /drone/src
- git fetch --tags --force
- name: publish
+1
View File
@@ -3,3 +3,4 @@ fund=false
update-notifier=false
package-lock=true
save-exact=true
lockfile-version=3
-2
View File
@@ -5,8 +5,6 @@ ignoreFiles:
- "**/*.go"
overrides:
- files: ["**/*.less"]
customSyntax: postcss-less
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
rules:
scale-unlimited/declaration-strict-value: null
+350
View File
@@ -4,6 +4,356 @@ 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).
## [1.19.0](https://github.com/go-gitea/gitea/releases/tag/1.19.0) - 2023-03-19
* BREAKING
* Add loading yaml label template files (#22976) (#23232)
* Make issue and code search support camel case for Bleve (#22829)
* Repositories: by default disable all units except code and pulls on forks (#22541)
* Support template for merge message description (#22248)
* Remove ONLY_SHOW_RELEVANT_REPOS setting (#21962)
* Implement actions (#21937)
* Remove deprecated DSA host key from Docker Container (#21522)
* Improve valid user name check (#20136)
* SECURITY
* Return 404 instead of 403 if user can not access the repo (#23155) (#23158)
* Support scoped access tokens (#20908)
* FEATURES
* Add support for commit cross references (#22645)
* Scoped labels (#22585)
* Add Chef package registry (#22554)
* Support asciicast files as new markup (#22448)
* cgo cross-compile for freebsd (#22397)
* Add cron method to gc LFS MetaObjects (#22385)
* Add new captcha: cloudflare turnstile (#22369)
* Enable `@<user>`- completion popup on the release description textarea (#22359)
* make /{username}.png redirect to user/org avatar (#22356)
* Add Conda package registry (#22262)
* Support org/user level projects (#22235)
* Add Mermaid copy button (#22225)
* Add user secrets (#22191)
* Secrets storage with SecretKey encrypted (#22142)
* Preview images for Issue cards in Project Board view (#22112)
* Add support for incoming emails (#22056)
* Add Cargo package registry (#21888)
* Add option to prohibit fork if user reached maximum limit of repositories (#21848)
* Add attention blocks within quote blocks for `Note` and `Warning` (#21711)
* Add Feed for Releases and Tags (#21696)
* Add package registry cleanup rules (#21658)
* Add "Copy" button to file view of raw text (#21629)
* Allow disable sitemap (#21617)
* Add package registry quota limits (#21584)
* Map OIDC groups to Orgs/Teams (#21441)
* Keep languages defined in .gitattributes (#21403)
* Add Webhook authorization header (#20926)
* Supports wildcard protected branch (#20825)
* Copy citation file content, in APA and BibTex format, on repo home page (#19999)
* API
* Match api migration behavior to web behavior (#23552) (#23573)
* Purge API comment (#23451) (#23452)
* User creation API: allow custom "created" timestamps (#22549)
* Add `updated_at` field to PullReview API object (#21812)
* Add API management for issue/pull and comment attachments (#21783)
* Add API endpoint to get latest release (#21267)
* Support system hook API (#14537)
* ENHANCEMENTS
* Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582)
* Fix sticky header in diff view (#23554) (#23568)
* Refactor merge/update git command calls (#23366) (#23544)
* Fix review comment context menu clipped bug (#23523) (#23543)
* Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540)
* Increase horizontal page padding (#23507) (#23537)
* Use octicon-verified for gpg signatures (#23529) (#23536)
* Make time tooltips interactive (#23526) (#23527)
* Replace Less with CSS (#23508)
* Fix 'View File' button in code search (#23478) (#23483)
* Convert GitHub event on actions and fix some pull_request events. (#23037) (#23471)
* Support reflogs (#22451) (#23438)
* Fix actions frontend bugs (pagination, long name alignment) and small simplify (#23370) (#23436)
* Scoped label display and documentation tweaks (#23430) (#23433)
* Add missing tabs to org projects page (#22705) (#23412)
* Fix and move "Use this template" button (#23398) (#23408)
* Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397) (#23403)
* Rename `canWriteUnit` to `canWriteProjects` (#23386) (#23399)
* Refactor and tidy-up the merge/update branch code (#22568) (#23365)
* Refactor `setting.Database.UseXXX` to methods (#23354) (#23356)
* Fix incorrect project links and use symlink icon for org-wide projects (#23325) (#23336)
* Fix PR view misalignment caused by long name file (#23321) (#23335)
* Scoped labels: don't require holding alt key to remove (#23303) (#23331)
* Add context when rendering labels or emojis (#23281) (#23319)
* Change interactiveBorder to fix popup preview (#23169) (#23314)
* Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311)
* update to mermaid v10 (#23178) (#23299)
* Fix code wrap for unbroken lines (#23268) (#23293)
* Use async await to fix empty quote reply at first time (#23168) (#23256)
* Fix switched citation format (#23250) (#23253)
* Allow `<video>` in MarkDown (#22892) (#23236)
* Order pull request conflict checking by recently updated, for each push (#23220) (#23225)
* Fix Fomantic UI's `touchstart` fastclick, always use `click` for click events (#23065) (#23195)
* Add word-break to sidebar-item-link (#23146) (#23180)
* Add InsecureSkipVerify to Minio Client for Storage (#23166) (#23177)
* Fix height for sticky head on large screen on PR page (#23111) (#23123)
* Change style to improve whitespaces trimming inside inline markdown code (#23093) (#23120)
* Avoid warning for system setting when start up (#23054) (#23116)
* Add accessibility to the menu on the navbar (#23059) (#23095)
* Improve accessibility for issue comments (#22612) (#23083)
* Remove delete button for review comment (#23036)
* Remove dashes between organization member avatars on hover (#23034)
* Use `gt-relative` class instead of the ambiguous `gt-pr` class (#23008)
* handle deprecated settings (#22992)
* Add scopes to API to create token and display them (#22989)
* Improve PR Review Box UI (#22986)
* Improve issues.LoadProject (#22982)
* Add all units to the units permission list in org team members sidebar (#22971)
* Rename `GetUnits` to `LoadUnits` (#22970)
* Rename `repo.GetOwner` to `repo.LoadOwner` (#22967)
* Rename "People" to "Members" in organization page and use a better icon (#22960)
* Fix avatar misalignment (#22955)
* Sort issues and pulls by recently updated in user and organization home (#22925)
* Add `title` to PR file tree items (#22918)
* First step to refactor the `.hide` to `.gt-hidden` (#22916)
* Add tooltip to issue reference (#22913)
* Always show the `command line instructions` button even if there are conflicts (#22909)
* Fix dark-colored description text in arc-green theme (#22908)
* Remove Fomantic-UI's `.hidden` CSS class for menu elements (#22895)
* Move helpers to be prefixed with `gt-` (#22879)
* Move `IsReadmeFile*` from `modules/markup/` to `modules/util` (#22877)
* Highlight focused diff file (#22870)
* Add some headings to repo views (#22869)
* Fix milestone title font problem (#22863)
* Pull Requests: setting to allow edits by maintainers by default, tweak UI (#22862)
* Introduce customized HTML elements, fix incorrect AppUrl usages in templates (#22861)
* Add `/$count` endpoints for NuGet v2 (#22855)
* Remove Fomantic-UI's `.hidden` CSS class for checkbox elements (#22851)
* Fix notification and stopwatch empty states (#22845)
* Always go full width in PR view (#22844)
* Improve AppUrl/ROOT_URL checking (#22836)
* Fix style of actions rerun button (#22835)
* Fix more HTMLURL in templates (#22831)
* Fix inconsistent Filter Project name in issue list (#22827)
* include build info in Prometheus metrics (#22819)
* Make clone URL use current page's host (#22808)
* Refactor legacy strange git operations (#22756)
* Improve error report when user passes a private key (#22726)
* set user dashboard org visibility to basic (#22706)
* Fix diff UI for unexpandable items (#22700)
* Remove 'primary' class from tab counter labels (#22687)
* Add more events details supports for actions (#22680)
* Refactor git command package to improve security and maintainability (#22678)
* Use relative url in actions view (#22675)
* set user visibility class to basic (#22674)
* Add repository setting to enable/disable releases unit (#22671)
* Remove label color from global issue filters (#22660)
* Fix poor alignment of organization description on organization home page (#22656)
* Small refactor for loading PRs (#22652)
* Allow setting access token scope by CLI (#22648)
* Improve accessibility of navigation bar and footer (#22635)
* Fixes accessibility behavior of Watching, Staring and Fork buttons (#22634)
* Fixes accessibility of empty repository commit status (#22632)
* Pull request yaml template support for including commit body in a field (#22629)
* Show migration validation error (#22619)
* set org visibility class to basic in header (#22605)
* Fix cache-control header clearing comment text when editing issue (#22604)
* Add ARIA support for Fomantic UI checkboxes (#22599)
* Add templates to customize text when creating and migrating repositories (#22597)
* Allow setting `redirect_to` cookie on OAuth login (#22594)
* Improve checkbox accessibility a bit by adding the title attribute (#22593)
* Allow issue templates to not render title (#22589)
* Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)
* Fix missing title and filter in issue sidebar project menu (#22557)
* Issues: support setting issue template field values with query (#22545)
* Issues: add Project filter to issues list and search (#22544)
* Pull Requests: add color to approved/reject icon in pull requests list (#22543)
* Mute all links in issue timeline (#22533)
* Dropzone: Add "Copy link" button for new uploads (#22517)
* Support importing comment types (#22510)
* Load asciicast css async (#22502)
* Move delete user to service (#22478)
* Change use of Walk to WalkDir to improve disk performance (#22462)
* Add reply hint to mail text (#22459)
* fix wrong theme class when logged out if default theme is changed (#22408)
* Refactor the setting to make unit test easier (#22405)
* Improve utils of slices (#22379)
* Use context parameter in models/git (#22367)
* Always reuse transaction (#22362)
* Fix unstable emoji sort (#22346)
* Add context cache as a request level cache (#22294)
* Reminder for no more logs to console (#22282)
* Support estimated count with multiple schemas (#22276)
* Move `convert` package to services (#22264)
* Use dynamic package type list (#22263)
* Hide file borders on sticky diff box (#22217)
* Improve notification and stopwatch styles (#22169)
* Fixed Project view .board-column height for tall screens. (#22108)
* Use multi reader instead to concat strings (#22099)
* Use git command instead of exec.Cmd in blame (#22098)
* Fix autofilled text visibility in dark mode (#22088)
* Rename almost all Ctx functions (#22071)
* Rename actions to operations on UI (#22067)
* refactor bind functions based on generics (#22055)
* Support disabling database auto migration (#22053)
* remove duplicated read file code (#22042)
* Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986)
* Skip initing disabled storages (#21985)
* Add doctor command for full GC of LFS (#21978)
* Util type to parse ref name (#21969)
* Replace fmt.Sprintf with hex.EncodeToString (#21960)
* Use random bytes to generate access token (#21959)
* Add index for access_token (#21908)
* Move all remaining colors into CSS variables (#21903)
* Webhook list enhancements (#21893)
* Embed Matrix icon as SVG (#21890)
* Remove useless "Cancel" buttons (#21872)
* fix(web): keep the pages of the navigation in the center (#21867)
* fix(web): reduce page jitter on browsers that support overlay scrollbar (#21850)
* Improvements for Content Copy (#21842)
* Tweak katex options (#21828)
* Show syntax lexer name in file view/blame (#21814)
* Remove `href="javascript:;"` in "save topics (Done)" button (#21813)
* Render number of commits in repo page in a user friendly way (#21786)
* Adjust clone timeout error to suggest increasing timeout (#21769)
* Update message of reach_limit_of_creation (#21757)
* Allow detect whether it's in a database transaction for a context.Context (#21756)
* Add configuration for CORS allowed headers (#21747)
* Move svg html render to modules/svg (#21716)
* Release and Tag List tweaks (#21712)
* Remove template previewer (#21701)
* Clean up formatting on install page (#21668)
* Configure update checker on installation page (#21655)
* Merge db.Iterate and IterateObjects (#21641)
* Add option to enable CAPTCHA validation for login (#21638)
* Allow disable RSS/Atom feed (#21622)
* Use CSS color-scheme instead of invert (#21616)
* Localize time units on activity heatmap (#21570)
* Fix UI column width, button overflow Fomantic's grid (#21559)
* feat: notify doers of a merge when automerging (#21553)
* Split migrations folder (#21549)
* feat: add button to quickly clear merge message (#21548)
* Add `context.Context` to more methods (#21546)
* Add index for hook_task table (#21545)
* Allow disable code tab (#20805)
* BUGFIXES
* Fix template error when reference Project (#23584)
* Fix dropdown icon misalignment when using fomantic icon (#23558) (#23577)
* Fix diff detail buttons wrapping, use tippy for review box (#23271) (#23546)
* Handle missing `README` in create repos API (#23387) (#23510)
* Disable sending email after push a commit to a closed PR (#23462) (#23492)
* Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450) (#23486)
* Fix due date being wrong on issue list (#23475) (#23477)
* Remove wrongly added column on migration test fixtures (#23456) (#23470)
* Make branches list page operations remember current page (#23420) (#23460)
* Fix missing commit status in PR which from forked repo (#23351) (#23453)
* Show edit/close/delete button on organization wide repositories (#23388) (#23429)
* Preserve file size when creating attachments (#23406) (#23426)
* Fix broken Chroma CSS styles (#23174) (#23402)
* Fix incorrect NotFound conditions in org/projects.go (#23384) (#23395)
* Set `X-Gitea-Debug` header once (#23361) (#23381)
* Pass context to avatar for projects view (#23359) (#23378)
* Fix panic when getting notes by ref (#23372) (#23377)
* Do not recognize text files as audio (#23355) (#23368)
* Fix adding of empty class name (#23352) (#23360)
* Fix various ImageDiff/SVG bugs (#23312) (#23358)
* Fix incorrect display for comment context menu (#23343) (#23344)
* Remove unnecessary space on link (#23334) (#23340)
* Fix incorrect redirect link of delete org project (#23327) (#23339)
* Fix cannot reopen after pushing commits to a closed PR (#23189) (#23324)
* Fix broken code editor diff preview (#23307) (#23320)
* Support sanitising the URL by removing extra slashes in the URL (#21333) (#23300)
* Avoid panic caused by broken payload when creating commit status (#23216) (#23294)
* Fill head commit to in payload when notifying push commits for mirroring (#23215) (#23292)
* Fix various bugs for "install" page (#23194) (#23286)
* Fix GetFilesChangedBetween if the file name may be escaped (#23272) (#23279)
* Revert relative links to absolute links in mail templates (#23267) (#23269)
* Fix commit retrieval by tag (#21804) (#23266)
* Use correct README link to render the README (#23152) (#23264)
* Close the temp file when dumping database to make the temp file can be deleted on Windows (#23249) (#23251)
* Use the correct selector to hide the checkmark of selected labels on clear (#23224) (#23228)
* Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147) (#23205)
* Properly flush unique queues on startup (#23154) (#23201)
* Pass `--global` when calling `git config --get`, for consistency with `git config --set` (#23157) (#23199)
* Make `gitea serv` respect git binary home (#23138) (#23197)
* Change button text for commenting and closing an issue at the same time (#23135) (#23182)
* Fix DBConsistency checks on MSSQL (#23132) (#23134)
* Show empty repos in Admin Repository Management page (#23114) (#23130)
* Redirect to the commit page after applying patch (#23056) (#23127)
* Fix nil context in RenderMarkdownToHtml (#23092) (#23108)
* Make issue meta dropdown support Enter, confirm before reloading (#23014) (#23102)
* Fix SyncOnCommit always return false in API of push_mirrors (#23088) (#23100)
* Fix commit name in Apply Patch page (#23086) (#23099)
* Fix some more hidden problems (#23074) (#23075)
* Bump golang.org/x/net from 0.4.0 to 0.7.0 (#22980)
* Get rules by id when editing branch protection rule (#22932)
* Fix panic when call api (/repos/{owner}/{repo}/pulls/{index}/files) (#22921)
* Increase Content field size of gpg_import_key to MEDIUMTEXT (#22897)
* Fix hidden commit status on multiple checks (#22889)
* Fix update by rebase being wrongly disabled by protected base branch (#22825)
* Make issue title edit buttons focusable and fix incorrect ajax requests (#22807)
* Fix rerun button of Actions (#22798)
* remove update language in ProfilePost (#22748)
* Do not overwrite empty DefaultBranch (#22708)
* Fix ref to trigger Actions (#22679)
* Fix time to NotifyPullRequestSynchronized (#22650)
* Show all projects, not just repo projects and open/closed projects (#22640)
* Project links should use parent link methods (#22587)
* Fix group filter for ldap source sync (#22506)
* Check quota limits for container uploads (#22450)
* Fix halfCommitter and WithTx (#22366)
* Attempt to fix TestExportUserGPGKeys (#22159)
* Fix heatmap first color being unused (#22157)
* Fix scroll over mermaid frame (#21925)
* Move migration test fixtures to the correct directories (#21901)
* fix(web): add `alt` for logo in home page (#21887)
* Fix webhook attachment text is not set in review comment (#21763)
* Alter package_version.metadata_json to LONGTEXT (#21667)
* Ensure that Webhook tasks are not double delivered (#21558)
* TESTING
* Make CI use a dummy password hasher for all tests (#22983)
* Disable test for incoming email (#22686)
* Move fuzz tests into tests/fuzz (#22376)
* Test views of LFS files (#22196)
* Specify ID in `TestAPITeam` (#22192)
* verify nodeinfo response by schema (#22137)
* Skip GitHub migration tests if the API token is undefined (#21824)
* Add a simple test for external renderer (#20033)
* TRANSLATION
* Use "Title Case" for text "Reference in new issue" (#22936)
* BUILD
* Wrap unless-check in docker manifests (#23079) (#23081)
* Adjust manifest to prevent tagging latest on rcs (#22811)
* update to build with go1.20 (#22732)
* Add Bash and Zsh completion scripts (#22646)
* Add Contributed backport command (#22643)
* Remove deprecated packages & staticcheck fixes (#22012)
* Update to Alpine 3.17 (#21904)
* Fix webpack license warning (#21815)
* DOCS
* Update documentation for the new YAML label file format (#23020) (#23341)
* Update hacking-on-gitea-zh_cn documentation (#23315) (#23323)
* Add basic documentation for labels, including scoped labels (#23304) (#23309)
* Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297) (#23305)
* Fix secrets overview page missing from docs sidebar (#23143) (#23145)
* Add some guidelines for refactoring (#22880)
* Explain that the no-access team unit does not affect public repositories (#22661)
* Fix incorrect Redis URL snippets in the example app.ini (#22573)
* docs: add swagger.json file location to FAQ (#22489)
* Update index.de-de.md (#22363)
* Update Gmail mailer configuration (#22291)
* Add missed reverse proxy authentication documentation (#22250)
* Add plural definitions for German translations (#21802)
* Attempt clarify AppWorkPath etc. (#21656)
* Add some documentation to packages (#21648)
* MISC
* Use `<nav>` instead of `<div>` in the global navbar (#23125) (#23533)
* Do not create commit graph for temporary repos (#23219) (#23229)
* Update button is shown when a Pull Request is marked WIP - Issue #21740 (#22683)
* Add main landmark to templates and adjust titles (#22670)
* Fix error on account activation with wrong passwd (#22609)
* Update JS dependencies (#22538)
* Display unreferenced packages total size in package admin panel (#22498)
* Mobile fix for Project view: Add delay to Sortable.js on mobile, to ensure scrolling is possible. (#22152)
* Update chroma to v2.4.0 (#22000)
* Hide collapse icon in diff with no lines (#21094)
## [1.18.5](https://github.com/go-gitea/gitea/releases/tag/v1.18.5) - 2023-02-21
* ENHANCEMENTS
-1
View File
@@ -5,7 +5,6 @@ Kees de Vries <bouwko@gmail.com> (@Bwko)
Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
Matthias Loibl <mail@matthiasloibl.com> (@metalmatze)
Rachid Zarouali <nobody@nobody.tld> (@xinity)
Rémy Boulanouar <admin@dblk.org> (@DblK)
Sandro Santilli <strk@kbt.io> (@strk)
+9 -9
View File
@@ -29,7 +29,7 @@ AIR_PACKAGE ?= github.com/cosmtrek/air@v1.40.4
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.6.0
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.2
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.4
@@ -105,7 +105,7 @@ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/m
FOMANTIC_WORK_DIR := web_src/fomantic
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
WEBPACK_CONFIGS := webpack.config.js
WEBPACK_DEST := public/js/index.js public/css/index.css
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
@@ -131,7 +131,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
GO_DIRS := cmd tests models modules routers build services tools
WEB_DIRS := web_src/js web_src/less
WEB_DIRS := web_src/js web_src/css
GO_SOURCES := $(wildcard *.go)
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
@@ -273,7 +273,7 @@ fmt:
.PHONY: fmt-check
fmt-check: fmt
@diff=$$(git diff $(GO_SOURCES) templates $(WEB_DIRS)); \
@diff=$$(git diff --color=always $(GO_SOURCES) templates $(WEB_DIRS)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
@@ -309,7 +309,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
.PHONY: swagger-check
swagger-check: generate-swagger
@diff=$$(git diff '$(SWAGGER_SPEC)'); \
@diff=$$(git diff --color=always '$(SWAGGER_SPEC)'); \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-swagger' and commit the result:"; \
echo "$${diff}"; \
@@ -342,7 +342,7 @@ lint: lint-frontend lint-backend
.PHONY: lint-frontend
lint-frontend: node_modules
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e
npx stylelint --color --max-warnings=0 web_src/less
npx stylelint --color --max-warnings=0 web_src/css
npx spectral lint -q -F hint $(SWAGGER_SPEC)
npx markdownlint docs *.md
@@ -414,7 +414,7 @@ vendor: go.mod go.sum
.PHONY: tidy-check
tidy-check: tidy
@diff=$$(git diff go.mod go.sum $(GO_LICENSE_FILE)); \
@diff=$$(git diff --color=always go.mod go.sum $(GO_LICENSE_FILE)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make tidy' and commit the result:"; \
echo "$${diff}"; \
@@ -885,7 +885,7 @@ svg: node-check | node_modules
.PHONY: svg-check
svg-check: svg
@git add $(SVG_DEST_DIR)
@diff=$$(git diff --cached $(SVG_DEST_DIR)); \
@diff=$$(git diff --color=always --cached $(SVG_DEST_DIR)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
echo "$${diff}"; \
@@ -895,7 +895,7 @@ svg-check: svg
.PHONY: lockfile-check
lockfile-check:
npm install --package-lock-only
@diff=$$(git diff package-lock.json); \
@diff=$$(git diff --color=always package-lock.json); \
if [ -n "$$diff" ]; then \
echo "package-lock.json is inconsistent with package.json"; \
echo "Please run 'npm install --package-lock-only' and commit the result:"; \
-5
View File
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -25,14 +25,22 @@ async function processFile(file, {prefix, fullName} = {}) {
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
}
// Set the `xmlns` attribute so that the files are displayable in standalone documents
// The svg backend module will strip the attribute during startup for inline display
const {data} = optimize(await readFile(file, 'utf8'), {
plugins: [
{name: 'preset-default'},
{name: 'removeXMLNS'},
{name: 'removeDimensions'},
{name: 'prefixIds', params: {prefix: () => name}},
{name: 'addClassesToSVGElement', params: {classNames: ['svg', name]}},
{name: 'addAttributesToSVGElement', params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]}},
{
name: 'addAttributesToSVGElement', params: {
attributes: [
{'xmlns': 'http://www.w3.org/2000/svg'},
{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'},
]
}
},
],
});
+3 -3
View File
@@ -250,7 +250,7 @@ func runDump(ctx *cli.Context) error {
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
log.Info("Skip dumping LFS data")
} else if err := storage.LFS.IterateObjects(func(objPath string, object storage.Object) error {
} else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat()
if err != nil {
return err
@@ -351,7 +351,7 @@ func runDump(ctx *cli.Context) error {
if ctx.IsSet("skip-attachment-data") && ctx.Bool("skip-attachment-data") {
log.Info("Skip dumping attachment data")
} else if err := storage.Attachments.IterateObjects(func(objPath string, object storage.Object) error {
} else if err := storage.Attachments.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat()
if err != nil {
return err
@@ -364,7 +364,7 @@ func runDump(ctx *cli.Context) error {
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
log.Info("Skip dumping package data")
} else if err := storage.Packages.IterateObjects(func(objPath string, object storage.Object) error {
} else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat()
if err != nil {
return err
+23 -3
View File
@@ -9,6 +9,8 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
@@ -25,6 +27,9 @@ import (
ini "gopkg.in/ini.v1"
)
// PIDFile could be set from build tag
var PIDFile = "/run/gitea.pid"
// CmdWeb represents the available web sub-command.
var CmdWeb = cli.Command{
Name: "web",
@@ -45,7 +50,7 @@ and it takes care of all the other things for you`,
},
cli.StringFlag{
Name: "pid, P",
Value: setting.PIDFile,
Value: PIDFile,
Usage: "Custom pid file path",
},
cli.BoolFlag{
@@ -81,6 +86,22 @@ func runHTTPRedirector() {
}
}
func createPIDFile(pidPath string) {
currentPid := os.Getpid()
if err := os.MkdirAll(filepath.Dir(pidPath), os.ModePerm); err != nil {
log.Fatal("Failed to create PID folder: %v", err)
}
file, err := os.Create(pidPath)
if err != nil {
log.Fatal("Failed to create PID file: %v", err)
}
defer file.Close()
if _, err := file.WriteString(strconv.FormatInt(int64(currentPid), 10)); err != nil {
log.Fatal("Failed to write PID information: %v", err)
}
}
func runWeb(ctx *cli.Context) error {
if ctx.Bool("verbose") {
_ = log.DelLogger("console")
@@ -107,8 +128,7 @@ func runWeb(ctx *cli.Context) error {
// Set pid file setting
if ctx.IsSet("pid") {
setting.PIDFile = ctx.String("pid")
setting.WritePIDFile = true
createPIDFile(ctx.String("pid"))
}
// Perform pre-initialization
+4 -2
View File
@@ -20,7 +20,7 @@
;; - The environment variable `$GITEA_WORK_DIR`
;; - A built-in value set at build time (see building from source)
;; - Otherwise it defaults to the directory of the _`AppPath`_
;; - If any of the above are relative paths then they are made absolute against the
;; - If any of the above are relative paths then they are made absolute against
;; the directory of the _`AppPath`_
;; - _`CustomPath`_: This is the base directory for custom templates and other options.
;; It is determined by using the first set thing in the following hierarchy:
@@ -1848,7 +1848,7 @@ ROUTER = console
;ENABLED = true
;;
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
;;
;; Max size of each file. Defaults to 4MB
;MAX_SIZE = 4
@@ -2516,6 +2516,8 @@ ROUTER = console
;LIMIT_SIZE_PYPI = -1
;; Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
;LIMIT_SIZE_RUBYGEMS = -1
;; Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
;LIMIT_SIZE_SWIFT = -1
;; Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
;LIMIT_SIZE_VAGRANT = -1
+1 -1
View File
@@ -1,6 +1,6 @@
THEME := themes/gitea
PUBLIC := public
ARCHIVE := https://dl.gitea.io/theme/master.tar.gz
ARCHIVE := https://dl.gitea.com/theme/main.tar.gz
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.82.0
@@ -46,7 +46,7 @@ reported as part of the default configuration when running `gitea --help` or on
- The environment variable `$GITEA_WORK_DIR`
- A built-in value set at build time (see building from source)
- Otherwise it defaults to the directory of the _`AppPath`_
- If any of the above are relative paths then they are made absolute against the
- If any of the above are relative paths then they are made absolute against
the directory of the _`AppPath`_
- _`CustomPath`_: This is the base directory for custom templates and other options.
It is determined by using the first set thing in the following hierarchy:
@@ -841,7 +841,7 @@ Default templates for project boards:
## Issue and pull request attachments (`attachment`)
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
- `MAX_SIZE`: **4**: Maximum size (MB).
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
@@ -1254,6 +1254,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
- `LIMIT_SIZE_PUB`: **-1**: Maximum size of a Pub upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
- `LIMIT_SIZE_PYPI`: **-1**: Maximum size of a PyPI upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
- `LIMIT_SIZE_RUBYGEMS`: **-1**: Maximum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
- `LIMIT_SIZE_SWIFT`: **-1**: Maximum size of a Swift upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
- `LIMIT_SIZE_VAGRANT`: **-1**: Maximum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
## Mirror (`mirror`)
@@ -354,7 +354,7 @@ To make a custom theme available to all users:
Community themes are listed in [gitea/awesome-gitea#themes](https://gitea.com/gitea/awesome-gitea#themes).
The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/less/themes/theme-arc-green.less).
The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/css/themes/theme-arc-green.css).
If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`.
This allows Gitea to adjust the Monaco code editor's theme accordingly.
@@ -21,13 +21,13 @@ menu:
## Background
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend.
Gitea uses [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend.
The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template).
The source files can be found in the following directories:
* **Less styles:** `web_src/less/`
* **CSS styles:** `web_src/css/`
* **JavaScript files:** `web_src/js/`
* **Vue components:** `web_src/js/components/`
* **Go HTML templates:** `templates/`
@@ -118,12 +118,15 @@ _Symbols used in table:_
| Rebase merging | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull/Merge request inline comments | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull/Merge request approval | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull/Merge require approval | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
| Pull/Merge multiple reviewers | ✓ | ✓ | ✓ | ✘ | ✓ | ✓ | ✓ |
| Merge conflict resolution | [](https://github.com/go-gitea/gitea/issues/9014) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
| Restrict push and merge access to certain users | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Revert specific commits | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
| Pull/Merge requests templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
| Cherry-picking changes | ✓ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
| Download Patch | ✓ | ✘ | ✓ | ✓ | ✓ | / | ✘ |
| Merge queues | ✘ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
## 3rd-party integrations
@@ -15,4 +15,18 @@ menu:
# 本地化
## TBD
Gitea的本地化是通过我们的[Crowdin项目](https://crowdin.com/project/gitea)进行的。
对于对**英语翻译**的更改,可以发出pull-request,来更改[英语语言环境](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)中合适的关键字。
有关对**非英语**翻译的更改,请参阅上面的 Crowdin 项目。
## 支持的语言
上述 Crowdin 项目中列出的任何语言一旦翻译了 25% 或更多都将得到支持。
翻译被接受后,它将在下一次 Crowdin 同步后反映在主存储库中,这通常是在任何 PR 合并之后。
在撰写本文时,这意味着更改后的翻译可能要到 Gitea 的下一个版本才会出现。
如果使用开发版本,则在同步更改内容后,它应该会在更新后立即显示。
@@ -159,7 +159,7 @@ using the `LDFLAGS` environment variable for `make`. The appropriate settings ar
- For _`CustomConf`_ you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
- For _`AppWorkPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
- For _`StaticRootPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
- To change the default PID file location use `-X \"code.gitea.io/gitea/modules/setting.PIDFile=/run/gitea.pid\"`
- To change the default PID file location use `-X \"code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid\"`
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
with the appropriate `TAGS` as above.
@@ -40,6 +40,7 @@ The following package managers are currently supported:
| [Pub]({{< relref "doc/packages/pub.en-us.md" >}}) | Dart | `dart`, `flutter` |
| [PyPI]({{< relref "doc/packages/pypi.en-us.md" >}}) | Python | `pip`, `twine` |
| [RubyGems]({{< relref "doc/packages/rubygems.en-us.md" >}}) | Ruby | `gem`, `Bundler` |
| [Swift]({{< relref "doc/packages/rubygems.en-us.md" >}}) | Swift | `swift` |
| [Vagrant]({{< relref "doc/packages/vagrant.en-us.md" >}}) | - | `vagrant` |
**The following paragraphs only apply if Packages are not globally disabled!**
+93
View File
@@ -0,0 +1,93 @@
---
date: "2023-01-10T00:00:00+00:00"
title: "Swift Packages Repository"
slug: "packages/swift"
draft: false
toc: false
menu:
sidebar:
parent: "packages"
name: "Swift"
weight: 95
identifier: "swift"
---
# Swift Packages Repository
Publish [Swift](hhttps://www.swift.org/) packages for your user or organization.
**Table of Contents**
{{< toc >}}
## Requirements
To work with the Swift package registry, you need to use [swift](https://www.swift.org/getting-started/) to consume and a HTTP client (like `curl`) to publish packages.
## Configuring the package registry
To register the package registry and provide credentials, execute:
```shell
swift package-registry set https://gitea.example.com/api/packages/{owner}/swift -login {username} -password {password}
```
| Placeholder | Description |
| ------------ | ----------- |
| `owner` | The owner of the package. |
| `username` | Your Gitea username. |
| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. |
The login is optional and only needed if the package registry is private.
## Publish a package
First you have to pack the contents of your package:
```shell
swift package archive-source
```
To publish the package perform a HTTP PUT request with the package content in the request body.
```shell --user your_username:your_password_or_token \
curl -X PUT --user {username}:{password} \
-H "Accept: application/vnd.swift.registry.v1+json" \
-F source-archive=@/path/to/package.zip \
-F metadata={metadata} \
https://gitea.example.com/api/packages/{owner}/swift/{scope}/{name}/{version}
```
| Placeholder | Description |
| ----------- | ----------- |
| `username` | Your Gitea username. |
| `password` | Your Gitea password. If you are using 2FA or OAuth use a [personal access token]({{< relref "doc/developers/api-usage.en-us.md#authentication" >}}) instead of the password. |
| `owner` | The owner of the package. |
| `scope` | The package scope. |
| `name` | The package name. |
| `version` | The package version. |
| `metadata` | (Optional) The metadata of the package. JSON encoded subset of https://schema.org/SoftwareSourceCode |
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
## Install a package
To install a Swift package from the package registry, add it in the `Package.swift` file dependencies list:
```
dependencies: [
.package(id: "{scope}.{name}", from:"{version}")
]
```
| Parameter | Description |
| ----------- | ----------- |
| `scope` | The package scope. |
| `name` | The package name. |
| `version` | The package version. |
Afterwards execute the following command to install it:
```shell
swift package resolve
```
+37 -1
View File
@@ -15,9 +15,45 @@ menu:
# Pull Request
A Pull Request (PR) is a way to propose changes to a repository.
It is a request to merge one branch into another, accompanied by a description of the changes that were made.
Pull Requests are commonly used as a way for contributors to propose changes and for maintainers to review and merge those changes.
## Creating a pull request
To create a PR, you'll need to follow these steps:
1. **Fork the repository** - If you don't have permission to make changes to the repository directly, you'll need to fork the repository to your own account.
This creates a copy of the repository that you can make changes to.
2. **Create a branch (optional)** - Create a new branch on your forked repository that contains the changes you want to propose.
Give the branch a descriptive name that indicates what the changes are for.
3. **Make your changes** - Make the changes you want, commit, and push them to your forked repository.
4. **Create the PR** - Go to the original repository and go to the "Pull Requests" tab. Click the "New Pull Request" button and select your new branch as the source branch.
Enter a descriptive title and description for your Pull Request and click "Create Pull Request".
## Reviewing a pull request
When a PR is created, it triggers a review process. The maintainers of the repository are notified of the PR and can review the changes that were made.
They can leave comments, request changes, or approve the changes.
If the maintainers request changes, you'll need to make those changes in your branch and push the changes to your forked repository.
The PR will be updated automatically with the new changes.
If the maintainers approve the changes, they can merge the PR into the repository.
## Closing a pull request
If you decide that you no longer want to merge a PR, you can close it.
To close a PR, go to the open PR and click the "Close Pull Request" button. This will close the PR without merging it.
## "Work In Progress" pull requests
Marking a pull request as being a work in progress will prevent that pull request from being accidentally merged. To mark a pull request as being a work in progress, you must prefix its title by `WIP:` or `[WIP]` (case insensitive). Those values are configurable in your `app.ini` file :
Marking a pull request as being a work in progress will prevent that pull request from being accidentally merged.
To mark a pull request as being a work in progress, you must prefix its title by `WIP:` or `[WIP]` (case insensitive).
Those values are configurable in your `app.ini` file:
```ini
[repository.pull-request]
+1 -1
View File
@@ -29,5 +29,5 @@ were added.
Example of changing a repository's visibility to public:
```shell
git push -o repo.private=false -u origin master
git push -o repo.private=false -u origin main
```
+1 -1
View File
@@ -29,5 +29,5 @@ Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/g
以下範例修改儲存庫的可見性為公開:
```shell
git push -o repo.private=false -u origin master
git push -o repo.private=false -u origin main
```
@@ -0,0 +1,40 @@
---
date: "2020-07-06T16:00:00+02:00"
title: "Usage: Push To Create"
slug: "push-to-create"
weight: 15
toc: false
draft: false
menu:
sidebar:
parent: "usage"
name: "Push To Create"
weight: 15
identifier: "push-to-create"
---
# Push To Create
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default.
## Enabling Push To Create
In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository-repository" >}}).
## Using Push To Create
Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command:
```shell
# Add the remote you want to push to
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git
# push to the remote
git push -u origin main
```
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.
## Push options (bonus)
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. To explicitly set the visibility, you can use a [push option]({{< relref "doc/usage/push-options.en-us.md" >}}).
+4 -5
View File
@@ -78,7 +78,7 @@ require (
github.com/minio/minio-go/v7 v7.0.49
github.com/minio/sha256-simd v1.0.0
github.com/msteinert/pam v1.1.0
github.com/nektos/act v0.0.0
github.com/nektos/act v0.2.43
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/niklasfasching/go-org v1.6.5
github.com/oliamb/cutter v0.2.2
@@ -106,7 +106,7 @@ require (
golang.org/x/crypto v0.6.0
golang.org/x/net v0.7.0
golang.org/x/oauth2 v0.5.0
golang.org/x/sys v0.5.0
golang.org/x/sys v0.6.0
golang.org/x/text v0.7.0
golang.org/x/tools v0.6.0
google.golang.org/grpc v1.53.0
@@ -174,7 +174,6 @@ require (
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
@@ -240,7 +239,7 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rhysd/actionlint v1.6.22 // indirect
github.com/rhysd/actionlint v1.6.23 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
@@ -287,7 +286,7 @@ replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142
replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix
replace github.com/nektos/act => gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744
replace github.com/nektos/act => gitea.com/gitea/act v0.243.1
exclude github.com/gofrs/uuid v3.2.0+incompatible
+8 -10
View File
@@ -52,8 +52,8 @@ codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570/go.mod h1:IIAjsi
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg=
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs=
gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744 h1:cqzKmGlX0wynSXO04NILpL25eBGwogDrKpkkbwmIpj4=
gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744/go.mod h1:2C/WbTalu1VPNgbVaZJaZDzlOtAKqkXJhdOClxkMy14=
gitea.com/gitea/act v0.243.1 h1:zIVlhGOLE4SHFPW++u3+5Y/jX5mub3QIhB13oNf6rtA=
gitea.com/gitea/act v0.243.1/go.mod h1:iLHCXqOPUElA2nSyHo4wtxSmvdkym3WU7CkP3AxF39Q=
gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681 h1:MMSPgnVULVwV9kEBgvyEUhC9v/uviZ55hPJEMjpbNR4=
gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681/go.mod h1:77TZu701zMXWJFvB8gvTbQ92zQ3DQq/H7l5wAEjQRKc=
gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0=
@@ -385,8 +385,6 @@ github.com/go-git/go-git/v5 v5.5.2/go.mod h1:BE5hUJ5yaV2YMxhmaP4l6RBQ08kMxKSPD4B
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
@@ -741,7 +739,7 @@ github.com/jhillyerd/enmime v0.10.1 h1:3VP8gFhK7R948YJBrna5bOgnTXEuPAoICo79kKkBK
github.com/jhillyerd/enmime v0.10.1/go.mod h1:Qpe8EEemJMFAF8+NZoWdpXvK2Yb9dRF0k/z6mkcDHsA=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
@@ -1046,8 +1044,8 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rhysd/actionlint v1.6.22 h1:cAEf2PGNwJXhdcTVF2xS/0ORqWS+ueUHwjQYsqFsGSk=
github.com/rhysd/actionlint v1.6.22/go.mod h1:gIKOdxtV40mBOcD0ZR8EBa8NqjEXToAZioroS3oedMg=
github.com/rhysd/actionlint v1.6.23 h1:041VOXgZddfvSJa9Il+WT3Iwuo/j0Nmu4bhpAScrds4=
github.com/rhysd/actionlint v1.6.23/go.mod h1:o5qc1K3I9taGMBhL7mVkpRd64hx3YqI+3t8ewGfYXfE=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
@@ -1504,14 +1502,14 @@ golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+11
View File
@@ -128,6 +128,17 @@ func (run *ActionRun) GetPushEventPayload() (*api.PushPayload, error) {
return nil, fmt.Errorf("event %s is not a push event", run.Event)
}
func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, error) {
if run.Event == webhook_module.HookEventPullRequest {
var payload api.PullRequestPayload
if err := json.Unmarshal([]byte(run.EventPayload), &payload); err != nil {
return nil, err
}
return &payload, nil
}
return nil, fmt.Errorf("event %s is not a pull request event", run.Event)
}
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
_, err := db.GetEngine(ctx).ID(repo.ID).
SetExpr("num_action_runs",
+1
View File
@@ -25,6 +25,7 @@ type ActionRunner struct {
ID int64
UUID string `xorm:"CHAR(36) UNIQUE"`
Name string `xorm:"VARCHAR(255)"`
Version string `xorm:"VARCHAR(64)"`
OwnerID int64 `xorm:"index"` // org level runner, 0 means system
Owner *user_model.User `xorm:"-"`
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global
+4
View File
@@ -1,6 +1,7 @@
-
id: 1
title: First project
owner_id: 0
repo_id: 1
is_closed: false
creator_id: 2
@@ -10,6 +11,7 @@
-
id: 2
title: second project
owner_id: 0
repo_id: 3
is_closed: false
creator_id: 3
@@ -19,6 +21,7 @@
-
id: 3
title: project on repo with disabled project
owner_id: 0
repo_id: 4
is_closed: true
creator_id: 5
@@ -29,6 +32,7 @@
id: 4
title: project on user2
owner_id: 2
repo_id: 0
is_closed: false
creator_id: 2
board_type: 1
+1 -1
View File
@@ -25,7 +25,7 @@
fork_id: 0
is_template: false
template_id: 0
size: 7028
size: 7320
is_fsck_enabled: true
close_issues_via_commit_in_any_branch: false
+3 -3
View File
@@ -34,7 +34,7 @@ func init() {
// BeforeInsert is invoked from XORM before inserting an object of this type.
func (l *LFSLock) BeforeInsert() {
l.Path = util.CleanPath(l.Path)
l.Path = util.PathJoinRel(l.Path)
}
// CreateLFSLock creates a new lock.
@@ -49,7 +49,7 @@ func CreateLFSLock(ctx context.Context, repo *repo_model.Repository, lock *LFSLo
return nil, err
}
lock.Path = util.CleanPath(lock.Path)
lock.Path = util.PathJoinRel(lock.Path)
lock.RepoID = repo.ID
l, err := GetLFSLock(dbCtx, repo, lock.Path)
@@ -69,7 +69,7 @@ func CreateLFSLock(ctx context.Context, repo *repo_model.Repository, lock *LFSLo
// GetLFSLock returns release by given path.
func GetLFSLock(ctx context.Context, repo *repo_model.Repository, path string) (*LFSLock, error) {
path = util.CleanPath(path)
path = util.PathJoinRel(path)
rel := &LFSLock{RepoID: repo.ID}
has, err := db.GetEngine(ctx).Where("lower(path) = ?", strings.ToLower(path)).Get(rel)
if err != nil {
+2 -2
View File
@@ -660,10 +660,10 @@ func GetPullRequestByIssueID(ctx context.Context, issueID int64) (*PullRequest,
// GetAllUnmergedAgitPullRequestByPoster get all unmerged agit flow pull request
// By poster id.
func GetAllUnmergedAgitPullRequestByPoster(uid int64) ([]*PullRequest, error) {
func GetAllUnmergedAgitPullRequestByPoster(ctx context.Context, uid int64) ([]*PullRequest, error) {
pulls := make([]*PullRequest, 0, 10)
err := db.GetEngine(db.DefaultContext).
err := db.GetEngine(ctx).
Where("has_merged=? AND flow = ? AND issue.is_closed=? AND issue.poster_id=?",
false, PullRequestFlowAGit, false, uid).
Join("INNER", "issue", "issue.id=pull_request.issue_id").
@@ -4,7 +4,6 @@
org_id: 0
name: label1
color: '#abcdef'
exclusive: false
num_issues: 2
num_closed_issues: 0
@@ -14,7 +13,6 @@
org_id: 0
name: label2
color: '#000000'
exclusive: false
num_issues: 1
num_closed_issues: 1
-
@@ -23,7 +21,6 @@
org_id: 3
name: orglabel3
color: '#abcdef'
exclusive: false
num_issues: 0
num_closed_issues: 0
@@ -33,7 +30,6 @@
org_id: 3
name: orglabel4
color: '#000000'
exclusive: false
num_issues: 1
num_closed_issues: 0
@@ -43,6 +39,5 @@
org_id: 0
name: pull-test-label
color: '#000000'
exclusive: false
num_issues: 0
num_closed_issues: 0
+6
View File
@@ -469,6 +469,12 @@ var migrations = []Migration{
NewMigration("Add NeedApproval to actions tables", v1_20.AddNeedApprovalToActionRun),
// v245 -> v246
NewMigration("Rename Webhook org_id to owner_id", v1_20.RenameWebhookOrgToOwner),
// v246 -> v247
NewMigration("Add missed column owner_id for project table", v1_20.AddNewColumnForProject),
// v247 -> v248
NewMigration("Fix incorrect project type", v1_20.FixIncorrectProjectType),
// v248 -> v249
NewMigration("Add version column to action_runner table", v1_20.AddVersionToActionRunner),
// to modify later
NewMigration("add size limit on repository", v1_20.AddSizeLimitOnRepo),
}
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_20 //nolint
import (
"xorm.io/xorm"
)
func AddNewColumnForProject(x *xorm.Engine) error {
type Project struct {
OwnerID int64 `xorm:"INDEX"`
}
return x.Sync(new(Project))
}
+50
View File
@@ -0,0 +1,50 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_20 //nolint
import (
"code.gitea.io/gitea/modules/log"
"xorm.io/xorm"
)
// FixIncorrectProjectType: set individual project's type from 3(TypeOrganization) to 1(TypeIndividual)
func FixIncorrectProjectType(x *xorm.Engine) error {
type User struct {
ID int64 `xorm:"pk autoincr"`
Type int
}
const (
UserTypeIndividual int = 0
TypeIndividual uint8 = 1
TypeOrganization uint8 = 3
)
type Project struct {
OwnerID int64 `xorm:"INDEX"`
Type uint8
Owner *User `xorm:"extends"`
}
sess := x.NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return err
}
count, err := sess.Table("project").
Where("type = ? AND owner_id IN (SELECT id FROM `user` WHERE type = ?)", TypeOrganization, UserTypeIndividual).
Update(&Project{
Type: TypeIndividual,
})
if err != nil {
return err
}
log.Debug("Updated %d projects to belong to a user instead of an organization", count)
return sess.Commit()
}
+14
View File
@@ -0,0 +1,14 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_20 //nolint
import "xorm.io/xorm"
func AddVersionToActionRunner(x *xorm.Engine) error {
type ActionRunner struct {
Version string `xorm:"VARCHAR(64)"` // the version of act_runner
}
return x.Sync(new(ActionRunner))
}
+3
View File
@@ -24,6 +24,7 @@ import (
"code.gitea.io/gitea/modules/packages/pub"
"code.gitea.io/gitea/modules/packages/pypi"
"code.gitea.io/gitea/modules/packages/rubygems"
"code.gitea.io/gitea/modules/packages/swift"
"code.gitea.io/gitea/modules/packages/vagrant"
"github.com/hashicorp/go-version"
@@ -159,6 +160,8 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc
metadata = &pypi.Metadata{}
case TypeRubyGems:
metadata = &rubygems.Metadata{}
case TypeSwift:
metadata = &swift.Metadata{}
case TypeVagrant:
metadata = &vagrant.Metadata{}
default:
+6
View File
@@ -44,6 +44,7 @@ const (
TypePub Type = "pub"
TypePyPI Type = "pypi"
TypeRubyGems Type = "rubygems"
TypeSwift Type = "swift"
TypeVagrant Type = "vagrant"
)
@@ -62,6 +63,7 @@ var TypeList = []Type{
TypePub,
TypePyPI,
TypeRubyGems,
TypeSwift,
TypeVagrant,
}
@@ -96,6 +98,8 @@ func (pt Type) Name() string {
return "PyPI"
case TypeRubyGems:
return "RubyGems"
case TypeSwift:
return "Swift"
case TypeVagrant:
return "Vagrant"
}
@@ -133,6 +137,8 @@ func (pt Type) SVGName() string {
return "gitea-python"
case TypeRubyGems:
return "gitea-rubygems"
case TypeSwift:
return "gitea-swift"
case TypeVagrant:
return "gitea-vagrant"
}
+12 -1
View File
@@ -144,10 +144,21 @@ func (p *Project) Link() string {
return ""
}
func (p *Project) IconName() string {
if p.IsRepositoryProject() {
return "octicon-project"
}
return "octicon-project-symlink"
}
func (p *Project) IsOrganizationProject() bool {
return p.Type == TypeOrganization
}
func (p *Project) IsRepositoryProject() bool {
return p.Type == TypeRepository
}
func init() {
db.RegisterModel(new(Project))
}
@@ -172,7 +183,7 @@ func GetCardConfig() []CardConfig {
// IsTypeValid checks if a project type is valid
func IsTypeValid(p Type) bool {
switch p {
case TypeRepository, TypeOrganization:
case TypeIndividual, TypeRepository, TypeOrganization:
return true
default:
return false
+1 -1
View File
@@ -20,7 +20,7 @@ func TestIsProjectTypeValid(t *testing.T) {
typ Type
valid bool
}{
{TypeIndividual, false},
{TypeIndividual, true},
{TypeRepository, true},
{TypeOrganization, true},
{UnknownType, false},
+22
View File
@@ -253,6 +253,28 @@ func GetReleasesByRepoID(ctx context.Context, repoID int64, opts FindReleasesOpt
return rels, sess.Find(&rels)
}
// GetTagNamesByRepoID returns a list of release tag names of repository.
func GetTagNamesByRepoID(ctx context.Context, repoID int64) ([]string, error) {
listOptions := db.ListOptions{
ListAll: true,
}
opts := FindReleasesOptions{
ListOptions: listOptions,
IncludeDrafts: true,
IncludeTags: true,
HasSha1: util.OptionalBoolTrue,
}
tags := make([]string, 0)
sess := db.GetEngine(ctx).
Table("release").
Desc("created_unix", "id").
Where(opts.toConds(repoID)).
Cols("tag_name")
return tags, sess.Find(&tags)
}
// CountReleasesByRepoID returns a number of releases matching FindReleaseOptions and RepoID.
func CountReleasesByRepoID(repoID int64, opts FindReleasesOptions) (int64, error) {
return db.GetEngine(db.DefaultContext).Where(opts.toConds(repoID)).Count(new(Release))
+3 -7
View File
@@ -62,7 +62,8 @@ func RepositoryListOfMap(repoMap map[int64]*Repository) RepositoryList {
return RepositoryList(ValuesRepository(repoMap))
}
func (repos RepositoryList) loadAttributes(ctx context.Context) error {
// LoadAttributes loads the attributes for the given RepositoryList
func (repos RepositoryList) LoadAttributes(ctx context.Context) error {
if len(repos) == 0 {
return nil
}
@@ -107,11 +108,6 @@ func (repos RepositoryList) loadAttributes(ctx context.Context) error {
return nil
}
// LoadAttributes loads the attributes for the given RepositoryList
func (repos RepositoryList) LoadAttributes() error {
return repos.loadAttributes(db.DefaultContext)
}
// SearchRepoOptions holds the search options
type SearchRepoOptions struct {
db.ListOptions
@@ -547,7 +543,7 @@ func SearchRepositoryByCondition(ctx context.Context, opts *SearchRepoOptions, c
}
if loadAttributes {
if err := repos.loadAttributes(ctx); err != nil {
if err := repos.LoadAttributes(ctx); err != nil {
return nil, 0, fmt.Errorf("LoadAttributes: %w", err)
}
}
+9
View File
@@ -22,6 +22,8 @@ type SearchUserOptions struct {
Keyword string
Type UserType
UID int64
LoginName string // this option should be used only for admin user
SourceID int64 // this option should be used only for admin user
OrderBy db.SearchOrderBy
Visible []structs.VisibleType
Actor *User // The user doing the search
@@ -62,6 +64,13 @@ func (opts *SearchUserOptions) toSearchQueryBase() *xorm.Session {
cond = cond.And(builder.Eq{"id": opts.UID})
}
if opts.SourceID > 0 {
cond = cond.And(builder.Eq{"login_source": opts.SourceID})
}
if opts.LoginName != "" {
cond = cond.And(builder.Eq{"login_name": opts.LoginName})
}
if !opts.IsActive.IsNone() {
cond = cond.And(builder.Eq{"is_active": opts.IsActive.IsTrue()})
}
+2 -2
View File
@@ -742,13 +742,13 @@ func VerifyUserActiveCode(code string) (user *User) {
}
// ChangeUserName changes all corresponding setting from old user name to new one.
func ChangeUserName(u *User, newUserName string) (err error) {
func ChangeUserName(ctx context.Context, u *User, newUserName string) (err error) {
oldUserName := u.Name
if err = IsUsableUsername(newUserName); err != nil {
return err
}
ctx, committer, err := db.TxContext(db.DefaultContext)
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return err
}
+41
View File
@@ -0,0 +1,41 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package actions
import (
webhook_module "code.gitea.io/gitea/modules/webhook"
"github.com/nektos/act/pkg/jobparser"
)
const (
githubEventPullRequest = "pull_request"
githubEventPullRequestTarget = "pull_request_target"
githubEventPullRequestReviewComment = "pull_request_review_comment"
githubEventPullRequestReview = "pull_request_review"
githubEventRegistryPackage = "registry_package"
githubEventCreate = "create"
githubEventDelete = "delete"
githubEventFork = "fork"
githubEventPush = "push"
githubEventIssues = "issues"
githubEventIssueComment = "issue_comment"
githubEventRelease = "release"
githubEventPullRequestComment = "pull_request_comment"
)
func convertFromGithubEvent(evt *jobparser.Event) string {
switch evt.Name {
case githubEventPullRequest, githubEventPullRequestTarget, githubEventPullRequestReview,
githubEventPullRequestReviewComment:
return string(webhook_module.HookEventPullRequest)
case githubEventRegistryPackage:
return string(webhook_module.HookEventPackage)
case githubEventCreate, githubEventDelete, githubEventFork, githubEventPush,
githubEventIssues, githubEventIssueComment, githubEventRelease, githubEventPullRequestComment:
fallthrough
default:
return evt.Name
}
}
+207 -134
View File
@@ -44,6 +44,32 @@ func ListWorkflows(commit *git.Commit) (git.Entries, error) {
return ret, nil
}
func GetContentFromEntry(entry *git.TreeEntry) ([]byte, error) {
f, err := entry.Blob().DataAsync()
if err != nil {
return nil, err
}
content, err := io.ReadAll(f)
_ = f.Close()
if err != nil {
return nil, err
}
return content, nil
}
func GetEventsFromContent(content []byte) ([]*jobparser.Event, error) {
workflow, err := model.ReadWorkflow(bytes.NewReader(content))
if err != nil {
return nil, err
}
events, err := jobparser.ParseRawOn(&workflow.RawOn)
if err != nil {
return nil, err
}
return events, nil
}
func DetectWorkflows(commit *git.Commit, triggedEvent webhook_module.HookEventType, payload api.Payloader) (map[string][]byte, error) {
entries, err := ListWorkflows(commit)
if err != nil {
@@ -52,29 +78,17 @@ func DetectWorkflows(commit *git.Commit, triggedEvent webhook_module.HookEventTy
workflows := make(map[string][]byte, len(entries))
for _, entry := range entries {
f, err := entry.Blob().DataAsync()
content, err := GetContentFromEntry(entry)
if err != nil {
return nil, err
}
content, err := io.ReadAll(f)
_ = f.Close()
if err != nil {
return nil, err
}
workflow, err := model.ReadWorkflow(bytes.NewReader(content))
if err != nil {
log.Warn("ignore invalid workflow %q: %v", entry.Name(), err)
continue
}
events, err := jobparser.ParseRawOn(&workflow.RawOn)
events, err := GetEventsFromContent(content)
if err != nil {
log.Warn("ignore invalid workflow %q: %v", entry.Name(), err)
continue
}
for _, evt := range events {
if evt.Name != triggedEvent.Event() {
continue
}
log.Trace("detect workflow %q for event %#v matching %q", entry.Name(), evt, triggedEvent)
if detectMatched(commit, triggedEvent, payload, evt) {
workflows[entry.Name()] = content
}
@@ -85,138 +99,197 @@ func DetectWorkflows(commit *git.Commit, triggedEvent webhook_module.HookEventTy
}
func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType, payload api.Payloader, evt *jobparser.Event) bool {
if convertFromGithubEvent(evt) != string(triggedEvent) {
return false
}
switch triggedEvent {
case webhook_module.HookEventCreate,
webhook_module.HookEventDelete,
webhook_module.HookEventFork,
webhook_module.HookEventIssueAssign,
webhook_module.HookEventIssueLabel,
webhook_module.HookEventIssueMilestone,
webhook_module.HookEventPullRequestAssign,
webhook_module.HookEventPullRequestLabel,
webhook_module.HookEventPullRequestMilestone,
webhook_module.HookEventPullRequestComment,
webhook_module.HookEventPullRequestReviewApproved,
webhook_module.HookEventPullRequestReviewRejected,
webhook_module.HookEventPullRequestReviewComment,
webhook_module.HookEventWiki,
webhook_module.HookEventRepository,
webhook_module.HookEventRelease,
webhook_module.HookEventPackage:
if len(evt.Acts) != 0 {
log.Warn("Ignore unsupported %s event arguments %q", triggedEvent, evt.Acts)
}
// no special filter parameters for these events, just return true if name matched
return true
case webhook_module.HookEventPush:
return matchPushEvent(commit, payload.(*api.PushPayload), evt)
case webhook_module.HookEventIssues:
return matchIssuesEvent(commit, payload.(*api.IssuePayload), evt)
case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync:
return matchPullRequestEvent(commit, payload.(*api.PullRequestPayload), evt)
case webhook_module.HookEventIssueComment:
return matchIssueCommentEvent(commit, payload.(*api.IssueCommentPayload), evt)
default:
log.Warn("unsupported event %q", triggedEvent)
return false
}
}
func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts) == 0 {
return true
}
switch triggedEvent {
case webhook_module.HookEventCreate:
fallthrough
case webhook_module.HookEventDelete:
fallthrough
case webhook_module.HookEventFork:
log.Warn("unsupported event %q", triggedEvent.Event())
return false
case webhook_module.HookEventPush:
pushPayload := payload.(*api.PushPayload)
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "branches", "tags":
refShortName := git.RefName(pushPayload.Ref).ShortName()
for _, val := range vals {
if glob.MustCompile(val, '/').Match(refShortName) {
matchTimes++
break
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "branches", "tags":
refShortName := git.RefName(pushPayload.Ref).ShortName()
for _, val := range vals {
if glob.MustCompile(val, '/').Match(refShortName) {
matchTimes++
break
}
case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
for _, val := range vals {
matched := false
for _, file := range filesChanged {
if glob.MustCompile(val, '/').Match(file) {
matched = true
break
}
}
if matched {
matchTimes++
}
case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
for _, val := range vals {
matched := false
for _, file := range filesChanged {
if glob.MustCompile(val, '/').Match(file) {
matched = true
break
}
}
}
default:
log.Warn("unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts)
case webhook_module.HookEventIssues:
fallthrough
case webhook_module.HookEventIssueAssign:
fallthrough
case webhook_module.HookEventIssueLabel:
fallthrough
case webhook_module.HookEventIssueMilestone:
fallthrough
case webhook_module.HookEventIssueComment:
fallthrough
case webhook_module.HookEventPullRequest:
prPayload := payload.(*api.PullRequestPayload)
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "types":
for _, val := range vals {
if glob.MustCompile(val, '/').Match(string(prPayload.Action)) {
if matched {
matchTimes++
break
}
}
case "branches":
refShortName := git.RefName(prPayload.PullRequest.Base.Ref).ShortName()
for _, val := range vals {
if glob.MustCompile(val, '/').Match(refShortName) {
matchTimes++
break
}
}
case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(prPayload.PullRequest.Base.Ref)
if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
for _, val := range vals {
matched := false
for _, file := range filesChanged {
if glob.MustCompile(val, '/').Match(file) {
matched = true
break
}
}
if matched {
matchTimes++
break
}
}
}
default:
log.Warn("unsupported condition %q", cond)
}
default:
log.Warn("push event unsupported condition %q", cond)
}
return matchTimes == len(evt.Acts)
case webhook_module.HookEventPullRequestAssign:
fallthrough
case webhook_module.HookEventPullRequestLabel:
fallthrough
case webhook_module.HookEventPullRequestMilestone:
fallthrough
case webhook_module.HookEventPullRequestComment:
fallthrough
case webhook_module.HookEventPullRequestReviewApproved:
fallthrough
case webhook_module.HookEventPullRequestReviewRejected:
fallthrough
case webhook_module.HookEventPullRequestReviewComment:
fallthrough
case webhook_module.HookEventPullRequestSync:
fallthrough
case webhook_module.HookEventWiki:
fallthrough
case webhook_module.HookEventRepository:
fallthrough
case webhook_module.HookEventRelease:
fallthrough
case webhook_module.HookEventPackage:
fallthrough
default:
log.Warn("unsupported event %q", triggedEvent.Event())
}
return false
return matchTimes == len(evt.Acts)
}
func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts) == 0 {
return true
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "types":
for _, val := range vals {
if glob.MustCompile(val, '/').Match(string(issuePayload.Action)) {
matchTimes++
break
}
}
default:
log.Warn("issue event unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts)
}
func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts) == 0 {
// defaultly, only pull request opened and synchronized will trigger workflow
return prPayload.Action == api.HookIssueSynchronized || prPayload.Action == api.HookIssueOpened
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "types":
action := prPayload.Action
if prPayload.Action == api.HookIssueSynchronized {
action = "synchronize"
}
log.Trace("matching pull_request %s with %v", action, vals)
for _, val := range vals {
if glob.MustCompile(val, '/').Match(string(action)) {
matchTimes++
break
}
}
case "branches":
refShortName := git.RefName(prPayload.PullRequest.Base.Ref).ShortName()
for _, val := range vals {
if glob.MustCompile(val, '/').Match(refShortName) {
matchTimes++
break
}
}
case "paths":
filesChanged, err := commit.GetFilesChangedSinceCommit(prPayload.PullRequest.Base.Ref)
if err != nil {
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
} else {
for _, val := range vals {
matched := false
for _, file := range filesChanged {
if glob.MustCompile(val, '/').Match(file) {
matched = true
break
}
}
if matched {
matchTimes++
break
}
}
}
default:
log.Warn("pull request event unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts)
}
func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCommentPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts) == 0 {
return true
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts {
switch cond {
case "types":
for _, val := range vals {
if glob.MustCompile(val, '/').Match(string(issueCommentPayload.Action)) {
matchTimes++
break
}
}
default:
log.Warn("issue comment unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts)
}
+32
View File
@@ -16,8 +16,10 @@ import (
"net/http"
"net/url"
"path"
"regexp"
"strconv"
"strings"
texttemplate "text/template"
"time"
"code.gitea.io/gitea/models/db"
@@ -213,6 +215,8 @@ func (ctx *Context) RedirectToFirst(location ...string) {
ctx.Redirect(setting.AppSubURL + "/")
}
var templateExecutingErr = regexp.MustCompile(`^template: (.*):([1-9][0-9]*):([1-9][0-9]*): executing (?:"(.*)" at <(.*)>: )?`)
// HTML calls Context.HTML and renders the template to HTTP response
func (ctx *Context) HTML(status int, name base.TplName) {
log.Debug("Template: %s", name)
@@ -228,6 +232,34 @@ func (ctx *Context) HTML(status int, name base.TplName) {
ctx.PlainText(http.StatusInternalServerError, "Unable to find status/500 template")
return
}
if execErr, ok := err.(texttemplate.ExecError); ok {
if groups := templateExecutingErr.FindStringSubmatch(err.Error()); len(groups) > 0 {
errorTemplateName, lineStr, posStr := groups[1], groups[2], groups[3]
target := ""
if len(groups) == 6 {
target = groups[5]
}
line, _ := strconv.Atoi(lineStr) // Cannot error out as groups[2] is [1-9][0-9]*
pos, _ := strconv.Atoi(posStr) // Cannot error out as groups[3] is [1-9][0-9]*
filename, filenameErr := templates.GetAssetFilename("templates/" + errorTemplateName + ".tmpl")
if filenameErr != nil {
filename = "(template) " + errorTemplateName
}
if errorTemplateName != string(name) {
filename += " (subtemplate of " + string(name) + ")"
}
err = fmt.Errorf("%w\nin template file %s:\n%s", err, filename, templates.GetLineFromTemplate(errorTemplateName, line, target, pos))
} else {
filename, filenameErr := templates.GetAssetFilename("templates/" + execErr.Name + ".tmpl")
if filenameErr != nil {
filename = "(template) " + execErr.Name
}
if execErr.Name != string(name) {
filename += " (subtemplate of " + string(name) + ")"
}
err = fmt.Errorf("%w\nin template file %s", err, filename)
}
}
ctx.ServerError("Render failed", err)
}
}
+4 -3
View File
@@ -18,10 +18,11 @@ type Pagination struct {
urlParams []string
}
// NewPagination creates a new instance of the Pagination struct
func NewPagination(total, page, issueNum, numPages int) *Pagination {
// NewPagination creates a new instance of the Pagination struct.
// "pagingNum" is "page size" or "limit", "current" is "page"
func NewPagination(total, pagingNum, current, numPages int) *Pagination {
p := &Pagination{}
p.Paginater = paginator.New(total, page, issueNum, numPages)
p.Paginater = paginator.New(total, pagingNum, current, numPages)
return p
}
+2 -13
View File
@@ -660,20 +660,9 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
return
}
tags, err := ctx.Repo.GitRepo.GetTags(0, 0)
tags, err := repo_model.GetTagNamesByRepoID(ctx, ctx.Repo.Repository.ID)
if err != nil {
if strings.Contains(err.Error(), "fatal: not a git repository ") {
log.Error("Repository %-v has a broken repository on the file system: %s Error: %v", ctx.Repo.Repository, ctx.Repo.Repository.RepoPath(), err)
ctx.Repo.Repository.Status = repo_model.RepositoryBroken
ctx.Repo.Repository.IsEmpty = true
ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
// Only allow access to base of repo or settings
if !isHomeOrSettings {
ctx.Redirect(ctx.Repo.RepoLink)
}
return
}
ctx.ServerError("GetTags", err)
ctx.ServerError("GetTagNamesByRepoID", err)
return
}
ctx.Data["Tags"] = tags
+1 -1
View File
@@ -31,7 +31,7 @@ func commonCheckStorage(ctx context.Context, logger log.Logger, autofix bool, op
totalSize, orphanedSize := int64(0), int64(0)
var pathsToDelete []string
if err := opts.storer.IterateObjects(func(p string, obj storage.Object) error {
if err := opts.storer.IterateObjects("", func(p string, obj storage.Object) error {
defer obj.Close()
totalCount++
+4
View File
@@ -56,6 +56,10 @@ func LogNameStatusRepo(ctx context.Context, repository, head, treepath string, p
} else if treepath != "" {
files = append(files, treepath)
}
// Use the :(literal) pathspec magic to handle edge cases with files named like ":file.txt" or "*.jpg"
for i, file := range files {
files[i] = ":(literal)" + file
}
cmd.AddDashesAndList(files...)
go func() {
+4 -2
View File
@@ -36,6 +36,8 @@ var (
once sync.Once
cache *lru.TwoQueueCache
githubStyles = styles.Get("github")
)
// NewContext loads custom highlight map from local config
@@ -121,7 +123,7 @@ func CodeFromLexer(lexer chroma.Lexer, code string) string {
return code
}
// style not used for live site but need to pass something
err = formatter.Format(htmlw, styles.GitHub, iterator)
err = formatter.Format(htmlw, githubStyles, iterator)
if err != nil {
log.Error("Can't format code: %v", err)
return code
@@ -184,7 +186,7 @@ func File(fileName, language string, code []byte) ([]string, string, error) {
lines := make([]string, 0, len(tokensLines))
for _, tokens := range tokensLines {
iterator = chroma.Literator(tokens...)
err = formatter.Format(htmlBuf, styles.GitHub, iterator)
err = formatter.Format(htmlBuf, githubStyles, iterator)
if err != nil {
return nil, "", fmt.Errorf("can't format code: %w", err)
}
+53 -14
View File
@@ -7,36 +7,38 @@ import (
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
)
var directories = make(directorySet)
// Locale reads the content of a specific locale from static/bindata or custom path.
func Locale(name string) ([]byte, error) {
return fileFromDir(path.Join("locale", util.CleanPath(name)))
return fileFromOptionsDir("locale", name)
}
// Readme reads the content of a specific readme from static/bindata or custom path.
func Readme(name string) ([]byte, error) {
return fileFromDir(path.Join("readme", util.CleanPath(name)))
return fileFromOptionsDir("readme", name)
}
// Gitignore reads the content of a gitignore locale from static/bindata or custom path.
func Gitignore(name string) ([]byte, error) {
return fileFromDir(path.Join("gitignore", util.CleanPath(name)))
return fileFromOptionsDir("gitignore", name)
}
// License reads the content of a specific license from static/bindata or custom path.
func License(name string) ([]byte, error) {
return fileFromDir(path.Join("license", util.CleanPath(name)))
return fileFromOptionsDir("license", name)
}
// Labels reads the content of a specific labels from static/bindata or custom path.
func Labels(name string) ([]byte, error) {
return fileFromDir(path.Join("label", util.CleanPath(name)))
return fileFromOptionsDir("label", name)
}
// WalkLocales reads the content of a specific locale
@@ -79,17 +81,54 @@ func walkAssetDir(root string, callback func(path, name string, d fs.DirEntry, e
return nil
}
func statDirIfExist(dir string) ([]string, error) {
isDir, err := util.IsDir(dir)
// mustLocalPathAbs coverts a path to absolute path
// FIXME: the old behavior (StaticRootPath might not be absolute), not ideal, just keep the same as before
func mustLocalPathAbs(s string) string {
abs, err := filepath.Abs(s)
if err != nil {
return nil, fmt.Errorf("unable to check if static directory %s is a directory. %w", dir, err)
// This should never happen in a real system. If it happens, the user must have already been in trouble: the system is not able to resolve its own paths.
log.Fatal("Unable to get absolute path for %q: %v", s, err)
}
if !isDir {
return nil, nil
return abs
}
func joinLocalPaths(baseDirs []string, subDir string, elems ...string) (paths []string) {
abs := make([]string, len(elems)+2)
abs[1] = subDir
copy(abs[2:], elems)
for _, baseDir := range baseDirs {
abs[0] = mustLocalPathAbs(baseDir)
paths = append(paths, util.FilePathJoinAbs(abs...))
}
files, err := util.StatDir(dir, true)
if err != nil {
return nil, fmt.Errorf("unable to read directory %q. %w", dir, err)
return paths
}
func listLocalDirIfExist(baseDirs []string, subDir string, elems ...string) (files []string, err error) {
for _, localPath := range joinLocalPaths(baseDirs, subDir, elems...) {
isDir, err := util.IsDir(localPath)
if err != nil {
return nil, fmt.Errorf("unable to check if path %q is a directory. %w", localPath, err)
} else if !isDir {
continue
}
dirFiles, err := util.StatDir(localPath, true)
if err != nil {
return nil, fmt.Errorf("unable to read directory %q. %w", localPath, err)
}
files = append(files, dirFiles...)
}
return files, nil
}
func readLocalFile(baseDirs []string, subDir string, elems ...string) ([]byte, error) {
for _, localPath := range joinLocalPaths(baseDirs, subDir, elems...) {
data, err := os.ReadFile(localPath)
if err == nil {
return data, nil
} else if !os.IsNotExist(err) {
log.Error("Unable to read file %q. Error: %v", localPath, err)
}
}
return nil, os.ErrNotExist
}
+6 -42
View File
@@ -6,62 +6,26 @@
package options
import (
"fmt"
"os"
"path"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
)
var directories = make(directorySet)
// Dir returns all files from static or custom directory.
func Dir(name string) ([]string, error) {
if directories.Filled(name) {
return directories.Get(name), nil
}
var result []string
for _, dir := range []string{
path.Join(setting.CustomPath, "options", name), // custom dir
path.Join(setting.StaticRootPath, "options", name), // static dir
} {
files, err := statDirIfExist(dir)
if err != nil {
return nil, err
}
result = append(result, files...)
result, err := listLocalDirIfExist([]string{setting.CustomPath, setting.StaticRootPath}, "options", name)
if err != nil {
return nil, err
}
return directories.AddAndGet(name, result), nil
}
// fileFromDir is a helper to read files from static or custom path.
func fileFromDir(name string) ([]byte, error) {
customPath := path.Join(setting.CustomPath, "options", name)
isFile, err := util.IsFile(customPath)
if err != nil {
log.Error("Unable to check if %s is a file. Error: %v", customPath, err)
}
if isFile {
return os.ReadFile(customPath)
}
staticPath := path.Join(setting.StaticRootPath, "options", name)
isFile, err = util.IsFile(staticPath)
if err != nil {
log.Error("Unable to check if %s is a file. Error: %v", staticPath, err)
}
if isFile {
return os.ReadFile(staticPath)
}
return []byte{}, fmt.Errorf("Asset file does not exist: %s", name)
// fileFromOptionsDir is a helper to read files from custom or static path.
func fileFromOptionsDir(elems ...string) ([]byte, error) {
return readLocalFile([]string{setting.CustomPath, setting.StaticRootPath}, "options", elems...)
}
// IsDynamic will return false when using embedded data (-tags bindata)
+10 -29
View File
@@ -8,33 +8,20 @@ package options
import (
"fmt"
"io"
"os"
"path"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
)
var directories = make(directorySet)
// Dir returns all files from bindata or custom directory.
// Dir returns all files from custom directory or bindata.
func Dir(name string) ([]string, error) {
if directories.Filled(name) {
return directories.Get(name), nil
}
var result []string
for _, dir := range []string{
path.Join(setting.CustomPath, "options", name), // custom dir
// no static dir
} {
files, err := statDirIfExist(dir)
if err != nil {
return nil, err
}
result = append(result, files...)
result, err := listLocalDirIfExist([]string{setting.CustomPath}, "options", name)
if err != nil {
return nil, err
}
files, err := AssetDir(name)
@@ -64,24 +51,18 @@ func AssetDir(dirName string) ([]string, error) {
return results, nil
}
// fileFromDir is a helper to read files from bindata or custom path.
func fileFromDir(name string) ([]byte, error) {
customPath := path.Join(setting.CustomPath, "options", name)
isFile, err := util.IsFile(customPath)
if err != nil {
log.Error("Unable to check if %s is a file. Error: %v", customPath, err)
}
if isFile {
return os.ReadFile(customPath)
// fileFromOptionsDir is a helper to read files from custom path or bindata.
func fileFromOptionsDir(elems ...string) ([]byte, error) {
// only try custom dir, no static dir
if data, err := readLocalFile([]string{setting.CustomPath}, "options", elems...); err == nil {
return data, nil
}
f, err := Assets.Open(name)
f, err := Assets.Open(util.PathJoinRelX(elems...))
if err != nil {
return nil, err
}
defer f.Close()
return io.ReadAll(f)
}
+1
View File
@@ -223,6 +223,7 @@ func ParsePackage(r io.Reader) (*Package, error) {
OptionalDependencies: meta.OptionalDependencies,
Bin: meta.Bin,
Readme: meta.Readme,
Repository: meta.Repository,
},
}
+7
View File
@@ -26,6 +26,10 @@ func TestParsePackage(t *testing.T) {
packageDescription := "Test Description"
data := "H4sIAAAAAAAA/ytITM5OTE/VL4DQelnF+XkMVAYGBgZmJiYK2MRBwNDcSIHB2NTMwNDQzMwAqA7IMDUxA9LUdgg2UFpcklgEdAql5kD8ogCnhwio5lJQUMpLzE1VslJQcihOzi9I1S9JLS7RhSYIJR2QgrLUouLM/DyQGkM9Az1D3YIiqExKanFyUWZBCVQ2BKhVwQVJDKwosbQkI78IJO/tZ+LsbRykxFXLNdA+HwWjYBSMgpENACgAbtAACAAA"
integrity := "sha512-yA4FJsVhetynGfOC1jFf79BuS+jrHbm0fhh+aHzCQkOaOBXKf9oBnC4a6DnLLnEsHQDRLYd00cwj8sCXpC+wIg=="
repository := Repository{
Type: "gitea",
URL: "http://localhost:3000/gitea/test.git",
}
t.Run("InvalidUpload", func(t *testing.T) {
p, err := ParsePackage(bytes.NewReader([]byte{0}))
@@ -242,6 +246,7 @@ func TestParsePackage(t *testing.T) {
Dist: PackageDistribution{
Integrity: integrity,
},
Repository: repository,
},
},
},
@@ -272,5 +277,7 @@ func TestParsePackage(t *testing.T) {
assert.Equal(t, "https://gitea.io/", p.Metadata.ProjectURL)
assert.Contains(t, p.Metadata.Dependencies, "package")
assert.Equal(t, "1.2.0", p.Metadata.Dependencies["package"])
assert.Equal(t, repository.Type, p.Metadata.Repository.Type)
assert.Equal(t, repository.URL, p.Metadata.Repository.URL)
})
}
+1
View File
@@ -21,4 +21,5 @@ type Metadata struct {
OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"`
Bin map[string]string `json:"bin,omitempty"`
Readme string `json:"readme,omitempty"`
Repository Repository `json:"repository,omitempty"`
}
+214
View File
@@ -0,0 +1,214 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package swift
import (
"archive/zip"
"fmt"
"io"
"path"
"regexp"
"strings"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/validation"
"github.com/hashicorp/go-version"
)
var (
ErrMissingManifestFile = util.NewInvalidArgumentErrorf("Package.swift file is missing")
ErrManifestFileTooLarge = util.NewInvalidArgumentErrorf("Package.swift file is too large")
ErrInvalidManifestVersion = util.NewInvalidArgumentErrorf("manifest version is invalid")
manifestPattern = regexp.MustCompile(`\APackage(?:@swift-(\d+(?:\.\d+)?(?:\.\d+)?))?\.swift\z`)
toolsVersionPattern = regexp.MustCompile(`\A// swift-tools-version:(\d+(?:\.\d+)?(?:\.\d+)?)`)
)
const (
maxManifestFileSize = 128 * 1024
PropertyScope = "swift.scope"
PropertyName = "swift.name"
PropertyRepositoryURL = "swift.repository_url"
)
// Package represents a Swift package
type Package struct {
RepositoryURLs []string
Metadata *Metadata
}
// Metadata represents the metadata of a Swift package
type Metadata struct {
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
RepositoryURL string `json:"repository_url,omitempty"`
License string `json:"license,omitempty"`
Author Person `json:"author,omitempty"`
Manifests map[string]*Manifest `json:"manifests,omitempty"`
}
// Manifest represents a Package.swift file
type Manifest struct {
Content string `json:"content"`
ToolsVersion string `json:"tools_version,omitempty"`
}
// https://schema.org/SoftwareSourceCode
type SoftwareSourceCode struct {
Context []string `json:"@context"`
Type string `json:"@type"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
CodeRepository string `json:"codeRepository,omitempty"`
License string `json:"license,omitempty"`
Author Person `json:"author"`
ProgrammingLanguage ProgrammingLanguage `json:"programmingLanguage"`
RepositoryURLs []string `json:"repositoryURLs,omitempty"`
}
// https://schema.org/ProgrammingLanguage
type ProgrammingLanguage struct {
Type string `json:"@type"`
Name string `json:"name"`
URL string `json:"url"`
}
// https://schema.org/Person
type Person struct {
Type string `json:"@type,omitempty"`
GivenName string `json:"givenName,omitempty"`
MiddleName string `json:"middleName,omitempty"`
FamilyName string `json:"familyName,omitempty"`
}
func (p Person) String() string {
var sb strings.Builder
if p.GivenName != "" {
sb.WriteString(p.GivenName)
}
if p.MiddleName != "" {
if sb.Len() > 0 {
sb.WriteRune(' ')
}
sb.WriteString(p.MiddleName)
}
if p.FamilyName != "" {
if sb.Len() > 0 {
sb.WriteRune(' ')
}
sb.WriteString(p.FamilyName)
}
return sb.String()
}
// ParsePackage parses the Swift package upload
func ParsePackage(sr io.ReaderAt, size int64, mr io.Reader) (*Package, error) {
zr, err := zip.NewReader(sr, size)
if err != nil {
return nil, err
}
p := &Package{
Metadata: &Metadata{
Manifests: make(map[string]*Manifest),
},
}
for _, file := range zr.File {
manifestMatch := manifestPattern.FindStringSubmatch(path.Base(file.Name))
if len(manifestMatch) == 0 {
continue
}
if file.UncompressedSize64 > maxManifestFileSize {
return nil, ErrManifestFileTooLarge
}
f, err := zr.Open(file.Name)
if err != nil {
return nil, err
}
content, err := io.ReadAll(f)
if err := f.Close(); err != nil {
return nil, err
}
if err != nil {
return nil, err
}
swiftVersion := ""
if len(manifestMatch) == 2 && manifestMatch[1] != "" {
v, err := version.NewSemver(manifestMatch[1])
if err != nil {
return nil, ErrInvalidManifestVersion
}
swiftVersion = TrimmedVersionString(v)
}
manifest := &Manifest{
Content: string(content),
}
toolsMatch := toolsVersionPattern.FindStringSubmatch(manifest.Content)
if len(toolsMatch) == 2 {
v, err := version.NewSemver(toolsMatch[1])
if err != nil {
return nil, ErrInvalidManifestVersion
}
manifest.ToolsVersion = TrimmedVersionString(v)
}
p.Metadata.Manifests[swiftVersion] = manifest
}
if _, found := p.Metadata.Manifests[""]; !found {
return nil, ErrMissingManifestFile
}
if mr != nil {
var ssc *SoftwareSourceCode
if err := json.NewDecoder(mr).Decode(&ssc); err != nil {
return nil, err
}
p.Metadata.Description = ssc.Description
p.Metadata.Keywords = ssc.Keywords
p.Metadata.License = ssc.License
p.Metadata.Author = Person{
GivenName: ssc.Author.GivenName,
MiddleName: ssc.Author.MiddleName,
FamilyName: ssc.Author.FamilyName,
}
p.Metadata.RepositoryURL = ssc.CodeRepository
if !validation.IsValidURL(p.Metadata.RepositoryURL) {
p.Metadata.RepositoryURL = ""
}
p.RepositoryURLs = ssc.RepositoryURLs
}
return p, nil
}
// TrimmedVersionString returns the version string without the patch segment if it is zero
func TrimmedVersionString(v *version.Version) string {
segments := v.Segments64()
var b strings.Builder
fmt.Fprintf(&b, "%d.%d", segments[0], segments[1])
if segments[2] != 0 {
fmt.Fprintf(&b, ".%d", segments[2])
}
return b.String()
}
+144
View File
@@ -0,0 +1,144 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package swift
import (
"archive/zip"
"bytes"
"strings"
"testing"
"github.com/hashicorp/go-version"
"github.com/stretchr/testify/assert"
)
const (
packageName = "gitea"
packageVersion = "1.0.1"
packageDescription = "Package Description"
packageRepositoryURL = "https://gitea.io/gitea/gitea"
packageAuthor = "KN4CK3R"
packageLicense = "MIT"
)
func TestParsePackage(t *testing.T) {
createArchive := func(files map[string][]byte) *bytes.Reader {
var buf bytes.Buffer
zw := zip.NewWriter(&buf)
for filename, content := range files {
w, _ := zw.Create(filename)
w.Write(content)
}
zw.Close()
return bytes.NewReader(buf.Bytes())
}
t.Run("MissingManifestFile", func(t *testing.T) {
data := createArchive(map[string][]byte{"dummy.txt": {}})
p, err := ParsePackage(data, data.Size(), nil)
assert.Nil(t, p)
assert.ErrorIs(t, err, ErrMissingManifestFile)
})
t.Run("ManifestFileTooLarge", func(t *testing.T) {
data := createArchive(map[string][]byte{
"Package.swift": make([]byte, maxManifestFileSize+1),
})
p, err := ParsePackage(data, data.Size(), nil)
assert.Nil(t, p)
assert.ErrorIs(t, err, ErrManifestFileTooLarge)
})
t.Run("WithoutMetadata", func(t *testing.T) {
content1 := "// swift-tools-version:5.7\n//\n// Package.swift"
content2 := "// swift-tools-version:5.6\n//\n// Package@swift-5.6.swift"
data := createArchive(map[string][]byte{
"Package.swift": []byte(content1),
"Package@swift-5.5.swift": []byte(content2),
})
p, err := ParsePackage(data, data.Size(), nil)
assert.NotNil(t, p)
assert.NoError(t, err)
assert.NotNil(t, p.Metadata)
assert.Empty(t, p.RepositoryURLs)
assert.Len(t, p.Metadata.Manifests, 2)
m := p.Metadata.Manifests[""]
assert.Equal(t, "5.7", m.ToolsVersion)
assert.Equal(t, content1, m.Content)
m = p.Metadata.Manifests["5.5"]
assert.Equal(t, "5.6", m.ToolsVersion)
assert.Equal(t, content2, m.Content)
})
t.Run("WithMetadata", func(t *testing.T) {
data := createArchive(map[string][]byte{
"Package.swift": []byte("// swift-tools-version:5.7\n//\n// Package.swift"),
})
p, err := ParsePackage(
data,
data.Size(),
strings.NewReader(`{"name":"`+packageName+`","version":"`+packageVersion+`","description":"`+packageDescription+`","keywords":["swift","package"],"license":"`+packageLicense+`","codeRepository":"`+packageRepositoryURL+`","author":{"givenName":"`+packageAuthor+`"},"repositoryURLs":["`+packageRepositoryURL+`"]}`),
)
assert.NotNil(t, p)
assert.NoError(t, err)
assert.NotNil(t, p.Metadata)
assert.Len(t, p.Metadata.Manifests, 1)
m := p.Metadata.Manifests[""]
assert.Equal(t, "5.7", m.ToolsVersion)
assert.Equal(t, packageDescription, p.Metadata.Description)
assert.ElementsMatch(t, []string{"swift", "package"}, p.Metadata.Keywords)
assert.Equal(t, packageLicense, p.Metadata.License)
assert.Equal(t, packageAuthor, p.Metadata.Author.GivenName)
assert.Equal(t, packageRepositoryURL, p.Metadata.RepositoryURL)
assert.ElementsMatch(t, []string{packageRepositoryURL}, p.RepositoryURLs)
})
}
func TestTrimmedVersionString(t *testing.T) {
cases := []struct {
Version *version.Version
Expected string
}{
{
Version: version.Must(version.NewVersion("1")),
Expected: "1.0",
},
{
Version: version.Must(version.NewVersion("1.0")),
Expected: "1.0",
},
{
Version: version.Must(version.NewVersion("1.0.0")),
Expected: "1.0",
},
{
Version: version.Must(version.NewVersion("1.0.1")),
Expected: "1.0.1",
},
{
Version: version.Must(version.NewVersion("1.0+meta")),
Expected: "1.0",
},
{
Version: version.Must(version.NewVersion("1.0.0+meta")),
Expected: "1.0",
},
{
Version: version.Must(version.NewVersion("1.0.1+meta")),
Expected: "1.0.1",
},
}
for _, c := range cases {
assert.Equal(t, c.Expected, TrimmedVersionString(c.Version))
}
}
+8 -18
View File
@@ -45,29 +45,19 @@ func AssetsHandlerFunc(opts *Options) http.HandlerFunc {
return
}
file := req.URL.Path
file = file[len(opts.Prefix):]
if len(file) == 0 {
resp.WriteHeader(http.StatusNotFound)
return
}
if strings.Contains(file, "\\") {
resp.WriteHeader(http.StatusBadRequest)
return
}
file = "/" + file
var written bool
var corsSent bool
if opts.CorsHandler != nil {
written = true
opts.CorsHandler(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
written = false
corsSent = true
})).ServeHTTP(resp, req)
}
if written {
// If CORS is not sent, the response must have been written by other handlers
if !corsSent {
return
}
file := req.URL.Path[len(opts.Prefix):]
// custom files
if opts.handle(resp, req, http.Dir(custPath), file) {
return
@@ -102,8 +92,8 @@ func setWellKnownContentType(w http.ResponseWriter, file string) {
}
func (opts *Options) handle(w http.ResponseWriter, req *http.Request, fs http.FileSystem, file string) bool {
// use clean to keep the file is a valid path with no . or ..
f, err := fs.Open(util.CleanPath(file))
// actually, fs (http.FileSystem) is designed to be a safe interface, relative paths won't bypass its parent directory, it's also fine to do a clean here
f, err := fs.Open(util.PathJoinRelX(file))
if err != nil {
if os.IsNotExist(err) {
return false
+1 -1
View File
@@ -26,7 +26,7 @@ func loadAttachmentFrom(rootCfg ConfigProvider) {
Attachment.Storage = getStorage(rootCfg, "attachments", storageType, sec)
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4)
Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
Attachment.Enabled = sec.Key("ENABLED").MustBool(true)
+5 -1
View File
@@ -54,7 +54,11 @@ var (
// LoadDBSetting loads the database settings
func LoadDBSetting() {
sec := CfgProvider.Section("database")
loadDBSetting(CfgProvider)
}
func loadDBSetting(rootCfg ConfigProvider) {
sec := rootCfg.Section("database")
Database.Type = DatabaseType(sec.Key("DB_TYPE").String())
defaultCharset := "utf8"
+2
View File
@@ -39,6 +39,7 @@ var (
LimitSizePub int64
LimitSizePyPI int64
LimitSizeRubyGems int64
LimitSizeSwift int64
LimitSizeVagrant int64
}{
Enabled: true,
@@ -81,6 +82,7 @@ func loadPackagesFrom(rootCfg ConfigProvider) {
Packages.LimitSizePub = mustBytes(sec, "LIMIT_SIZE_PUB")
Packages.LimitSizePyPI = mustBytes(sec, "LIMIT_SIZE_PYPI")
Packages.LimitSizeRubyGems = mustBytes(sec, "LIMIT_SIZE_RUBYGEMS")
Packages.LimitSizeSwift = mustBytes(sec, "LIMIT_SIZE_SWIFT")
Packages.LimitSizeVagrant = mustBytes(sec, "LIMIT_SIZE_VAGRANT")
}
+13 -36
View File
@@ -12,7 +12,6 @@ import (
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
@@ -42,15 +41,13 @@ var (
AppWorkPath string
// Global setting objects
CfgProvider ConfigProvider
CustomPath string // Custom directory path
CustomConf string
PIDFile = "/run/gitea.pid"
WritePIDFile bool
RunMode string
RunUser string
IsProd bool
IsWindows bool
CfgProvider ConfigProvider
CustomPath string // Custom directory path
CustomConf string
RunMode string
RunUser string
IsProd bool
IsWindows bool
)
func getAppPath() (string, error) {
@@ -141,22 +138,6 @@ func IsRunUserMatchCurrentUser(runUser string) (string, bool) {
return currentUser, runUser == currentUser
}
func createPIDFile(pidPath string) {
currentPid := os.Getpid()
if err := os.MkdirAll(filepath.Dir(pidPath), os.ModePerm); err != nil {
log.Fatal("Failed to create PID folder: %v", err)
}
file, err := os.Create(pidPath)
if err != nil {
log.Fatal("Failed to create PID file: %v", err)
}
defer file.Close()
if _, err := file.WriteString(strconv.FormatInt(int64(currentPid), 10)); err != nil {
log.Fatal("Failed to write PID information: %v", err)
}
}
// SetCustomPathAndConf will set CustomPath and CustomConf with reference to the
// GITEA_CUSTOM environment variable and with provided overrides before stepping
// back to the default
@@ -218,17 +199,17 @@ func PrepareAppDataPath() error {
// InitProviderFromExistingFile initializes config provider from an existing config file (app.ini)
func InitProviderFromExistingFile() {
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, false, PIDFile, "")
CfgProvider = newFileProviderFromConf(CustomConf, false, "")
}
// InitProviderAllowEmpty initializes config provider from file, it's also fine that if the config file (app.ini) doesn't exist
func InitProviderAllowEmpty() {
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, true, PIDFile, "")
CfgProvider = newFileProviderFromConf(CustomConf, true, "")
}
// InitProviderAndLoadCommonSettingsForTest initializes config provider and load common setttings for tests
func InitProviderAndLoadCommonSettingsForTest(extraConfigs ...string) {
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, true, PIDFile, strings.Join(extraConfigs, "\n"))
CfgProvider = newFileProviderFromConf(CustomConf, true, strings.Join(extraConfigs, "\n"))
loadCommonSettingsFrom(CfgProvider)
if err := PrepareAppDataPath(); err != nil {
log.Fatal("Can not prepare APP_DATA_PATH: %v", err)
@@ -241,13 +222,9 @@ func InitProviderAndLoadCommonSettingsForTest(extraConfigs ...string) {
// newFileProviderFromConf initializes configuration context.
// NOTE: do not print any log except error.
func newFileProviderFromConf(customConf string, writePIDFile, allowEmpty bool, pidFile, extraConfig string) *ini.File {
func newFileProviderFromConf(customConf string, allowEmpty bool, extraConfig string) *ini.File {
cfg := ini.Empty()
if writePIDFile && len(pidFile) > 0 {
createPIDFile(pidFile)
}
isFile, err := util.IsFile(customConf)
if err != nil {
log.Error("Unable to check if %s is a file. Error: %v", customConf, err)
@@ -380,7 +357,7 @@ func CreateOrAppendToCustomConf(purpose string, callback func(cfg *ini.File)) {
// LoadSettings initializes the settings for normal start up
func LoadSettings() {
LoadDBSetting()
loadDBSetting(CfgProvider)
loadServiceFrom(CfgProvider)
loadOAuth2ClientFrom(CfgProvider)
InitLogs(false)
@@ -401,7 +378,7 @@ func LoadSettings() {
// LoadSettingsForInstall initializes the settings for install
func LoadSettingsForInstall() {
LoadDBSetting()
loadDBSetting(CfgProvider)
loadServiceFrom(CfgProvider)
loadMailerFrom(CfgProvider)
}
+1 -1
View File
@@ -90,6 +90,6 @@ func (s discardStorage) URL(_, _ string) (*url.URL, error) {
return nil, fmt.Errorf("%s", s)
}
func (s discardStorage) IterateObjects(_ func(string, Object) error) error {
func (s discardStorage) IterateObjects(_ string, _ func(string, Object) error) error {
return fmt.Errorf("%s", s)
}
+1 -1
View File
@@ -42,7 +42,7 @@ func Test_discardStorage(t *testing.T) {
assert.Errorf(t, err, string(tt))
}
{
err := tt.IterateObjects(func(_ string, _ Object) error { return nil })
err := tt.IterateObjects("", func(_ string, _ Object) error { return nil })
assert.Error(t, err, string(tt))
}
})
+12 -5
View File
@@ -5,11 +5,11 @@ package storage
import (
"context"
"fmt"
"io"
"net/url"
"os"
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/util"
@@ -41,13 +41,19 @@ func NewLocalStorage(ctx context.Context, cfg interface{}) (ObjectStorage, error
}
config := configInterface.(LocalStorageConfig)
if !filepath.IsAbs(config.Path) {
return nil, fmt.Errorf("LocalStorageConfig.Path should have been prepared by setting/storage.go and should be an absolute path, but not: %q", config.Path)
}
log.Info("Creating new Local Storage at %s", config.Path)
if err := os.MkdirAll(config.Path, os.ModePerm); err != nil {
return nil, err
}
if config.TemporaryPath == "" {
config.TemporaryPath = config.Path + "/tmp"
config.TemporaryPath = filepath.Join(config.Path, "tmp")
}
if !filepath.IsAbs(config.TemporaryPath) {
return nil, fmt.Errorf("LocalStorageConfig.TemporaryPath should be an absolute path, but not: %q", config.TemporaryPath)
}
return &LocalStorage{
@@ -58,7 +64,7 @@ func NewLocalStorage(ctx context.Context, cfg interface{}) (ObjectStorage, error
}
func (l *LocalStorage) buildLocalPath(p string) string {
return filepath.Join(l.dir, util.CleanPath(strings.ReplaceAll(p, "\\", "/")))
return util.FilePathJoinAbs(l.dir, p)
}
// Open a file
@@ -127,8 +133,9 @@ func (l *LocalStorage) URL(path, name string) (*url.URL, error) {
}
// IterateObjects iterates across the objects in the local storage
func (l *LocalStorage) IterateObjects(fn func(path string, obj Object) error) error {
return filepath.WalkDir(l.dir, func(path string, d os.DirEntry, err error) error {
func (l *LocalStorage) IterateObjects(prefix string, fn func(path string, obj Object) error) error {
dir := l.buildLocalPath(prefix)
return filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
}
+52 -10
View File
@@ -4,6 +4,10 @@
package storage
import (
"bytes"
"context"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
@@ -16,29 +20,29 @@ func TestBuildLocalPath(t *testing.T) {
expected string
}{
{
"a",
"/a",
"0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"/a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
},
{
"a",
"/a",
"../0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"/a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
},
{
"a",
"/a",
"0\\a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"/a/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
},
{
"b",
"/b",
"a/../0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"b/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"/b/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
},
{
"b",
"/b",
"a\\..\\0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"b/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
"/b/0/a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14",
},
}
@@ -50,3 +54,41 @@ func TestBuildLocalPath(t *testing.T) {
})
}
}
func TestLocalStorageIterator(t *testing.T) {
dir := filepath.Join(os.TempDir(), "TestLocalStorageIteratorTestDir")
l, err := NewLocalStorage(context.Background(), LocalStorageConfig{Path: dir})
assert.NoError(t, err)
testFiles := [][]string{
{"a/1.txt", "a1"},
{"/a/1.txt", "aa1"}, // same as above, but with leading slash that will be trim
{"b/1.txt", "b1"},
{"b/2.txt", "b2"},
{"b/3.txt", "b3"},
{"b/x 4.txt", "bx4"},
}
for _, f := range testFiles {
_, err = l.Save(f[0], bytes.NewBufferString(f[1]), -1)
assert.NoError(t, err)
}
expectedList := map[string][]string{
"a": {"a/1.txt"},
"b": {"b/1.txt", "b/2.txt", "b/3.txt", "b/x 4.txt"},
"": {"a/1.txt", "b/1.txt", "b/2.txt", "b/3.txt", "b/x 4.txt"},
"/": {"a/1.txt", "b/1.txt", "b/2.txt", "b/3.txt", "b/x 4.txt"},
"a/b/../../a": {"a/1.txt"},
}
for dir, expected := range expectedList {
count := 0
err = l.IterateObjects(dir, func(path string, f Object) error {
defer f.Close()
assert.Contains(t, expected, path)
count++
return nil
})
assert.NoError(t, err)
assert.Equal(t, count, len(expected))
}
}
+10 -4
View File
@@ -121,7 +121,7 @@ func NewMinioStorage(ctx context.Context, cfg interface{}) (ObjectStorage, error
}
func (m *MinioStorage) buildMinioPath(p string) string {
return strings.TrimPrefix(path.Join(m.basePath, util.CleanPath(strings.ReplaceAll(p, "\\", "/"))), "/")
return util.PathJoinRelX(m.basePath, p)
}
// Open open a file
@@ -209,12 +209,18 @@ func (m *MinioStorage) URL(path, name string) (*url.URL, error) {
}
// IterateObjects iterates across the objects in the miniostorage
func (m *MinioStorage) IterateObjects(fn func(path string, obj Object) error) error {
func (m *MinioStorage) IterateObjects(prefix string, fn func(path string, obj Object) error) error {
opts := minio.GetObjectOptions{}
lobjectCtx, cancel := context.WithCancel(m.ctx)
defer cancel()
basePath := m.basePath
if prefix != "" {
basePath = m.buildMinioPath(prefix)
}
for mObjInfo := range m.client.ListObjects(lobjectCtx, m.bucket, minio.ListObjectsOptions{
Prefix: m.basePath,
Prefix: basePath,
Recursive: true,
}) {
object, err := m.client.GetObject(lobjectCtx, m.bucket, mObjInfo.Key, opts)
@@ -223,7 +229,7 @@ func (m *MinioStorage) IterateObjects(fn func(path string, obj Object) error) er
}
if err := func(object *minio.Object, fn func(path string, obj Object) error) error {
defer object.Close()
return fn(strings.TrimPrefix(mObjInfo.Key, m.basePath), &minioObject{object})
return fn(strings.TrimPrefix(mObjInfo.Key, basePath), &minioObject{object})
}(object, fn); err != nil {
return convertMinioErr(err)
}
+2 -2
View File
@@ -65,7 +65,7 @@ type ObjectStorage interface {
Stat(path string) (os.FileInfo, error)
Delete(path string) error
URL(path, name string) (*url.URL, error)
IterateObjects(func(path string, obj Object) error) error
IterateObjects(path string, iterator func(path string, obj Object) error) error
}
// Copy copies a file from source ObjectStorage to dest ObjectStorage
@@ -87,7 +87,7 @@ func Copy(dstStorage ObjectStorage, dstPath string, srcStorage ObjectStorage, sr
// Clean delete all the objects in this storage
func Clean(storage ObjectStorage) error {
return storage.IterateObjects(func(path string, obj Object) error {
return storage.IterateObjects("", func(path string, obj Object) error {
_ = obj.Close()
return storage.Delete(path)
})
+9
View File
@@ -88,6 +88,9 @@ type Repository struct {
ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"`
HasPullRequests bool `json:"has_pull_requests"`
HasProjects bool `json:"has_projects"`
HasReleases bool `json:"has_releases"`
HasPackages bool `json:"has_packages"`
HasActions bool `json:"has_actions"`
IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"`
AllowMerge bool `json:"allow_merge_commits"`
AllowRebase bool `json:"allow_rebase"`
@@ -170,6 +173,12 @@ type EditRepoOption struct {
HasPullRequests *bool `json:"has_pull_requests,omitempty"`
// either `true` to enable project unit, or `false` to disable them.
HasProjects *bool `json:"has_projects,omitempty"`
// either `true` to enable releases unit, or `false` to disable them.
HasReleases *bool `json:"has_releases,omitempty"`
// either `true` to enable packages unit, or `false` to disable them.
HasPackages *bool `json:"has_packages,omitempty"`
// either `true` to enable actions unit, or `false` to disable them.
HasActions *bool `json:"has_actions,omitempty"`
// either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace.
IgnoreWhitespaceConflicts *bool `json:"ignore_whitespace_conflicts,omitempty"`
// either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.
+9
View File
@@ -93,3 +93,12 @@ type UserSettingsOptions struct {
HideEmail *bool `json:"hide_email"`
HideActivity *bool `json:"hide_activity"`
}
// RenameUserOption options when renaming a user
type RenameUserOption struct {
// New username for this user. This name cannot be in use yet by any other user.
//
// required: true
// unique: true
NewName string `json:"new_username" binding:"Required"`
}
+3
View File
@@ -1,4 +1,5 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
@@ -9,6 +10,8 @@ type Email struct {
Email string `json:"email"`
Verified bool `json:"verified"`
Primary bool `json:"primary"`
UserID int64 `json:"user_id"`
UserName string `json:"username"`
}
// CreateEmailOption options when creating email addresses
+6
View File
@@ -25,6 +25,12 @@ const defaultSize = 16
// Init discovers SVGs and populates the `SVGs` variable
func Init() {
SVGs = Discover()
// Remove `xmlns` because inline SVG does not need it
r := regexp.MustCompile(`(<svg\b[^>]*?)\s+xmlns="[^"]*"`)
for name, svg := range SVGs {
SVGs[name] = r.ReplaceAllString(svg, "$1")
}
}
// Render render icons - arguments icon name (string), size (int), class (string)
+3
View File
@@ -109,6 +109,9 @@ func NewFuncMap() []template.FuncMap {
"CustomEmojis": func() map[string]string {
return setting.UI.CustomEmojisMap
},
"IsShowFullName": func() bool {
return setting.UI.DefaultShowFullName
},
"Safe": Safe,
"SafeJS": SafeJS,
"JSEscape": JSEscape,
+28 -21
View File
@@ -118,7 +118,7 @@ func handleGenericTemplateError(err error) (string, []interface{}) {
lineNumber, _ := strconv.Atoi(lineNumberStr)
line := getLineFromAsset(templateName, lineNumber, "")
line := GetLineFromTemplate(templateName, lineNumber, "", -1)
return "PANIC: Unable to compile templates!\n%s in template file %s at line %d:\n\n%s\nStacktrace:\n\n%s", []interface{}{message, filename, lineNumber, log.NewColoredValue(line, log.Reset), log.Stack(2)}
}
@@ -140,7 +140,7 @@ func handleNotDefinedPanicError(err error) (string, []interface{}) {
lineNumber, _ := strconv.Atoi(lineNumberStr)
line := getLineFromAsset(templateName, lineNumber, functionName)
line := GetLineFromTemplate(templateName, lineNumber, functionName, -1)
return "PANIC: Unable to compile templates!\nUndefined function %q in template file %s at line %d:\n\n%s", []interface{}{functionName, filename, lineNumber, log.NewColoredValue(line, log.Reset)}
}
@@ -161,7 +161,7 @@ func handleUnexpected(err error) (string, []interface{}) {
lineNumber, _ := strconv.Atoi(lineNumberStr)
line := getLineFromAsset(templateName, lineNumber, unexpected)
line := GetLineFromTemplate(templateName, lineNumber, unexpected, -1)
return "PANIC: Unable to compile templates!\nUnexpected %q in template file %s at line %d:\n\n%s", []interface{}{unexpected, filename, lineNumber, log.NewColoredValue(line, log.Reset)}
}
@@ -181,14 +181,15 @@ func handleExpectedEnd(err error) (string, []interface{}) {
lineNumber, _ := strconv.Atoi(lineNumberStr)
line := getLineFromAsset(templateName, lineNumber, unexpected)
line := GetLineFromTemplate(templateName, lineNumber, unexpected, -1)
return "PANIC: Unable to compile templates!\nMissing end with unexpected %q in template file %s at line %d:\n\n%s", []interface{}{unexpected, filename, lineNumber, log.NewColoredValue(line, log.Reset)}
}
const dashSeparator = "----------------------------------------------------------------------\n"
func getLineFromAsset(templateName string, targetLineNum int, target string) string {
// GetLineFromTemplate returns a line from a template with some context
func GetLineFromTemplate(templateName string, targetLineNum int, target string, position int) string {
bs, err := GetAsset("templates/" + templateName + ".tmpl")
if err != nil {
return fmt.Sprintf("(unable to read template file: %v)", err)
@@ -229,24 +230,30 @@ func getLineFromAsset(templateName string, targetLineNum int, target string) str
// If there is a provided target to look for in the line add a pointer to it
// e.g. ^^^^^^^
if target != "" {
idx := bytes.Index(lineBs, []byte(target))
if idx >= 0 {
// take the current line and replace preceding text with whitespace (except for tab)
for i := range lineBs[:idx] {
if lineBs[i] != '\t' {
lineBs[i] = ' '
}
}
// write the preceding "space"
_, _ = sb.Write(lineBs[:idx])
// Now write the ^^ pointer
_, _ = sb.WriteString(strings.Repeat("^", len(target)))
_ = sb.WriteByte('\n')
targetPos := bytes.Index(lineBs, []byte(target))
if targetPos >= 0 {
position = targetPos
}
}
if position >= 0 {
// take the current line and replace preceding text with whitespace (except for tab)
for i := range lineBs[:position] {
if lineBs[i] != '\t' {
lineBs[i] = ' '
}
}
// write the preceding "space"
_, _ = sb.Write(lineBs[:position])
// Now write the ^^ pointer
targetLen := len(target)
if targetLen == 0 {
targetLen = 1
}
_, _ = sb.WriteString(strings.Repeat("^", targetLen))
_ = sb.WriteByte('\n')
}
// Finally write the footer
sb.WriteString(dashSeparator)
+2 -2
View File
@@ -233,7 +233,7 @@ func TimeSince(then time.Time, lang translation.Locale) template.HTML {
}
func htmlTimeSince(then, now time.Time, lang translation.Locale) template.HTML {
return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s">%s</span>`,
return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s" data-tooltip-interactive="true">%s</span>`,
then.In(setting.DefaultUILocation).Format(GetTimeFormat(lang.Language())),
timeSince(then, now, lang)))
}
@@ -244,7 +244,7 @@ func TimeSinceUnix(then TimeStamp, lang translation.Locale) template.HTML {
}
func htmlTimeSinceUnix(then, now TimeStamp, lang translation.Locale) template.HTML {
return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s">%s</span>`,
return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s" data-tooltip-interactive="true">%s</span>`,
then.FormatInLocation(GetTimeFormat(lang.Language()), setting.DefaultUILocation),
timeSinceUnix(int64(then), int64(now), lang)))
}
+83 -11
View File
@@ -5,6 +5,7 @@ package util
import (
"errors"
"fmt"
"net/url"
"os"
"path"
@@ -14,21 +15,92 @@ import (
"strings"
)
// CleanPath ensure to clean the path
func CleanPath(p string) string {
if strings.HasPrefix(p, "/") {
return path.Clean(p)
// PathJoinRel joins the path elements into a single path, each element is cleaned by path.Clean separately.
// It only returns the following values (like path.Join), any redundant part (empty, relative dots, slashes) is removed.
// It's caller's duty to make every element not bypass its own directly level, to avoid security issues.
//
// empty => ``
// `` => ``
// `..` => `.`
// `dir` => `dir`
// `/dir/` => `dir`
// `foo\..\bar` => `foo\..\bar`
// {`foo`, ``, `bar`} => `foo/bar`
// {`foo`, `..`, `bar`} => `foo/bar`
func PathJoinRel(elem ...string) string {
elems := make([]string, len(elem))
for i, e := range elem {
if e == "" {
continue
}
elems[i] = path.Clean("/" + e)
}
p := path.Join(elems...)
if p == "" {
return ""
} else if p == "/" {
return "."
} else {
return p[1:]
}
return path.Clean("/" + p)[1:]
}
// EnsureAbsolutePath ensure that a path is absolute, making it
// relative to absoluteBase if necessary
func EnsureAbsolutePath(path, absoluteBase string) string {
if filepath.IsAbs(path) {
return path
// PathJoinRelX joins the path elements into a single path like PathJoinRel,
// and covert all backslashes to slashes. (X means "extended", also means the combination of `\` and `/`).
// It's caller's duty to make every element not bypass its own directly level, to avoid security issues.
// It returns similar results as PathJoinRel except:
//
// `foo\..\bar` => `bar` (because it's processed as `foo/../bar`)
//
// All backslashes are handled as slashes, the result only contains slashes.
func PathJoinRelX(elem ...string) string {
elems := make([]string, len(elem))
for i, e := range elem {
if e == "" {
continue
}
elems[i] = path.Clean("/" + strings.ReplaceAll(e, "\\", "/"))
}
return filepath.Join(absoluteBase, path)
return PathJoinRel(elems...)
}
const pathSeparator = string(os.PathSeparator)
// FilePathJoinAbs joins the path elements into a single file path, each element is cleaned by filepath.Clean separately.
// All slashes/backslashes are converted to path separators before cleaning, the result only contains path separators.
// The first element must be an absolute path, caller should prepare the base path.
// It's caller's duty to make every element not bypass its own directly level, to avoid security issues.
// Like PathJoinRel, any redundant part (empty, relative dots, slashes) is removed.
//
// {`/foo`, ``, `bar`} => `/foo/bar`
// {`/foo`, `..`, `bar`} => `/foo/bar`
func FilePathJoinAbs(elem ...string) string {
elems := make([]string, len(elem))
// POISX filesystem can have `\` in file names. Windows: `\` and `/` are both used for path separators
// to keep the behavior consistent, we do not allow `\` in file names, replace all `\` with `/`
if isOSWindows() {
elems[0] = filepath.Clean(elem[0])
} else {
elems[0] = filepath.Clean(strings.ReplaceAll(elem[0], "\\", pathSeparator))
}
if !filepath.IsAbs(elems[0]) {
// This shouldn't happen. If there is really necessary to pass in relative path, return the full path with filepath.Abs() instead
panic(fmt.Sprintf("FilePathJoinAbs: %q (for path %v) is not absolute, do not guess a relative path based on current working directory", elems[0], elems))
}
for i := 1; i < len(elem); i++ {
if elem[i] == "" {
continue
}
if isOSWindows() {
elems[i] = filepath.Clean(pathSeparator + elem[i])
} else {
elems[i] = filepath.Clean(pathSeparator + strings.ReplaceAll(elem[i], "\\", pathSeparator))
}
}
// the elems[0] must be an absolute path, just join them together
return filepath.Join(elems...)
}
// IsDir returns true if given path is a directory,
+68 -6
View File
@@ -138,13 +138,75 @@ func TestMisc_IsReadmeFileName(t *testing.T) {
}
func TestCleanPath(t *testing.T) {
cases := map[string]string{
"../../test": "test",
"/test": "/test",
"/../test": "/test",
cases := []struct {
elems []string
expected string
}{
{[]string{}, ``},
{[]string{``}, ``},
{[]string{`..`}, `.`},
{[]string{`a`}, `a`},
{[]string{`/a/`}, `a`},
{[]string{`../a/`, `../b`, `c/..`, `d`}, `a/b/d`},
{[]string{`a\..\b`}, `a\..\b`},
{[]string{`a`, ``, `b`}, `a/b`},
{[]string{`a`, `..`, `b`}, `a/b`},
{[]string{`lfs`, `repo/..`, `user/../path`}, `lfs/path`},
}
for _, c := range cases {
assert.Equal(t, c.expected, PathJoinRel(c.elems...), "case: %v", c.elems)
}
for k, v := range cases {
assert.Equal(t, v, CleanPath(k))
cases = []struct {
elems []string
expected string
}{
{[]string{}, ``},
{[]string{``}, ``},
{[]string{`..`}, `.`},
{[]string{`a`}, `a`},
{[]string{`/a/`}, `a`},
{[]string{`../a/`, `../b`, `c/..`, `d`}, `a/b/d`},
{[]string{`a\..\b`}, `b`},
{[]string{`a`, ``, `b`}, `a/b`},
{[]string{`a`, `..`, `b`}, `a/b`},
{[]string{`lfs`, `repo/..`, `user/../path`}, `lfs/path`},
}
for _, c := range cases {
assert.Equal(t, c.expected, PathJoinRelX(c.elems...), "case: %v", c.elems)
}
// for POSIX only, but the result is similar on Windows, because the first element must be an absolute path
if isOSWindows() {
cases = []struct {
elems []string
expected string
}{
{[]string{`C:\..`}, `C:\`},
{[]string{`C:\a`}, `C:\a`},
{[]string{`C:\a/`}, `C:\a`},
{[]string{`C:\..\a\`, `../b`, `c\..`, `d`}, `C:\a\b\d`},
{[]string{`C:\a/..\b`}, `C:\b`},
{[]string{`C:\a`, ``, `b`}, `C:\a\b`},
{[]string{`C:\a`, `..`, `b`}, `C:\a\b`},
{[]string{`C:\lfs`, `repo/..`, `user/../path`}, `C:\lfs\path`},
}
} else {
cases = []struct {
elems []string
expected string
}{
{[]string{`/..`}, `/`},
{[]string{`/a`}, `/a`},
{[]string{`/a/`}, `/a`},
{[]string{`/../a/`, `../b`, `c/..`, `d`}, `/a/b/d`},
{[]string{`/a\..\b`}, `/b`},
{[]string{`/a`, ``, `b`}, `/a/b`},
{[]string{`/a`, `..`, `b`}, `/a/b`},
{[]string{`/lfs`, `repo/..`, `user/../path`}, `/lfs/path`},
}
}
for _, c := range cases {
assert.Equal(t, c.expected, FilePathJoinAbs(c.elems...), "case: %v", c.elems)
}
}
+2 -1
View File
@@ -1423,7 +1423,6 @@ issues.context.reference_issue=Odkázat v novém úkolu
issues.context.edit=Upravit
issues.context.delete=Smazat
issues.no_content=Není zde žádný obsah.
issues.close_issue=Zavřít
issues.pull_merged_at=`sloučil/a commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> do <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`sloučil/a commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> do <b>%[3]s</b> ručně %[4]s`
issues.close_comment_issue=Okomentovat a zavřít
@@ -3269,6 +3268,7 @@ rubygems.dependencies.development=Vývojové závislosti
rubygems.required.ruby=Vyžaduje verzi Ruby
rubygems.required.rubygems=Vyžaduje verzi RubyGem
rubygems.documentation=Další informace o registru RubyGems naleznete v <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">dokumentaci</a>.
swift.registry=Nastavte tento registr z příkazového řádku:
vagrant.install=Pro přidání Vagrant box spusťte následující příkaz:
vagrant.documentation=Další informace o registru Vagrant naleznete v <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">dokumentaci</a>.
settings.link=Propojit tento balíček s repozitářem
@@ -3351,6 +3351,7 @@ runners.status.unspecified=Neznámý
runners.status.idle=Nečinný
runners.status.active=Aktivní
runners.status.offline=Offline
runners.version=Verze
runs.all_workflows=Všechny pracovní postupy
runs.open_tab=%d otevřeno
+2 -1
View File
@@ -1310,7 +1310,6 @@ issues.context.reference_issue=In neuem Issue referenzieren
issues.context.edit=Bearbeiten
issues.context.delete=Löschen
issues.no_content=Hier gibt es bis jetzt noch keinen Inhalt.
issues.close_issue=Schließen
issues.pull_merged_at=`mergte den Commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> %[4]s in <b>%[3]s</b>`
issues.manually_pull_merged_at=`mergte den Commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> %[4]s manuell in <b>%[3]s</b>`
issues.close_comment_issue=Kommentieren und schließen
@@ -3122,6 +3121,7 @@ rubygems.dependencies.development=Entwicklungsabhängigkeiten
rubygems.required.ruby=Benötigt Ruby Version
rubygems.required.rubygems=Benötigt RubyGem Version
rubygems.documentation=Weitere Informationen zur RubyGems-Paketverwaltung findest du in der <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">Dokumentation</a>.
swift.registry=Diese Registry über die Kommandozeile einrichten:
vagrant.install=Um eine Vagrant-Box hinzuzufügen, führen Sie folgenden Befehl aus:
vagrant.documentation=Für weitere Informationen zur Vagrant-Registry, siehe <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">Dokumentation</a>.
settings.link=Dieses Paket einem Repository zuweisen
@@ -3154,6 +3154,7 @@ runners.task_list.run=Ausführen
runners.task_list.repository=Repository
runners.task_list.commit=Commit
runners.status.active=Aktiv
runners.version=Version
runs.commit=Commit
+4 -3
View File
@@ -1319,8 +1319,8 @@ issues.opened_by_fake=άνοιξε το %[1]s από %[2]s
issues.closed_by_fake=από %[2]s έκλεισαν %[1]s
issues.previous=Προηγούμενο
issues.next=Επόμενο
issues.open_title=Ανοιχτό
issues.closed_title=Κλειστό
issues.open_title=Ανοιχτά
issues.closed_title=Κλειστά
issues.draft_title=Προσχέδιο
issues.num_comments=%d σχόλια
issues.commented_at=`σχολίασε <a href="#%s">%s</a>`
@@ -1331,7 +1331,6 @@ issues.context.reference_issue=Αναφορά σε νέο ζήτημα
issues.context.edit=Επεξεργασία
issues.context.delete=Διαγραφή
issues.no_content=Δεν υπάρχει ακόμα περιεχόμενο.
issues.close_issue=Κλείσιμο
issues.pull_merged_at=`συγχώνευσε την υποβολή <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> σε <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`συγχώνευσε την υποβολή <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> σε <b>%[3]s</b> %[4]s`
issues.close_comment_issue=Σχόλιο και κλείσιμο
@@ -3155,6 +3154,7 @@ rubygems.dependencies.development=Εξαρτήσεις Ανάπτυξης
rubygems.required.ruby=Απαιτεί την έκδοση Ruby
rubygems.required.rubygems=Απαιτεί έκδοση RubyGem
rubygems.documentation=Για περισσότερες πληροφορίες σχετικά με το μητρώο RubyGems, ανατρέξτε <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">στην τεκμηρίωση</a>.
swift.registry=Ρυθμίστε αυτό το μητρώο από τη γραμμή εντολών:
vagrant.install=Για προσθήκη ενός κυτίου Vagrant, εκτελέστε την ακόλουθη εντολή:
vagrant.documentation=Για περισσότερες πληροφορίες σχετικά με το μητρώο του Vagrant, ανατρέξτε <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">στην τεκμηρίωση</a>.
settings.link=Σύνδεση αυτού του πακέτου με ένα αποθετήριο
@@ -3187,6 +3187,7 @@ runners.task_list.run=Εκτέλεση
runners.task_list.repository=Αποθετήριο
runners.task_list.commit=Υποβολή
runners.status.active=Ενεργό
runners.version=Έκδοση
runs.commit=Υποβολή
+12 -1
View File
@@ -84,6 +84,7 @@ add = Add
add_all = Add All
remove = Remove
remove_all = Remove All
remove_label_str = Remove item "%s"
edit = Edit
enabled = Enabled
@@ -1372,7 +1373,7 @@ issues.context.reference_issue = Reference in New Issue
issues.context.edit = Edit
issues.context.delete = Delete
issues.no_content = There is no content yet.
issues.close_issue = Close
issues.close = Close Issue
issues.pull_merged_at = `merged commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> into <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at = `merged commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> into <b>%[3]s</b> manually %[4]s`
issues.close_comment_issue = Comment and Close
@@ -1657,6 +1658,7 @@ pulls.update_branch_rebase = Update branch by rebase
pulls.update_branch_success = Branch update was successful
pulls.update_not_allowed = You are not allowed to update branch
pulls.outdated_with_base_branch = This branch is out-of-date with the base branch
pulls.close = Close Pull Request
pulls.closed_at = `closed this pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.reopened_at = `reopened this pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.merge_instruction_hint = `You can also view <a class="show-instruction">command line instructions</a>.`
@@ -2267,7 +2269,9 @@ diff.review.header = Submit review
diff.review.placeholder = Review comment
diff.review.comment = Comment
diff.review.approve = Approve
diff.review.self_reject = Pull request authors can't request changes on their own pull request
diff.review.reject = Request changes
diff.review.self_approve = Pull request authors can't approve their own pull request
diff.committed_by = committed by
diff.protected = Protected
diff.image.side_by_side = Side by Side
@@ -3242,6 +3246,10 @@ rubygems.dependencies.development = Development Dependencies
rubygems.required.ruby = Requires Ruby version
rubygems.required.rubygems = Requires RubyGem version
rubygems.documentation = For more information on the RubyGems registry, see <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">the documentation</a>.
swift.registry = Setup this registry from the command line:
swift.install = Add the package in your <code>Package.swift</code> file:
swift.install2 = and run the following command:
swift.documentation = For more information on the Swift registry, see <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/swift/">the documentation</a>.
vagrant.install = To add a Vagrant box, run the following command:
vagrant.documentation = For more information on the Vagrant registry, see <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">the documentation</a>.
settings.link = Link this package to a repository
@@ -3353,11 +3361,14 @@ runners.status.unspecified = Unknown
runners.status.idle = Idle
runners.status.active = Active
runners.status.offline = Offline
runners.version = Version
runs.all_workflows = All Workflows
runs.open_tab = %d Open
runs.closed_tab = %d Closed
runs.commit = Commit
runs.pushed_by = Pushed by
runs.valid_workflow_helper = Workflow config file is valid.
runs.invalid_workflow_helper = Workflow config file is invalid. Please check your config file: %s
need_approval_desc = Need approval to run workflows for fork pull request.
+2 -1
View File
@@ -1330,7 +1330,6 @@ issues.context.reference_issue=Referencia en una nueva incidencia
issues.context.edit=Editar
issues.context.delete=Eliminar
issues.no_content=Aún no existe contenido.
issues.close_issue=Cerrar
issues.pull_merged_at=`fusionado commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> en <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`fusionado manualmente commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> en <b>%[3]s</b> %[4]s`
issues.close_comment_issue=Comentar y cerrar
@@ -3154,6 +3153,7 @@ rubygems.dependencies.development=Dependencias de desarrollo
rubygems.required.ruby=Requiere versión Ruby
rubygems.required.rubygems=Requiere la versión de RubyGem
rubygems.documentation=Para obtener más información sobre el registro de RubyGems, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">la documentación</a>.
swift.registry=Configurar este registro desde la línea de comandos:
vagrant.install=Para añadir un paquete Vagrant, ejecuta el siguiente comando:
vagrant.documentation=Para más información sobre el registro de paquetes Vagrant, revisa la <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">documentación</a>.
settings.link=Vincular este paquete a un repositorio
@@ -3186,6 +3186,7 @@ runners.task_list.run=Ejecutar
runners.task_list.repository=Repositorio
runners.task_list.commit=Commit
runners.status.active=Activo
runners.version=Versión
runs.commit=Commit
-1
View File
@@ -1213,7 +1213,6 @@ issues.context.reference_issue=مرجع در شماره جدید
issues.context.edit=ویرایش
issues.context.delete=حذف
issues.no_content=هنوز محتوایی ایجاد نشده.
issues.close_issue=ببند
issues.pull_merged_at=`ادغام شده commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> در <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`ادغام شده commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> در <b>%[3]s</b> بصورت دستی %[4]s`
issues.close_comment_issue=ثبت دیدگاه و بستن
-1
View File
@@ -936,7 +936,6 @@ issues.context.reference_issue=Viittaa uudesa ongelmassa
issues.context.edit=Muokkaa
issues.context.delete=Poista
issues.no_content=Sisältöä ei vielä ole.
issues.close_issue=Sulje
issues.close_comment_issue=Kommentoi ja sulje
issues.reopen_issue=Avaa uudelleen
issues.reopen_comment_issue=Kommentoi ja avaa uudelleen
-1
View File
@@ -1195,7 +1195,6 @@ issues.context.reference_issue=Référencer dans un nouveau ticket
issues.context.edit=Éditer
issues.context.delete=Supprimer
issues.no_content=Il n'existe pas encore de contenu.
issues.close_issue=Fermer
issues.pull_merged_at=`révision fusionnée <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> dans <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`révision fusionnée <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> dans <b>%[3]s</b> manuellement %[4]s`
issues.close_comment_issue=Commenter et Fermer
-1
View File
@@ -881,7 +881,6 @@ issues.context.quote_reply=Válasz idézettel
issues.context.edit=Szerkesztés
issues.context.delete=Törlés
issues.no_content=Még nincs tartalom.
issues.close_issue=Lezárás
issues.close_comment_issue=Hozzászólás és lezárás
issues.reopen_issue=Újranyitás
issues.reopen_comment_issue=Hozzászólás és újranyitás
-1
View File
@@ -752,7 +752,6 @@ issues.context.quote_reply=Kutip Balasan
issues.context.edit=Sunting
issues.context.delete=Hapus
issues.no_content=Belum ada konten.
issues.close_issue=Tutup
issues.close_comment_issue=Komentar dan Tutup
issues.reopen_issue=Buka kembali
issues.reopen_comment_issue=Komentar dan Buka Kembali
+1 -1
View File
@@ -823,7 +823,6 @@ issues.num_comments=%d ummæli
issues.commented_at=`gerði ummæli <a href="#%s">%s</a>`
issues.context.edit=Breyta
issues.context.delete=Eyða
issues.close_issue=Loka
issues.manually_pull_merged_at=`sameinaði framlag <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> inni í <b>%[3]s</b> handvirkt %[4]s`
issues.close_comment_issue=Senda ummæli og Loka
issues.reopen_issue=Enduropna
@@ -1404,6 +1403,7 @@ runners.task_list.run=Keyra
runners.task_list.repository=Hugbúnaðarsafn
runners.task_list.commit=Framlag
runners.status.active=Virkt
runners.version=Útgáfa
runs.commit=Framlag
+4 -1
View File
@@ -1315,7 +1315,6 @@ issues.context.reference_issue=Fai riferimento in un nuovo problema
issues.context.edit=Modifica
issues.context.delete=Elimina
issues.no_content=Non ci sono ancora contenuti.
issues.close_issue=Chiudi
issues.pull_merged_at=`merged commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> in <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`merged commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> in <b>%[3]s</b> manualmente %[4]s`
issues.close_comment_issue=Commenta e Chiudi
@@ -2187,7 +2186,9 @@ diff.review.header=Invia revisione
diff.review.placeholder=Revisione commento
diff.review.comment=Commentare
diff.review.approve=Approva
diff.review.self_reject=Gli autori di Pull request non possono richiedere modifiche sulla loro pull request
diff.review.reject=Richiedi cambiamenti
diff.review.self_approve=Gli autori di Pull request non possono approvare la loro pull request
diff.committed_by=committato da
diff.protected=Protetto
diff.image.side_by_side=A fianco
@@ -3121,6 +3122,7 @@ rubygems.dependencies.development=Dipendenze Di Sviluppo
rubygems.required.ruby=Richiede la versione di Ruby
rubygems.required.rubygems=Richiede la versione RubyGem
rubygems.documentation=Per ulteriori informazioni sul registro di RubyGems, vedere <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">la documentazione</a>.
swift.registry=Configura questo registro dalla riga di comando:
settings.link=Collega questo pacchetto a un repository
settings.link.description=Se si collega un pacchetto a un repository, il pacchetto è elencato nell'elenco dei pacchetti del repository.
settings.link.select=Seleziona Repository
@@ -3151,6 +3153,7 @@ runners.task_list.run=Esegui
runners.task_list.repository=Repository
runners.task_list.commit=Commit
runners.status.active=Attivo
runners.version=Versione
runs.commit=Commit
+17 -2
View File
@@ -821,6 +821,7 @@ remove_account_link=連携アカウントの削除
remove_account_link_desc=連携アカウントを削除し、Giteaアカウントへのアクセス権を取り消します。 続行しますか?
remove_account_link_success=連携アカウントを削除しました。
hooks.desc=このユーザーが所有する<strong>すべてのリポジトリ</strong>でトリガーされるWebhookを追加します。
orgs_none=あなたはどの組織のメンバーでもありません。
repos_none=あなたはリポジトリを所有していません。
@@ -1368,7 +1369,7 @@ issues.context.reference_issue=新しいイシューから参照
issues.context.edit=編集
issues.context.delete=削除
issues.no_content=まだ内容がありません
issues.close_issue=クローズする
issues.close=イシューをクローズ
issues.pull_merged_at=`がコミット <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> を <b>%[3]s</b> にマージ %[4]s`
issues.manually_pull_merged_at=`がコミット <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> を <b>%[3]s</b> に手動マージ %[4]s`
issues.close_comment_issue=コメントしてクローズ
@@ -1653,6 +1654,7 @@ pulls.update_branch_rebase=リベースでブランチを更新
pulls.update_branch_success=ブランチの更新が成功しました
pulls.update_not_allowed=ブランチを更新する権限がありません
pulls.outdated_with_base_branch=このブランチはベースブランチに対して最新ではありません
pulls.close=プルリクエストをクローズ
pulls.closed_at=`がプルリクエストをクローズ <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.reopened_at=`がプルリクエストを再オープン <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.merge_instruction_hint=`<a class="show-instruction">コマンドラインの手順</a>も確認できます。`
@@ -2289,6 +2291,8 @@ release.edit_subheader=リリースで、プロジェクトのバージョンを
release.tag_name=タグ名
release.target=ターゲット
release.tag_helper=既存のタグを選択するか、新しいタグを作成します。
release.tag_helper_new=新しいタグです。 このタグはターゲットから作成されます。
release.tag_helper_existing=存在するタグです。
release.title=タイトル
release.content=内容
release.prerelease_desc=プレリリース
@@ -2418,7 +2422,7 @@ settings.delete_prompt=組織は恒久的に削除され、元に戻すことは
settings.confirm_delete_account=削除を確認
settings.delete_org_title=組織の削除
settings.delete_org_desc=組織を恒久的に削除します。 続行しますか?
settings.hooks_desc=この組織の<strong>すべてのリポジトリ</strong>に対して発行されるWebhookを追加します。
settings.hooks_desc=この組織の<strong>すべてのリポジトリ</strong>でトリガーされるWebhookを追加します。
settings.labels_desc=この組織の<strong>すべてのリポジトリ</strong>で使用可能なイシューラベルを追加します。
@@ -2809,6 +2813,8 @@ auths.still_in_used=この認証ソースはまだ使用中です。 先に、
auths.deletion_success=認証ソースを削除しました。
auths.login_source_exist=認証ソース '%s' は既に存在します。
auths.login_source_of_type_exist=このタイプの認証ソースは既に存在します。
auths.unable_to_initialize_openid=OpenID Connectプロバイダーを初期化できませんでした: %s
auths.invalid_openIdConnectAutoDiscoveryURL=無効な自動検出URLです(http://またはhttps://で始まる有効なURLでなければなりません)
config.server_config=サーバー設定
config.app_name=サイトのタイトル
@@ -2929,6 +2935,8 @@ config.git_disable_diff_highlight=Diffのシンタックスハイライトが無
config.git_max_diff_lines=最大の差分行数(1ファイルあたり)
config.git_max_diff_line_characters=最大の差分文字数(1行あたり)
config.git_max_diff_files=差分を表示する最大ファイル数
config.git_enable_reflogs=Reflog有効
config.git_reflog_expiry_time=有効期間
config.git_gc_args=GC引数
config.git_migrate_timeout=移行タイムアウト
config.git_mirror_timeout=ミラー更新タイムアウト
@@ -3232,6 +3240,10 @@ rubygems.dependencies.development=開発用依存関係
rubygems.required.ruby=必要なRubyバージョン
rubygems.required.rubygems=必要なRubyGemバージョン
rubygems.documentation=RubyGemsレジストリの詳細については、<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">ドキュメント</a> を参照してください。
swift.registry=このレジストリをコマンドラインからセットアップします:
swift.install=あなたの <code>Package.swift</code> ファイルにパッケージを追加します:
swift.install2=そして次のコマンドを実行します:
swift.documentation=Swift レジストリの詳細については、 <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/swift/">ドキュメント</a> を参照してください。
vagrant.install=Vagrant ボックスを追加するには、次のコマンドを実行します。
vagrant.documentation=Vagrantレジストリの詳細については <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">ドキュメント</a>を参照してください。
settings.link=このパッケージをリポジトリにリンク
@@ -3343,12 +3355,15 @@ runners.status.unspecified=不明
runners.status.idle=アイドル
runners.status.active=稼働中
runners.status.offline=オフライン
runners.version=バージョン
runs.all_workflows=すべてのワークフロー
runs.open_tab=%d オープン
runs.closed_tab=%d クローズ
runs.commit=コミット
runs.pushed_by=Pushed by
runs.valid_workflow_helper=ワークフロー設定ファイルは有効です。
runs.invalid_workflow_helper=ワークフロー設定ファイルは無効です。あなたの設定ファイルを確認してください: %s
need_approval_desc=フォークプルリクエストのワークフローを実行するには承認が必要です。
-1
View File
@@ -787,7 +787,6 @@ issues.delete_comment_confirm=이 댓글을 정말 삭제하시겠습니까?
issues.context.edit=수정하기
issues.context.delete=삭제
issues.no_content=아직 콘텐츠가 없습니다.
issues.close_issue=닫기
issues.close_comment_issue=클로즈 및 코멘트
issues.reopen_issue=다시 열기
issues.reopen_comment_issue=다시 오픈 및 코멘트
+2 -1
View File
@@ -1461,7 +1461,6 @@ issues.context.reference_issue=Atsaukties uz šo jaunā problēmā
issues.context.edit=Labot
issues.context.delete=Dzēst
issues.no_content=Vēl nav satura.
issues.close_issue=Aizvērt
issues.pull_merged_at=`sapludināja revīziju <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> atzarā <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`manuāli sapludināja revīziju <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> atzarā <b>%[3]s</b> %[4]s`
issues.close_comment_issue=Komentēt un aizvērt
@@ -3329,6 +3328,7 @@ rubygems.dependencies.development=Izstrādes atkarības
rubygems.required.ruby=Nepieciešamā Ruby versija
rubygems.required.rubygems=Nepieciešamā RubyGem versija
rubygems.documentation=Papildus informācija par RubyGems reģistru pieejama <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">dokumentācijā</a>.
swift.registry=Konfigurējiet šo reģistru no komandrindas:
vagrant.install=Lai pievienotu Vagrant kasti, izpildiet sekojošu komandu:
vagrant.documentation=Papildus informācija par Vagrant reģistru pieejama <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">dokumentācijā</a>.
settings.link=Piesaistīt pakotni šim repozitorijam
@@ -3440,6 +3440,7 @@ runners.status.unspecified=Nezināms
runners.status.idle=Dīkstāvē
runners.status.active=Aktīvs
runners.status.offline=Bezsaistē
runners.version=Versija
runs.all_workflows=Visas darbaplūsmas
runs.open_tab=%d atvērti
-1
View File
@@ -1315,7 +1315,6 @@ issues.context.reference_issue=Verwijs in nieuw issue
issues.context.edit=Bewerken
issues.context.delete=Verwijder
issues.no_content=Er is nog geen inhoud.
issues.close_issue=Sluit
issues.pull_merged_at=`commit samengevoegd <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> in <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`commit <a class="ui sha" href="%[1]s"> handmatig samengevoegd <code>%[2]s</code></a> in <b>%[3]s</b> %[4]s`
issues.close_comment_issue=Reageer en sluit
-1
View File
@@ -1208,7 +1208,6 @@ issues.context.quote_reply=Cytuj odpowiedź
issues.context.edit=Edytuj
issues.context.delete=Usuń
issues.no_content=Nie ma jeszcze treści.
issues.close_issue=Zamknij
issues.close_comment_issue=Skomentuj i zamknij
issues.reopen_issue=Otwórz ponownie
issues.reopen_comment_issue=Skomentuj i otwórz ponownie
+67 -1
View File
@@ -247,6 +247,7 @@ default_enable_timetracking_popup=Habilitar o cronômetro para novos repositóri
no_reply_address=Domínio de e-mail oculto
no_reply_address_helper=Nome de domínio para usuários com um endereço de e-mail oculto. Por exemplo, o nome de usuário 'joe' será registrado no Git como 'joe@noreply.example.org' se o domínio de e-mail oculto estiver definido como 'noreply.example.org'.
password_algorithm=Algoritmo Hash de Senha
invalid_password_algorithm=Algoritmo de hash de senha inválido
password_algorithm_helper=Escolha o algoritmo de hash para as senhas. Diferentes algoritmos têm requerimentos e forças diversos. O `Argon2` possui boa qualidade, porém usa muita memória e pode ser inapropriado para sistemas com menos recursos.
enable_update_checker=Habilitar Verificador de Atualizações
enable_update_checker_helper=Procura por novas versões periodicamente conectando-se ao gitea.io.
@@ -284,6 +285,7 @@ users=Usuários
organizations=Organizações
search=Pesquisar
code=Código
search.type.tooltip=Tipo de pesquisa
search.fuzzy=Similar
search.fuzzy.tooltip=Incluir resultados que sejam próximos ao termo de busca
search.match=Correspondência
@@ -819,6 +821,7 @@ remove_account_link=Remover conta vinculada
remove_account_link_desc=A exclusão da chave SSH revogará o acesso à sua conta. Continuar?
remove_account_link_success=A conta vinculada foi removida.
hooks.desc=Adicionar webhooks que serão acionados para <strong>todos os repositórios</strong> pertencentes a este usuário.
orgs_none=Você não é membro de nenhuma organização.
repos_none=Você não possui nenhum repositório
@@ -1231,6 +1234,7 @@ projects.column.color=Colorido
projects.open=Abrir
projects.close=Fechar
projects.column.assigned_to=Atribuído a
projects.card_type.desc=Pré-visualizações de Cards
projects.card_type.images_and_text=Imagens e Texto
projects.card_type.text_only=Somente texto
@@ -1365,7 +1369,6 @@ issues.context.reference_issue=Referência em uma nova issue
issues.context.edit=Editar
issues.context.delete=Excluir
issues.no_content=Ainda não há conteúdo.
issues.close_issue=Fechar
issues.pull_merged_at=`aplicou o merge do commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> em <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`aplicou o merge do commit <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> em <b>%[3]s</b> manualmente %[4]s`
issues.close_comment_issue=Comentar e fechar
@@ -1399,6 +1402,7 @@ issues.label_title=Nome da etiqueta
issues.label_description=Descrição da etiqueta
issues.label_color=Cor da etiqueta
issues.label_exclusive=Exclusivo
issues.label_exclusive_desc=Nomeie o rótulo <code>escopo/item</code> para torná-lo mutuamente exclusivo com outros rótulos do <code>escopo/</code>.
issues.label_exclusive_warning=Quaisquer rótulos com escopo conflitantes serão removidos ao editar os rótulos de uma issue ou pull request.
issues.label_count=%d etiquetas
issues.label_open_issues=%d issues abertas
@@ -1655,6 +1659,7 @@ pulls.merge_instruction_hint=`Você também pode ver as <a class="show-instructi
pulls.merge_instruction_step1_desc=No repositório do seu projeto, crie um novo branch e teste as alterações.
pulls.merge_instruction_step2_desc=Faça merge das alterações e atualize no Gitea.
pulls.clear_merge_message=Limpar mensagem do merge
pulls.clear_merge_message_hint=Limpar a mensagem de merge só irá remover o conteúdo da mensagem de commit e manter trailers git gerados, como "Co-Authored-By …".
pulls.auto_merge_button_when_succeed=(Quando a verificação for bem-sucedida)
pulls.auto_merge_when_succeed=Mesclar automaticamente quando todas as verificações forem bem sucedidas
@@ -1810,6 +1815,7 @@ activity.git_stats_deletion_n=%d exclusões
search=Pesquisar
search.search_repo=Pesquisar no repositório...
search.type.tooltip=Tipo de pesquisa
search.fuzzy=Aproximada
search.fuzzy.tooltip=Incluir resultados que sejam próximos ao termo de busca
search.match=Corresponde
@@ -2044,6 +2050,7 @@ settings.event_package_desc=Pacote criado ou excluído em um repositório.
settings.branch_filter=Filtro de branch
settings.branch_filter_desc=Lista dos branches a serem considerados nos eventos push, criação de branch e exclusão de branch, especificados como padrão glob. Se estiver vazio ou for <code>*</code>, eventos para todos os branches serão relatados. Veja <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentação da sintaxe. Exemplos: <code>master</code>, <code>{master,release*}</code>.
settings.authorization_header=Header de Autorização
settings.authorization_header_desc=Será incluído como header de autorização para solicitações quando estiver presente. Exemplos: %s.
settings.active=Ativo
settings.active_helper=Informações sobre eventos disparados serão enviadas para esta URL do webhook.
settings.add_hook_success=O webhook foi adicionado.
@@ -2124,6 +2131,7 @@ settings.dismiss_stale_approvals=Descartar aprovações obsoletas
settings.dismiss_stale_approvals_desc=Quando novos commits que mudam o conteúdo do pull request são enviados para o branch, as antigas aprovações serão descartadas.
settings.require_signed_commits=Exibir commits assinados
settings.require_signed_commits_desc=Rejeitar pushes para este branch se não estiverem assinados ou não forem validáveis.
settings.protect_branch_name_pattern=Padrão de Nome de Branch Protegida
settings.protect_protected_file_patterns=Padrões de arquivos protegidos (separados usando ponto e vírgula '\;'):
settings.protect_protected_file_patterns_desc=Arquivos protegidos que não têm permissão para serem alterados diretamente, mesmo se o usuário tiver permissão para adicionar, editar ou apagar arquivos neste branch. Vários padrões podem ser separados usando ponto e vírgula ('\;'). Veja <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentação para sintaxe de padrões. Exemplos: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.
settings.protect_unprotected_file_patterns=Padrões de arquivos desprotegidos (separados usando ponto e vírgula '\;'):
@@ -2132,6 +2140,7 @@ settings.add_protected_branch=Habilitar proteção
settings.delete_protected_branch=Desabilitar proteção
settings.update_protect_branch_success=Proteção do branch '%s' foi atualizada.
settings.remove_protected_branch_success=Proteção do branch '%s' foi desabilitada.
settings.remove_protected_branch_failed=Removendo regra de proteção de branch '%s' falhou.
settings.protected_branch_deletion=Desabilitar proteção de branch
settings.protected_branch_deletion_desc=Desabilitar a proteção de branch permite que os usuários com permissão de escrita realizem push. Continuar?
settings.block_rejected_reviews=Bloquear merge em revisões rejeitadas
@@ -2146,6 +2155,8 @@ settings.default_merge_style_desc=Estilo de merge padrão para pull requests:
settings.choose_branch=Escolha um branch...
settings.no_protected_branch=Não há branches protegidos.
settings.edit_protected_branch=Editar
settings.protected_branch_required_rule_name=Nome da regra é obrigatório
settings.protected_branch_duplicate_rule_name=Regra com nome duplicado
settings.protected_branch_required_approvals_min=Aprovações necessárias não podem ser negativas.
settings.tags=Tags
settings.tags.protection=Proteção das Tags
@@ -2278,6 +2289,8 @@ release.edit_subheader=Lançamentos organizam versões do projeto.
release.tag_name=Nome da tag
release.target=Destino
release.tag_helper=Escolha uma tag existente, ou crie uma nova tag.
release.tag_helper_new=Nova tag. Esta tag será criada a partir do alvo.
release.tag_helper_existing=Tag existente.
release.title=Título
release.content=Conteúdo
release.prerelease_desc=Marcar como pré-lançamento
@@ -2570,6 +2583,10 @@ dashboard.delete_old_actions=Excluir todas as ações antigas do banco de dados
dashboard.delete_old_actions.started=A exclusão de todas as ações antigas do banco de dados foi iniciada.
dashboard.update_checker=Verificador de atualização
dashboard.delete_old_system_notices=Excluir todos os avisos de sistema antigos do banco de dados
dashboard.gc_lfs=Coletar lixos dos meta-objetos LFS
dashboard.stop_zombie_tasks=Parar tarefas zumbi
dashboard.stop_endless_tasks=Parar tarefas infinitas
dashboard.cancel_abandoned_jobs=Cancelar trabalhos abandonados
users.user_manage_panel=Gerenciamento de conta de usuário
users.new_account=Criar conta de usuário
@@ -2658,6 +2675,7 @@ repos.size=Tamanho
packages.package_manage_panel=Gerenciamento de Pacotes
packages.total_size=Tamanho Total: %s
packages.unreferenced_size=Tamanho Não Referenciado: %s
packages.owner=Proprietário
packages.creator=Criador
packages.name=Nome
@@ -2751,6 +2769,8 @@ auths.oauth2_required_claim_value_helper=Defina este valor para permitir o login
auths.oauth2_group_claim_name=Nome do claim que fornece os nomes dos grupos para esta fonte. (Opcional)
auths.oauth2_admin_group=Valor do Claim de Grupo para os usuários administradores. (Opcional - requer nome do claim acima)
auths.oauth2_restricted_group=Valor do Claim de Grupo para os usuários restritos. (Opcional - requer nome do claim acima)
auths.oauth2_map_group_to_team=Mapear grupos para Organizações. (Opcional - requer nome do claim acima)
auths.oauth2_map_group_to_team_removal=Remover usuários de equipes sincronizadas se o usuário não pertence ao grupo correspondente.
auths.enable_auto_register=Habilitar cadastro automático
auths.sspi_auto_create_users=Criar usuários automaticamente
auths.sspi_auto_create_users_helper=Permitir que o método de autenticação SSPI crie automaticamente novas contas para usuários que fazem o login pela primeira vez
@@ -2791,6 +2811,8 @@ auths.still_in_used=A fonte de autenticação ainda está em uso. Converta ou ex
auths.deletion_success=A fonte de autenticação foi excluída.
auths.login_source_exist=A fonte de autenticação '%s' já existe.
auths.login_source_of_type_exist=Uma fonte de autenticação deste tipo já existe.
auths.unable_to_initialize_openid=Não é possível inicializar o Provedor OpenID Connect: %s
auths.invalid_openIdConnectAutoDiscoveryURL=URL do Auto Discovery inválida (deve ser uma URL válida, começando com http:// ou https://)
config.server_config=Configuração do servidor
config.app_name=Nome do servidor
@@ -2911,6 +2933,8 @@ config.git_disable_diff_highlight=Desabilitar realce de mudanças no diff
config.git_max_diff_lines=Máximo de linhas mostradas no diff (para um único arquivo)
config.git_max_diff_line_characters=Máximo de caracteres mostrados no diff (para uma única linha)
config.git_max_diff_files=Máximo de arquivos a serem mostrados no diff
config.git_enable_reflogs=Habilitar Reflogs
config.git_reflog_expiry_time=Tempo de expiração
config.git_gc_args=Argumentos do GC
config.git_migrate_timeout=Tempo limite de migração
config.git_mirror_timeout=Tempo limite de atualização de espelhamento
@@ -3039,6 +3063,7 @@ reopen_pull_request=`reabriu o pull request <a href="%[1]s">%[3]s#%[2]s</a>`
comment_issue=`comentou na issue <a href="%[1]s">%[3]s#%[2]s</a>`
comment_pull=`comentou no pull request <a href="%[1]s">%[3]s#%[2]s</a>`
merge_pull_request=`fez merge do pull request <a href="%[1]s">%[3]s#%[2]s</a>`
auto_merge_pull_request=`fez merge automático do pull request <a href="%[1]s">%[3]s#%[2]s</a>`
transfer_repo=transferiu repositório de <code>%s</code> para <a href="%s">%s</a>
push_tag=fez push da tag <a href="%[2]s">%[3]s</a> to <a href="%[1]s">%[4]s</a>
delete_tag=excluiu tag %[2]s de <a href="%[1]s"> %[3]s</a>
@@ -3148,10 +3173,12 @@ dependency.id=ID
dependency.version=Versão
cargo.registry=Configurar este registro no arquivo de configuração de Cargo (por exemplo <code>~/.cargo/config.toml</code>):
cargo.install=Para instalar o pacote usando Cargo, execute o seguinte comando:
cargo.documentation=Para obter mais informações sobre o registro Cargo, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/cargo/">a documentação</a>.
cargo.details.repository_site=Site do Repositório
cargo.details.documentation_site=Site da Documentação
chef.registry=Configure este registro em seu arquivo <code>~/.chef/config.rb</code>:
chef.install=Para instalar o pacote, execute o seguinte comando:
chef.documentation=Para obter mais informações sobre o registro Chef, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/chef/">a documentação</a>.
composer.registry=Configure este registro em seu arquivo <code>~/.composer/config.json</code>:
composer.install=Para instalar o pacote usando o Composer, execute o seguinte comando:
composer.documentation=Para obter mais informações sobre o registro do Composer, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/composer/">a documentação</a>.
@@ -3211,6 +3238,10 @@ rubygems.dependencies.development=Dependências de Desenvolvimento
rubygems.required.ruby=Requer o Ruby versão
rubygems.required.rubygems=Requer o RubyGem versão
rubygems.documentation=Para obter mais informações sobre o registro do RubyGems, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">a documentação</a>.
swift.registry=Configure este registro pela linha de comando:
swift.install=Adicione o pacote em seu arquivo <code>Package.swift</code>:
swift.install2=e execute o seguinte comando:
swift.documentation=Para obter mais informações sobre o registro Swift, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/swift/">a documentação</a>.
vagrant.install=Para adicionar uma Vagrant box, execute o seguinte comando:
vagrant.documentation=Para obter mais informações sobre o registro do Vagrant, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">a documentação</a>.
settings.link=Vincular este pacote a um repositório
@@ -3224,6 +3255,15 @@ settings.delete.description=A exclusão de um pacote é permanente e não pode s
settings.delete.notice=Você está prestes a excluir %s (%s). Esta operação é irreversível, tem certeza?
settings.delete.success=O pacote foi excluído.
settings.delete.error=Falha ao excluir o pacote.
owner.settings.cargo.title=Índice do Registro Cargo
owner.settings.cargo.initialize=Iniciar Índice
owner.settings.cargo.initialize.description=Para usar o registro Cargo é necessário um repositório git especial. Aqui você pode (re)criá-lo com a configuração necessária.
owner.settings.cargo.initialize.error=Falha ao inicializar índice Cargo: %v
owner.settings.cargo.initialize.success=O índice Cargo foi criado com sucesso.
owner.settings.cargo.rebuild=Reconstruir Índice
owner.settings.cargo.rebuild.description=Se o índice está fora de sincronia com os pacotes Cargo, você pode reconstruí-lo aqui.
owner.settings.cargo.rebuild.error=Falha ao reconstruir índice Cargo: %v
owner.settings.cargo.rebuild.success=O índice Cargo foi reconstruído com sucesso.
owner.settings.cleanuprules.title=Gerenciar Regras de Limpeza
owner.settings.cleanuprules.add=Adicionar Regra de Limpeza
owner.settings.cleanuprules.edit=Editar Regra de Limpeza
@@ -3232,6 +3272,7 @@ owner.settings.cleanuprules.preview=Pré-visualizar Regra de Limpeza
owner.settings.cleanuprules.preview.overview=%d pacotes agendados para serem removidos.
owner.settings.cleanuprules.preview.none=A regra de limpeza não corresponde a nenhum pacote.
owner.settings.cleanuprules.enabled=Habilitado
owner.settings.cleanuprules.pattern_full_match=Aplicar padrão ao nome completo do pacote
owner.settings.cleanuprules.keep.title=Versões que correspondem a estas regras são mantidas, mesmo se corresponderem a uma regra de remoção abaixo.
owner.settings.cleanuprules.keep.count=Manter o mais recente
owner.settings.cleanuprules.keep.count.1=1 versão por pacote
@@ -3245,6 +3286,7 @@ owner.settings.cleanuprules.success.update=Regra de limpeza foi atualizada.
owner.settings.cleanuprules.success.delete=Regra de limpeza foi excluída.
owner.settings.chef.title=Registro Chef
owner.settings.chef.keypair=Gerar par de chaves
owner.settings.chef.keypair.description=Gerar um par de chaves usado para autenticar no registro Chef. A chave anterior não pode ser usada depois.
[secrets]
secrets=Segredos
@@ -3253,6 +3295,8 @@ none=Não há segredos ainda.
value=Valor
name=Nome
creation=Adicionar Segredo
creation.name_placeholder=apenas caracteres alfanuméricos ou underline (_), não pode começar com GITEA_ ou GITHUB_
creation.value_placeholder=Insira qualquer conteúdo. Espaços em branco no início e no fim serão omitidos.
creation.success=O segredo '%s' foi adicionado.
creation.failed=Falha ao adicionar segredo.
deletion=Excluir segredo
@@ -3274,6 +3318,10 @@ status.cancelled=Cancelado
status.skipped=Ignorado
status.blocked=Bloqueado
runners=Runners
runners.runner_manage_panel=Gerenciamento de Runners
runners.new=Criar novo Runner
runners.new_notice=Como iniciar um runner
runners.status=Status
runners.id=ID
runners.name=Nome
@@ -3281,21 +3329,39 @@ runners.owner_type=Tipo
runners.description=Descrição
runners.labels=Rótulos
runners.last_online=Última Vez Online
runners.agent_labels=Etiquetas do Agente
runners.custom_labels=Etiquetas Personalizadas
runners.custom_labels_helper=Etiquetas personalizadas são etiquetas que são adicionadas manualmente por um administrador. Separe as etiquetas com vírgula. Espaço em branco no começo ou no final de cada etiqueta é ignorado.
runners.runner_title=Runner
runners.task_list=Tarefas recentes neste runner
runners.task_list.run=Executar
runners.task_list.status=Status
runners.task_list.repository=Repositório
runners.task_list.commit=Commit
runners.task_list.done_at=Feito em
runners.edit_runner=Editar Runner
runners.update_runner=Atualizar as Alterações
runners.update_runner_success=Runner atualizado com sucesso
runners.update_runner_failed=Falha ao atualizar runner
runners.delete_runner=Deletar esse runner
runners.delete_runner_success=Runner excluído com sucesso
runners.delete_runner_failed=Falha ao excluir runner
runners.delete_runner_header=Confirme para excluir este runner
runners.delete_runner_notice=Se uma tarefa estiver sendo executada neste runner, ela será encerrada e marcada como falha. Pode quebrar o workflow de construção.
runners.none=Nenhum runner disponível
runners.status.unspecified=Desconhecido
runners.status.idle=Inativo
runners.status.active=Ativo
runners.status.offline=Offiline
runners.version=Versão
runs.all_workflows=Todos os Workflows
runs.open_tab=%d Aberto
runs.closed_tab=%d Fechado
runs.commit=Commit
runs.pushed_by=Push realizado por
runs.valid_workflow_helper=Arquivo de configuração do workflow é válido.
runs.invalid_workflow_helper=O arquivo de configuração do workflow é inválido. Por favor, verifique seu arquivo de configuração: %s
need_approval_desc=Precisa de aprovação para executar workflows para pull request do fork.
+20 -8
View File
@@ -1357,8 +1357,8 @@ issues.opened_by_fake=%[1]s aberta(s) por %[2]s
issues.closed_by_fake=por %[2]s foi fechada %[1]s
issues.previous=Anterior
issues.next=Seguinte
issues.open_title=Aberta
issues.closed_title=Fechada
issues.open_title=aberta(s)
issues.closed_title=fechada(s)
issues.draft_title=Rascunho
issues.num_comments=%d comentários
issues.commented_at=`comentou <a href="#%s">%s</a>`
@@ -1369,7 +1369,7 @@ issues.context.reference_issue=Criar uma nova questão referindo esta
issues.context.edit=Editar
issues.context.delete=Eliminar
issues.no_content=Ainda não há conteúdo.
issues.close_issue=Fechar
issues.close=Encerrar questão
issues.pull_merged_at=`integrou o cometimento <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> no ramo <b>%[3]s</b> %[4]s`
issues.manually_pull_merged_at=`integrou o cometimento <a class="ui sha" href="%[1]s"><code>%[2]s</code></a> no ramo <b>%[3]s</b> manualmente %[4]s`
issues.close_comment_issue=Comentar e fechar
@@ -1654,6 +1654,7 @@ pulls.update_branch_rebase=Modificar ramo mudando a base
pulls.update_branch_success=A sincronização do ramo foi bem sucedida
pulls.update_not_allowed=Não tem autorização para sincronizar o ramo
pulls.outdated_with_base_branch=Este ramo é obsoleto em relação ao ramo base
pulls.close=Encerrar pedido de integração
pulls.closed_at=`fechou este pedido de integração <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.reopened_at=`reabriu este pedido de integração <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.merge_instruction_hint=`Também pode ver as <a class="show-instruction">instruções para a linha de comandos</a>.`
@@ -1780,7 +1781,7 @@ activity.title.issues_1=%d questão
activity.title.issues_n=%d questões
activity.title.issues_closed_from=%s resolvida(s) de %s
activity.title.issues_created_by=%s criada por %s
activity.closed_issue_label=Encerrada
activity.closed_issue_label=Fechada
activity.new_issues_count_1=questão nova
activity.new_issues_count_n=questões novas
activity.new_issue_label=Em aberto
@@ -1930,7 +1931,7 @@ settings.trust_model.default=Modelo de confiança padrão
settings.trust_model.default.desc=Usar o modelo de confiança padrão do repositório para esta instalação.
settings.trust_model.collaborator=Colaborador
settings.trust_model.collaborator.long=Colaborador: Confiar nas assinaturas dos colaboradores
settings.trust_model.collaborator.desc=Assinaturas válidas dos colaboradores deste repositório serão marcadas como "fiável" (quer correspondam ou não ao autor do cometimento). Caso contrário, assinaturas válidas serão marcadas como "não fiável" se a assinatura corresponder ao autor do cometimento e "não corresponde", se não corresponder.
settings.trust_model.collaborator.desc=Assinaturas válidas dos colaboradores deste repositório serão marcadas como "fiável" (independentemente de corresponderem, ou não, ao autor do cometimento). Caso contrário, assinaturas válidas serão marcadas como "não fiável" se a assinatura corresponder ao autor do cometimento e "não corresponde", se não corresponder.
settings.trust_model.committer=Autor do cometimento
settings.trust_model.committer.long=Autor do cometimento: Confiar nas assinaturas que correspondam aos autores dos cometimentos (isto corresponde ao funcionamento do GitHub e força a que os cometimentos assinados do Gitea tenham o Gitea como autor do cometimento)
settings.trust_model.committer.desc=Assinaturas válidas apenas serão marcadas como "fiável" se corresponderem ao autor do cometimento, caso contrário serão marcadas como "não corresponde". Isto irá forçar a que o Gitea seja o autor do cometimento nos cometimentos assinados, ficando o autor real marcado como "Co-autorado-por:" e "Co-cometido-por:" no resumo do cometimento. A chave padrão do Gitea tem que corresponder a um utilizador na base de dados.
@@ -2264,7 +2265,9 @@ diff.review.header=Submeter revisão
diff.review.placeholder=Comentário da revisão
diff.review.comment=Comentar
diff.review.approve=Aprovar
diff.review.self_reject=Autores de pedidos de integração não podem requisitar modificações sobre o seu próprio pedido de integração
diff.review.reject=Solicitar modificações
diff.review.self_approve=Autores de pedidos de integração não podem aprovar o seu próprio pedido de integração
diff.committed_by=cometido por
diff.protected=Protegido
diff.image.side_by_side=Lado a Lado
@@ -2934,6 +2937,8 @@ config.git_disable_diff_highlight=Desabilitar o realce de sintaxe no diff
config.git_max_diff_lines=Número máximo de linhas diff (por ficheiro)
config.git_max_diff_line_characters=Número máximos de caracteres diff (por linha)
config.git_max_diff_files=Número máximo de ficheiros diff a serem apresentados
config.git_enable_reflogs=Habilitar reflogs
config.git_reflog_expiry_time=Tempo de expiração
config.git_gc_args=Argumentos da recolha de lixo
config.git_migrate_timeout=Prazo da migração
config.git_mirror_timeout=Prazo para sincronização da réplica
@@ -3237,6 +3242,10 @@ rubygems.dependencies.development=Dependências de desenvolvimento
rubygems.required.ruby=Requer a versão do Ruby
rubygems.required.rubygems=Requer a versão do RubyGem
rubygems.documentation=Para obter mais informações sobre o registo do RubyGems, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">a documentação</a>.
swift.registry=Configurar este registo usando a linha de comandos:
swift.install=Adicione o pacote no seu ficheiro <code>Package.swift</code>:
swift.install2=e execute o seguinte comando:
swift.documentation=Para obter mais informações sobre o registo do Swift, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/swift/">a documentação</a>.
vagrant.install=Para adicionar uma máquina virtual Vagrant, execute o seguinte comando:
vagrant.documentation=Para obter mais informações sobre o registo do Vagrant, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">a documentação</a>.
settings.link=Vincular este pacote a um repositório
@@ -3342,18 +3351,21 @@ runners.delete_runner=Eliminar o executor
runners.delete_runner_success=O executor foi eliminado com sucesso
runners.delete_runner_failed=Falhou ao eliminar o executor
runners.delete_runner_header=Confirme que quer eliminar este executor
runners.delete_runner_notice=Se uma tarefa estiver a correr sob este executor, será terminada e marcada como tendo falhado. Pode quebrar o fluxo de trabalho de construção.
runners.delete_runner_notice=Se uma tarefa estiver a correr sob este executor, será terminada e marcada como tendo falhado. Isso pode quebrar a sequência de trabalho de construção.
runners.none=Não há executores disponíveis
runners.status.unspecified=Desconhecido
runners.status.idle=Parada
runners.status.active=Em funcionamento
runners.status.offline=Desconectada
runners.version=Versão
runs.all_workflows=Todos os fluxos de trabalho
runs.all_workflows=Todas as sequências de trabalho
runs.open_tab=%d abertas
runs.closed_tab=%d fechadas
runs.commit=Cometimento
runs.pushed_by=Enviada por
runs.valid_workflow_helper=O ficheiro de configuração da sequência de trabalho é válido.
runs.invalid_workflow_helper=O ficheiro de configuração da sequência de trabalho é inválido. Verifique o seu ficheiro de configuração: %s
need_approval_desc=É necessária aprovação para executar fluxos de trabalho para a derivação do pedido de integração.
need_approval_desc=É necessária aprovação para executar sequências de trabalho para a derivação do pedido de integração.

Some files were not shown because too many files have changed in this diff Show More