Commit Graph

9124 Commits

Author SHA1 Message Date
fa6ea60c55 Frontend build improvements, fix Fomantic build ()
- add package-lock.json to webpack/fomantic prereqs making them always rebuild when dependencies change.
- remove FOMANTIC_EVIDENCE. It seemed better to just track a few output files instead.
- delete fomantic output files before build to prevent possible bugs in fomantic's build.
- resolve WEBPACK_SOURCES only once for performance
- reorder variables for clarity
- use clean-all in Dockerfile
- detect busybox for find syntax

Fixes: https://github.com/go-gitea/gitea/issues/10569
Fixes: https://github.com/go-gitea/gitea/issues/10565
Fixes: https://github.com/go-gitea/gitea/issues/10570
Fixes: https://github.com/go-gitea/gitea/issues/10568
2020-03-03 13:51:11 -06:00
aa4a297c16 Rename repo size sorting options () 2020-03-03 14:27:38 -03:00
009990b0c0 Remove unnecessary parentheses in template ()
Fix 

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-03-03 16:00:36 +08:00
0e2217bd2d Logout POST action ()
* Change logout to POST

* Update for redirect

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-02 22:50:31 -06:00
bea497ff96 nextcloud oauth ()
Fix 
2020-03-02 22:11:45 -05:00
07f6ae30e4 Change default value of DefaultCommandExecutionTimeout to match cheatsheet () 2020-03-02 22:13:01 -03:00
5abe1c52de Display pull request head branch even the branch deleted or repository deleted ()
* Display pull request head branch even the branch deleted or repository deleted

* Merge getHeadRepo/loadHeadRepo and getBaseRepo/loadBaseRepo on pull and fill repo when pr.Issue.Repo is available

* retrieve sha from pull head when pull request branch deleted and fix tests

* Fix test

* Ensure MustHeadRepoName returns empty string if no head repo

Co-authored-by: zeripath <art27@cantab.net>
2020-03-02 22:31:55 +00:00
22b7507024 [skip ci] Updated translations via Crowdin 2020-03-02 20:56:37 +00:00
ac4f952f73 Fix make find command ()
Continuation of https://github.com/go-gitea/gitea/pull/10577

This version also includes an additional fix for Darwin and FreeBSD
which do not accept the `-regextype` option, but only `-E` and the
argument order is specifically required like this for `-E` to work.

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-03-02 20:55:12 +00:00
5e1438ba92 Admin page for managing user e-mail activation ()
* Implement mail activation admin panel

* Add export comments

* Fix another export comment

* again...

* And again!

* Apply suggestions by @lunny

* Add UI for user activated emails

* Make new activation UI work

* Fix lint

* Prevent admin from self-deactivate; add modal

Co-authored-by: zeripath <art27@cantab.net>
2020-03-02 15:25:36 -03:00
b5ecc82d6e [skip ci] Updated translations via Crowdin 2020-03-02 15:54:56 +00:00
753c0675c1 Fix migration bug on v96.go () 2020-03-02 12:53:39 -03:00
e9afd74bbe Speed up make ()
* Speed up make

- stop `find` from venturing into node_modules and other directories
  that do not contain *.go files
- only run `find` once for *.go files
- move image tempdir generation to that task
- rename GOFILES to GO_SOURCES_OWN for consistency and to indicate that
  vendor files are not included
- pre-resolve FOMANTIC_SOURCES

* exclude more

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-03-02 00:45:08 +02:00
4160bd6ef1 Remove Unused Functions ()
* remove ReplaceLeft

* remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName

* remove CheckUnitUser chainload to models.CheckUnitUser

* remove MakeAssigneeList

* remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch

* remove GetRandomBytesAsBase64

* remove PushUpdateDeleteTags

