Commit Graph
480 Commits
Author SHA1 Message Date
techknowlogick 156f54d6e2 allow U2F with default settings for gitea in subpath (#12990)
* allow U2F with default settings for gitea in subpath

* use trim suffix

Co-authored-by: zeripath <[email protected]>
2020-10-01 20:49:49 +08:00
6543 818d921bbb Refactor use TrimSuffix instead of TrimRight (#12993)
* Refactor use TrimSuffix instead of TrimRight

* TrimRight right

* has #12990
2020-10-01 06:54:34 +01:00
Lunny Xiao 3878e985b6 Add default storage configurations (#12813)
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-09-29 12:05:13 +03:00
Tait Hoyem c85c9d40c2 Add config option to make create-on-push repositories public by default (#12936)
* Add config option to make create-on-push repositories public by default

* Fix linting

* Add option to 'config cheat sheet' page

* Chinese translation

Signed-off-by: a1012112796 <[email protected]>

* Fix typo in docs

* fix typo

* Add option to example config

Co-authored-by: Tait Hoyem <[email protected]>
Co-authored-by: a1012112796 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-09-27 15:20:52 -04:00
zeripath f1ab1c532b Allow extended config on cron settings (#12939)
* Allow extended config on cron settings

Fix #12934

Signed-off-by: Andrew Thornton <[email protected]>
2020-09-25 09:58:09 +01:00
zeripath 7a7f56044a Adopt repositories (#12920)
* Don't automatically delete repository files if they are present

Prior to this PR Gitea would delete any repository files if they are
present during creation or migration. This can in certain circumstances
lead to data-loss and is slightly unpleasant.

This PR provides a mechanism for Gitea to adopt repositories on creation
and otherwise requires an explicit flag for deletion.

PushCreate is slightly different - the create will cause adoption if
that is allowed otherwise it will delete the data if that is allowed.

Signed-off-by: Andrew Thornton <[email protected]>

* Update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Fix tests and migrate overwrite

Signed-off-by: Andrew Thornton <[email protected]>

* as per @lunny

Only offer to adopt or overwrite if the user can do that.

Allow the site administrator to adopt or overwrite in all
circumstances

Signed-off-by: Andrew Thornton <[email protected]>

* Use setting.Repository.DefaultBranch for the default branch

Signed-off-by: Andrew Thornton <[email protected]>

* Always set setting.Repository.DefaultBranch

Signed-off-by: Andrew Thornton <[email protected]>

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* update templates

Signed-off-by: Andrew Thornton <[email protected]>

* ensure repo closed

Signed-off-by: Andrew Thornton <[email protected]>

* Rewrite of adoption as per @6543 and @lunny

Signed-off-by: Andrew Thornton <[email protected]>

* Apply suggestions from code review

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* missing not

Signed-off-by: Andrew Thornton <[email protected]>

* add modals and flash reporting

Signed-off-by: Andrew Thornton <[email protected]>

* Make the unadopted page searchable

Signed-off-by: Andrew Thornton <[email protected]>

* Add API

Signed-off-by: Andrew Thornton <[email protected]>

* Fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Handle empty and non-master branched repositories

Signed-off-by: Andrew Thornton <[email protected]>

* placate lint

Signed-off-by: Andrew Thornton <[email protected]>

* remove commented out code

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-09-25 07:09:23 +03:00
zeripath 4979f15c3f Add configurable Trust Models (#11712)
* Add configurable Trust Models

Gitea's default signature verification model differs from GitHub. GitHub
uses signatures to verify that the committer is who they say they are -
meaning that when GitHub makes a signed commit it must be the committer.
The GitHub model prevents re-publishing of commits after revocation of a
key and prevents re-signing of other people's commits to create a
completely trusted repository signed by one key or a set of trusted
keys.

The default behaviour of Gitea in contrast is to always display the
avatar and information related to a signature. This allows signatures to
be decoupled from the committer. That being said, allowing arbitary
users to present other peoples commits as theirs is not necessarily
desired therefore we have a trust model whereby signatures from
collaborators are marked trusted, signatures matching the commit line
are marked untrusted and signatures that match a user in the db but not
the committer line are marked unmatched.

The problem with this model is that this conflicts with Github therefore
we need to provide an option to allow users to choose the Github model
should they wish to.

Signed-off-by: Andrew Thornton <[email protected]>

* Adjust locale strings

Signed-off-by: Andrew Thornton <[email protected]>

* as per @6543

Co-authored-by: 6543 <[email protected]>

* Update models/gpg_key.go

* Add migration for repository

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2020-09-20 00:44:55 +08:00
John Olheiser c6e4bc53aa Check passwords against HaveIBeenPwned (#12716)
* Implement pwn

Signed-off-by: jolheiser <[email protected]>

* Update module

Signed-off-by: jolheiser <[email protected]>

* Apply suggestions mrsdizzie

Co-authored-by: mrsdizzie <[email protected]>

* Add link to HIBP

Signed-off-by: jolheiser <[email protected]>

* Add more details to admin command

Signed-off-by: jolheiser <[email protected]>

* Add context to pwn

Signed-off-by: jolheiser <[email protected]>

* Consistency and making some noise ;)

Signed-off-by: jolheiser <[email protected]>

Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-09-08 17:06:39 -05:00
Lunny Xiao 7a5465fc56 LFS support to be stored on minio (#12518)
* LFS support to be stored on minio

* Fix test

* Fix lint

* Fix lint

* Fix check

* Fix test

* Update documents and add migration for LFS

* Fix some bugs
2020-09-08 23:45:10 +08:00
6543 bc11caff94 [Vendor] Switch go-version lib (#12719)
* vendor: switch from "mcuadros/go-version" to "hashicorp/go-version"

* Adapt P1

* simplify

* fix lint

* adapt

* fix lint & rm old code

* no deadlock

* rm RWMutex and check GoVersion only 1-time

* Copyright header

Co-authored-by: techknowlogick <[email protected]>
2020-09-05 12:42:58 -04:00
zeripath 5c0697ad1e Use argon as default password hash algorithm (#12688)
* Restrict TLS connections to 1.2 minimum

* Set Argon2 as the default KDF

* Fix user.yml

* Remove TLS minversion changes

Signed-off-by: Andrew Thornton <[email protected]>

* Add migration as per @techknowlogick

Signed-off-by: Andrew Thornton <[email protected]>

* set the password algo in the fixtures

Signed-off-by: Andrew Thornton <[email protected]>

* Remove the v148 migration - it needs recreate table to change the defaults

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Nadim Kobeissi <[email protected]>
2020-09-03 14:58:31 -04:00
Lunny Xiao 9bc69ff26e Support elastic search for code search (#10273)
* Support elastic search for code search

* Finished elastic search implementation and add some tests

* Enable test on drone and added docs

* Add new fields to elastic search

* Fix bug

* remove unused changes

* Use indexer alias to keep the gitea indexer version

* Improve codes

* Some code improvements

* The real indexer name changed to xxx.v1

Co-authored-by: zeripath <[email protected]>
2020-08-30 19:08:01 +03:00
John Olheiser b611ae1908 Mark Cache with ini tag (#12605)
Signed-off-by: jolheiser <[email protected]>
2020-08-26 02:04:18 +03:00
zeripath fcabbae168 Set utf8mb4 as the default charset on MySQL if CHARSET is unset (#12563)
MySQL in its infinite wisdom determines that UTF8 does not
mean UTF8. Our install scripts know about this and will set
CHARSET to utf8mb4 if we users choose this but... users who
do not explicitly set this variable will default to utf8mb3
without knowing it.

This PR changes the unset CHARSET value to utf8mb4 if users
choose to use mysql.

Signed-off-by: Andrew Thornton <[email protected]>
2020-08-22 13:56:33 +01:00
mrsdizzie fb70b5d207 Disable password complexity check default (#12557)
* Disable password complexity check default

These features enourange bad passwords/are annoying for people using better password methods, and at minimum we shouldn't force that as a default for obvious reasons. Disable any default check to avoid regular complaints.

* fix copy paste format
2020-08-21 18:42:23 -04:00
Florian Klink 95d478c29c change PIDFile default from /var/run/gitea.pid to /run/gitea.pid (#12500)
* docs: update heading

This section covers more paths than the 3 listed in the heading.

* setting: change PIDFile default from /var/run/gitea.pid to /run/gitea.pid

On most modern distributions, /var/run is deprecated and only kept for
backwards compat according to
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html, and is a
symlink to `/run/` on modern distributions.

Old Distros that still don't have `/run` can update the gitea default as
described in from-source.en-us.md to point to the old location.

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2020-08-18 14:21:24 +03:00
Lunny Xiao 62e6c9bc6c Add a storage layer for attachments (#11387)
* Add a storage layer for attachments

* Fix some bug

* fix test

* Fix copyright head and lint

* Fix bug

* Add setting for minio and flags for migrate-storage

* Add documents

* fix lint

* Add test for minio store type on attachments

* fix test

* fix test

* Apply suggestions from code review

Co-authored-by: guillep2k <[email protected]>

* Add warning when storage migrated successfully

* Fix drone

* fix test

* rebase

* Fix test

* display the error on console

* Move minio test to amd64 since minio docker don't support arm64

* refactor the codes

* add trace

* Fix test

* remove log on xorm

* Fi download bug

* Add a storage layer for attachments

* Add setting for minio and flags for migrate-storage

* fix lint

* Add test for minio store type on attachments

* Apply suggestions from code review

Co-authored-by: guillep2k <[email protected]>

* Fix drone

* fix test

* Fix test

* display the error on console

* Move minio test to amd64 since minio docker don't support arm64

* refactor the codes

* add trace

* Fix test

* Add URL function to serve attachments directly from S3/Minio

* Add ability to enable/disable redirection in attachment configuration

* Fix typo

* Add a storage layer for attachments

* Add setting for minio and flags for migrate-storage

* fix lint

* Add test for minio store type on attachments

* Apply suggestions from code review

Co-authored-by: guillep2k <[email protected]>

* Fix drone

* fix test

* Fix test

* display the error on console

* Move minio test to amd64 since minio docker don't support arm64

* don't change unrelated files

* Fix lint

* Fix build

* update go.mod and go.sum

* Use github.com/minio/minio-go/v6

* Remove unused function

* Upgrade minio to v7 and some other improvements

* fix lint

* Fix go mod

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Tyler <[email protected]>
2020-08-18 12:23:45 +08:00
Lanre Adelowo 4027c5dd7c Kanban board (#8346)
Co-authored-by: 6543 <[email protected]>
Co-authored-by: jaqra <[email protected]>
Co-authored-by: Kerry <[email protected]>
Co-authored-by: Jaqra <[email protected]>
Co-authored-by: Kyle Evans <[email protected]>
Co-authored-by: Tsakiridis Ilias <[email protected]>
Co-authored-by: Ilias Tsakiridis <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-08-16 23:07:38 -04:00
zeripath ac3cfad23d Make the default PID file compile-time settable (#12485)
#12391 offered to change the default PID file from /var/run/gitea.pid however in discussion it was decided that this could break users of older systems. An alternative was offered that we could make the PID file compile/link time settable.

This PR does this, and changes the name of the setting from CustomPID to simply PIDFile. It also updates the from-source docs to show how to change the compiler settings to do this.

Closes #12391

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Florian Klink <[email protected]>
2020-08-15 21:15:27 +01:00
techknowlogick 22c952ac7a Make dashboard newsfeed list length a configurable item (#12469)
Co-authored-by: John Olheiser <[email protected]>
2020-08-11 10:48:13 -04:00
6543 78d17b4b43 Make default StaticRootPath compile time settable (#12371)
Make it possible to compile the default location of StaticRootPath independent from AppWorkPath

Co-authored-by: Andrew Thornton <[email protected]>
2020-08-08 15:02:22 +01:00
techknowlogick e6c9f19b8f Use url.Parse to parse hostname (#12335) 2020-07-26 20:16:22 -04:00
Wim 4609eba2e7 Fix ipv6 parsing (#12321)
* Fix ipv6 parsing

* Update modules/setting/setting.go

Co-authored-by: 6543 <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-07-26 16:31:28 -04:00
Stormxx 26e931ae34 fix a spelling error (#12163)
Co-authored-by: techknowlogick <[email protected]>
2020-07-06 11:58:31 -04:00
zeripath c5b08f6d5a Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777)
* Make LogDescriptions race safe

* Add manager commands for pausing, resuming, adding and removing loggers

Signed-off-by: Andrew Thornton <[email protected]>

* Placate lint

* Ensure that file logger is run!

* Add support for smtp and conn

Signed-off-by: Andrew Thornton <[email protected]>

* Add release-and-reopen

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-07-05 20:07:07 -04:00
techknowlogick 6bf78d2b57 Global default branch setting (#11918)
* Global default branch setting

* add to app.ini example per @silverwind

* update per @lunny

Co-authored-by: John Olheiser <[email protected]>
2020-06-17 16:53:55 -04:00
zeripath 9ecf732abc Prevent panic on empty HOST for mysql (#11850)
Signed-off-by: Andrew Thornton <[email protected]>
2020-06-11 12:47:55 -04:00
silverwind 628ee1d82e Replace jquery-datetimepicker with native date input (#11684)
This removes the jQuery plugin as well as the associated config options.
Native input[type=date] does not require a language attribute as it is
localized by default, except for the placeholder attribute for which I
currently piggy-back the repo.issues.due_date_form localization option.

Implementation should pretty much match GH. Of note is that Safari does
not provide a UI for this input type, but I don't think providing one is
neccessary and GH did not bother either.

Co-authored-by: techknowlogick <[email protected]>
2020-06-10 14:35:27 -04:00
PhilippHomann 684b7a999f Dump: add output format tar and output to stdout (#10376)
* Dump: Use mholt/archive/v3 to support tar including many compressions

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Allow dump output to stdout

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Fixed bug present since #6677 where SessionConfig.Provider is never "file"

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never pack RepoRootPath, LFS.ContentPath and LogRootPath when they are below AppDataPath

Signed-off-by: Philipp Homann <[email protected]>

* Dump: also dump LFS (fixes #10058)

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never dump CustomPath if CustomPath is a subdir of or equal to AppDataPath (fixes #10365)

Signed-off-by: Philipp Homann <[email protected]>

* Use log.Info instead of fmt.Fprintf

Signed-off-by: Philipp Homann <[email protected]>

* import ordering

* make fmt

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Matti R <[email protected]>
2020-06-05 16:47:39 -04:00
Emanuel Angelo a39557f8fb European Portuguese translation (#11568)
This PR includes the modifications necessary to make use of the European Portuguese translation from the default setting.
2020-06-05 09:07:56 +01:00
John Olheiser a6fd2f23f7 Allow site admin to disable mirrors (#11740)
* Allow site admin to disable mirrors

Signed-off-by: jolheiser <[email protected]>

* No need to run through Safe

Signed-off-by: jolheiser <[email protected]>

* Clarify only disabling NEW mirrors

Signed-off-by: jolheiser <[email protected]>

* Apply suggestions from @guillep2k

Co-authored-by: guillep2k <[email protected]>

Co-authored-by: guillep2k <[email protected]>
2020-06-02 21:21:38 -04:00
zeripath a1ad188326 Fix chardet test and add ordering option (#11621)
* Fix chardet test and add ordering option

Signed-off-by: Andrew Thornton <[email protected]>

* minor fixes

Signed-off-by: Andrew Thornton <[email protected]>

* remove log

Signed-off-by: Andrew Thornton <[email protected]>

* remove log2

Signed-off-by: Andrew Thornton <[email protected]>

* only iterate through top results

Signed-off-by: Andrew Thornton <[email protected]>

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

* slight restructure of for loop

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-06-02 19:20:19 -03:00
zeripath e8955173a9 Default MSSQL port 0 to allow automatic detection by default (#11642)
Fix #11633

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-05-28 23:59:59 -04:00
zeripath 3aedc795c4 Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635)
Fix #11634

Signed-off-by: Andrew Thornton <[email protected]>
2020-05-28 16:29:15 +03:00
zeripath 814ca9ffea Allow different HardBreaks settings for documents and comments (#11515)
GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton [email protected]

Changes to index.js as per @silverwind 
Co-authored-by: silverwind <[email protected]>

Changes to docs as per @guillep2k 
Co-authored-by: guillep2k <[email protected]>
2020-05-24 09:14:26 +01:00
zeripath c81ab17de9 TrimSpace when reading InternalToken from a file (#11502)
InternalTokens are fixed as alphanum strings therefore TrimSpace from these.
Also use isatty to not add a terminal newline when redirecting generate.

Fix #11498

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-05-20 19:16:06 +03:00
zeripath 9a2e47b23a Refactor Cron and merge dashboard tasks (#10745)
* Refactor Cron and merge dashboard tasks

* Merge Cron and Dashboard tasks
* Make every cron task report a system notice on completion
* Refactor the creation of these tasks
* Ensure that execution counts of tasks is correct
* Allow cron tasks to be started from the cron page

* golangci-lint fixes

* Enforce that only one task with the same name can be registered

Signed-off-by: Andrew Thornton <[email protected]>

* fix name check

Signed-off-by: Andrew Thornton <[email protected]>

* as per @guillep2k

* as per @lafriks

Signed-off-by: Andrew Thornton <[email protected]>

* Add git.CommandContext variants

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-05-16 19:31:38 -04:00
zeripath 0052d788da Allow log.xxx.default to set logging settings for the default logger only (#11292)
* Allow log.xxx.default to set logging settings for the default logger only

Signed-off-by: Andrew Thornton <[email protected]>

* Update modules/setting/log.go

* as per @silverwind add some documentation

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-05-15 22:38:52 -04:00
zeripath f8e015e8e4 Move LFS directory creation out of NewContext (#11362)
Fix #9481
(probably others too)

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-05-10 16:30:46 +03:00
zeripath 791353c03b Add EventSource support (#11235)
If the browser supports EventSource switch to use this instead of
polling notifications.

Signed-off-by: Andrew Thornton [email protected]
2020-05-07 22:49:00 +01:00
zeripath 4f9d59be17 Sendmail should create a process on the gitea system and have a default timeout (#11256)
* Make sure that sendmail processes register with the process manager
* Provide a timeout for these (initially of 5 minutes)
* Add configurable value and tie in to documentation
* Tie in to the admin config page.

Signed-off-by: Andrew Thornton <[email protected]>
2020-05-03 00:04:31 +01:00
Alexander Scheel 1bf9e44bda Fix sanitizer config - multiple rules (#11133)
In #9888, it was reported that my earlier pull request #9075 didn't quite function as expected. I was quite hopeful the `ValuesWithShadow()` worked as expected (and, I thought my testing showed it did) but I guess not. @zeripath proposed an alternative syntax which I like:

```ini
[markup.sanitizer.1]
ELEMENT=a
ALLOW_ATTR=target
REGEXP=something
[markup.sanitizer.2]
ELEMENT=a
ALLOW_ATTR=target
REGEXP=something
```

This was quite easy to adopt into the existing code. I've done so in a semi-backwards-compatible manner:

 - The value from `.Value()` is used for each element.
 - We parse `[markup.sanitizer]` and all `[markup.sanitizer.*]` sections and add them as rules.

This means that existing configs will load one rule (not all rules). It also means people can use string identifiers (`[markup.sanitiser.KaTeX]`) if they prefer, instead of numbered ones.

Co-authored-by: Andrew Thornton <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-04-29 12:34:59 +01:00
zeripath b10c416f9e Use AJAX for notifications table (#10961)
* Use AJAX for notifications table

Signed-off-by: Andrew Thornton <[email protected]>

* move to separate js

Signed-off-by: Andrew Thornton <[email protected]>

* placate golangci-lint

Signed-off-by: Andrew Thornton <[email protected]>

* Add autoupdating notification count

Signed-off-by: Andrew Thornton <[email protected]>

* Fix wipeall

Signed-off-by: Andrew Thornton <[email protected]>

* placate tests

Signed-off-by: Andrew Thornton <[email protected]>

* Try hidden

Signed-off-by: Andrew Thornton <[email protected]>

* Try hide and hidden

Signed-off-by: Andrew Thornton <[email protected]>

* More auto-update improvements

Only run checker on pages that have a count
Change starting checker to 10s with a back-off to 60s if there is no change

Signed-off-by: Andrew Thornton <[email protected]>

* string comparison!

Signed-off-by: Andrew Thornton <[email protected]>

* as per @silverwind

Signed-off-by: Andrew Thornton <[email protected]>

* add configurability as per @6543

Signed-off-by: Andrew Thornton <[email protected]>

* Add documentation as per @6543

Signed-off-by: Andrew Thornton <[email protected]>

* Use CSRF header not query

Signed-off-by: Andrew Thornton <[email protected]>

* Further JS improvements

Fix @etzelia update notification table request
Fix @silverwind comments

Co-Authored-By: silverwind <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>

* Simplify the notification count fns

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: silverwind <[email protected]>
2020-04-24 00:57:38 -03:00
zeripath e74c4e1be9 Add option to increase provided OAuth2 token maximum size (#11180)
Some OAuth2 providers return quite large structured tokens >32767 bytes.
Gitea currently has a fixed maximum of 32767 bytes for these and
unfortunately due to the convoluted nature of the dependent libraries the
error returned is rather opaque.

Here we manage the error a little better - detecting the rather opaque
github.com/gorilla/securecookie.errEncodedValueTooLong and converting
it to a more readable error.

Further we provide a configurable option to increase the maximum size of
the provided OAuth2 tokens.

Fix #9907

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-04-23 00:47:23 +02:00
silverwind 7e20f1cb5b enable ENABLE_HARD_LINE_BREAK by default (#11162)
enable ENABLE_HARD_LINE_BREAK by default

This matches GitHub's rendering.

Fix #11155
2020-04-21 23:13:56 +01:00
S7evinK 828a27feeb Add Matrix webhook (#10831)
* Add Matrix webhook

Signed-off-by: Till Faelligen <[email protected]>

* Add template and related translations for Matrix hook

Signed-off-by: Till Faelligen <[email protected]>

* Add actual webhook routes and form

Signed-off-by: Till Faelligen <[email protected]>

* Add missing file

Signed-off-by: Till Faelligen <[email protected]>

* Update modules/webhook/matrix_test.go

* Use stricter regex to replace URLs

Signed-off-by: Till Faelligen <[email protected]>

* Escape url and text

Signed-off-by: Till Faelligen <[email protected]>

* Remove unnecessary whitespace

* Fix copy and paste mistake

Co-Authored-By: Tulir Asokan <[email protected]>

* Fix indention inconsistency

* Use Authorization header instead of url parameter

* Add raw commit information to webhook

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
2020-03-28 15:09:55 +02:00
zeripath 9269b7f627 Multiple LFS improvements (#10667)
* Add more logging in the LFS server

Adds more logging in the LFS server and stops sending internal server
error information to the client

* Add LFS Lock cursor implementation

* Simplify Claims in LFS and remove the float64 casts

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-03-09 19:56:18 +00:00
John Olheiser de63ac046e Make PR message on pushes configurable (#10664)
* Make PR message on pushes configurable

* Make fmt

Signed-off-by: jolheiser <[email protected]>
2020-03-08 08:34:38 -05:00
zeripath 513b962c1d Add max-file-size to LFS (#10463)
* Add max-file-size to LFS

* Update modules/lfs/server.go

* As per @silverwind

Co-Authored-By: silverwind <[email protected]>

Co-authored-by: silverwind <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-02-28 01:46:57 -03:00
guillep2k 4a2d23981d Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368)
* Test locking immediate for SQLite3

* fix url field separator

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-02-27 07:51:37 +08:00