Compare commits

..

174 Commits

Author SHA1 Message Date
83f8414e1e Update Changelog for 1.11.5 ()
* Update Changelog for 1.11.5

* bumb version in docs

* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>
2020-05-09 16:26:27 -03:00
0b216f40fd Fix tracked time issues () ()
Backport  

* Fix tracked time issues ()

* Fix nil exeption: 

* fix 500

* activate test 😆

* move logic

* Add missing import

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
2020-05-09 18:08:41 +01:00
dd6e604f8f Add NotifySyncPushCommits to indexer notifier () ()
Thanks to @simon-on-gh for tracking down the issue.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-08 22:40:51 +01:00
86863ae939 Prevent timer leaks in Workerpool and others () ()
There is a potential memory leak in `Workerpool` due to the intricacies of
`time.Timer` stopping.

Whenever a `time.Timer` is `Stop`ped its channel must be cleared using a
`select` if the result of the `Stop()` is `false`.

Unfortunately in `Workerpool` these were checked the wrong way round.

However, there were a few other places that were not being checked.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-09 00:18:39 +08:00
f3a90057a5 Allow X in addition to x in tasks () ()
Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-05-08 20:55:16 +08:00
03fdd82d63 Changelog v1.11.5 ()
* Changelog v1.11.5

* Apply suggestions from code review

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-08 12:58:05 +03:00
cd7fa15d1d Prevent multiple listings of organization when creating a repository () ()
Backport  

Prevent multiple listings of organization when creating a repository ()

prevent double entries in results of GetOrgsCanCreateRepoByUserID

I first try to only add GroupBy directly but xorm return broken user objects ...

... solution was to just query related UserIDs(OrgIDs) first and return OrgUsers based on this IDs

close 

Co-authored-by: zeripath <art27@cantab.net>
2020-05-07 21:30:51 +01:00
79868d7096 When delete tracked time through the API return 404 not 500 () () 2020-05-07 22:42:33 +03:00
19626b93f8 Manage port in submodule refurl () ()
* Manage port in submodule refurl

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix lint

Signed-off-by: Andrew Thornton <art27@cantab.net>

* URLJoin is causes a cyclic dependency and possibly isn't what what we want anyway

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Protect against leading .. in scp syntax

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-07 10:41:40 -05:00
91e6a7f7ea api.Context.NotFound(...) should tolerate nil () ()
There is an unfortunate signature change with the api.Context
NotFound function; whereas the normal modules/context/Context
NotFound function requires an error or nil, the api.Context
variant will panic with an NPE if a nil is provided.

This PR will allow api.Context.NotFound to tolerate a being
passed a nil.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-05 17:48:24 -05:00
ff7eaa1eb4 Show pull request selection even when unrelated branches () ()
Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-04 12:38:26 +01:00
5131206aad repo: milestone: make /milestone/:id endpoint accessible () ()
Previously, this required authentication, but there's not actually
any privileged information on this page.  Move the endpoint out of
the group that requires sign-in.  It still requires the ability to
read issues and pull requests, so private repositories (for instance)
will not be exposed.

Fixes  
Fixes 

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-04 04:12:36 +03:00
bfc25fcf40 Fix GetContents(): Dont't ignore Executables () () 2020-04-25 01:54:38 -03:00
4a6765fba2 Fix submodule paths when AppSubUrl is not root () ()
Backport 

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-04-22 13:37:52 +01:00
dca8ef9407 Prevent clones and pushes to disabled wiki () ()
Backport 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-04-19 16:40:40 +01:00
cebef5c871 Remove errant third closing curly-bracket from account.tmpl and send account ID in account.tmpl ()
* Remove errant third } from account.tmpl

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update templates/user/settings/account.tmpl
2020-04-19 20:35:34 +08:00
245d6ebda5 On Repo Deletion: Delete related TrackedTimes too () () 2020-04-19 10:39:48 +08:00
d9875ff2e1 Refresh codemirror on show pull comment tab () ()
Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-04-18 13:55:13 -03:00
cc2a6c1d30 Fix merge dialog on protected branch with missing required statuses () ()
It is possible for misconfigured protected branches to have required status checks that are not in any of the current statuses: Pending, Success, Error, Failure, or Warning - presumably because the CI has not contacted us as yet.

Fix  by adding case: missing StatusChecks when these are missing
2020-04-16 10:45:34 +03:00
b5fd55de73 fix 404 and 500 image size in small size screen () ()
do it by define Semantic UI image class

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-04-12 20:24:15 +08:00
e11b3a1076 Load PR Issue Poster on API too () ()
* Load pr Issue Poster on API too ()

* ajust for 1.11 codebase
2020-04-11 01:10:16 -03:00
0c4be64345 [Backport] Fix release counter on API repository info () ()
* Fix release counter on API repository info ()

* correct Pull Count to v1.11 Fixtures
2020-04-06 18:13:12 -04:00
c34ad62eea Mulitple Gitea Doctor improvements () () () () ()
* Mulitple Gitea Doctor improvements ()

Backport 

* Add `gitea doctor --list` flag to list the checks that will be run, including those by default
* Add `gitea doctor --run` to run specific checks
* Add `gitea doctor --all` to run all checks
* Add db version checker
* Add non-default recalculate merge bases check/fixer to doctor
* Add hook checker (Fix ) and ensure hooks are executable (Fix )
* Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.)
* Add SCRIPT_TYPE check (Fix )
* Add `gitea doctor --fix` to attempt to fix what is possible to easily fix
* Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.)

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Switch to io.Writer instead of io.StringWriter

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-04-06 16:15:20 -04:00
f7d7cf4e2d Fix rebase conflict detection in git 2.26 ()
Git changed the technique used in rebase from
simple apply-patches to use merge. This breaks
our conflict detection code.

created by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-04-03 13:09:15 -04:00
99a364a9dc Generate Diff and Patch direct from Pull head () ()
Backport 

* Generate Diff and Patch direct from Pull head

Fix 
Also fix "Empty Diff/Patch File when pull is merged"

Closes 

* Add tests to ensure that diff does not change
* Ensure diffs and pulls pages work if head branch is deleted too

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-04-03 17:06:54 +03:00
3afbbfe921 Changelog v1.11.4 ()
* output of changelog

* Apply suggestions from code review

* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>
2020-04-01 18:09:33 +03:00
bfce841b04 Only update merge_base if not already merged ()
* Only update merge_base if not already merged

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Prevent race in transfer pull request

* Update services/pull/pull.go
2020-04-01 15:33:44 +03:00
139fc7cfee Fix milestones too many SQL variables bug () ()
* Fix milestones too many SQL variables bug

* Fix test

* Don't display repositories with no milestone and fix tests

* Remove unused code and add some comments
2020-03-31 08:40:37 -05:00
596eebb2b6 Protect against NPEs in notifications list () ()
* Protect against NPEs in notifications list ()

Unfortunately there appears to be potential race with notifications
being set before the associated issue has been committed.

This PR adds protection in to the notifications list to log any failures
and remove these notifications from the display.

References  - and prevents the panic but does not completely fix
this.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add log import

* Update models/notification.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-03-30 15:23:02 +08:00
1d5d745851 Convert plumbing.ErrObjectNotFound to git.ErrNotExist in getCommit () ()
Backport 

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-03-29 17:47:53 +01:00
3dabfd4933 Convert plumbing.ErrReferenceNotFound to git.ErrNotExist in GetRefCommitID () ()
* Fix panic in API pulls when headbranch does not exist ()

Backport 

* Fix panic in API pulls when headbranch does not exist
* refix other reference to plumbing.ErrReferenceNotFound

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>
2020-03-23 15:01:25 +02:00
6ee6731290 account for empty lines in receive-hook message () ()
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-03-21 10:49:02 +08:00
602fe45936 Fix bug on branch API () ()
* Fix bug on branch API ()

* Fix branch api canPush and canMerge
2020-03-20 23:31:01 +02:00
e2da9cd21f FIx hiding of fields in authorization source page () () 2020-03-19 11:40:01 -04:00
c0b917b7eb Migrate to go-git/go-git v5.0.0 () () 2020-03-18 22:36:31 -04:00
54ea58ddf0 Prevent default for linkAction () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-16 20:41:02 -03:00
0158725387 Changelog for v1.10.6 () ()
* Changelog for v1.10.6

* Add warnning

* Apply suggestions from code review

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2020-03-10 23:09:56 -04:00
f3cacf1332 Add changelog for v1.11.3 ()
* Add changelog for v1.11.3

* Apply suggestions from code review

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>

* Update CHANGELOG.md

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-03-10 17:11:15 +00:00
a15dc93011 cross compile using go 1.13.x () 2020-03-09 21:11:02 +02:00
66b31786d3 Prevent panic in stopwatch () ()
Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-03-08 21:14:27 +02:00
931ddfec6d add changelog for v1.10.5 () () 2020-03-08 09:54:23 -05:00
7e0a5b17db Fix bug on pull view when required status check no ci result () () 2020-03-07 17:32:08 +08:00
07688231c2 Changelog for v1.11.2 ()
* Changelog for v1.11.2

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* as per @jolheiser

* as per @jolheiser x2

* Update CHANGELOG.md

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>

* Update CHANGELOG.md

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>

* another security pr

* another security pr

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2020-03-06 15:38:11 +08:00
21eaeb8418 Issue writers perms can modify issues () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-06 04:42:20 +00:00
9a929ad17f Handle deleted base branch in PR () ()
Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-03-05 22:23:34 +02:00
c19ac41b34 Delete dependencies when deleting a repository () ()
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
2020-03-05 13:56:53 +00:00
fd85d31cb4 Ensure executable bit is kept on the web editor () ()
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-03-05 16:55:21 +08:00
c9e4d7a564 Update mergebase in pr checker () () 2020-03-04 18:56:09 -03:00
9990430e32 Build gitea1.11 with go1.13 () 2020-03-03 07:09:27 +00:00
6f5656ab0e Logout POST action () ()
* Change logout to POST

* Update for redirect

* Revert octicon to font

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-03 13:54:15 +08:00
e4a876cee1 Admin page for managing user e-mail activation () ()
* Admin page for managing user e-mail activation ()

* Implement mail activation admin panel

* Apply suggestions by @lunny

* Add UI for user activated emails

* Prevent admin from self-deactivate; add modal

Co-authored-by: zeripath <art27@cantab.net>

* Fix pagination options downgrade

Co-authored-by: zeripath <art27@cantab.net>
2020-03-02 17:09:37 -03:00
abb534ba7a Fix migration bug on v96.go () ()
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-03-02 10:32:20 -06:00
65dceb6a40 Fix redirection path if Slack webhook channel is invalid ()
The path to the hook config is already defined by orgRepoCtx
2020-03-02 13:54:07 +02:00
db26f0aca9 head.tmpl og:image picture location () ()
* head.tmpl og:image picture location ()

og:image picture location

* CI.restart()

* CI.restart()

Co-authored-by: FreeCipher <admin@freecipher.com>
2020-03-01 15:33:18 -05:00
76878fd69b Fix 404 after activating secondary email (backport of ) () 2020-03-01 13:27:13 +01:00
3444fa2dd7 Fix appearance of unsigned sha box in view_list () ()
Unfortunately the fix in  was slightly incorrect and placed the
detail box at one level too far out.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-02-29 17:20:32 +02:00
caa2aeaa52 Show Signer in commit lists and add basic trust () ()
Backport 
Backport 

* Show Signer in commit lists and add basic trust ()

Show the avatar of the signer in the commit list pages as we do not
enforce that the signer is an author or committer. This makes it
clearer who has signed the commit.

Also display commits signed by non-members differently from
members and in particular make it clear when a non-member signer
is different from the committer to help reduce the risk of
spoofing.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Fix the signing icon in the  view_list.tmpl page ()

Co-Authored-By: silverwind <me@silverwind.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-28 14:18:02 -03:00
11300ee582 Fix potential bugs () ()
* use e if it is an option
* potential nil so check err first
* check err first
* m == nil already checked
2020-02-28 00:12:23 -03:00
c6b78c3d31 Org action fixes and form cleanup () ()
* More org fixes

* Move form action query to inputs

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-27 19:38:21 -06:00
4c40aa5be9 Use [:space:] instead of \s () ()
Backport 
2020-02-27 19:12:10 +00:00
50f2e90b76 [BugFix] Avoid mailing explicit unwatched () ()
* [BugFix] Avoid mailing explicit unwatched ()
2020-02-27 11:42:51 -06:00
5d11ccc9e1 Handle push rejection message in Merge & Web Editor () ()
Backport 

* Handle push rejection message in Merge

* Fix sanitize, adjust message handling

* Handle push-rejection in webeditor CRUD too

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-27 15:37:11 +02:00
93860af542 Fix SQLite concurrency problems by using BEGIN IMMEDIATE () () 2020-02-26 23:30:57 -03:00
7bf5834f2c Show the username as a fallback on feeds if full name is blank ()
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-26 20:59:07 -05:00
1fbdd9335f Fix double PR notification from API () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-26 22:39:39 +02:00
e9061a537c Fix admin notices () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-26 11:14:37 -06:00
ed664a9e1d Change admin dashboard to POST () ()
* Change admin dashboard to POST ()

