summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* oauth2 with remote Gitea - Fix #8093 (#8149)techknowlogick2019-09-121-0/+8
|
* Restrict repository indexing by glob match (#7767)guillep2k2019-09-115-6/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restrict repository indexing by file extension * Use REPO_EXTENSIONS_LIST_INCLUDE instead of REPO_EXTENSIONS_LIST_EXCLUDE and have a more flexible extension pattern * Corrected to pass lint gosimple * Add wildcard support to REPO_INDEXER_EXTENSIONS * This reverts commit 72a650c8e42f4abf59d5df7cd5dc27b451494cc6. * Add wildcard support to REPO_INDEXER_EXTENSIONS (no make vendor) * Simplify isIndexable() for better clarity * Add gobwas/glob to vendors * manually set appengine new release * Implement better REPO_INDEXER_INCLUDE and REPO_INDEXER_EXCLUDE * Add unit and integration tests * Update app.ini.sample and reword config-cheat-sheet * Add doc page and correct app.ini.sample * Some polish on the doc * Simplify code as suggested by @lafriks
* Fix webhooks to use proxy from environment (#8116)Lauris BH2019-09-101-0/+1
|
* Implement webhook branch filter (#7791)WGH2019-09-093-3/+90
| | | | | | | | * Fix validate() function to handle errors in embedded anon structs * Implement webhook branch filter See #2025, #3998.
* Add option to initialize repository with labels (#6061)John Olheiser2019-09-083-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add optional label sets on repo creation * Fix CRLF * Instead of hardcoding default, make it the helper * Move label set init out of repo init Add a new error for the router Combine router label init with repo creation label init Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add issue labels to Swagger for repo creation Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update models/issue_label.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Update models/issue_label.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Add reviewrs as participants (#8121)guillep2k2019-09-071-1/+1
|
* Move git diff codes from models to services/gitdiff (#7889)Lunny Xiao2019-09-054-1071/+5
| | | | | | | | | | * move git diff codes from models to services/gitdiff * fix template * fix test * fix template
* feat: highlight issue references with : (#8101)Rinat2019-09-052-1/+2
| | | | | | | | | | | * feat: highlight issue references with : e.g. #1287: my commit msg e.g. ABC-1234: my commit msg * ref: update model regex to consistent with issueNumericPattern * test: check highlight issue with : in commits messages
* Add API endpoint for accessing repo topics (#7963)David Svantesson2019-09-034-36/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create API endpoints for repo topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Generate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add documentation to functions Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Grammar fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix function comment Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics * Ignore if topic is sent twice in same request, refactoring. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix topic dropdown with api changes. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Style fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update API documentation Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Better way to handle duplicate topics in slice Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make response element TopicName an array of strings, instead of using an array of TopicName Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test cases for API Repo Topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix format of tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix unit tests after adding some more topics to the test fixture. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update models/topic.go Limit multiple if else if ... Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Engine as first parameter in function Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Replace magic numbers with http status code constants. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix variable scope Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Test one read with login and one with token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add some more tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Apply suggestions from code review Use empty struct for efficiency Co-Authored-By: Lauris BH <lauris@nix.lv> * Add test case to check access for user with write access Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix access, repo admin required to change topics Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Correct first test to be without token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Any repo reader should be able to access topics. * No need for string pointer Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Add Ability for User to Customize Email Notification Frequency (#7813)Gary Kim2019-08-296-10/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Backend Logic for Toggling Email Notification This commit adds the backend logic for allowing users to enable or disable email notifications. The implementation ensures that only issue notification emails get disabled and important emails are still sent regardless of the setting. The UI to toggle this setting has not yet been implemented. * Add UI and complete user email notification enable This commit completes the functionality to allow users to disable their own email notifications. Signed-off-by: Gary Kim <gary@garykim.dev> * Add Third Option for Only Email on Mention Signed-off-by: Gary Kim <gary@garykim.dev> * Readd NOT NULL to new preference string Signed-off-by: Gary Kim <gary@garykim.dev> * Add Tests and Rewrite Comment Signed-off-by: Gary Kim <gary@garykim.dev> * Allow admin to set default email frequency Signed-off-by: Gary Kim <gary@garykim.dev> * Add new config option to docs Signed-off-by: Gary Kim <gary@garykim.dev> * Fix a few mistakes Signed-off-by: Gary Kim <gary@garykim.dev> * Only update required columns Signed-off-by: Gary Kim <gary@garykim.dev> * Simplify an error check Signed-off-by: Gary Kim <gary@garykim.dev> * Make email_notification_preference column in DB be VARCHAR(20) Signed-off-by: Gary Kim <gary@garykim.dev> * Handle errors Signed-off-by: Gary Kim <gary@garykim.dev> * Update models/migrations/v93.go Co-Authored-By: Lauris BH <lauris@nix.lv>
* Retry create issue to cope with duplicate keys (#7898)guillep2k2019-08-261-29/+23
| | | | | | * Retry create issue to cope with duplicate keys * Use .SetExpr().Where().Insert()
* Include description in repository search. (#7942)David Svantesson2019-08-253-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add description in repository search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Refactor SearchRepositoryByName with a general function SearchRepository Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Allow to specify if description shall be included in API repo search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add new app.ini setting for whether to search within repo description. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Search keyword in description (if setting enabled) on: - Explore page - Organization profile page - User profile page - Admin repo page Do not search keyword in description on: - Any non-keyword search (not relevant) - Incremental search (uses API) Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Put parameters related to keyword directly after it Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test cases for including (and not including) repository description in search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Rename test function from TestSearchRepositoryByName to TestSearchRepository. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make setting SEARCH_REPO_DESCRIPTION default to true Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Abort syncrhonization from LDAP source if there is some error. (#7960)David Svantesson2019-08-241-1/+6
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Add support for DEFAULT_ORG_MEMBER_VISIBLE (#7669)guillep2k2019-08-242-7/+18
| | | | | | | | | | | | * Add support for DEFAULT_ORG_MEMBER_VISIBLE * Correct formatting * Improved description in cheat sheet. * Add test for DefaultOrgMemberVisible * Remove dead code
* Move database settings from models to setting (#7806)Lunny Xiao2019-08-2418-271/+47
| | | | | | | | | | | | | | | | | | * move database settings from models to setting * update docs * fix checkout pr * fix tests * fix lint * remove unsupported tidb options * correct wrong variable name * remove tidb totally
* Use gitea forked macaron (#7933)Tamal Saha2019-08-2334-39/+44
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Change repo search to use exact match for topic search. (#7941)David Svantesson2019-08-221-1/+5
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* don't convert buffer to string (#7115)Lunny Xiao2019-08-221-1/+1
|
* Add file status on API (#7671)Lunny Xiao2019-08-212-30/+70
| | | | | | | | | | * add file status on API * fix tests * fix tests * fix tests
* Fix pull creation with empty changes (#7920)Mura Li2019-08-201-7/+10
| | | | | * Logs the stderr of git-apply * Add an integration test * Skip testPatch when patch is empty
* fix wrong sender when send slack webhook (#7918)Lunny Xiao2019-08-201-4/+4
|
* Extract the username and password from the mirror url (#7651)zeripath2019-08-161-1/+37
| | | | | | | | | | | | * Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-1546-251/+257
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-152-5/+7
| | | | | | | | | | | | | | * Convert files to utf-8 for indexing * Move utf8 functions to modules/base * Bump repoIndexerLatestVersion to 3 * Add tests for base/encoding.go * Changes to pass gosimple * Move UTF8 funcs into new modules/charset package
* lfs/lock: round locked_at timestamp to second (#7872)Antoine GIRARD2019-08-151-1/+1
| | | | | | | | * lfs/lock: round locked_at timestamp to second * test returned locked_at values * tests: use time RFC3339
* move CreateReview to moduels/pull (#7841)Lunny Xiao2019-08-141-37/+0
|
* Check commit message hashes before making links (#7713)Gary Kim2019-08-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check commit message hashes before making links Previously, when formatting commit messages, anything that looked like SHA1 hashes was turned into a link using regex. This meant that certain phrases or numbers such as `777777` or `deadbeef` could be recognized as a commit even if the repository has no commit with those hashes. This change will make it so that anything that looks like a SHA1 hash using regex will then also be checked to ensure that there is a commit in the repository with that hash before making a link. Signed-off-by: Gary Kim <gary@garykim.dev> * Use gogit to check if commit exists This commit modifies the commit hash check in the render for commit messages to use gogit for better performance. Signed-off-by: Gary Kim <gary@garykim.dev> * Make code cleaner Signed-off-by: Gary Kim <gary@garykim.dev> * Use rev-parse to check if commit exists Signed-off-by: Gary Kim <gary@garykim.dev> * Add and modify tests for checking hashes in html link rendering Signed-off-by: Gary Kim <gary@garykim.dev> * Return error in sha1CurrentPatternProcessor Co-Authored-By: mrsdizzie <info@mrsdizzie.com> * Import Gitea log module Signed-off-by: Gary Kim <gary@garykim.dev> * Revert "Return error in sha1CurrentPatternProcessor" This reverts commit 28f561cac46ef7e51aa26aefcbe9aca4671366a6. Signed-off-by: Gary Kim <gary@garykim.dev> * Add debug logging to sha1CurrentPatternProcessor This will log errors by the git command run in sha1CurrentPatternProcessor if the error is one that was unexpected. Signed-off-by: Gary Kim <gary@garykim.dev>
* Fix duplicate call of webhook (#7821)Antoine GIRARD2019-08-111-1/+0
|
* api: fix multiple bugs with statuses endpoints (#7785)Antoine GIRARD2019-08-092-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | * fix commit statuses api url * search refs before passing sha * adjust tests * directly search tags and branches names + remove un-needed check in NewCommitStatus * fix comment * de-duplicate code * test: use relative setting.AppURL * Update routers/api/v1/repo/status.go Co-Authored-By: Lauris BH <lauris@nix.lv> * remove return * Update routers/api/v1/repo/status.go Co-Authored-By: Lauris BH <lauris@nix.lv>
* Fix approvals counting (#7757)Lunny Xiao2019-08-072-6/+9
| | | | | | | | * fix approvals counting * fix tests * fmt
* Fix Slack webhook fork message (#7774)WGH2019-08-061-2/+2
| | | The order of forkee and fork was mixed up.
* Add migration step to remove old repo_indexer_status orphaned records (#7746)guillep2k2019-08-062-0/+18
| | | | | | | | | | | | * Add migration step to remove old repo_indexer_status orphaned records * Include RepoIndexerStatus struct definition in the migrate function * Change .Delete(o) into ID(o.ID).Delete(new(RepoIndexerStatus)) * Simplification of the delete procedure * Rename v91.go to v92.go
* fix rename failed when rewrite public keys (#7761)Lunny Xiao2019-08-061-1/+3
|
* Fix dropTableColumns sqlite implementation (#7710)zeripath2019-08-053-97/+23
| | | | | | | | | | * Fix dropTableColumns sqlite implementation * use droptables and its index dropping support in v78 and v85 * golang-ci fixes * Add migration from gitea 1.3.3 for sqlite which reveals the droptables bug - thus showing this works
* Add SQL execution on log and indexes on table repository and comment (#7740)Lunny Xiao2019-08-055-6/+36
| | | | | | | | * add index on comment * add SQL execution time on log and index owner_id on repository * add migration
* add pagination for admin api get orgs and fix only list public orgs bug (#7742)Lunny Xiao2019-08-041-3/+1
|
* Fix repo_index_status lingering when deleting a repository (#7734)guillep2k2019-08-041-0/+1
|
* Fix milestone completness calculation when migrating (#7725)Lauris BH2019-08-031-4/+16
|
* Fixes indexed repos keeping outdated indexes when files grow too large (#7712)guillep2k2019-08-031-1/+1
|
* org/members: display 2FA members states + optimize sql requests (#7621)Antoine GIRARD2019-08-0211-19/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * org/members: display 2FA state * fix comment typo * lay down UserList bases * add basic test for previous methods * add comment for UserList type * add valid two-fa account * test new UserList methods * optimize MembersIsPublic by side loading info on GetMembers + fix integrations tests * respect fmt rules * use map for data * Optimize GetTwoFaStatus * rewrite by using existing sub func * Optimize IsUserOrgOwner * remove un-used code * tests: cover empty org + fix import order * tests: add ErrTeamNotExist path * tests: fix wrong expected result
* Include "executable" files in the index, as they are not necessarily binary ↵guillep2k2019-08-021-1/+1
| | | | (#7718)
* Skip non-regular files (e.g. submodules) on repo indexing (#7711)guillep2k2019-08-021-5/+13
|
* fix duplicated webhook when creating issue with assignees (#7681)Lunny Xiao2019-07-311-3/+6
|
* Move add to hook queue for created repo to outside xorm session. (#7675)David Svantesson2019-07-311-2/+15
| | | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Move commit repo action from models to repofiles package (#7645)Lunny Xiao2019-07-303-309/+10
| | | | | | * move commit repo action from models to repofiles package * fix unit tests
* SetDefaultBranch on pushing to empty repository (#7610)zeripath2019-07-301-0/+11
|
* change length of some repository's columns (#7652)Lunny Xiao2019-07-293-3/+23
|
* fix wrong email when use gitea as OAuth2 provider (#7640)renothing2019-07-271-4/+4
| | | | | | | when you use gitea as OAuth2 provider, the /api/v1/user should return user primary email as identifier, which is unique in OAuth2 clients. this patch use convert.ToUser replace all u.APIFormat in api requests, return primary email when caller is yourself or admin.
* reserve .well-known username (#7637)Andreas Shimokawa2019-07-261-0/+1
|
* Fix bug create/edit wiki pages when code master branch protected (#7580)Lunny Xiao2019-07-252-5/+11
| | | | | | * fix bug create/edit wiki pages when code master branch protected * improve FullPushingEnvironment function