Commit Graph

88 Commits (a617d52374e937db0edacfba2a26bdd14a05538e)

Author SHA1 Message Date
Unknwon a617d52374
2fa: initial support (#945) 2017-04-06 00:14:30 -04:00
Unknwon 6fbb984ebf
Refactoring: rename pkg/base -> pkg/tool 2017-04-05 09:05:40 -04:00
Unknwon c05717a5f0
models/mirror: feed git.IsRepoURLAccessible with raw mirror address 2017-04-04 20:42:18 -04:00
Unknwon fe25effe7c
repo/http: fix client is not informed to provide credentials
When Git client has cached credentials for a site, missing response
header 'WWW-Authenticate: Basic realm="."' will result in Git client
does not prompt user to input credentials again but plain error
message and halts push/pull process.
2017-04-04 19:36:30 -04:00
Unknwon d05395fe90
Refactoring: rename modules -> pkg
Reasons to change:

1. Shorter than 'modules'
2. More generally used by other Go projects
3. Corresponds to the naming of '$GOPATH/pkg' directory
2017-04-04 19:29:59 -04:00
Unknwon 79ba0314e9
milestone: only show issue-related count under issue list (#4316) 2017-03-24 14:00:01 -04:00
Unknwon beee6e03b1
error: move ErrRepoNotExist -> errors.RepoNotExist 2017-03-23 14:27:34 -04:00
Unknwon 0ccd7c97ab
models: rename ErrUserNotExist -> errors.UserNotExist 2017-03-16 17:18:43 -04:00
Unknwon 92153fd898
git_hook: add new env var 'GOGS_AUTH_USER_EMAIL' (#4252) 2017-03-06 23:28:03 -05:00
Unknwon e9838a83ce
routers/repo/http: only prompt HTTP Basic Authentication when intended
Sometimes user could simply request wrong URL, but if that wrong URL
has nothing related Git HTTP operations, HTTP Basic Authentication
should not prompted. Instead, clean 404 page should be presented.

The patch also supports Git HTTP operations without '.git' suffix
to the repository name, which addresses #4226 and #4189.
2017-03-04 21:26:32 -05:00
Unknwon b78e03934d
models/access: hasAccess only need userID not user object 2017-02-23 16:15:25 -05:00
Unknwon 7e09d210ba
Initial version of protected branches (#776)
- Able to restrict force push and deletion
- Able to restrict direct push
2017-02-17 15:10:50 -05:00
Unknwon 5155f026b4
Security: fix XSS attack on milestone
Reported by Miguel Ángel Jimeno.
2017-02-17 08:06:48 -05:00
Unknwon d521e716dd
refactoring: SSH and HTTP push procees is now unified
We used to handle SSH and HTTP push separately which produces
duplicated code, but now with post-receive hook, the process
is unified to one single place and much cleaner.
Thus, UpdateTask struct is removed.

Narrow down the range of Git HTTP routes to reduce condufsing
HTTP Basic Authentication window popup on browser.

By detecting <old-commit, new-commit, ref-name> inside post-receive
hook, Git HTTP doesn't need to read the whole content body anymore,
which completely solve the RAM problem reported in #636.
2017-02-16 16:33:49 -05:00
Unknwon eb66060cd7
log: start using gopkg.in/clog.v1 2017-02-09 19:29:59 -05:00
Unknwon 2994272e91
Code fix for PR #3748 2016-12-23 20:44:27 -05:00
typeless cdedc2d188 Use temporary file to avoid out-of-memory when receiving big chunks. (#3748)
* Use temporary file to avoid out-of-memory when receiving big chunk.

Not perfect but I think it's a reasonable solution.
For small request bodies, I suppose performance wouldn't be an issue.
For large ones, this seems to be a necessary evil.

* Must close the open file to avoid fd leaks
2016-12-23 19:50:12 -05:00
Unknwon 16d3e7085e
Minor fix for PR #3667 2016-12-22 01:51:49 -05:00
Thibault Meyer c47fbc629b Feature #2583: Disable HTTP cloning (#3667)
* Can disable GIT interactions by HTTP protocol

* rename variable + fix wiki link

* missing space
2016-12-22 01:42:04 -05:00
Unknwon a00c932bbc General code quality improvement 2016-08-16 23:06:38 -07:00
Unknwon dccb0c15b9 Replace convert.To with APIFormat calls 2016-08-14 04:17:26 -07:00
Unknwon 3f7f4852ef #2246 fully support of webhooks for pull request 2016-08-14 03:32:24 -07:00
Unknwon 1f2e173a74 Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
Franz Schmidt 8b35c194ec Fixes #3110 (#3136) 2016-06-27 17:02:39 +08:00
Unknwon c041273dd3 repo/http: clean code 2016-06-01 04:19:01 -07:00
Unknwon 60ae8ac3d2 Add route for #2846 2016-03-21 10:49:46 -04:00
Unknwon 514382e2eb Rename module: middleware -> context 2016-03-11 11:56:52 -05:00
Unknwon 338af89d56 #2650 fix possbility that use email as pusher user name
Remove the possibility of using email as user name when user actually push
through combination of email and password with HTTP.

Also refactor update action function to replcae tons of arguments with
single PushUpdateOptions struct.
And define the user who pushes code as pusher, therefore variable names shouldn't
be confusing any more.
2016-02-17 22:47:06 -05:00
Florian Kaiser 0e4ae27caa Use pretty 404 pages in repo.HTTPBackend 2016-02-02 14:09:47 +00:00
zhuharev 0d5dc8a064 typo fix 2016-01-06 22:41:42 +03:00
Unknwon a62290de52 #2311 improve HTTP auth error message 2015-12-30 21:29:30 -05:00
Unknwon 40f3142264 #2114 External URL for wiki 2015-12-11 04:55:08 -05:00
Unknwon 830d000667 finish wiki 2015-11-30 20:45:55 -05:00
Unknwon c50a3503e6 introduce git-shell 2015-11-26 17:33:45 -05:00
Unknwon 0128036514 #1681 some fixes for builtin SSH server on Windows 2015-11-23 22:32:07 -05:00
Unknwon b55499d039 go vet and fix #1890 2015-11-08 14:31:49 -05:00
Unknwon 0fbb8c8826 New push to head repo of head branch: regenerate patch and retest apply 2015-10-24 03:36:47 -04:00
Unknwon 2ac8e11f46 #842 able to use access token replace basic auth 2015-09-02 02:40:15 -04:00
Unknwon 03b85b73af token recent activity 2015-08-19 06:22:33 +08:00
Unknwon d17f102339 try to fix HTTP ops not GC 2015-08-17 22:32:43 +08:00
Unknwon 407385db7e work on #1493 2015-08-17 17:05:37 +08:00
Unknwon dea3a8c6a4 WIP: create PR - choose branch 2015-08-08 22:43:14 +08:00
Unknwon e50982f5ec allow anonymous SSH clone 2015-08-05 11:14:17 +08:00
Unknwon fa298a2c30 #835: Realtime webhooks 2015-07-25 21:32:04 +08:00
Linquize f26f8d5afa Set Content-Type to text/plain for http status 401
This is because git command line shows the failure reason only if Content-Type is text/plain.
2015-03-28 22:30:05 +08:00
Unknwon 588f3215c6 #1040: dashboard no longer accessible when repo is missing 2015-03-16 04:04:27 -04:00
Unknwon 4aafeace23 fix HTTP/HTTPS push update func call panic #1037 and `http: multiple response.WriteHeader calls` 2015-03-12 01:15:01 -04:00
Unknwon b0b11fd7b1 Merge branch 'access' of github.com:gogits/gogs into dev 2015-02-28 21:50:29 -05:00
Gogs fab038b175 Attempt #3 of ldap fixes 2015-02-27 13:18:29 +00:00
Peter Smit f9454cc32c Make sure that a mirror can't be written to by http or ssh 2015-02-16 12:00:06 +02:00