* Add form and convert to POST

* Redirect for flash

* Convert octicons back to fa for 1.11

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-25 17:42:43 -06:00
4cb18601ff Change action GETs to POST () ()
* Change action GETs to POST

* submite = submit + smite

* No more # href

* Fix test

* Match other tests

* Explicit csrf

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-25 15:08:21 -06:00
3abb25166c Update markbates/goth (backport) ()
Update markbates/goth to v1.61.2
- Fixes a JWT decoding issue in the OpenID provider
- Updates the GitHub provider to use the authorization header for authentication
- Updates the Twitch provider for Twitch's v5 API changes
- Adds the email and is_private_email fields to the Apple provider's GetUser implementation
- Modifies gothic to export a non-collidable context key for setting the Provider in a context.Context
- Adds new scopes to the Spotify provider
- Adds the IDToken from OpenID providers on the user struct
- Make Apple provider's SecretParams public
- Adds support for sign in with Apple, and drops support for Go versions 1.7 and 1.8
- Fixes the Slack provider's FetchURL logic to use the appropriate scope for the info it needs
Signed-off-by: Oscar LÃfwenhamn <oscar.lofwenhamn@cgi.com>
2020-02-24 13:19:25 -05:00
9e6ad64d48 Trigger webhooks on issue label-change via API too () ()
* trigger webhooks with api too

* fix comment

* notify report old too

* CI restart

* restart CI again

* remove duplicated code
2020-02-24 14:30:59 +00:00
b51d7c459e Fix webhook bug () ()
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-02-24 01:48:30 -03:00
d3b6f001fe Various fixes in login sources () ()
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-23 22:46:17 +02:00
e938f1d945 Add frontend/backend make targets, fix source release () ()
* Add frontend/backend make targets, fix source release

- Add 'make backend' and 'make frontend' make targets which are used to
  build go and js/css/svg files respectively.

- The 'backend' target can be invoked without requiring Node.js to be
  present on the system if pre-built frontend assets are present like
  in the release source tarballs.

- Fix source releases missing 'dist' folders inside 'node_modules' which
  were erronously excluded from tar.

- Store VERSION in file VERSION for the release tarballs and prefer that
  file over git-derived version.

* fix release task

* fix typo

* fix another typo

Fixes: https://github.com/go-gitea/gitea/issues/10253
2020-02-22 08:51:58 -03:00
7284327a00 Prevent panic on merge to PR () ()
If you attempt to merge to a branch which on a PR there will be a nil pointer error in the pull request checker.

This panic is uncaught and will bring down the gitea server.

This PR adds protection to prevent this.

Co-authored-by: zeripath <art27@cantab.net>
2020-02-21 22:53:32 +00:00
919f3f11e2 update crypto vendors ()
Co-authored-by: @techknowlogick
2020-02-21 11:27:18 -03:00
3cee15e6f9 Ensure only own addresses are updated () () 2020-02-21 10:35:17 -03:00
34e3644ada Fix wrong num closed issues on repository when close issue via commit () ()
Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-20 15:52:19 +01:00
14bd120cdc Reading pull attachments should depend on read UnitTypePullRequests () ()
Co-authored-by: zeripath <art27@cantab.net>
2020-02-18 21:02:50 -06:00
3e40f8bebc Set max-width on review-box comment box () ()
Co-authored-by: zeripath <art27@cantab.net>
2020-02-18 18:59:14 -06:00
df5f1d9dca Prevent nil pointer in GetPullRequestCommitStatusState () ()
Backport  

Ensure that pr.HeadRepo is loaded before using it in GetPullRequestCommitStatusState.

Fixes error on merging with successful commit merge statuses.
2020-02-18 20:04:10 +00:00
457ee1ab5a Fix status check enable () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-18 19:34:50 +00:00
4f64688902 Truncate long commit message header () ()
* Truncate long commit message header

* Fix overflow in view commit table

* Use @media less

* Further improvements

* Fix the commit message on small screens

* adjust width of minimal table
2020-02-18 08:51:39 +01:00
117dcf1c02 Set the initial commit status to Success otherwise it will always be Pending () ()
Backport 

The commit status code has a bug whereby setting the initial status to Pending means you can never have the status of Success - it should be set to Success.
2020-02-17 20:50:59 +00:00
4529a262c0 Don't manually replace whitespace during render () ()
* Don't manually replace whitespace during render

For historical reasons Gitea manually alters the urlPrefix and replaces
a whitespace with a +. This Works for URLs, but we're also passing
urlPrefix to git calls and adding the + is breaking the tree path.

Goldmark will automatically convert a white space to the proper %20, so
we should leave the string as is which lets us pass it to git unmodified
and then let Goldmark fix it.

Also fixed separate bug in URLJoin I noticed while testing where it will
silently discard sections of a path that have # in them (possibly
others). We should just escape it first.

Fixes 10156

* Escape elems as well

* Revert "Escape elems as well"

This reverts commit 8bf49596fee6fac4d9da256cd1e90a0ec0183671.

* restart ci

* remove changes to URLJoin

* restart ci

Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-02-17 19:46:28 +02:00
ff24f81a05 Create Changelog for v1.11.1 release ()
* Create Changelog

* Update CHANGELOG.md

Co-Authored-By: techknowlogick <matti@mdranta.net>

* Include

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-02-17 01:22:39 +02:00
e3cb4f9d0e fix: set explicit POSTGRES_PASSWORD for pgsql on drone CI () 2020-02-16 16:38:54 -05:00
9b7890f1cc v1.10.4 Changelog () ()
* v1.10.4 Changelog

* Add backport identifier for 

* Update CHANGELOG.md entry for 
2020-02-16 16:38:06 -05:00
eb064dfda2 make: add release-sources ()
* make: add release-sources

* make: release-sources exclude .git and make_evidence

* fix: skip exclude MAKE_EVIDENCE_DIR not present in 1.11
2020-02-16 13:23:41 -05:00
f9e66e5a46 Blacklist manifest.json & milestones user () ()
Fix 

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-02-16 13:20:59 +02:00
ef89260cf1 Repo name added to automatically generated commit message when mergin… () ()
* Repo name added to automatically generated commit message when merging pull request

* As per @lunny

Co-authored-by: Shashvat Kedia <sk261@snu.edu.in>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-15 21:17:01 +00:00
315d928626 Fix Workerpool deadlock () ()
* Prevent deadlock on boost

* Force a boost in testchannelqueue
2020-02-15 19:28:25 +00:00
5525452bdf Divide GetIssueStats query in smaller chunks () ()
* Divide GetIssueStats query in smaller chunks

* Skip chunking if count is low enough

* Fix lint

* Define maxQueryParameters

* Remove absMaxQueryParameters because of lint

* Restart CI

* Restart CI

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-15 19:07:09 +02:00
987cd277f6 Fix reply on code review () ()
Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
2020-02-13 11:32:30 +02:00
5cdfde2ebf Stop hanging issue indexer initialisation from preventing shutdown () ()
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-02-12 12:22:10 +02:00
1cd6233cef fix filter label emoji width () () 2020-02-12 00:39:06 +01:00
cb81e39f7a Fix issue sidebar menus having an infinite height () 2020-02-11 22:26:33 +01:00
8efd6b32e2 Fix commit between two commits calculation if there is only last commit () () 2020-02-11 11:10:12 +08:00
c95d9603ea Only check for conflicts/merging if the PR has not been merged in the interim () ()
* Only check for conflicts/merging if the PR has not been merged in the interim ()

* Only check for merging if the PR has not been merged in the interim

* fixup! Only check for merging if the PR has not been merged in the interim

* Try to fix test failure

* Use PR2 not PR1 in tests as PR1 merges automatically

* return already merged error

* enforce locking

* move pullrequest checking to after merge

This might improve the chance that the race does not affect us but does not prevent it.

* Remove minor race with getting merge commit id

move check pr after merge

* Remove unnecessary prepareTestEnv - onGiteaRun does this for us

* Add information about when merging occuring

* More logging

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

* re order

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-10 13:09:08 +00:00
9169b39458 Changelog 1.11.0 ()
* Changelog 1.11.0

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Backport snackport

Co-Authored-By: techknowlogick <matti@mdranta.net>

* Update CHANGELOG.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-10 13:34:30 +02:00
80eb50655a Fix followers and following tabs in profile () () 2020-02-09 21:00:24 +00:00
b16c555541 Fix code-expansion arc-green theme bug () ()
* fix code-expansion theme bug

* working solution without important

* no new color

* the midle
2020-02-08 00:04:03 +01:00
b5b44364e3 Allow emoji on review head comments () ()
Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-02-07 21:39:24 +01:00
6af58022c8 Prevent double waitgroup decrement () ()
* Prevent double waitgroup decrement

Co-authored-by: zeripath <art27@cantab.net>
2020-02-07 17:12:49 +00:00
e48b460a0a Fix issue/pull link () () 2020-02-07 11:51:23 +08:00
2cd2614eaa Fix push-create SSH bugs () ()
* Attempt to fix push-create SSH bugs

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Fix binding

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Invalid ctx

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-05 15:50:06 +01:00
0129e76ef5 Prevent DeleteUser API abuse () ()
* fix & co

* word suggestions from @jolheiser
2020-02-03 19:44:06 +02:00
6896dad675 working part of () ()
Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
2020-02-03 11:19:04 +08:00
1ed4323005 Add button to revert SimpleMDE to plain textarea () () 2020-02-01 22:24:58 +02:00
049af0d3d0 Fix branch page pull request title and link error () ()
* Fix branch page pull request title and link error ()
2020-02-01 15:14:56 +00:00
f5727d83dd [BugFix] [API] Pull.API.Convert: Only try to get HeadBranch if HeadRepo exist () () 2020-01-31 20:49:45 -05:00
912ce27421 Update topics repo count when deleting repository () 2020-01-31 08:04:49 +00:00
b3549bb5ec [UI] Show pull icon on pull () () 2020-01-29 20:40:43 +00:00
491cbeca67 Fix milestone API state parameter unhandled () ()
* Fix milestone API state parameter unhandled

* Fix test
2020-01-29 18:01:44 +02:00
895d92ffe5 Ensure that feeds are appropriately restricted () ()
* Ensure that feeds are appropriately restricted

* Placate golangci-lint
2020-01-28 23:54:09 +02:00
4b11f967bd PRs: Move to use a temporary repo for pushing new prs () ()
* Move to use a temporary repo for pushing new prs
2020-01-28 18:46:59 +00:00
1e73dd2446 Fix wiki raw view on sub path () ()
* Fix wiki raw view on sub path

* Add test for subpath wiki raw file

* Fix bug
2020-01-28 15:10:25 +00:00
315026c2c5 trim whitespace of MilestoneName at creation/rename () () 2020-01-28 16:52:24 +08:00
16dfd9ffbe Sanitize credentials in mirror form () () 2020-01-26 08:16:53 +00:00
16f7b43903 Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch () ()
* fix pull view when head repository or head branch missed and close related pull requests when delete branch

* fix pull view broken when head repository deleted

* close pull requests when head repositories deleted

* Add tests for broken pull request head repository or branch

* fix typo

* ignore special error when close pull request

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-25 17:39:53 +08:00
043febdbc9 Switch to use -f instead of -F for sendmail () ()
Fix 

Co-authored-by: zeripath <art27@cantab.net>
2020-01-24 20:45:53 -05:00
60f91d56f0 Fix check for push on default branch ()
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-24 19:56:30 -05:00
16fc15ae6a Fix file rename/copy not supported by indexer () 2020-01-24 18:25:00 -05:00
ef8f6d99f1 Fix regression with tag test running () 2020-01-22 15:49:08 -05:00
4b688135f9 Changelog 1.11.0-rc2 ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-01-22 14:56:55 -05:00
e24861a546 Don't convert ellipsis in markdown () ()
* Don't convert ellipsis

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Formatting

Co-Authored-By: zeripath <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
2020-01-22 16:24:04 +00:00
128cc34344 Fixed repo link in generated comment for cross repository dependency () ()
* fixed link to issue in issue comments after adding/removing a dependency, before links assumed the issue was in the same repository. also changed the format of the displayed issue since the issue will not necessarily be in the same repo

* based on pr comments, changed to use HTMLURL instead of piecing together the issue url, and added an if statement around the issue link display as a nil protection

* only showing repo name in dependency comment if the issue is from another repo

Co-authored-by: Brad Albright <32200834+bhalbright@users.noreply.github.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-22 12:54:40 +02:00
f82a805478 Check if diff actually contains sections when rendering () () 2020-01-22 08:02:57 +00:00
0dced15c1a Fix wrong hint when status checking is running on pull request view () ()
* Fix wrong hint when status checking is running on pull request view

* fix lint

* fix test

* fix test

* fix wrong tmpl

* fix import

* rename function name
2020-01-22 08:06:11 +02:00
db9342c854 Fix RocketChat () ()
* Fix RocketChat??

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Don't send attachment for repo create/delete

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Make fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-21 17:24:18 -05:00
79c1d48532 Do not try to recreate ldap user if they are already created () ()
* Do not try to recreate ldap user if they are already created

