summaryrefslogtreecommitdiffstats
path: root/cmd/web.go
Commit message (Collapse)AuthorAgeFilesLines
* Backport #5537 Remove a double slash in the HTTPS redirect with Let's ↵Greg Karékinian2018-12-131-1/+4
| | | | | | | | | | | | | | | Encrypt (#5539) 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
* Backported #5525 Fix the Let's Encrypt handler (#5527)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
* Tab on user profile to show starred repos (#519)Andrey Nering2016-12-291-1/+0
| | | | | | | | | | | | | | * Tab on user profile to show starred repos * Make golint happy and use transactions on StarRepo function * x -> sess * Use sess.Close() instead of sess.Rollback() * Add copyright * Fix lint
* commithgraph / timeline (#428)Kjell Kvinge2016-12-291-0/+1
| | | | | | | | | | * Add model and tests for graph * Add route and router for graph * Add assets for graph * Add template for graph
* Git LFS support v2 (#122)Fabian Zaremba2016-12-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Import github.com/git-lfs/lfs-test-server as lfs module base Imported commit is 3968aac269a77b73924649b9412ae03f7ccd3198 Removed: Dockerfile CONTRIBUTING.md mgmt* script/ vendor/ kvlogger.go .dockerignore .gitignore README.md * Remove config, add JWT support from github.com/mgit-at/lfs-test-server Imported commit f0cdcc5a01599c5a955dc1bbf683bb4acecdba83 * Add LFS settings * Add LFS meta object model * Add LFS routes and initialization * Import github.com/dgrijalva/jwt-go into vendor/ * Adapt LFS module: handlers, routing, meta store * Move LFS routes to /user/repo/info/lfs/* * Add request header checks to LFS BatchHandler / PostHandler * Implement LFS basic authentication * Rework JWT secret generation / load * Implement LFS SSH token authentication with JWT Specification: https://github.com/github/git-lfs/tree/master/docs/api * Integrate LFS settings into install process * Remove LFS objects when repository is deleted Only removes objects from content store when deleted repo is the only referencing repository * Make LFS module stateless Fixes bug where LFS would not work after installation without restarting Gitea * Change 500 'Internal Server Error' to 400 'Bad Request' * Change sql query to xorm call * Remove unneeded type from LFS module * Change internal imports to code.gitea.io/gitea/ * Add Gitea authors copyright * Change basic auth realm to "gitea-lfs" * Add unique indexes to LFS model * Use xorm count function in LFS check on repository delete * Return io.ReadCloser from content store and close after usage * Add LFS info to runWeb() * Export LFS content store base path * LFS file download from UI * Work around git-lfs client issue with unauthenticated requests Returning a dummy Authorization header for unauthenticated requests lets git-lfs client skip asking for auth credentials See: https://github.com/github/git-lfs/issues/1088 * Fix unauthenticated UI downloads from public repositories * Authentication check order, Finish LFS file view logic * Ignore LFS hooks if installed for current OS user Fixes Gitea UI actions for repositories tracking LFS files. Checks for minimum needed git version by parsing the semantic version string. * Hide LFS metafile diff from commit view, marking as binary * Show LFS notice if file in commit view is tracked * Add notbefore/nbf JWT claim * Correct lint suggestions - comments for structs and functions - Add comments to LFS model - Function comment for GetRandomBytesAsBase64 - LFS server function comments and lint variable suggestion * Move secret generation code out of conditional Ensures no LFS code may run with an empty secret * Do not hand out JWT tokens if LFS server support is disabled
* Provide button to delete merged pull request (#441)Lunny Xiao2016-12-251-0/+1
| | | | | | * provide button to delete merged pull request * golint fix
* Bindata is optional and over-writable on restart (#354)Thomas Boerger2016-12-221-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Moved conf assets into options folder * Dropped old bindata * Started to integrate options bindata and accessors * Do not enforce a builtin app.ini * Replaced bindata calls with options * Dropped bindata task from makefile, it's the generate task now * Always embedd app.ini to provide sane config defaults * Use sane defaults for the configuration * Defined default value for SSH_KEYGEN_PATH * Dropped "NEVER EVER MODIFY THIS FILE" header from app.ini * Fixed new paths in latest test additions * Drop bindata with make clean task * Set more proper default values
* Remove remaining Gogs reference on locales and cmd (#430)Joubert RedRat2016-12-211-2/+2
|
* Integrate templates into bindata optionally (#314)Thomas Boerger2016-12-061-55/+3
| | | Integrated optional bindata for the templates
* Catch os... errorsBwko2016-12-021-2/+3
|