Commit graph

1467 commits

Author SHA1 Message Date
Stefan Kalscheuer
0b177574c9 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
89845f6728 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 4a46613 and fixes #2053.
2017-07-12 04:26:54 +02:00
Ethan Koenig
e58237ee3f Fix import order 2017-07-06 16:38:38 -04:00
Ethan Koenig
e14ea9979b Relative URL tests 2017-07-06 12:46:31 -04:00
Ethan Koenig
b1d7348a20 Fix wiki preview links 2017-07-06 12:07:15 -04:00
Ethan Koenig
2fd039864b Fix missing-return bug (#2109) 2017-07-04 09:29:57 +08:00
Ethan Koenig
fea902adc8 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
3c0705ecf3 Absolute path for setting.CustomConf (#2085) 2017-07-01 11:10:04 +08:00
Ethan Koenig
2b410e44b2 lint 2017-06-29 12:11:34 -04:00
Ethan Koenig
05e3726415 Use default avatar on error 2017-06-29 12:10:33 -04:00
Ethan Koenig
23f0728879 Don't ignore gravatar error 2017-06-29 10:37:55 -04:00
Lauris BH
32fc44aa83 Make time diff translatable (#2057) 2017-06-28 13:43:28 +08:00
Dan Magnus Lindvall
79daf31058 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
5db8cf3bd1 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
f6450b8f92 remove deprecated code for Gogs compitable (#2041) 2017-06-23 14:29:53 +08:00
Mike Fellows
32f1c41f28 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
b7812be33a fix misspell (#1996)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-18 08:30:04 +08:00
Andrey Nering
635273cea6 Merge pull request #1829 from ethantkoenig/no_branches
Commitless repos should be bare
2017-06-12 11:05:01 -03:00
Ethan Koenig
6d613fb28e No highlighting for .txt files (#1922) 2017-06-09 19:39:16 -05:00
Jonas Östanbäck
d9a8eff2de 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
f6b58964d7 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
6ec07a6bd7 Make LocalCopyPath a setting instead of a hard-coded path (#1881) 2017-06-06 04:09:54 -05:00
Ethan Koenig
bfb44f8854 Fix status table race condition (#1835) 2017-05-31 16:57:17 +08:00
Ethan Koenig
642f844735 Fix PR template error (#1834) 2017-05-30 07:04:12 -05:00
Jonas Östanbäck
b93568cce4 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
e0c6ab2d44 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
c85ff532e9 Commitless repos should be bare 2017-05-28 22:31:40 -04:00
Bo-Yi Wu
1e40c2e579 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
be5323a05f 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
6362462da8
fix admin lost permission caused by #947 2017-05-19 08:59:26 +08:00
Lunny Xiao
fd6034aaf2 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
5db5e16ab6 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
9e627af9a4 gofmt (#1710) 2017-05-12 16:09:53 +08:00
Ethan Koenig
5ca3046da6 Fix rendering of issue checkboxes (#1709) 2017-05-12 15:52:45 +08:00
Lauris BH
524885dd65 LDAP user synchronization (#1478) 2017-05-10 15:10:18 +02:00
mappu
fd76f090a2 markup: microoptimise for many short filenames in directory (#1534)
* markup: microoptimise for many short filenames in directory

Move strings.ToLower() after the early-return length check. This is a safe operation in all cases and should slightly improve directory listing performance when a directory contains many thousands of files with short filenames.

* markup: expand test cases for IsReadmeFile()
2017-05-09 22:20:22 +08:00
Lauris BH
51d0becb42 Add configuration option for default permission to create Organizations (#1686) 2017-05-08 21:51:53 +02:00
Lauris BH
9a0b0da1fe Fix commit sha1 URL rendering in markdown (#1677)
* Fix commit sha1 URL rendering in markdown

* Add unit test for commit sha1 markdown rendering when sha1 has space before it

* Change to better variable name
2017-05-05 16:49:13 +08:00
Lunny Xiao
1773e88643 Drop db operations from hook commands (#1514)
* move all database operations from hook command to web command and instead of internal routes

* bug fixed

* adjust the import path sequences

* remove unused return value on hookSetup
2017-05-04 13:42:02 +08:00
Antoine GIRARD
3edb0c5894 Generate swagger json (#1402)
- Generate swagger.json into public/
- Add swagger-ui auto-installation
- Add footer link to local swagger-ui
- Add /swagger url for using app url.
- Fix Swagger-UI version via git tag
2017-05-02 15:35:59 +02:00
Lunny Xiao
0d1e001b9c fix multiple readme file rendering and fix #1657 (#1658)
* fix multiple readme file rendering and fix #1657

* remove unnecessary loop
2017-05-02 16:57:54 +08:00
Lauris BH
0144817971 Do not allow commiting to protected branch from online editor (#1502)
* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
2017-05-02 08:49:55 +08:00
Lunny Xiao
3ebbdfaa75 make openid support default false for compitable with v1.1 (#1650) 2017-05-02 00:27:53 +08:00
Willem van Dreumel
950f2e2074 Additional OAuth2 providers (#1010)
* add google+

* sort signin oauth2 providers based on the name so order is always the same

* update auth tip for google+

* add gitlab provider

* add bitbucket provider (and some go fmt)

* add twitter provider

* add facebook provider

* add dropbox provider

* add openid connect provider incl. new format of tips section in "Add New Source"

* lower the amount of disk storage for each session to prevent issues while building cross platform (and disk overflow)

* imports according to goimport and code style

* make it possible to set custom urls to gitlab and github provider (only these could have a different host)

* split up oauth2 into multiple files

* small typo in comment

* fix indention

* fix indentation

* fix new line before external import

* fix layout of signin part

* update "broken" dependency
2017-05-01 21:26:53 +08:00
Antoine GIRARD
8371f94d06 Rework SSH key management UI to add GPG (#1293)
* Rework SSH key management UI to add GPG

* Add more detail to gpg key display

* Update CHANGELOG.md

* Implement deletion UI

* Implement adding gpg UI

* Various fixes

- Fix duplicate entry in locale
- Re-generate hash before verification since they are consumed

* Add missing translation

* Split template

* Catch not found/verified email error
2017-04-26 21:10:43 +08:00
Morlinest
fcc7cdab11 Fix markdown rendering (#1530) 2017-04-24 12:18:36 +08:00
Lunny Xiao
52627032bc Add markup package to prepare for org markup format (#1493) 2017-04-21 09:01:08 +02:00
Lunny Xiao
f0db3da713 fix go get sub package and add domain on installation to let go get work defaultly (#1518)
* fix go get sub package and add domain on installation to let go get work defaultly

* fix import sequence

* fix .git problem
2017-04-21 10:43:29 +08:00
Lunny Xiao
a2d365c81f fix #1501 ssh hangs caused by #1461 (#1513) 2017-04-19 19:16:36 +08:00
Lunny Xiao
2eeae84cbd Add internal routes for ssh hook comands (#1471)
* 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
2017-04-19 11:45:01 +08:00