* just remove autoregister

Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-21 21:17:00 +01:00
05b9864086 Update queue_redis.go () 2020-01-21 20:02:25 +08:00
ff508c9c9b Add option to prevent LDAP from deactivating everything on empty search () ()
* Add option to prevent LDAP from deactivating everything on empty search

* Update options/locale/locale_en-US.ini

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-20 21:18:23 +02:00
f96c1a2c79 Fix wrong permissions check when issues/prs shared operations () ()
* Fix wrong permissions check when issues/prs shared operations

* move redirect to the last of the function

* fix swagger

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-20 17:59:33 +02:00
ce756ee89f Check user != nil before checking values () ()
* Check user != nil before checking values

* Handle autoAdmin

Co-authored-by: zeripath <art27@cantab.net>
2020-01-19 22:01:39 -05:00
f2e9d4b851 Allow hyphen in language name () ()
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-19 19:23:35 -05:00
e878d743f4 Ensure that 2fa is checked on reset-password () ()
* Ensure that 2fa is checked on reset-password

* Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Properly manage scratch_code regeneration

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-19 23:21:21 +00:00
3fa14d89a2 [Backport] CI optimisation & add github token env var ()
* ci: use docker image for golangci-lint ()

* ci: re-ordering Drone CI for optimizing time ()

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try offloading mysql8 to arm64

* Revert "ci: try offloading mysql8 to arm64"

This reverts commit c60de5db1cf8b5984c3014a57da6490f06c8d980.

* ci: try offloading pgsql to arm64

* ci: activate ldap on arm64

* ci: test mysql8 in place pgsql arm64

* chore: clean un-needed move

* typo

* ci: revert runnning mysql on arm64

* ci: run compliance on arm

* chore: limit change

* chore: readd maybe need for release fetch-tags

* ci: remove docker-linux-amd64-dry-run

* ci: remove docker-linux-amd64-dry-run

* Revert "ci: remove docker-linux-amd64-dry-run"

This reverts commit 0715f65b11c37869359aaaa5d22901da512e8184.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

* ci: use new mssql image ()

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

* ci: run notify on arm64 ()

* ci: run notify on arm64

Free one jobs on amrd64

* Update .drone.yml

* Update .drone.yml

* Update .drone.yml

Based on: https://github.com/appleboy/drone-discord/blob/master/.drone.yml#L339

* improve trigger

Co-authored-by: techknowlogick <matti@mdranta.net>

* ci: move some integration tests on arm64 ()

* tests: configure github remaining limit + read token ()

* ci: configure remaining github limmit

* prepend with github since package is common to all migrations

* add RefreshRate

* Update github.go

* add missing space

* go fmt

* Read env variable GITHUB_READ_TOKEN for token

* Update .drone.yml

* ci: simplify tag/release by always running coverage ()

* ci: simplify tag/release by always running coverage

* use mod and vendor for unit test coverage

* remove not needed lfs for unit test

* use arm drone agent for docs ()

* run translations pipeline on arm server ()

* add git-check to Makefile

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-19 23:21:54 +01:00
bcb722daec Make CertFile and KeyFile relative to CustomPath () ()
* Make CertFile and KeyFile relative to CustomPath

The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath.

Fix 

* Improve error reporting when reading certificates

* Apply suggestions from code review

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-01-19 19:59:30 +00:00
8add1dfacc Fix issues/pulls dependencies problems () ()
* Fix issues/pulls dependencies problems

* fix swagger and api param name

* fix js
2020-01-19 12:56:57 -05:00
aa6ed1b7c1 Explicitly refer to PR in squash-merge commit message in case of external tracker () ()
* Explicitly refer to PR in squash-merge commit message in case of external tracker

* documentation

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
2020-01-18 22:28:33 +08:00
95cb921097 fix () 2020-01-17 23:31:46 -05:00
6730df9e8c Changelog 1.10.3 () () 2020-01-17 17:02:30 -05:00
b577500a54 Fix markdown anchor links () () 2020-01-17 11:49:50 -05:00
fe46185407 Fix download file wrong content-type () ()
* Fix download file wrong content-type

* change the error text to be more precise

* fix test

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-17 15:11:20 +01:00
69a2a29c33 Fix wrong identify poster on a migrated pull request when submi… () () 2020-01-17 13:38:11 +01:00
f766719895 fix dump non-exist log directory () () 2020-01-17 13:02:41 +08:00
e2ddc42377 Fix compare () ()
Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-17 10:08:28 +08:00
3521177a34 Fix push-to-create () ()
* Fix push-to-create

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Check URL path and service

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Send dummy payload on receive-pack GET

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* The space was actually a NUL byte

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Use real bare repo instead of manufactured payload

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: zeripath <art27@cantab.net>
2020-01-16 07:40:37 +02:00
c8bb0ecf52 Fix missing msteam webhook on organization () () 2020-01-16 03:09:47 +00:00
dbe6136348 Fix missing unlock in uniquequeue () 2020-01-16 01:09:31 +01:00
6d1f7e90cf Fix () Korean locales ()
* backport korean 20-20-01-15 | fix 

* update state 14:43:10 UTC
2020-01-15 11:28:44 -05:00
42663a687c Fix add team on collaborator page when same name as organization () 2020-01-15 14:18:18 +01:00
73c90c26d4 Backport Locales [2020-01-14] ()
* backport state of 2020-01-14

* Apply suggestions from code review

Co-Authored-By: 6543 <6543@obermui.de>

Co-authored-by: zeripath <art27@cantab.net>
2020-01-15 07:03:38 +00:00
c579ad92b5 Fix SimpleMDE quote reply () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-15 03:23:55 +01:00
602c5da953 Fix () ()
Co-authored-by: zeripath <art27@cantab.net>
2020-01-15 01:41:28 +01:00
1980e59ac2 Fix milestones page ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>
2020-01-14 23:33:12 +01:00
28508792ba Fix missing updated time on migrated issues and comments () ()
* Fix missing updated time on migrated issues and comments

* Fix testing and missing updated on migrating pullrequest

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-14 17:55:03 +01:00
3e23dad075 fix webpack polyfills () ()
webpack polyfills did not work because useBuiltIns: 'entry' expects a
explicit core-js import. Changed it to 'usage' which does not require
these explicit imports and polyfills based on browserslist.

As a result, the built index.js now went from 128kB to 192kB.

Ref: https://babeljs.io/docs/en/babel-preset-env#usebuiltins
2020-01-12 17:43:16 -05:00
b13b9d3dbd Move Errored PRs out of StatusChecking () ()
* Move Errored PRs out of StatusChecking ()

* Set Errored PRs out of StatusChecking

* Ensure that api status is correctly set too

* Update models/pull.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update services/pull/check.go

Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>
2020-01-12 20:52:40 +01:00
4072f28e60 Make hook status printing configurable with delay () ()
* Delay printing hook statuses until after 1 second

* Move to a 5s delay, wrapped writer structure and add config

* Update cmd/hook.go

* Apply suggestions from code review

* Update cmd/hook.go

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-12 18:02:36 +00:00
dbeef6bb02 [BugFix] [API] ​/repos​/issues​/search () ()
* fix

* fix options

* add TEST

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-12 10:20:49 +00:00
fec35440db silence fomantic error regarding tabs () ()
Fomantic expects all tabs to have a target element with content as
defined by the data-tab attribute. All our usage of the tab module seems
to use <a> element tabs that link to new pages so these content elements
are never present and fomantic complains about that in the console with
an "Activated tab cannot be found" error. This silences that error.
2020-01-11 23:20:33 -05:00
f8ea50cc7a Remove unused lock () 2020-01-11 19:06:39 +00:00
0e53a16cca Missed q.lock.Unlock() will cause panic () 2020-01-11 17:05:24 +00:00
7eaba6ba8a Never allow an empty password to validate () ()
* Restore IsPasswordSet previous value

