summaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* fix label of --id in admin delete user (#14005)zeripath2020-12-171-6/+35
| | | | | | | | | | | | | | | | | | | | | * fix label of --id in admin delete user This pr fixes the label descriptor of `gitea admin delete user` but also adds a `--username` option. Fix #13995 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix-spacing Signed-off-by: Andrew Thornton <art27@cantab.net> * Add delete email support Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Whenever the password is updated ensure that the hash algorithm is too (#13966)zeripath2020-12-121-1/+1
| | | | | | | | | | | `user.HashPassword` may potentially - and in fact now likely does - change the `passwd_hash_algo` therefore whenever the `passwd` is updated, this also needs to be updated. Fix #13832 Thanks @fblaese for the hint Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor doctor (#12264)zeripath2020-12-021-521/+35
| | | | | | | | | | | | | | | | | | | | | | | | * Refactor Logger Refactor Logger to make a logger interface and make it possible to wrap loggers for specific purposes. * Refactor Doctor Move the gitea doctor functions into its own module. Use a logger for its messages instead of returning a results string[] Signed-off-by: Andrew Thornton <art27@cantab.net> * Update modules/doctor/misc.go Co-authored-by: 6543 <6543@obermui.de> * Update modules/doctor/misc.go Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Handle and propagate errors when checking if paths are Dirs, Files or Exist ↵zeripath2020-11-272-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | (#13186) * Ensure errors from IsDir propagate * Handle errors when checking IsFile * Handle and propagate errors from IsExist * Update modules/templates/static.go * Update modules/templates/static.go * Return after ctx.ServerError * Apply suggestions from code review * Fix tests The previous merge managed to break repo_form.go Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Use mount but not register for chi routes (#13555)Lunny Xiao2020-11-161-2/+3
| | | | | | | | | | | | | | | * Use mount but not register for chi routes * Fix test * Fix test * Fix test * Fix comment * turn back unnecessary change * Remove the timout middleware since some operations may spend much time.
* Introduce go chi web framework as frontend of macaron, so that we can move ↵Lunny Xiao2020-11-131-9/+7
| | | | | | | | | routes from macaron to chi step by step (#7420) * When route cannot be found on chi, go to macaron * Stick chi version to 1.5.0 * Follow router log setting
* Add docs command (#13429)John Olheiser2020-11-071-0/+61
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix --port setting (#13288)zeripath2020-10-301-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix --port setting Unfortunately there was an error in #13195 which set the --port option before the settings were read. This PR fixes this by moving applying this option to after the the settings are read However, on looking further into this code I believe that the setPort code was slightly odd. Firstly, it may make sense to run the install page on a different temporary port to the full system and this should be possible with a --install-port option. Secondy, if the --port option is provided we should apply it to both otherwise there will be unusual behaviour on graceful restart Thirdly, the documentation for --port says that the setting is temporary - it should therefore not save its result to the configuration (This however, does mean that authorized_keys and internal links may not be correct. - I think we need to discuss this option further.) Fix #13277 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update cmd/web.go * Apply suggestions from code review Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix send mail (#13312)Lunny Xiao2020-10-261-2/+5
| | | | | | | | | * Fix send mail * Fix send mail * Update modules/private/mail.go Co-authored-by: techknowlogick <matti@mdranta.net>
* Sendmail command (#13079)Maxim Zhiburt2020-10-243-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add SendSync method Usefull to have when you need to be confident that message was sent. * Add sendmail command * add checks that if either title or content is empty then error out * Add a confirmation step * Add --force option to bypass confirm step * Move implementation of runSendMail to a different file * Add copyrighting comment * Make content optional Print waring if it's empty or haven't been set up. The warning will be skiped if there's a `--force` flag. * Fix import style Co-authored-by: 6543 <6543@obermui.de> * Use batch when getting all users IterateUsers uses batching by default. Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Send emails one by one instead of as one chunck Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Send messages concurantly Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Use SendAsync+Flush instead of SendSync Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Add timeout parameter to sendemail command Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Fix spelling mistake Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Update cmd/admin.go Co-authored-by: 6543 <6543@obermui.de> * Connect to a running Gitea instance * Fix mispelling * Add copyright comment Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move install pages out of main macaron routes (#13195)zeripath2020-10-192-46/+95
| | | | | | | | | | | | | * Move install pages out of main macaron loop Signed-off-by: Andrew Thornton <art27@cantab.net> * Update templates/post-install.tmpl Co-authored-by: Lauris BH <lauris@nix.lv> * remove prefetch Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve users management through the CLI (#6001) (#10492)ydelafollye2020-10-151-5/+84
| | | | | | | | | | * Fix images in wiki edit preview (#11546) Make sure wiki editor sets wiki to true so gitea renders it as a wiki page. Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless. Fixes #11540
* Avatars and Repo avatars support storing in minio (#12516)Lunny Xiao2020-10-141-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Avatar support minio * Support repo avatar minio storage * Add missing migration * Fix bug * Fix test * Add test for minio store type on avatars and repo avatars; Add documents * Fix bug * Fix bug * Add back missed avatar link method * refactor codes * Simplify the codes * Code improvements * Fix lint * Fix test mysql * Fix test mysql * Fix test mysql * Fix settings * Fix test * fix test * Fix bug
* Move update-server-info to hooks (#12826)zeripath2020-10-141-0/+6
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Provide self-registering storage system (#12978)zeripath2020-10-121-14/+23
| | | | | | | | | | | | | | | | | | | * Provide self-registering storage system Signed-off-by: Andrew Thornton <art27@cantab.net> * More simplification Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove old strings from setting Signed-off-by: Andrew Thornton <art27@cantab.net> * oops attachments not attachment Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add ssh certificate support (#12281)Wim2020-10-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ssh certificate support * Add ssh certificate support to builtin ssh * Write trusted-user-ca-keys.pem based on configuration * Update app.example.ini * Update templates/user/settings/keys_principal.tmpl Co-authored-by: silverwind <me@silverwind.io> * Remove unused locale string * Update options/locale/locale_en-US.ini Co-authored-by: silverwind <me@silverwind.io> * Update options/locale/locale_en-US.ini Co-authored-by: silverwind <me@silverwind.io> * Update models/ssh_key.go Co-authored-by: silverwind <me@silverwind.io> * Add missing creation of SSH.Rootpath * Update cheatsheet, example and locale strings * Update models/ssh_key.go Co-authored-by: zeripath <art27@cantab.net> * Update models/ssh_key.go Co-authored-by: zeripath <art27@cantab.net> * Update models/ssh_key.go Co-authored-by: zeripath <art27@cantab.net> * Update models/ssh_key.go Co-authored-by: zeripath <art27@cantab.net> * Update models/ssh_key.go * Optimizations based on feedback * Validate CA keys for external sshd * Add filename option and change default filename Add a SSH_TRUSTED_USER_CA_KEYS_FILENAME option which default is RUN_USER/.ssh/gitea-trusted-user-ca-keys.pem Do not write a file when SSH_TRUSTED_USER_CA_KEYS is empty. Add some more documentation. * Remove unneeded principalkey functions * Add blank line * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> * Add SSH_AUTHORIZED_PRINCIPALS_ALLOW option This adds a SSH_AUTHORIZED_PRINCIPALS_ALLOW which is default email,username this means that users only can add the principals that match their email or username. To allow anything the admin need to set the option anything. This allows for a safe default in gitea which protects against malicious users using other user's prinicipals. (before that user could set it). This commit also has some small other fixes from the last code review. * Rewrite principal keys file on user deletion * Use correct rewrite method * Set correct AuthorizedPrincipalsBackup default setting * Rewrite principalsfile when adding principals * Add update authorized_principals option to admin dashboard * Handle non-primary emails Signed-off-by: Andrew Thornton <art27@cantab.net> * Add the command actually to the dashboard template * Update models/ssh_key.go Co-authored-by: silverwind <me@silverwind.io> * By default do not show principal options unless there are CA keys set or they are explicitly set Signed-off-by: Andrew Thornton <art27@cantab.net> * allow settings when enabled * Fix typos in TrustedUserCAKeys path * Allow every CASignatureAlgorithms algorithm As this depends on the content of TrustedUserCAKeys we should allow all signature algorithms as admins can choose the specific algorithm on their signing CA * Update models/ssh_key.go Co-authored-by: Lauris BH <lauris@nix.lv> * Fix linting issue Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Gitea serv, hooks, manager and the like should always display Fatals (#13032)zeripath2020-10-071-0/+2
| | | | | | | | | | | | | | | | | The gitea cmd/serv.go setup function deletes the console logger to prevent stdout interference with commands. However, the problem is that it then calls setting.NewContext which may cause an exit with log.Fatal - which will then not be shown. Now, log.Fatal is so disastrous that the interference that logging causes is wanted. However, we can avoid stdout interference by emitting on stderr. This PR forces the creation of a console logger on stderr listening on Fatal for these commands. Most commands have a `--debug` option now that will print more reasons too - however, defaulting to give the log for Fatal seems reasonable. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor use TrimSuffix instead of TrimRight (#12993)65432020-10-011-1/+1
| | | | | | | * Refactor use TrimSuffix instead of TrimRight * TrimRight right * has #12990
* Add default storage configurations (#12813)Lunny Xiao2020-09-292-13/+49
| | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Check passwords against HaveIBeenPwned (#12716)John Olheiser2020-09-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update module Signed-off-by: jolheiser <john.olheiser@gmail.com> * Apply suggestions mrsdizzie Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Add link to HIBP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add more details to admin command Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add context to pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Consistency and making some noise ;) Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: zeripath <art27@cantab.net>
* LFS support to be stored on minio (#12518)Lunny Xiao2020-09-081-31/+43
| | | | | | | | | | | | | | | | | * LFS support to be stored on minio * Fix test * Fix lint * Fix lint * Fix check * Fix test * Update documents and add migration for LFS * Fix some bugs
* gitea dump: include version & Check InstallLock (#12760)65432020-09-071-0/+4
| | | | | | | | | * gitea dump: include version * Check InstallLock (close #12759) * fix test * fix lint
* Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752)zeripath2020-09-061-0/+1
| | | | | | | * Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes Fix #11738 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add command to recreate tables (#12407)zeripath2020-09-061-0/+63
| | | | | | | | | | | | | | Provides new command: `gitea doctor recreate-table` which will recreate db tables and copy the old data in to the new table. This function can be used to remove the old warning of struct defaults being out of date. Fix #8868 Fix #3265 Fix #8894 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure repoNames are lowercased in serv (#12668)zeripath2020-08-311-2/+8
| | | | | | | | | | #12624 missed lowering the provided repoPath. (Additionally make a few fixes to the way the debug flag works.) Fix #12659 Fix #12667 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure ↵zeripath2020-08-302-3/+4
| | | | | | EnvPusherEmail is set (#12646) Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use shellquote to unpack arguments to gitea serv (#12624)zeripath2020-08-281-15/+18
| | | | | Fix #12471 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Initial support for push options (#12169)John Olheiser2020-08-232-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial support for push options Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix misspelling 🤦 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix formatting after conflict resolution * defer close git repo * According the GitLab documentation, git >= 2.10 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Words are hard. Thanks @mrsdizzie :sweat_smile: Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Only update if there are push options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Add a storage layer for attachments (#11387)Lunny Xiao2020-08-181-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a storage layer for attachments * Fix some bug * fix test * Fix copyright head and lint * Fix bug * Add setting for minio and flags for migrate-storage * Add documents * fix lint * Add test for minio store type on attachments * fix test * fix test * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Add warning when storage migrated successfully * Fix drone * fix test * rebase * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * remove log on xorm * Fi download bug * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * Add URL function to serve attachments directly from S3/Minio * Add ability to enable/disable redirection in attachment configuration * Fix typo * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * don't change unrelated files * Fix lint * Fix build * update go.mod and go.sum * Use github.com/minio/minio-go/v6 * Remove unused function * Upgrade minio to v7 and some other improvements * fix lint * Fix go mod Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Tyler <tystuyfzand@gmail.com>
* Make the default PID file compile-time settable (#12485)zeripath2020-08-151-2/+3
| | | | | | | | | | #12391 offered to change the default PID file from /var/run/gitea.pid however in discussion it was decided that this could break users of older systems. An alternative was offered that we could make the PID file compile/link time settable. This PR does this, and changes the name of the setting from CustomPID to simply PIDFile. It also updates the from-source docs to show how to change the compiler settings to do this. Closes #12391 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Florian Klink <flokli@flokli.de>
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-112-3/+9
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Fix ipv6 parsing (#12321)Wim2020-07-261-1/+2
| | | | | | | | | | | | * Fix ipv6 parsing * Update modules/setting/setting.go Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Decrease the num_stars when deleting a repo (#11954)赵智超2020-07-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Decrease the num_stars when deleting a repo fix #11949 Signed-off-by: a1012112796 <1012112796@qq.com> * Add migration * use batch * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint * fix lint * fix ci * fix ci2 * add doctor * duplicate code * fix migration * fix some nits * add start Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777)zeripath2020-07-051-9/+371
| | | | | | | | | | | | | | | | | | | | | | * Make LogDescriptions race safe * Add manager commands for pausing, resuming, adding and removing loggers Signed-off-by: Andrew Thornton <art27@cantab.net> * Placate lint * Ensure that file logger is run! * Add support for smtp and conn Signed-off-by: Andrew Thornton <art27@cantab.net> * Add release-and-reopen Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add migration to set IsArchived false if it is null (#11853)zeripath2020-06-111-0/+16
| | | | | | | | | | | | | * Add migration to set IsArchived false if it is null Fix #11824 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add doctor Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Dump: add output format tar and output to stdout (#10376)PhilippHomann2020-06-051-57/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Dump: Use mholt/archive/v3 to support tar including many compressions Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: Allow dump output to stdout Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: Fixed bug present since #6677 where SessionConfig.Provider is never "file" Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: never pack RepoRootPath, LFS.ContentPath and LogRootPath when they are below AppDataPath Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: also dump LFS (fixes #10058) Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Dump: never dump CustomPath if CustomPath is a subdir of or equal to AppDataPath (fixes #10365) Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * Use log.Info instead of fmt.Fprintf Signed-off-by: Philipp Homann <homann.philipp@googlemail.com> * import ordering * make fmt Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Matti R <matti@mdranta.net>
* Doctor check & fix db consistency (#11111)65432020-05-291-2/+85
| | | | | | | | | | | | | needed to fix issue as described in #10280 * rename check-db to check-db-version * add check-db-consistency: * find issues without existing repository * find pulls without existing issues * find tracked times without existing issues/pulls * find labels without repository or org reference Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add debug option to hooks (#11624)zeripath2020-05-281-2/+17
| | | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* TrimSpace when reading InternalToken from a file (#11502)zeripath2020-05-201-3/+20
| | | | | | | | | | InternalTokens are fixed as alphanum strings therefore TrimSpace from these. Also use isatty to not add a terminal newline when redirecting generate. Fix #11498 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Prevent timer leaks in Workerpool and others (#11333)zeripath2020-05-081-9/+3
| | | | | | | | | | | | | | | | There is a potential memory leak in `Workerpool` due to the intricacies of `time.Timer` stopping. Whenever a `time.Timer` is `Stop`ped its channel must be cleared using a `select` if the result of the `Stop()` is `false`. Unfortunately in `Workerpool` these were checked the wrong way round. However, there were a few other places that were not being checked. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* cmd: dump: check value of skip-repository flag (#11254)Kyle Evans2020-05-031-1/+1
| | | | | | This is a boolean flag; simply checking if it's set isn't enough, we must check the value as well. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* cmd: dump: add an -L/--skip-log option (#11253)Kyle Evans2020-04-301-1/+10
| | | | | | | | | | Not all dumps need to include the logs, in a similar vain to not all dumps needing to include repositories; these may be subject to different backup mechanisms/constraints. Add a simple option to let them be excluded from the dump to simplify workflows that need to exclude them or not collect in the first place. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
* Return error for authorized_keys and mergebase problems (#10990)zeripath2020-04-081-1/+4
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Mulitple Gitea Doctor improvements (#10943)zeripath2020-04-061-45/+312
| | | | | | | | | | | | | | * Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix #10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net>
* make `gitea admin auth list` formatting configurable (#10844)zeripath2020-03-271-1/+37
| | | | | | | | | * make admin auth list formatting configurable Signed-off-by: Andrew Thornton <art27@cantab.net> * As per @guillep2k Signed-off-by: Andrew Thornton <art27@cantab.net>
* Multiple LFS improvements (#10667)zeripath2020-03-091-6/+9
| | | | | | | | | | | | | | * Add more logging in the LFS server Adds more logging in the LFS server and stops sending internal server error information to the client * Add LFS Lock cursor implementation * Simplify Claims in LFS and remove the float64 casts Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add restricted user filter to LDAP authentication (#10600)Lauris BH2020-03-052-0/+15
| | | | | | * Add restricted user filter to LDAP authentification * Fix unit test cases
* Fix push-create SSH bugs (#10145)John Olheiser2020-02-051-0/+6
| | | | | | | | | | | | | | * Attempt to fix push-create SSH bugs Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix binding Signed-off-by: jolheiser <john.olheiser@gmail.com> * Invalid ctx Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Implement "embedded" command to extract static resources (#9982)guillep2k2020-02-022-0/+362
| | | | | | | | | | | | | | | | | | | | | | | * draft * Implement extract command * Fix nits and force args on extract * Add !bindata stub, support Windows, fmt * fix vendored flag * Remove leading slash for matching * Add docs * Fix typos * Add embedded view command Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Implement basic app.ini and path checks to doctor cmd (#10064)guillep2k2020-01-301-15/+112
| | | | | | | | | | | | | | | | | | | | | | | | | * Add doctor check of app.ini paths * Make /custom dir not mandatory * Fix message and improve interface * Update cmd/doctor.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Apaise lint * Isn't the linter a sweet? (1) * Isn't the linter a sweet? (2) * Isn't the linter a sweet?? (3) * Restart CI Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net>