aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fix webpackChunkName for citation-js-csl (#21806)silverwind2022-11-131-1/+1
|
* Add plural definitions for German translations (#21802)delvh2022-11-131-4/+4
| | | | Previously, there were discussions on how to write certain plurals. So, we explicitly document the special plurals to end the discussion.
* Fix webhook attachment text is not set in review comment (#21763)Jim Kirisame2022-11-131-5/+4
| | | | | | | | | | | | The `getPullRequestPayloadInfo` function is widely used in many webhook, it works well when PR is open or edit. But when we comment in PR review panel (not PR panel), the comment content is not set as `attachmentText`. This commit set comment content as `attachmentText` when PR review, so webhook could obtain this information via this function. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Render number of commits in repo page in a user friendly way (#21786)Yarden Shoham2022-11-131-1/+1
| | | | | | | | | | | | | | | | Use `JsPrettyNumber` to render the number of commits * Closes #12637 ### Before ![1094](https://user-images.githubusercontent.com/20454870/201484428-eaa80d27-eeed-444e-9dc5-ae046424de2f.png) ### After ![1,094](https://user-images.githubusercontent.com/20454870/201484385-b5bdc290-86fd-493b-a87c-c987012b18ad.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Upgrade golang.org/x/crypto (#21792)Gusted2022-11-122-13/+13
| | | | | | | | | - Update the crypto dependency to include https://github.com/golang/crypto/commit/6fad3dfc18918c2ac9c112e46b32473bd2e5e2f9 - Resolves #17798 Executed: `go get golang.org/x/crypto@6fad3dfc18918c2ac9c112e46b32473bd2e5e2f9 && rm go.sum && go mod tidy`
* Allow detect whether it's in a database transaction for a context.Context ↵Lunny Xiao2022-11-1291-176/+252
| | | | | | | | | | | | | | | | (#21756) Fix #19513 This PR introduce a new db method `InTransaction(context.Context)`, and also builtin check on `db.TxContext` and `db.WithTx`. There is also a new method `db.AutoTx` has been introduced but could be used by other PRs. `WithTx` will always open a new transaction, if a transaction exist in context, return an error. `AutoTx` will try to open a new transaction if no transaction exist in context. That means it will always enter a transaction if there is no error. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: 6543 <6543@obermui.de>
* Add some documentation to packages (#21648)zeripath2022-11-123-2/+14
| | | | | | | | | | In #21637 it was mentioned that the purpose of the API routes for the packages is unclear. This PR adds some documentation. Fix #21637 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Adjust clone timeout error to suggest increasing timeout (#21769)zeripath2022-11-121-0/+4
| | | | | | | | | There are far too many error reports regarding timeouts from migrations. We should adjust error report to suggest increasing this timeout. Ref #20680 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Simplify text color selectors and tweak arc-green colors (#21784)silverwind2022-11-122-87/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the text color rules out of the unneeded `.ui` block, add missing colors, tweak colors on arc-green to be more readable (red was particulary bad to read). Also, this removes the previous inheritance of link colors. I think links should always be in primary color and if they are to be discolored, the color should be set on them explicitely. <img width="165" alt="Screenshot 2022-11-12 at 13 28 30" src="https://user-images.githubusercontent.com/115237/201474098-700d9fed-3133-43c7-b57e-d4cc5c2795cb.png"> <img width="152" alt="Screenshot 2022-11-12 at 13 18 48" src="https://user-images.githubusercontent.com/115237/201474156-b6de4cb5-bce8-4553-b3d4-8365aff9a3a7.png"> HTML to test with: ```html <div class="text red">some text with <a href="#foo">a link</a>.</div> <div class="text orange">some text with <a href="#foo">a link</a>.</div> <div class="text yellow">some text with <a href="#foo">a link</a>.</div> <div class="text olive">some text with <a href="#foo">a link</a>.</div> <div class="text green">some text with <a href="#foo">a link</a>.</div> <div class="text teal">some text with <a href="#foo">a link</a>.</div> <div class="text blue">some text with <a href="#foo">a link</a>.</div> <div class="text violet">some text with <a href="#foo">a link</a>.</div> <div class="text purple">some text with <a href="#foo">a link</a>.</div> <div class="text pink">some text with <a href="#foo">a link</a>.</div> <div class="text brown">some text with <a href="#foo">a link</a>.</div> <div class="text grey">some text with <a href="#foo">a link</a>.</div>
* Load GitRepo in API before deleting issue (#21720)Jason Song2022-11-121-1/+1
| | | | | | | | | Fix #20921. The `ctx.Repo.GitRepo` has been used in deleting issues when the issue is a PR. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Copy citation file content, in APA and BibTex format, on repo home page (#19999)Nolann2022-11-1110-21/+474
| | | Add feature to easily copy CITATION.cff content in APA and BibTex format.
* Ignore line anchor links with leading zeroes (#21728)silverwind2022-11-112-15/+39
| | | | | Fixes: https://github.com/go-gitea/gitea/issues/21722 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update message of reach_limit_of_creation (#21757)Jason Song2022-11-111-2/+2
| | | | | | | | | | | | | When I'm trying to use a user which has no repo numbers limit to create a repo for a org which has reached the limit, it says "You have already reached your limit of 5 repositories." That's confusing. "I" haven't reached the limit, the owner has. <img width="828" alt="xnip_2022-11-10_11-57-45" src="https://user-images.githubusercontent.com/9418365/200997290-d0819e40-fb10-4c37-917c-167e2070b4f9.png"> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add configuration for CORS allowed headers (#21747)Drew Noel2022-11-115-1/+8
| | | | | | | | | | This PR enhances the CORS middleware usage by allowing for the headers to be configured in `app.ini`. Fixes #21746 Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Revert unrelated changes for SMTP auth (#21767)wxiaoguang2022-11-106-11/+11
| | | | | | | The purpose of #18982 is to improve the SMTP mailer, but there were some unrelated changes made to the SMTP auth in https://github.com/go-gitea/gitea/pull/18982/commits/d60c43869420f5fc43ad19b454c9ae50dad65964 This PR reverts these unrelated changes, fix #21744
* Init git module before database migration (#21764)wxiaoguang2022-11-101-0/+9
| | | | | | Close #21761 Some database migrations depend on the git module.
* Extract updateSession function to reduce repetition (#21735)Jason Song2022-11-104-135/+80
| | | | | | | A simple refactor to reduce duplicate codes. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
* Fix dashboard ignored system setting cache (#21621)Lunny Xiao2022-11-1012-151/+172
| | | | | | This is a performance regression from #18058 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Add .dockerignore (#21753)Jason Song2022-11-101-0/+114
| | | | | | | | | | | | There's a lot of work that has been done on `.dockerignore`: - #329 - #2927 - #8338 And finally, it has been deleted by #2927. This is a copy of the `.gitignore`. Creating a soft link is more elegant, but it may cause trouble to the Windows users.
* Attempt clarify AppWorkPath etc. (#21656)zeripath2022-11-095-54/+126
| | | | | | | | | | Attempt clarify the AppWorkPath in the documentation by using different notation and adding a section to the start of the cheat sheet. Fix #21523 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set last login when activating account (#21731)Jason Song2022-11-091-0/+7
| | | | | | | | Fix #21698. Set the last login time to the current time when activating the user successfully. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734)Xinyu Zhou2022-11-092-3/+4
| | | | | | | | | | | | fixes: https://github.com/go-gitea/gitea/issues/21733 Uncaught Error: Language id "vs.editor.nullLanguage" is not configured nor known Note that this monaco-editor worked fine on 0.33.0 and broke on 0.34.0. If upstream fixed, remove this code. Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix UI language switching bug (#21597)wxiaoguang2022-11-091-1/+1
| | | | | | | | | | | | | | Related: * https://github.com/go-gitea/gitea/pull/21596#issuecomment-1291450224 There was a bug when switching language by AJAX: the irrelevant POST requests were processed by the target page's handler. Now, use GET instead of POST. The GET requests should be harmless. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add package registry quota limits (#21584)KN4CK3R2022-11-0920-61/+378
| | | | | | | | | | Related #20471 This PR adds global quota limits for the package registry. Settings for individual users/orgs can be added in a seperate PR using the settings table. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add attention blocks within quote blocks for `Note` and `Warning` (#21711)Yarden Shoham2022-11-094-0/+92
| | | | | | | | | | | | | | | | | | For each quote block, the first `**Note**` or `**Warning**` gets an icon prepended to it and its text is colored accordingly. GitHub does this (community/community#16925). [Initially requested on Discord.](https://discord.com/channels/322538954119184384/322538954119184384/1038816475638661181) ### Before ![image](https://user-images.githubusercontent.com/20454870/200408558-bd318302-6ff9-4d56-996f-9190e89013ec.png) ### After ![image](https://user-images.githubusercontent.com/20454870/200658863-1bac6461-dae7-4bf2-abd2-672d209574e4.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: silverwind <me@silverwind.io>
* Move svg html render to modules/svg (#21716)Lunny Xiao2022-11-083-49/+77
| | | | | Also added more checks for the render function. Co-authored-by: silverwind <me@silverwind.io>
* Fix tests on migrations (#21705)Lunny Xiao2022-11-082-1/+16
|
* Remove semver compatible flag and change pypi to an array of test cases (#21708)Wayne Starr2022-11-083-7/+50
| | | | | | | | This addresses #21707 and adds a second package test case for a non-semver compatible version (this might be overkill though since you could also edit the old package version to have an epoch in front and see the error, this just seemed more flexible for the future). Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Allow local package identifiers for PyPI packages (#21690)KN4CK3R2022-11-072-4/+11
| | | | | Fixes #21683 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix typo (#21695)Xinyu Zhou2022-11-072-2/+2
| | | | | | Duplicate parentheses written in link. Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove template previewer (#21701)Gusted2022-11-062-34/+0
| | | | | - Remove "unused" code, I don't think anyone ever used this or was aware of this feature. It doesn't even work properly as most fields/data are empty.
* Revert "[skip ci] Updated translations via Crowdin" (#21689)Lunny Xiao2022-11-0649-99330/+46501
| | | This reverts commit cb4473692f2f9fd24a175691bae98be64abe4816.
* [skip ci] Updated translations via CrowdinXinyu Zhou2022-11-0549-46501/+99330
|
* Fix docs relref (#21685)Xinyu Zhou2022-11-042-2/+2
| | | | reslove https://github.com/go-gitea/gitea/issues/21627#issuecomment-1303678781
* Add "Copy" button to file view of raw text (#21629)Yarden Shoham2022-11-043-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | If a raw text file is displayed, a copy button of the text is enabled. * Closes #12866 ### Before ![image](https://user-images.githubusercontent.com/20454870/198898628-df1bcb0c-79d7-4ffb-95e4-441d77430827.png) ### After ![image](https://user-images.githubusercontent.com/20454870/199988152-ea1099ad-29e1-4765-a9ca-4c03c1737453.png) #### Rendered files and binaries have their button disabled ![image](https://user-images.githubusercontent.com/20454870/199988408-73de6327-5e9e-462b-b2b6-8c3f5b878386.png) ![image](https://user-images.githubusercontent.com/20454870/199988563-844f8656-f48d-4929-880e-b6558c1c054a.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve valid user name check (#20136)wxiaoguang2022-11-0412-14/+95
| | | | | | | | | | | | | Close https://github.com/go-gitea/gitea/issues/21640 Before: Gitea can create users like ".xxx" or "x..y", which is not ideal, it's already a consensus that dot filenames have special meanings, and `a..b` is a confusing name when doing cross repo compare. After: stricter Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Remove Gusted as Gitea maintainer (#21676)Gusted2022-11-031-1/+0
|
* Fix token generation when using INTERNAL_TOKEN_URI (#21669)wxiaoguang2022-11-032-6/+20
| | | | | | | | | | | Fix https://github.com/go-gitea/gitea/issues/21666 Caused by https://github.com/go-gitea/gitea/pull/19663 Before: when install, the INTERNAL_TOKEN was always generated and saved. But the internal token may be already there by INTERNAL_TOKEN_URI After: INTERNAL_TOKEN_URI file must be non-empty. When install, skip internal token generation if the token exists.
* Clean up formatting on install page (#21668)zeripath2022-11-032-31/+52
| | | | | | | | | | | | | | | | | | | | | The install page has been somewhat inconsistently styled for a while. This PR simplifies and standardises the styling of these fields makes things line up better across widths. Replace #21660 Signed-off-by: Andrew Thornton <art27@cantab.net> Old: ![Screenshot from 2022-11-02 23-07-05](https://user-images.githubusercontent.com/1824502/199619007-4a6b66c5-e19c-4d29-b71b-9aa73f2789ca.png) New: ![Screenshot from 2022-11-02 23-04-28](https://user-images.githubusercontent.com/1824502/199618779-370f88e7-b590-4abd-afb9-b66cc3194a5d.png) Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add Webhook authorization header (#20926)oliverpool2022-11-0325-263/+671
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _This is a different approach to #20267, I took the liberty of adapting some parts, see below_ ## Context In some cases, a weebhook endpoint requires some kind of authentication. The usual way is by sending a static `Authorization` header, with a given token. For instance: - Matrix expects a `Bearer <token>` (already implemented, by storing the header cleartext in the metadata - which is buggy on retry #19872) - TeamCity #18667 - Gitea instances #20267 - SourceHut https://man.sr.ht/graphql.md#authentication-strategies (this is my actual personal need :) ## Proposed solution Add a dedicated encrypt column to the webhook table (instead of storing it as meta as proposed in #20267), so that it gets available for all present and future hook types (especially the custom ones #19307). This would also solve the buggy matrix retry #19872. As a first step, I would recommend focusing on the backend logic and improve the frontend at a later stage. For now the UI is a simple `Authorization` field (which could be later customized with `Bearer` and `Basic` switches): ![2022-08-23-142911](https://user-images.githubusercontent.com/3864879/186162483-5b721504-eef5-4932-812e-eb96a68494cc.png) The header name is hard-coded, since I couldn't fine any usecase justifying otherwise. ## Questions - What do you think of this approach? @justusbunsi @Gusted @silverwind - ~~How are the migrations generated? Do I have to manually create a new file, or is there a command for that?~~ - ~~I started adding it to the API: should I complete it or should I drop it? (I don't know how much the API is actually used)~~ ## Done as well: - add a migration for the existing matrix webhooks and remove the `Authorization` logic there _Closes #19872_ Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: delvh <dev.lh@web.de>
* feat: notify doers of a merge when automerging (#21553)kolaente2022-11-0318-27/+87
| | | | | | | | | | | | | | | | | | | | | | I found myself wondering whether a PR I scheduled for automerge was actually merged. It was, but I didn't receive a mail notification for it - that makes sense considering I am the doer and usually don't want to receive such notifications. But ideally I want to receive a notification when a PR was merged because I scheduled it for automerge. This PR implements exactly that. The implementation works, but I wonder if there's a way to avoid passing the "This PR was automerged" state down so much. I tried solving this via the database (checking if there's an automerge scheduled for this PR when sending the notification) but that did not work reliably, probably because sending the notification happens async and the entry might have already been deleted. My implementation might be the most straightforward but maybe not the most elegant. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove deprecated DSA host key from Docker Container (#21522)Xinyu Zhou2022-11-032-12/+0
| | | | | | | | | | | | | | | Since OpenSSH 7.0 and greater similarly disable the ssh-dss (DSA) public key algorithm, and recommend against its use. http://www.openssh.com/legacy.html ## :warning: BREAKING :warning: This patch will remove DSA host key form OpenSSH daemon configuration file. Signed-off-by: baronbunny <its@baronbunny.cn> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Alter package_version.metadata_json to LONGTEXT (#21667)KN4CK3R2022-11-033-1/+29
|
* Handle branch name with prefix in GitHub migration (#20357)Chongyi Zheng2022-11-031-1/+6
| | | | | | | | | GitHub allows releases with target commitish `refs/heads/BRANCH`, which then causes issues in Gitea after migration. This fix handles cases that a branch already has a prefix. Fixes #20317 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinLunny Xiao2022-11-033-0/+19
|
* Split migrations folder (#21549)Lunny Xiao2022-11-02190-1481/+1711
| | | | There are too many files in `models/migrations` folder so that I split them into sub folders.
* [skip ci] Updated translations via CrowdinGusted2022-11-021-1/+1
|
* Configure update checker on installation page (#21655)Gusted2022-11-014-0/+11
| | | | | | | | | - I recently became aware that this was enabled by-default, I don't necessary agree with that and this should rather be configured by the user(this patch does that on the installation page) as it connects to a homeserver, which I'd prefer to avoid on my instance. ![image](https://user-images.githubusercontent.com/25481501/199260613-a77a1b10-347a-4542-8982-9b9b24dad28c.png)
* Fix repository adoption on Windows (#21646)zeripath2022-10-312-9/+10
| | | | | | | | | | | | A bug was introduced in #17865 where filepath.Join is used to join putative unadopted repository owner and names together. This is incorrect as these names are then used as repository names - which shoud have the '/' separator. This means that adoption will not work on Windows servers. Fix #21632 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor docs (#21627)Xinyu Zhou2022-10-3116-175/+7
| | | | | | | | | | | | | | This patch: - Rename some files( `.md` to `.en-us.md`), fix missed translation copy - Update link which shoud be refer to `../hacking-on-gitea/` instead of `../make/` (outdated) - Update `_redirects`: - redirect `/{zh-cn|fr-fr}/make/` to `../hacking-on-gitea/` - redirect `/zh-cn/third-party-tools/` to `/zh-cn/integrations/` - Delete duplicated/outdated files. - Update menu `weight` of developers.zh-cn.md Signed-off-by: Xinyu Zhou <i@sourcehut.net>