* Update models/user.go

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-11 16:27:03 +02:00
ff16099c6d Don't attempt to close issue if already closed () 2020-01-11 01:42:11 -05:00
a516a7ba0f Load milestone in API PR list () () 2020-01-10 22:58:03 -05:00
11bce6fd3d eliminate horizontal scroll caused by footer ()
Co-authored-by: zeripath <art27@cantab.net>
2020-01-10 08:45:59 +08:00
3fb906dc02 remove google font call () () 2020-01-09 16:40:57 -05:00
3a00a690c9 Prevent redirect to Host () () 2020-01-09 16:37:37 -05:00
a2b7cc1bb1 Fix nil reference in repo generation () ()
* Fix nil reference

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Tighten

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-01-09 16:50:21 +00:00
04a77b1f42 Add HTML URL to API Issues () ()
* Add HTML URL to API Issues

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Swagger

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-09 08:07:21 +02:00
f523372d07 Add PR review webhook to Telegram () ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-08 21:42:28 +02:00
e39c238ef4 fix () 2020-01-08 17:32:25 +01:00
3624 changed files with 191769 additions and 461653 deletions
.changelog.yml.drone.yml.editorconfig.eslintignore.eslintrc.gitattributes
.github
.gitignore.golangci.yml.ignore.npmrc.stylelintrcCHANGELOG.mdCONTRIBUTING.mdDockerfileMakefileREADME.mdREADME_ZH.md
assets
build.go
build
cmd
contrib
custom/conf
docker
Makefile
root/etc
s6/gitea
templates
docs
go.modgo.sum
integrations
README.mdapi_branch_test.goapi_comment_test.goapi_gpg_keys_test.goapi_helper_for_declarative_test.goapi_issue_label_test.goapi_issue_subscription_test.goapi_issue_test.goapi_issue_tracked_time_test.goapi_notification_test.goapi_oauth2_apps_test.goapi_org_test.goapi_pull_review_test.goapi_pull_test.goapi_repo_file_create_test.goapi_repo_file_delete_test.goapi_repo_file_update_test.goapi_repo_get_contents_list_test.goapi_repo_get_contents_test.goapi_repo_git_commits_test.goapi_repo_test.goapi_team_test.goattachment_test.goauth_ldap_test.gobranches_test.gocmd_keys_test.goeventsource_test.gogit_helper_for_declarative_test.gogit_test.go
gitea-repositories-meta
integration_test.goissue_test.golfs_getobject_test.go
migration-test
mssql.ini.tmplmysql.ini.tmplmysql8.ini.tmplorg_count_test.gopgsql.ini.tmplprivate-testing.keypull_create_test.gopull_merge_test.gopull_update_test.gorelease_test.gorepo_activity_test.gorepo_test.gorepofiles_update_test.gosqlite.inisqlite.ini.tmplssh_key_test.gotestlogger.go
main.go
models
access.goaccess_test.goaction.goaction_test.goadmin.goattachment.goavatar.gobranches.gocommit_status.goconsistency.gocontext.goerror.goexternal_login_user.gofixture_generation.gofixture_test.go
fixtures
gpg_key.gohelper_environment.goissue.goissue_assignees.goissue_comment.goissue_label.goissue_label_test.goissue_list.goissue_list_test.goissue_milestone.goissue_milestone_test.goissue_reaction.goissue_reaction_test.goissue_stopwatch.goissue_stopwatch_test.goissue_test.goissue_tracked_time.goissue_user_test.goissue_watch.goissue_watch_test.golfs.golist_options.golog.gologin_source.gomain_test.gomigrate.go
migrations
models.gonotification.gonotification_test.gooauth2.gooauth2_application.goorg.goorg_team.goorg_team_test.goorg_test.gopull.gopull_list.gopull_sign.gopull_test.gorelease.gorepo.gorepo_activity.gorepo_branch.gorepo_collaboration.gorepo_collaboration_test.gorepo_generate.gorepo_indexer.gorepo_language_stats.gorepo_list.gorepo_list_test.gorepo_permission.gorepo_sign.gorepo_test.gorepo_unit.gorepo_watch.gorepo_watch_test.goreview.goreview_test.gossh_key.gostar.gostar_test.gotask.gotest_fixtures.gotoken.gotoken_test.gotopic.gotopic_test.gotwofactor.gou2f_test.gounit.gounit_tests.goupdate.goupdate_test.goupload.gouser.gouser_follow_test.gouser_heatmap_test.gouser_mail.gouser_mail_test.gouser_openid.gouser_test.gouserlist.gowebhook.gowebhook_test.gowiki.go
modules
analyze
auth
base
cache
context
convert
cron
emoji
eventsource
generate
git
graceful
indexer
lfs
log
markup
migrations
notification
options
private
process
public
queue
references
repofiles
repository
session
setting
ssh
structs
task
templates
test
timeutil
user
util
validation
webhook
options/locale
package-lock.jsonpackage.json
public
img
vendor
VERSIONS
assets
lato-fonts
noto-color-emoji
octicons
roboto-fonts
swagger-ui
librejs.html
plugins
clipboard
cssrelpreload
dropzone
emojify
LICENSEemojify.custom.js
images
+1.png-1.png100.png1234.png8ball.pnga.pngab.pngabc.pngabcd.pngaccept.pngaerial_tramway.pngairplane.pngalarm_clock.pngalien.pngambulance.pnganchor.pngangel.pnganger.pngangry.pnganguished.pngant.pngapple.pngaquarius.pngaries.pngarrow_backward.pngarrow_double_down.pngarrow_double_up.pngarrow_down.pngarrow_down_small.pngarrow_forward.pngarrow_heading_down.pngarrow_heading_up.pngarrow_left.pngarrow_lower_left.pngarrow_lower_right.pngarrow_right.pngarrow_right_hook.pngarrow_up.pngarrow_up_down.pngarrow_up_small.pngarrow_upper_left.pngarrow_upper_right.pngarrows_clockwise.pngarrows_counterclockwise.pngart.pngarticulated_lorry.pngastonished.pngatm.pngb.pngbaby.pngbaby_bottle.pngbaby_chick.pngbaby_symbol.pngback.pngbaggage_claim.pngballoon.pngballot_box_with_check.pngbamboo.pngbanana.pngbangbang.pngbank.pngbar_chart.pngbarber.pngbaseball.pngbasketball.pngbath.pngbathtub.pngbattery.pngbear.pngbee.pngbeer.pngbeers.pngbeetle.pngbeginner.pngbell.pngbento.pngbicyclist.pngbike.pngbikini.pngbird.pngbirthday.pngblack_circle.pngblack_joker.pngblack_medium_small_square.pngblack_medium_square.pngblack_nib.pngblack_small_square.pngblack_square.pngblack_square_button.pngblossom.pngblowfish.pngblue_book.pngblue_car.pngblue_heart.pngblush.pngboar.pngboat.pngbomb.pngbook.pngbookmark.pngbookmark_tabs.pngbooks.pngboom.pngboot.pngbouquet.pngbow.pngbowling.pngbowtie.pngboy.pngbread.pngbride_with_veil.pngbridge_at_night.pngbriefcase.pngbroken_heart.pngbug.pngbulb.pngbullettrain_front.pngbullettrain_side.pngbus.pngbusstop.pngbust_in_silhouette.pngbusts_in_silhouette.pngcactus.pngcake.pngcalendar.pngcalling.pngcamel.pngcamera.pngcancer.pngcandy.pngcapital_abcd.pngcapricorn.pngcar.pngcard_index.pngcarousel_horse.pngcat.pngcat2.pngcd.pngchart.pngchart_with_downwards_trend.pngchart_with_upwards_trend.pngcheckered_flag.pngcherries.pngcherry_blossom.pngchestnut.pngchicken.pngchildren_crossing.pngchocolate_bar.pngchristmas_tree.pngchurch.pngcinema.pngcircus_tent.pngcity_sunrise.pngcity_sunset.pngcl.pngclap.pngclapper.pngclipboard.pngclock1.pngclock10.pngclock1030.pngclock11.pngclock1130.pngclock12.pngclock1230.pngclock130.pngclock2.pngclock230.pngclock3.pngclock330.pngclock4.pngclock430.pngclock5.pngclock530.pngclock6.pngclock630.pngclock7.pngclock730.pngclock8.pngclock830.pngclock9.pngclock930.pngclosed_book.pngclosed_lock_with_key.pngclosed_umbrella.pngcloud.pngclubs.pngcn.pngcocktail.pngcoffee.pngcold_sweat.pngcollision.pngcomputer.pngconfetti_ball.pngconfounded.pngconfused.pngcongratulations.pngconstruction.pngconstruction_worker.pngconvenience_store.pngcookie.pngcool.pngcop.pngcopyright.pngcorn.pngcouple.pngcouple_with_heart.pngcouplekiss.pngcow.pngcow2.pngcredit_card.pngcrescent_moon.pngcrocodile.pngcrossed_flags.pngcrown.pngcry.pngcrying_cat_face.pngcrystal_ball.pngcupid.pngcurly_loop.pngcurrency_exchange.pngcurry.pngcustard.pngcustoms.pngcyclone.pngdancer.pngdancers.pngdango.pngdart.pngdash.pngdate.pngde.pngdeciduous_tree.pngdepartment_store.pngdiamond_shape_with_a_dot_inside.pngdiamonds.pngdisappointed.pngdisappointed_relieved.pngdizzy.pngdizzy_face.pngdo_not_litter.pngdog.pngdog2.pngdollar.pngdolls.pngdolphin.pngdonut.pngdoor.pngdoughnut.pngdragon.pngdragon_face.pngdress.pngdromedary_camel.pngdroplet.pngdvd.pnge-mail.pngear.pngear_of_rice.pngearth_africa.pngearth_americas.pngearth_asia.pngegg.pngeggplant.pngeight.pngeight_pointed_black_star.pngeight_spoked_asterisk.pngelectric_plug.pngelephant.pngemail.pngend.pngenvelope.pnges.pngeuro.pngeuropean_castle.pngeuropean_post_office.pngevergreen_tree.pngexclamation.pngexpressionless.pngeyeglasses.pngeyes.pngfacepunch.pngfactory.pngfallen_leaf.pngfamily.pngfast_forward.pngfax.pngfearful.pngfeelsgood.pngfeet.pngferris_wheel.pngfile_folder.pngfinnadie.pngfire.pngfire_engine.pngfireworks.pngfirst_quarter_moon.pngfirst_quarter_moon_with_face.pngfish.pngfish_cake.pngfishing_pole_and_fish.pngfist.pngfive.pngflags.pngflashlight.pngfloppy_disk.pngflower_playing_cards.pngflushed.pngfoggy.pngfootball.pngfork_and_knife.pngfountain.pngfour.pngfour_leaf_clover.pngfr.pngfree.pngfried_shrimp.pngfries.pngfrog.pngfrowning.pngfu.pngfuelpump.pngfull_moon.pngfull_moon_with_face.pnggame_die.pnggb.pnggem.pnggemini.pngghost.pnggift.pnggift_heart.pnggirl.pnggitea.pngglobe_with_meridians.pnggoat.pnggoberserk.pnggodmode.pnggolf.pnggrapes.pnggreen_apple.pnggreen_book.pnggreen_heart.pnggrey_exclamation.pnggrey_question.pnggrimacing.pnggrin.pnggrinning.pngguardsman.pngguitar.pnggun.pnghaircut.pnghamburger.pnghammer.pnghamster.pnghand.pnghandbag.pnghankey.pnghash.pnghatched_chick.pnghatching_chick.pngheadphones.pnghear_no_evil.pngheart.pngheart_decoration.pngheart_eyes.pngheart_eyes_cat.pngheartbeat.pngheartpulse.pnghearts.pngheavy_check_mark.pngheavy_division_sign.pngheavy_dollar_sign.pngheavy_exclamation_mark.pngheavy_minus_sign.pngheavy_multiplication_x.pngheavy_plus_sign.pnghelicopter.pngherb.pnghibiscus.pnghigh_brightness.pnghigh_heel.pnghocho.pnghoney_pot.pnghoneybee.pnghorse.pnghorse_racing.pnghospital.pnghotel.pnghotsprings.pnghourglass.pnghourglass_flowing_sand.pnghouse.pnghouse_with_garden.pnghurtrealbad.pnghushed.pngice_cream.pngicecream.pngid.pngideograph_advantage.pngimp.pnginbox_tray.pngincoming_envelope.pnginformation_desk_person.pnginformation_source.pnginnocent.pnginterrobang.pngiphone.pngit.pngizakaya_lantern.pngjack_o_lantern.pngjapan.pngjapanese_castle.pngjapanese_goblin.pngjapanese_ogre.pngjeans.pngjoy.pngjoy_cat.pngjp.pngkey.pngkeycap_ten.pngkimono.pngkiss.pngkissing.pngkissing_cat.pngkissing_closed_eyes.pngkissing_face.pngkissing_heart.pngkissing_smiling_eyes.pngkoala.pngkoko.pngkr.pnglarge_blue_circle.pnglarge_blue_diamond.pnglarge_orange_diamond.pnglast_quarter_moon.pnglast_quarter_moon_with_face.pnglaughing.pngleaves.pngledger.pngleft_luggage.pngleft_right_arrow.pngleftwards_arrow_with_hook.pnglemon.pngleo.pngleopard.pnglibra.pnglight_rail.pnglink.pnglips.pnglipstick.pnglock.pnglock_with_ink_pen.pnglollipop.pngloop.pngloudspeaker.pnglove_hotel.pnglove_letter.pnglow_brightness.pngm.pngmag.pngmag_right.pngmahjong.pngmailbox.pngmailbox_closed.pngmailbox_with_mail.pngmailbox_with_no_mail.pngman.pngman_with_gua_pi_mao.pngman_with_turban.pngmans_shoe.pngmaple_leaf.pngmask.pngmassage.pngmeat_on_bone.pngmega.pngmelon.pngmemo.pngmens.pngmetal.pngmetro.pngmicrophone.pngmicroscope.pngmilky_way.pngminibus.pngminidisc.pngmobile_phone_off.pngmoney_with_wings.pngmoneybag.pngmonkey.pngmonkey_face.pngmonorail.pngmortar_board.pngmount_fuji.pngmountain_bicyclist.pngmountain_cableway.pngmountain_railway.pngmouse.pngmouse2.pngmovie_camera.pngmoyai.pngmuscle.pngmushroom.pngmusical_keyboard.pngmusical_note.pngmusical_score.pngmute.pngnail_care.pngname_badge.pngneckbeard.pngnecktie.pngnegative_squared_cross_mark.pngneutral_face.pngnew.pngnew_moon.pngnew_moon_with_face.pngnewspaper.pngng.pngnine.pngno_bell.pngno_bicycles.pngno_entry.pngno_entry_sign.pngno_good.pngno_mobile_phones.pngno_mouth.pngno_pedestrians.pngno_smoking.pngnon-potable_water.pngnose.pngnotebook.pngnotebook_with_decorative_cover.pngnotes.pngnut_and_bolt.pngo.pngo2.pngocean.pngoctocat.pngoctopus.pngoden.pngoffice.pngok.pngok_hand.pngok_woman.pngolder_man.pngolder_woman.pngon.pngoncoming_automobile.pngoncoming_bus.pngoncoming_police_car.pngoncoming_taxi.pngone.pngopen_file_folder.pngopen_hands.pngopen_mouth.pngophiuchus.pngorange_book.pngoutbox_tray.pngox.pngpackage.pngpage_facing_up.pngpage_with_curl.pngpager.pngpalm_tree.pngpanda_face.pngpaperclip.pngparking.pngpart_alternation_mark.pngpartly_sunny.pngpassport_control.pngpaw_prints.pngpeach.pngpear.pngpencil.pngpencil2.pngpenguin.pngpensive.pngperforming_arts.pngpersevere.pngperson_frowning.pngperson_with_blond_hair.pngperson_with_pouting_face.pngphone.pngpig.pngpig2.pngpig_nose.pngpill.pngpineapple.pngpisces.pngpizza.pngplus1.pngpoint_down.pngpoint_left.pngpoint_right.pngpoint_up.pngpoint_up_2.pngpolice_car.pngpoodle.pngpoop.pngpost_office.pngpostal_horn.pngpostbox.pngpotable_water.pngpouch.pngpoultry_leg.pngpound.pngpouting_cat.pngpray.pngprincess.pngpunch.pngpurple_heart.pngpurse.pngpushpin.pngput_litter_in_its_place.pngquestion.pngrabbit.pngrabbit2.pngracehorse.pngradio.pngradio_button.pngrage.pngrage1.pngrage2.pngrage3.pngrage4.pngrailway_car.pngrainbow.pngraised_hand.pngraised_hands.pngraising_hand.pngram.pngramen.pngrat.pngrecycle.pngred_car.pngred_circle.pngregistered.pngrelaxed.pngrelieved.pngrepeat.pngrepeat_one.pngrestroom.pngrevolving_hearts.pngrewind.pngribbon.pngrice.pngrice_ball.pngrice_cracker.pngrice_scene.pngring.pngrocket.pngroller_coaster.pngrooster.pngrose.pngrotating_light.pnground_pushpin.pngrowboat.pngru.pngrugby_football.pngrunner.pngrunning.pngrunning_shirt_with_sash.pngsa.pngsagittarius.pngsailboat.pngsake.pngsandal.pngsanta.pngsatellite.pngsatisfied.pngsaxophone.pngschool.pngschool_satchel.pngscissors.pngscorpius.pngscream.pngscream_cat.pngscroll.pngseat.pngsecret.pngsee_no_evil.pngseedling.pngseven.pngshaved_ice.pngsheep.pngshell.pngship.pngshipit.pngshirt.pngshit.pngshoe.pngshower.pngsignal_strength.pngsix.pngsix_pointed_star.pngski.pngskull.pngsleeping.pngsleepy.pngslot_machine.pngsmall_blue_diamond.pngsmall_orange_diamond.pngsmall_red_triangle.pngsmall_red_triangle_down.pngsmile.pngsmile_cat.pngsmiley.pngsmiley_cat.pngsmiling_imp.pngsmirk.pngsmirk_cat.pngsmoking.pngsnail.pngsnake.pngsnowboarder.pngsnowflake.pngsnowman.pngsob.pngsoccer.pngsoon.pngsos.pngsound.pngspace_invader.pngspades.pngspaghetti.pngsparkle.pngsparkler.pngsparkles.pngsparkling_heart.pngspeak_no_evil.pngspeaker.pngspeech_balloon.pngspeedboat.pngsquirrel.pngstar.pngstar2.pngstars.pngstation.pngstatue_of_liberty.pngsteam_locomotive.pngstew.pngstraight_ruler.pngstrawberry.pngstuck_out_tongue.pngstuck_out_tongue_closed_eyes.pngstuck_out_tongue_winking_eye.pngsun_with_face.pngsunflower.pngsunglasses.pngsunny.pngsunrise.pngsunrise_over_mountains.pngsurfer.pngsushi.pngsuspect.pngsuspension_railway.pngsweat.pngsweat_drops.pngsweat_smile.pngsweet_potato.pngswimmer.pngsymbols.pngsyringe.pngtada.pngtanabata_tree.pngtangerine.pngtaurus.pngtaxi.pngtea.pngtelephone.pngtelephone_receiver.pngtelescope.pngtennis.pngtent.pngthought_balloon.pngthree.pngthumbsdown.pngthumbsup.pngticket.pngtiger.pngtiger2.pngtired_face.pngtm.pngtoilet.pngtokyo_tower.pngtomato.pngtongue.pngtop.pngtophat.pngtractor.pngtraffic_light.pngtrain.pngtrain2.pngtram.pngtriangular_flag_on_post.pngtriangular_ruler.pngtrident.pngtriumph.pngtrolleybus.pngtrollface.pngtrophy.pngtropical_drink.pngtropical_fish.pngtruck.pngtrumpet.pngtshirt.pngtulip.pngturtle.pngtv.pngtwisted_rightwards_arrows.pngtwo.pngtwo_hearts.pngtwo_men_holding_hands.pngtwo_women_holding_hands.pngu5272.pngu5408.pngu55b6.pngu6307.pngu6708.pngu6709.pngu6e80.pngu7121.pngu7533.pngu7981.pngu7a7a.pnguk.pngumbrella.pngunamused.pngunderage.pngunlock.pngup.pngus.pngv.pngvertical_traffic_light.pngvhs.pngvibration_mode.pngvideo_camera.pngvideo_game.pngviolin.pngvirgo.pngvolcano.pngvs.pngwalking.pngwaning_crescent_moon.pngwaning_gibbous_moon.pngwarning.pngwatch.pngwater_buffalo.pngwatermelon.pngwave.pngwavy_dash.pngwaxing_crescent_moon.pngwaxing_gibbous_moon.pngwc.pngweary.pngwedding.pngwhale.pngwhale2.pngwheelchair.pngwhite_check_mark.pngwhite_circle.pngwhite_flower.pngwhite_large_square.pngwhite_medium_small_square.pngwhite_medium_square.pngwhite_small_square.pngwhite_square_button.pngwind_chime.pngwine_glass.pngwink.pngwolf.pngwoman.pngwomans_clothes.pngwomans_hat.pngwomens.pngworried.pngwrench.pngx.pngyellow_heart.pngyen.pngyum.pngzap.pngzero.pngzzz.png
fomantic
highlight
jquery-migrate
jquery.areyousure
jquery.datetimepicker
jquery
moment
promise-polyfill
vue-calendar-heatmap
vue
routers
scripts
semantic.json
services
snap
templates
admin
base
explore
home.tmplinstall.tmpl
mail/issue
org
pwa
repo
status
swagger
user
tools.go
vendor
gitea.com
github.com
RoaringBitmap/roaring
aymerick/douceur
blevesearch
boombuler/barcode
chris-ramon/douceur
couchbase/vellum
denisenkom/go-mssqldb
dustin/go-humanize
edsrzf/mmap-go
etcd-io/bbolt
fatih
go-enry
go-git/go-git/v5
golang/protobuf/proto
google
go-github
v24
v32
uuid
gorilla/css
hashicorp
huandu/xstrings
imdario/mergo
issue9/identicon
keybase/go-crypto
klauspost/compress
mailru/easyjson
markbates/goth/providers
mattn
mgechev
microcosm-cc/bluemonday
mschoch/smat
niklasfasching/go-org/org
olekukonko/tablewriter
olivere/elastic/v7
.fossa.yml.gitignore.travis.ymlCHANGELOG-3.0.mdCHANGELOG-5.0.mdCHANGELOG-6.0.mdCHANGELOG-7.0.mdCODE_OF_CONDUCT.mdCONTRIBUTING.mdCONTRIBUTORSISSUE_TEMPLATE.mdLICENSEREADME.mdacknowledged_response.gobackoff.gobulk.gobulk_delete_request.gobulk_delete_request_easyjson.gobulk_index_request.gobulk_index_request_easyjson.gobulk_processor.gobulk_request.gobulk_update_request.gobulk_update_request_easyjson.gocanonicalize.gocat_aliases.gocat_allocation.gocat_count.gocat_health.gocat_indices.goclear_scroll.goclient.gocluster_health.gocluster_reroute.gocluster_state.gocluster_stats.go
config
connection.gocount.godecoder.godelete.godelete_by_query.godoc.godocker-compose.ymldocvalue_field.goerrors.goexists.goexplain.gofetch_source_context.gofield_caps.gogeo_point.goget.gogo.modhighlight.goindex.goindices_analyze.goindices_close.goindices_create.goindices_delete.goindices_delete_template.goindices_exists.goindices_exists_template.goindices_flush.goindices_flush_synced.goindices_forcemerge.goindices_freeze.goindices_get.goindices_get_aliases.goindices_get_field_mapping.goindices_get_mapping.goindices_get_settings.goindices_get_template.goindices_open.goindices_put_alias.goindices_put_mapping.goindices_put_settings.goindices_put_template.goindices_refresh.goindices_rollover.goindices_segments.goindices_shrink.goindices_stats.goindices_unfreeze.goingest_delete_pipeline.goingest_get_pipeline.goingest_put_pipeline.goingest_simulate_pipeline.goinner_hit.gologger.gomget.gomsearch.gomtermvectors.gonodes_info.gonodes_stats.goping.goplugins.goquery.goreindex.gorequest.gorescore.gorescorer.goresponse.goretrier.goretry.gorun-es.shrun-tests.shscript.goscript_delete.goscript_get.goscript_put.goscroll.gosearch.gosearch_aggs.gosearch_aggs_bucket_adjacency_matrix.gosearch_aggs_bucket_auto_date_histogram.gosearch_aggs_bucket_children.gosearch_aggs_bucket_composite.gosearch_aggs_bucket_count_thresholds.gosearch_aggs_bucket_date_histogram.gosearch_aggs_bucket_date_range.gosearch_aggs_bucket_diversified_sampler.gosearch_aggs_bucket_filter.gosearch_aggs_bucket_filters.gosearch_aggs_bucket_geo_distance.gosearch_aggs_bucket_geohash_grid.gosearch_aggs_bucket_global.gosearch_aggs_bucket_histogram.gosearch_aggs_bucket_ip_range.gosearch_aggs_bucket_missing.gosearch_aggs_bucket_nested.gosearch_aggs_bucket_range.gosearch_aggs_bucket_reverse_nested.gosearch_aggs_bucket_sampler.gosearch_aggs_bucket_significant_terms.gosearch_aggs_bucket_significant_text.gosearch_aggs_bucket_terms.gosearch_aggs_matrix_stats.gosearch_aggs_metrics_avg.gosearch_aggs_metrics_cardinality.gosearch_aggs_metrics_extended_stats.gosearch_aggs_metrics_geo_bounds.gosearch_aggs_metrics_geo_centroid.gosearch_aggs_metrics_max.gosearch_aggs_metrics_min.gosearch_aggs_metrics_percentile_ranks.gosearch_aggs_metrics_percentiles.gosearch_aggs_metrics_scripted_metric.gosearch_aggs_metrics_stats.gosearch_aggs_metrics_sum.gosearch_aggs_metrics_top_hits.gosearch_aggs_metrics_value_count.gosearch_aggs_metrics_weighted_avg.gosearch_aggs_pipeline_avg_bucket.gosearch_aggs_pipeline_bucket_script.gosearch_aggs_pipeline_bucket_selector.gosearch_aggs_pipeline_bucket_sort.gosearch_aggs_pipeline_cumulative_sum.gosearch_aggs_pipeline_derivative.gosearch_aggs_pipeline_extended_stats_bucket.gosearch_aggs_pipeline_max_bucket.gosearch_aggs_pipeline_min_bucket.gosearch_aggs_pipeline_mov_avg.gosearch_aggs_pipeline_mov_fn.gosearch_aggs_pipeline_percentiles_bucket.gosearch_aggs_pipeline_serial_diff.gosearch_aggs_pipeline_stats_bucket.gosearch_aggs_pipeline_sum_bucket.gosearch_collapse_builder.gosearch_queries_bool.gosearch_queries_boosting.gosearch_queries_common_terms.gosearch_queries_constant_score.gosearch_queries_dis_max.gosearch_queries_distance_feature_query.gosearch_queries_exists.gosearch_queries_fsq.gosearch_queries_fsq_score_funcs.gosearch_queries_fuzzy.gosearch_queries_geo_bounding_box.gosearch_queries_geo_distance.gosearch_queries_geo_polygon.gosearch_queries_has_child.gosearch_queries_has_parent.gosearch_queries_ids.gosearch_queries_match.gosearch_queries_match_all.gosearch_queries_match_none.gosearch_queries_match_phrase.gosearch_queries_match_phrase_prefix.gosearch_queries_more_like_this.gosearch_queries_multi_match.gosearch_queries_nested.gosearch_queries_parent_id.gosearch_queries_percolator.gosearch_queries_prefix.gosearch_queries_query_string.gosearch_queries_range.gosearch_queries_raw_string.gosearch_queries_regexp.gosearch_queries_script.gosearch_queries_script_score.gosearch_queries_simple_query_string.gosearch_queries_slice.gosearch_queries_term.gosearch_queries_terms.gosearch_queries_terms_set.gosearch_queries_type.gosearch_queries_wildcard.gosearch_queries_wrapper.gosearch_request.gosearch_shards.gosearch_source.gosearch_terms_lookup.gosnapshot_create.gosnapshot_create_repository.gosnapshot_delete.gosnapshot_delete_repository.gosnapshot_get.gosnapshot_get_repository.gosnapshot_restore.gosnapshot_verify_repository.gosort.gosuggest_field.gosuggester.gosuggester_completion.gosuggester_context.gosuggester_context_category.gosuggester_context_geo.gosuggester_phrase.gosuggester_term.gotasks_cancel.gotasks_get_task.gotasks_list.gotermvectors.goupdate.goupdate_by_query.go
uritemplates
validate.goxpack_ilm_delete_lifecycle.goxpack_ilm_get_lifecycle.goxpack_ilm_put_lifecycle.goxpack_info.goxpack_security_change_password.goxpack_security_delete_role.goxpack_security_delete_role_mapping.goxpack_security_delete_user.goxpack_security_disable_user.goxpack_security_enable_user.goxpack_security_get_role.goxpack_security_get_role_mapping.goxpack_security_get_user.goxpack_security_put_role.goxpack_security_put_role_mapping.goxpack_security_put_user.goxpack_watcher_ack_watch.goxpack_watcher_activate_watch.goxpack_watcher_deactivate_watch.goxpack_watcher_delete_watch.goxpack_watcher_execute_watch.goxpack_watcher_get_watch.goxpack_watcher_put_watch.goxpack_watcher_start.goxpack_watcher_stats.goxpack_watcher_stop.go
pkg/errors
pquerna/otp
satori/go.uuid
steveyen/gtreap
tinylib/msgp/msgp
xanzy/go-gitlab
yohcop/openid-go
yuin
go.etcd.io/bbolt
golang.org/x
crypto
mod
oauth2
sys
cpu
internal/unsafeheader
unix
README.mderrors_freebsd_386.goerrors_freebsd_amd64.goerrors_freebsd_arm64.gomkall.shmkerrors.shsyscall_darwin.1_13.gosyscall_darwin.gosyscall_darwin_386.gosyscall_darwin_amd64.gosyscall_darwin_arm.gosyscall_darwin_arm64.gosyscall_freebsd.gosyscall_freebsd_386.gosyscall_freebsd_amd64.gosyscall_illumos.gosyscall_linux.gosyscall_linux_386.gosyscall_linux_amd64.gosyscall_linux_arm.gosyscall_linux_arm64.gosyscall_linux_mips64x.gosyscall_linux_mipsx.gosyscall_linux_ppc64x.gosyscall_linux_riscv64.gosyscall_linux_s390x.gosyscall_linux_sparc64.gosyscall_unix.gozerrors_freebsd_386.gozerrors_freebsd_amd64.gozerrors_freebsd_arm.gozerrors_freebsd_arm64.gozerrors_linux.gozerrors_linux_386.gozerrors_linux_amd64.gozerrors_linux_arm.gozerrors_linux_arm64.gozerrors_linux_mips.gozerrors_linux_mips64.gozerrors_linux_mips64le.gozerrors_linux_mipsle.gozerrors_linux_ppc64.gozerrors_linux_ppc64le.gozerrors_linux_riscv64.gozerrors_linux_s390x.gozerrors_linux_sparc64.gozsyscall_darwin_386.1_11.gozsyscall_darwin_386.gozsyscall_darwin_amd64.1_11.gozsyscall_darwin_amd64.gozsyscall_darwin_arm.1_11.gozsyscall_darwin_arm.gozsyscall_darwin_arm64.1_11.gozsyscall_darwin_arm64.gozsyscall_freebsd_386.gozsyscall_freebsd_amd64.gozsyscall_freebsd_arm64.gozsyscall_illumos_amd64.gozsyscall_linux.gozsyscall_linux_386.gozsyscall_linux_amd64.gozsyscall_linux_arm.gozsyscall_linux_arm64.gozsyscall_linux_mips.gozsyscall_linux_mips64.gozsyscall_linux_mips64le.gozsyscall_linux_mipsle.gozsyscall_linux_ppc64.gozsyscall_linux_ppc64le.gozsyscall_linux_s390x.gozsyscall_linux_sparc64.gozsysctl_openbsd_386.gozsysctl_openbsd_amd64.gozsysctl_openbsd_arm.gozsysnum_linux_386.gozsysnum_linux_amd64.gozsysnum_linux_arm.gozsysnum_linux_arm64.gozsysnum_linux_mips.gozsysnum_linux_mips64.gozsysnum_linux_mips64le.gozsysnum_linux_mipsle.gozsysnum_linux_ppc64.gozsysnum_linux_ppc64le.gozsysnum_linux_riscv64.gozsysnum_linux_s390x.gozsysnum_linux_sparc64.goztypes_freebsd_386.goztypes_freebsd_amd64.goztypes_freebsd_arm64.goztypes_linux.goztypes_linux_386.goztypes_linux_amd64.goztypes_linux_arm.goztypes_linux_arm64.goztypes_linux_mips.goztypes_linux_mips64.goztypes_linux_mips64le.goztypes_linux_mipsle.goztypes_linux_ppc64.goztypes_linux_ppc64le.goztypes_linux_riscv64.goztypes_linux_s390x.goztypes_linux_sparc64.go
windows
time
tools
xerrors
google.golang.org
appengine
protobuf
AUTHORSCONTRIBUTORSLICENSEPATENTS
encoding
internal
proto
reflect
runtime
gopkg.in
modules.txt
xorm.io
builder
core
xorm
.changelog.yml.drone.yml.gitignore.revive.tomlCHANGELOG.mdCONTRIBUTING.mdMakefileREADME.mdREADME_CN.mdcache_lru.gocache_memory_store.go
caches
context_cache.goconvert.go
convert
core
dialect_mssql.godialect_mysql.godialect_oracle.godialect_postgres.godialect_sqlite3.go
dialects
doc.goengine.goengine_cond.goengine_context.goengine_group.goengine_table.goerror.gogen_reserved.shgo.modgo.sumhelpers.gohelpler_time.gointerface.go
internal
json.go
log
logger.go
names
pg_reserved.txtrows.go
schemas
session.gosession_cols.gosession_cond.gosession_context.gosession_convert.gosession_delete.gosession_exist.gosession_find.gosession_get.gosession_insert.gosession_iterate.gosession_query.gosession_raw.gosession_schema.gosession_stats.gosession_tx.gosession_update.gostatement.gostatement_args.gostatement_columnmap.gostatement_exprparam.gostatement_quote.gosyslogger.gotag.go
tags
test_mssql.shtest_mssql_cache.shtest_mymysql.shtest_mymysql_cache.shtest_mysql.shtest_mysql_cache.shtest_postgres.shtest_postgres_cache.shtest_sqlite.shtest_sqlite_cache.shtest_tidb.shtransaction.gotypes.goxorm.go
web_src
webpack.config.js

