John Olheiser
3f1c0841cb
Granular webhook events ( #9626 )
...
* Initial work
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add PR reviews and API coverage
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Split up events
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add migration and locale
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Format
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Revert IsPull
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix comments
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix tests
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix PR reviews
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix issue_comment
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Make fmt
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Migrations
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Backwards compatible API
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix feishu
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move session commit
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
5 years ago
Lauris BH
37c3db7be6
Add restricted user filter to LDAP authentication ( #10600 )
...
* Add restricted user filter to LDAP authentification
* Fix unit test cases
5 years ago
Antoine GIRARD
4e65d2b8ea
Ensure executable bit is kept on the web editor ( #10607 )
...
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
5 years ago
Lauris BH
3d5d21133c
OAuth2: add Yandex provider ( #8335 ) ( #10564 )
...
* OAuth2: add Yandex provider (#8335 )
* remove changes from locale ru-RU
* fmt modules/auth/oauth2/oauth2.go
Co-Authored-By: 6543 <6543@obermui.de>
* fix fmt
* Update templates/admin/auth/new.tmpl
* fix fmt
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
zeripath
0b3a9c4f85
Fix LFS max file size enforcement ( #10593 )
...
Unfortunately the batch handler also needs to enforce max file size.
Enforce max file size in batch handler
5 years ago
techknowlogick
bea497ff96
nextcloud oauth ( #10562 )
...
Fix #7078
5 years ago
zeripath
07f6ae30e4
Change default value of DefaultCommandExecutionTimeout to match cheatsheet ( #10581 )
5 years ago
Lunny Xiao
5abe1c52de
Display pull request head branch even the branch deleted or repository deleted ( #10413 )
...
* 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>
5 years ago
6543
4160bd6ef1
Remove Unused Functions ( #10516 )
...
* 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
5 years ago
Gustavo Marin
af61b2249a
adds API endpoints to manage OAuth2 Application (list/create/delete) ( #10437 )
...
* 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>
5 years ago
6543
7e8cdba181
[Refactor] move APIFormat() of Issue and Label to convert package ( #10423 )
...
* 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>
5 years ago
zeripath
c32f3da33c
Handle panic in indexer initialisation better ( #10534 )
...
* Handle panic in indexer initialisation better
* as per @guillep2k
5 years ago
zeripath
154b137b6d
Relax sanitization as per https://github.com/jch/html-pipeline ( #10527 )
...
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 #10471
and likely others...
5 years ago
6543
694f44660f
inform participants on UI too ( #10473 )
...
* inform participants on UI too
* ajust test
* refactor getParticipantIDsByIssue
5 years ago
zeripath
513b962c1d
Add max-file-size to LFS ( #10463 )
...
* 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>
5 years ago
zeripath
9ad2aa8f4d
Use media links for img in post-process ( #10515 )
...
* use media links for img in post-process
* do not visit text of anchors
5 years ago
6543
e57ac841de
Fix potential bugs ( #10513 )
...
* use e if it is an option
* potential nil so check err first
* check err first
* m == nil already checked
5 years ago
guillep2k
4a2d23981d
Fix SQLite concurrency problems by using BEGIN IMMEDIATE ( #10368 )
...
* Test locking immediate for SQLite3
* fix url field separator
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
5 years ago
6543
084a2b0026
Code Refactor of IssueWatch related things ( #10401 )
...
* 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>
5 years ago
John Olheiser
e5944a9521
Change admin dashboard to POST ( #10465 )
...
* Add form and convert to POST
* Redirect for flash
Signed-off-by: jolheiser <john.olheiser@gmail.com>
5 years ago
6543
4427a936b4
[API] enable paggination for ListRepoTags ( #10454 )
...
* 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>
5 years ago
guillep2k
09dbd85a3a
Various fixes in login sources ( #10428 )
5 years ago
Lunny Xiao
542bd59239
Fix webhook bug ( #10427 )
...
Co-authored-by: techknowlogick <matti@mdranta.net>
5 years ago
zeripath
089ccb0c80
Handle push rejection message in Merge & Web Editor ( #10373 )
...
* Handle push rejection message in Merge
* placate golangci-lint
* Fix sanitize, adjust message handling
* oops
* Oops
* Handle push-rejection in webeditor CRUD too
* Apply suggestions from code review
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
zeripath
c8d1c38129
Render READMEs in docs/ .gitea or .github from root ( #10361 )
...
* Render READMEs in docs/ .gitea or .github from root
5 years ago
Lauris BH
3c45cf8494
Add detected file language to code search ( #10256 )
...
Move langauge detection to separate module to be more reusable
Add option to disable vendored file exclusion from file search
Allways show all language stats for search
5 years ago
Lunny Xiao
21e771c41b
Fix notification ( #10331 )
5 years ago
John Olheiser
e76a64dda1
Inject SVG sprite via ajax ( #10320 )
...
* AJAX SVG
* Fix PWA
* Remove unused PWA assets
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-Authored-by: silverwind <me@silverwind.io>
5 years ago
mrsdizzie
b5f28d154d
Don't manually replace whitespace during render ( #10291 )
...
* 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>
5 years ago
zeripath
791b109d6f
Notification: queue ui.go notification-service ( #10281 )
...
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
zeripath
88986746d5
Fix Workerpool deadlock ( #10283 )
...
* Prevent deadlock on boost
* Force a boost in testchannelqueue
5 years ago
Lauris BH
a1d796f521
Index code and stats only for non-empty repositories ( #10251 )
...
Fix test and switch to unique queue
Fix MySQL support when deleting old statistics
5 years ago
Lunny Xiao
5dbf36f356
Issue search support elasticsearch ( #9428 )
...
* Issue search support elasticsearch
* Fix lint
* Add indexer name on app.ini
* add a warnning on SearchIssuesByKeyword
* improve code
5 years ago
David Svantesson
9ff4e1d2d9
Add API branch protection endpoint ( #9311 )
...
* add API branch protection endpoint
* lint
* Change to use team names instead of ids.
* Status codes.
* fix
* Fix
* Add new branch protection options (BlockOnRejectedReviews, DismissStaleApprovals, RequireSignedCommits)
* Do xorm query directly
* fix xorm GetUserNamesByIDs
* Add some tests
* Improved GetTeamNamesByID
* http status created for CreateBranchProtection
* Correct status code in integration test
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
5 years ago
Lunny Xiao
3d69bbd58f
Fix queue pop error and stat empty repository error ( #10248 )
...
* Fix queue pop error and stat empty repository error
* Fix error
5 years ago
Lunny Xiao
83a8944fcf
Add feishu webhook support ( #10229 )
...
Add feishu webhook support
5 years ago
zeripath
1125d1453b
Stop hanging issue indexer initialisation from preventing shutdown ( #10243 )
...
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
5 years ago
John Olheiser
86fdba177a
Add Octicon SVG spritemap ( #10107 )
...
* Add octicon SVG sprite
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Static prefix
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* SVG for all repo icons
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* make vendor
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Swap out octicons
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move octicons to top of less imports
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix JS
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Definitely not a search/replace
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Missed regex
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move to more generic calls and webpack
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* make svg -> make webpack
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Remove svg-sprite
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update tests
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Missed a test
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Remove svg from makefile
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Suggestions
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Attempt to fix test
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update tests
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Revert timetracking test
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Swap .octicon for .svg in less
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add aria-hidden
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Replace mega-octicon
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix webpack globbing on Windows
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Revert
Co-Authored-By: silverwind <me@silverwind.io>
* Fix octions from upstream
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix Vue and missed JS function
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add JS helper and PWA
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Preload SVG
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <matti@mdranta.net>
5 years ago
Lauris BH
ad2642a8aa
Language statistics bar for repositories ( #8037 )
...
* Implementation for calculating language statistics
Impement saving code language statistics to database
Implement rendering langauge stats
Add primary laguage to show in repository list
Implement repository stats indexer queue
Add indexer test
Refactor to use queue module
* Do not timeout for queues
5 years ago
zeripath
37892be635
Restore graceful restart on SIGHUP ( #10224 )
...
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
Lauris BH
852aeeffc0
Fix commit between two commits calculation if there is only last commit ( #10225 )
5 years ago
6543
e273817154
[API] Fix inconsistent label color format ( #10129 )
...
* update and use labelColorPattern
* add TestCases
* fix lint
* # optional for templates
* fix typo
* some more
* fix lint of **master**
5 years ago
Lars Lehtonen
0754ceca5b
modules/log: remove noop written variables ( #10182 )
...
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
5 years ago
zeripath
c512bfd09c
Prevent double waitgroup decrement ( #10170 )
...
* Prevent double waitgroup decrement
5 years ago
6543
b3c72a7c4a
[API] expose RepoOwner on Issue responce ( #10126 )
...
* add RepoOwner on issue api responce
* CI.restart()
5 years ago
Lauris BH
20c513be6e
Show download count info in release list ( #10124 )
...
* Show download count info in release list
* Use go-humanize
5 years ago
Lunny Xiao
48ce135cc9
Move PushUpdateAddDeleteTags to repository module from models ( #10106 )
...
* Move PushUpdateAddDeleteTags to repository module from models
* Fix deadlock on sqlite
5 years ago
zeripath
2c903383b5
Add Unique Queue infrastructure and move TestPullRequests to this ( #9856 )
...
* Upgrade levelqueue to version 0.2.0
This adds functionality for Unique Queues
* Add UniqueQueue interface and functions to create them
* Add UniqueQueue implementations
* Move TestPullRequests over to use UniqueQueue
* Reduce code duplication
* Add bytefifos
* Ensure invalid types are logged
* Fix close race in PersistableChannelQueue Shutdown
5 years ago
Lunny Xiao
bf1970d0bd
Improve push update options ( #10105 )
...
* Improve push update options
* fix test
* More refactor and fix lint
* fix lint
* Fix lint
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
guillep2k
70aa629ae7
Add warning when using relative path to app.ini ( #10104 )
...
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago