aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Add serviceworker.js to KnownPublicEntries (#11992)silverwind2020-06-201-3/+4
| | | | | | | Fixes a wrong 302 redirect to the login page, see https://github.com/go-gitea/gitea/issues/11989. Also made it so the reserved username list is extended with those known entries so we avoid code duplication. Should be backported to 1.12.
* Use enry language type to detect special languages (#11974)Lauris BH2020-06-191-16/+5
|
* For language detection do not try to analyze big files by content (#11971)Lauris BH2020-06-191-3/+7
|
* Use only first line of commit when creating referenced comment (#11960)Cirno the Strongest2020-06-191-1/+2
| | | | | | | | | | * Use only first line of commit when creating referenced comment * Update modules/repofiles/action.go * Display first line only on feeds too Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
* Use google/uuid to instead satori/go.uuid (#11943)Lunny Xiao2020-06-184-9/+9
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Global default branch setting (#11918)techknowlogick2020-06-172-1/+4
| | | | | | | | | * Global default branch setting * add to app.ini example per @silverwind * update per @lunny Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Only write to global gitconfig if necessary (#11876)zeripath2020-06-132-25/+65
| | | | | | | | | | | | | * Only write to global gitconfig if necessary Fix #11855 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Disable all typographic replacements in markdown renderer (#11871)silverwind2020-06-132-8/+1
| | | | | | | | | | | | | | | | | | | * Disable all typographic replacements in markdown renderer Previously we only disabled some of them. This disables all the default replacements that goldmark's typographer extension offers, matching GitHub's renderer. Ref: https://github.com/yuin/goldmark#typographer-extension Fixes: https://github.com/go-gitea/gitea/issues/11001 * remove typographer extension completely * fix test * really fix test Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix 500 error on repos with no tags (#11870)mrsdizzie2020-06-121-1/+1
| | | | | | | | #11846 Introduced feature to show exact tag on commit view. However if a repo has no tags at all git prints out a separate and unhandled error " No names found, cannot describe anything." Adding --always to the command makes it always use the error in the style of "fatal: no tag exactly matches" even if there are no tags at all. Fixes #11869 Fixes #11868
* Handle more pathological branch and tag names (#11843)zeripath2020-06-112-67/+7
| | | | | | | | | | | * 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>
* Fix commit search in all branches (#11849)Cirno the Strongest2020-06-111-1/+27
| | | | | | | * Fix commit search in all branches * comments Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Show exact tag for commit on diff view (#11846)Cirno the Strongest2020-06-111-1/+16
| | | | | | | * Show exact tag for commit on diff view * Fix comment Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Prevent panic on empty HOST for mysql (#11850)zeripath2020-06-111-1/+1
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set the base url when migrating from Gitlab using access token or username ↵Gernot Eger2020-06-111-1/+1
| | | | | | | without password (#11852) When migrating from gitlab, set the baseUrl in NewGitlabDownloader when using an access token or username without password Fix #11851
* Don't consider tag refs as valid for branch name (#11847)Cirno the Strongest2020-06-101-1/+1
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Replace jquery-datetimepicker with native date input (#11684)silverwind2020-06-101-13/+2
| | | | | | | | | | | | 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>
* API expose usefull General Repo settings settings (#11758)65432020-06-101-0/+11
| | | | | | | | | | | * 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/+2
| | | | | | | | * API allow to create closed milestones * set CloseDate too Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Honor DEFAULT_PAGING_NUM for API (#11805)Cirno the Strongest2020-06-081-1/+1
| | | | | | | | | | * 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>
* Add option to API to update PullRequest base branch (#11666)65432020-06-071-0/+1
| | | | | * EditPull: add option to change base Close #11552
* Fix visibility of forked public repos from private orgs (#11717)Cirno the Strongest2020-06-061-1/+2
| | | | | | | | | * Fix visibility of forked public repos from private orgs * update forks visibility when org visibility is changed Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix timezone on issue deadline (#11697)Cirno the Strongest2020-06-051-0/+5
| | | | | | | * Fix timezone on issue deadline * FormatDate Co-authored-by: zeripath <art27@cantab.net>
* Dump: add output format tar and output to stdout (#10376)PhilippHomann2020-06-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Dump: Use mholt/archive/v3 to support tar including many compressions Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: Allow dump output to stdout Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: Fixed bug present since #6677 where SessionConfig.Provider is never "file" Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: never pack RepoRootPath, LFS.ContentPath and LogRootPath when they are below AppDataPath Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: also dump LFS (fixes #10058) Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: never dump CustomPath if CustomPath is a subdir of or equal to AppDataPath (fixes #10365) Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Use log.Info instead of fmt.Fprintf Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * import ordering * make fmt Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Matti R <matti@mdranta.net>
* Add hide activity option (#11353)l-jonas2020-06-051-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add hide activity option This closes https://github.com/go-gitea/gitea/issues/7927 * Adjust for linter * Adjust for linter * Add tests * Remove info that admins can view the activity * Adjust new tests for linter * Rename v139.go to v140.go * Rename v140.go to v141.go * properly indent * gofmt Co-authored-by: Jonas Lochmann <git@inkompetenz.org> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix typo (#11773)successgo2020-06-052-14/+14
| | | | | * Fix typo of MSSQL * Fix typo: validates
* Add internal-repo octicon for public repos of private org (#11529)Cirno the Strongest2020-06-051-0/+1
| | | | | | | | | | | | | | | | | | | * Show multiple octicons on repo list * fix mixed spaces/tabs * Internal repo octicon * show internal icon in dashboard repolist * swagger * fix icon for normal repo on repo page * don't expose owner visibility directly; provide internal in repo api * fix icons for forks and mirrors Co-authored-by: Lauris BH <lauris@nix.lv>
* Provide diff and patch API endpoints (#11751)zeripath2020-06-051-0/+4
| | | | | | | | | | | | | | | | | | | | | * Provide diff and patch API endpoints The diff and patch endpoints on the main routes are not accessible by token therefore we provide new API based endpoints for these Fix #10923 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Make the response an actual string Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* European Portuguese translation (#11568)Emanuel Angelo2020-06-051-4/+4
| | | | This PR includes the modifications necessary to make use of the European Portuguese translation from the default setting.
* Include query in sign in redirect (#11579)mrsdizzie2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | * Include query in sign in redirect Include query string in ctx.Data["SignInLink"] so people are redirected to the right page after singing in. Fixes case of: Visit: https://try.gitea.io/mrsdizzie/testcase/issues?q=&type=all&sort=&state=open&labels=7071&milestone=0&assignee=0 Sign in, then redirected to: https://try.gitea.io/mrsdizzie/testcase/issues Create a new "SignInLink" instead of updating the existing "Link" because too many places in the code assume "Link" won't have a query * Apply suggestions from code review Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [API] on 500 error only show message if gitea in dev mode (#11641)65432020-06-031-0/+4
| | | | | | | * add API specific InternalServerError() * return 500 error msg only if not Production mode * rm unnessesary change
* Allow site admin to disable mirrors (#11740)John Olheiser2020-06-021-0/+2
| | | | | | | | | | | | | | | | | | | * Allow site admin to disable mirrors Signed-off-by: jolheiser <john.olheiser@gmail.com> * No need to run through Safe Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify only disabling NEW mirrors Signed-off-by: jolheiser <john.olheiser@gmail.com> * Apply suggestions from @guillep2k Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix chardet test and add ordering option (#11621)zeripath2020-06-023-4/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix chardet test and add ordering option Signed-off-by: Andrew Thornton <art27@cantab.net> * minor fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * remove log Signed-off-by: Andrew Thornton <art27@cantab.net> * remove log2 Signed-off-by: Andrew Thornton <art27@cantab.net> * only iterate through top results Signed-off-by: Andrew Thornton <art27@cantab.net> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md * slight restructure of for loop Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update emoji dataset with skin tone variants (#11678)mrsdizzie2020-06-022-1727/+3103
| | | | | | | | | * Update emoji dataset with skin tone variants Since the format of emoji that support skin tone modifiers is predictable we can add different variants into our dataset when generating it so that we can match and properly style most skin tone variants of emoji. No real code change here other than what generates the dataset and the data itself. * use escape unicode sequence in map Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Issue/Pull expose IsLocked Property on API (#11708)65432020-06-014-0/+4
| | | | Expose IsLocked Property
* Fix language stat calculation (#11692)Cirno the Strongest2020-05-312-7/+28
| | | | | | | * Fix language stat calculation * Group languages and ignore 0 size files * remove unneeded code
* Change language statistics to save size instead of percentage (#11681)Lauris BH2020-05-302-19/+9
| | | | | | | | | | | * Change language statistics to save size instead of percentage in database Co-Authored-By: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> * Do not exclude if only language * Fix edge cases with special langauges Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Fix issue with DiffIndex on initial commit (#11677)zeripath2020-05-291-0/+3
| | | | | | | | | | | | | | | | | Unfortunately #11614 introduced a bug whereby the initial commit of a repository could not be seen due to there being no parent commit to create a clear diff from. Here we create a diffstat from the difference between the parentless SHA and the SHA of the empty tree - a constant known to git. (With thanks to @L0veSunshine for informing me of this SHA) Thanks to @a1012112796 for initial attempt to fix. Fix #11650 Closes #11674 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-Authored-By: L0veSunshine <xuan199651@gmail.com>
* Add API Endpoint for Branch Creation (#11607)Terence Le Huu Phuong2020-05-292-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [FEATURE] [API] Add Endpoint for Branch Creation Issue: https://github.com/go-gitea/gitea/issues/11376 This commit introduces an API endpoint for branch creation. The added route is POST /repos/{owner}/{repo}/branches. A JSON with the name of the new branch and the name of the old branch is required as parameters. Signed-off-by: Terence Le Huu Phuong <terence@qwasar.io> * Put all the logic into CreateBranch and removed CreateRepoBranch * - Added the error ErrBranchDoesNotExist in error.go - Made the CreateNewBranch function return an errBranchDoesNotExist error when the OldBranch does not exist - Made the CreateBranch API function checks that the repository is not empty and that branch exists. * - Added a resetFixtures helper function in integration_test.go to fine-tune test env resetting - Added api test for CreateBranch - Used resetFixture instead of the more general prepareTestEnv in the repo_branch_test CreateBranch tests * Moved the resetFixtures call inside the loop for APICreateBranch function * Put the prepareTestEnv back in repo_branch_test * fix import order/sort api branch test Co-authored-by: zeripath <art27@cantab.net>
* Update emoji regex (#11584)mrsdizzie2020-05-293-7/+31
| | | | | When matching emoji, use a regex built from the data we have instead of something generic using unicode ranges. A generic regex can't tell the difference between two separate emoji next to each other or one emoji that is built out of two separate emoji next to each other. This means that emoji that are next to each other without space in between will be now accurately spanned individually with proper title etc...
* Exclude generated files from language statistics (#11653)Lauris BH2020-05-292-14/+10
| | | * Update go-enry to v2.5.2
* Default MSSQL port 0 to allow automatic detection by default (#11642)zeripath2020-05-281-1/+1
| | | | | | | Fix #11633 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Return json on 500 error from API (#11574)65432020-05-281-4/+21
| | | | | | | | | | | | | | | * add API specific InternalServerError() Co-authored-by: zeripath <art27@cantab.net> * return 500 error msg only if not Production mode * Revert "return 500 error msg only if not Production mode" This reverts commit 8467b2cee674ad205b452780ca88abb1b27643c8. * InternalServerError Co-authored-by: zeripath <art27@cantab.net>
* Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635)zeripath2020-05-281-0/+2
| | | | | Fix #11634 Signed-off-by: Andrew Thornton <art27@cantab.net>
* When must change password only show Signout (#11600)zeripath2020-05-261-1/+3
| | | | | | | | | | | | When "Must Change Password" simplify the navbar header to only show the signout button as all other links will redirect back. This prevents the notifications icon from showing preventing initialization of the event-source and hence preventing redirect_to being set, however in addition do not set the redirect_to cookie if we are looking at the /user/events page. Fix #11554 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix numbr of files, total additions, and deletions (#11614)zeripath2020-05-263-2/+93
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* When initialising repositories ensure that the user doing the creation is ↵zeripath2020-05-241-1/+1
| | | | | | | the initializer (#11601) Fix #10760 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow different HardBreaks settings for documents and comments (#11515)zeripath2020-05-243-13/+29
| | | | | | | | | | | | | | | | GH has different HardBreaks behaviour for markdown comments and documents. Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting. Here we split the setting in to two - one for documents and one for comments and other things. Signed-off-by: Andrew Thornton art27@cantab.net Changes to index.js as per @silverwind Co-authored-by: silverwind <me@silverwind.io> Changes to docs as per @guillep2k Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Prevent (caught) panic on login (#11590)zeripath2020-05-231-6/+14
| | | | | | | | | | | | | | | | Unfortunately when the virtual session is released it requires that the real session does not exist. This worked fine when sessions were only saved at the end of request/response cycle however, now sessions are saved proactively this does not hold. The result is a caught panic in the logs during every log-in. This panic has no significant side-effects but should not occur. This PR marks the virtual session as released when released and updates it if the same session is released again. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Properly handle and return empty string for dangling commits in ↵Cirno the Strongest2020-05-231-1/+6
| | | | GetBranchName (#11587)
* Move serviceworker to workbox and fix SSE interference (#11538)silverwind2020-05-212-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: https://github.com/go-gitea/gitea/issues/11092 Fixes: https://github.com/go-gitea/gitea/issues/7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162ba1f18b98a4bf9635959fd28d16e839fc5. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>