@ -15,7 +15,7 @@ groups:
labels:
- kind/breaking
-
name: FEATURES
name: FEATURE
labels:
- kind/feature
-
@ -27,7 +27,7 @@ groups:
labels:
- kind/bug
-
name: ENHANCEMENTS
name: ENHANCEMENT
labels:
- kind/enhancement
- kind/refactor

File diff suppressed because it is too large Load Diff

@ -1,3 +1,4 @@
# http://editorconfig.org
root = true
[*]
@ -6,18 +7,23 @@ insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
[*.md]
trim_trailing_whitespace = false
[*.go]
indent_style = tab
indent_size = 8
[*.{go,tmpl,html}]
[*.{tmpl,html}]
indent_style = tab
indent_size = 4
[*.{less,css}]
[*.less]
indent_style = space
indent_size = 4
[*.{js,json,yml}]
[*.{yml,json}]
indent_style = space
indent_size = 2
[*.js]
indent_style = space
indent_size = 2

1
.eslintignore Normal file

@ -0,0 +1 @@
/web_src/js/semanticDropdown.js

@ -4,9 +4,6 @@ extends:
- eslint-config-airbnb-base
- eslint:recommended
ignorePatterns:
- /web_src/js/vendor
parserOptions:
ecmaVersion: 2020
@ -18,57 +15,39 @@ env:
globals:
__webpack_public_path__: true
Clipboard: false
CodeMirror: false
Dropzone: false
emojify: false
hljs: false
SimpleMDE: false
u2fApi: false
Tribute: false
overrides:
- files: ["web_src/**/*worker.js"]
env:
worker: true
rules:
no-restricted-globals: [0]
Vue: false
rules:
arrow-body-style: [0]
arrow-parens: [2, always]
camelcase: [0]
comma-dangle: [2, only-multiline]
consistent-return: [0]
default-case: [0]
func-names: [0]
import/extensions: [2, always, {ignorePackages: true}]
import/prefer-default-export: [0]
import/extensions: [0]
max-len: [0]
multiline-comment-style: [2, separate-lines]
newline-per-chained-call: [0]
no-alert: [0]
no-cond-assign: [2, except-parens]
no-console: [1, {allow: [info, warn, error]}]
no-continue: [0]
no-empty: [2, {allowEmptyCatch: true}]
no-eq-null: [2]
no-mixed-operators: [0]
no-multi-assign: [0]
no-new: [0]
no-param-reassign: [0]
no-plusplus: [0]
no-restricted-syntax: [0]
no-return-await: [0]
no-shadow: [0]
no-underscore-dangle: [0]
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
no-use-before-define: [0]
no-var: [2]
object-curly-newline: [0]
object-curly-spacing: [2, never]
one-var-declaration-per-line: [0]
one-var: [0]
operator-linebreak: [2, after]
prefer-const: [2, {destructuring: all}]
prefer-destructuring: [0]
quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
radix: [2, as-needed]
semi: [2, always, {omitLastInOneLineBlock: true}]

