Commit Graph
487 Commits
Author SHA1 Message Date
zeripath a978536553 Standardise logging of failed authentication attempts in internal SSH (#13962)
Continuing on from #13953 continue to improve and standardise
logging from internal SSH.

Also updates the fail2ban setup

Signed-off-by: Andrew Thornton <[email protected]>
2020-12-15 08:45:13 +00:00
9ccfa03d94 Reformat docs (#13897)
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-12-09 07:47:06 +01:00
3bfa053c3e Log IP on SSH authentication failure for Built-in SSH server (#13150)
* Log IP on SSH authentication failure

fixes https://github.com/go-gitea/gitea/issues/13094

* include string 'Failed authentication attempt' in error

* update fail2ban docs

also match failed authentication over command line

* better logging of authentication errors with IP addresses

* format ...

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: 6543 <[email protected]>
2020-12-08 18:54:33 +01:00
6543andtechknowlogick 33231b3a42 Added Table of Contents to long documentation pages (#13890)
* Redo #13836 with new shortcode
(https://gitea.com/gitea/theme/pulls/90)

* add Api Usage

Co-authored-by: techknowlogick <[email protected]>
2020-12-07 23:52:26 -05:00
techknowlogick b1c4cc0175 Self-host cloudron image for docs (#13895)
* Add cloudron image to docs itself

* rm cloudron csp

* Update from-package.en-us.md
2020-12-07 22:20:37 -05:00
John Olheiser ab2dc27819 Fully qualify cloudron CSP (#13892)
* Wildcard cloudron

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

* Just use FQDN

Signed-off-by: jolheiser <[email protected]>
2020-12-07 16:17:27 -06:00
silverwind 5a07f57054 Remove Noto Color Emoji fallback (#13838)
It's causing browser errors logged in Firefox under certain
circumstances, and I think we're better off recommending Linux users to
install a proper emoji font into their system.
2020-12-04 16:01:47 +01:00
f2c55569d9 fixed and updated FAQ table of contents links (#13835)
* fixed and updated FAQ table of contents links, rewording one heading that wouldn't generate a working link

Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-12-04 08:33:38 +01:00
c03592a5e5 Update docker ssh passthrough docs (#13732)
* update docker ssh passthrough docs

* remove mailto:git part in SSH forwarding call

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-12-02 18:23:54 -05:00
silverwindandtechknowlogick 1ba3ba6510 Set RUN_MODE prod by default (#13765)
I think it's a bad default to have "dev" as the default run mode which
enables debugging and now also disables HTTP caching. It's better to
just default to a value suitable for general deployments.

Co-authored-by: techknowlogick <[email protected]>
2020-11-30 14:52:04 -05:00
f5ee3cb6e7 Add Allow-/Block-List for Migrate & Mirrors (#13610)
* add black list and white list support for migrating repositories

* fix fmt

* fix lint

* fix vendor

* fix modules.txt

* clean diff

* specify log message

* use blocklist/allowlist

* allways use lowercase to match url

* Apply allow/block

* Settings: use existing "migrations" section

* convert domains lower case

* dont store unused value

* Block private addresses for migration by default

* fix lint

* use proposed-upstream func to detect private IP addr

* a nit

* add own error for blocked migration, add tests, imprufe api

* fix test

* fix-if-localhost-is-ipv4

* rename error & error message

* rename setting options

* Apply suggestions from code review

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-28 19:37:58 -05:00
a3b10dd83e Format files (#13698)
* align "make help"

* format

* untouch build/generate-svg.js

* untouch .eslintrc

* combine editorconfig's

* rm editorconfig

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-28 01:12:22 -05:00
Jesse Laprade 4f9f8a3747 Fixed the log path on fail2ban page (#13726)
* Changed path from /home/git/gitea/log/gitea.log to
  /var/lib/gitea/log/gitea.log on the fail2ban page, so the log matches
  the instructions found on the following binary installation page:
  https://docs.gitea.io/en-us/install-from-binary/#create-required-directory-structure
2020-11-27 20:08:23 -05:00
techknowlogick eda38fca6e specific version in docker compose (#13644)
* specific version in docker compose

fix #13643

* update latest version
2020-11-19 11:36:48 -05:00
7135e727a0 Docs: Installation from package (#13607)
* add Arch Linux

* add Arch Linux ARM

* remove Debian

There is no package in any of Debian's official repositories as of 17.11.2020 17:55 UTC.

* shrink Alpine Linux

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

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-11-18 01:51:22 +02:00
silverwind 3333f2d64a HTTP cache rework and enable caching for storage assets (#13569)
This enabled HTTP time-based cache for storage assets, primarily
avatars. I have not observed If-Modified-Since from browsers during
tests but I guess it's good to support regardless.

It introduces a new generic httpcache module that can handle both
time-based and etag-based caching.

Additionally, manifest.json and robots.txt are now also cachable.
2020-11-17 17:44:52 -05:00
7c010e3c1b proper signature validation (#13523)
$header_signature could be a typed float (start with 0e and then only numbers) and a float does equal a string when comparing with typed juggle.
eg: 0e123 != "abc" does return false, but 0e123 !== "abc" returns true.

you previously could circumvent the signature check when providing a header signature in the float format (0e...)

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2020-11-13 13:28:15 -05:00
Simon Legner f3b8916d37 docs(comparison): GitHub Actions (#13474)
https://github.com/features/actions
2020-11-08 17:35:28 -05:00
techknowlogickandzeripath 016a1dc891 Add note about installation on kubernetes to docs (#13469)
Co-authored-by: zeripath <[email protected]>
2020-11-08 15:50:40 -05:00
Antoine GIRARD 9a3eed3fe5 docker: rootless image (#10154)
* docker: rootless image

* improve docs + remove check for write perm on custom

* add more info on ssh passtrough

* Add comment for internal ssh server in container config
2020-10-31 20:58:22 -04:00
zeripathandtechknowlogick 20fa482c1c Fix --port setting (#13288)
* Fix --port setting

Unfortunately there was an error in #13195 which set the --port
option before the settings were read. This PR fixes this by
moving applying this option to after the the settings are read

However, on looking further into this code I believe that the setPort
code was slightly odd.

Firstly, it may make sense to run the install page on a different
temporary port to the full system and this should be possible with
a --install-port option.

Secondy, if the --port option is provided we should apply it to both
otherwise there will be unusual behaviour on graceful restart

Thirdly, the documentation for --port says that the setting is
temporary - it should therefore not save its result to the configuration

(This however, does mean that authorized_keys and internal links may
not be correct. - I think we need to discuss this option further.)

Fix #13277

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

* Update cmd/web.go

* Apply suggestions from code review

Co-authored-by: techknowlogick <[email protected]>
2020-10-30 15:26:03 -04:00
Shikaku c5d9ab342f Fix command-line doc examples (#13337) 2020-10-28 20:47:51 +00:00
JustAnotherArchivist 5092097da3 Add deprecation notice for webhook payload's secret field (#13330) 2020-10-27 20:06:35 +00:00
Lunny Xiaoandtechknowlogick e64c7c2d65 Remove duplicated repository.upload on cheat-sheet docs (#13290)
Co-authored-by: techknowlogick <[email protected]>
2020-10-24 13:49:52 -04:00
John Olheiser bc3c254112 Refactor docs (#13275)
* First pass

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

* More changes

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

* Redirects

Signed-off-by: jolheiser <[email protected]>
2020-10-23 11:59:45 -04:00
Mattias Perssonandtechknowlogick c7731d5d93 Clarify app.example.ini documentation (#13256)
* Clarify app.example.ini documentation

Hard to understand if cron i needed to activate all other cron.

* Added missing "Extended cron tasks" to config-cheat-sheet.en-us.md

cron default is false - setting it true activates all cron. Changed the documentation accordingly

* Fixed spelling

Co-authored-by: techknowlogick <[email protected]>
2020-10-22 14:02:28 -04:00
4c118024de add sdk links to docs (#13266)
* add sdk links to docs

* Update docs/content/doc/advanced/api-usage.en-us.md

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

Co-authored-by: Markus <[email protected]>
Co-authored-by: John Olheiser <[email protected]>
2020-10-22 13:04:23 -04:00
Amoo Hesam 3d12ad10ed Inform user of how disable SSH feature when installing using Docker (#13180) 2020-10-22 00:24:20 -04:00
silverwind 5db0734a67 Use CSS Variables for fonts, remove postcss-loader (#13204)
* Use CSS Variables for fonts, remove postcss-loader

- Use CSS variables for fonts, making the fonts easier to customize
- Remove postcss-loader, it's not doing anything useful and is actually
  applying strange transforms on our CSS.

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

* introduce helper variable, mark documented vars

* work around case issue by always quoting specific fonts
2020-10-19 16:01:06 -04:00
Patrick SchratzandAndrew Thornton 650344c8b4 Align SSH_AUTHORIZED_KEYS_BACKUP var with the value in app.ini (#13212)
* Align `SSH_AUTHORIZED_KEYS_BACKUP` var with the value in `app.ini`

* Also fix the cheat sheet and move it to below - SSH_CREATE_AUTHORIZED_KEYS_FILE

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

Co-authored-by: Andrew Thornton <[email protected]>
2020-10-19 15:25:32 -04:00
ydelafollye 8f2c577988 Improve users management through the CLI (#6001) (#10492)
* Fix images in wiki edit preview (#11546)

Make sure wiki editor sets wiki to true so gitea renders it as a wiki page.

Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless.

Fixes #11540
2020-10-15 22:48:38 -04:00
Johan Van de Wauw 493cc7bcc2 Update external-renderers.en-us.md (#13165)
Alpine 3.12 (the version used by current master) no longer provides the python-dev package:
https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.12.0#python2_no_longer_provides_python_and_python-devel

As the next steps explicitely use python3 it is not needed anyway.
2020-10-15 19:30:25 +01:00
Robin c622cdcbe9 Enhance config cheat sheet on passwd quoting (#13158)
See #13126
2020-10-15 10:48:00 +01:00
Lunny Xiao e1e06ee9fb Avatars and Repo avatars support storing in minio (#12516)
* Avatar support minio

* Support repo avatar minio storage

* Add missing migration

* Fix bug

* Fix test

* Add test for minio store type on avatars and repo avatars; Add documents

* Fix bug

* Fix bug

* Add back missed avatar link method

* refactor codes

* Simplify the codes

* Code improvements

* Fix lint

* Fix test mysql

* Fix test mysql

* Fix test mysql

* Fix settings

* Fix test

* fix test

* Fix bug
2020-10-14 21:07:51 +08:00
6543 ac5268939b Gitea 2 Gitea migration (#12657)
* first draft

* update gitea sdk to 9e280adb4da

* adapt feat of updated sdk

* releases now works

* break the Reactions loop

* use convertGiteaLabel

* fix endless loop because paggination is not supported there !!!

* rename gitea local uploader files

* pagination can bite you in the ass

* Version Checks

* lint

* docs

* rename gitea sdk import to miss future conficts

* go-swagger: dont scan the sdk structs

* make sure gitea can shutdown gracefully

* make GetPullRequests and GetIssues similar

* rm useles

* Add Test: started ...

* ... add tests ...

* Add tests and Fixing things

* Workaround missing SHA

* Adapt: Ensure that all migration requests are cancellable
(714ab71ddc4260937b1480519d453d2dc4e77dd6)

* LINT: fix misspells in test set

* adapt ListMergeRequestAwardEmoji

* update sdk

* Return error when creating giteadownloader failed

* update sdk

* adapt new sdk

* adopt new features

* check version before err

* adapt: 'migrate service type switch page'

* optimize

* Fix DefaultBranch

* impruve

* handle subPath

* fix test

* Fix ReviewCommentPosition

* test GetReviews

* add DefaultBranch int test set

* rm unused

* Update SDK to v0.13.0

* addopt sdk changes

* found better link

* format template

* Update Docs

* Update Gitea SDK (v0.13.1)
2020-10-14 07:06:00 +03:00
77cb501064 Add ssh certificate support (#12281)
* Add ssh certificate support

* Add ssh certificate support to builtin ssh

* Write trusted-user-ca-keys.pem based on configuration

* Update app.example.ini

* Update templates/user/settings/keys_principal.tmpl

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

* Remove unused locale string

* Update options/locale/locale_en-US.ini

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

* Update options/locale/locale_en-US.ini

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

* Update models/ssh_key.go

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

* Add missing creation of SSH.Rootpath

* Update cheatsheet, example and locale strings

* Update models/ssh_key.go

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

* Update models/ssh_key.go

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

* Update models/ssh_key.go

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

* Update models/ssh_key.go

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

* Update models/ssh_key.go

* Optimizations based on feedback

* Validate CA keys for external sshd

* Add filename option and change default filename

Add a SSH_TRUSTED_USER_CA_KEYS_FILENAME option which default is
RUN_USER/.ssh/gitea-trusted-user-ca-keys.pem

Do not write a file when SSH_TRUSTED_USER_CA_KEYS is empty.

Add some more documentation.

* Remove unneeded principalkey functions

* Add blank line

* Apply suggestions from code review

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

* Add SSH_AUTHORIZED_PRINCIPALS_ALLOW option

This adds a SSH_AUTHORIZED_PRINCIPALS_ALLOW which is default
email,username this means that users only can add the principals
that match their email or username.

To allow anything the admin need to set the option anything.

This allows for a safe default in gitea which protects against malicious
users using other user's prinicipals. (before that user could set it).

This commit also has some small other fixes from the last code review.

* Rewrite principal keys file on user deletion

* Use correct rewrite method

* Set correct AuthorizedPrincipalsBackup default setting

* Rewrite principalsfile when adding principals

* Add update authorized_principals option to admin dashboard

* Handle non-primary emails

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

* Add the command actually to the dashboard template

* Update models/ssh_key.go

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

* By default do not show principal options unless there are CA keys set or they are explicitly set

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

* allow settings when enabled

* Fix typos in TrustedUserCAKeys path

* Allow every CASignatureAlgorithms algorithm

As this depends on the content of TrustedUserCAKeys we should allow all
signature algorithms as admins can choose the specific algorithm on their
signing CA

* Update models/ssh_key.go

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

* Fix linting issue

Co-authored-by: silverwind <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-10-10 20:38:09 -04:00
zeripath 05c34201e2 Change default log configuration (#13088)
* Change default log configuration

This PR changes the install page and the docker default
logging configuration to match the suggested configuration
that I repeatedly end up suggesting on issues.

It further improves the logging configuration docs to
recommend specific instructions for how to configure logs
for posting to issues.

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

* Update docs/content/doc/advanced/logging-documentation.en-us.md
2020-10-10 18:19:50 +03:00
64c5743751 Disable DSA ssh keys by default (#13056)
* Disable DSA ssh keys by default

OpenSSH has disabled DSA keys since version 7.0

As the docker runs openssh > v7.0 we should just disable
DSA keys by default.

Refers to #11417

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

* Just disable DSA keys by default

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

* Appears we need to set the minimum key sizes too

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

* Appears we need to set the minimum key sizes too

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

* Remove DSA type

* Fix Tests

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-10-09 09:52:57 +03:00
Melroy van den Bergandtechknowlogick a16760939f Improve Docker container name (#13077)
* Improve Docker container name

Use a better Docker container name than the default 'server'

* Changing to gitea and use recommended v3 Docker-compose

Use `gitea` as container name. And use version 3 of the docker-compose, which should now be used: https://docs.docker.com/compose/compose-file/compose-versioning/

Co-authored-by: techknowlogick <[email protected]>
2020-10-08 22:31:07 -04:00
Niklas GoerkeandNiklas Goerke 041d452fc6 Mitigate Security vulnerability in the git hook feature (#13058)
* Extend git hook warning in the UI.

Git hooks are a dangerous feature, administrators should be warned before giving
the git hook privilege to users.

* Disable Git hooks by default and add warning.

Git hooks are a dangerous features (see warning text) that should only
be enabled if the administrator was informed about the risk involved.

Co-authored-by: Niklas Goerke <[email protected]>
2020-10-07 12:55:13 +03:00
Rongjian Zhang cbc1af255e Update third-party-tools.en-us.md (#13046) 2020-10-06 12:55:51 -04:00
6543 143f88522c [Docs] Update GitNex Link (#13050) 2020-10-06 08:23:10 +01:00
silverwindandLauris BH bef02eec30 Attachments: Add extension support, allow all types for releases (#12465)
* Attachments: Add extension support, allow all types for releases

- Add support for file extensions, matching the `accept` attribute of `<input type="file">`
- Add support for type wildcard mime types, e.g. `image/*`
- Create repository.release.ALLOWED_TYPES setting (default unrestricted)
- Change default for attachment.ALLOWED_TYPES to a list of extensions
- Split out POST /attachments into two endpoints for issue/pr and
  releases to prevent circumvention of allowed types check

Fixes: https://github.com/go-gitea/gitea/pull/10172
Fixes: https://github.com/go-gitea/gitea/issues/7266
Fixes: https://github.com/go-gitea/gitea/pull/12460
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers

* rename function

* extract GET routes out of RepoMustNotBeArchived

Co-authored-by: Lauris BH <[email protected]>
2020-10-05 01:49:33 -04:00
Divyam Bhasinandtechknowlogick dd31df0ced updated docs with caveat for authorized_keys (#13030)
* updated docs with caveat for authorized_keys

* wrapped authorized_keys in ticks

Co-authored-by: techknowlogick <[email protected]>
2020-10-04 19:52:40 -04:00
John OlheiserandAndrew Thornton 3841e371a2 hCaptcha Support (#12594)
* Initial work on hCaptcha

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

* Use module

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

* Format

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

* At least return and debug log a captcha error

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

* Pass context to hCaptcha

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

* Add context to recaptcha

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

* fix lint

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

* Finish hcaptcha

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

* Update example config

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

* Apply error fix for recaptcha

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

* Change recaptcha ChallengeTS to string

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

Co-authored-by: Andrew Thornton <[email protected]>
2020-10-02 23:37:53 -04:00
e9e4917139 Update comparison for GitLab CE (#13019)
* Update comparison for GitLab CE

Fixes #13018.

* Update docs/content/doc/features/comparison.en-us.md

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

* Update comparison.en-us.md

According to the linked issue it is there and just the documentation is lacking.

* Update docs/content/doc/features/comparison.en-us.md

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

* Update docs/content/doc/features/comparison.en-us.md

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

Co-authored-by: mrsdizzie <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-10-02 18:08:17 -04:00
zeripath bc02119212 Copy missing things from app.example.ini to Cheat Sheet (#12988)
Signed-off-by: Andrew Thornton <[email protected]>
2020-10-01 07:57:57 +01:00
raoulb 48a798c5c1 Fix hugo shortcode typo in faq (#12987)
* Fix hugo shortcode typo in faq

* Switch to using language tags
2020-09-30 16:59:30 -04:00
65d451e903 Clarification on the use of certificate chains (#12986)
* Clarification on the use of certificate chains

* As per @bagasme

Co-authored-by: Bagas Sanjaya <[email protected]>

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Bagas Sanjaya <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-09-30 12:16:13 -04:00
Lunny Xiao c306725943 Fix typo on Chinese documents (#12982) 2020-09-30 20:27:41 +08:00