2
0
Commit Graph

1484 Commits

Author SHA1 Message Date
Ethan Koenig
36267cec16 Webhooks for repo creation/deletion (#1663)
* Webhooks for repo creation/deletion

* add createHookTask

* Add handles for GetSlackPayload and GetDiscordPayload
2017-09-03 11:20:24 +03:00
Lauris BH
ae436760ee Fix releases to be counted from database not tags (#2389) 2017-08-28 22:06:10 +08:00
Lunny Xiao
ebaac2f66e Implementation of discord webhook (#2402)
* implementation of discord webhook

* fix webhooks

* fix typo and unnecessary color values

* fix typo

* fix imports and revert changes to webhook_slack.go
2017-08-28 13:06:45 +08:00
Manuel
b7d01d941a Add UseCompatSSHURI setting (#2356)
* Add UseCompatSSHURI setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> (+1 squashed commits)

Squashed commits:

[dda2dc79] Add ForceCloneSSHURL setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>

* Make protocol if construct more readable

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
2017-08-26 15:57:41 +02:00
Zsombor
25c3335031 Add possibility to record branch or tag information in an issue (#780) 2017-08-24 15:30:27 +03:00
Michael Lustfield
f20dd4a514 Moved vendored js/css into public/vendor and documented sources (#1484) (#2241)
* Cleaning up public/ and documenting js/css libs.

This commit mostly addresses #1484 by moving vendor'ed plugins into a
vendor/ directory and documenting their upstream source and license in
vendor/librejs.html.

This also proves gitea is using only open source js/css libraries which
helps toward reaching #1524.

* Removing unused css file.

The version of this file in use is located at:
  vendor/plugins/highlight/github.css

* Cleaned up librejs.html and added javascript header

A SafeJS function was added to templates/helper.go to allow keeping
comments inside of javascript.

A javascript comment was added in the header of templates/base/head.tmpl
to mark all non-inline source as free.

The librejs.html file was updated to meet the current librejs spec. I
have now verified that the librejs plugin detects most of the scripts
included in gitea and suspect the non-free detections are the result of
a bug in the plugin. I believe this commit is enough to meet the C0.0
requirement of #1534.

* Updating SafeJS function per lint suggestion

* Added VERSIONS file, per request
2017-08-23 16:58:05 +02:00
Antoine GIRARD
d7908c088d Improve swagger doc (#2274)
* Add swagger comment for adminCreateOrg

* Add swagger comment for admin route

* add hook swagger doc

* Add tags

* Add auth

* Fix name of responses

* Edit name method

* Update vendor

* make generate-swagger
2017-08-21 14:13:47 +03:00
Sandro Santilli
dbf4d596d2 Add OpenID configuration in install page (#2276) 2017-08-19 17:34:49 +02:00
Ethan Koenig
d849e090ae No error log entries for repo 404 (#2200) 2017-08-19 15:32:18 +03:00
Ethan Koenig
1c157cd5a5 Fix rendering of external links (#2292) 2017-08-13 19:30:27 -03:00
Michael Kuhn
37535bb548 Make short link pattern greedy (#2259)
Multiple links on the same line are currently not recognized correctly.
2017-08-06 00:52:19 +03:00
Lauris BH
e233790046 Fix internal requests when gitea listens to unix socket or only external IP (#2234)
* Fix internal requests when gitea listens to unix socket or only external IP

* When Gitea is set to listen using FastCGI use AppURL for LocalURL
2017-08-03 23:32:13 +08:00
Ethan Koenig
93e2feee90 Fix counts on issues dashboard (#2215)
* Fix counts on issues dashboard

* setupSess -> setupSession

* Unit test

* Load repo owners for issues
2017-08-03 13:09:16 +08:00
Ethan Koenig
8eb7afcdef EnableUnit() -> UnitEnabled() (#2242) 2017-08-02 11:46:54 +03:00
Christoph Handel
2c9cb8bed1 Fix git version check with four digits (1.8.3.1) (#2236) 2017-08-01 21:59:22 +03:00
Lauris BH
089ec744d9 Fix profile update for non-local users (#2178) 2017-07-19 09:36:37 +08:00
Lauris BH
a218b59f84 Remove unit types commits and settings (#2161)
* Remove unit types commits and settings

* Can not limit units in administrator teams

* Limit changing units only to teams with read and write access mode

* Small code optimization
2017-07-17 10:04:43 +08:00
Stefan Kalscheuer
a6f2a4b5f6 Only show SSH clone URL if signed in (#2169) (#2170)
* Add configuration flag SSH_EXPOSE_ANONYMOUS

If this flag (default True) is set to false, the SSH clone URL will only be exposed if the current user is signed in.

* Default SSH exposure set to false

To match GitHub and for security reasons, SSH URL exposure is disabled by default.
In addition to that. minor code changes have been applied.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>

* Add integration tests

* Hide clone button neither HTTP and SSH is enabled

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2017-07-15 22:21:51 +08:00
Roy Marples
6a2f71a735 Fix SHA1 hash linking (#2143)
This changes the regex to look for a hash from 7 to 40 characters,
to match the use of abbreviated hash lookups in both git and github.
The restriction of not being a pure number is also removed because
1234567 is now considered a valid abbreviated hash, as is deadbeef.

A note has been added to the top of the code to state that the
literal regex match is fine, but no extra validation is currently
performed so some false positives are expected.

A future change could ensure that the hash exists in the repository
before rendering it as a link, although this might incur a slight
performance penalty.

Reverts part of commit ce4acf6 and fixes #2053.
2017-07-12 04:26:54 +02:00
Ethan Koenig
cab808ea03 Fix import order 2017-07-06 16:38:38 -04:00
Ethan Koenig
d10b52f81d Relative URL tests 2017-07-06 12:46:31 -04:00
Ethan Koenig
20459e9435 Fix wiki preview links 2017-07-06 12:07:15 -04:00
Ethan Koenig
769da77ae2 Fix missing-return bug (#2109) 2017-07-04 09:29:57 +08:00
Ethan Koenig
2436bebd75 Check for valid renamed usernames (#2077)
* Check for valid renamed usernames

* Integration test

* Test for username with space

* Make name field required
2017-07-01 22:48:29 +03:00
Ethan Koenig
eac8eb8d75 Absolute path for setting.CustomConf (#2085) 2017-07-01 11:10:04 +08:00
Ethan Koenig
707c14c5f2 lint 2017-06-29 12:11:34 -04:00
Ethan Koenig
f68e83ae11 Use default avatar on error 2017-06-29 12:10:33 -04:00
Ethan Koenig
9ce8e54226 Don't ignore gravatar error 2017-06-29 10:37:55 -04:00
Lauris BH
a998986b06 Make time diff translatable (#2057) 2017-06-28 13:43:28 +08:00
Dan Magnus Lindvall
cf283a16d0 Setting to disable authorized_keys backup (#1856)
* Add setting to disable authorized_keys backup when rewriting public keys

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Update default value to comply with documentation

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Use tmp-file instead of bak-file for saving manually added keys.

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing and build bakpath with sprintf only

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Only close file once

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not modify calcFingerprint

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Fix casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change style from disable to enable

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change name, just SSH_BACKUP_AUTHORIZED_KEYS

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not check for directory existence if backup is disabled

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
2017-06-28 09:35:35 +08:00
Kim "BKC" Carlbäcker
ab635e1293 Always return valid go-get meta, even if unauthorized (#2010)
* Always return valid go-get meta, even if unauthorized

* don't leak information
2017-06-26 09:06:40 +08:00
Lunny Xiao
71903fd8f4 remove deprecated code for Gogs compitable (#2041) 2017-06-23 14:29:53 +08:00
Mike Fellows
c5029c7f28 ROOT_URL setting use the default as shown in conf/app.ini (#1823)
The well commented conf/app.ini file that comes with the code shows the
ROOT_URL (i.e. setting.AppURL) as:

    ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/

However the installed custom/conf/app.ini file does not include this setting as
shown, and the default in the setting module was hard coded to
http://localhost:3000/ instead of what is shown above.

With this change the ROOT_URL will default to what is shown above if it is not
set in the custom/conf/app.ini.

Of course it is still possible to override the default by adding the ROOT_URL
setting to your custom/conf/app.ini file as usual.

Signed-off-by: Mike Fellows <mike.fellows@shaw.ca>
2017-06-22 15:35:14 +08:00
Bo-Yi Wu
6b5714b65c fix misspell (#1996)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-18 08:30:04 +08:00
Andrey Nering
8db9f206d6 Merge pull request #1829 from ethantkoenig/no_branches
Commitless repos should be bare
2017-06-12 11:05:01 -03:00
Ethan Koenig
0234e29063 No highlighting for .txt files (#1922) 2017-06-09 19:39:16 -05:00
Jonas Östanbäck
1eb6004a46 Send mails as HTML as default. Setting for send as plain text. (#1648)
* Send mails as HTML as default. Setting for send as plain text.
 * Add new option SendAsPlainText. remove EnableHTMLAlternative
 * Send HTML mails as default
 * Add html check if html2text should be performed

* Send only multipart or plain. Add deprication warning for ENABLE_HTML_ALTERNATIVE

* Still use ENABLE_HTML_ALTERNATIVE for backward compatibility

* Changed to not ignore html2text errors
2017-06-07 09:14:31 +08:00
Sandro Santilli
3e3d0c55fe Include formatting check to the make test (and thus also check) rule (#1366)
* Include formatting check to the `make check` rule

... and give it its own standalone target too (make fmt-check)

Show diff on fmt-check failure
Do not allow running "fmt-check" with incompatible go version
Also simplify the `fmt` rule

* Forbid running "make fmt" with Go version != 1.7 or 1.8

* Ignore bindata.go for spelling and formatting checks

also remove duplicated variable assignment for GOFILES

* Run `make fmt`
2017-06-06 08:53:16 -05:00
Phil Hopper
fa0546b6fb Make LocalCopyPath a setting instead of a hard-coded path (#1881) 2017-06-06 04:09:54 -05:00
Ethan Koenig
2cc53871ff Fix status table race condition (#1835) 2017-05-31 16:57:17 +08:00
Ethan Koenig
d9ffdf987f Fix PR template error (#1834) 2017-05-30 07:04:12 -05:00
Jonas Östanbäck
56b709fa9f xxx_active_code_live setting in printed in hours and minutes instead … (#1814)
* xxx_active_code_live setting in printed in hours and minutes instead of just hours

* Update app.ini description of xxx_code_lives settings
2017-05-29 02:35:47 -05:00
Rémy Boulanouar
2e314e1166 Add Gitea Webhook (#1755)
* Replace Gogs by Gitea

* Fix missing changes

* Create Gitea webhook and put Gogs webhook apart.
2017-05-29 02:17:15 -05:00
Ethan Koenig
f7064960fb Commitless repos should be bare 2017-05-28 22:31:40 -04:00
Bo-Yi Wu
2775ad4b9a fix: #1757 fix set MAX_CREATION_LIMIT as zero. (#1762)
* fix: #1757 fix set MAX_CREATION_LIMIT as zero.

* fix: missing default value
2017-05-21 22:48:35 +08:00
Andrey Nering
0b79595391 Update HighlightJS and fix YAML files highlighting (#1764)
* Update HighlightJS to 9.11.0

* Fix YAML files highlighting
2017-05-20 11:52:35 +08:00
Lunny Xiao
90331a5642 fix admin lost permission caused by #947 2017-05-19 08:59:26 +08:00
Lunny Xiao
d9d2f96121 Add units to team (#947)
* add units to team

* fix lint

* finish team setting backend

* finished permission controll on routes

* fix import blank line

* add unit check on ssh/http pull and push and fix test failed

* fix fixtures data

* remove unused code
2017-05-18 22:54:24 +08:00
Jonas Östanbäck
eed45d4fa6 Correct grammar in APIEmpty documentation (#1748)
* Correct grammar in APIEmpty doc

* Generate swagger.v1.json
2017-05-18 22:39:42 +08:00
Ethan Koenig
9bcee7290c gofmt (#1710) 2017-05-12 16:09:53 +08:00