5
.gitattributes vendored

@ -1,10 +1,7 @@
* text=auto eol=lf
/vendor/** -text -eol
/public/vendor/** -text -eol
conf/* linguist-vendored
docker/* linguist-vendored
options/* linguist-vendored
public/* linguist-vendored
build/* linguist-vendored
scripts/* linguist-vendored
templates/* linguist-vendored

9
.github/stale.yml vendored

@ -27,11 +27,9 @@ staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had recent activity.
I am here to help clear issues left open even if solved or waiting for more insight.
This issue will be closed if no further activity occurs during the next 2 weeks.
If the issue is still valid just add a comment to keep it alive.
Thank you for your contributions.
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you
for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
@ -52,3 +50,4 @@ pulls:
closeComment: >
This pull request has been automatically closed because of inactivity.
You can re-open it if needed.

17
.gitignore vendored

@ -34,26 +34,19 @@ _testmain.go
coverage.all
/modules/options/bindata.go
/modules/options/bindata.go.hash
/modules/public/bindata.go
/modules/public/bindata.go.hash
/modules/templates/bindata.go
/modules/templates/bindata.go.hash
*.db
*.log
/gitea
/gitea-vet
/debug
/integrations.test
/bin
/dist
/custom/*
!/custom/conf
/custom/conf/*
!/custom/conf/app.ini.sample
/custom
/data
/indexers
/log
@ -68,7 +61,6 @@ coverage.all
/integrations/indexers-pgsql
/integrations/indexers-sqlite
/integrations/indexers-mssql
/integrations/sqlite.ini
/integrations/mysql.ini
/integrations/mysql8.ini
/integrations/pgsql.ini
@ -76,11 +68,7 @@ coverage.all
/node_modules
/yarn.lock
/public/js
/public/serviceworker.js
/public/css
/public/fonts
/public/fomantic
/public/img/svg
/VERSION
# Snapcraft
@ -92,6 +80,3 @@ prime/
*.snap-build
*_source.tar.bz2
.DS_Store
# Make evidence files
/.make_evidence

@ -95,6 +95,3 @@ issues:
- linters:
- misspell
text: '`Unknwon` is a misspelling of `Unknown`'
- path: models/update.go
linters:
- unused

@ -1,6 +1,5 @@
/vendor
/public/vendor/plugins
/public/vendor/assets
/public/vendor
/modules/options/bindata.go
/modules/public/bindata.go
/modules/templates/bindata.go

1
.npmrc

@ -1,2 +1 @@
package-lock=true
save-exact=true

@ -1,16 +1,11 @@
extends: stylelint-config-standard
ignoreFiles:
- web_src/less/vendor/**/*
rules:
at-rule-empty-line-before: null
block-closing-brace-empty-line-before: null
color-hex-length: null
comment-empty-line-before: null
declaration-empty-line-before: null
indentation: 4
no-descending-specificity: null
number-leading-zero: never
rule-empty-line-before: null
selector-pseudo-element-colon-notation: null

File diff suppressed because it is too large Load Diff

@ -71,21 +71,23 @@ to make sure your changes don't cause regression elsewhere.
Here's how to run the test suite:
- code lint
- Install the correct version of the drone-cli package. As of this
writing, the correct drone-cli version is
[1.2.0](https://docs.drone.io/cli/install/).
- Ensure you have enough free disk space. You will need at least
15-20 Gb of free disk space to hold all of the containers drone
creates (a default AWS or GCE disk size won't work -- see
[#6243](https://github.com/go-gitea/gitea/issues/6243)).
- Change into the base directory of your copy of the gitea repository,
and run `drone exec --event pull_request`.
- At the moment `drone exec` doesn't support the Docker Toolbox on Windows 10
(see [drone-cli#135](https://github.com/drone/drone-cli/issues/135))
| | |
| :-------------------- | :---------------------------------------------------------------- |
|``make lint`` | lint everything (not suggest if you only change one type code) |
|``make lint-frontend`` | lint frontend files |
|``make lint-backend`` | lint backend files |
- run test code (Suggest run in linux)
| | |
| :------------------------------------- | :----------------------------------------------- |
|``make test[\#TestSpecificName]`` | run unit test |
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for sqlite |
|[More detail message about integrations](integrations/README.md) |
The drone version, command line, and disk requirements do change over
time (see [#4053](https://github.com/go-gitea/gitea/issues/4053) and
[#6243](https://github.com/go-gitea/gitea/issues/6243)); if you
discover any issues, please feel free to send us a pull request to
update these instructions.
## Vendoring
@ -112,7 +114,15 @@ included in the next released version.
## Building Gitea
See the [hacking instructions](https://docs.gitea.io/en-us/hacking-on-gitea/).
Generally, the go build tools are installed as-needed in the `Makefile`.
An exception are the tools to build the CSS, JS and images.
- To build CSS and JS: Install [Node.js](https://nodejs.org/en/download/package-manager) at version 10.0 or above
with `npm` and then run `npm install`, `make css` and `make js`.
- To build Images: ImageMagick, inkscape and zopflipng binaries must be
available in your `PATH` to run `make generate-images`.
For more details on how to generate files, build and test Gitea, see the [hacking instructions](https://docs.gitea.io/en-us/hacking-on-gitea/)
## Code review
@ -344,7 +354,7 @@ be reviewed by two maintainers and must pass the automatic tests.
Code that you contribute should use the standard copyright header:
```
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
```

@ -1,7 +1,7 @@
###################################
#Build stage
FROM golang:1.14-alpine3.11 AS build-env
FROM golang:1.13-alpine3.11 AS build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -9,7 +9,6 @@ ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
RUN apk --no-cache add build-base git nodejs npm
@ -20,7 +19,7 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
&& make clean build
FROM alpine:3.11
LABEL maintainer="maintainers@gitea.io"
@ -38,8 +37,7 @@ RUN apk --no-cache add \
s6 \
sqlite \
su-exec \
tzdata \
gnupg
tzdata
RUN addgroup \
-S -g 1000 \

402
Makefile

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the Discord chat at https://discord.gg/Gitea](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
@ -33,18 +33,14 @@ From the root of the source tree, run:
TAGS="bindata" make build
or if sqlite support is required:
TAGS="bindata sqlite sqlite_unlock_notify" make build
The `build` target is split into two sub-targets:
- `make backend` which requires [Go 1.12](https://golang.org/dl/) or greater.
- `make frontend` which requires [Node.js 10.13](https://nodejs.org/en/download/) or greater.
- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater.
- `make frontend` which requires [Node.js 10.0.0](https://nodejs.org/en/download/) or greater.
If pre-built frontend files are present it is possible to only build the backend:
TAGS="bindata" make backend
TAGS="bindata" make backend
More info: https://docs.gitea.io/en-us/install-from-source/
@ -69,7 +65,7 @@ NOTES:
For more information and instructions about how to install Gitea, please look
at our [documentation](https://docs.gitea.io/en-us/). If you have questions
that are not covered by the documentation, you can get in contact with us on
our [Discord server](https://discord.gg/Gitea),
our [Discord server](https://discord.gg/NsatcWJ),
or [forum](https://discourse.gitea.io/)!
## Authors

@ -3,7 +3,7 @@
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the Discord chat at https://discord.gg/Gitea](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)

File diff suppressed because one or more lines are too long

@ -1,32 +0,0 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//+build vendor
package main
// Libraries that are included to vendor utilities used during build.
// These libraries will not be included in a normal compilation.
import (
// for lint
_ "github.com/BurntSushi/toml"
_ "github.com/mgechev/dots"
_ "github.com/mgechev/revive/formatter"
_ "github.com/mgechev/revive/lint"
_ "github.com/mgechev/revive/rule"
_ "github.com/mitchellh/go-homedir"
// for embed
_ "github.com/shurcooL/vfsgen"
// for cover merge
_ "golang.org/x/tools/cover"
// for vet
_ "gitea.com/jolheiser/gitea-vet"
// for swagger
_ "github.com/go-swagger/go-swagger/cmd/swagger"
)

@ -1,86 +0,0 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"bytes"
"crypto/sha1"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strconv"
"github.com/shurcooL/vfsgen"
)
func needsUpdate(dir string, filename string) (bool, []byte) {
needRegen := false
_, err := os.Stat(filename)
if err != nil {
needRegen = true
}
oldHash, err := ioutil.ReadFile(filename + ".hash")
if err != nil {
oldHash = []byte{}
}
hasher := sha1.New()
err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
_, _ = hasher.Write([]byte(info.Name()))
_, _ = hasher.Write([]byte(info.ModTime().String()))
_, _ = hasher.Write([]byte(strconv.FormatInt(info.Size(), 16)))
return nil
})
if err != nil {
return true, oldHash
}
newHash := hasher.Sum([]byte{})
if bytes.Compare(oldHash, newHash) != 0 {
return true, newHash
}
return needRegen, newHash
}
func main() {
if len(os.Args) != 4 {
log.Fatal("Insufficient number of arguments. Need: directory packageName filename")
}
dir, packageName, filename := os.Args[1], os.Args[2], os.Args[3]
update, newHash := needsUpdate(dir, filename)
if !update {
fmt.Printf("bindata for %s already up-to-date\n", packageName)
return
}
fmt.Printf("generating bindata for %s\n", packageName)
var fsTemplates http.FileSystem = http.Dir(dir)
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
PackageName: packageName,
BuildTags: "bindata",
VariableName: "Assets",
Filename: filename,
})
if err != nil {
log.Fatalf("%v\n", err)
}
_ = ioutil.WriteFile(filename+".hash", newHash, 0666)
}

@ -1,221 +0,0 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2015 Kenneth Shaw
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"encoding/json"
"flag"
"fmt"
"go/format"
"io/ioutil"
"log"
"net/http"
"regexp"
"sort"
"strconv"
"strings"
"unicode/utf8"
)
const (
gemojiURL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
maxUnicodeVersion = 12
)
var (
flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")
)
// Gemoji is a set of emoji data.
type Gemoji []Emoji
// Emoji represents a single emoji and associated data.
type Emoji struct {
Emoji string `json:"emoji"`
Description string `json:"description,omitempty"`
Aliases []string `json:"aliases"`
UnicodeVersion string `json:"unicode_version,omitempty"`
SkinTones bool `json:"skin_tones,omitempty"`
}
// Don't include some fields in JSON
func (e Emoji) MarshalJSON() ([]byte, error) {
type emoji Emoji
x := emoji(e)
x.UnicodeVersion = ""
x.Description = ""
x.SkinTones = false
return json.Marshal(x)
}
func main() {
var err error
flag.Parse()
// generate data
buf, err := generate()
if err != nil {
log.Fatal(err)
}
// write
err = ioutil.WriteFile(*flagOut, buf, 0644)
if err != nil {
log.Fatal(err)
}
}
var replacer = strings.NewReplacer(
"main.Gemoji", "Gemoji",
"main.Emoji", "\n",
"}}", "},\n}",
", Description:", ", ",
", Aliases:", ", ",
", UnicodeVersion:", ", ",
", SkinTones:", ", ",
)
var emojiRE = regexp.MustCompile(`\{Emoji:"([^"]*)"`)
func generate() ([]byte, error) {
var err error
// load gemoji data
res, err := http.Get(gemojiURL)
if err != nil {
return nil, err
}
defer res.Body.Close()
// read all
body, err := ioutil.ReadAll(res.Body)
if err != nil {
return nil, err
}
// unmarshal
var data Gemoji
err = json.Unmarshal(body, &data)
if err != nil {
return nil, err
}
var skinTones = make(map[string]string)
skinTones["\U0001f3fb"] = "Light Skin Tone"
skinTones["\U0001f3fc"] = "Medium-Light Skin Tone"
skinTones["\U0001f3fd"] = "Medium Skin Tone"
skinTones["\U0001f3fe"] = "Medium-Dark Skin Tone"
skinTones["\U0001f3ff"] = "Dark Skin Tone"
var tmp Gemoji
//filter out emoji that require greater than max unicode version
for i := range data {
val, _ := strconv.ParseFloat(data[i].UnicodeVersion, 64)
if int(val) <= maxUnicodeVersion {
tmp = append(tmp, data[i])
}
}
data = tmp
sort.Slice(data, func(i, j int) bool {
return data[i].Aliases[0] < data[j].Aliases[0]
})
aliasMap := make(map[string]int, len(data))
for i, e := range data {
if e.Emoji == "" || len(e.Aliases) == 0 {
continue
}
for _, a := range e.Aliases {
if a == "" {
continue
}
aliasMap[a] = i
}
}
// gitea customizations
i, ok := aliasMap["tada"]
if ok {
data[i].Aliases = append(data[i].Aliases, "hooray")
}
i, ok = aliasMap["laughing"]
if ok {
data[i].Aliases = append(data[i].Aliases, "laugh")
}
// write a JSON file to use with tribute (write before adding skin tones since we can't support them there yet)
file, _ := json.Marshal(data)
_ = ioutil.WriteFile("assets/emoji.json", file, 0644)
// Add skin tones to emoji that support it
var (
s []string
newEmoji string
newDescription string
newData Emoji
)
for i := range data {
if data[i].SkinTones {
for k, v := range skinTones {
s = strings.Split(data[i].Emoji, "")
if utf8.RuneCountInString(data[i].Emoji) == 1 {
s = append(s, k)
} else {
// insert into slice after first element because all emoji that support skin tones
// have that modifer placed at this spot
s = append(s, "")
copy(s[2:], s[1:])
s[1] = k
}
newEmoji = strings.Join(s, "")
newDescription = data[i].Description + ": " + v
newAlias := data[i].Aliases[0] + "_" + strings.ReplaceAll(v, " ", "_")
newData = Emoji{newEmoji, newDescription, []string{newAlias}, "12.0", false}
data = append(data, newData)
}
}
}
// add header
str := replacer.Replace(fmt.Sprintf(hdr, gemojiURL, data))
// change the format of the unicode string
str = emojiRE.ReplaceAllStringFunc(str, func(s string) string {
var err error
s, err = strconv.Unquote(s[len("{Emoji:"):])
if err != nil {
panic(err)
}
return "{" + strconv.QuoteToASCII(s)
})
// format
return format.Source([]byte(str))
}
const hdr = `
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package emoji
// Code generated by gen.go. DO NOT EDIT.
// Sourced from %s
//
var GemojiData = %#v
`

@ -1,119 +0,0 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright (c) 2015, Wade Simmons
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// gocovmerge takes the results from multiple `go test -coverprofile` runs and
// merges them into one profile
// +build ignore
package main
import (
"flag"
"fmt"
"io"
"log"
"os"
"sort"
"golang.org/x/tools/cover"
)
func mergeProfiles(p *cover.Profile, merge *cover.Profile) {
if p.Mode != merge.Mode {
log.Fatalf("cannot merge profiles with different modes")
}
// Since the blocks are sorted, we can keep track of where the last block
// was inserted and only look at the blocks after that as targets for merge
startIndex := 0
for _, b := range merge.Blocks {
startIndex = mergeProfileBlock(p, b, startIndex)
}
}
func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) int {
sortFunc := func(i int) bool {
pi := p.Blocks[i+startIndex]
return pi.StartLine >= pb.StartLine && (pi.StartLine != pb.StartLine || pi.StartCol >= pb.StartCol)
}
i := 0
if sortFunc(i) != true {
i = sort.Search(len(p.Blocks)-startIndex, sortFunc)
}
i += startIndex
if i < len(p.Blocks) && p.Blocks[i].StartLine == pb.StartLine && p.Blocks[i].StartCol == pb.StartCol {
if p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {
log.Fatalf("OVERLAP MERGE: %v %v %v", p.FileName, p.Blocks[i], pb)
}
switch p.Mode {
case "set":
p.Blocks[i].Count |= pb.Count
case "count", "atomic":
p.Blocks[i].Count += pb.Count
default:
log.Fatalf("unsupported covermode: '%s'", p.Mode)
}
} else {
if i > 0 {
pa := p.Blocks[i-1]
if pa.EndLine >= pb.EndLine && (pa.EndLine != pb.EndLine || pa.EndCol > pb.EndCol) {
log.Fatalf("OVERLAP BEFORE: %v %v %v", p.FileName, pa, pb)
}
}
if i < len(p.Blocks)-1 {
pa := p.Blocks[i+1]
if pa.StartLine <= pb.StartLine && (pa.StartLine != pb.StartLine || pa.StartCol < pb.StartCol) {
log.Fatalf("OVERLAP AFTER: %v %v %v", p.FileName, pa, pb)
}
}
p.Blocks = append(p.Blocks, cover.ProfileBlock{})
copy(p.Blocks[i+1:], p.Blocks[i:])
p.Blocks[i] = pb
}
return i + 1
}
func addProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile {
i := sort.Search(len(profiles), func(i int) bool { return profiles[i].FileName >= p.FileName })
if i < len(profiles) && profiles[i].FileName == p.FileName {
mergeProfiles(profiles[i], p)
} else {
profiles = append(profiles, nil)
copy(profiles[i+1:], profiles[i:])
profiles[i] = p
}
return profiles
}
func dumpProfiles(profiles []*cover.Profile, out io.Writer) {
if len(profiles) == 0 {
return
}
fmt.Fprintf(out, "mode: %s\n", profiles[0].Mode)
for _, p := range profiles {
for _, b := range p.Blocks {
fmt.Fprintf(out, "%s:%d.%d,%d.%d %d %d\n", p.FileName, b.StartLine, b.StartCol, b.EndLine, b.EndCol, b.NumStmt, b.Count)
}
}
}
func main() {
flag.Parse()
var merged []*cover.Profile
for _, file := range flag.Args() {
profiles, err := cover.ParseProfiles(file)
if err != nil {
log.Fatalf("failed to parse profiles: %v", err)
}
for _, p := range profiles {
merged = addProfile(merged, p)
}
}
dumpProfiles(merged, os.Stdout)
}

File diff suppressed because it is too large Load Diff

@ -1,23 +0,0 @@
#!/bin/sh
mv ./options/locale/locale_en-US.ini ./options/
# Make sure to only change lines that have the translation enclosed between quotes
sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
s/^([a-zA-Z0-9_.-]+)[ ]*="/\1=/
s/\\"/"/g
s/"$//
}' ./options/locale/*.ini
# Remove translation under 25% of en_us
baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
baselines=$((baselines / 4))
for filename in ./options/locale/*.ini; do
lines=`wc -l "$filename" | cut -d" " -f1`
if [ $lines -lt $baselines ]; then
echo "Removing $filename: $lines/$baselines"
rm "$filename"
fi
done
mv ./options/locale_en-US.ini ./options/locale/

@ -14,10 +14,9 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth/oauth2"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
pwd "code.gitea.io/gitea/modules/password"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
@ -146,32 +145,6 @@ var (
Name: "list",
Usage: "List auth sources",
Action: runListAuth,
Flags: []cli.Flag{
cli.IntFlag{
Name: "min-width",
Usage: "Minimal cell width including any padding for the formatted table",
Value: 0,
},
cli.IntFlag{
Name: "tab-width",
Usage: "width of tab characters in formatted table (equivalent number of spaces)",
Value: 8,
},
cli.IntFlag{
Name: "padding",
Usage: "padding added to a cell before computing its width",
Value: 1,
},
cli.StringFlag{
Name: "pad-char",
Usage: `ASCII char used for padding if padchar == '\\t', the Writer will assume that the width of a '\\t' in the formatted output is tabwidth, and cells are left-aligned independent of align_left (for correct-looking results, tabwidth must correspond to the tab width in the viewer displaying the result)`,
Value: "\t",
},
cli.BoolFlag{
Name: "vertical-bars",
Usage: "Set to true to print vertical bars between columns",
},
},
}
idFlag = cli.Int64Flag{
@ -377,11 +350,9 @@ func runRepoSyncReleases(c *cli.Context) error {
log.Trace("Synchronizing repository releases (this may take a while)")
for page := 1; ; page++ {
repos, count, err := models.SearchRepositoryByName(&models.SearchRepoOptions{
ListOptions: models.ListOptions{
PageSize: models.RepositoryListDefaultPageSize,
Page: page,
},
Private: true,
Page: page,
PageSize: models.RepositoryListDefaultPageSize,
Private: true,
})
if err != nil {
return fmt.Errorf("SearchRepositoryByName: %v", err)
@ -404,7 +375,7 @@ func runRepoSyncReleases(c *cli.Context) error {
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
if err = repository.SyncReleasesWithTags(repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
gitRepo.Close()
continue
@ -439,7 +410,7 @@ func runRegenerateHooks(c *cli.Context) error {
if err := initDB(); err != nil {
return err
}
return repo_module.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
return models.SyncRepositoryHooks()
}
func runRegenerateKeys(c *cli.Context) error {
@ -561,18 +532,8 @@ func runListAuth(c *cli.Context) error {
return err
}
flags := tabwriter.AlignRight
if c.Bool("vertical-bars") {
flags |= tabwriter.Debug
}
padChar := byte('\t')
if len(c.String("pad-char")) > 0 {
padChar = c.String("pad-char")[0]
}
// loop through each source and print
w := tabwriter.NewWriter(os.Stdout, c.Int("min-width"), c.Int("tab-width"), c.Int("padding"), padChar, flags)
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
for _, source := range loginSources {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, models.LoginNames[source.Type], source.IsActived)

@ -61,10 +61,6 @@ var (
Name: "admin-filter",
Usage: "An LDAP filter specifying if a user should be given administrator privileges.",
},
cli.StringFlag{
Name: "restricted-filter",
Usage: "An LDAP filter specifying if a user should be given restricted status.",
},
cli.BoolFlag{
Name: "allow-deactivate-all",
Usage: "Allow empty search results to deactivate all users.",
@ -239,9 +235,6 @@ func parseLdapConfig(c *cli.Context, config *models.LDAPConfig) error {
if c.IsSet("admin-filter") {
config.Source.AdminFilter = c.String("admin-filter")
}
if c.IsSet("restricted-filter") {
config.Source.RestrictedFilter = c.String("restricted-filter")
}
if c.IsSet("allow-deactivate-all") {
config.Source.AllowDeactivateAll = c.Bool("allow-deactivate-all")
}

@ -39,7 +39,6 @@ func TestAddLdapBindDn(t *testing.T) {
"--user-search-base", "ou=Users,dc=full-domain-bind,dc=org",
"--user-filter", "(memberOf=cn=user-group,ou=example,dc=full-domain-bind,dc=org)",
"--admin-filter", "(memberOf=cn=admin-group,ou=example,dc=full-domain-bind,dc=org)",
"--restricted-filter", "(memberOf=cn=restricted-group,ou=example,dc=full-domain-bind,dc=org)",
"--username-attribute", "uid-bind full",
"--firstname-attribute", "givenName-bind full",
"--surname-attribute", "sn-bind full",
@ -75,7 +74,6 @@ func TestAddLdapBindDn(t *testing.T) {
SearchPageSize: 99,
Filter: "(memberOf=cn=user-group,ou=example,dc=full-domain-bind,dc=org)",
AdminFilter: "(memberOf=cn=admin-group,ou=example,dc=full-domain-bind,dc=org)",
RestrictedFilter: "(memberOf=cn=restricted-group,ou=example,dc=full-domain-bind,dc=org)",
Enabled: true,
},
},
@ -267,7 +265,6 @@ func TestAddLdapSimpleAuth(t *testing.T) {
"--user-search-base", "ou=Users,dc=full-domain-simple,dc=org",
"--user-filter", "(&(objectClass=posixAccount)(full-simple-cn=%s))",
"--admin-filter", "(memberOf=cn=admin-group,ou=example,dc=full-domain-simple,dc=org)",
"--restricted-filter", "(memberOf=cn=restricted-group,ou=example,dc=full-domain-simple,dc=org)",
"--username-attribute", "uid-simple full",
"--firstname-attribute", "givenName-simple full",
"--surname-attribute", "sn-simple full",
@ -295,7 +292,6 @@ func TestAddLdapSimpleAuth(t *testing.T) {
AttributeSSHPublicKey: "publickey-simple full",
Filter: "(&(objectClass=posixAccount)(full-simple-cn=%s))",
AdminFilter: "(memberOf=cn=admin-group,ou=example,dc=full-domain-simple,dc=org)",
RestrictedFilter: "(memberOf=cn=restricted-group,ou=example,dc=full-domain-simple,dc=org)",
Enabled: true,
},
},
@ -503,7 +499,6 @@ func TestUpdateLdapBindDn(t *testing.T) {
"--user-search-base", "ou=Users,dc=full-domain-bind,dc=org",
"--user-filter", "(memberOf=cn=user-group,ou=example,dc=full-domain-bind,dc=org)",
"--admin-filter", "(memberOf=cn=admin-group,ou=example,dc=full-domain-bind,dc=org)",
"--restricted-filter", "(memberOf=cn=restricted-group,ou=example,dc=full-domain-bind,dc=org)",
"--username-attribute", "uid-bind full",
"--firstname-attribute", "givenName-bind full",
"--surname-attribute", "sn-bind full",
@ -548,7 +543,6 @@ func TestUpdateLdapBindDn(t *testing.T) {
SearchPageSize: 99,
Filter: "(memberOf=cn=user-group,ou=example,dc=full-domain-bind,dc=org)",
AdminFilter: "(memberOf=cn=admin-group,ou=example,dc=full-domain-bind,dc=org)",
RestrictedFilter: "(memberOf=cn=restricted-group,ou=example,dc=full-domain-bind,dc=org)",
Enabled: true,
},
},
@ -984,7 +978,6 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
"--user-search-base", "ou=Users,dc=full-domain-simple,dc=org",
"--user-filter", "(&(objectClass=posixAccount)(full-simple-cn=%s))",
"--admin-filter", "(memberOf=cn=admin-group,ou=example,dc=full-domain-simple,dc=org)",
"--restricted-filter", "(memberOf=cn=restricted-group,ou=example,dc=full-domain-simple,dc=org)",
"--username-attribute", "uid-simple full",
"--firstname-attribute", "givenName-simple full",
"--surname-attribute", "sn-simple full",
@ -1013,7 +1006,6 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
AttributeSSHPublicKey: "publickey-simple full",
Filter: "(&(objectClass=posixAccount)(full-simple-cn=%s))",
AdminFilter: "(memberOf=cn=admin-group,ou=example,dc=full-domain-simple,dc=org)",
RestrictedFilter: "(memberOf=cn=restricted-group,ou=example,dc=full-domain-simple,dc=org)",
},
},
},

@ -22,7 +22,6 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/options"
"code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"xorm.io/builder"
@ -85,16 +84,10 @@ var checklist = []check{
},
{
title: "Check Database Version",
name: "check-db-version",
name: "check-db",
isDefault: true,
f: runDoctorCheckDBVersion,
abortIfFailed: false,
},
{
title: "Check consistency of database",
name: "check-db-consistency",
isDefault: false,
f: runDoctorCheckDBConsistency,
abortIfFailed: true,
},
{
title: "Check if OpenSSH authorized_keys file is up-to-date",
@ -120,12 +113,6 @@ var checklist = []check{
isDefault: false,
f: runDoctorPRMergeBase,
},
{
title: "Recalculate Stars number for all user",
name: "recalculate_stars_number",
isDefault: false,
f: runDoctorUserStarNum,
},
// more checks please append here
}
@ -365,7 +352,7 @@ func runDoctorAuthorizedKeys(ctx *cli.Context) ([]string, error) {
if ctx.Bool("fix") {
return []string{"authorized_keys is out of date, attempting regeneration"}, models.RewriteAllPublicKeys()
}
return nil, fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
return nil, fmt.Errorf("authorized_keys is out of date and should be regenerated with gitea admin regenerate keys")
}
return nil, nil
}
@ -413,12 +400,12 @@ func iteratePRs(repo *models.Repository, each func(*models.Repository, *models.P
func runDoctorHooks(ctx *cli.Context) ([]string, error) {
// Need to iterate across all of the repositories
return iterateRepositories(func(repo *models.Repository) ([]string, error) {
results, err := repository.CheckDelegateHooks(repo.RepoPath())
results, err := models.CheckDelegateHooks(repo.RepoPath())
if err != nil {
return nil, err
}
if len(results) > 0 && ctx.Bool("fix") {
return []string{fmt.Sprintf("regenerated hooks for %s", repo.FullName())}, repository.CreateDelegateHooks(repo.RepoPath())
return []string{fmt.Sprintf("regenerated hooks for %s", repo.FullName())}, models.CreateDelegateHooks(repo.RepoPath())
}
return results, nil
@ -500,10 +487,6 @@ func runDoctorPRMergeBase(ctx *cli.Context) ([]string, error) {
return results, err
}
func runDoctorUserStarNum(ctx *cli.Context) ([]string, error) {
return nil, models.DoctorUserStarNum()
}
func runDoctorScriptType(ctx *cli.Context) ([]string, error) {
path, err := exec.LookPath(setting.ScriptType)
if err != nil {
@ -511,96 +494,3 @@ func runDoctorScriptType(ctx *cli.Context) ([]string, error) {
}
return []string{fmt.Sprintf("ScriptType %s is on the current PATH at %s", setting.ScriptType, path)}, nil
}
func runDoctorCheckDBConsistency(ctx *cli.Context) ([]string, error) {
var results []string
// make sure DB version is uptodate
if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
return nil, fmt.Errorf("model version on the database does not match the current Gitea version. Model consistency will not be checked until the database is upgraded")
}
//find labels without existing repo or org
count, err := models.CountOrphanedLabels()
if err != nil {
return nil, err
}
if count > 0 {
if ctx.Bool("fix") {
if err = models.DeleteOrphanedLabels(); err != nil {
return nil, err
}
results = append(results, fmt.Sprintf("%d labels without existing repository/organisation deleted", count))
} else {
results = append(results, fmt.Sprintf("%d labels without existing repository/organisation", count))
}
}
//find issues without existing repository
count, err = models.CountOrphanedIssues()
if err != nil {
return nil, err
}
if count > 0 {
if ctx.Bool("fix") {
if err = models.DeleteOrphanedIssues(); err != nil {
return nil, err
}
results = append(results, fmt.Sprintf("%d issues without existing repository deleted", count))
} else {
results = append(results, fmt.Sprintf("%d issues without existing repository", count))
}
}
//find pulls without existing issues
count, err = models.CountOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id")
if err != nil {
return nil, err
}
if count > 0 {
if ctx.Bool("fix") {
if err = models.DeleteOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id"); err != nil {
return nil, err
}
results = append(results, fmt.Sprintf("%d pull requests without existing issue deleted", count))
} else {
results = append(results, fmt.Sprintf("%d pull requests without existing issue", count))
}
}
//find tracked times without existing issues/pulls
count, err = models.CountOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id")
if err != nil {
return nil, err
}
if count > 0 {
if ctx.Bool("fix") {
if err = models.DeleteOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id"); err != nil {
return nil, err
}
results = append(results, fmt.Sprintf("%d tracked times without existing issue deleted", count))
} else {
results = append(results, fmt.Sprintf("%d tracked times without existing issue", count))
}
}
count, err = models.CountNullArchivedRepository()
if err != nil {
return nil, err
}
if count > 0 {
if ctx.Bool("fix") {
updatedCount, err := models.FixNullArchivedRepository()
if err != nil {
return nil, err
}
results = append(results, fmt.Sprintf("%d repositories with null is_archived updated", updatedCount))
} else {
results = append(results, fmt.Sprintf("%d repositories with null is_archived", count))
}
}
//ToDo: function to recalc all counters
return results, nil
}

@ -52,10 +52,6 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
Name: "skip-repository, R",
Usage: "Skip the repository dumping",
},
cli.BoolFlag{
Name: "skip-log, L",
Usage: "Skip the log dumping",
},
},
}
@ -99,7 +95,7 @@ func runDump(ctx *cli.Context) error {
zip.Verbose = ctx.Bool("verbose")
if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") {
if ctx.IsSet("skip-repository") {
log.Info("Skip dumping local repositories")
} else {
log.Info("Dumping local repositories...%s", setting.RepoRootPath)
@ -155,12 +151,7 @@ func runDump(ctx *cli.Context) error {
}
}
// Doesn't check if LogRootPath exists before processing --skip-log intentionally,
// ensuring that it's clear the dump is skipped whether the directory's initialized
// yet or not.
if ctx.IsSet("skip-log") && ctx.Bool("skip-log") {
log.Info("Skip dumping log files")
} else if com.IsExist(setting.LogRootPath) {
if com.IsExist(setting.LogRootPath) {
if err := z.AddDir("log", setting.LogRootPath); err != nil {
fatal("Failed to include log: %v", err)
}

Some files were not shown because too many files have changed in this diff Show More