Commit Graph
645 Commits
Author SHA1 Message Date
zeripath e494f34cfa Make the Mirror Queue a queue (#17326)
Convert the old mirror syncing queue to the more modern queue format.

Fix a bug in the from the repo-archive queue PR - the assumption was made that uniqueness could be enforced with by checking equality in a map in channel unique queues - however this only works for primitive types - which was the initial intention but is an imperfect. This is fixed by marshalling the data and placing the martialled data in the unique map instead.

The documentation is also updated to add information about the deprecated configuration values.

Signed-off-by: Andrew Thornton <[email protected]>
2021-10-17 12:43:25 +01:00
92cf815981 Split index.js to separate files (#17315)
* split `index.js` to separate files

* tune clipboard

* fix promise

* fix document

* remove intermediate empty file

* fix async event listener

* use `export function` instead of `export {}`, add more comments

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]>
2021-10-17 01:28:04 +08:00
41de7a8be6 Add simple update checker to Gitea (#17212)
* Add simple update checker to Gitea

* update struct and remove comments

* fix lint

* Update custom/conf/app.example.ini

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

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

* Update custom/conf/app.example.ini

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

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

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

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

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

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

* Update modules/cron/tasks_extended.go

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

* Update custom/conf/app.example.ini

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

* take PR feedback into account and display banner on admin dashboard for alerts

* Add more detailed message

* placate lint

* update per feedback

Co-authored-by: delvh <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
2021-10-16 02:14:34 -04:00
wxiaoguangandtechknowlogick 1cc5dacdea Update documents for Gitea behind reverse proxy. Fix some small bugs (some URLs are generated without sub-path) (#17320)
* Apache `ProxyPassReverse` only works for Location, Content-Location and URI headers on HTTP redirect responses, it causes more problems than it resolves. Now all URLs generated by Gitee have the correct prefix AppSubURL. We do not need to set `ProxyPassReverse`.

* fix url param

* use AppSubURL instead of AppURL in api/v1

Co-authored-by: techknowlogick <[email protected]>
2021-10-15 23:34:07 -04:00
c829f4430d Frontend refactor: move Vue related code from index.js to components dir, and remove unused codes. (#17301)
* frontend refactor

* Apply suggestions from code review

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

* Update templates/base/head.tmpl

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

* Update docs/content/doc/developers/guidelines-frontend.md

Co-authored-by: Lunny Xiao <[email protected]>

* fix typo

* fix typo

* refactor PageData to pageData

* Apply suggestions from code review

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

* Simply for the visual difference.

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

* Revert "Apply suggestions from code review"

This reverts commit 4d78ad9b0e96ca180e0823de17659a2e0814c099.

Co-authored-by: delvh <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]>
2021-10-15 10:35:26 +08:00
zeripath f8a1ed5e1e Disable core.protectNTFS (#17300)
core.protectNTFS protects NTFS from files which may be difficult to remove or interact
with using the win32 api, however, it also appears to prevent such files from
being entered into the git indexes - fundamentally causing breakages with PRs that
affect these files. However, deliberately setting this to false may cause security
issues due to the remain sparse checkout of files in the merge pipeline.

The only sensible option therefore is to provide an optional setting which admins
could set which would forcibly switch this off if they are affected by this issue.

Fix #17092

Signed-off-by: Andrew Thornton <[email protected]>
2021-10-13 14:20:11 -04:00
Romain 744d70a13d Add metrics to get issues by repository (#17225) 2021-10-05 20:39:37 +02:00
27ed51e74a Add metrics to get issues by label (#17201)
* Add metrics to get issues by label

* Add comment on IssueByLabelCount

* Code review - Unify "AS" in SQL (#17201)

* Code review - Remove useless join (#17201)

* Code review - Disable issue_by_label by default in settings (#17201)

* use e

* restore empty line

* update docs

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-10-03 18:46:44 -04:00
techknowlogick 90801753cd Add nodeinfo endpoint for federation purposes (#16953)
Nodeinfo is a way to expose certain metadata about a server for use of discovery regarding functionality of its federation capabilities.

Two endpoints are required:
1. `/.well-known/nodeinfo` which informs client where it can find the location of the location of its metadata (including which version of the schema is used)
2. the endpoint which exposes the metadata in json format according to schema.

Notes:
* `openRegistrations` is a required field, but I propose to set to false as default in case someone writes a crawler to discover "open" gitea instances
* to limit data leakage I also propose to not include the `usage` field (note it is required so it should be included, but left as empty).

More info:
https://github.com/jhass/nodeinfo
https://github.com/jhass/nodeinfo/tree/main/schemas/2.1
http://nodeinfo.diaspora.software/protocol.html
2021-09-28 01:38:06 +02:00
Gwyneth Morgan 63863cda2f Use light/dark theme based on system preference (#17051)
Add a new default theme `auto`, which will automatically switch between
`gitea` (light) and `arc-green` (dark) themes depending on the user's
operating system settings.

Closes: #8183
2021-09-27 15:47:44 +01:00
Forest Johnson b2ddd77c0f docs: explain where are settings for release files (#17161)
Just a tiny change to save someone some time while reading the docs. I got lost in the angular code and npm packages trying to reverse engineer it  and figure out what setting controlled this file limit: 

![image](https://user-images.githubusercontent.com/7119703/134829716-8f587878-21a3-413b-ba1e-c2bbe9391ad2.png)

Eventually I tracked it down from

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/options/locale/locale_en-US.ini#L2776

to

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/templates/repo/upload.tmpl#L11

to 

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/web_src/js/index.js#L1043 

to 

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/web_src/js/features/dropzone.js#L3

to

https://www.npmjs.com/package/dropzone

and then I realized I can't read 😅,  back  to 

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/templates/repo/upload.tmpl#L8

and quickly solved it from there!! 

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/modules/upload/upload.go#L81


Yes  I know this long path was 90% me failing to read code properly and going on a red herring journey...  but point is we should not have to do this in the first place to know how to  configure this file upload form 🥺 👉 👈
2021-09-27 14:00:54 +01:00
zeripathandtechknowlogick 222675f479 Allow LDAP Sources to provide Avatars (#16851)
* Allow LDAP Sources to provide Avatars

Add setting to LDAP source to allow it to provide an Avatar.

Currently this is required to point to the image bytes.

Fix #4144

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

* Rename as Avatar Attribute (drop JPEG)

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

* Always synchronize avatar if there is change

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

* Actually get the avatar from the ldap

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

* clean-up

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

* use len()>0 rather than != ""

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

* slight shortcut in IsUploadAvatarChanged

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

Co-authored-by: techknowlogick <[email protected]>
2021-09-26 22:39:36 -04:00
zeripath 76ddaf0e1c Add minimum versions of databases to the docs (#17080)
We do not currently state the minimum versions of databases we support.

This PR sets them to:
* MySQL >=5.7
* Postgres >=10
* MSSQL >=2008R2 SP3

Signed-off-by: Andrew Thornton <[email protected]>
2021-09-17 23:25:50 +01:00
4c275fd2cf doc: Upgrade from an old Gitea (#16918)
* doc: Upgrade from an old Gitea

* update backup steps

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* update backup tips

* update table header

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update docs/content/doc/upgrade/from-gitea.en-us.md

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

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

* Update from-gitea.en-us.md

Co-authored-by: delvh <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-09-09 14:13:21 -04:00
6543 35566f7660 Enable Malayalam, Greek, Persian, Hungarian & Indonesian by default (#16998) 2021-09-09 14:16:42 +08:00
aaea24af13 Changes for German language (#16985)
* translated the rest of index.de-de.md to german

* fixed typo in german locale activate_account email

* fixed typo in german doc/content/page/index.md

* Update docs/content/page/index.de-de.md

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

* commited sugesstions

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

* commited sugesstions

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

* commited sugesstions

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

* revert locale change

Co-authored-by: delvh <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: zeripath <[email protected]>
2021-09-08 12:37:06 -04:00
f63b423a44 Make mirror feature more configurable (#16957)
Rename`[repository]` `DISABLE_MIRRORS` to `[mirror]` `DISABLE_NEW_PULL`  and add `ENABLED` and `DISABLE_NEW_PUSH` with the below meanings:

- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors.
- `DISABLE_NEW_PULL`: **false**: Disable the creation of **new** mirrors. Pre-existing mirrors remain valid.
- `DISABLE_NEW_PUSH`: **false**: Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid.


Co-authored-by: zeripath <[email protected]>
Co-authored-by: delvh <[email protected]>
2021-09-07 17:49:36 +02:00
aceArt-GmbH 16c491b1ba Doc: Mail-Tempales: Fix AppUrl function name (#16939)
Thanks to https://github.com/go-gitea/gitea/pull/16788 I can see why our docker container kept restarting when adding the custom mail template example.
[The example template](https://docs.gitea.io/en-us/mail-templates/#example) has an error

```
2021/09/03 10:55:25 cmd/web.go:91:func1() [F] PANIC: template: mail/issue/default:35: function "AppURL" not defined
        /usr/local/go/src/html/template/template.go:374 (0x1563bb8)
        /go/src/code.gitea.io/gitea/vendor/github.com/unrolled/render/render.go:322 (0x1563782)
        /go/src/code.gitea.io/gitea/vendor/github.com/unrolled/render/render.go:202 (0x1562f8b)
        /go/src/code.gitea.io/gitea/vendor/github.com/unrolled/render/render.go:146 (0x15629d2)
        /go/src/code.gitea.io/gitea/modules/templates/base.go:88 (0x16b0769)
        /go/src/code.gitea.io/gitea/routers/web/base.go:125 (0x225f284)
        /go/src/code.gitea.io/gitea/routers/web/web.go:95 (0x2261284)
        /go/src/code.gitea.io/gitea/routers/init.go:147 (0x22817ba)
        /go/src/code.gitea.io/gitea/cmd/web.go:158 (0x239741a)
        /go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:524 (0x1740884)
        /go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:173 (0x17415f8)
        /go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:277 (0x173e8c7)
        /go/src/code.gitea.io/gitea/main.go:115 (0x23d3e69)
        /usr/local/go/src/runtime/proc.go:225 (0x443995)
        /usr/local/go/src/runtime/asm_amd64.s:1371 (0x47b360)
```
2021-09-03 12:49:42 +01:00
Patrick Schratz 51bd311bfd update theme doc (#16860) 2021-08-29 14:26:43 -04:00
Lunny Xiaoand6543 37a3509e3e Paginate releases page & set default page size to 10 (#16857)
* Add release default page and set it to 10

* use limit

Co-authored-by: 6543 <[email protected]>
2021-08-29 18:25:16 +02:00
wxiaoguangandzeripath c0661259bb Add GoLand configuration in hacking on gitea (#16843)
Co-authored-by: zeripath <[email protected]>
2021-08-28 23:25:08 -04:00
f6c3c97ed1 Add proxy settings and support for migration and webhook (#16704)
* Add proxy settings and support for migration and webhook

* Fix default value

* Add newline for example ini

* Add lfs proxy support

* Fix lint

* Follow @zeripath's review

* Fix git clone

* Fix test

* missgin http requests for proxy

* use empty

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

Co-authored-by: 6543 <[email protected]>
Co-authored-by: zeripath <[email protected]>
2021-08-18 21:10:39 +08:00
zeripathandLunny Xiao deb2ef59b2 Add API Token Cache (#16547)
One of the issues holding back performance of the API is the problem of hashing.
Whilst banning BASIC authentication with passwords will help, the API Token scheme
still requires a PBKDF2 hash - which means that heavy API use (using Tokens) can
still cause enormous numbers of hash computations.

A slight solution to this whilst we consider moving to using JWT based tokens and/or
a session orientated solution is to simply cache the successful tokens. This has some
security issues but this should be balanced by the security issues of load from
hashing.

Related #14668

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

Co-authored-by: Lunny Xiao <[email protected]>
2021-08-17 14:30:42 -04:00
zeripath 9ec149e494 Improve SMTP authentication and Fix user creation bugs (#16612)
* Improve SMTP authentication, Fix user creation bugs and add LDAP cert/key options

This PR has two parts:

Improvements for SMTP authentication:

* Default to use SMTPS if port is 465, and allow setting of force SMTPS.
* Always use STARTTLS if available
* Provide CRAM-MD5 mechanism
* Add options for HELO hostname disabling
* Add options for providing certificates and keys
* Handle application specific password response as a failed user login
instead of as a 500.

Close #16104

Fix creation of new users:

* A bug was introduced when allowing users to change usernames which
prevents the creation of external users.
* The LoginSource refactor also broke this page.

Close #16104

Signed-off-by: Andrew Thornton <[email protected]>
2021-08-11 21:42:58 +01:00
techknowlogick 052af4828c Add note about build-time flags for PAM support (#16641)
Fix #16639
2021-08-07 01:22:30 -04:00
zeripathandJohn Olheiser 349a83fcba Allow setting X-FRAME-OPTIONS (#16643)
* Allow setting X-FRAME-OPTIONS

This PR provides a mechanism to set the X-FRAME-OPTIONS header.

Fix #7951

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

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

Co-authored-by: John Olheiser <[email protected]>

Co-authored-by: John Olheiser <[email protected]>
2021-08-06 16:47:10 -04:00
Clar Fon 7190e296d1 Clarify where server.LFS_CONTENT_PATH was moved to (#16601)
Signed-off-by: ltdk <[email protected]>
2021-08-03 09:03:04 +01:00
AJ ONeal 9064deb6f9 Pre-fill suggested New File 'name' and 'content' with Query Params (#16556)
* feature: add (GitHub-style) querystrings for pre-filling new file content

* docs: add query parameters for new files
2021-07-29 05:39:46 +02:00
techknowlogickandzeripath 9d59dbb8e0 Add Linode as an installation option in docs (#16529)
Add Linode as an installation option in docs

Co-authored-by: zeripath <[email protected]>
2021-07-24 15:08:23 +01:00
techknowlogick 819ece5c44 Add snap to docs (#16530) 2021-07-24 14:06:38 +01:00
2e5f7ddd3a Make Mermaid.js limit configurable (#16519)
* Make Mermaid.js limit configurable

Add `MERMAID_MAX_SOURCE_CHARACTERS` to `[markup]` settings
to make the maximum size of a mermaid render configurable.

Fix #16513

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

* fixup! Make Mermaid.js limit configurable

* Update custom/conf/app.example.ini

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

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

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

Co-authored-by: silverwind <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2021-07-24 00:21:51 -04:00
qwerty287 82f2596922 Fix typo (#16522) 2021-07-23 15:05:37 +02:00
+3 e90680419b Add support for corporate WeChat webhooks (#15910)
* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

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

* Update services/webhook/wechatwork.go

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

* 修善wechatwork

* 修善wechatwork

* fix

* Update locale_cs-CZ.ini

fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

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

* Update services/webhook/wechatwork.go

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

* 修善wechatwork

* 修善wechatwork

* fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix wechat

* fix wechat

* fix wechat

* fix wechat

* Fix invalid params and typo of email templates (#16394)

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

* Add LRU mem cache implementation (#16226)

The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

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

* [skip ci] Updated translations via Crowdin

* Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (#16407)

* plugins/docker -> techknowlogick/drone-docker

* It is multi-arch

* docs: rewrite email setup (#16404)

* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <[email protected]>

* Validate Issue Index before querying DB (#16406)

* Fix external renderer (#16401)

* fix external renderer

* use GBackground context as fallback

* no fallback, return error

Co-authored-by: Lauris BH <[email protected]>

* Add checkbox to delete pull branch after successful merge (#16049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Detect encoding changes while parsing diff (#16330)

* Detect encoding changes while parsing diff

* Let branch/tag name be a valid ref to get CI status (#16400)

* fix #16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix build

* fix build

* Apply suggestions from code review

Co-authored-by: a1012112796 <[email protected]>
Co-authored-by: myheavily <myheavily>
Co-authored-by: zhaoxin <[email protected]>
Co-authored-by: Meano <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: GiteaBot <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Bagas Sanjaya <[email protected]>
Co-authored-by: Norwin <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Jimmy Praet <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2021-07-23 12:41:27 +08:00
Antoine Goutenoirand6543 573a8cc8db docs: fix various typos and translate to french (#16477)
Co-authored-by: 6543 <[email protected]>
2021-07-18 12:21:32 -04:00
doseraandzeripath 301ab0327d Extend the fail2ban instructions with a hint on how to make X-Real-IP… (#16446)
Following the merging of #14959 - Gitea is a lot more strict regarding the interpretation of `X-Real-IP` and `X-Forwarded-For` headers.

This PR updates the fail2ban documentation to include hints to set: `REVERSE_PROXY_TRUSTED_PROXIES` and `REVERSE_PROXY_LIMIT` appropriately.

See discussion in #16443

Co-authored-by: zeripath <[email protected]>
2021-07-16 10:04:52 +01:00
zeripath 215aa01560 Update documentation to reflect #15219 (#16442)
The move to render custom/public as within /assets in #15219 missed updating
several documentation pages.

This PR updates this documentation.

Signed-off-by: Andrew Thornton <[email protected]>
2021-07-15 20:49:12 +01:00
1d7015f0e3 add configuration option to restrict users by default (#16256)
* add configuration option to restrict users by default

* default IsRestricted permission only set on sign up

setting this in the model messes with other workflows (e.g. syncing LDAP users) where the IsRestricted permission needs to be explicitly set and not overridden by a config value

* fix formatting

* Apply suggestions from code review

* ensure newly created user is set to restricted

* ensure imports are in the correct order

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-07-15 15:19:48 -04:00
Jimmy Praet a39bc029c8 Change @every 24h default schedules to @midnight (#16431) 2021-07-15 11:55:48 -04:00
techknowlogick 18159acc9d add note about minimum required version of git installed (#16433) 2021-07-14 23:28:49 -04:00
79508a30f8 Change docker tag logic (#16421)
* Change docker logic

* Apply suggestions from code review

Co-authored-by: Kyle D. <[email protected]>

* docs

Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Kyle D. <[email protected]>
2021-07-14 18:08:43 +01:00
Bagas Sanjaya c23d80f5e5 docs: rewrite email setup (#16404)
* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <[email protected]>
2021-07-12 22:05:40 +02:00
zeripath 78128ffba3 Add LRU mem cache implementation (#16226)
The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <[email protected]>
2021-07-10 23:54:15 +02:00
4475688ae9 Added documentation about 413 errors with an nginx solution (#15313)
* Added documentation about 413 errors with an nginx solution.

Co-authored-by: silverwind <[email protected]>
Co-authored-by: Norwin <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-07-10 02:16:07 +02:00
luzpaz c99634ce94 Fix various documentation, user-facing, and source comment typos (#16367)
* Fix various doc, user-facing, and source comment typos

Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`
2021-07-08 13:38:13 +02:00
冯天书 39039f1e37 Fix typo in customizing-gitea.en-us.md (#16362)
Fixed a type in a URL in PlantUML code example in `customizing-gitea.en-us.md`.
2021-07-07 17:25:42 +02:00
Lunny Xiao e8b47f5247 Fix docs assets link (#16337) 2021-07-04 15:56:40 +02:00
Val Lorentz 370718862d docs: Fix broken anchors in links to awesome-gitea (#16331) 2021-07-03 21:42:33 +01:00
6543 61a895d60f Add forge emojies (#16296)
* codeberg :codeberg:
* gitlab :gitlab:
* git :git:
* github :github:
* gogs :gogs:
2021-07-02 16:04:57 +02:00
Norwinandtechknowlogick bef14819d4 Clarify GPG binary check (#14832)
fixes #14817

Co-authored-by: techknowlogick <[email protected]>
2021-07-01 16:14:09 +02:00
zeripath c8b131f33d Update Go-Git to take advantage of LargeObjectThreshold (#16316)
Following the merging of https://github.com/go-git/go-git/pull/330 we
can now add a setting to avoid go-git reading and caching large objects.

Signed-off-by: Andrew Thornton <[email protected]>
2021-06-30 22:58:45 +02:00