summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Disallow dangerous url schemes (#25960)KN4CK3R2023-07-184-5/+19
| | | | | | | | | | | | Regression: https://github.com/go-gitea/gitea/pull/24805 Closes: #25945 - Disallow `javascript`, `vbscript` and `data` (data uri images still work) url schemes even if all other schemes are allowed - Fixed older `cbthunderlink` tests --------- Co-authored-by: delvh <dev.lh@web.de>
* Avoid creating directories when loading config (#25944)wxiaoguang2023-07-181-2/+4
| | | | | | | | | The "creating dir/file during load config" is a longstanding and complex problem. This PR only does a quick patch, it still needs more refactorings in the future. Fix #25938
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-181-29/+29
|
* Import `sortablejs` only once (#25936)silverwind2023-07-173-7/+10
| | | | | | | Previously, `sortablejs` was imported twice, once synchronously and once asynchronously, leading to webpack creating duplicate output code (once in the index bundle, and once in a separate chunk). Fix this by always asynchronously importing it. This was one of the build warnings observed when trying to build with vite.
* Make environment-to-ini work with INSTALL_LOCK=true (#25926)wxiaoguang2023-07-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression of #25648, fix #25924 Test: ```bash rm -f /tmp/example.ini /tmp/out.ini && \ echo "[security]" > /tmp/example.ini && \ echo "INSTALL_LOCK = true" >> /tmp/example.ini && \ GITEA__foo__bar=1 go run contrib/environment-to-ini/environment-to-ini.go --config=/tmp/example.ini --out=/tmp/out.ini && \ echo "==== example:" && \ cat /tmp/example.ini && \ echo "==== out:" && \ cat /tmp/out.ini ``` Output: ``` 2023/07/17 17:40:51 ...nvironment-to-ini.go:99:runEnvironmentToIni() [I] Settings saved to: "/tmp/out.ini" ==== example: [security] INSTALL_LOCK = true ==== out: [security] INSTALL_LOCK = true [foo] bar = 1 ```
* Ignore `runs-on` with expressions when warning no matched runners (#25917)Jason Song2023-07-171-0/+7
| | | | | Fix #25905 Co-authored-by: Giteabot <teabot@gitea.io>
* Skip unuseful error message in dev mode when watching local filesystem (#25919)wxiaoguang2023-07-171-1/+1
| | | | | | | | | | | | Before, in dev mode, there might be some error logs like: ``` 2023/07/17 13:54:51 ...s/assetfs/layered.go:221:WatchLocalChanges() [E] Unable to watch directory .: lstat /data/work/gitea/custom/templates: no such file or directory ``` Because there is no "custom/templates" directory. After: ignore such error, no such error message anymore.
* Add shutting down notice (#25920)KN4CK3R2023-07-171-1/+1
| | | | | | | Got the same problem as #25915 when updating an instance. The `log.Fatal` should have been marked as breaking in #23911. This PR adds a notice that the system is shutting down because of the deprecated setting.
* Downgrading Snap to build with node/18 instead of node/20techknowlogick2023-07-171-1/+1
|
* Fix margin on the new/edit project page. (#25885)puni98692023-07-161-3/+3
| | | | | | | | | | | | | | | | | | New/Edit Project page consistent layout. Fix margin on the new/edit page. Before: <img width="1381" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/303e128c-0bd0-4289-a395-ff077e33b1c8"> <img width="1392" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/d11f7a42-ddf4-4c0a-a1b1-b8cefca9dfa1"> After <img width="1390" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/8ae1a979-9050-4d68-8f5d-9dfaa620c0e8"> <img width="1391" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/24a62711-dc0a-4425-bf84-7c1896b9a005"> Co-authored-by: silverwind <me@silverwind.io>
* Add 1.20.0 changelog (#25901)delvh2023-07-161-0/+615
| | | Co-authored-by: Yarden Shoham <git@yardenshoham.com>
* Fix incorrect milestone count when provide a keyword (#25880)yp053272023-07-161-10/+9
| | | | | | | You can confirm this issue in: https://try.gitea.io/yp05327/testrepo/milestones?state=open&q=a There's no milestone, but the count is 1. ![image](https://github.com/go-gitea/gitea/assets/18380374/25e58cee-aeeb-43c1-8ec8-6e2ec6bf1284)
* Avoid opening/closing PRs which are already merged (#25883)yp053272023-07-161-0/+8
| | | | | | | | | | | We can select PRs to open/close them by one click, but we forgot to check whether it is merged. You can get an opening merged PR: ![image](https://github.com/go-gitea/gitea/assets/18380374/22c2e747-4bb9-4742-a9aa-ef39d5308bc5) You can confirm this in: https://try.gitea.io/yp05327/testrepo/pulls/5
* Make `add line comment` buttons focusable (#25894)sebastian-sauer2023-07-154-10/+15
| | | | | | | | Use a real button and add an aria-label. Additionally, show the button whenever it is focused. See https://codeberg.org/forgejo/forgejo/issues/998 for explanation. Our handling of this button is now equal to that of GitHub. Nothing has changed visually.
* Fix "Flash" message usage (#25895)wxiaoguang2023-07-152-23/+6
| | | Resolve https://github.com/go-gitea/gitea/pull/25820/files#r1264309059
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-151-3/+118
|
* Add support for different Maven POM encoding (#25873)KN4CK3R2023-07-143-2/+30
| | | | | | Fixes #25853 - Maven POM files aren't always UTF-8 encoded. - Reject the upload of unparsable POM files
* Fix incorrect release count (#25879)yp053272023-07-142-2/+1
| | | | | | | | | | | | | | | | | | | | Release count is not correct: https://try.gitea.io/yp05327/testrepo/tags ![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52) https://try.gitea.io/yp05327/testrepo/releases ![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403) https://try.gitea.io/yp05327/testrepo/releases/tag/testtag ![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260) We already have correct release count, no need to calculate it again. https://github.com/go-gitea/gitea/blob/c5e187c389b35b9e080a3187b93a775a3c81e585/modules/context/repo.go#L547 Co-authored-by: Giteabot <teabot@gitea.io>
* Add Github related extensions in devcontainer (#25800)yp053272023-07-142-1/+3
|
* Add error info if no user can fork the repo (#25820)yp053272023-07-142-0/+7
| | | | | | | | | Before: (Owner list is empty) ![image](https://github.com/go-gitea/gitea/assets/18380374/dbe87bfe-14ed-4997-8cb2-5c1308232a70) After: (Disable the button and show the error info) ![image](https://github.com/go-gitea/gitea/assets/18380374/a7e4c315-67ab-408b-88f2-c554076ce87a)
* Fix wrong usage of PathEscapeSegments in branch list page (#25864)yp053272023-07-141-1/+1
| | | | | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/21ce7bfa-36f7-4125-9a66-d644400916a8) emmm, don't know how to write a good title to describe this issue. If you have a good idea, I can change the title. The fix code is copied from L122. Not sure it is right or not. @lunny Maybe `DefaultBranchBranch` is also typo? Two `Branch` in variable name .
* fix incorrect repo url when changed the case of ownername (#25733)hiifong2023-07-142-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When only the case of the username changes and the new username is consistent with the lowercase username of the old user name, update the owner name of the repo, and keep the original logic consistent with other conditions. example: your username is `gitea`, lowercase username is `gitea`,repo url is `.../gitea/{repo}`, you changed username to `Gitea` or `GiTea` or other, but the lowercase username is still `gitea`, the repo url is still `.../gitea/{repo}`. this pr fixed it,keep username and repo url consistent. Before: ![image](https://github.com/go-gitea/gitea/assets/89133723/84177296-f0ff-4176-84f1-1f9ec3f5b86f) ![image](https://github.com/go-gitea/gitea/assets/89133723/8f8f4a12-ecdd-4dec-af89-85c009b0ccfe) After: ![image](https://github.com/go-gitea/gitea/assets/89133723/0564edb6-9467-405a-8cd4-d6f70e6f614b) ![image](https://github.com/go-gitea/gitea/assets/89133723/554ecd6e-e5a1-43bc-a46d-99e988c2ff58)
* Upgrade go dependencies (#25819)harryzcy2023-07-1410-398/+379
|
* Don't stack PR tab menu on small screens (#25789)sebastian-sauer2023-07-142-22/+32
| | | | | | | | | | | | | | | the stacking takes up screen space - display the tabs as the navigation bar. github uses the same layout. Screenshots (left before, right after): ![image](https://github.com/go-gitea/gitea/assets/1135157/d7e2aaec-c67b-403d-8d56-d4c824b04eed) ![image](https://github.com/go-gitea/gitea/assets/1135157/9e150881-c265-4074-afd7-407bb52e1934) Large screen: ![image](https://github.com/go-gitea/gitea/assets/1135157/d5cbdaa3-2962-4c4f-9595-5938981ff99e)
* Link to list of vulnerabilities (#25872)M Hickford2023-07-141-0/+2
|
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-141-1/+21
|
* move issue filters to shared template (#25729)Denys Konovalov2023-07-136-347/+203
| | | | | | | | | | | | | | | | Issue filters are being used on repo list page and on milestone issues page, and the code is mostly duplicated. This PR does the following changes: - move issue filters into a shared template - allow filtering milestone issues by project, so no need to hide this filter on milestone issues page - remove some dead code (e. g. issue actions in milestone issues template) - fix label filter dropdown width --------- Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-131-0/+90
|
* Remove `git.FileBlame` (#25841)Jason Song2023-07-121-6/+0
| | | | | | | | | | The `FileBlame` function looks strange, it has `revision` as argument but doesn't use it. Since the function never be used, I think we could just remove it. If anyone thinks it should be kept, please help fix `revision`. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix empty project displayed in issue sidebar (#25802)yp053272023-07-125-11/+53
| | | | | | | | | | | | | | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4) This issue comes from the change in #25468. `LoadProject` will always return at least one record, so we use `ProjectID` to check whether an issue is linked to a project in the old code. As other `issue.LoadXXX` functions, we need to check the return value from `xorm.Session.Get`. In recent unit tests, we only test `issueList.LoadAttributes()` but don't test `issue.LoadAttributes()`. So I added a new test for `issue.LoadAttributes()` in this PR. --------- Co-authored-by: Denys Konovalov <privat@denyskon.de>
* Update blog links (#25843)HesterG2023-07-128-9/+9
| | | | | | | | As title. Permalinks for lastest version of blog has changed, update the blog links. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix margin on the `new/edit milestone` page (#25801)puni98692023-07-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is some distortion in desktop and mobile ui for new/edit milestone page. Fixing the new/edit milestone page for desktop and mobile ui Design background https://uxplanet.org/primary-secondary-action-buttons-c16df9b36150 https://balsamiq.com/learn/articles/button-design-best-practices/ <details> <summary>Screen shots</summary> Before: ![image](https://github.com/go-gitea/gitea/assets/80308335/c8627679-da2d-465f-bc8f-978d7b836919) ![image](https://github.com/go-gitea/gitea/assets/80308335/43b54599-2856-440a-a13c-08bb3cedf35c) After ![image](https://github.com/go-gitea/gitea/assets/80308335/85ca3d32-4842-41bc-8647-aa4222b9cc06) ![image](https://github.com/go-gitea/gitea/assets/80308335/c00e87c4-e64e-4b18-aa42-d26c3942a21b) </details> --------- Co-authored-by: Denys Konovalov <privat@denyskon.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Do not "guess" the file encoding/BOM when using API to upload files (#25828)wxiaoguang2023-07-121-102/+3
| | | | | | | | Related issue: #18368 It doesn't seem right to "guess" the file encoding/BOM when using API to upload files. The API should save the uploaded content as-is.
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-121-17/+221
|
* Show correct SSL Mode on "install page" (#25818)wxiaoguang2023-07-122-3/+4
|
* Fix incorrect oldest sort in project list (#25806)yp053272023-07-115-15/+64
| | | | sort type `oldest` should be `Asc`. Added a test for this.
* Fix the error message when the token is incorrect (#25701)caicandong2023-07-113-24/+52
| | | | | | | | | | | | | | | we refactored `userIDFromToken` for the token parsing part into a new function `parseToken`. `parseToken` returns the string `token` from request, and a boolean `ok` representing whether the token exists or not. So we can distinguish between token non-existence and token inconsistency in the `verfity` function, thus solving the problem of no proper error message when the token is inconsistent. close #24439 related #22119 --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Exclude default branch from pushed branch hint (#25795)Lunny Xiao2023-07-102-2/+4
| | | | | | | | When pushing to default branch, no pushing hint should be prompt. Fix #25778 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* For API attachments, use API URL (#25639)Lunny Xiao2023-07-1019-67/+108
| | | | | | | Fix #25257 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix WORK_DIR for docker (root) image (#25738)wxiaoguang2023-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #25726 #17846 chose an incorrect WORK_DIR path for docker root image. Gitea's work-path was already used as the base path for various paths (like AppDataPath), so, the work-path should be mounted to a volume in a docker image. Now, for docker root image, it's unavoidable to mix the WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"), because some of them have already been mixed. Some directories in the screenshot are for "CustomPath" , while others are for "AppDataPath", due to the technical debts in old code: ``` CUSTOM_PATH="/data/gitea" APP_DATA_PATH = /data/gitea ``` <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1) </details> This PR is breaking but this is the only way at the moment to avoid users losing their data accidently Co-authored-by: Giteabot <teabot@gitea.io>
* Avoid amending the Rebase and Fast-forward merge if there is no message ↵wxiaoguang2023-07-102-1/+6
| | | | | | | | | | | | template (#25779) Related #22669. Close #25177 After the fix: ![image](https://github.com/go-gitea/gitea/assets/2114189/0e900927-ea72-4f8f-bde6-5ed927cb02f4) Co-authored-by: Giteabot <teabot@gitea.io>
* Show edit title button on commits tab of PR, too (#25791)sebastian-sauer2023-07-101-0/+3
| | | | | | | | | | | | | | | | | | | | | All 3 tabs of the PR (Conversation, Commits and Files changed) should show the edit title button. Before this commit the edit button was not shown on commits tab Screenshots: After: ![image](https://github.com/go-gitea/gitea/assets/1135157/d04c700c-dffc-4bcd-8108-cb64838af0c6) Before: ![image](https://github.com/go-gitea/gitea/assets/1135157/b6795ad3-c994-461c-98aa-a7331c3e3877) Just for reference the edit button in files changed tab: ![image](https://github.com/go-gitea/gitea/assets/1135157/5750640d-489f-4a71-8144-543ef42afb42) Co-authored-by: Giteabot <teabot@gitea.io>
* Make "install page" respect environment config (#25648)wxiaoguang2023-07-1013-72/+86
| | | | | | | | | | | | | | | | | | | | | | | | | Replace #25580 Fix #19453 The problem was: when users set "GITEA__XXX__YYY" , the "install page" doesn't respect it. So, to make the result consistent and avoid surprising end users, now the "install page" also writes the environment variables to the config file. And, to make things clear, there are enough messages on the UI to tell users what will happen. There are some necessary/related changes to `environment-to-ini.go`: * The "--clear" flag is removed and it was incorrectly written there. The "clear" operation should be done if INSTALL_LOCK=true * The "--prefix" flag is removed because it's never used, never documented and it only causes inconsistent behavior. ![image](https://github.com/go-gitea/gitea/assets/2114189/12778ee4-3fb5-4664-a73a-41ebbd77cd5b)
* Enable H014 and H023 djlint rules (#25786)silverwind2023-07-0910-23/+3
| | | | | | | | | | | | Enable these rules: - H014 | More than 2 blank lines. - H023 | Do not use entity references. There are more potential rules to enable but they are blocked by bugs in the linter: - https://github.com/Riverside-Healthcare/djLint/issues/711 - https://github.com/Riverside-Healthcare/djLint/issues/712
* Restructure issue list template, styles (#25750)Denys Konovalov2023-07-095-148/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR does various modifications on the issue list shared template: - restructure layout to achieve better responsiveness - fix various style issues - restructure styles (better result with less code :) - remove numerous `gt-*` patches and other unneeded classes -> use existing css classes <details> <summary>Before:</summary> ![Bildschirmfoto vom 2023-07-07 14-35-00](https://github.com/go-gitea/gitea/assets/47871822/5301fc80-d58b-41c2-8090-5867e2e8459c) ![Bildschirmfoto vom 2023-07-07 14-35-19](https://github.com/go-gitea/gitea/assets/47871822/d36ab691-7dc4-44bb-a8f6-a4105a2a6777) ![Bildschirmfoto vom 2023-07-07 14-35-43](https://github.com/go-gitea/gitea/assets/47871822/0762c852-eb40-4b00-8757-c5dbfd2ae569) </details> <details> <summary>After:</summary> ![Bildschirmfoto vom 2023-07-07 14-32-04](https://github.com/go-gitea/gitea/assets/47871822/0ac42d36-f98f-451a-b556-70c913d19df8) ![Bildschirmfoto vom 2023-07-07 14-31-32](https://github.com/go-gitea/gitea/assets/47871822/520fac9c-33e3-4290-bfe1-6e941f1100f8) ![Bildschirmfoto vom 2023-07-07 14-31-14](https://github.com/go-gitea/gitea/assets/47871822/05ad46bb-3c67-403d-85b8-d12d64f99c59) </details> --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix notification list bugs (#25781)wxiaoguang2023-07-094-4/+4
| | | | | | | | | Fix #25627 1. `ctx.Data["Link"]` should use relative URL but not AppURL 2. The `data-params` is incorrect because it doesn't contain "page". JS can simply use "window.location.search" to construct the AJAX URL 3. The `data-xxx` and `id` in notification_subscriptions.tmpl were copied&pasted, they don't have affect.
* Revert package access change from #23879 (#25707)KN4CK3R2023-07-098-28/+385
| | | | | | | | | | | | | | | | | | | | | Fixes (?) #25538 Fixes https://codeberg.org/forgejo/forgejo/issues/972 Regression #23879 #23879 introduced a change which prevents read access to packages if a user is not a member of an organization. That PR also contained a change which disallows package access if the team unit is configured with "no access" for packages. I don't think this change makes sense (at the moment). It may be relevant for private orgs. But for public or limited orgs that's useless because an unauthorized user would have more access rights than the team member. This PR restores the old behaviour "If a user has read access for an owner, they can read packages". --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Make route middleware/handler mockable (#25766)wxiaoguang2023-07-093-4/+145
| | | | | | | | | | | | | | | | | | To mock a handler: ```go web.RouteMock(web.MockAfterMiddlewares, func(ctx *context.Context) { // ... }) defer web.RouteMockReset() ``` It helps: * Test the middleware's behavior (assert the ctx.Data, etc) * Mock the middleware's behavior (prepare some context data for handler) * Mock the handler's response for some test cases, especially for some integration tests and e2e tests.
* Update tool dependencies, lock govulncheck and actionlint (#25655)silverwind2023-07-0926-141/+133
| | | | | | | | | | - Update all tool dependencies - Lock `govulncheck` and `actionlint` to their latest tags --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Test if container blob is accessible before mounting (#22759)KN4CK3R2023-07-093-8/+72
| | | | | | | | | | related #16865 This PR adds an accessibility check before mounting container blobs. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: silverwind <me@silverwind.io>