Commit Graph

1356 Commits (a07b1f630aee4deb82623ef05b8b236f2b0c09df)

Author SHA1 Message Date
Unknwon e8c3e9bcf8
Improve code for fix of #4006 2017-01-03 11:02:14 +08:00
Unknwon cdfcef04a1
Fix incorrect logic check for fork repo action 2017-01-03 10:39:05 +08:00
Unknwon 8aa35577b3
Fix vulnerability reported in #4006 2017-01-03 10:36:27 +08:00
Unknwon 8059175a5c
Fix dashboard issues/pull request counting 2016-12-27 22:01:18 +08:00
Unknwon f8fd084bd2
Fix dashboard issue/pull request scoping 2016-12-27 20:32:27 +08:00
Unknwon d528704503
Minor code fix for PR #3560 2016-12-27 20:26:35 +08:00
hgaiser e6ef75204b Fix assigned/created issues in dashboard. (#3560)
* Fix assigned/created issues in dashboard.

* Use GetUserIssueStats for getting all Dashboard stats.

* Use gofmt to format the file properly.

* Replace &Issue{} with new(Issue).

* Check if user has access to given repository.

* Remove unnecessary filtering of issues.

* Return 404 error if invalid repository is given.

* Use correct number of issues in paginater.
2016-12-27 18:54:24 +08: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 03f7f3ee67
Some code renaming 2016-12-22 19:58:30 -05:00
Unknwon 6383bf7480
Fix reported vulnerability
Ability to use labels from arbitrary repositories.

Reported by Miguel Ángel Jimeno.
2016-12-22 19:44:59 -05:00
Unknwon f471ef1bc7
Fix vulnerability reported in #3962 2016-12-22 19:35:06 -05:00
Unknwon 7ebe0a9916
Fix vulnerabilities reported in #3959 2016-12-22 19:19:56 -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 d04b19545d
Code fix for PR #3547 2016-12-22 01:28:06 -05:00
Unknwon 79a2745b4a
Set ProdMode in the correct place
Closes #3696, #3611

Previously, ProdMode can only be true for web server,
which always prints dev mode log message to incoming SSH
connections and leaks unexpected information.
2016-12-22 00:27:45 -05:00
Unknwon 6cc992ea54
Minor fix for PR #3687 2016-12-21 23:52:11 -05:00
Stefan Grönke 3376354ed8 Check if file is a symlink with web editor (#3687)
* editor checks for symlinks

* translate file_is_a_symlink message

* credit translation author
2016-12-21 23:49:56 -05:00
Unknwon 67380cf47b
Minor code fix 2016-12-21 04:08:23 -05:00
LefsFlare 39fdb0f9c4 Fixed 404 caused by unexpected question mark (#3668)
This fixes 404 caused when creating new files or wiki pages with question marks.
2016-12-21 04:05:49 -05:00
imilo 85fbd6e9c6 New settings option for a custom SSH host (#3763) 2016-12-21 03:46:54 -05:00
leonklingele d96f2a7184 Fix random string generator (#3953)
* Remove unused custom-alphabet feature of random string generator

* Fix modulo-biased random string generator

* Random string generator should return error if it fails to read random data via crypto/rand
2016-12-21 03:41:37 -05:00
Nico Mandery adcb1d7c65 serve video files using the HTML5 video tag (#3967) 2016-12-21 03:40:23 -05:00
Alexander Lunegov 7358e46815 Fix string format verbs (#3637) 2016-12-21 02:09:43 -05:00
Unknwon 8f09fc64bd
Minor fix for PR #3624 2016-12-21 01:48:11 -05:00
Kim "BKC" Carlbäcker b2de3d71c5 More Issue-Comments API-endpoints (#3624)
* ListAllInRepo & Delete Issue-Comments

* Moar data in issue-comments
2016-12-21 01:21:15 -05:00
Unknwon 44ed991726
Merge branch 'develop' of https://github.com/tanapoln/gogs into develop 2016-12-21 00:49:44 -05:00
LefsFlare 2cb5ec5983 Prevented user enumeration of valid users through HTTP status codes of login (#3639) (#3654) 2016-10-16 22:08:40 -04:00
Unknwon 6da55159a2
#3589 LoadRepoConfig after ORM is initialized 2016-09-02 23:18:37 -04:00
Tanapol Nearunchorn 73fedc7275 provide button to delete merged pull request 2016-09-02 10:12:21 +07:00
Daniel Oaks b3d9ca4ccd Add the ability to explore organizations (#3573)
* Add ability to explore organizations

* Use right icon for org explore links
2016-09-01 09:08:05 -04:00
Unknwon dadd35b636 #3559 fix template error 2016-08-31 13:59:23 -07:00
Unknwon 152e715999 models/login_source: code improvement 2016-08-31 01:22:41 -07:00
Unknwon 99c2ae7b35 #3515 use alert instead 500 for duplicated login source name 2016-08-31 00:56:10 -07:00
无闻 cd9b926af7 Support Editorconfig on web editor (#3512) 2016-08-30 16:47:22 -07:00
Andrey Nering 9ac46fb983 Support Editorconfig on web editor 2016-08-30 20:30:47 -03:00
Unknwon 8516dfcb6c #2018 able to sync now for mirrors
- Refactor code to use sync.UniqueQueue
- Closes #3509
2016-08-30 16:18:33 -07:00
Unknwon 643142acab Web editor: support upload files 2016-08-30 05:23:59 -07:00
Unknwon 780cc2d110 router/repo: code refactoring 2016-08-30 02:08:38 -07:00
Unknwon 28cf0e6aaa #3459 code quality improvement 2016-08-29 20:00:06 -07:00
Thibault Meyer 92fb30c526 Load a set of predefined labels (#3459)
* Can use a predefined set of labels

* Change UI

* Fix HTML file indentation

* Avoid reading file from other directory (security issue)

* Apply a better fix

* Remove not used variable

* Merge upstream/develop

* Do modifications

* Raname

* remove binding + rename variable
2016-08-29 19:02:49 -07:00
Unknwon 62b0dc4853 Web editor: fix cannot create new file in subdirectory 2016-08-29 00:10:21 -07:00
Unknwon 429c92c0ce #3516 enforce line ending to be \n from web editor 2016-08-28 05:32:10 -07:00
Unknwon ba27d71abe Web editor: improve edit file 2016-08-28 04:31:42 -07:00
Unknwon 0114fdcba4 Web editor: improve delete file process 2016-08-28 01:41:44 -07:00
Unknwon 6e171c5225 Web editor: improve edit file tooltip 2016-08-27 15:25:01 -07:00
Unknwon f0b5c3b90a #3448 redirect if any after sign in 2016-08-27 15:07:02 -07:00
Unknwon 13a8823bd3 #3495 only start builtin SSH server after user finish installation 2016-08-27 12:25:22 -07:00
Unknwon 6b98d58906 #2966 code cleanup 2016-08-26 13:40:53 -07:00
Iwan Budi Kusnanto 8dca9f95fa issues comment API : list, create, edit (#2966)
add `since` query string support to list issue comment
2016-08-26 11:23:21 -07:00
Unknwon f8a48ffaad Web editor: improve code quality 2016-08-24 21:35:03 -07:00
Kurt Madel 67fb0fe6a5 added support to set pull_request event from api (#3513) 2016-08-24 20:44:58 -07:00
Unknwon 0b273ac4d5 #3383 code cleanup 2016-08-24 16:05:56 -07:00
lstahlman 84b56c3c53 Additional API support for milestones (#3383) 2016-08-24 15:18:56 -07:00
Kim Carlbäcker 7c5710d31f Issues can be closed via API (#3170) (#3479)
* Issues can be closed via API

* Error-checking is nice xD

* EditIssueOption.Status => State

* Use const instead of string-literal
2016-08-23 09:09:32 -07:00
Unknwon a00c932bbc General code quality improvement 2016-08-16 23:06:38 -07:00
Unknwon 6f9a95f830 #2246 add HTMLURL to webhook type
- Fill Milestone and Assignee field when available in webhook payload
2016-08-16 10:19:09 -07:00
Unknwon 6cda35a75f #3464 reproduce diff signs 2016-08-16 07:31:54 -07:00
Unknwon 2625193a48 models/repo_editor: improve code quality 2016-08-15 22:20:55 -07:00
Unknwon 4042d1f0c3 models/issue: improve quality and performance of NewIssue function 2016-08-15 18:40:32 -07:00
Unknwon 4a46613916 markdown: fix treating pure number as SHA1
- Detect non-exist commit and return 404 not 500
2016-08-15 15:27:19 -07:00
Unknwon 61e27dedf7 #3466 fix response of pull request form validation error 2016-08-15 14:04:44 -07:00
Unknwon 94392a7af3 Fix empty repository panic on send test webhook 2016-08-15 05:53:47 -07:00
Unknwon 8637e67e6f Fix outdated edit can’t overwrite changes 2016-08-15 02:06:35 -07:00
Unknwon 4a19fd6441 Web editor: temporarily disable upload and quick fix for edit and new
Try to merge into develop branch ASAP, then continue minor fixes afterwards.
2016-08-15 01:42:20 -07:00
Unknwon 54e0ada9d5 Web editor: improve delete file 2016-08-14 23:52:24 -07:00
Unknwon cd89f6c502 Web editor: improve edit file and diff preview 2016-08-14 23:52:24 -07:00
Unknwon 15845cb287 Code clean up for new config options 2016-08-14 23:52:24 -07:00
Richard Mahn d0a0239bac Squashed commit of the following:
commit 0afcb843d7ffd596991c4885cab768273a6eb42c
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 17:13:29 2016 -0600

    Removed Upload stats as the upload table is just a temporary table

commit 7ecd73ff5535612d79d471409173ee7f1fcfa157
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 08:42:41 2016 -0600

    Fix for CodeMirror mode

commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 08:03:33 2016 -0600

    Made tabbing in editor use spaces

commit 23af384c53206a8a40e11e45bf49d7a149c4adcd
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 07:56:46 2016 -0600

    Fix for data-url

commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9
Merge: 7fc8a89 991ce42
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 07:42:53 2016 -0600

    Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file

    Conflicts:
    	modules/bindata/bindata.go
    	public/js/gogs.js

commit 7fc8a89cb495478225b02d613e647f99a1489634
Merge: fd3d86c c03d040
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 07:40:00 2016 -0600

    Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file

commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Sun Jul 31 07:39:44 2016 -0600

    Code cleanup

commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Fri Jul 29 15:38:23 2016 -0600

    Code cleanup

commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Thu Jul 28 18:36:01 2016 -0600

    Code cleanup and fixes

commit c2895dc742f25f8412879c9fa15e18f27f42f194
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Thu Jul 28 18:24:04 2016 -0600

    Fixes per Unknwon's requests

commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef
Merge: 889e9fa ad7ea88
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Thu Jul 28 17:13:43 2016 -0600

    Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file

    Conflicts:
    	modules/bindata/bindata.go
    	modules/setting/setting.go

commit 889e9faf1bd8559a4979c8f46005d488c1a234d4
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Fri Jul 22 14:09:18 2016 -0600

    Fix in gogs.js

commit 47603edf223f147b114be65f3bd27bc1e88827a5
Merge: bb57912 cf85e9e
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Fri Jul 22 14:07:36 2016 -0600

    Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file

    Conflicts:
    	modules/bindata/bindata.go
    	public/js/gogs.js

commit bb5791255867a71c11a77b639db050ad09c597a4
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Fri Jul 22 14:02:18 2016 -0600

    Update for using CodeMirror mode addon

commit d10d128c51039be19e2af9c66c63db66a9f2ec6d
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Tue Jul 19 16:12:57 2016 -0600

    Update for Edit

commit 34a34982025144e3225e389f7849eb6273c1d576
Merge: fa1b752 1c7dcdd
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Tue Jul 19 11:52:02 2016 -0600

    Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file

    Conflicts:
    	modules/bindata/bindata.go

commit fa1b752be29cd455c5184ddac2ffe80b3489763e
Author: Richard Mahn <richard_mahn@wycliffeassociates.org>
Date:   Fri Jul 15 18:35:42 2016 -0600

    Feature for editing, creating, uploading and deleting files
2016-08-14 23:52:24 -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
Andrey Nering dbed39ba05 On showing diff/file, use the tab_width specified on .editorconfig, if any (#3241)
Closes #3182
2016-08-11 17:07:09 -07:00
Unknwon 2cb04db526 Fix #3391 2016-08-11 15:29:39 -07:00
Unknwon a47aef5460 #2852 code cleanup 2016-08-11 14:55:10 -07:00
Unknwon 70fbcd2f27 models: rename EnableTidb to EnableTiDB 2016-08-11 14:38:45 -07:00
Thibault Meyer 53c573ed02 Fix #3314: Cannot edit release with tag name contains slash (#3434) 2016-08-11 13:45:42 -07:00
Robin Lambertz 5a9709fa9d Add MaxRepoCreation to EditUser API (#2781) 2016-08-11 11:49:31 -07:00
Unknwon 7e9b42c87d #2780 code clean up 2016-08-11 11:35:46 -07:00
Robin Lambertz b6c14f8b21 Add AddCollaborator API Endpoint (#2780)
* Add AddCollaborator API Endpoint

* Add optional Permission to AddCollaborator endpoint

* Use APIContext
2016-08-11 11:23:25 -07:00
Andrew 0885784f13 Wiki mirroring implementation (#3233)
* Implement wiki mirroring, add Update mirrors operation to admin dashboard

* bindata.go update after merge

* Implement checking Git repo endpoint existence, support for BB included

* Remove admin dashboard operation
Fix bindata.go

* Apply gofmt to repo model file

* Try to remove bindata from PR

* Revert accepted wiki names change in favor of better system

* Remove unused imports
2016-08-11 10:18:51 -07:00
Unknwon d625e41c6c #3408 minor code fix 2016-08-11 07:41:01 -07:00
Thibault Meyer 6a81632e36 Fix typo CacheInternal -> CacheInterval (#3432) 2016-08-11 05:59:11 -07:00
Unknwon b85927e488 #3091 show Git configs on admin panel 2016-08-10 11:01:42 -07:00
lstahlman 89f71b44f7 Add committer information to API and Webhooks. Also fixes #3271 (#3414) 2016-08-09 22:01:57 -07:00
Unknwon edd786446c #3158 skip RUN_USER check on Windows 2016-08-09 17:41:18 -07:00
Unknwon f70343660d Little code refactoring 2016-08-09 12:56:00 -07:00
Rory McNamara c8b45ecc27 Render the Code view on the server (minus syntax highlighting) (#2942)
* render code view server side

* remove debug print

* fix multiline selection bug

* change string concatenation to bytes.Buffer for efficiency

* Fix newlines added by previous for hljs

* fix selection highlighting

* make css changes in .less
2016-08-09 12:35:20 -07:00
lstahlman 2c82fc3edb Fix for #3410 overall issues for organisations is limited to num_repos from the user (#3412) 2016-08-09 10:00:42 -07:00
Sandro Santilli 90dd0657b5 Add support for federated avatars (#3320)
* Add support for federated avatars

Fixes #3105

Removes avatar fetching duplication code
Adds an "Enable Federated Avatar" checkbox in user settings
(defaults to unchecked)

Moves avatar settings all in the same form, making
local and remote avatars mutually exclusive

Renames UploadAvatarForm to AvatarForm
as it's not anymore only for uploading

* Run gofmt on all modified files

* Move Avatar form in its own page

* Add go-libravatar dependency to vendor/ dir

Hopefully helps with accepting the contribution.
See also #3214

* Revert "Add go-libravatar dependency to vendor/ dir"

This reverts commit a8cb93ae640bbb90f7d25012fc257bda9fae9b82.

* Make federated avatar setting a global configuration

Removes the per-user setting

* Move avatar handling back to base tool, disable federated avatar in offline mode

* Format, handle error

* Properly set fallback host

* Use unsupported github.com mirror for importing go-libravatar

* Remove comment showing life exists outside of github.com

... pity, but contribution would not be accepted otherwise

* Use Combo for Get and Post methods over /avatar

* FEDERATED_AVATAR -> ENABLE_FEDERATED_AVATAR

* Fix persistance of federated avatar lookup checkbox at install time

* Federated Avatars -> Enable Federated Avatars

* Use len(string) == 0 instead of string == ""

* Move import line where it belong

See
https://github.com/Unknwon/go-code-convention/blob/master/en-US/import_packages.md

Pity the import url is still the unofficial one, but oh well...

* Save a line (and waste much more expensive time)

* Remove redundant parens

* Remove an empty line

* Remove empty lines

* Reorder lines to make diff smaller

* Remove another newline

Unknwon review got me start a fight against newlines

* Move DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR after OFFLINE_MODE

On re-reading the diff I figured what Unknwon meant here:
https://github.com/gogits/gogs/pull/3320/files#r73741106

* Remove newlines that weren't there before my intervention
2016-08-07 10:27:38 -07:00
Thibault Meyer 30fda0f1ae Fix #3315: Release dont use tag creation date (#3374)
* Fix #3315: Release dont use tag creation date

* Simplify code and apply gofmt

* remove useless block (ctx.Repo.GitRepo.GetTag) on EditReleasePost

* apply gofmt on modified files
2016-08-06 10:02:15 -07:00
Unknwon ab9c5fb5e7 #2593 allow render raw content
Use URL query parameter render=1 to render content in raw mode.
2016-08-05 18:34:13 -07:00
rugk 28dc5bb566 Replace gogs.io http links with https version (#3386) 2016-08-05 17:35:40 -07:00
Unknwon cf6d321991 Ignore repository with issue disabled or use external tracker in dashboard issues 2016-08-05 12:46:26 -07:00
Unknwon 50422f1fc2 #3348 always use relative avatar link in the template 2016-08-05 12:12:54 -07:00
Unknwon db3d393576 routers/api: rename handlers to be unexported 2016-08-04 17:08:01 -07:00
Unknwon 2f105f3979 #2162 completely disable builtin issue tracker when enable external tracker 2016-08-04 16:32:02 -07:00
Unknwon e7fd65f0cf #3290 better code structure and batch minor improvements 2016-08-03 11:51:22 -07:00
lstahlman 2eeb0ec9b0 Additional API support for labels (#3290)
* Add API support for labels.

* Error handling for adding/replacing multiple issue labels

* Revisions to function names and error handling. Use issue.ClearLabels in replace/clear functions

* Additional code cleanup
2016-08-03 09:24:16 -07:00
Unknwon 10dc330640 #3345 dump content directly to HTTP ResponseWriter 2016-07-30 23:39:58 +08:00