summaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Add Access-Control-Expose-Headers (#12446)zeripath2020-08-1312-0/+16
| | | | | | Fix #12424 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Fix ignored login on compare (#12476)Lunny Xiao2020-08-121-1/+1
|
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-116-8/+59
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Render the git graph on the server (#12333)zeripath2020-08-061-2/+9
| | | | | | | | | | | | | Rendering the git graph on the server means that we can properly track flows and switch from the Canvas implementation to a SVG implementation. * This implementation provides a 16 limited color selection * The uniqued color numbers are also provided * And there is also a monochrome version *In addition is a hover highlight that allows users to highlight commits on the same flow. Closes #12209 Signed-off-by: Andrew Thornton art27@cantab.net Co-authored-by: silverwind <me@silverwind.io>
* UserProfile Page: Render Description (#12415)65432020-08-051-0/+5
| | | | | | | | | | | | | * If Description contain more that one line render it * simpler ... * only render if description exists * Fix NPE in tests * Update routers/user/profile.go Co-authored-by: zeripath <art27@cantab.net>
* Prevent empty div when editing comment (#12404)zeripath2020-08-041-3/+3
| | | | | | | | * Prevent empty div when editing comment The template for attachments needs to remove whitespace and return empty when there are no attachments. Fix #10220
* Add API to update pr headBranch (#12419)赵智超2020-08-043-1/+98
| | | | | * [API] Add update pr headBranch api Signed-off-by: a1012112796 <1012112796@qq.com>
* fix a small nit (#12420)赵智超2020-08-031-0/+1
| | | Signed-off-by: a1012112796 <1012112796@qq.com>
* Add TOTP header to Swagger Documentation (#12402)65432020-08-021-0/+6
|
* Don't use legacy method to send Matrix Webhook (#12348)S7evinK2020-07-301-0/+1
| | | | | | | | | | | | | | | | | * Don't use legacy send for messages * Add migrations to ensure Matrix webhooks use PUT * Set HTTP method to PUT as default * Fix sql condition.. Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Rename getTxnID -> getMatrixTxnID * Use local variable instead of constant value Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add action feed for new release (#12324)赵智超2020-07-292-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add action feed for new release Signed-off-by: a1012112796 <1012112796@qq.com> * fix lint * Apply suggestions from code review * Add ReleaseID to the action table * Remove error message * Fold the attachments download list * remove attchment download list * simplify code * fix create release from existing tag * simplify ui * translation change * fix test Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move jquery-minicolors to npm/webpack (#12305)silverwind2020-07-292-2/+0
| | | | | | | | | | | | | | | | | | | | * Move jquery-minicolors to npm/webpack - Unvendor and add as npm dependency - Removed unneeded backend variable - Fixed existing bug where picker would previously initizalize to the same green color when editing a label. There was probably a version bump because the previous version was over 3 years old but it seems to be compatible. * use file-loader * trailing comma and comment update * misc tweaks Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Git 2.28 no longer permits diff with ... on unrelated branches (#12364)zeripath2020-07-291-0/+2
| | | | | | | * Git 2.28 no longer permits diff with ... on unrelated branches Signed-off-by: Andrew Thornton <art27@cantab.net> * need to check stderr
* Add name filter to API for GetMilestoneList (#12336)65432020-07-283-7/+37
| | | | | | | | | Adds a name filter to the API for GetMilestoneList Includes a small refactor: merge GetMilestones and GetMilestonesByRepoID Close #12260 Needed for https://gitea.com/gitea/go-sdk/issues/383 and https://gitea.com/gitea/tea/pulls/149
* Show 404 page when release not found (#12328)赵智超2020-07-261-0/+4
| | | | | Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* models: fix xorm variable clobber (#12231)Lars Lehtonen2020-07-131-3/+1
| | | | | NewTestEngine() takes a *xorm.Engine as its argument, and then immediately overwrites it. This fixes the model package to not take an unneeded variable, and changes the routers package to not create a nil *xorm.Engine that is immediately discarded by model.
* Syntax highlight expanded code blobs (#12223)mrsdizzie2020-07-121-1/+2
| | | | | Expanded code in diffs wasn't being highlighted properly because it wasn't passing the filename to highlighting code. Fixes #12218
* Direct SVG rendering (#12157)silverwind2020-07-121-0/+3
| | | | | | | | | | | | Introduce 'make svg' which calls a node script that compiles svg files to `public/img/svg`. These files are vendored to not create a dependency on Node for the backend build. On the frontend side, configure webpack using `raw-loader` so SVGs can be imported as string. Also moved our existing SVGs to web_src/svg for consistency. Fixes: https://github.com/go-gitea/gitea/issues/11618
* Extend Notifications API and return pinned notifications by default (#12164)zeripath2020-07-123-14/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extend notifications API and return pinned notifications in notifications list Signed-off-by: Andrew Thornton <art27@cantab.net> * fix swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix swagger again Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * remove spurious debugs * as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update models/notification.go * as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Default to showing closed Issues/PR list when there are only closed ↵65432020-07-091-1/+7
| | | | | issues/PRs (#12200) If all issues are closed, then set the default to show the closed issues.
* Fix regression: Gitea commits API again returns commit summaries, not full ↵Kristian Antonsen2020-07-081-1/+1
| | | | | messages (#12186) Closes #12185
* Enable cloning via Git Wire Protocol v2 over HTTP (#12170)William Hilton2020-07-081-4/+15
| | | | | | | * Enable Git Wire Protocol v2 over HTTP * use RunInDirTimeoutEnv * pass $HOME environment variable to git upload-pack
* Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777)zeripath2020-07-053-3/+122
| | | | | | | | | | | | | | | | | | | | | | * Make LogDescriptions race safe * Add manager commands for pausing, resuming, adding and removing loggers Signed-off-by: Andrew Thornton <art27@cantab.net> * Placate lint * Ensure that file logger is run! * Add support for smtp and conn Signed-off-by: Andrew Thornton <art27@cantab.net> * Add release-and-reopen Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Multiple small admin dashboard fixes (#12153)zeripath2020-07-051-3/+6
| | | | | | | | | * Remove spurious spacing between Maintenance Operations and its table on dashboard * Prevent (EXTRA string) comments in Task headers * Redirect tasks started from monitor page back to monitor * Fix #12107 - redirects from process cancel should use AppSubUrl * When wrapping queues set the name correctly Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove spurious logging (#12139)zeripath2020-07-051-3/+0
| | | | | | | Unfortunately #10745 merged a spurious logging message. This PR removes this. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix repo API listing stability (#12057)Clark Boylan2020-07-021-0/+1
| | | | | | | | | | | | | | Repo listings are paginated in the API now. Unfortunately, they are ORDER BY updated_unix which only has second resolution. This means that if you do a listing when multiple projects were created at the same time you can unstable ordering. If that unstable ordering happens at a page boundary you may fail to get a complete repo listing. To make things worse sorting by updated_unix means that we may never get a complete listing because udpated_unix can change independent of our API calls. Fix this by making the API repo listing order by id instead.
* Provide option to unlink a fork (#11858)zeripath2020-07-021-2/+39
| | | | | | | | | | | | | | | | | | | | | | * Provide option to unlink a fork Fix #4566 Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: techknowlogick <matti@mdranta.net> * Add check that user can create repo Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @cirnoT Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net>
* Ensure BlameReaders close at end of request (#12102)zeripath2020-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | #11716 reports multiple git blame processes hanging around this was thought to be due to timeouts, however on closer look this appears to be due to the Close() function of the BlameReader hanging with a blocked stdout pipe. This PR fixes this Close function to: * Cancel the context of the cmd * Close the StdoutReader - ensuring that the output pipe is closed Further it makes the context of the `git blame` command a child of the request context - ensuring that even if Close() is not called, on cancellation of the Request the blame is command will also be cancelled. Fixes #11716 Closes #11727 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Server-side syntax highlighting for all code (#12047)mrsdizzie2020-07-013-50/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Server-side syntax hilighting for all code This PR does a few things: * Remove all traces of highlight.js * Use chroma library to provide fast syntax hilighting directly on the server * Provide syntax hilighting for diffs * Re-style both unified and split diffs views * Add custom syntax hilighting styling for both regular and arc-green Fixes #7729 Fixes #10157 Fixes #11825 Fixes #7728 Fixes #3872 Fixes #3682 And perhaps gets closer to #9553 * fix line marker * fix repo search * Fix single line select * properly load settings * npm uninstall highlight.js * review suggestion * code review * forgot to call function * fix test * Apply suggestions from code review suggestions from @silverwind thanks Co-authored-by: silverwind <me@silverwind.io> * code review * copy/paste error * Use const for highlight size limit * Update web_src/less/_repository.less Co-authored-by: Lauris BH <lauris@nix.lv> * update size limit to 1MB and other styling tweaks * fix highlighting for certain diff sections * fix test * add worker back as suggested Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Do not override API issue pagination with UI settings (#12068)Cirno the Strongest2020-06-271-3/+0
| | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix swagger docs for /repos/issues (#12069)Cirno the Strongest2020-06-271-0/+2
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Show description on individual milestone view (#12055)mrsdizzie2020-06-251-0/+2
| | | | | Fixes #12043 Co-authored-by: Lauris BH <lauris@nix.lv>
* API: Move AllowedReactions endpoint into GetGenneralUI endpoint + creat new ↵65432020-06-224-17/+34
| | | | | | | | | | | | | swagger section settings (#11854) * move Setting function into its own package * swagger add&use new section "settings" * move api AllowedReactions into general UI-Settings endpoint * prepare TEST * lint
* Add pagination headers on endpoints that support total count from database ↵Cirno the Strongest2020-06-219-14/+51
| | | | | | | | | | | | | (#11145) * begin work * import fmt * more work * empty commit Co-authored-by: Lauris BH <lauris@nix.lv>
* Global default branch setting (#11918)techknowlogick2020-06-171-0/+1
| | | | | | | | | * Global default branch setting * add to app.ini example per @silverwind * update per @lunny Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Rework blame template and styling (#11885)Cirno the Strongest2020-06-151-22/+8
| | | | | | | * Rework blame template and styling * cleanup template and add missing NumLines Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Rework api/user/repos for pagination (#11827)Cirno the Strongest2020-06-131-21/+33
| | | | | | | | | | | | | | * Add count to `GetUserRepositories` so that pagination can be supported for `/user/{username}/repos` * Rework ListMyRepos to use models.SearchRepository ListMyRepos was an odd one. It first fetched all user repositories and then tried to supplement them with accessible map. The end result was that: * Limit for pagination did not work because accessible repos would always be appended * The amount of pages was incorrect if one were to calculate it * When paginating, all accessible repos would be shown on every page Hopefully it should now work properly. Fixes #11800 and does not require any change on Drone-side as it can properly interpret and act on Link header which we now set. Co-authored-by: Lauris BH <lauris@nix.lv>
* Handle more pathological branch and tag names (#11843)zeripath2020-06-113-10/+24
| | | | | | | | | | | * Handle more pathological branch and tag names Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix failing test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Show exact tag for commit on diff view (#11846)Cirno the Strongest2020-06-111-0/+6
| | | | | | | * Show exact tag for commit on diff view * Fix comment Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Replace jquery-datetimepicker with native date input (#11684)silverwind2020-06-101-4/+0
| | | | | | | | | | | | This removes the jQuery plugin as well as the associated config options. Native input[type=date] does not require a language attribute as it is localized by default, except for the placeholder attribute for which I currently piggy-back the repo.issues.due_date_form localization option. Implementation should pretty much match GH. Of note is that Safari does not provide a UI for this input type, but I don't think providing one is neccessary and GH did not bother either. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* fix a small nit (#11834)赵智超2020-06-101-1/+2
| | | | | As title, run this line in one time is enough. Signed-off-by: a1012112796 <1012112796@qq.com>
* API expose usefull General Repo settings settings (#11758)65432020-06-103-0/+25
| | | | | | | | | | | * GeneralRepoSettings expose MirrorsDisabled, HTTPGitDisabled, MaxCreationLimit * Apply suggestions from code review Co-authored-by: proton <25139420+proton-ab@users.noreply.github.com> * lint Co-authored-by: proton <25139420+proton-ab@users.noreply.github.com>
* API allow to create closed milestones (#11745)65432020-06-091-0/+5
| | | | | | | | * API allow to create closed milestones * set CloseDate too Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove page size limit comment from swagger (#11806)Cirno the Strongest2020-06-0939-61/+61
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Honor DEFAULT_PAGING_NUM for API (#11805)Cirno the Strongest2020-06-082-13/+0
| | | | | | | | | | * Honor DEFAULT_PAGING_NUM for API * set pagination to 10 for tests * lint Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Ensure rejected push to refs/pull/index/head fails nicely (#11724)zeripath2020-06-081-5/+27
| | | | | | | | | | A pre-receive hook that rejects pushes to refs/pull/index/head will cause a broken PR which causes an internal server error whenever it is viewed. This PR handles prevents the internal server error by handling non-existent pr heads and sends a flash error informing the creator there was a problem. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add option to API to update PullRequest base branch (#11666)65432020-06-071-0/+26
| | | | | * EditPull: add option to change base Close #11552
* In File Create/Update API return 404 if Branch does not exist (#11791)65432020-06-071-0/+4
|
* Fix doer of rename repo (#11789)赵智超2020-06-071-1/+1
| | | | | | | fix #11725 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: zeripath <art27@cantab.net>
* Add language statistics API endpoint (#11737)Lauris BH2020-06-073-0/+92
| | | | | * Add language statistics API * Add tests