* remove GetUserByKeyID
(you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID")

* remove BasicAuthEncode from struct package -> same function in modules/base/tools !

* remove UserID from api.utils

* remove unused func from structs package
2020-03-02 00:05:44 +02:00
c08c975d36 Fix redirection path if Slack webhook channel is invalid ()
The path to the hook config is already defined by orgRepoCtx

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-03-01 11:51:55 -05:00
f9d34b2c60 vendor: update github.com/yuin/goldmark to v1.1.24 () 2020-03-01 15:01:44 +02:00
14f3593f20 Fix 404 after activating secondary email () 2020-02-29 23:46:20 +00:00
421e7b7875 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 13:27:19 +00:00
82be59e633 issue search on my related repositories ()
* adding search capability to user's issues dashboard

* global issue search

* placement of search bar on issues dashboard

* fixed some bugs in the issue dashboard search

* added unit test because IssueIDs option was added to UserIssueStatsOptions

* some renaming of fields in the issue dashboard code to be more clear; also trying to fix issue of searching the right repos based on the filter

* added unit test fro GetRepoIDsForIssuesOptions; fixed search lost on pagination; using shown issue status for open/close count; removed some debugging

* fix issue with all count showing incorrectly

* removed todo comment left in by mistake

* typo pulling wrong count

* fxied all count being off when selecting repositories

* setting the opts.IsClosed after pulling repos to search, this is done so that the list of repo ids to serach for the keyword is not limited, we need to get all the issue ids for the shown issue stats

* added "accessibleRepositoryCondition" check on the query to pull the repo ids to search for issues, this is an added protection to ensure we don't search repos the user does not have access to

* added code so that in the issues search, we won't use an in clause of issues ids that goes over 1000

* fixed unit test

* using 950 as the limit for issue search, removed unneeded group by in GetRepoIDsForIssuesOptions, showing search on pulls dashboard page too (not just issues)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-29 03:52:05 -03:00
af61b2249a adds API endpoints to manage OAuth2 Application (list/create/delete) ()
* add API endpoint to create OAuth2 Application.

* move endpoint to /user. Add swagger documentations and proper response type.

* change json tags to snake_case. add CreateOAuth2ApplicationOptions to swagger docs.

* change response status to Created (201)

* add methods to list OAuth2 apps and delete an existing OAuth2 app by ID.

* add APIFormat convert method and file header

* fixed header

* hide secret on oauth2 application list

* add Created time to API response

* add API integration tests for create/list/delete OAuth2 applications.

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-29 03:19:32 -03:00
7e8cdba181 [Refactor] move APIFormat() of Issue and Label to convert package ()
* Label: delete .APIFormat() and use convert.ToLabel()

* move issue APIFormat too

* add missing one

* move TEST too

* handle error -> return empty APIIssue

* 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-02-28 23:49:50 -03:00
c32f3da33c Handle panic in indexer initialisation better ()
* Handle panic in indexer initialisation better
* as per @guillep2k
2020-02-28 22:00:09 +00:00
154b137b6d Relax sanitization as per https://github.com/jch/html-pipeline ()
Looking at github/markup#245 it is clear that GH uses https://github.com/jch/html-pipeline to sanitize. This PR relaxes our sanitization to more closely match this.

Fixes 
and likely others...
2020-02-28 20:05:12 +00:00
e0ecddc11b Prevent accidential selection of language stats bar () 2020-02-29 00:59:29 +08:00
e661cd0321 Set correct content_type value for Gogs/Gitea webhooks () ()
The content_type value was defaulting to the string value of the
ContentType, not the integer value as expected by the backend.
2020-02-28 14:33:52 +00:00
ae4eaf02be vendor: unknown/cae move to taged version () 2020-02-28 13:46:28 +00:00
15c7738b3a goldmark v1.1.19 -> v1.1.23 ()
vendor update
2020-02-28 13:06:10 +00:00
74433c91bf head.tmpl og:image picture location ()
og:image picture location
2020-02-28 19:30:23 +08:00
8d2059a201 update: macaron cores,gzip,session ()
Co-authored-by: zeripath <art27@cantab.net>
2020-02-28 10:51:18 +01:00
694f44660f inform participants on UI too ()
* inform participants on UI too

* ajust test

* refactor getParticipantIDsByIssue
2020-02-28 05:16:41 -03:00
513b962c1d Add max-file-size to LFS ()
* Add max-file-size to LFS

* Update modules/lfs/server.go

* As per @silverwind

Co-Authored-By: silverwind <me@silverwind.io>

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-28 01:46:57 -03:00
9ad2aa8f4d Use media links for img in post-process ()
* use media links for img in post-process

* do not visit text of anchors
2020-02-28 01:16:05 -03:00
efec0d393b Fix the signing icon in the view_list.tmpl page ()
* Fix the view_list.tmpl page

* fix-centerlock

* Update web_src/less/_base.less

as per @silverwind

Co-Authored-By: silverwind <me@silverwind.io>

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-27 23:03:17 -03:00
e57ac841de 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-27 20:10:27 -03:00
15fbf509d3 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 16:00:13 -06:00
90919bb37e Show Signer in commit lists and add basic trust ()
* 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>

* ensure orange text and background is available

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

* Update gpg_key.go

* Update models/gpg_key.go

* Apply suggestions from code review

* Require team collaborators to have access to UnitTypeCode

* as per @6543

* fix position of sha as per @silverwind

* as per @guillep2k
2020-02-27 16:20:55 -03:00
858aebc2d8 Use [:space:] instead of \s () 2020-02-27 18:03:21 +00:00
a924a90349 [BugFix] Avoid mailing explicit unwatched ()
* Avoid mailing explicit unwatched

* CI.restart()

* back to normal

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-27 10:07:05 +00:00
9a476113f0 Add fluid-icon ()
This provides Firefox (and possible other browsers) with a
high-resolution rich icon, in place of the previously removed
apple-touch-icon without having to use that one as it lacks an
alpha channel. This is the same method GH uses.

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/UI_considerations#Rich_icons

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-02-27 11:40:14 +08:00
4a2d23981d Fix SQLite concurrency problems by using BEGIN IMMEDIATE ()
* Test locking immediate for SQLite3

* fix url field separator

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2020-02-27 07:51:37 +08:00
7ffc2427da Show the username as a fallback on feeds if full name is blank ()
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-26 22:08:24 +00:00
ef798d4b84 Tweak language stats bar ()
- Ensure bar does not overflow parent
- Remove unneccessary borders/background
- Fix shaky animation caused by JS animation miscalculation by setting
  fixed height on the summary box. Box itself is still shaky during
  animation, but better it then the whole page.

Fixes: https://github.com/go-gitea/gitea/issues/10474
2020-02-26 22:44:14 +02:00
17581252e4 Fixed formatting ()
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2020-02-26 13:28:39 -05:00
78585b1cd7 Fix double PR notification from API ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-26 12:12:34 -06:00
bcd16cec63 Fix admin notices ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-26 10:25:54 -06:00
084a2b0026 Code Refactor of IssueWatch related things ()
* refactor

* optimize

* remove Iretating function
LoadWatchUsers do not load Users into IW object and it is used only in api ... so move this logic

* remove unessesary

* Apply suggestions from code review

Thx

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

* make Tests more robust

* fix rebase

* restart CI

* CI no dont hit sqlites deadlock

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-02-26 03:32:22 -03:00
e5944a9521 Change admin dashboard to POST ()
* Add form and convert to POST

* Redirect for flash

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-02-25 16:54:13 -06:00
c161bb013e 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 14:28:47 -06:00
4427a936b4 [API] enable paggination for ListRepoTags ()
* enable paggination for repoTags

* precalculate first, cut slice second

* 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>
2020-02-25 14:07:07 -05:00
b098cc24c5 Use documentation IPs for example IPs ()
See https://tools.ietf.org/html/rfc5737

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-02-25 13:25:17 -05:00