Lauris BH
0486b6fe45
Add restricted user filter to LDAP authentication ( #10600 )
* Add restricted user filter to LDAP authentification
* Fix unit test cases
6 years ago
Antoine GIRARD
e8d407b761
Ensure executable bit is kept on the web editor ( #10607 )
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
6 years ago
Lauris BH
8609599ee4
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>
6 years ago
zeripath
7121cc0b85
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
6 years ago
techknowlogick
b1bdd4462e
nextcloud oauth ( #10562 )
Fix #7078
6 years ago
zeripath
e81c66a53b
Change default value of DefaultCommandExecutionTimeout to match cheatsheet ( #10581 )
6 years ago
Lunny Xiao
e16aa269a1
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>
6 years ago
6543
a9229912d8
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
6 years ago
Gustavo Marin
1c1d3929eb
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>
6 years ago
6543
601f964ce8
[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>
6 years ago
zeripath
5a8a577ac0
Handle panic in indexer initialisation better ( #10534 )
* Handle panic in indexer initialisation better
* as per @guillep2k
6 years ago
zeripath
2d47970edf
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...
6 years ago
6543
42d8170b4e
inform participants on UI too ( #10473 )
* inform participants on UI too
* ajust test
* refactor getParticipantIDsByIssue
6 years ago
zeripath
23012b5099
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>
6 years ago
zeripath
5bf0ac325b
Use media links for img in post-process ( #10515 )
* use media links for img in post-process
* do not visit text of anchors
6 years ago
6543
0e8d955bd6
Fix potential bugs ( #10513 )
* use e if it is an option
* potential nil so check err first
* check err first
* m == nil already checked
6 years ago
guillep2k
8eb6da47b8
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>
6 years ago
6543
97ec108a00
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>
6 years ago
John Olheiser
6c7b78628b
Change admin dashboard to POST ( #10465 )
* Add form and convert to POST
* Redirect for flash
Signed-off-by: jolheiser <john.olheiser@gmail.com>
6 years ago
6543
7ed7f6974f
[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>
6 years ago
guillep2k
d629b04495
Various fixes in login sources ( #10428 )
6 years ago
Lunny Xiao
47460c1c34
Fix webhook bug ( #10427 )
Co-authored-by: techknowlogick <matti@mdranta.net>
6 years ago
zeripath
66aebdef7b
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>
6 years ago
zeripath
b410ea0672
Render READMEs in docs/ .gitea or .github from root ( #10361 )
* Render READMEs in docs/ .gitea or .github from root
6 years ago
Lauris BH
6ce8f85da9
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
6 years ago
Lunny Xiao
321c239dcf
Fix notification ( #10331 )
6 years ago
John Olheiser
688f0109d0
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>
6 years ago
mrsdizzie
d7b3474fa7
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 8bf49596fe .
* restart ci
* remove changes to URLJoin
* restart ci
Co-authored-by: techknowlogick <matti@mdranta.net>
6 years ago
zeripath
1fcfbab134
Notification: queue ui.go notification-service ( #10281 )
Co-authored-by: Lauris BH <lauris@nix.lv>
6 years ago
zeripath
dabafdde35
Fix Workerpool deadlock ( #10283 )
* Prevent deadlock on boost
* Force a boost in testchannelqueue
6 years ago
Lauris BH
a311e7b817
Index code and stats only for non-empty repositories ( #10251 )
Fix test and switch to unique queue
Fix MySQL support when deleting old statistics
6 years ago
Lunny Xiao
3fdd0c99f8
Issue search support elasticsearch ( #9428 )
* Issue search support elasticsearch
* Fix lint
* Add indexer name on app.ini
* add a warnning on SearchIssuesByKeyword
* improve code
6 years ago
David Svantesson
a6045fc7fb
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>
6 years ago
Lunny Xiao
0b06ffe647
Fix queue pop error and stat empty repository error ( #10248 )
* Fix queue pop error and stat empty repository error
* Fix error
6 years ago
Lunny Xiao
a1d35421d5
Add feishu webhook support ( #10229 )
Add feishu webhook support
6 years ago
zeripath
0c866cba74
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>
6 years ago
John Olheiser
dd3a8e419d
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>
6 years ago
Lauris BH
416682f73d
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
6 years ago
zeripath
96569dbfc4
Restore graceful restart on SIGHUP ( #10224 )
Co-authored-by: Lauris BH <lauris@nix.lv>
6 years ago
Lauris BH
5323ee6060
Fix commit between two commits calculation if there is only last commit ( #10225 )
6 years ago
6543
9d21f27433
[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**
6 years ago
Lars Lehtonen
88a175bb17
modules/log: remove noop written variables ( #10182 )
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
6 years ago
zeripath
603b124755
Prevent double waitgroup decrement ( #10170 )
* Prevent double waitgroup decrement
6 years ago
6543
fa3066094d
[API] expose RepoOwner on Issue responce ( #10126 )
* add RepoOwner on issue api responce
* CI.restart()
6 years ago
Lauris BH
83b5e8be25
Show download count info in release list ( #10124 )
* Show download count info in release list
* Use go-humanize
6 years ago
Lunny Xiao
be45245e67
Move PushUpdateAddDeleteTags to repository module from models ( #10106 )
* Move PushUpdateAddDeleteTags to repository module from models
* Fix deadlock on sqlite
6 years ago
zeripath
bde89c91d6
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
6 years ago
Lunny Xiao
83f9d46264
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>
6 years ago
guillep2k
d266549c34
Add warning when using relative path to app.ini ( #10104 )
Co-authored-by: Lauris BH <lauris@nix.lv>
6 years ago
guillep2k
ee683b8652
Implement "embedded" command to extract static resources ( #9982 )
* draft
* Implement extract command
* Fix nits and force args on extract
* Add !bindata stub, support Windows, fmt
* fix vendored flag
* Remove leading slash for matching
* Add docs
* Fix typos
* Add embedded view command
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 years ago