summaryrefslogtreecommitdiffstats
path: root/cmd/web.go
Commit message (Collapse)AuthorAgeFilesLines
* Graceful fixes (#8645)zeripath2019-10-231-0/+2
| | | | | | | | | | * Only attempt to kill parent once * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Add waitgroup for running servers
* Restore Graceful Restarting & Socket Activation (#7274)zeripath2019-10-151-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prevent deadlock in indexer initialisation during graceful restart * Move from gracehttp to our own service to add graceful ssh * Add timeout for start of indexers and make hammer time configurable * Fix issue with re-initialization in indexer during tests * move the code to detect use of closed to graceful * Handle logs gracefully - add a pid suffix just before restart * Move to using a cond and a holder for indexers * use time.Since * Add some comments and attribution * update modules.txt * Use zero to disable timeout * Move RestartProcess to its own file * Add cleanup routine
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+1
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Use certmanager provided TLSConfig for LetsEncrypt (#7229)zeripath2019-06-171-6/+3
|
* Add golangci (#6418)kolaente2019-06-121-2/+7
|
* Fix wrong init dependency on markup extensions (#7038)Lunny Xiao2019-05-251-3/+0
| | | | * fix wrong init dependency on markup extensions
* Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631)zeripath2019-04-291-9/+0
|
* Better logging (#6038) (#6095)zeripath2019-04-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Remove a double slash in the HTTPS redirection when Let's Encrypt is enabled ↵Greg Karékinian2018-12-121-1/+4
| | | | | | | | | | | | | | | (#5537) Before: $ curl 0.0.0.0:3001 <a href="https://gitea.example.com:3000//">Found</a>. After: $ curl 0.0.0.0:3001 <a href="https://gitea.example.com:3000/">Found</a>. Fixes #5536
* Fix the Let's Encrypt handler by listening on a valid address (#5525)Greg Karékinian2018-12-111-1/+7
| | | | | | | | | | | | | | | | | | | * Fix the Let's Encrypt handler by listening on a valid address Also handle errors in the HTTP server go routine, return a fatal error when something goes wrong. Thanks to @gbl08ma for finding the actual bug Here is an example of the error handling: 2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind: permission denied Closes #5280 * Fix a typo
* add letsencrypt to Gitea (#4189)Fluf2018-08-211-0/+33
|
* General refactor of the cmd package (#3328)Morgan Bazalgette2018-01-121-5/+4
| | | | | | | | * General refactor of the cmd package * Address breakage in runCreateUser * Place "common" functions into cmd.go
* Add an option to allow redirect of http port 80 to https. (#1928)Mike Fellows2017-12-251-0/+23
| | | | | | | | | | | | | * Add an option to allow redirect of http port 80 to https. This is an "opt in" option (default is to not redirect). It will only redirect if protocol is https and the new REDIRECT_PORT_80 option is set to true. The Port to redirect in previous commit was hardcoded to 80, now it can be specified in the app.ini, defaulting to 80. The boolean option to turn redirection on has been changed to REDIRECT_OTHER_PORT to be logically consistent with the new port option. Signed-off-by: Mike Fellows <mike.fellows@shaw.ca>
* fix run web with -p push failed (#3154)Lunny Xiao2017-12-131-0/+30
|
* Add external markup render support (#2570)Lunny Xiao2017-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | * add external markup render support * bug fixed * refacotr codes and fix wrong error log * fix comments and add check to prevent leaks * add check for config file and improve the example * check file close error * use ioutil.TempFile instead uuid * correct Render -> Parser * improve warning when incorrect markup setting * fix typos
* Integration test framework (#1290)Ethan Koenig2017-04-251-629/+3
| | | | | | | | | | * Integration test framework * udpate drone sign * Formatting fixes and move router.go to routers/ * update sign for drone
* support health check via / and fix #969 (#1520)Lunny Xiao2017-04-201-0/+4
|
* feat: add download count field and unit testing for attachment. (#1512)Bo-Yi Wu2017-04-201-0/+5
| | | | | | | | | | | | | | * feat: add download count field and unit testing. * fix: unit testing * refactor: improve testing. * fix: update comment * add default value. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* Add internal routes for ssh hook comands (#1471)Lunny Xiao2017-04-191-0/+6
| | | | | | | | | | | | | | | | * add internal routes for ssh hook comands * fix lint * add comment on why package named private not internal but the route name is internal * add comment above package private why package named private not internal but the route name is internal * remove exp time on internal access * move routes from /internal to /api/internal * add comment and defer on UpdatePublicKeyUpdated
* Better URL validation (#1507)Lauris BH2017-04-191-0/+2
| | | | | | | | | | | | | | | | | | | | * Add correct git branch name validation * Change git refname validation error constant name * Implement URL validation based on GoLang url.Parse method * Backward compatibility with older Go compiler * Add git reference name validation unit tests * Remove unused variable in unit test * Implement URL validation based on GoLang url.Parse method * Backward compatibility with older Go compiler * Add url validation unit tests
* Add watch button on issueAndrey Nering2017-03-291-0/+1
|
* Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION (#1369)Sandro Santilli2017-03-291-2/+2
| | | | | | | | | | | * Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION Omit the configuration variable (the default) to be dependent. Fixes #1363 * Move OpenID settings under Service object * Show OpenID SignUp and SignIn status in admin panel / configuration
* Fix FCGI (over TCP) support (#1368)Pavel Korovin2017-03-231-1/+6
|
* LFS: Return 404 for unimplemented endpoints (#1330)Fabian Zaremba2017-03-201-0/+3
| | | | | | | Without this patch a 401 is returned for unspecified endpoints, making the LFS client ask for HTTP credentials. This behaviour was introduced with the new locking API: https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md
* Show user OpenID URIs in their profile (#1314)Sandro Santilli2017-03-201-0/+1
|
* feat: Only use issue and wiki on repo. (#1297)Bo-Yi Wu2017-03-181-12/+12
|
* Login via OpenID-2.0 (#618)Sandro Santilli2017-03-171-0/+21
|
* Batch updates for issues (#926)Ethan Koenig2017-03-151-6/+5
|
* Rename /forget_password url to /forgot_passwordSandro Santilli2017-03-141-2/+2
| | | | | | | | | Also renames `forgot_password` translation key to `forgot_password_title` and `forget_password` to `forgot_password` Includes entry in CHANGELOG about the breaking change (and some markdown fixes in there)
* remove unused struct (#1062)Lunny Xiao2017-02-271-8/+1
|
* Oauth2 consumer (#679)Willem van Dreumel2017-02-221-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
* Protected branches system (#339)Denis Denisov2017-02-211-0/+5
| | | | | | | | | | | | | | | | | | | | * Protected branches system * Moved default branch to branches section (`:org/:reponame/settings/branches`). * Initial support Protected Branch. - Admin does not restrict - Owner not to limit - To write permission restrictions * reformat tmpl * finished the UI and add/delete protected branch response * remove unused comment * indent all the template files and remove ru translations since we use crowdin * fix the push bug
* feat: Able to disable non-admin to create new organization (#927)Bo-Yi Wu2017-02-141-2/+8
|
* Markdown rendering overhaul (#186)Andrew Boyarshin2017-02-141-0/+5
| | | | | | | | | | | | * Markdown rendering overhaul Cleaned up and squashed commits into single one. Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com> * Fix markdown API, add markdown module and API tests, improve code coverage Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>
* fix watchers templates breaks (#870)Lunny Xiao2017-02-081-1/+1
|
* Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 (#801)Matthias Loibl2017-02-051-0/+7
| | | | | | * Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 * Add comment for golint to blank pprof import
* Fix remove unix socket listenAddr (#846)surefire2017-02-051-1/+1
| | | | Because the absence of the listenAddr is what is expected. The error will only be then when we can't remove.
* Add units concept for modulable functions of a repository (#742)Lunny Xiao2017-02-041-4/+4
| | | | | | | | | | | | | | | | * Add units concept for modulable functions of a repository * remove unused comment codes & fix lints and tests * remove unused comment codes * use struct config instead of map * fix lint * rm wrong files * fix tests
* Cleanup log messagingGabriel Jackson2017-02-021-3/+3
| | | | | | | | | This change corrects a few logging issues: * Standardized formatting errors with '%v'. * Standardized failure warning word usage. * Corrected an instance of using the standard log library when the gitea log library should be used instead.
* Allow custom public files (#782)Thomas Boerger2017-01-281-0/+5
| | | | | | * Allow custom public files * Gofmt code, lots of places not related to this pr
* Add ETag header to avatars (#721)Bwko2017-01-251-0/+1
|
* Two factor authentication support (#630)Andrew2017-01-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit for 2FA support Signed-off-by: Andrew <write@imaginarycode.com> * Add vendored files * Add missing depends * A few clean ups * Added improvements, proper encryption * Better encryption key * Simplify "key" generation * Make 2FA enrollment page more robust * Fix typo * Rename twofa/2FA to TwoFactor * UNIQUE INDEX -> UNIQUE
* Attach to release (#673)Philip Couling2017-01-151-3/+1
| | | | | | | | | | | | | | * Moved attachaments POST url from /issues/attachments to /attachments * Implemented attachment upload on release page * Implemented downloading attachments on the release page * Added zip and gzip files to default allowed attachments * Implemented uploading attachments on edit release * Renamed UploadIssueAttachment to UploadAttachment
* Don't create a default pid file (#637)Bwko2017-01-141-1/+1
|
* Notifications: mark as read/unread and pin (#629)Andrey Nering2017-01-121-1/+4
| | | | | | | | | | * Use relative URLs * Notifications - Mark as read/unread * Feature of pinning a notification * On view issue, do not mark as read a pinned notification
* feat: support pid file.Bo-Yi Wu2017-01-091-0/+10
|
* Merge pull request #539 from andreynering/notifications-step-2Andrey Nering2017-01-051-0/+4
|\ | | | | Notifications - Step 2
| * Notifications - Step 2Andrey Nering2016-12-301-0/+4
| |
* | fix windows build broken by #416Lunny Xiao2016-12-311-24/+2
| |
* | Support http service graceful restart (#416)Lunny Xiao2016-12-311-3/+23
|/ | | | | | * support http service graceful restart * fix dependencies