summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [skip ci] Updated translations via CrowdinAaron F2022-09-052-0/+11
|
* Webhook for Wiki changes (#20219)Aaron F2022-09-0437-9/+618
| | | | | | | | | | | | | | | | | | | Add support for triggering webhook notifications on wiki changes. This PR contains frontend and backend for webhook notifications on wiki actions (create a new page, rename a page, edit a page and delete a page). The frontend got a new checkbox under the Custom Event -> Repository Events section. There is only one checkbox for create/edit/rename/delete actions, because it makes no sense to separate it and others like releases or packages follow the same schema. ![image](https://user-images.githubusercontent.com/121972/177018803-26851196-831f-4fde-9a4c-9e639b0e0d6b.png) The actions itself are separated, so that different notifications will be executed (with the "action" field). All the webhook receivers implement the new interface method (Wiki) and the corresponding tests. When implementing this, I encounter a little bug on editing a wiki page. Creating and editing a wiki page is technically the same action and will be handled by the ```updateWikiPage``` function. But the function need to know if it is a new wiki page or just a change. This distinction is done by the ```action``` parameter, but this will not be sent by the frontend (on form submit). This PR will fix this by adding the ```action``` parameter with the values ```_new``` or ```_edit```, which will be used by the ```updateWikiPage``` function. I've done integration tests with matrix and gitea (http). ![image](https://user-images.githubusercontent.com/121972/177018795-eb5cdc01-9ba3-483e-a6b7-ed0e313a71fb.png) Fix #16457 Signed-off-by: Aaron Fischer <mail@aaron-fischer.net>
* test: use `T.TempDir` to create temporary test directory (#21043)Eng Zer Jun2022-09-0424-194/+57
| | | | | | | | | | | | | | | | | | | | | | | | A testing cleanup. This pull request replaces `os.MkdirTemp` with `t.TempDir`. We can use the `T.TempDir` function from the `testing` package to create temporary directory. The directory created by `T.TempDir` is automatically removed when the test and all its subtests complete. This saves us at least 2 lines (error check, and cleanup) on every instance, or in some cases adds cleanup that we forgot. Reference: https://pkg.go.dev/testing#T.TempDir ```go func TestFoo(t *testing.T) { // before tmpDir, err := os.MkdirTemp("", "") require.NoError(t, err) defer os.RemoveAll(tmpDir) // now tmpDir := t.TempDir() } ``` Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* Set uploadpack.allowFilter etc on gitea serv to enable partial clones with ↵zeripath2022-09-041-6/+14
| | | | | | | | | | | | ssh (#20902) When setting.Git.DisablePartialClone is set to false then the web server will add filter support to web http. It does this by using`-c` command arguments but this will not work on gitea serv as the upload-pack and receive-pack commands do not support this. Instead we move these options into the .gitconfig instead. Fix #20400 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix 500 on time tracking in timeline API (#21052)qwerty2872022-09-041-0/+6
| | | Fix #21041
* Add more checks in migration code (#21011)zeripath2022-09-0424-281/+693
| | | | | | | | | | | | When migrating add several more important sanity checks: * SHAs must be SHAs * Refs must be valid Refs * URLs must be reasonable Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net>
* Fill the specified ref in webhook test payload (#20961)Jason Song2022-09-043-7/+17
| | | | | The webhook payload should use the right ref when it‘s specified in the testing request. The compare URL should not be empty, a URL like `compare/A...A` seems useless in most cases but is helpful when testing.
* [skip ci] Updated licenses and gitignoressilverwind2022-09-044-19/+1
|
* Add go licenses to licenses.txt (#21034)silverwind2022-09-046-7/+827
| | | | | | | `make go-licenses` will generate `assets/go-licenses.json` which is then included in the webpack build. This step depends on both go and node being present, so unfortunately, I could not automate the generation by hooking it up to `tidy` as that target is triggered on CI where we do not have a docker image with both go an node. It should be ran from time to time, ideally after each go mod update.
* Added docs for agit-setup (#21027)Cypherpunk Samurai2022-09-031-0/+47
| | | | | | | | | This PR Adds Documentation for the new Agit feature. Agit allows creating PR directly while pushing code. Close #21018 Co-authored-by: CypherpunkSamurai <CypherpunkSamurai@users.noreply.github.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: a1012112796 <1012112796@qq.com>
* Add another index for Action table on postgres (#21033)zeripath2022-09-032-3/+17
| | | | | | | | | | In #21031 we have discovered that on very big tables postgres will use a search involving the sort term in preference to the restrictive index. Therefore we add another index for postgres and update the original migration. Fix #21031 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Delete unreferenced packages when deleting a package version (#20977)KN4CK3R2022-09-032-2/+78
| | | | | Delete a package if its last version got deleted. Otherwise removing the owner works only after the clean up job ran. Fix #20969
* Improve arc-green code theme (#21039)silverwind2022-09-032-102/+105
| | | | | | | | | | | | | - Increase contrasts overall - Add various missing theme classes - Ensure strings and constants are colored the same across languages Before: <img width="575" alt="Screen Shot 2022-09-03 at 15 20 19" src="https://user-images.githubusercontent.com/115237/188272267-c3af3de0-a1d9-4a80-a3ab-278e9b04cb44.png"> <img width="705" alt="Screen Shot 2022-09-03 at 15 10 12" src="https://user-images.githubusercontent.com/115237/188272194-dc40ac7d-1629-44a0-a881-5f0922285195.png"> After: <img width="579" alt="Screen Shot 2022-09-03 at 15 19 31" src="https://user-images.githubusercontent.com/115237/188272275-55b87bc7-1122-410f-9250-14cf9e973124.png"> <img width="703" alt="image" src="https://user-images.githubusercontent.com/115237/188272715-a5fcd180-c5dc-4303-8e77-de785d5e0937.png">
* Add down key check has tribute container (#21016)Tyrone Yeh2022-09-031-0/+12
| | | | | | | | Fixes an issue where users would not be able to select by pressing the down arrow when using @TAG above a message Bug videos: https://user-images.githubusercontent.com/1255041/188095999-c4ccde18-e53b-4251-8a14-d90c4042d768.mp4
* Do not add links to Posters or Assignees with ID < 0 (#20577)zeripath2022-09-037-128/+76
| | | | | | | There are several places in templates/repo/issue/view_content/comments.tmpl where links are made to Posters or Assignees who are Ghosts or have IDs <0. Fix #20559 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinJakobDev2022-09-033-20/+57
|
* Show language name on hover (#20923)JakobDev2022-09-022-2/+2
| | | | Each repo has a bar which shows the used programming languages. If you want to know, what language is behind a color, you need to click the bar. With this PR, you just need to hover over the color the view the name.
* fix: PackageMetadataVersion deps (#21017)José Carlos2022-09-021-9/+12
| | | | | Set DevDependencies, PeerDependencies & OptionalDependencies in npm package metadatas Fix #21013
* Fix the quick-submit for pending review comment (#20992)wxiaoguang2022-09-021-0/+2
| | | | | | If there is only one "Add comment" button (when there are pending review comments), the quick-submit should submit the form with is_review=true even if the "Add comment" button is not really clicked. Close #20990
* Kd/ci playwright go test (#20123)Kyle D2022-09-02644-1027/+1857
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add initial playwright config * Simplify Makefile * Simplify Makefile * Use correct config files * Update playwright settings * Fix package-lock file * Don't use test logger for e2e tests * fix frontend lint * Allow passing TEST_LOGGER variable * Init postgres database * use standard gitea env variables * Update playwright * update drone * Move empty env var to commands * Cleanup * Move integrations to subfolder * tests integrations to tests integraton * Run e2e tests with go test * Fix linting * install CI deps * Add files to ESlint * Fix drone typo * Don't log to console in CI * Use go test http server * Add build step before tests * Move shared init function to common package * fix drone * Clean up tests * Fix linting * Better mocking for page + version string * Cleanup test generation * Remove dependency on gitea binary * Fix linting * add initial support for running specific tests * Add ACCEPT_VISUAL variable * don't require git-lfs * Add initial documentation * Review feedback * Add logged in session test * Attempt fixing drone race * Cleanup and bump version * Bump deps * Review feedback * simplify installation * Fix ci * Update install docs
* chore: add myself to maintainers (#21028)Jason Song2022-09-021-0/+1
|
* Support Issue forms and PR forms (#20987)Jason Song2022-09-0230-173/+1773
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: extend issue template for yaml * feat: support yaml template * feat: render form to markdown * feat: support yaml template for pr * chore: rename to Fields * feat: template unmarshal * feat: split template * feat: render to markdown * feat: use full name as template file name * chore: remove useless file * feat: use dropdown of fomantic ui * feat: update input style * docs: more comments * fix: render text without render * chore: fix lint error * fix: support use description as about in markdown * fix: add field class in form * chore: generate swagger * feat: validate template * feat: support is_nummber and regex * test: fix broken unit tests * fix: ignore empty body of md template * fix: make multiple easymde editors work in one page * feat: better UI * fix: js error in pr form * chore: generate swagger * feat: support regex validation * chore: generate swagger * fix: refresh each markdown editor * chore: give up required validation * fix: correct issue template candidates * fix: correct checkboxes style * chore: ignore .hugo_build.lock in docs * docs: separate out a new doc for merge templates * docs: introduce syntax of yaml template * feat: show a alert for invalid templates * test: add case for a valid template * fix: correct attributes of required checkbox * fix: add class not-under-easymde for dropzone * fix: use more back-quotes * chore: remove translation in zh-CN * fix EasyMDE statusbar margin * fix: remove repeated blocks * fix: reuse regex for quotes Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Include go.mod in gomod-check and rename to tidy-check (#21025)silverwind2022-09-021-4/+4
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via Crowdinzeripath2022-09-021-0/+4
|
* Update a few go dependencies (#21022)zeripath2022-09-013-443/+384
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a lot of go dependencies that appear old and we should update them. The following packages have been updated: * codeberg.org/gusted/mcaptcha * github.com/markbates/goth * github.com/buildkite/terminal-to-html * github.com/caddyserver/certmagic * github.com/denisenkom/go-mssqldb * github.com/duo-labs/webauthn * github.com/editorconfig/editorconfig-core-go/v2 * github.com/felixge/fgprof * github.com/gliderlabs/ssh * github.com/go-ap/activitypub * github.com/go-git/go-git/v5 * github.com/go-ldap/ldap/v3 * github.com/go-swagger/go-swagger * github.com/go-testfixtures/testfixtures/v3 * github.com/golang-jwt/jwt/v4 * github.com/klauspost/compress * github.com/lib/pq * gitea.com/lunny/dingtalk_webhook - instead of github.com * github.com/mattn/go-sqlite3 * github/matn/go-isatty * github.com/minio/minio-go/v7 * github.com/niklasfasching/go-org * github.com/prometheus/client_golang * github.com/stretchr/testify * github.com/unrolled/render * github.com/xanzy/go-gitlab * gopkg.in/ini.v1 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinLunny Xiao2022-09-011-0/+2
|
* Fix missed sort bug (#20996)Lunny Xiao2022-08-311-0/+2
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix typo (#21004)ya2022-08-311-2/+2
| | | | | Missing directory Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make sure fmt catches all templates (#20979)silverwind2022-08-3162-251/+251
| | | | | | | | * Make sure fmt catches all templates Make's `wildcard` is not recursive so it missed many template files, fix that by using `find`. * Update Makefile
* Remove black labels and CSS cleanup (#21003)silverwind2022-08-313-6/+2
| | | | Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Go 1.19 format (#20758)John Olheiser2022-08-3023-578/+626
| | | | | | | | | | | | | | | | | | | | | | | | * 1.19 gofumpt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change CSV test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Commit whitespace fixes from @zeripath Co-authored-by: zeripath <art27@cantab.net> * Update emoji Signed-off-by: jolheiser <john.olheiser@gmail.com> * bump swagger & fix generate-swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* [skip ci] Updated translations via CrowdinJonRB2022-08-311-0/+2
|
* Fix typo (#20993)JonRB2022-08-291-1/+1
|
* fix broken insecureskipverify handling in rediss connection uris (#20967)Igor Rzegocki2022-08-292-2/+20
| | | fixes regression #19213
* Redirect if user does not exist (#20981)KN4CK3R2022-08-291-1/+5
|
* fix hard-coded timeout and error panic in API archive download endpoint (#20925)Peter Gardfjäll2022-08-296-71/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix hard-coded timeout and error panic in API archive download endpoint This commit updates the `GET /api/v1/repos/{owner}/{repo}/archive/{archive}` endpoint which prior to this PR had a couple of issues. 1. The endpoint had a hard-coded 20s timeout for the archiver to complete after which a 500 (Internal Server Error) was returned to client. For a scripted API client there was no clear way of telling that the operation timed out and that it should retry. 2. Whenever the timeout _did occur_, the code used to panic. This was caused by the API endpoint "delegating" to the same call path as the web, which uses a slightly different way of reporting errors (HTML rather than JSON for example). More specifically, `api/v1/repo/file.go#GetArchive` just called through to `web/repo/repo.go#Download`, which expects the `Context` to have a `Render` field set, but which is `nil` for API calls. Hence, a `nil` pointer error. The code addresses (1) by dropping the hard-coded timeout. Instead, any timeout/cancelation on the incoming `Context` is used. The code addresses (2) by updating the API endpoint to use a separate call path for the API-triggered archive download. This avoids producing HTML-errors on errors (it now produces JSON errors). Signed-off-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com>
* Add support for Vagrant packages (#20930)KN4CK3R2022-08-2919-2/+757
| | | | | | | | | | | | | | | | | | * Add support for Vagrant boxes. * Add authentication. * Add tests. * Add integration tests. * Add docs. * Add icons. * Update routers/api/packages/api.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinJonRB2022-08-292-7/+40
|
* Add instructions how to add service dependencies (#20968)JonRB2022-08-281-0/+10
|
* Share HTML template renderers and create a watcher framework (#20218)zeripath2022-08-2843-615/+899
| | | | | | | | | | | | | | | | | | | | | | | | | The recovery, API, Web and package frameworks all create their own HTML Renderers. This increases the memory requirements of Gitea unnecessarily with duplicate templates being kept in memory. Further the reloading framework in dev mode for these involves locking and recompiling all of the templates on each load. This will potentially hide concurrency issues and it is inefficient. This PR stores the templates renderer in the context and stores this context in the NormalRoutes, it then creates a fsnotify.Watcher framework to watch files. The watching framework is then extended to the mailer templates which were previously not being reloaded in dev. Then the locales are simplified to a similar structure. Fix #20210 Fix #20211 Fix #20217 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated licenses and gitignoressilverwind2022-08-281-1/+1
|
* [skip ci] Updated translations via Crowdinsilverwind2022-08-2728-0/+30
|
* Change review buttons to icons to make space for text (#20934)silverwind2022-08-2611-9/+20
| | | | | The layout on the review code view was broken depending on length of the text. Change all three buttons to icons with tooltip to make more space for these long texts. Fixes: #20922
* Fix download archiver of a commit (#20962)Lunny Xiao2022-08-262-3/+4
|
* Add whitespace removal inside template curly brackes (#20853)silverwind2022-08-2530-102/+110
|
* Only show relevant repositories on explore page (#19361)Gusted2022-08-258-8/+65
| | | | | | | Adds a new option to only show relevant repo's on the explore page, for bigger Gitea instances like Codeberg this is a nice option to enable to make the explore page more populated with unique and "high" quality repo's. A note is shown that the results are filtered and have the possibility to see the unfiltered results. Co-authored-by: vednoc <vednoc@protonmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: 6543 <6543@obermui.de>
* Replace `ServeStream` with `ServeContent` (#20903)KN4CK3R2022-08-2517-41/+31
| | | | | | | | | | | * Replace ServeStream with ServeContent. * Update modules/timeutil/timestamp.go Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update JS dependencies (#20950)silverwind2022-08-252-3773/+1405
| | | | | - Update all JS dependencies minus vue - Tested easymde, monaco, swagger
* chore: remove broken gitea-format-imports (#20952)Jason Song2022-08-251-26/+0
|
* Fix input.value attr for RequiredClaimName/Value (#20946)soumyadey2022-08-251-2/+2
| | | | | | Values set for RequiredClaimName and RequiredClaimValue do not show up on UI. Fix typo `values` to `value`.