aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Add option to initialize repository with labels (#6061)John Olheiser2019-09-083-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-11/+11
|
* Move git diff codes from models to services/gitdiff (#7889)Lunny Xiao2019-09-054-6/+10
| | | | | | | | | | * move git diff codes from models to services/gitdiff * fix template * fix test * fix template
* Add API endpoint for accessing repo topics (#7963)David Svantesson2019-09-037-59/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 change title notification for issues (#8061)guillep2k2019-09-021-0/+3
|
* Add Ability for User to Customize Email Notification Frequency (#7813)Gary Kim2019-08-291-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Move line number to :before attr to hide from search on browser (#8002)jaqra2019-08-281-1/+1
| | | | | | | | * Move line number to :before attr to hide from search on browser * Use same variable in WriteString Co-Authored-By: Lauris BH <lauris@nix.lv>
* Retry create issue to cope with duplicate keys (#7898)guillep2k2019-08-262-14/+0
| | | | | | * Retry create issue to cope with duplicate keys * Use .SetExpr().Where().Insert()
* Fix adding default Telegram webhook (#7972)Gary Kim2019-08-261-0/+2
| | | | | | | | | | | | * Fix adding default Telegram webhook Fixes #7932 Signed-off-by: Gary Kim <gary@garykim.dev> * Run goimports Signed-off-by: Gary Kim <gary@garykim.dev>
* Adds details about what tags can use the Git tags API (#7989)Richard Mahn2019-08-261-2/+2
|
* API method to list all commits of a repository (#6408)Mike Schwörer2019-08-263-26/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added API endpoint ListAllCommits (/repos/{owner}/{repo}/git/commits) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Fixed failing drone build Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Implemented requested changes (PR reviews) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * gofmt Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Changed api route from "/repos/{owner}/{repo}/git/commits" to "/repos/{owner}/{repo}/commits" * Removed unnecessary line * better error message when git repo is empty * make generate-swagger * fixed removed return * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * go fmt * Refactored common code into ToCommit() * made toCommit not exported * added check for userCache == nil
* Run CORS handler first for /api routes (#7967)Tamal Saha2019-08-262-9/+8
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Include description in repository search. (#7942)David Svantesson2019-08-254-57/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Move database settings from models to setting (#7806)Lunny Xiao2019-08-243-46/+39
| | | | | | | | | | | | | | | | | | * 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
* Document possibility to limit API Repo search to topics only. (#7957)David Svantesson2019-08-231-0/+4
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Use gitea forked macaron (#7933)Tamal Saha2019-08-2363-103/+75
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Extract the username and password from the mirror url (#7651)zeripath2019-08-161-0/+4
| | | | | | | | | | | | * Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
* Detect delimiter in CSV rendering (#7869)Norwin2019-08-161-2/+4
| | | | | | | | | | | | | | | | | | | | | * detect csv delimiter in csv rendering fixes #7868 * make linter happy * fix failing testcase & use ints where possible * expose markup type to template previously all markup had the .markdown class, which is incorrect, as it applies markdown CSS & JS logic to CSV rendering * fix build (missing `make css`) * ignore quoted csv content for delimiter scoring also fix html generation
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-1515-46/+52
| | | | | | | | | | | | | | | | | | * 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-153-8/+8
| | | | | | | | | | | | | | * 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
* fix non existent milestone with 500 error (#7867)Lanre Adelowo2019-08-141-0/+5
|
* move CreateReview to moduels/pull (#7841)Lunny Xiao2019-08-141-1/+3
|
* Attempt to fix hook problem (#7854)zeripath2019-08-141-5/+14
|
* Enable switching to a different source branch when PR already exists (#7819)Mario Lubenka2019-08-111-7/+7
| | | Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Rewrite existing repo units if setting is not included in api body (#7763)David Svantesson2019-08-101-73/+86
| | | | | | | | * Rewrite existing repo units if setting is not included in api body Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * else-if on one row
* api: fix multiple bugs with statuses endpoints (#7785)Antoine GIRARD2019-08-092-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Display error as string but not bytes (#7780)Lunny Xiao2019-08-071-1/+1
| | | | | | | | * display error as string but not bytes * Update routers/repo/http.go Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>
* add pagination for admin api get orgs and fix only list public orgs bug (#7742)Lunny Xiao2019-08-041-1/+12
|
* display as error (#7724)Lunny Xiao2019-08-031-1/+1
|
* org/members: display 2FA members states + optimize sql requests (#7621)Antoine GIRARD2019-08-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* improve branches list performance and fix protected branch icon when ↵Lunny Xiao2019-08-011-4/+12
| | | | no-login (#7695)
* fix wrong email when use gitea as OAuth2 provider (#7640)renothing2019-07-2711-23/+28
| | | | | | | 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.
* Fix #7136: Add paging and extend API GetCommitStatuses (#7141)zeripath2019-07-251-5/+46
| | | | | | | | | | | | | | | | | | | | * Fix #7136: Add paging and extend API GetCommitStatuses * update swagger * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Apply suggestions from code review
* Swagger: Add information to API Token header (#7585)zeripath2019-07-241-0/+1
| | | * Add a description to the API Token header for swagger
* use 403 instead of 401 for ErrUserProhibitLogin (#7591)zeripath2019-07-231-1/+1
|
* Removed unnecessary conversions (#7557)Christian Muehlhaeuser2019-07-231-3/+2
| | | No need to convert to the same type.
* Handle ErrUserProhibitLogin in http git (#7586)zeripath2019-07-231-1/+4
|
* Fixes #7564 - Malformed URLs in API git/commits response (#7565)Richard Mahn2019-07-221-2/+2
|
* Fixed ineffectual assignments (#7555)Christian Muehlhaeuser2019-07-221-1/+0
| | | Don't assign values we never use.
* Fixes #7474 - Handles all redirects for Web UI File CRUD (#7478)Richard Mahn2019-07-172-15/+119
| | | | | | | | | | | | | | | | * Fixes #7474 - Handles all redirects for Web UI File CRUD * Fixes lint errors * Typo fix * Adds unit tests for a few helper functions * Fixes per review * Fix for new branch creation and to unit test * Fixes the template used for errors on delete
* Remove settting dependency on modules/session (#7237)Lunny Xiao2019-07-171-0/+3
| | | | | | | | | | * remove settting dependency on modules/session * fix fmt * fix tests * fix lint
* Fixes #7475 - Settings pages giving UnitType error message (#7482)Richard Mahn2019-07-151-1/+1
|
* Support setting cookie domain (#6288)Tamal Saha2019-07-123-20/+22
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* add notification placeholder (#7409)Lunny Xiao2019-07-122-0/+10
|
* Only show "New Pull Request" button if repo allows pulls (#7426)Gary Kim2019-07-111-0/+1
| | | Signed-off-by: Gary Kim <gary@garykim.dev>
* wiki history improvements (#7391)Cherrg2019-07-111-2/+2
| | | | | | | | | | | | | | | | | * add history comments to detect page delete Signed-off-by: Michael Gnehr <michael@gnehr.de> * fix too much history entries - caused by --follow flag - if files with same contents exists Signed-off-by: Michael Gnehr <michael@gnehr.de> * style imprevements wiki - history - wrap long author names Signed-off-by: Michael Gnehr <michael@gnehr.de>
* add missing template variable on organisation settings (#7385)Cherrg2019-07-091-0/+1
| | | | | fix #6755 Signed-off-by: Michael Gnehr <michael@gnehr.de>
* wiki - page revisions list (#7369)Cherrg2019-07-082-64/+189
| | | | | | | | | | | | | | fix #7 * add wiki page revision list * mobile improvements * css improvements for long usernames * split renderWikiPage into 3 functions Signed-off-by: Michael Gnehr <michael@gnehr.de>
* Refactor filetype is not allowed errors (#7309)Antoine GIRARD2019-07-064-46/+12
|
* Make captcha and password optional for external accounts (#6606)AJ ONeal2019-07-062-37/+63
|