2274 Commits (baefea311f1a66a97f9a2779ad3342f4f8167d28)

Author SHA1 Message Date
Lunny Xiao b3000ae623 Fix create team, update team missing units (#5188) 6 years ago
Lunny Xiao c5d098c32e fix bug when users have serval teams with different units on different repositories (#5307) 6 years ago
Jonas Bröms 599adde1bc Add option to disable automatic mirror syncing. (#5242)
Setting the interval to 0 will disable to automatic syncing.
6 years ago
Stanislav 078c404c3b Prometheus endpoint (#5256)
* Add prometheus collector and route

* dep ensure -add github.com/prometheus/client_golang/prometheus

* dep ensure -update github.com/golang/protobuf

* add metrics to reserved usernames

* add comment head in metrics package

* fix style imports

* add metrics settings

* add bearer token check

* mapping metrics configs

* fix lint

* update config cheat sheet

* update conf sample, typo fix
6 years ago
kolaente 225c48982b Fixed heatmap not working in mssql (#5248) 6 years ago
zeripath 7d9a191a3c Create AuthorizedKeysCommand (#5236) 6 years ago
zeripath 00533d3870 Keys API changes (#4960)
* Add private information to the deploy keys api

This commit adds more information to the deploy keys to allow for back
reference in to the main keys list. It also adds information about the
repository that the key is referring to.

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

* Add private information to the user keys API

This adjusts the keys API to give out private information to user keys if
the current user is the owner or an admin.

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

* Add ability to search keys by fingerprint

This commit adds the functionality to search ssh-keys by fingerprint of
the ssh-key. Deploy keys per repository can also be searched. There is
no current clear API point to allow search of all deploy keys by
fingerprint or keyID.

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

* Add integration test
6 years ago
Stanislav 794049e824 fix compatibility heatmap with mysql 8 (#5232) 6 years ago
Jerry Jacobs 22ad514297 Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094)
* Fix issue where ecdsa and other key types are not synced from LDAP authentication provider fixes #5092

* integrations/auth_ldap_test.go: Add Hermes Conrad new ecdsa-sha2-nistp256 publickey fingerprint

* integrations/auth_ldap_test.go: Use ssh-keygen -lf <filename> -E sha256
6 years ago
Lunny Xiao 10370651fc This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql (#5136)
* This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql

* fix tests
6 years ago
Lunny Xiao e61c6cd3db fix data race on migrate repository (#5224) 6 years ago
Lunny Xiao 735b12eaf0
fix sqlite lock (#5210) 6 years ago
Lunny Xiao 70a80e31cf fix sqlite and mssql lock (#5214) 6 years ago
Lunny Xiao 2b7c366f64
fix sqlite lock (#5184)
* fix sqlite lock

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>
6 years ago
Lunny Xiao e7822473e9 Fix race on updatesize (#5190)
* fix race on updatesize

* fix more repoPath
6 years ago
Lunny Xiao 5f938c0c78
Fix sqlite lock (#5176)
* fix sqlite lock

* fix sqlite lock on getUnitType
6 years ago
Antoine GIRARD 70ad46133f Fix JSON result of empty array (#5154) 6 years ago
kolaente 6759237eda User action heatmap (#5131)
* Added basic heatmap data

* Added extra case for sqlite

* Built basic heatmap into user profile

* Get contribution data from api & styling

* Fixed lint & added extra group by statements for all database types

* generated swagger spec

* generated swagger spec

* generated swagger spec

* fixed swagger spec

* fmt

* Added tests

* Added setting to enable/disable user heatmap

* Added locale for loading text

* Removed UseTiDB

* Updated librejs & moment.js

* Fixed import order

* Fixed heatmap in postgresql

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-Authored-By: kolaente <konrad@kola-entertainments.de>

* Added copyright header

* Fixed a bug to show the heatmap for the actual user instead of the currently logged in

* Added integration test for heatmaps

* Added a heatmap on the dashboard

* Fixed timestamp parsing

* Hide heatmap on mobile

* optimized postgresql group by query

* Improved sqlite group by statement
6 years ago
Mura Li 9458880c06 Increase the retry limit to 20 times and the interval to 200ms (#5134)
The original settings has less tolerance and would fail on some
environments.
6 years ago
Filip Navara 9b2fcadeef Fix SQL quoting (#5117)
`show` is keyword in MySQL and has to be quoted to reference a column name. Use grave accents (ASCII code 96) for quoting to match rest of the source code. It's non-standard SQL, but it's supported by SQLite and MySQL.

Signed-off-by: Filip Navara <navara@emclient.com>
6 years ago
Oleg Kovalov 5a4648cdd6 Remove check for negative length (#5120) 6 years ago
Mura Li 583b1b8429 Retry test-fixtures loading in case of transaction rollback (#5125) 6 years ago
Oleg Kovalov cabdf84f1f Use named const instead of a raw string (#5115) 6 years ago
Oleg Kovalov a908b29a74 Remove duplicated if bodies (#5121) 6 years ago
Lunny Xiao 616b8f42f9 Fix deadlock when sqlite (#5118)
* fix deadlock when sqlite

* fix clonelink deadlock on sqlite
6 years ago
Oleg Kovalov fef0410b92 Make switch more clear (#5119) 6 years ago
Lunny Xiao ea619b39b2
Add notification interface and refactor UI notifications (#5085)
* add notification interface and refactor UI notifications

* add missing methods on notification interface and notifiy only issue status really changed

* implement NotifyPullRequestReview for ui notification
6 years ago
zeripath dd62ca7ba9 Add support for search by uid (#4876)
Signed-off-by: Andrew Thornton <art27@cantab.net>
6 years ago
Bo-Yi Wu 1e34413238 refactor: err != nil check, just return error instead (#5093) 6 years ago
Bo-Yi Wu 486e989a39 feat(topic): search keyword by splitting provided values by , (#4939) 6 years ago
kolaente e79e9248fd Fix regex to support optional end line of old section in diff hunk (#5096)
+ Named groups in reges for easier group parsing
6 years ago
Lunny Xiao 970c690681 fix release creation via API (#5076)
* fix release creation via API

* fix release create tests
6 years ago
Jonas Franz 94cd7bb25b Hide outdated comments in file view (#5017)
* Hide outdated comments in file view

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit test by adding "invalidated" comment to fixtures

Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Lanre Adelowo e6d54d511d make sure milestone listing is consistent across board (#4987) 6 years ago
SagePtr 043ab2cd59 Fix null pointer dereference in ParseCommitWithSignature (#4962) 6 years ago
crito d6b97c8557 fix url in discord webhook (#4953)
opening issues generates a webhook to discord that contains
a url to the gitea api. the message title in discord is therefore
referencing to the api instead of the issue itself.
6 years ago
Lauris BH 4befec242a
Code review UI improvements and bugfixes (#4682)
* Code review UI improvements

* More fixes to dark theme

* Style fix

* Fix to allow add code review comments only on review files tab

* More readability dark style fixes

* Fix commenting on deleted files. Fixes #4752

* Fix line blame getting for multiple corner cases
6 years ago
Lanre Adelowo acb6f8a518 make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945) 6 years ago
linweijie2012 f98040ad50 fix bug forget to remove Stopwatch when remove repository (#4928) 6 years ago
Lanre Adelowo 126ba796dc Force user to change password (#4489)
* redirect to login page after successfully activating account

* force users to change password if account was created by an admin

* force users to change password if account was created by an admin

* fixed build

* fixed build

* fix pending issues with translation and wrong routes

* make sure path check is safe

* remove unneccessary newline

* make sure users that don't have to view the form get redirected

* move route to use /settings prefix so as to make sure unauthenticated users can't view the page

* update as per @lafriks review

* add necessary comment

* remove unrelated changes

* support redirecting to location the user actually want to go to before being forced to change his/her password

* run make fmt

* added tests

* improve assertions

* add assertion

* fix copyright year

Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
6 years ago
SagePtr 10a2a904d7 Fix bug when repo remained bare if multiple branches pushed (#4923) 6 years ago
Bo-Yi Wu ea20adaa84
feat(repo): support search repository by topic name (#4505)
* feat(repo): support search repository by topic name
6 years ago
Lauris BH fa4663e61e Add push webhook support for mirrored repositories (#4127) 6 years ago
SagePtr bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810)
* Fix redirect with non-ascii branch names (#4764)

* Add integration tests for non-ascii branch redirect

* Fix mysql test and coverage test
6 years ago
SagePtr 303d7f7e9c Do not autocreate directory for new user/orgs (#4828) (#4849) 6 years ago
SagePtr 4ae5a54c1f Fix missing release title in webhook (#4783) (#4796) 6 years ago
techknowlogick 194a11eb11
Don't disclose emails of all users when sending out emails (#4664) 6 years ago
Russell Aunger 127f477056 MySQL TLS (#4642) 6 years ago
Lanre Adelowo 33bc2ebdfa Make sure to reset commit count in the cache on mirror syncing (#4720)
* Make sure to reset commit count in the cache on mirror syncing

* reset count of commits in all branches
6 years ago
SagePtr 50ce19eff7 Fix failure on creating pull request with assignees (#4419) (#4583) 6 years ago
nemoinho ca112f0a04 Add whitespace handling to PR-comparsion (#4683)
* Add whitespace handling to PR-comparsion

In a PR we have to keep an eye on a lot of different things. But sometimes the
bare code is the key-thing we want to care about and just don't want to care
about fixed indention on some places. Especially if we follow the pathfinder
rule we face a lot of these situations because these changes don't break the
code in many languages but improve the readability a lot.

So this change introduce a fine graned button to adjust the way how the
reviewer want to see whitespace-changes within the code.

The possibilities reflect the possibilities from git itself except of the
`--ignore-blank-lines` flag because that one is also handled by `-b` and is
really rare.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
6 years ago
Julien Tant 7781e8cef2 Disable merging a WIP Pull request (#4529)
* prevent pull request to be merged when PR is a WIP

* add tests

* add helper to prepend WIP: in PR title

* move default wip prefixes into settings

* use configurable WIP prefixes in javascript and default to first one in templates

* add documentation

* add unit test on pull model

Signed-off-by: Julien Tant <julien@craftyx.fr>
6 years ago
Lunny Xiao 52c2cb15db add vendor to user reserved words and format words list according alphabet (#4685) 6 years ago
Lunny Xiao 578cf52ce5
Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0

* Optimize if structure
6 years ago
SagePtr 32145b6de8 Push whitelist now doesn't apply to branch deletion (#4601) (#4607) 6 years ago
Dennis Menschel 9c0a374f3f Fix integer constant overflows in tests (#4616)
* Use integer limit value [1] instead of hard-coded magic constant for
  NonexistentID.

* Explicitly use int64 in order to avoid the following errors on 32 bit
  architectures:

  # code.gitea.io/gitea/integrations
  ./api_admin_test.go:50:34: constant 9223372036854775807 overflows int
  ./api_token_test.go:47:34: constant 9223372036854775807 overflows int
  [...]
  # code.gitea.io/gitea/models
  ./action_test.go:179:15: constant 9223372036854775807 overflows int

[1] https://golang.org/pkg/math/#pkg-constants

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
6 years ago
Lauris BH 6e64f9db8e Pull request review/approval and comment on code (#3748)
* Initial ui components for pull request review

* Add Review
Add IssueComment types

Signed-off-by: Jonas Franz <info@jonasfranz.software>

(cherry picked from commit 2b4daab)
Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replace ReviewComment with Content

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add load functions
Add ReviewID to findComments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add create review comment implementation
Add migration for review
Other small changes

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Simplified create and find functions for review

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Moved "Pending" to first position

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add GetCurrentReview to simplify fetching current review

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Preview for listing comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Move new comment form to its own file

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Implement Review form
Show Review comments on comment stream

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for single comments
Showing buttons in context

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add pending tag to pending review comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit tests for Review

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fetch all review ids at once
Add unit tests

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Improved comment rendering in "Files" view by adding Comments to DiffLine

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for invalidating comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Switched back to code.gitea.io/git

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Moved review migration from v64 to v65

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Rebuild css

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Improve translations

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit tests by updating fixtures and updating outdated test

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Comments will be shown at the right place now

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for deleting CodeComments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix problems caused by files in subdirectories

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for showing code comments of reviews in conversation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for "Show/Hide outdated"

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update code.gitea.io/git

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add support for new webhooks

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update comparison

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Resolve conflicts

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Minor UI improvements

* update code.gitea.io/git

* Fix ui bug reported by @lunny causing wrong position of add button
Add functionality to "Cancel" button
Add scale effects to add button
Hide "Cancel" button for existing comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Prepare solving conflicts

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Show add button only if no comments already exist for the line

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add missing vendor files

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Check if reviewer is nil

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Show forms only to users who are logged in

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Revert "Show forms only to users who are logged in"

This reverts commit c083682

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Save patch in comment
Render patch for code comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add link to comment in code

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add reply form to comment list
Show forms only to signed in users

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add 'Reply' as translatable
Add CODE_COMMENT_LINES setting

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix problems introduced by checking for singed in user

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add v70

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update generated stylesheet

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix preview
Beginn with new review comment patch system

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add new algo to generate diff for line range
Remove old algo used for cutting big diffs (it was very buggy)

* Add documentation and example for CutDiffAroundLine

* Fix example of CutDiffAroundLine

* Fix some comment UI rendering bugs

* Add code comment edit mode

* Send notifications / actions to users until review gets published
Fix diff generation bug
Fix wrong hashtag

* Fix vet errors

* Send notifications also for single comments

* Fix some notification bugs, fix link

* Fix: add comment icon is only shown on code lines

* Add lint comment

* Add unit tests for git diff

* Add more error messages

* Regenerated css

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* fmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Regenerated CSS with latest less version

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix test by updating comment type to new ID

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Introducing CodeComments as type for map[string]map[int64][]*Comment
Other minor code improvements

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix data-tab issues

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Remove unnecessary change

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* refactored checkForInvalidation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Append comments instead of setting

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Use HeadRepo instead of BaseRepo

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update migration

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Regenerated CSS

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add copyright

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update index.css

Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Lunny Xiao 9c354a539a
fix bugs when too many IN variables (#4594) 6 years ago
SagePtr c1224124ea Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525) 6 years ago
techknowlogick adf3f004b6
Switch plaintext scratch tokens to use hash instead (#4331) 6 years ago
SagePtr ac968c3c6f Fix out-of-transaction query in removeOrgUser (#4521) (#4522) 6 years ago
Lukas Treyer be4ec0cbba env var GITEA_PUSHER_EMAIL (#4516)
* env var GITEA_PUSHER_EMAIL

* set pusher email only if email address is not private
6 years ago
Kjell Kvinge ba358ecbf5 Make max commits in graph configurable (#4498) 6 years ago
Lauris BH ae9dd239fb Fix migration from older releases (#4495) 6 years ago
Kjell Kvinge bed623600d Accept 'Data:' in commit graph (#4487) 6 years ago
Lauris BH 0c59edaafa Update xorm to latest version and fix correct `user` table referencing in sql (#4473) 6 years ago
kolaente 1bff02de55 Added dependencies for issues (#2196) (#2531) 6 years ago
Lauris BH e95417ea2c Fix column droping for MSSQL that need new transaction for that (#4440) 6 years ago
Guido Diepen 7c943b1cad Implemented hover text showing user FullName (#4261)
For each action that is displayed in either the public activity overview
of a user, or in the dashboard overview, the link to the username is now
extended with a title attribute to show the FullName as hover text

Signed-off-by: Guido Diepen <site-github@guidodiepen.nl>
6 years ago
Lauris BH 54fedd4070 Add default merge options when adding new repository (#4369) 6 years ago
Lunny Xiao b46066f17c fix repository last updated time update when delete a user who watched the repo (#4363) 6 years ago
Antoine GIRARD 74f9f98f78 Simply remove tidb and deps (#3993) 6 years ago
cezar97 51ba3df5ff Add `noreferrer` to rel='noopener` for <a> tags (#4328) 6 years ago
Kim "BKC" Carlbäcker cbee921c28 Limit uploaded avatar image-size to 4096x3072 by default (#4353) 6 years ago
Alexey Terentyev 91ff87c0e5 Fixed violation of the unique constraint for v68 migration (#4297) 6 years ago
David Schneiderbauer 0b3ea42847 hide issues from org private repos w/o team assignment (#4034) 6 years ago
Alexey Terentyev 46d19c4676 Fix topics addition (Another solution) (#4031) (#4258)
* Added topics validation, fixed repo topics duplication (#4031)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added tests

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed fmt

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added comments to exported functions

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Deleted RemoveDuplicateTopics function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fixed lint

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added Copyright

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added query solution for duplicates

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed migration query

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Changed RegExp. Fixed migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed test for changed regexp

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Removed validation log messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed validate function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
6 years ago
techknowlogick d84da8fe65 Change parsing of postgresql settings (#4275)
* Change parsing of postgresql settings

Fix #4200

* Add copyright

* update postgresql connection string

* add tests
6 years ago
David Schneiderbauer a93f13849c Fix not removed watches on unallowed repositories (#4201) 6 years ago
Lauris BH 2b8c0bb5e2 Delete reactions added to issues and comments when deleting repository (#4232) 6 years ago
Lunny Xiao 406031d3cc fix bug when deleting a release (#4207) 6 years ago
Lunny Xiao da898d4066 fix delete comment bug (#4216) 6 years ago
Christopher Medlin b5f61f1d15 Improve logging for e-mail and OpenID already in use errors (#4174) 6 years ago
Magnus Lindvall cdb9478774 LDAP Public SSH Keys synchronization (#1844)
* Add LDAP Key Synchronization feature

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Add migration: add login source id column for public_key table

* Only update keys if needed

* Add function to only list pubkey synchronized from ldap

* Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it.

* Only get keys belonging to current login source id

* Set default login source id to 0

* Some minor cleanup. Add integration tests (updete dep testify)
6 years ago
Alexey Terentyev b908ac9fab Added repository search ordered by stars or forks. Forks column in admin repo list. (#3969)
* Added repository search order by stars or forks.
Added Forks column to admin repository list.

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed search repo template

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
6 years ago
Lunny Xiao 4ec8551490
fix webhook bug of response info is not displayed in UI (#4000) 6 years ago
奶爸 d94472e89b fix #4003 (#4004)
Webhook and hook_task not cleaned up when delete repository
6 years ago
Lunny Xiao 6bdc556b7f
Fix some webhooks bugs (#3981)
* fix some webhooks bugs

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix test

* fix clearlabels

* fix pullrequest webhook bug fix #3492

* update release webhook description

* remove unused code

* fix push webhook in pull request

* small changes
6 years ago
Jonas Franz 951309f76a Add support for FIDO U2F (#3971)
* Add support for U2F

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add vendor library
Add missing translations

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Minor improvements

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library
Add U2F error handling

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F login page to OAuth

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Move U2F user settings to a separate file

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit tests for u2f model
Renamed u2f table name

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix problems caused by refactoring

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F documentation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Remove not needed console.log-s

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add default values to app.ini.sample
Add FIDO U2F to comparison

Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Lunny Xiao 24941a1046
Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* load attributes when created release

* update comparsion doc
6 years ago
Lauris BH ff3971b830 Add LDAP integration tests (#3897)
* Add LDAP service for tests

* Add LDAP login source and test user sign-in

* Add checks to test if user data is correct

* Add LDAP user sync test

* Add failed user sign-in test
6 years ago
Lauris BH 382e7276b8 Fix multiple asssingee table migration (#3931) 6 years ago
kolaente 95f2e2b57b Multiple assignees (#3705) 6 years ago
Travis Parker 73370b8cf7 consistent IsOverdue field name capitalization (#3909)
Milestone.IsOverDue vs Issue.IsOverdue, the former was also causing the
milestone list page template to fail to render if any milestones have a
due date assigned.

Signed-off-by: Travis J Parker <travis.parker@gmail.com>
6 years ago
kolaente 1fdf560678 Added user language setting (#3875)
* Added user language setting

* Added translation string for setting

* Fixed import order + typo

* improved checking if the user has a language saved in the db

* The current saved language is now set a default inside the dropdown

* fmt

* When a user signs in and doesn't have a language saved, the current browser language is saved

* updated gitea-sdk

* Merge branch 'master' of https://github.com/go-gitea/gitea into save-user-language

# Conflicts:
#	models/migrations/migrations.go
#	models/migrations/v62.go

* Made tests work again

* trigger CI

* trigger CI

* fmt

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* When loggin in, only the language col gets updated instead of everything
6 years ago
Lauris BH 1e1ece8f3d
Do not allow to reuse TOTP passcode (#3878) 6 years ago
Bo-Yi Wu c58e1e437b test: reduce testing time. (#3885) 6 years ago
Lauris BH 9495429982
Add "error" as reserved username (#3882) 6 years ago
Lauris BH 5ffdf9388b
Fix to use only needed columns from tables to get repository git paths (#3870) 6 years ago
kolaente 1a97030017 Issue due date (#3794)
* Started adding deadline to ui

* Implemented basic issue due date managing

* Improved UI for due date managing

* Added at least write access to the repo in order to modify issue due dates

* Ui improvements

* Added issue comments creation when adding/modifying/removing a due date

* Show due date in issue list

* Added api support for issue due dates

* Fixed lint suggestions

* Added deadline to sdk

* Updated css

* Added support for adding/modifiying deadlines for pull requests via api

* Fixed comments not created when updating or removing a deadline

* update sdk (will do properly once go-gitea/go-sdk#103 is merged)

* enhanced updateIssueDeadline

* Removed unnessecary Issue.DeadlineString

* UI improvements

* Small improvments to comment creation
+ ui & validation improvements

* Check if an issue is overdue is now a seperate function

* Updated go-sdk with govendor as it was merged

* Simplified isOverdue method

* removed unessecary deadline to 0 set

* Update swagger definitions

* Added missing return

* Added an explanary comment

* Improved updateIssueDeadline method so it'll only update `deadline_unix`

* Small changes and improvements
* no need to explicitly load the issue when updating a deadline, just use whats already there
* small optimisations

* Added check if a deadline was modified before updating it

* Moved comment creating logic into its own function

* Code cleanup for creating deadline comment

* locale improvement

* When modifying a deadline, the old deadline is saved with the comment

* small improvments to xorm session handling when updating an issue deadline
+ style nitpicks

* style nitpicks

* Moved checking for if the user has write acces to middleware
6 years ago
Tris Forster 85d14cc229 Symlink icons (#1416) (#3826)
* Updated vendor code for code.gitea.io/git

* Display symlinks correctly for files and directories

* Added symlink tests

* Applied silverwinds stylesheet patch

Signed-off-by: Tris Forster <tris.git@shoddynet.org>
6 years ago
Lauris BH 181b3a8f09 Fix path cleanup in multiple places (#3871) 6 years ago
Ethan Koenig 7ea4bfc561 API endpoint for testing webhook (#3550)
* API endpoint for testing webhook

* Empty commit to rerun CI
6 years ago
Lauris BH 5a62eb30df
Store OAuth2 session data in database (#3660)
* Store OAuth2 session data in database

* Rename table to `oauth2_session` and do not skip xormstorage initialization error
6 years ago
Jonas Franz 8d5f58d834 Shows total tracked time in issue and milestone list (#3341)
* Show total tracked time in issue and milestone list
Show total tracked time at issue page

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Optimizing TotalTimes by using SumInt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fixing wrong total times for milestones caused by a missing JOIN
Adding unit tests for total times

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Logging error instead of ignoring it

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Correcting spelling mistakes

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change error message to a short version

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add error handling to TotalTimes
Add variable for totalTimes

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Introduce TotalTrackedTimes as variable of issue
Load TotalTrackedTimes by loading attributes of IssueList
Load TotalTrackedTimes by loading attributes of single issue
Add Sec2Time as helper to use it in templates

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fixed test + gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Load TotalTrackedTimes via MilestoneList instead of single requests

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix test

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change comment from SQL query to description

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Check if timetracker is enabled

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix test by enabling timetracking

Signed-off-by: Jonas Franz <info@jonasfranz.de>
6 years ago
kolaente fd8d6405c8 Fix only updated_unix when adding a comment (#3855) 6 years ago
Morgan Bazalgette 320c9817bc Don't force due date to current time (#3830)
Fixes #3827
6 years ago
Lunny Xiao bec69f702b
Add topic support (#3711)
* add topic models and unit tests

* fix comments

* fix comment

* add the UI to show or add topics for a repo

* show topics on repositories list

* fix test

* don't show manage topics link when no permission

* use green basic as topic label

* fix topic label color

* remove trace content

* remove debug function
6 years ago
Michael Kuhn f321980a32 Fix typo in deleteUser (#3781)
num_watches was used where num_stars should have been used.
6 years ago
Bwko 8ee45eb614 Add EnableTimetracking option to app settings (#3719) 6 years ago
Evan Sherwood 6b6c414bc3 Enhance healthcheck for database connectivity (#3754)
Modify the call to ping the database to fail gracefully if the
database has not yet been configured by the end user, such as
after a clean install. This allows /healthcheck to return a 200
with a modified status message instead of causing a PANIC.

Signed-off-by: Evan Sherwood <evan@sherwood.io>
6 years ago
Jonas Franz 3e06490d38 Add Size column to attachment (#3734)
* Add size column to attachment
Migrate attachments by calculating file sizes

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Calculate attachment size on creation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Log error instead of returning error

Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Lunny Xiao d877bf7e15
Add config option to enable or disable log executed SQL (#3726)
* add config option to enable or disable log executed SQL

* rename ShowSQL to LogSQL
6 years ago
Lunny Xiao 45d1fc03cb
fix go vet error (#3740) 6 years ago
Allen Wild 15c6bb500b Add repository setting to enable/disable health checks (#3607)
New Feature:
  * Repository struct field for IsFsckEnabled (default true of course)
  * Admin Settings section on repo options page, accessible only by
    admin users

Possible Enhancements:
  * There's no way to force running health checks on all repos
    regardless of their IsFsckEnabled setting. This would be useful if
    there were an admin API or dashboard button to run fsck immediately.

Issue: https://github.com/go-gitea/gitea/issues/1712
Signed-off-by: Allen Wild <allenwild93@gmail.com>
6 years ago
Bwko 321cc2a3d0 Set default branchname on first push (#3715) 6 years ago
Chri-s 9350ba7947 Add protected branch whitelists for merging (#3689)
* Add database migrations for merge whitelist

* Add merge whitelist settings for protected branches

* Add checks for merge whitelists
6 years ago
Jonas Franz 43fc430c07 Improve release page UI (#3693)
* Improve release page ui by adding size

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation to a.MustSize()

Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Lunny Xiao 9e5d0a09eb
Global code search support (#3664)
* add global code search on explore

* fix bug when no anyone public repos

* change the icon

* fix typo and add UnitTypeCode check for login non-admin user

* fix ui description when no match
6 years ago
Chri-s a2a49c93c7 Added checks for protected branches in pull requests (#3544)
* Added checks for protected branches in pull requests

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Moved check for protected branch into new function CheckUserAllowedToMerge

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Removed merge conflict lines from last commit

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Explicit check for error type in ViewIssue

Signed-off-by: Christian Wulff <NChris@posteo.net>
6 years ago
Lauris BH c0d41b1b77 Add label descriptions (#3662)
* Add label descriptions

* Add default descriptions to label template
6 years ago
Lauris BH de8a091767 Fix MySQL and PostgreSQL column drop SQL (#3649) 6 years ago
Lauris BH dc4afef07f Fix column removal in MSSQL (#3638)
* Fix column removal in MSSQL

* Use xorm session in MSSQL drop column operations

* Add transaction as MSSQL alter table is transactional
6 years ago
Jonas Franz 9a5e628a7e Add Attachment API (#3478)
* Add Attachment API
* repos/:owner/:repo/releases (add attachments)
* repos/:owner/:repo/releases/:id (add attachments)
* repos/:owner/:repo/releases/:id/attachments
* repos/:owner/:repo/releases/:id/attachments/:attachment_id

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Add unit tests for new attachment functions
Fix comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* fix lint

* Update vendor.json

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* remove version of sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit tests
Add missing license header

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add CreateReleaseAttachment
Add EditReleaseAttachment
Add DeleteReleaseAttachment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add filename query parameter for choosing another name for an attachment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix order of imports

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Restricting updatable attachment columns

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update go-sdk
Replace Attachments with Assets

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Update go-sdk

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Updating go-sdk and regenerating swagger

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add missing file of go-sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change origin of code.gitea.io/sdk to code.gitea.io/sdk
Update code.gitea.io/sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update swagger

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update updateAttachment
6 years ago
Morgan Bazalgette b730498f02 Don't write to log NoCommitterAccount (#3621)
* Don't write to log NoCommitterAccount

It's way too verbose, and the information is also printed to the user
already. Fixes #3602.

* ignore err only if it's a ErrUserNotExist

* Replace with IsErrUserNotExist
6 years ago
Bo-Yi Wu 78b54b49fa
fix: Add feed for organization (#3594)
* feat: Add feed for organization

* fix: testing

* fix: testing

* fix: testing

* fix: testing
6 years ago
Allen Wild 8606d9f5bc Add admin dashboard option to run health checks (#3606)
There's one for git gc, why not git fsck too?

Also add a couple more trace logs to GitFsck to see progress
6 years ago
Wendell Sun d2d0aea8a1 Fix the protected branch panic issue (#3567) 6 years ago
Wendell Sun 2d1c5c3756 Fix remove team member issue (#3566)
Put sess.Commit() out of the RemoveOrgUser function

Add an empty line to separate import packages
6 years ago
Wendell Sun 19bf4ddf80 Fix query protected branch bug (#3563)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
6 years ago
Bo-Yi Wu 845ba9d153 fix: if Mirrors repo no content is fetched, updated time should not b… (#3551)
* fix: if Mirrors repo no content is fetched, updated time should not be changed

* fix: sync update time from mirror repo.

* fix: one single session.

* update comment.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
6 years ago
Bo-Yi Wu 04b3e8cbdc
refactor: reduce sql query in retrieveFeeds (#3547) 6 years ago
Ethan Koenig d27d720f05 Use unique temp dirs in unit tests (#3494)
* Use unique temp dirs in unit tests

* Remove temp dirs after tests run

* os.RemoveAll -> removeAllWithRetry
6 years ago
Wendell Sun 2f5c1ba1db Bug fix for repo releases sorted (#3522)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>

Use TimeStampNow function
6 years ago
Lauris BH 58893384e8 Add issue closed time column to fix activity closed issues list (#3537)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
6 years ago
Lauris BH 3a9c698821
Force remove test repo root path in case previous test is still locking it (#3528)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
6 years ago
Codruț Constantin Gușoi 96c268c0fc Implements generator cli for secrets (#3531)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
6 years ago
Ethan Koenig 6eaeb01ecf Update code.gitea.io/git (#3482) 6 years ago
Codruț Constantin Gușoi 011f128c89 Fixes missing avatars in offline mode (#3471)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
6 years ago
Ethan Koenig a89592d4ab Reduce repo indexer disk usage (#3452) 6 years ago
Lauris BH 283e87d814
Fix rendering of wiki page list if wiki repo contains other files (#3454)
* Fix rendering of wiki page list if wiki repo contains other files

* Improve wiki filename tests
6 years ago
Ethan Koenig b16c84de7b Fix synchronization bug in repo indexer (#3455) 6 years ago
Morgan Bazalgette 17655cdf1b Enable caching on assets and avatars (#3376)
* Enable caching on assets and avatars

Fixes #3323

* Only set avatar in user BeforeUpdate when there is no avatar set

* add error checking after stat

* gofmt

* Change cache time for avatars to an hour
6 years ago
Antoine GIRARD b3fd94c13d Add sensitive headers (#3429)
* Add HeaderWithSensitiveCase methods to respect casing

* Update webhook.go
7 years ago
Ethan Koenig 46c7fe371d Fix PR merge error (#3421) 7 years ago
Ethan Koenig 3968c1149e Fix SQL type error for webhooks (#3424) 7 years ago
Ethan Koenig bac6ac033a Fix race condition in repo renaming (#3418) 7 years ago
Ethan Koenig c55a027da3 Fix empty checkout bug (#3419) 7 years ago
Wendell Sun b627f1131b Change local copy origin url after repository rename (#3399)
Fix #3378
7 years ago
Antoine GIRARD 9e842c8a72 Fix SSH auth lfs locks (#3152)
* Fix SSH auth LFS locks

* Activate SSH/lock test

* Remove debug

* Follow @lunny recommendation for AfterLoad method
7 years ago
Antoine GIRARD 1ce3572409 Remove useless check (#3384)
In #3377, I put check inside all write key function. This one is useless no.
7 years ago
Sandro Santilli 05ab747054 Force-push to base repo's ref/pull/#/head (#3393)
* Force-push to base repo's ref/pull/#/head

Fixes force-pushing to pull request branches, otherwise failing with:

[...gitea/models/pull.go:1022 AddTestPullRequestTask()] [E] PushToBaseRepo: Push: exit status 1 - To /path/to/gitea-repositories/org/repo.git
 ! [rejected]        issue-fix -> refs/pull/20/head (non-fast-forward)

* format
7 years ago
Lauris BH ca306985d3
Change how merged PR commit info are prepared (#3368)
* Change how merged PR commits and diff are made

* Update code.gitea.io/git dependency

* Fix typo

* Remove unneeded local variable
7 years ago
Ethan Koenig b0d5bb909b Delete indexer DB entries when (re)creating index (#3385)
* comment
7 years ago
Antoine GIRARD 095fb9f2e3 Add integrations tests from git cli (#3377)
* test: integration add git cli tests

Extracted form for easing review process and debug #3152

* test: integration add git cli big file commit

* fix:  Don't rewrite key if internal server
7 years ago
Lauris BH a68bf746a4
Change reserved avatar name to correct - avatars (#3375) 7 years ago
Ethan Koenig ccdb94992d Asynchronously populate the repo indexer (#3366)
* Populate repo indexer in background

* Check if no repos exist

* race cond
7 years ago
Bo-Yi Wu 7a2a3fbafc refactor(model): update user method. (#3360) 7 years ago
Kim "BKC" Carlbäcker e5b8b4b5ec Cleanup models.User.HashPassword (#3334) 7 years ago
Lauris BH be1330ec89 Remove hardcoded paths to fix randomly failing tests (#3347)
* Remove hardcoded paths to fix randomly failing tests

* Use correct function for merge path
7 years ago
Morgan Bazalgette 674cfb7cac Change EncodePasswd to HashPassword (#3329)
* Change EncodePasswd to HashPassword

* Create test+benchmark for HashPassword
7 years ago
Ethan Koenig f48680888c Remove IsOwner, NumTeams from OrgUser (#3269) 7 years ago
Antoine GIRARD cb868b7851 Add missing indexer doc in configuration (#3324)
* Add missing indexer doc in configuration

* Unify MAX_FILE_SIZE to 1024 * 1024
7 years ago
Lunny Xiao 835b890329 fix bug when a user delete but assigned on issue (#3318) 7 years ago
Vlad Temian e78786ef39 Writable deploy keys (closes #671) (#3225)
* Add is_writable checkbox to deploy keys interface

* Add writable key option to deploy key form

* Add support for writable ssh keys in the interface

* Rename IsWritable to ReadOnly

* Test: create read-only and read-write deploy keys via api

* Add DeployKey access mode migration

* Update gitea sdk via govendor

* Fix deploykey migration

* Add unittests for writable deploy keys

* Move template text to locale

* Remove implicit column update

* Remove duplicate locales

* Replace ReadOnly field with IsReadOnly method

* Fix deploy_keys related integration test

* Rename v54 migration with v55

* Fix migration hell
7 years ago
Lauris BH 8ac1501ad7
Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Pull request options migration and UI in settings

* Add ignore whitespace functionality

* Fix settings if pull requests are disabled

* Fix migration transaction

* Merge with Rebase functionality

* UI changes and related functionality for pull request merging button

* Implement squash functionality

* Fix rebase merging

* Fix pull request merge tests

* Add squash and rebase tests

* Fix API method to reuse default message functions

* Some refactoring and small fixes

* Remove more hardcoded values from tests

* Remove unneeded check from API method

* Fix variable name and comment typo

* Fix reset commit count after PR merge
7 years ago
Sandro Santilli a192f3052e Serve pull request .diff files (#3293)
* Serve pull request .diff files

Closes #3259

* Add test for pull request redirection and .diff access

* Typo

* There's no need to test for pr.BaseRepo being nil after calling GetBaseRepo
7 years ago
Alberto González Palomo 30fb81c71e Use issue number/index instead of id for API URL. (#3298)
Using the API calls, the issue objects retrieved by
/repos/{owner}/{repo}/issues
contains the wrong value in the "url" field:
it uses the "id" value instead of the "number" value.

For instance, in a new repo in try.gitea.io with just one issue:
[{
  "id": 896,
  "url": "https://try.gitea.io/api/v1/repos/AlbertoGP/uno/issues/896",
  "number": 1,
   ...
}]

The given URL does not work, but if you replace the "896" by "1" it
does.
7 years ago
modmew8 9f8349af06 Fixed asterisk based tasklist items, fixed requirement for one char after last blank to be a valid task. (#3296)
Signed-off-by: modmew8 <modmew8@gmail.com>
7 years ago
modmew8 d996da6bab Added progressbar for issues (#1146). (#3171)
* Added progressbar for issues (#1146).

* Updated the generated index.css.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed stored progress percentage and changed it to css calc. Also added the issue task progress to the user/dashboard/issues.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed unnecessary blanks.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Formatted the files correctly, fmt-check terminates now without errors.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed variables, made computing the tasks on demand with precompiled regexp.

Signed-off-by: modmew8 <modmew8@gmail.com>
7 years ago
Sandro Santilli 8cd987af0c Add repo-sync-releases admin command (#3254)
* Add repo-sync-releases admin command

Will help recovering corrupted database, see #3247

* Load repos in chunks of 10, exit with error if unable to get a list, scan private repos, fix typo

* Fix debug output about num releases

* Introduce RepositoryListDefaultPageSize constant, set to 64

Use it from the new admin command

* Use RepositoryListDefaultPageSize in more places

* Document RepositoryListDefaultPageSize
7 years ago
Ethan Koenig c64924682e Fix race condition in team functions (#3268) 7 years ago
Morgan Bazalgette edce41ae65 go back to using CFB for AES decryption/encryption for 2FA (#3274) 7 years ago
Ethan Koenig 3850bad4c0 Remove unused consts/vars (#3270) 7 years ago
Ethan Koenig 4c9341f689 Fix bugs in issue dashboard stats (#3073) 7 years ago
Lunny Xiao f5155b9913 Small improve on deleting attachements (#3145)
* Small improve on deleting attachements

* improve the sequence of deletion
7 years ago
Antoine GIRARD cc7b8e3379 Add more bench (#3161)
* Improve makefile + Add benchs

* Apply recommendations of @ethantkoenig
7 years ago
Ethan Koenig 515cdaa85d Fix ignored errors when checking if organization, team member (#3177) 7 years ago
Ethan Koenig e67b4055f9 Fix repo-transfer-and-team-repo-count bug (#3241) 7 years ago
Ethan Koenig 0e384c6376 Check ignored errors for issue and milestone count (#3213) 7 years ago
Ethan Koenig 6abfa48c0e Remove unnecessary updates to issue indexer (#3212) 7 years ago
Ethan Koenig befa7445d2 Unit tests for routers/repo/issue_label (#3198) 7 years ago
Lunny Xiao f94c1b3943
Improvements for supporting UI Location (#3146)
* improvements for supporting UI Location

* improved the comment
7 years ago
Lauris BH c06cc740de
Reorder migrations, skip errors if running migration again (#3160)
* Reorder migrations, skip errors if running migration again

* Rename migration file names to match migration version

* Add note about ingored error
7 years ago
Lunny Xiao 859b9ad7ea fix org owner cannot be removed if there is not in owner team (#3164) 7 years ago
Kim "BKC" Carlbäcker 4b5197beb4 Fix Uninitialized variable in ParsePatch (#3156) 7 years ago
Lunny Xiao 956354885a simple usage of x (#3144) 7 years ago
Lunny Xiao f2e20c81b6 Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
7 years ago
Ethan Koenig defc97afc2 Fixtures for public_key table (#3140) 7 years ago
Ethan Koenig d1efe2078a Fix integration tests (#3141) 7 years ago
Lunny Xiao 41d6afe0e7 Fix compile failed without gcc (#3130)
* fix comile failed without gcc

* add sqlite tag for unit test
7 years ago
Antoine GIRARD ef78309b65 Improve LFS tests + fix lfs url refs + keep path upper/lowercase in db. (#3092)
* Add failing test

* Fix urls

* Improve url in tests

* improve testing

* Remove debug code

* Add deps

* LFS corner-case : Search on lower but store with case

* Temporary comment of blocking action

* fix hooks

* Use temporary repo for git client test

* Use userPassword in place of hard-coded password
7 years ago
Ethan Koenig 5e4427e4e7 Fix repo indexer and submodule bug (#3107) 7 years ago
Sasha Varlamov 7ec6cddd27 Add 'mark all read' option to notifications (#3097)
* Add 'mark all read' option to notifications

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Tests for reactions (#3083)

* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>

Fix reaction possition when there is attachments (#3099)

Refactor notifications swap function

* Accept change to drop beforeupdate call

* Update purge notifications error message for consistency

* Drop unnecessary check for mark all as read button

* Remove debugging comment
7 years ago
Vlad Temian 469ab99e9a Delete a user's public key via admin api (closes #3014) (#3059)
* Delete a user's public key via admin api

* Test admin ssh endpoint for creating a new ssh key

* Adapt public ssh key test to also test the delete operation

* Test that deleting a missing key will result in a 404

* Test that a normal user can't delete another user's ssh key

* Make DeletePublicKey return err

* Update swagger doc
7 years ago
Lauris BH f1d8dda5b4
Tests for reactions (#3083)
* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
7 years ago
Ethan Koenig c0a7899416 Sort repos in issues dashboard sidebar (#3072)
* Sort repos in issues dashboard sidebar

* Sort repos by name
7 years ago
Ethan Koenig 3c1b1ca78e Fix error message sanitiziation (#3082) 7 years ago
Lauris BH 5dc37b187c
Add reactions to issues/PR and comments (#2856) 7 years ago
Ethan Koenig ab62da283a Fix avatar URLs (#3069)
* Fix avatar URLs

* import order
7 years ago
Ethan Koenig a0964775ab Sanitize logs for mirror sync (#3057) 7 years ago
Ethan Koenig 3163abedd6 Fix ref parsing in commit messages (#3067) 7 years ago
Lunny Xiao 35cc5b0402
Remove GetRepositoryByRef and add GetRepositoryByOwnerAndName (#3043)
* remove GetRepositoryByRef and add GetRepositoryByOwnerAndName

* fix tests

* fix tests bug

* some improvements
7 years ago
Ethan Koenig 91f3d77ceb Unit tests for wiki routers (#3022) 7 years ago
Antoine GIRARD 4035ab05fa Fix git lfs path (#3016)
* add suffix .git

* Remove Content-Type on GET methods

* Add migrations to force creation before any further potential migration
7 years ago
Duncan Ogilvie c80d147fa9 Improve memory usage when reaching diff limits (#2990)
Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
7 years ago
Antoine GIRARD d99f4ab003 Git LFS lock api (#2938)
* Implement routes

* move to api/sdk and create model

* Implement add + list

* List return 200 empty list no 404

* Add verify lfs lock api

* Add delete and start implementing auth control

* Revert to code.gitea.io/sdk/gitea vendor

* Apply needed check for all lfs locks route

* Add simple tests

* fix lint

* Improve tests

* Add delete test + fix

* Add lfs ascii header

* Various fixes from review + remove useless code + add more corner case testing

* Remove repo link since only id is needed.

Save a little of memory and cpu time.

* Improve tests

* Use TEXT column format for path + test

* fix mispell

* Use NewRequestWithJSON for POST tests

* Clean path

* Improve DB format

* Revert uniquess repoid+path

* (Re)-setup uniqueness + max path length

* Fixed TEXT in place of VARCHAR

* Settle back to maximum VARCHAR(3072)

* Let place for repoid in key

* Let place for repoid in key

* Let place for repoid in key

* Revert back
7 years ago
Ethan Koenig b7ebaf6d20 Various wiki bug fixes (#2996)
* Update macaron

* Various wiki bug fixes
7 years ago
Ethan Koenig 1028ef2def Don't print SQL in unit tests (#2995)
* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
7 years ago
Ethan Koenig 716ac1214f Enable admin to search by email (#2888) 7 years ago
Ethan Koenig 0f6dc411df Remove unnecessary IssueList attribute loads (#2936) 7 years ago
Lunny Xiao 10b54df2b2 Add dingtalk webhook (#2777)
* add dingtalk webhook type

* add vendor

* some fixes

* fix name check

* fix name check & improvment
7 years ago
Michael Kuhn 420fc8efc2 Disable add key button if SSH is disabled (#2873) 7 years ago
Lauris BH bd6f24b4ab
Add deleted_branch table fixture (#2832)
* Add deleted_branch table fixture

* Fix deleted branches tests

* Remove unneeded global variable
7 years ago
Lauris BH 240609432b Issue content should not be updated when closing with comment (#2833) 7 years ago
Guillaume Dube 8798cf4e3b Set session and indexers' data files rel to AppDataPath (#2192)
* Set session and indexers' data files rel to AppDataPath

The setting AppDataPath is now relative to the working directory.
The session svc's PROVIDER_CONFIG now defaults to AppDataPath/data/sessions.
The issue indexer's IssuePath now defaults to AppDataPath/indexers/issues.bleves.

* fix bug
7 years ago
Morlinest 95637e046f Fix order of comments (#2835) 7 years ago
Ethan Koenig e6a97b6675 Use api.TrackedTime in API (#2807)
* Use api.TrackedTime in API

* APIFormat() method

* Rename function
7 years ago
cstyles b0b24a2dbb Use RelAvatarLink() in GetActAvatar() (#2800) 7 years ago
Lauris BH 82fc50f4ee Fix Git LFS object/repo link storage in database and small refactoring (#2803) 7 years ago
Ethan Koenig 513375c429 Make URL scheme unambiguous (#2408)
* Make URL scheme unambiguous

Redirect old routes to new routes

* Fix redirects to new URL scheme, and update template

* Fix branches/_new endpoints, and update integration test
7 years ago
Ethan Koenig 5866eb2321 Code/repo search (#2582)
Indexed search of repository contents (for default branch only)
7 years ago
Morlinest ddb7f59ef4 Add search mode option to /api/repo/search (#2756)
* Add repo type option to /api/repo/search

* Add tests and fix result of collaborative filter in specific condition

* Fix/optimize search & tests

* Improve integration tests

* Fix lint errors

* Fix unit tests

* Change and improve internal implementation of repo search

* Use NonexistentID

* Make search api more general

* Change mirror and fork search behaviour

* Fix tests & typo in comment
7 years ago
Lauris BH 6a107e57f6 Add checks for commits with missing author and time (#2771)
* Add checks for commits with missing author and time

* Fix validate commits with emails if it has no Author
7 years ago
Gibheer bc84110989 don't check minimum key size when disabled (#1754)
* cleanup old comments for ed25519

These comments were added when x/crypto/ed25519 could not yet handle
ed25519. It does now, so it should be removed.
Also the key type is now replaced with the proper constant.

* move the minimum key size config before the check

This moves the actual config lookup before any check is done. This
avoids problems with calling to ssh-keygen which doesn't support the
expected output format and returning an error, when the check is disabled.
7 years ago
Lauris BH eca05b09aa Add commit count caching (#2774)
* Add commit count caching

* Small refactoring

* Add different key prefix for refs and commits

* Add configuratuion option to allow to change caching time or disable it
7 years ago
Bwko 3ab580c8d6 Add branch overiew page (#2108)
* Add branch overiew page

* fix changed method name on sub menu

* remove unused code
7 years ago
Lunny Xiao 796be03e9b fix discord hook bug (#2778) 7 years ago
Lunny Xiao 6eeadb2082 Hide unactive on explore users and some refactors (#2741)
* hide unactive on explore users and some refactors

* fix test for removed Organizations

* fix test for removed Organizations

* fix imports

* fix logic bug

* refactor the toConds

* Rename TestOrganizations to TestSearchUsers and add tests for users

* fix other tests

* fix other tests

* fix watchers tests

* fix comments and remove unused code
7 years ago
harry 81d1e54a49 Use identicon image for default gravatar. (#2767)
* Use identicon image for default gravatar.

* Fixed tests.
7 years ago
Lunny Xiao 985a39590b Use buffersize to reduce database connection when iterate (#2724)
* use buffersize to reduce database connection when iterate

* fix typo

* add default value on app.ini comment
7 years ago
Jonas Bröms 847272a70d Only update mirror last update after successful sync (#2730) 7 years ago
Morlinest ccd3577970 Fix repository search function (#2689)
* Fix and remove FIXME

* Respect membership visibility

* Fix/rewrite searchRepositoryByName function

* Add unit tests

* Add integration tests

* Remove Searcher completely

* Remove trailing space
7 years ago
Lauris BH c7f4f07765 Integration test for activity page (#2704)
* Integration test for activity page

* Small code refactoring for acitvity page

* Move activity stats calculation logic to model
7 years ago
Lauris BH f3833b7ce4 Create new branch from branch selection dropdown (#2130)
* Create new branch from branch selection dropdown and rewrite it to VueJS

* Make updateLocalCopyToCommit as not exported

* Move branch name validation to model

* Fix possible race condition
7 years ago
Lauris BH 1ec4dc6c1d Fix so that user can still fork his own repository to owned organizations (#2699)
* Fix so that user can still fork his own repository to his organizations

* Fix to only use owned organizations

* Add integration test for forking own repository to owned organization
7 years ago
Lauris BH f42dbdbae5 Add Activity page to repository (#2674)
* Add Activity page to repository

* Add request data for activity

* Add issue data for activity

* Add user unit right checks

* Add releases to activity

* Log repository unit loading error
7 years ago
Lauris BH 8863e74f2a Fix organization watch migration (#2703) 7 years ago
Patrick G e89bb7ef6a Allow custom SSH user in UI for built-in SSH server (#2617) (#2678)
* Allow custom SSH user in UI for built-in SSH server (#2617)

* Some fixes

* Did make fmt

* Updated according to review

- Renamed config to BUILTIN_SSH_SERVER_USER
- Removed unnecessary default string value for config item

* Updated according to review

* Fixed some minor issues
7 years ago
Lunny Xiao 514006a2e5 Fix orgnization user watch repository (#2670)
* remove orgnization watch repositories

* fix migration

* fix typo and missing change

* remove unused code
7 years ago
Morlinest dff26e25ca Remove redudant functions and code (#2652)
* Remove redudant functions and code
7 years ago
Morlinest c2346e4469 Add repository search unit and integration tests (#2575)
* Add more repo search tests

* Fix repo search tests

* Always test returned repos length

* Add test with lower pagesize limit (test more pages)

* Add and fix /api/repo/search integration tests

* Simplify unit tests code

* Simplify and unify integration tests code

* Improve test coverage

* Temporary fix tests due to bugs in current repo search implementation

* Revert removing not nil Searcher

* Add more checks to tests

* Simplify privacy checks in /api/repo tests

* Temporary remove privacy check from repo search tests
7 years ago
David Schneiderbauer ebac051e72 Rewrite migrations to not depend on future code changes (#2604)
* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* add error check

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Additiomal fixes for migrations

* Fix timetracking migration

* Add back nil check
7 years ago
Julian Scholle 92123fe82a GPG key email verification no longer case sensitive (#2661) (#2663)
* GPG key email verification no longer case sensitive (#2661)

* case insensitive GPG key email verification now cached (#2661)

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
7 years ago
Kazuki Sawada ffab139c91 table `pull_request` wasn't updated correctly (#2649)
* Fix: table `pull_request` won't be updated correctly

* Update also status column when manually merged
7 years ago
Ethan Koenig aa962deec0 Replace deprecated Id method with ID (#2655) 7 years ago
Morlinest a79af9cf6f Fix index column deletion (#2651) 7 years ago
Ethan Koenig 4b2c8ca533 Use session when creating user (#2638) 7 years ago
Morlinest a04718a2a6 Remove repo unit index (#2621)
* Remove repo unit index

* Fix sqlite
7 years ago
Lunny Xiao a8717e5e3a Use AfterLoad instead of AfterSet on Structs (#2628)
* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad
7 years ago