aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Calculate MAX_WORKERS default value by CPU number (#26177)wxiaoguang2023-07-274-18/+25
| | | | | | To avoid consuming user's 100% CPU, limit the default value of MAX_WORKERS Fix #26063 (the CPU 100% problem mentioned in it)
* Fixing redirection issue for logged-in users (#26105)cassiozareck2023-07-271-1/+2
| | | | | | | | | | | | | | | | | This PR addresses an issue where logged-in users get redirected to the homepage when trying to access a URL with the redirect_to parameter. The issue was traced back to a middleware function in services/auth/middleware.go that redirects logged-in users to the homepage. This function didn't account the redirect_to parameter. The fix modifies the middleware function to check for this case and redirect the user to the specified URL instead of the homepage. Closes: #26005 --------- Signed-off-by: cassiozareck <cassiomilczareck@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update govulncheck, fix typo (#26168)silverwind2023-07-261-4/+4
| | | | - Update govulncheck to latest version - Fix typo in variable name
* Fix handling of plenty Nuget package versions (#26075)KN4CK3R2023-07-265-38/+138
| | | | | | Fixes #25953 - Do not load full version information (v3) - Add pagination support (v2)
* Fix typos in Contributing.md (#26170)Niko Hoffrén2023-07-261-2/+2
| | | | | | | | | | | | | Fixed typos considering CONTRIBUTING.md. This line: GitHub API compatability #github-api-compatability changed to: GitHub API compatibility #github-api-compatibility and this line: GitHub API compatability changed to: GitHub API compatibility
* Disable download action logs button when there's no logs (#26114)yp053272023-07-261-1/+1
| | | | | | | | | | | | If there's no logs, you can also click the download button, then you will get `job is not started` page ![image](https://github.com/go-gitea/gitea/assets/18380374/c0dad309-1fb9-4505-99da-bf0038423744) https://gitea.com/yp05327/testrepo/actions/runs/38 After: If there's no steps displayed, the download button will be disabled. ![image](https://github.com/go-gitea/gitea/assets/18380374/5f51ba70-3d0b-46d8-ad77-f02c4c8fa52c)
* Re-add static images to docs (#26167)John Olheiser2023-07-264-0/+76
| | | | | | | https://github.com/go-gitea/gitea/pull/26051 I accidentally rebased locally without my re-addition for these files, so they were missed in the merge, but only for `main`. Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update email-setup.en-us.md (#26068)Felix Victor2023-07-2610-19/+14
| | | | | | | | The setting `MAILER_TYPE` is deprecated. According to the config cheat sheet, it should be `PROTOCOL`. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improve display of Labels/Projects/Assignees sort options (#25886)yp053272023-07-263-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Labels: Before: (no highlights) ![image](https://github.com/go-gitea/gitea/assets/18380374/88ffbff0-1b14-4d93-810d-f2ce2b2d7321) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/ab7b665b-d17c-4acd-a681-64cbb67ae460) ![image](https://github.com/go-gitea/gitea/assets/18380374/19f8a0d0-ad5f-4dbf-b45a-1001e60a8399) Projects: Before: (no highlights) ![image](https://github.com/go-gitea/gitea/assets/18380374/2079e6a8-8801-4662-acda-e248f115462f) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/7180a086-68be-49c4-bb29-3d05454fb41d) ![image](https://github.com/go-gitea/gitea/assets/18380374/3c5a791f-1852-4957-89b8-10940c672e10) Assignee: Before: (no highlights) ![image](https://github.com/go-gitea/gitea/assets/18380374/09273636-d9b1-4144-9533-2ce66cab8c49) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/24bd0cfe-b589-4c8a-be67-74f242dda6d3) ![image](https://github.com/go-gitea/gitea/assets/18380374/7476be73-5201-4330-82e2-44b0b5080f71)
* Fix wrong branch name in rename branch modal (#26146)yp053272023-07-261-1/+1
| | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/b4dc68e8-b85b-4097-a432-940e291ac582) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/7e692dd2-6b8b-4ba5-a251-ae4b9b917492)
* Doc update swagger doc for POST /orgs/{org}/teams (#26155)caicandong2023-07-262-12/+5
| | | close #26111
* Fix UI regression of asciinema player (#26159)Jason Song2023-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | It was caused by updating `asciinema-player`, the upstream changed the CSS class prefix: `https://github.com/asciinema/asciinema-player/commit/40505e479e8ba6833f178a3b7e85503c72491614` <details> <summary>Before:</summary> <img width="1320" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/b91a2cf5-c1da-43d6-bac2-bc278728b11e"> </details> <details> <summary>After:</summary> <img width="1311" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/c9872d25-e0bb-43d4-8b1e-d87c6b03c0a2"> </details>
* refactor improve NoBetterThan (#26126)caicandong2023-07-264-8/+193
| | | | | | | | | | | | | - The `NoBetterThan` function can only handle comparisons between "pending," "success," "error," and "failure." For any other comparison, we directly return false. This prevents logic errors like the one in #26121. - The callers of the `NoBetterThan` function should also avoid making incomparable calls. --------- Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
* Update Chinese documents (#26139)Upstream80222023-07-263-39/+113
| | | Update part of the documents, translate English to Chinese.
* Fix bugs in LFS meta garbage collection (#26122)Zettat1232023-07-263-7/+71
| | | | | | | | This PR - Fix #26093. Replace `time.Time` with `timeutil.TimeStamp` - Fix #26135. Add missing `xorm:"extends"` to `CountLFSMetaObject` for LFS meta object query - Add a unit test for LFS meta object garbage collection
* Move web JSON functions to web context and simplify code (#26132)wxiaoguang2023-07-2636-196/+75
| | | | | | | | | The JSONRedirect/JSONOK/JSONError functions were put into "Base" context incorrectly, it would cause abuse. Actually, they are for "web context" only, so, move them to the correct place. And by the way, use them to simplify old code: +75 -196
* Only show newly pushed branches message in the same repository (#26148)Zettat1232023-07-261-0/+1
| | | | | Partly fixes #26130 This is a quick fix. #25812 will fully fix the bug.
* Docusaurus-ify (#26051)John Olheiser2023-07-26281-2157/+794
| | | | | | | | | | | | | | This PR cleans up the docs in a way to make them simpler to ingest by our [docs repo](https://gitea.com/gitea/gitea-docusaurus). 1. It includes all of the sed invocations our ingestion did, removing the need to do it at build time. 2. It replaces the shortcode variable replacement method with `@variable@` style, simply for easier sed invocations when required. 3. It removes unused files and moves the docs up a level as cleanup. --------- Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Display deprecated warning in admin panel pages as well as in the log file ↵Lunny Xiao2023-07-267-9/+55
| | | | | | | | | | | | | | | (#26094) This PR includes #26007 's changes but have a UI to prompt administrator about the deprecated settings as well as the log or console warning. Then users will have enough time to notice the problem and don't have surprise like before. <img width="1293" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/c33355f0-1ea7-4fb3-ad43-cd23cd15391d"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove "misc" scope check from public API endpoints (#26134)wxiaoguang2023-07-264-63/+33
| | | Fix #26035
* Fix LFS object list style (#26133)wxiaoguang2023-07-262-25/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Close #26104 . Only a quick fix, the UI is not perfect. Before: <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/7b10d42d-8317-4d99-80f9-b6c5fe05c17e) ![image](https://github.com/go-gitea/gitea/assets/2114189/b43f1242-61a0-45e3-98b7-aa74b29f3813) </details> After: <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/a8d27f70-781d-4702-866f-a56df6dd6c0a) ![image](https://github.com/go-gitea/gitea/assets/2114189/379274e7-c67b-4c11-9cee-28a298b4ff5a) </details>
* Drop the correct deleted branch table (#26028)yp053272023-07-263-1/+15
| | | | There's a typo in #22743 The correct table name is `deleted_branch` not `deleted_branches`
* Fix CLI allowing creation of access tokens with existing name (#26071)Yarden Shoham2023-07-251-5/+16
| | | | | | | | | | | | | We are now: - Making sure there is no existing access token with the same name - Making sure the given scopes are valid (we already did this before but now we have a message) The logic is mostly taken from https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123 Closes #26044 Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Fix incorrect router logger (#26137)wxiaoguang2023-07-251-3/+3
| | | | | | A low-level mistake: * `log.Info` is global `Info` function, which calls "default" logger * `logger.Info` is the for router's logger
* Increase table cell horizontal padding (#26140)silverwind2023-07-251-1/+1
| | | | | | | | | | | | Extract from https://github.com/go-gitea/gitea/pull/26043, just the padding increase. Before and After (hard to notice, but it's there): <img width="427" alt="Screenshot 2023-07-25 at 19 37 12" src="https://github.com/go-gitea/gitea/assets/115237/9543dcda-eccb-4739-b7dd-06b076108ab4"> <img width="420" alt="Screenshot 2023-07-25 at 19 37 26" src="https://github.com/go-gitea/gitea/assets/115237/0a9c3724-81a1-4c67-a13b-4b728a51fc3a"> Co-authored-by: Giteabot <teabot@gitea.io>
* Update xorm version (#26128)Lunny Xiao2023-07-253-345/+69
| | | | | | | Test new xorm version compatible with Gitea --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix UI for release tag page / wiki page / subscription page (#25948)puni98692023-07-255-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Agenda: This PR contains UI fixes for release tag page / wiki page / subscription page. Here is the list of changes made in this PR. 1. Release tag page a. In the New Release page the whole ui got change. Now it is covering in full page page with mobile view port. Description about the release the editor preview now has a min-height. and the check boxes for `Prerelease` and option are left aligned. Couple of divider are added. 2. Subscription page: a. In the subscription page the ui was distorted in mobile view. Now its fix. Couple of unused styles were removed. 3. Create Wiki page:- a. In the page the preview of markdown is now contains a fix min-height so this it will not distorted in desktop view and a divider is added before action buttons. Couple of unused styles were removed. # Before ## Release page <img width="1391" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/319dec2e-08cf-40c5-920a-d651930ee28e"> <img width="494" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/03249f40-2d36-4552-bb93-43832aac2f8b"> <img width="1390" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/bf8b2d31-4857-480b-abd9-66a3ae6e24d8"> <img width="484" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/c3a58210-a337-4c8e-89a6-edb3975986bb"> Editor <img width="958" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/3bdd299d-d12b-4774-ace9-7184b1a57b18"> Editor preview <img width="1293" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2b61c528-c018-4800-ab86-07aae56adecd"> <img width="484" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/ff7bc5ee-9dc0-4f78-a0b1-94277ab27700"> #### After <img width="1439" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/94f7e073-5977-40bd-98ef-0711ed0815cc"> <img width="1384" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/83e3105f-c1ee-4329-b90f-8bb724dac50f"> <img width="1440" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/05f024a5-52eb-4072-8599-d6ca12f6fad1"> <img width="1387" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/c73f069b-572a-4a13-aaa9-fc5b4dd3420d"> <img width="1440" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2f98f012-8e64-4a12-9595-5acdef18f85c"> Markdown preview change <img width="1368" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/31e583ec-48f6-4f1a-8b56-0164fcb127a5"> Wiki page Before <img width="1393" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/9c9cfdf6-3c2a-4f47-883b-76624d96f9a0"> <img width="499" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/522ad573-1ad2-4fa2-8bf7-48a3dded14e7"> Preview of mark down. <img width="488" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/998f3c25-9fca-43c8-b1ff-648aab291727"> Footer <img width="490" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/89c6cf4e-4599-4403-bac8-285efdd9361a"> After <img width="1389" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/1ee0fc72-f864-44c0-b2e4-e0e8a8470204"> <img width="498" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/b35b9a5d-8e26-4869-a6ed-6cef1f4a87a6"> <img width="499" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/b40bcbaa-fca6-42ab-9556-f950811b565d"> Preview tab block has min-height <img width="1392" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/4a53d6c2-596c-423a-91b1-533cef734f93"> Mobile view <img width="496" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/c5ffc4c9-3c21-4cad-bc32-2ea3f0644a08"> <img width="497" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/08dd560f-4333-41ec-95b9-8154910d2254"> <img width="496" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/9fba8f55-727b-4756-a4a6-2070c719b15b"> ## Subscription page ### Before <img width="1393" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/0a7d561b-f56c-4ebe-93bd-952abecd437f"> <img width="492" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/4dc44d0c-ea81-4130-8afb-8f271c029e8a"> After <img width="1394" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/a3567e30-2b5b-49d6-9ecb-2ab481ea4d36"> <img width="494" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/024da9e2-dfc4-4672-95cc-a6ac034d9712"> <img width="508" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/b748ecea-427c-4f8b-a1bf-08f82f9a42e6">
* added ssh mirror workaround description (#26096)thigg2023-07-251-0/+13
| | | | | | related #1635 #18159 This will probably be obsolete at some point, but it should not break anything and it may help some users
* Improve "gitea doctor" sub-command and fix "help" commands (#26072)wxiaoguang2023-07-255-76/+62
| | | | | | | | | | | | | | | | | | | | | | | Replace #21790 And close #25965 by the way (it needs a separate fix for 1.20) Major changes: 1. Move "gitea convert" to "gitea doctor conver". The old "gitea doctor" still works as a hidden sub-command (to avoid breaking) 2. Do not write "doctor.log" by default, it's not useful in most cases and causes bugs like 25965 3. Improve documents 4. Fix the "help" commands. Before, the "./gitea doctor" can't show the sub-command help correctly (regression of the last cli/v2 refactoring) After this PR: ``` ./gitea help # show all sub-commands for the app ./gitea doctor # show the sub-commands for the "doctor" ./gitea doctor help # show the sub-commands for the "doctor", as above ```
* Fix wrong commit status in web ui (#26121)yp053272023-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/8c5643b5-5c16-4674-9fe6-9e7fa2dda0b9) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/caf8891b-14df-418d-a7eb-977b54b9e9be) There's a bug in the recent logic, `CalcCommitStatus` will always return the first item of `statuses` or error status, because `state` is defined with default value which should be `CommitStatusSuccess` Then ``` golang if status.State.NoBetterThan(state) { ``` this `if` will always return false unless `status.State = CommitStatusError` which makes no sense. So `lastStatus` will always be `nil` or error status. Then we will always return the first item of `statuses` here or only return error status, and this is why in the first picture the commit status is `Success` but not `Failure`. https://github.com/go-gitea/gitea/blob/af1ffbcd63569df8646b20c524378f25710f129e/models/git/commit_status.go#L204-L211 Co-authored-by: Giteabot <teabot@gitea.io>
* remove IsWarning in tmpl (#26120)caicandong2023-07-251-1/+1
| | | | | | This problem occurs because in #25839, the warning status has been removed, but there is something in the tmpl that hasn't been changed. related #25839 close #26118
* Fix minor capitalization error in string (#26100)Panagiotis "Ivory" Vasilopoulos2023-07-251-1/+1
| | | | | Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve commit graph alignment and truncating (#26112)wxiaoguang2023-07-252-10/+15
| | | | | Fix #26101 ![image](https://github.com/go-gitea/gitea/assets/2114189/7507d201-822e-4534-8b20-e659d56b1268)
* Fix wrong workflow status when rerun a job in an already finished workflow ↵yp053272023-07-251-1/+1
| | | | | | | | | | | | | | (#26119) Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/fb687592-b117-4cd5-b076-2ca5ca847ea4) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/c9b0683e-e81d-410b-8c35-fbe54327fab4) After workflow finished, if you rerun a single job, the workflow status will become to `Running` which is not correct as no jobs are running in this workflow.
* Allow Organisations to have a E-Mail (#25082)JakobDev2023-07-2511-10/+48
| | | | | | | | | | | | | | | | | | | | Resolves #25057 This adds a E-Mail field to Organisations. The E-Mail is just shown on the Profile when it is visited by a logged in User. The E-mail is not used for something else. **Screenshots:** ![grafik](https://github.com/go-gitea/gitea/assets/15185051/a8d622b3-7278-4c08-984b-9c5ebfdb5471) ![grafik](https://github.com/go-gitea/gitea/assets/15185051/6dcb1dd7-d04b-49eb-bc96-6582cfe9757b) --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: Denys Konovalov <privat@denyskon.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* doc sync authentication.md to zh-cn (#26117)caicandong2023-07-251-1/+257
| | | as title
* Fix loading `LFS_JWT_SECRET` from wrong section (#26109)Jason Song2023-07-251-1/+1
| | | | | | | | | | | Regression of #25408. `LFS_JWT_SECRET_URI` and `LFS_JWT_SECRET` are under the `server` section, not `lfs`. So each time gitea restarts, it resets `LFS_JWT_SECRET`. <img width="1378" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/527ec9b9-eea2-4334-a274-6d1471456edd">
* Avoid writing config file if not installed (#26107)wxiaoguang2023-07-251-1/+1
| | | | Just like others (oauth2 secret, internal token, etc), do not generate if no install lock
* Implement auto-cancellation of concurrent jobs if the event is push (#25716)Bo-Yi Wu2023-07-256-19/+127
| | | | | | | | | | | | | | | | | | - cancel running jobs if the event is push - Add a new function `CancelRunningJobs` to cancel all running jobs of a run - Update `FindRunOptions` struct to include `Ref` field and update its condition in `toConds` function - Implement auto cancellation of running jobs in the same workflow in `notify` function related task: https://github.com/go-gitea/gitea/pull/22751/ --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Signed-off-by: appleboy <appleboy.tw@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: delvh <dev.lh@web.de>
* [skip ci] Updated translations via CrowdinGiteaBot2023-07-251-0/+43
|
* doc guide the user to create the appropriate level runner (#26091)caicandong2023-07-245-9/+17
| | | close #26045
* Fix handling of Debian files with trailing slash (#26087)KN4CK3R2023-07-244-50/+70
| | | | | | | Fixes #26022 - Fix handling of files with trailing slash - Fix handling of duplicate package file errors - Added test for both
* fix Missing 404 swagger response docs for /admin/users/{username} (#26086)caicandong2023-07-242-0/+5
| | | close #26079
* Allow the use of alternative net.Listener implementations by downstreams ↵idk2023-07-243-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25855) This is a simple PR which moves the `GetListener` function to a `DefaultGetListener` function, and changes `GetListener` to be a variable which by default points to the `DefaultGetListener` function. This allows people who may exist quasi-downstream of Gitea to create alternate "GetListener" functions, with identical signatures, which return different implementations of the `net.Listener` interface. This approach is expressly intended to be non-invasive and have the least possible impact on the gitea codebase. A previous version of this idea was rejected before: https://github.com/go-gitea/gitea/issues/15544 but because of issues like: https://github.com/go-gitea/gitea/issues/22335 I **really** think that recommending people configure proxies by hand is exactly the wrong way to do things(This is why there is a Tor Browser.). This tiny change lets me put proper hidden service configuration into single `i2p.go` file which lives in `modules/graceful/` and which never has to be checked in to your codebase or affect your dependencies or bloat your project in any way, it can live on a branch in my fork and I'll fast-forward every release and never the twain shall meet. The main use-case for this is to listen on Peer-to-Peer networks and Hidden Services directly without error-prone and cumbersome port-forwarding configuration. For instance, I might implement an "I2PGetListener" as follows: ```Go // adapted from i2p.go which is unchecked-in in my modules/graceful/ directory import "github.com/eyedeekay/onramp" var garlic = &onramp.Garlic{} func I2PGetListener(network, address string) (net.Listener, error) { // Add a deferral to say that we've tried to grab a listener defer GetManager().InformCleanup() switch network { case "tcp", "tcp4", "tcp6", "i2p", "i2pt": return garlic.Listen() case "unix", "unixpacket": // I2P isn't really a replacement for the stuff you use Unix sockets for and it's also not an anonymity risk, so treat them normally unixAddr, err := net.ResolveUnixAddr(network, address) if err != nil { return nil, err } return GetListenerUnix(network, unixAddr) default: return nil, net.UnknownNetworkError(network) } } ``` I could then substitute that GetListener function and be 50% of the way to having a fully-functioning gitea-over-hidden-services instance without any additional configuration(The other 50% doesn't require any code-changes on gitea's part). There are 2 advantages here, one being convenience, first this turns hidden services into a zero-configuration option for self-hosting gitea, and second safety, these Go libraries are passing around hidden-service-only versions of the net.Addr struct, they're using hidden-service-only versions of the sockets, which are both expressly designed to never require access to any information outside the hidden service network, manipulating the application so it reveals information about the host becomes much more difficult, and some attacks become nearly impossible. It also opens up TLS-over-Hidden Services support which is niche right now, of course, but in a future where gitea instances federate if hidden services want to be part of the federation they're probably going to need TLS certificates. They don't need to be painful to set up. This doesn't fix an open issue, but it might affect: - https://github.com/go-gitea/gitea/issues/22335 - my `i2p.go` file actually has a mod that fixes this but it requires adding a handful of new dependencies to gitea and isn't compatible with the normal way you guys recommend using a proxy so I don't think it's ready to send to you as a PR, but if I can find a non-invasive way to fix it I will. - https://github.com/go-gitea/gitea/issues/18240 I hereby agree to the Code of Conduct published here: https://github.com/go-gitea/gitea/blob/8b89563bf1031089a218e6d05dc61047281b35ee/CODE_OF_CONDUCT.md I have read and understood the recommendations published here: https://github.com/go-gitea/gitea/blob/8b89563bf1031089a218e6d05dc61047281b35ee/CONTRIBUTING.md Thank you for your consideration. --------- Co-authored-by: eyedeekay <idk@mulder> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add missing default value for some Bool cli flags (#26082)wxiaoguang2023-07-242-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #25959 I forgot to add default values to some Bool flags (which were BoolT in cli/v1, BoolT means default to be true) This PR adds the default "Value" for them. ``` ./cmd/manager_logging.go: }, cli.BoolTFlag{ ./cmd/manager_logging.go- Name: "rotate, r", ./cmd/manager_logging.go- Usage: "Rotate logs", -- ./cmd/manager_logging.go: }, cli.BoolTFlag{ ./cmd/manager_logging.go- Name: "daily, d", ./cmd/manager_logging.go- Usage: "Rotate logs daily", -- ./cmd/manager_logging.go: }, cli.BoolTFlag{ ./cmd/manager_logging.go- Name: "compress, z", ./cmd/manager_logging.go- Usage: "Compress rotated logs", -- ./cmd/admin.go: cli.BoolTFlag{ ./cmd/admin.go- Name: "force-smtps", ./cmd/admin.go- Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.", -- ./cmd/admin.go: cli.BoolTFlag{ ./cmd/admin.go- Name: "skip-verify", ./cmd/admin.go- Usage: "Skip TLS verify.", -- ./cmd/admin.go: cli.BoolTFlag{ ./cmd/admin.go- Name: "disable-helo", ./cmd/admin.go- Usage: "Disable SMTP helo.", -- ./cmd/admin.go: cli.BoolTFlag{ ./cmd/admin.go- Name: "skip-local-2fa", ./cmd/admin.go- Usage: "Skip 2FA to log on.", -- ./cmd/admin.go: cli.BoolTFlag{ ./cmd/admin.go- Name: "active", ./cmd/admin.go- Usage: "This Authentication Source is Activated.", ```
* Reduce unnecessary DB queries for Actions tasks (#25199)sillyguodong2023-07-247-9/+174
| | | | | | | | | | | | | | | | | | | | | | | Close #24544 Changes: - Create `action_tasks_version` table to store the latest version of each scope (global, org and repo). - When a job with the status of `waiting` is created, the tasks version of the scopes it belongs to will increase. - When the status of a job already in the database is updated to `waiting`, the tasks version of the scopes it belongs to will increase. - On Gitea side, in `FeatchTask()`, will try to query the `action_tasks_version` record of the scope of the runner that call `FetchTask()`. If the record does not exist, will insert a row. Then, Gitea will compare the version passed from runner to Gitea with the version in database, if inconsistent, try pick task. Gitea always returns the latest version from database to the runner. Related: - Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10 - Runner: https://gitea.com/gitea/act_runner/pulls/219
* Use stderr as fallback if the log file can't be opened (#26074)wxiaoguang2023-07-241-1/+6
| | | | | | | If the log file can't be opened, what should it do? panic/exit? ignore logs? fallback to stderr? It seems that "fallback to stderr" is slightly better than others ....
* Make organization redirect warning more clear (#26077)Panagiotis "Ivory" Vasilopoulos2023-07-241-2/+2
|
* Replace gogs/cron with go-co-op/gocron (#25977)Chongyi Zheng2023-07-246-22/+123
| | | | | | | | Replace `github.com/gogs/cron` with `github.com/go-co-op/gocron` as the former package is not maintained for many years. --------- Co-authored-by: delvh <dev.lh@web.de>
* Remove `db.DefaultContext` in `routers/` and `cmd/` (#26076)delvh2023-07-2311-128/+121
| | | | | | Now, the only remaining usages of `models.db.DefaultContext` are in - `modules` - `models` - `services`