Commit Graph
35 Commits
Author SHA1 Message Date
Zoran Peričić bd2350e24d Add/update SMTP auth providers via cli (#18197)
Allow adding/updating SMTP authentication source via CLI using:
- gitea admin  auth add-smtp 
- gitea admin  auth update-smtp

Signed-off-by: Zoran Peričić <[email protected]>
2022-01-12 22:54:53 +00:00
Greg Myers 59ef05d999 Fix typos in docs/content (#18215) 2022-01-09 19:53:03 +08:00
qwerty287 a0d1923637 Fix various typos of software names (#18083)
* `git` -> `Git`
* `Github` and `github` -> `GitHub`
* `crowdin` -> `Crowdin`
* `git-lfs` -> `Git LFS`
* `githooks`, `git hooks`, `git-hooks` -> `Git Hooks`
* `discord` -> `Discord`
* `2fa` -> `2FA`
* `gitlab` and `Gitlab` -> `GitLab`
* `web hook` -> `webhook`
* `linux` -> `Linux`
* `sqlite` -> `SQLite`
* `MYSQL` and `mysql` -> `MySQL`
* rename refs to `master` branch -> `main`
* Fix English grammar
2021-12-24 11:56:57 +08:00
4fb6d37ae7 Add Option to synchronize Admin & Restricted states from OIDC/OAuth2 along with Setting Scopes (#16766)
* Add setting to OAuth handlers to override local 2FA settings

This PR adds a setting to OAuth and OpenID login sources to allow the source to
override local 2FA requirements.

Fix #13939

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

* Fix regression from #16544

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

* Add scopes settings

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

* fix trace logging in auth_openid

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

* add required claim options

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

* Move UpdateExternalUser to externalaccount

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

* Allow OAuth2/OIDC to set Admin/Restricted status

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

* Allow use of the same group claim name for the prohibit login value

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

* fixup! Move UpdateExternalUser to externalaccount

* as per wxiaoguang

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

* add label back in

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

* adjust localisation

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

* placate lint

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

Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-12-14 16:37:11 +08:00
a504ca2c61 Docs: replace gitea with Gitea (#17838)
Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2021-11-28 21:28:30 +08:00
SahAssarandwxiaoguang 05e2bc129a Fix list for options under cli->user->admin->create (#17382)
Co-authored-by: wxiaoguang <[email protected]>
2021-11-03 13:27:35 +08: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
zeripathandtechknowlogick 19e5983395 Add --quiet and --verbose to gitea web to control initial logging (#16260)
One of the repeatedly reported issues has been that gitea produces too much console
logging during set up even if the console logger is turned off.

Fundamentally this is due to some otherwise very helpful logging that has to occur
before logging is set up. This has come to a head with the merging of #16243 where
otherwise potentially helpful Trace logging in the git module now appears on the
console.

This PR proposes three things:

1. Change the initial default logger to Info not Trace.
2. Change the logging for the AppPath things to Info in recompense.
3. Add two new command line options to gitea web: --quiet and --verbose

`gitea web -q` or `gitea web --quiet` will only log Fatal level initially.
`gitea web -verbose` will log at Trace.

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

Co-authored-by: techknowlogick <[email protected]>
2021-06-26 20:56:58 -04:00
a24ca26b31 [docs] Fix typo in command-line.en-us.md (#14746)
seperated -> separated

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2021-02-19 11:29:22 -05:00
zeripathand6543 d5ae3682c5 Exclude the current dump file from the dump (#14606)
* Exclude the current dump file from the dump

Always prevent the current file from being added to the dump.

Fix #13618

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

* Add skip custom directory option

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

* placate lint

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

Co-authored-by: 6543 <[email protected]>
2021-02-08 09:00:12 +08:00
Daniil PankratovandDaniil Pankratov fbc7248687 CLI support for OAuth sources custom icons (#14166)
Co-authored-by: Daniil Pankratov <[email protected]>
2020-12-28 09:39:12 +01:00
Lunny Xiao a42089354f Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244)
* Dump github/gitlab repository data to a local directory

* Fix lint

* Adjust directory structure

* Allow migration special units

* Allow migration ignore release assets

* Fix lint

* Add restore repository

* stage the changes

* Merge

* Fix lint

* Update the interface

* Add some restore methods

* Finish restore

* Add comments

* Fix restore

* Add a token flag

* Fix bug

* Fix test

* Fix test

* Fix bug

* Fix bug

* Fix lint

* Fix restore

* refactor downloader

* fmt

* Fix bug isEnd detection on getIssues

* Refactor maxPerPage

* Remove unused codes

* Remove unused codes

* Fix bug

* Fix restore

* Fix dump

* Uploader should not depend downloader

* use release attachment name but not id

* Fix restore bug

* Fix lint

* Fix restore bug

* Add a method of DownloadFunc for base.Release to make uploader not depend on downloader

* fix Release yml marshal

* Fix trace information

* Fix bug when dump & restore

* Save relative path on yml file

* Fix bug

* Use relative path

* Update docs

* Use git service string but not int

* Recognize clone addr to service type
2020-12-27 11:34:19 +08:00
5321b8a130 fix label of --id in admin delete user (#14005)
* fix label of --id in admin delete user

This pr fixes the label descriptor of `gitea admin delete user`
but also adds a `--username` option.

Fix #13995

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

* fix-spacing

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

* Add delete email support

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

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-12-17 02:57:32 -05: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
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
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
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
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
zeripath b0ae3edc04 Add command to recreate tables (#12407)
Provides new command: `gitea doctor recreate-table` which will recreate
db tables and copy the old data in to the new table.

This function can be used to remove the old warning of struct defaults being
out of date.

Fix #8868
Fix #3265
Fix #8894

Signed-off-by: Andrew Thornton <[email protected]>
2020-09-06 22:52:01 +01:00
zeripathandFlorian Klink f1c9434901 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
aea3818e79 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
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
Lunny Xiao 2914eb2781 Add a new command doctor to check if some wrong configurations on gitea instance (#9095)
* add doctor

* Add a new command doctor to check if some wrong configurations on gitea instance

* fix import

* use regex match authorized_keys on doctor

* Add documentation
2020-01-11 15:24:57 +01:00
zeripath c98a365500 AuthorizedKeysCommand should not query db directly (#9371)
* AuthorizedKeysCommand should not query db directly

* Update routers/private/internal.go

* Fix import order
2019-12-16 20:49:07 -05:00
Justin R. Cutler c996b2dca6 Correct port range for cap_net_bind_service (#9306) 2019-12-09 14:20:09 -05:00
John Olheiser cdac1bfb5f Add migrate command to docs (#8842)
* Add migrate command to docs

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

* Link to CLI

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

* Clarify idempotence

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

* Sneak in convert command

Signed-off-by: jolheiser <[email protected]>
2019-11-05 13:54:54 -05:00
ngourdonandngourdon e164486c9d Add CLI commands to manage LDAP authentication source (#6681)
* add CLI commands to manage LDAP authentication source

* delete Gogs copyright

* remove unused return value of func parseLoginSource

* fix comment

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

* remove config flag already present in global flags

* remove config flag from ldap commands in docs

* remove config flag handling
2019-06-17 14:32:20 -04:00
Lanre Adelowo 364ac6b337 add docs for #6847 (#7132) 2019-06-05 17:24:09 +01:00
zeripath 46c89db264 Add work path CLI option (#6922)
Makes it possible to set the work path as a CLI option instead of
relying on environment variables which are somewhat opaque
2019-05-14 11:20:35 -04:00
techknowlogick ada0d7dd5a Rename LFS_JWT_SECRET to include OAUTH2 as well (#6826) 2019-05-01 22:32:06 -04:00
John Olheiser 0e786302b2 Change verbose flag in dump command to avoid colliding with global version flag (#6822)
* Change verbose flag to avoid colliding with version flag
* Update docs

Signed-off-by: jolheiser <[email protected]>
2019-05-01 21:36:09 +01:00
zeripath fc33eabea7 Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00
ngourdon 9d6de48e3e Add username flag in create-user command (#6534)
* Add username flag in create-user command

* Fix the error message

* Change name to username on flag of create-user command

* Include create-user flags of both versions

* delete deprecated example of create-user command
2019-04-09 11:21:55 -04:00
nodiscc a768492061 docs: document setup with read-only config (#6348) 2019-04-04 10:21:54 -04:00