Commit Graph
398 Commits
Author SHA1 Message Date
John Olheiserandguillep2k a2bae20bea 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
zeripathandtechknowlogick 63733d795a 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
silverwindandtechknowlogick a5bb904629 Narrow down Edge version in browser support docs (#11640)
* Narrow down Edge version in browser support docs

I noticed that Edge 14 has a pretty buggy fetch implementation and
because it has already reached end of support I think it's better we
don't specifically state support for it, even if it may work to some
extend.

* mention both edge versions

Co-authored-by: techknowlogick <[email protected]>
2020-05-30 23:06:34 -04:00
TLZandtechknowlogick 903d775c58 Update Caddy reverse-proxy instructions (#11655)
Co-authored-by: techknowlogick <[email protected]>
2020-05-30 22:16:32 -04:00
zeripathandguillep2k fb2917ef1c Add warning to mailer documentation about authentication (#11563)
* Add warning to mailer documentation about authentication

References #7966

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

* As per @guillep2k and @mrsdizzie

* as per @mrsdizzie

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

Co-authored-by: guillep2k <[email protected]>
2020-05-24 23:56:18 +01:00
88bae3f938 Add chocolatey package install instructions (#11586)
* Update from-package.en-us.md

https://github.com/go-gitea/gitea/issues/10800

* Update docs/content/doc/installation/from-package.en-us.md

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

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-05-24 15:17:33 -04:00
853cb13b17 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
silverwindandtechknowlogick 34037be88c Remove IE11 support (#11470)
* Remove IE11 support

With master now on 1.13, it's time to drop IE11 for good. The woff
variants are also in use by Opera Mini but it has even less market share
and I can only imagine how broken the UI is in it.

Fixes: https://github.com/go-gitea/gitea/issues/6147

* update docs

Co-authored-by: techknowlogick <[email protected]>
2020-05-19 23:28:59 -04:00
294bdf1724 Docs: add AlpineLinux packages (#11446)
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-05-17 14:09:56 +03:00
zeripathandtechknowlogick bd164d386b 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
John Olheiserandtechknowlogick 2035f9504c Add localization docs (#11411)
* Add localization docs

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

* Clarify bleeding edge vs release

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

* Capitalize Crowdin

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

Co-authored-by: techknowlogick <[email protected]>
2020-05-14 17:33:52 -04:00
John Olheiser 61fa4c7d19 Add awesome-gitea reference on install from package docs (#11405)
Signed-off-by: jolheiser <[email protected]>
2020-05-14 01:58:49 +03:00
b937439d35 Update docs to reflect new location of homebrew repo (#11384)
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-05-12 20:51:41 +08:00
7df7fd3606 Changed image of openid-connect logo for better look on arc-green theme (#11312)
* Set background of openIDConnect logo to white in arc-green theme

* Fixed linting off arc-green theme

Signed-off-by: Leo Maroni <[email protected]>

* Revert changes of first commit (white background) and replaced the image

* Updated openid_connect (part 2)

* Update public/img/auth/openid_connect.svg

Now in one line

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

Co-authored-by: silverwind <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-05-10 17:55:22 +03:00
silverwindandtechknowlogick 5925d3fa81 Few tweaks in the hacking guide (#11345)
Co-authored-by: techknowlogick <[email protected]>
2020-05-09 18:11:30 -04:00
zeripath 036d3840d0 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
Adrian POIGETandAdrian POIGET 375c708bd1 Fix; declare DOMAIN variable for docker setup (#10780)
In the /install form, the value for SSH Server Domain is taken form the DOMAIN variable
and overwrites SSH_DOMAIN environment variable set the first time if nothing done

Co-authored-by: Adrian POIGET <[email protected]>
2020-05-04 10:50:29 +01:00
zeripath f8bb951e0d 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
d176f2933e Propose an explanation how to restart gracefully gitea after an update (#10866)
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-04-30 15:14:27 +03:00
zeripathandLunny Xiao be288379cf Use keys.openpgp.org instead of pgp.mit.edu (#11249)
The SKS Keyserver network has been under attack with poisoned
certificates since at least 2019. Downloading a poisoned certificate has
the awful side-effect of completely breaking your keyring and most
software has now moved off the network and uses the keys.openpgp.org
which has a different protocol instead - in fact one whereby emails are
verified.

For more details regarding the attack see: https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f

See: https://keys.openpgp.org/about and https://keys.openpgp.org/about/faq

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

Co-authored-by: Lunny Xiao <[email protected]>
2020-04-30 12:08:43 +03:00
12f85d63e2 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
c2139649ac Support unicode emojis and remove emojify.js (#11032)
* Support unicode emojis and remove emojify.js

This PR replaces all use of emojify.js and adds unicode emoji support to various areas of gitea.

This works in a few ways:

First it adds emoji parsing support into gitea itself. This allows us to

 * Render emojis from valid alias (😄)
 * Detect unicode emojis and let us put them in their own class with proper aria-labels and styling
 * Easily allow for custom "emoji"
 * Support all emoji rendering and features without javascript
 * Uses plain unicode and lets the system render in appropriate emoji font
 * Doesn't leave us relying on external sources for updates/fixes/features

That same list of emoji is also used to create a json file which replaces the part of emojify.js that populates the emoji search tribute. This file is about 35KB with GZIP turned on and I've set it to load after the page renders to not hinder page load time (and this removes loading emojify.js also)

For custom "emoji" it uses a pretty simple scheme of just looking for /emojis/img/name.png where name is something a user has put in the "allowed reactions" setting we already have. The gitea reaction that was previously hard coded into a forked copy of emojify.js is included and works as a custom reaction under this method.

The emoji data sourced here is from https://github.com/github/gemoji which is the gem library Github uses for their emoji rendering (and a data source for other sites). So we should be able to easily render any emoji and :alias: that Github can, removing any errors from migrated content. They also update it as well, so we can sync when there are new unicode emoji lists released.

I've included a slimmed down and slightly modified forked copy of https://github.com/knq/emoji to make up our own emoji module. The code is pretty straight forward and again allows us to have a lot of flexibility in what happens.

I had seen a few comments about performance in some of the other threads if we render this ourselves, but there doesn't seem to be any issue here. In a test it can parse, convert, and render 1,000 emojis inside of a large markdown table in about 100ms on my laptop (which is many more emojis than will ever be in any normal issue). This also prevents any flickering and other weirdness from using javascript to render some things while using go for others.

Not included here are image fall back URLS. I don't really think they are necessary for anything new being written in 2020. However, managing the emoji ourselves would allow us to add these as a feature later on if it seems necessary.

Fixes: https://github.com/go-gitea/gitea/issues/9182
Fixes: https://github.com/go-gitea/gitea/issues/8974
Fixes: https://github.com/go-gitea/gitea/issues/8953
Fixes: https://github.com/go-gitea/gitea/issues/6628
Fixes: https://github.com/go-gitea/gitea/issues/5130

* add new shared function emojiHTML

* don't increase emoji size in issue title

* Update templates/repo/issue/view_content/add_reaction.tmpl

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

* Support for emoji rendering in various templates

* Render code and review comments as they should be

* Better way to handle mail subjects

* insert unicode from tribute selection

* Add template helper for plain text when needed

* Use existing replace function I forgot about

* Don't include emoji greater than Unicode Version 12

Only include emoji and aliases in JSON

* Update build/generate-emoji.go

* Tweak regex slightly to really match everything including random invisible characters. Run tests for every emoji we have

* final updates

* code review

* code review

* hard code gitea custom emoji to match previous behavior

* Update .eslintrc

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

* disable preempt

Co-authored-by: silverwind <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-04-28 15:05:39 -03:00
6cb878be02 [Docs] Config Cheat Sheet - Task Edit (#9972)
* backwards compatibility typo

* Unlist description and separate from list by an empty line

* redis needs password edit

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

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

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: John Olheiser <[email protected]>
2020-04-27 19:41:59 -04:00
zeripathandsilverwind ac81fc79c9 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
zeripathandtechknowlogick c88e5dbe29 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
Antoine GIRARD 3388e0a9be Add documentation to display STL preview (#11181)
* Update customizing-gitea.en-us.md

* Update customizing-gitea.en-us.md

* only load assets when needed

* remove useless var

* fix missing 'i' modifier
2020-04-22 20:02:54 +03:00
silverwind 8de19dd4e3 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
Johan Van de Wauw 633aa54f3d doc: Fix package name in external renderer example (#11170)
The py3-zmq package does not exist in alpine linux 3.11, used in both master and 1.11.4 . The py3-pyzmq package exists however:
https://pkgs.alpinelinux.org/packages?name=py3-pyzmq&branch=v3.11
2020-04-21 16:36:27 -04:00
Kristian AntonsenandAntoine GIRARD a274163299 Replace references to cron.update_migration_post_id with cron.update_migration_poster_id in docs (#11068)
Across several files, references to cron.update_migration_post_id are made, although the actual setting is called cron.update_migration_poster_id according to modules/setting/cron.go (https://github.com/go-gitea/gitea/blob/10e2f291442fdc7efc31c02f5ffcba79a36db9ac/modules/setting/cron.go#L54).

Co-authored-by: Antoine GIRARD <[email protected]>
2020-04-15 02:44:08 +02:00
maxm123andguillep2k 9675ffd037 Add charset handling to backup/restore doc (#11062)
Co-authored-by: guillep2k <[email protected]>
2020-04-13 23:55:20 -03:00
silverwindandguillep2k 856f5d9a2c add 'make watch-frontend' and expand docs (#10931)
* add 'make watch-frontend' and expand docs

* add bindata note

* add .PHONY

Co-authored-by: guillep2k <[email protected]>
2020-04-12 00:50:59 -03:00
3f4dabb5f6 [Docs] Cross Build Gitea from Source (#10999)
* Add cross-build docs

Note that C cross compiler is required for building Gitea with `TAGS`.

* Apply suggestion from @mrsdizzie

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

* Apply suggestion from @guillep2k

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

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: John Olheiser <[email protected]>
2020-04-11 00:13:31 -03:00
8b1ce45aa0 [feature] provide OwnerName field for README template (#10981)
Co-Authored-By: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-04-06 21:40:38 -04:00
6543 34cdc4d377 [Docs] Add Note to Readme-Template about Variable Espansion (#10983)
* add note with Espansion VarNames

* add context of Name
2020-04-06 19:43:17 -04:00
zeripathandLauris BH 1449b6fa4b Add docs for gmail (#10995)
Fix #10971

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

Co-authored-by: Lauris BH <[email protected]>
2020-04-06 16:18:42 -04:00
6d363ebc39 [Docs] Database Preparation - Connection over TLS (#10889)
* Database Preparation - Connection over TLS

* Step 6 MySQL edit

- have been created [before -> earlier]
- recreate user, [and this time]

* Apply suggestions from @guillep2k

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

* certificat[e] typo

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-04-01 12:30:25 -03:00
zeripathandmrsdizzie 7872ea2d47 Add IIS Reverse Proxy documentation (#10881)
* Add IIS Reverse Proxy documentation

@mahdiit in #10748 described how to set up IIS as a reverse proxy. This
PR adds these to our documentation.

Close #10748

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

* Update docs/content/doc/usage/reverse-proxies.en-us.md

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

Co-authored-by: mrsdizzie <[email protected]>
2020-03-30 00:11:15 +03:00
John Olheiser 4eca657f77 Remove test from installation directions (#10873)
Signed-off-by: jolheiser <[email protected]>
2020-03-29 11:07:40 +01:00
755320f3af [Docs] Config Cheat Sheet: SSL_MODE Value Description (#10834)
* Add description of SSL_MODE values

* Apply suggestions from @guillep2k

Rewording suggestions

Co-Authored-By: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Antoine GIRARD <[email protected]>
2020-03-28 00:24:12 -03:00
Simon Legner 81c42cee61 doc(authentication.en-us): remove superflous line (#10758) 2020-03-18 09:52:51 -05:00
211f335e62 Documentation - updated email setup (#10695)
* Updated email setup documentation to include sendmail option

* Update docs/content/doc/usage/email-setup.en-us.md

full path to sendmail

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

* Update docs/content/doc/usage/email-setup.en-us.md

docker image does not have sendmail

Co-Authored-By: Antoine GIRARD <[email protected]>

* Update docs/content/doc/usage/email-setup.en-us.md

Co-Authored-By: Antoine GIRARD <[email protected]>

* Update docs/content/doc/usage/email-setup.en-us.md

Co-Authored-By: James Lakin <[email protected]>

* Update docs/content/doc/usage/email-setup.en-us.md

Co-Authored-By: James Lakin <[email protected]>

Co-authored-by: 8ctopus <[email protected]>
Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Antoine GIRARD <[email protected]>
Co-authored-by: James Lakin <[email protected]>
2020-03-13 16:20:14 +01:00
zeripathandLauris BH b6a7d9f63f 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
68fd6a873d System-wide webhooks (#10546)
* Create system webhook column (and migration)

* Create system webhook DB methods

Based on the default webhook ones

* Modify router to handle system webhooks and default ones

* Remove old unused admin nav template

* Adjust orgRepoCtx to differentiate system and default webhook URLs

* Assign IsSystemWebhook when creating webhooks

* Correctly use booleans for IsSystemWebhook

* Use system webhooks when preparing webhooks for payload

* Add UI and locale changes

* Use router params to differentiate admin hook pages

* Fix deleting admin webhooks and rename method

* Add clarity to webhook docs

* Revert "Remove old unused admin nav template"

This reverts commit 191a20a7389fe5f6256b0ad6aafd04b9b0e295c5.

* Rename WebHooksNewPost to GiteaHooksNewPost for clarity

* Reintroduce blank line lost during merge conflict

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-03-09 00:08:05 +02:00
John Olheiser 2a72fb6aa9 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
John Olheiserandsilverwind 42639a8e32 Add node version variable to docs (#10620)
Also adjusted other version mentions so go version is always mentioned
as major.minor and node only as major.

Co-authored-by: silverwind <[email protected]>
2020-03-05 16:36:22 -06:00
John Olheiser 7b73adf12b Add FAQ for markdown (#10611)
* Add FAQ for markdown

* Expand explanation @guillep2k

Signed-off-by: jolheiser <[email protected]>
2020-03-05 09:05:18 -06:00
Lauris BHandLunny Xiao 7b3b295229 Add notice for awesome-gitea (#10612)
Signed-off-by: jolheiser <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
2020-03-05 11:55:28 +02:00
Lauris BH 38ab26185e Add restricted user filter to LDAP authentication (#10600)
* Add restricted user filter to LDAP authentification

* Fix unit test cases
2020-03-05 08:30:33 +02:00
guillep2k acd1034d5e Versions (#10597)
Signed-off-by: jolheiser <[email protected]>
2020-03-04 21:37:19 -03:00
9bd3c9a3c2 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