aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix doer of rename repo (#11789)赵智超2020-06-071-1/+1
| | | | | | | fix #11725 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: zeripath <art27@cantab.net>
* Fix visibility of forked public repos from private orgs (#11717)Cirno the Strongest2020-06-061-1/+1
| | | | | | | | | * Fix visibility of forked public repos from private orgs * update forks visibility when org visibility is changed Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Prevent transferring repos to invisible orgs (#11517)guillep2k2020-05-211-0/+9
| | | Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
* API endpoint for repo transfer (#9947)65432020-01-311-7/+7
| | | | | | | | | | * squash * optimize * fail before make any changes * fix-header
* API add/generalize pagination (#9452)SpaWn2KiLl2020-01-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * paginate results * fixed deadlock * prevented breaking change * updated swagger * go fmt * fixed find topic * go mod tidy * go mod vendor with go1.13.5 * fixed repo find topics * fixed unit test * added Limit method to Engine struct; use engine variable when provided; fixed gitignore * use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors * set Page value on Home route * improved memory allocations * fixed response headers * removed logfiles * fixed import order * import order * improved swagger * added function to get models.ListOptions from context * removed pagesize diff on unit test * fixed imports * removed unnecessary struct field * fixed go fmt * scoped PR * code improvements * code improvements * go mod tidy * fixed import order * fixed commit statuses session * fixed files headers * fixed headers; added pagination for notifications * go mod tidy * go fmt * removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list * Apply suggestions from code review Co-Authored-By: 6543 <6543@obermui.de> Co-Authored-By: zeripath <art27@cantab.net> * fixed build error * CI.restart() * fixed merge conflicts resolve * fixed conflicts resolve * improved FindTrackedTimesOptions.ToOptions() method * added backwards compatibility on ListReleases request; fixed issue tracked time ToSession * fixed build error; fixed swagger template * fixed swagger template * fixed ListReleases backwards compatibility * added page to user search route Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Add setting to set default and global disabled repository units. (#8788)David Svantesson2020-01-171-58/+67
| | | | | | | | | | | | | | | | | | * Add possibility to global disable repo units. * Add Default Repo Unit app.ini setting. * Hide units * Hide disabled repo units * Minor fixes * Indicate disabled units in team settings. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Fix #9662 (#9767)David Svantesson2020-01-151-1/+1
| | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move some repository methods from models to modules/repository (#9353)Lunny Xiao2019-12-141-1/+2
| | | | | | * Move some repository methods from models to modules/repository * fix test
* Move transfer repository and rename repository on a service package and ↵Lunny Xiao2019-11-151-23/+2
| | | | | | | | | | | | | | | | | | | | | | start action notification (#8573) * move transfer repository and rename repository on a service package and start action notification * remove unused codes * fix lint * fix bugs * fix test * fix test * fix test * fix lint * update go mod and sum
* Githook highlighter (#8932)Konctantin2019-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | * Add code highlighter to GitHook edit Signed-off-by: Konctantin <gawrilyako@gmail.com> * Fix indentation Signed-off-by: Konctantin <gawrilyako@gmail.com> * Resolve merge conflict Signed-off-by: gawrilyako@gmail.com <Konctantin> * Resolve merge conflict Signed-off-by: gawrilyako@gmail.com <Konctantin> * Fix pre-build drone event Signed-off-by: Konctantin <gawrilyako@gmail.com>
* Add Close() method to gogitRepository (#8901)zeripath2019-11-131-0/+10
| | | | | | | | | In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Template Repositories (#8768)John Olheiser2019-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move some actions to notification/action (#8779)Lunny Xiao2019-11-081-3/+2
| | | | | | | | * Move some actions to notification/action * Fix test * fix test
* Move some repositories' operations to a standalone service package (#8557)Lunny Xiao2019-10-261-1/+2
| | | | | | | | | | | | * Move some repositories' operations to a standalone service package * improve code * remove unused codes * add rollback when fork failed * add repo when return
* Move mirror to a standalone package from models (#7486)Lunny Xiao2019-10-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move mirror to a standalone package * fix mirror address in template * fix tests * fix lint * fix comment * fix tests * fix tests * fix vendor * fix fmt * fix lint * remove wrong file submitted * fix conflict * remove unrelated changes * fix go mod * fix tests * clean go mod * make vendor work * make vendor work * fix tests * remove duplicated test
* Move all mail related codes from models to services/mailer (#7200)Lunny Xiao2019-09-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move all mail related codes from models to modules/mailer * fix lint * use DBContext instead Engine * use WithContext not WithEngine * Use DBContext instead of Engine * don't use defer when sess.Close() * move DBContext to context.go and add some methods * move mailer from modules/ to services * fix lint * fix tests * fix fmt * add gitea copyright * fix tests * don't expose db functions * make code clear * add DefaultDBContext * fix build * fix bug
* Add teams to repo on collaboration page. (#8045)David Svantesson2019-09-231-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add teams to repo on collaboration page. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add option for repository admins to change teams access to repo. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add comment for functions Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make RepoAdminChangeTeamAccess default false in xorm and make it default checked in template instead. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make proper language strings and fix error redirection. * Add unit tests for adding and deleting team from repository. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add database migration Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix redirect Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix locale string mismatch. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Move team access mode text logic to template. * Move collaborator access mode text logic to template.
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+1
| | | 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
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-5/+5
| | | | | | | | | | | | | | | | | | * 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
* Add golangci (#6418)kolaente2019-06-121-1/+4
|
* Validate External Tracker URL Format (#7089)mrsdizzie2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | * Validate External Tracker URL Format Add some validation checks for external tracker URL format. Fixes #7068 * Don't make {index} a hard requirement * Fix Description * make fmt * move regex to package level * fix copyright date
* Repository avatars (#6986)Sergey Dryabzhinsky2019-05-291-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Repository avatars - first variant of code from old work for gogs - add migration 87 - add new option in app.ini - add en-US locale string - add new class in repository.less * Add changed index.css, remove unused template name * Update en-us doc about configuration options * Add comments to new functions, add new option to docker app.ini * Add comment for lint * Remove variable, not needed * Fix formatting * Update swagger api template * Check if avatar exists * Fix avatar link/path checks * Typo * TEXT column can't have a default value * Fixes: - remove old avatar file on upload - use ID in name of avatar file - users may upload same files - add simple tests * Fix fmt check * Generate PNG instead of "static" GIF * More informative comment * Fix error message * Update avatar upload checks: - add file size check - add new option - update config docs - add new string to en-us locale * Fixes: - use FileHEader field for check file size - add new test - upload big image * Fix formatting * Update comments * Update log message * Removed wrong style - not needed * Use Sync2 to migrate * Update repos list view - bigger avatar - fix html blocks alignment * A little adjust avatar size * Use small icons for explore/repo list * Use new cool avatar preparation func by @lafriks * Missing changes for new function * Remove unused import, move imports * Missed new option definition in app.ini Add file size check in user/profile avatar upload * Use smaller field length for Avatar * Use session to update repo DB data, update DeleteAvatar - use session too * Fix err variable definition * As suggested @lafriks - return as soon as possible, code readability
* Correctly adjust mirror url (#6593)zeripath2019-04-121-1/+46
|
* Allow admin users to set a repositoires visibility to public, even if ↵Matthias Beckert2019-04-111-2/+2
| | | | | FORCE_PRIVATE is to true (#6541) (#6572) Signed-off-by: Matthias Beckert <beckert.matthias@googlemail.com>
* Better logging (#6038) (#6095)zeripath2019-04-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* routers/repo/setting: display correct error for invalid mirror interval (#6414)Allen Wild2019-03-251-0/+10
| | | | | | | | | | | Set Err_Interval in the context data so that the mirror interval box is highlighted red as expected. Clear Err_RepoName for the mirror and advanced actions. repo_name is not set by these forms, causing auth.validate() to set the Err_RepoName before SettingsPost is called, which would lead to the repository name box getting erroneously highlighted red. Fixes: https://github.com/go-gitea/gitea/issues/6396
* Create a repo redirect when transferring ownership (#6210) (#6211)James E. Blair2019-02-281-0/+8
| | | | | | | When transferring ownership of a repo to a different user/org, create a repo redirect that points to the new location in the same way that is done when a repo is renamed. Signed-off-by: James E. Blair <jeblair@redhat.com>
* fix bug user could change private repository to public when force private ↵Lunny Xiao2019-02-221-0/+8
| | | | enabled. (#6156)
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-101-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #5957 * add tests to make sure config option is respected * use already defined struct * - use migration to make the flag repo wide not for the entire gitea instance Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created - fix copy/paste error in copyright header year and rearrange import - use repo config instead of server config value to determine if a commit should close an issue - update testsuite * use global config only when creating a new repository * allow repo admin toggle feature via UI * fix typo and improve testcase * fix fixtures * add DEFAULT prefix to config value * fix test
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-031-0/+3
| | | | | | | | | | | | | | | | 1. A key can either be an ssh user key or a deploy key. It cannot be both. 2. If a key is a user key - it can only be associated with one user. 3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different. 4. If a repository is deleted, its deploy keys must be deleted too. We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints: - [x] You should not be able to add the same user key as another user - [x] You should not be able to add a ssh user key which is being used as a deploy key - [x] You should not be able to add a ssh deploy key which is being used as a user key - [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode. - [x] If you delete a repository you must delete all its deploy keys. Fix #1357
* Fix MinInterval (#5856)yasuokav2019-01-261-1/+1
| | | Fixes #5847
* Feature: Archive repos (#5009)kolaente2019-01-231-0/+41
|
* Add rebase with merge commit merge style (#3844) (#4052)Julian2018-12-271-0/+1
| | | Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
* Allow to add organization members as collaborators on organization owned ↵Lanre Adelowo2018-11-301-13/+0
| | | | | repositories (#4748) repository... Fixes #4507
* Add option to disable automatic mirror syncing. (#5242)Jonas Bröms2018-11-081-2/+6
| | | Setting the interval to 0 will disable to automatic syncing.
* make sure to catch the right error so it is displayed as an error on the ui ↵Lanre Adelowo2018-09-161-1/+1
| | | | not a 500 (#4945)
* Improve URL validation for external wiki and external issues (#4710)Lauris BH2018-08-151-2/+9
| | | | | | * Improve URL validation for external wiki and external issues * Do not allow also localhost address for external URLs
* An inactive user shouldn't be able to be added as a collaborator (#4535)Lanre Adelowo2018-08-071-0/+6
| | | | | | | | | | | | | | * an inactive user shouldn't be able to be a collaborator * use translated error message * add active user check when adding a new collaborator via the api * fix translation text * added collaborator test * improvee testcases
* Don't fail silently if trying to add a collaborator twice (#4533)Lanre Adelowo2018-08-071-0/+6
| | | | | | | | | | | | * don't fail silently if trying to add a collaborator twice * fix translation text * added collaborator test * improvee testcases * Added tests to make sure a collaborator cannot be added twice
* Added dependencies for issues (#2196) (#2531)kolaente2018-07-171-0/+1
|
* Add repository setting to enable/disable health checks (#3607)Allen Wild2018-03-271-0/+18
| | | | | | | | | | | | | | 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>
* Handle refactor (#3339)Morgan Bazalgette2018-01-101-30/+30
| | | | | | * Replace all ctx.Handle with ctx.ServerError or ctx.NotFound * Change Handle(403) to NotFound, avoid using macaron's NotFound
* Writable deploy keys (closes #671) (#3225)Vlad Temian2018-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add Pull Request merge options - Ignore white-space for conflict checking, ↵Lauris BH2018-01-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix ignored errors when checking if organization, team member (#3177)Ethan Koenig2017-12-211-32/+10
|
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-1/+2
| | | | | | | | | | | | | | * 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
* Allow adding collaborators with (fullname) (#3103)Sasha Varlamov2017-12-071-1/+2
| | | | | | | | | | * Allow adding collaborators with (fullname) Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> * Refactor username suffix to utils pkg Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>
* Disable add key button if SSH is disabled (#2873)Michael Kuhn2017-11-211-3/+6
|