Commit Graph
95 Commits
Author SHA1 Message Date
Tekaoh e71e231d93 Update config-cheat-sheet.en-us.md (#7046) 2019-05-26 06:23:30 +01:00
Lunny Xiao 14df04550c Add support of utf8mb4 for mysql (#6992) 2019-05-24 00:15:26 -04:00
Monty Taylor 7f9c30820c Fix documentation on Oauth2.Enable flag (#7011)
* Fix documentation on Oauth2.Enable flag

The docs list this as ENABLED, but in the source code it's
ENABLE, meaning following the docs leads to confusion.

* Update sample config for oauth2.ENABLE
2019-05-21 21:48:34 -04:00
silverwind ba86d52847 add make targets for js and css, add js linter (#6952)
* add make targets for js,css, add javascript linter

- add `make js`, deprecating `make javascripts`
- add `make css`, deprecating `make generate-stylesheets` and
  `make stylesheets-check`
- changed the unclean css check to only run on CI
- add JS linting via eslint with basic configuration and fixed
  discovered issues
- changed autoprefixer to use official `postcss-cli` avoiding the need
  to loop in the makefile
- moved browserslist to package.json so other future tools can use it
  too.
- update documentation for new make targets and added JS section

* fix indentation

* move functions used in html to 'exported' list

* Run lessc binary without having to install anything to node_modules

* use relative paths to node bin scripts, removing npx

* Revert "use relative paths to node bin scripts, removing npx"

This reverts commit 119b725525a8430b32ee7a6e6009b4ece544e39b.

* fix lessc and postcss plugins

* check for node_modules and use actual bin names
2019-05-16 08:57:47 +03:00
zeripath a03dd323de Stop colorizing files by default (#6949) 2019-05-15 22:37:06 +01:00
Tamal Saha e27a8ee2e4 Handle CORS requests (#6289) 2019-05-13 11:38:53 -04:00
zeripath 68bd8ff71f Fix logging documentation (#6904)
* ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG

* Allow DISABLE_ROUTER_LOG to be set in the [log] section
2019-05-11 10:13:57 +01:00
Wim f5fc57b6a0 Show full name if DefaultShowFullName setting activated (#6710)
Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section.
If enabled the full name will be shown (unless it's empty, then
the default username will be used)
2019-05-08 11:41:35 +03:00
techknowlogick 9962d778ed Add documentation for OTP/2FA header in API for basic auth (#6872) 2019-05-07 16:53:45 -04:00
Lunny Xiao 20d5b987e1 Improve migrations to support migrating milestones/labels/issues/comments/pullrequests (#6290)
* add migrations

* fix package dependency

* fix lints

* implements migrations except pull requests

* add releases

* migrating releases

* fix bug

* fix lint

* fix migrate releases

* fix tests

* add rollback

* pull request migtations

* fix import

* fix go module vendor

* add tests for upload to gitea

* more migrate options

* fix swagger-check

* fix misspell

* add options on migration UI

* fix log error

* improve UI options on migrating

* add support for username password when migrating from github

* fix tests

* remove comments and fix migrate limitation

* improve error handles

* migrate API will also support migrate milestones/labels/issues/pulls/releases

* fix tests and remove unused codes

* add DownloaderFactory and docs about how to create a new Downloader

* fix misspell

* fix migration docs

* Add hints about migrate options on migration page

* fix tests
2019-05-07 09:12:51 +08:00
zeripath 34b2206900 Allow Recaptcha service url to be configured (#6820) 2019-05-02 16:09:39 +03:00
zeripath fc33eabea7 Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00
zeripath 7d8e28a4e4 Trace Logging on Permission Denied & ColorFormat (#6618)
* Add log.ColorFormat and log.ColorFormatted

Structs can now implement log.ColorFormatted to provide their own
colored format when logged with `%-v` or additional flags.

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

* Add basic ColorFormat to repository and user

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

* Add basic ColorFormat to access and unit

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

* Add ColorFormat to permission and on trace log it

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

* Add log.NewColoredIDValue to make ID value coloring consistent

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

* formatting changes

* Add some better tracing to permission denied for read issues/pulls

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

* Add Trace logging on permission denied

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

* Remove isTrace() check from deferred func

* Adjust repo and allow logging of team

* use FormatInt instead of Itoa

* Add blank line

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

* Update access.go
2019-04-22 23:40:51 +03:00
Richard Mahn a39be88f1e Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 2019-04-17 12:06:35 -04:00
zeripath 7b084da00e Add SUBJECT_PREFIX mailer config option (#6605)
* Add SUBJECT_PREFIX mailer config option

* Add space between subject prefix and subject (Change from Gogs)

Signed-off-by: Andrew Thornton <[email protected]>
2019-04-17 00:56:40 -04:00
Jonas Franz d3039437c8 Add oauth2 documentation (#6604)
* Add oauth2 documentation

Signed-off-by: Jonas Franz <[email protected]>

* Apply suggestions from code review

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

* Update docs/content/doc/advanced/oauth2-provider.md

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

* Update oauth2-provider.md
2019-04-14 10:42:11 +02:00
Jonas Franz fb30b9b089 Add option to disable refresh token invalidation (#6584)
* Add option to disable refresh token invalidation

Signed-off-by: Jonas Franz <[email protected]>

* Add integration tests and remove wrong todos

Signed-off-by: Jonas Franz <[email protected]>

* Fix typo

Signed-off-by: Jonas Franz <[email protected]>

* Fix tests and add documentation

Signed-off-by: Jonas Franz <[email protected]>
2019-04-12 15:50:21 +08:00
Lunny Xiao 88860b9e1e Issue indexer queue redis support (#6218)
* add redis queue

* finished indexer redis queue

* add redis vendor

* fix vet

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

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

* switch to go mod

* Update required changes for new logging func signatures
2019-04-08 12:05:15 +03:00
zeripath ff3be6f335 Quieter Integration Tests (#6513)
* Rename BaseLogger to WriterLogger to help the creation of other providers

* Don't export ColorBytes and ResetBytes from ColoredValues

* Make integration tests only print logs if they fail

* check can color before coloring

* I always forget about MSSQL

* Oh and use LEVEL in sqlite.ini

* Make the test logger log at info - as it means you see the router

* Remove empty expected changes

* Make the migrations quieter too

* Don't display SQL on error - it can be looked at in the file logs if necessary

* Fix skip when using onGiteaRun
2019-04-07 03:25:14 +03:00
zeripath 6fa149816c Some logging documentation (#6498) 2019-04-04 09:44:01 +01:00
zeripath 016379ecdc Better logging (#6038) (#6095)
* Panic don't fatal on create new logger

Fixes #5854

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

* partial broken

* Update the logging infrastrcture

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

* Reset the skip levels for Fatal and Error

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

* broken ncsa

* More log.Error fixes

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

* Remove nal

* set log-levels to lowercase

* Make console_test test all levels

* switch to lowercased levels

* OK now working

* Fix vetting issues

* Fix lint

* Fix tests

* change default logging to match current gitea

* Improve log testing

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

* reset error skip levels to 0

* Update documentation and access logger configuration

* Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE

* Fix broken level caching

* Refactor the router log

* Add Router logger

* Add colorizing options

* Adjust router colors

* Only create logger if they will be used

* update app.ini.sample

* rename Attribute ColorAttribute

* Change from white to green for function

* Set fatal/error levels

* Restore initial trace logger

* Fix Trace arguments in modules/auth/auth.go

* Properly handle XORMLogger

* Improve admin/config page

* fix fmt

* Add auto-compression of old logs

* Update error log levels

* Remove the unnecessary skip argument from Error, Fatal and Critical

* Add stacktrace support

* Fix tests

* Remove x/sync from vendors?

* Add stderr option to console logger

* Use filepath.ToSlash to protect against Windows in tests

* Remove prefixed underscores from names in colors.go

* Remove not implemented database logger

This was removed from Gogs on 4 Mar 2016 but left in the configuration
since then.

* Ensure that log paths are relative to ROOT_PATH

* use path.Join

* rename jsonConfig to logConfig

* Rename "config" to "jsonConfig" to make it clearer

* Requested changes

* Requested changes: XormLogger

* Try to color the windows terminal

If successful default to colorizing the console logs

* fixup

* Colorize initially too

* update vendor

* Colorize logs on default and remove if this is not a colorizing logger

* Fix documentation

* fix test

* Use go-isatty to detect if on windows we are on msys or cygwin

* Fix spelling mistake

* Add missing vendors

* More changes

* Rationalise the ANSI writer protection

* Adjust colors on advice from @0x5c

* Make Flags a comma separated list

* Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING

* Ensure matching is done on the non-colored message - to simpify EXPRESSION
2019-04-02 08:48:31 +01:00
Thomas McWork fe647de56b More specific declaration of search disk space (#6338)
Elaborate more on the code search storage space requirement
2019-03-16 22:47:04 -04:00
MysticBoy 9d9c7880b6 Update third-party-tools.en-us.md (#6301)
Add  Gitea Extension for Visual Studio
2019-03-11 19:35:18 +08:00
Aidan Fitzgerald 9853171de5 Copyedit docs (#6275) 2019-03-09 16:15:45 -05:00
John Olheiser d0401f0f01 Third party docs (#6282) 2019-03-08 12:42:59 -05:00
Jonas Franz 58efa8748b Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
John Olheiser cd612b59fa Doc updates for customization and installation. (#6176)
* Doc updates and changing default sqlite DB path

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

* Update customizing locales and THEMES

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

* Add link to templates directory

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

* Add portion for final step of running Gitea

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

* Add recommended to service file usage

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

* Removed DB path change, moving to another PR
Updated doc sentence structure

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

* Revert change to template wording

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

* Move recommended run-type to top
2019-02-28 20:09:47 +08:00
Lunny Xiao 19efa3bb7d Add more tests and docs for issue indexer, add db indexer type for searching from database (#6144)
* add more tests and docs for issue indexer, add db indexer type for searching from database

* fix typo

* fix typo

* fix lint

* improve docs
2019-02-21 13:01:28 +08:00
John Olheiser 9139f3205d Makefile changes for Windows and easier development (#6103)
* Added Go Path and node_modules to PATH
* Uses npx now for generate-stylesheets
* Uses `go env GOPATH` to calculate adding GOPATH/bin to PATH
* Added note about installing Node 8.0+ to generate stylesheets
* Added preferred Node version to CONTRIBUTING.md
2019-02-20 19:56:40 +00:00
Lanre Adelowo ee76816e00 Implement "conversation lock" for issue comments (#5073) 2019-02-18 22:55:04 +02:00
Rémy Boulanouar 7d4d14f39a Allow to set organization visibility (public, internal, private) (#1763) 2019-02-18 18:00:27 +02:00
zeripath 91270d4058 Update and expand information about building Gitea (#6019)
* Update and expand building information

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

* remove extraneous extra line

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

* Fix spelling mistake

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

* Note about documentation for the website

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

* More changes

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

* Clarified the automatic build dependency

* Update the from-source to match the hacking information

* Extend quotes

* Update required go and discord link

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

* Update hacking-on-gitea.en-us.md

Add in information about postcss
2019-02-12 16:22:01 +00:00
Lanre Adelowo fadac7d59a Add option to close issues via commit on a non master branch (#5992)
* fixes #5957

* add tests to make sure config option is respected

* use already defined struct

* - use migration to make the flag repo wide not for the entire gitea instance
Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created

- fix copy/paste error in copyright header year and rearrange import

- use repo config instead of server config value to determine if a commit should close an issue

- update testsuite

* use global config only when creating a new repository

* allow repo admin toggle feature via UI

* fix typo and improve testcase

* fix fixtures

* add DEFAULT prefix to config value

* fix test
2019-02-10 21:27:19 +02:00
Lunny Xiao f7eef3e8c0 add default time out for git operations (#6015) 2019-02-09 22:44:24 +00:00
Richard Mahn 3fe605932c Feature - Pagination for git tree API (#5838)
* Feature - Pagination for git tree API

* Handles case when page is negative

* Does a for loop over the start and end rather than all entries

* Removed redundent logic

* Adds per_page as a query parameter

* Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt

* Fix typo in cheat-sheet en

* Makes page start at 1, generated swagger

* Use updates to SDK

* Updates to use latest sdk

* Updates swagger for tree api

* Adds test for GetTreeBySHA

* Updates per PR reviews

* Updates per PR reviews

* Remove file

* Formatting

* Fix to swagger file

* Fix to swagger

* Update v1_json.tmpl

* Fix to swagger file
2019-02-06 18:19:26 +00:00
zeripath 4eced282dd Allow Macaron to be set to log through to gitea.log (#5667)
* Allow Macaron to be set to log through gitea.log

Fix #4291
2019-02-05 22:06:41 -05:00
techknowlogick a464408bd0 add other session providers (#5963) 2019-02-05 11:52:51 -05:00
zeripath 3857d8cc65 Make log mailer for testing (#5893)
* Create log mailer for testing email settings

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

* Switch on the log mailer for the integration tests

This ensures that the sending mail process works

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

* rename the from user for mysql/mssql

* rename log sender to dummy sender

* update the integration tests
2019-02-02 21:06:52 -05:00
sebastian-sauer 5ee9128ac8 Config option to disable automatic repo watching (#5852)
Add a new config option to enable / disable the automatic watching of
repos for new repositories and if a user is added to a team.

Fixes #653

Signed-off-by: Sebastian Sauer <[email protected]>
2019-01-27 09:25:21 +00:00
Lunny Xiao 38490206f8 improve the releases api paging (#5831)
* improve the releases api paging

* add max limit on API paging
2019-01-24 20:59:27 +02:00
Peter Colberg 641c4a1d9f Adapt documentation to renamed ENABLE_SWAGGER option (#5811)
Updates documentation to account for the renamed ENABLE_SWAGGER_ENDPOINT from  #3572 (commit a74426d631e3311cc3c460ae9917f76f0221f4de)

Signed-off-by: Peter Colberg <[email protected]>
2019-01-23 20:09:18 +00:00
techknowlogick d16746ea31 Add documentation for SHOW_REGISTRATION_BUTTON (#5778)
* Fix #5737
2019-01-19 18:22:47 -05:00
Paul Brackin ca5824c4d1 Make db connect more robust (#5738) 2019-01-19 16:17:08 -05:00
Lanre Adelowo 86d673b968 update docs to include THEMES config value (#5752)
* update docs to include THEMES

* Update app.ini.sample

* Update config-cheat-sheet.en-us.md
2019-01-17 14:48:01 -05:00
Lunny Xiao 34555a5f22 Support CORS headers to git smart http protocol (#5719) 2019-01-14 16:05:27 -05:00
0x5c fc06fa8a1b Documentation: Clarity for HTTPS setups (#5626)
[https-setup]
- Made it clearer that HTTP redirection is possible
[config-cheat-sheet]
- Clarified the behavihour of the redirection-related config keys
2019-01-03 16:46:07 +01:00
BetaCat 991df74a07 Fix translation errors in doc advanced part (zh-cn) (#5112)
* ZH-CN translation of Advanced part

* Fix translation errors

* Resolve issues
2018-12-23 18:57:49 +08:00
zeripath 5e858f18da Support reverse proxy providing email (#5554)
This PR implements #2347
2018-12-18 12:05:48 -05:00
Roman c2040ee0c3 improve the git-scm url's in docs and sample.ini (#5467)
* remove old git-version from git-scm url in app.ini

The url includes the version of git, which is not required to view the
page. If you open the page without the version you get the current
version and it's possible to switch the used version.

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

* docs: mention the git-scm url for git configs

Signed-off-by: Roman <[email protected]>
2018-12-05 00:40:42 +02:00
Lanre Adelowo f48c1f6131 Explicitly decide whether to use TLS in mailer's configuration (#5024)
* explicitly decide on using TLS for mail connections

* explicitly decide on using TLS for mail connections

* keep compatibility
2018-11-26 14:21:41 -05:00