Commit Graph

71 Commits (f1a4b8683b2338b198114786a0f4cba14e8d07e8)

Author SHA1 Message Date
unknwon f1a4b8683b go fmt 2019-08-19 07:48:43 +08:00
unknwon ad927c5950
routes/api/srcgraph: rename struct to match adapter package 2019-08-03 15:30:13 -07:00
unknwon e688457820
routes/api/srcgraph: remove option field 2019-08-01 18:07:21 -07:00
unknwon e2629d7ea6
routes/api/srcgraph: initial support for General Protocol 2019-07-31 21:27:40 -07:00
Unknwon 657ea2686f
auth: coding style and glitches fixes for GitHub login source (#5340) 2018-12-18 16:46:50 -05:00
haixunlu 311df9c521 auth: add new authentication source: GitHub, including GitHub Enterprise (#5340)
* Add new Authentication Source: GitHub, including GitHub Enterprise.

* Add vendor dependencies.
2018-12-18 15:49:30 -05:00
Unknwon 86ada87529
models/repo_editor: sanitize user-defined file name to prevent RCE (#5558)
Reported by PentesterLab (https://pentesterlab.com).
2018-12-18 01:31:04 -05:00
Unknwon f91cb9321e
api: add GetReferenceSHA (#5546) 2018-12-16 19:47:32 -05:00
Unknwon ee82d35ed8
api: add GetSingleCommit (#5546) 2018-12-15 00:24:41 -05:00
Unknwon f545faa06d
templates: make state changing routes to POST method (#5541)
- pkg/context: add ParamsUser to unify the injection process
2018-12-06 22:58:02 -05:00
Unknwon f2ec0d80a8
user/auth: flush and destroy session at logout (#5540)
Reported by @cezar97.
2018-12-04 19:35:44 -05:00
Unknwon 98114944fc
vendor: update github.com/gogs/go-gogs-client
Bring fixes for #5538
2018-12-03 14:45:19 -05:00
Unknwon e1b3a25008
api/repo: support edit repository issue tracker (gogs/go-gogs-client#94) 2018-12-02 12:55:05 -05:00
Unknwon 69c1cd3f38
routes/api: change status handle to new style
Also fixed one bug that did not catch team not found error.
2018-12-01 21:41:30 -05:00
Unknwon ce13fbb98a
routes/api: allow get repository without login (#5475) 2018-12-01 21:40:19 -05:00
Unknwon 3db9b06a6e
api: fix critical CSRF vulnerabilities on API routes (#5355)
By explicitly requires token authentication.
2018-11-28 21:05:58 -05:00
Charles Kenney 6c90d12a0c routes/repo/issue: implement issue pre-filling (#5521)
Signed-off-by: Charles Kenney <charlesc.kenney@gmail.com>
2018-11-20 13:16:42 -05:00
William Hilton dae311ea9d repo/http: update CORS headers to allow custom user-agent (#5498)
At some point after #4970 was merged, isomorphic-git started sending a custom User-Agent in its HTTP requests to deal with some services (\*cough\* gists \*cough\*) which filtered git traffic by User-Agent. Sadly, this broke cloning from Gogs using isomorphic-git in the browser (https://github.com/isomorphic-git/isomorphic-git/issues/555). This PR fixes it by telling browsers it is OK for CORS requests to send a custom User-Agent header.
2018-11-07 18:14:15 -05:00
Unknwon a221b2807f
routes/repo/issue: fix redirect with unexpected escape (#5443) 2018-09-30 13:55:40 -04:00
Unknwon 0d66b1cc1c
pkg/context: apply EscapePound at context level
Always escape template variable {{.Link}} variable and  redirect calls.

Relates to #5442
2018-09-28 23:56:45 -04:00
Unknwon bd7d1e2f16
routes: fix open redirect vulnerability (#5355)
Reported by @cezar97.
2018-09-28 23:19:29 -04:00
Unknwon f8302c5470
ci: fix go vet and add Go 1.11.x 2018-09-14 22:48:35 -04:00
Unknwon 1ec365de25
repo: trigger webhook when delete branch after merged pull request (#5331) 2018-09-14 20:04:31 -04:00
Unknwon b68de2330d
auth: support set default login source (#5274) 2018-09-13 14:06:04 -04:00
haixunlu 68a6579852 login_source: add default authentication switch (#5338)
* Add default Authentication Switch.

* adjust the code accroding to reviews

* #1. Remove redudant logic.
#2, Fix a bug in "Edit" panel.

* Remove unused logic

* Fix local authentication files are not flushed.

* refactor according to review.
2018-09-13 13:49:07 -04:00
Unknwon 512a900202
repo/editor: hide internal error detail
Prevent exposure of server path
2018-08-17 23:35:53 +08:00
Unknwon ac73d43444
repo_editor: able to trigger Git hooks (#4338) 2018-08-17 23:15:20 +08:00
Unknwon 844d69143f
pkg/markup: allow match SHA1 length 7-40 (#3321) 2018-08-17 20:02:43 +08:00
chromium1337 1f247cf813 routes: fix open redirect vulnerability #5364 (#5365) 2018-08-06 17:10:16 +08:00
GeekComb c9bb33afc3 repo: fix issue of fork repository no check the limit of users' repository (#5346) 2018-07-18 20:03:09 +08:00
Steve Chung 436dd6c0a4 routes/repo/setting: require autosize when repo/settings/options is rendered (#5315) 2018-06-26 21:40:09 +08:00
ususdei cd71077c6a pull request: able to add custom commit description (#5276)
* pull request merges now allow for custom commit messages

* allow i18n on commit_message label

* place label above textarea for commit message

* rename commit message for pull requests into commit description and pass to git separately
2018-06-26 20:49:46 +08:00
Unknwon 376a629c9f
repo: add changes to repository avatar feature (#5221) 2018-06-17 22:18:41 +08:00
Sergey Dryabzhinsky 303fa37b60 repo: support avatars (#5221)
* First code for repository avatars

* Last code for repository avatars

- add new option for repo avatars location on filesystem
- add route catch in web
- add new fields to repo model
- add migration
- update settings handlers
- update repo header template

* Update locale messages

* Add repo avatars to home page

* Add repo avatars to organization right panel

* Show repo avatars in repo list

* Remove AvatarEamil field, remove Gravatar support, use generic locale messages

* Fix migration

* Fix seed and not used tool

* Revert public css changes, add them to less files

* Latest lessc (2.6.0) don't put result into file but output to stdout

So redirect output to file

* Simplify things:

- migration don't needed, and table changes too
- just upload file to repo avatar storage
- or generate random image

* Fix repo image seed - name not unique

* Get rid of not needed model fields

* Class value is enough, remove height attribute

* Don't generate random avatar for repository

- use html and semantic ui icons if no avatar found

* Update styles and templates for repo

- use repo icon as default avatar
- use globe icon for public repos
- add micro style for repo avatars at dashboard

* Remvoe redundant empty line

* Fix nl2br filter - must return string

* Fix css style for micro-repo-avatar in dashboard list

* Remove `|len`, works fine w/o it.

* Update after review 2:

- use static route for repository avatar
- format images settings block in settings

* Update after review 2:

- no random avatar for repo

* Update after review 2:

- no random avatar for repo 2
- update imports
- update UploadAvatar* functions

* Update after review 2:

- update templates

* Fix trace call

* Remove unused immport since we use static route for repo avatars.
2018-06-17 20:21:52 +08:00
Unknwon e5ddbcab7d
routes/repo/http: fix wrong format type 2018-06-13 21:58:46 +08:00
oOOps f9bc980b0b api: correct pagination in repository search api (#5293) 2018-06-13 21:55:09 +08:00
Unknwon dfd494c113
repo: minor improve for PR #5219 and support UTF-8 byte count 2018-06-11 21:06:24 +08:00
Sergey Dryabzhinsky 57897cc8c2 repo: update repository description field to contain more than 256 symbols (#5219)
* Update repository description field to contain more than 256 symbols

- update repository model - description field now is `TEXT` and limited by 4000 symbols
- new migration
- add description to html forms - repo creation and repo settings
- add translation for description

* Update for description field, new features

- add autosize (height) for description textarea, new plugin
- set max description length to 512 symbols
- update locales

* Fix migration - typo in var

* Update repo description behaviour

- add textarea autosize for /repo/create
- add symbols counter under description testarea (create/edit)

* Fix function definition - it a var

* Revert ru-RU locale

* Update by review

- Use type `varchar(512)` in migration
- Remove unused files from autosize plugin

* Fix migration - new project paths

* Fixes after review 2

- copyright year
- format includes
- use switch instead of multi-if

* Remove unused `default:` option.
2018-06-11 20:34:26 +08:00
Unknwon fbecc18e2e
*: use jsoniter to replace encoding/json 2018-06-09 17:32:58 +08:00
Alexey Terentyev 4c844081f3 routes/repo: added deletion of an empty line at the end of file (#5261) (#5270)
* Added deletion of an empty line at the end of file (#5261)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fix after feedback

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-06 21:32:54 +08:00
Unknwon 775919c129
mirror: show sync feeds on dashboard (#2017) 2018-05-30 21:26:03 +08:00
Unknwon aff4208244
*: rename "gogits" to "gogs" 2018-05-27 08:53:48 +08:00
Wei He 73dbaefec5 routes/user/setting: fix avatar email update error (#5245) 2018-05-26 09:19:04 +08:00
Unknwon 05edcde6c9
routes/user/auth: improve coding style 2018-05-21 14:45:47 +08:00
Unknwon 01ccc2cc96
security: prevent same passcode from being reused
Reported by @cezar97.
2018-05-21 14:24:06 +08:00
Lauris BH eccc8109c1 security: fix path cleanup for repository init and editor (#5207)
Reported by Kacper Szurek https://security.szurek.pl/.
2018-05-08 14:32:49 -04:00
Unknwon f89d948c06
templates/repo/issue: rework escape delete branch link after merged pull request (#4601) 2018-04-16 23:08:09 -04:00
Unknwon f2ecfdc96a
auth: support authentication source config file (#3142) 2018-04-12 09:55:58 -04:00
Unknwon 34bd04f925
MISC: fix typo and grammar
Reference: 932490d7f1 (commitcomment-28344918)
2018-03-30 04:40:13 -04:00
Unknwon 932490d7f1
conf: add option to rewrite authorized_keys file at start (#4435)
Added config option '[server] REWRITE_AUTHORIZED_KEYS_AT_START'.
2018-03-30 01:32:18 -04:00