Commit Graph
118 Commits
Author SHA1 Message Date
bd92e460bd Propose some references about ci/cd solutions compatibles with gitea (#7996)
* Propose some references about ci/cd solutions compatibles with gitea

* No note about theirs integration level, only a starting point.

* Update docs/content/doc/advanced/ci-cd.en-us.md

Improve text

Co-Authored-By: Lauris BH <[email protected]>

* Improve link to CI solutions

Update docs/content/doc/advanced/ci-cd.en-us.md

Co-Authored-By: Lauris BH <[email protected]>

* Update docs/content/doc/advanced/ci-cd.en-us.md

Typo in name :/

Co-Authored-By: John Olheiser <[email protected]>

* Remove redundant empty line

* Invite user to consult new CI/CD page

* Link target CI tools

* Jenkins and its plugin

* Update docs/content/doc/advanced/third-party-tools.en-us.md

Simplify link CI/CD

Co-Authored-By: John Olheiser <[email protected]>

* Update docs/content/doc/advanced/ci-cd.en-us.md

Typo

Co-Authored-By: John Olheiser <[email protected]>

* Provide gitea documentation about drone usage

    Co-Authored-By: John Olheiser <[email protected]>

* Update docs/content/doc/advanced/ci-cd.en-us.md

Co-Authored-By: Lauris BH <[email protected]>

* Apply suggestions from code review

Co-Authored-By: Lauris BH <[email protected]>
2019-08-29 17:30:12 -04:00
Gary KimandLauris BH e48b7cd3a0 Add Ability for User to Customize Email Notification Frequency (#7813)
* Add Backend Logic for Toggling Email Notification

This commit adds the backend logic for
allowing users to enable or disable email
notifications. The implementation ensures
that only issue notification emails get disabled
and important emails are still sent regardless
of the setting.

The UI to toggle this setting has not yet been
implemented.

* Add UI and complete user email notification enable

This commit completes the functionality to allow
users to disable their own email notifications.

Signed-off-by: Gary Kim <[email protected]>

* Add Third Option for Only Email on Mention

Signed-off-by: Gary Kim <[email protected]>

* Readd NOT NULL to new preference string

Signed-off-by: Gary Kim <[email protected]>

* Add Tests and Rewrite Comment

Signed-off-by: Gary Kim <[email protected]>

* Allow admin to set default email frequency

Signed-off-by: Gary Kim <[email protected]>

* Add new config option to docs

Signed-off-by: Gary Kim <[email protected]>

* Fix a few mistakes

Signed-off-by: Gary Kim <[email protected]>

* Only update required columns

Signed-off-by: Gary Kim <[email protected]>

* Simplify an error check

Signed-off-by: Gary Kim <[email protected]>

* Make email_notification_preference column in DB be VARCHAR(20)

Signed-off-by: Gary Kim <[email protected]>

* Handle errors

Signed-off-by: Gary Kim <[email protected]>

* Update models/migrations/v93.go

Co-Authored-By: Lauris BH <[email protected]>
2019-08-29 17:05:42 +03:00
David Svantesson 1a656b9fed Include description in repository search. (#7942)
* Add description in repository search.

Signed-off-by: David Svantesson <[email protected]>

* Refactor SearchRepositoryByName with a general function SearchRepository

Signed-off-by: David Svantesson <[email protected]>

* Allow to specify if description shall be included in API repo search.

Signed-off-by: David Svantesson <[email protected]>

* Add new app.ini setting for whether to search within repo description.

Signed-off-by: David Svantesson <[email protected]>

* Search keyword in description (if setting enabled) on:
 - Explore page
 - Organization profile page
 - User profile page
 - Admin repo page

Do not search keyword in description on:
 - Any non-keyword search (not relevant)
 - Incremental search (uses API)

Signed-off-by: David Svantesson <[email protected]>

* Put parameters related to keyword directly after it

Signed-off-by: David Svantesson <[email protected]>

* Add test cases for including (and not including) repository description in search.

Signed-off-by: David Svantesson <[email protected]>

* Rename test function from TestSearchRepositoryByName to TestSearchRepository.

Signed-off-by: David Svantesson <[email protected]>

* Make setting SEARCH_REPO_DESCRIPTION default to true

Signed-off-by: David Svantesson <[email protected]>
2019-08-25 20:06:36 +03:00
guillep2k 55f7398067 Add support for DEFAULT_ORG_MEMBER_VISIBLE (#7669)
* Add support for DEFAULT_ORG_MEMBER_VISIBLE

* Correct formatting

* Improved description in cheat sheet.

* Add test for DefaultOrgMemberVisible

* Remove dead code
2019-08-24 15:28:59 +03:00
Lunny Xiao 45a3009bc7 Move database settings from models to setting (#7806)
* move database settings from models to setting

* update docs

* fix checkout pr

* fix tests

* fix lint

* remove unsupported tidb options

* correct wrong variable name

* remove tidb totally
2019-08-24 11:24:45 +02:00
Lunny Xiao 5bb5b714e2 Display ui time with customize time location (#7792)
* display ui time with customize time location

* fix lint

* rename UILocation to DefaultUILocation

* move time related functions to modules/timeutil

* fix tests

* fix tests

* fix build

* fix swagger
2019-08-15 22:46:21 +08:00
Antoine GIRARD 3232885571 Import topics during migration (#7851)
* add GetTopics interface

* CreateTopics

* remove un-needed comment
2019-08-14 14:16:12 +08:00
Antoine GIRARD 98d0b035d6 add details for db socket listening (#7830) 2019-08-12 17:52:11 -04:00
Mason b52d392fd7 Add SSH_LISTEN_HOST to the config cheatsheet (#7793)
This was missing before, and this commit adds it with the correct
default value and description
2019-08-08 18:40:31 +03:00
guillep2k 8204be3f8a Correct formatting of bullet list (#7794) 2019-08-08 07:47:57 +03:00
Tamal Saha 32a74d6276 Support setting cookie domain (#6288)
Signed-off-by: Tamal Saha <[email protected]>
2019-07-12 09:57:31 -04:00
Sandro Santilli 9aae5ee0b0 Add section about customizing mail (#7419)
See https://github.com/go-gitea/gitea/issues/6037
2019-07-11 01:27:57 -04:00
Mura Li 78fa8ea726 Support git.PATH entry in app.ini (#6772) 2019-07-07 03:26:56 -04:00
EpicCoder f1fb43be9d Add additional password hash algorithms (closes #5859) (#6023) 2019-07-07 02:01:01 -04:00
Lunny Xiao 51dc2b2ddb Use vendors when go generate (#7340)
* use vendors when go generate

* update docs about golang minimal requirement from 1.9 to 1.11

* fix build
2019-07-06 23:00:41 -04:00
AJ ONeal 09cc502d65 Make captcha and password optional for external accounts (#6606) 2019-07-06 15:48:02 -04:00
silverwind e66970aebe add 'npm' and 'npm-update' make targets and lockfile (#7246)
* add 'npm' and 'npm-update' make targets and lockfile

- `make npm` installs and updates node_modules, triggered automatically
   on `make css` and `make js` as it completes reasonably fast and
   ensures consistent modules.
- `make npm-update` updates all dependencies to their latest version,
   regenerates `node_modules` from scratch and updates
   `package-lock.json`. It uses npm modules `updates` written by yours
   truly to find the latest version of each dependency.

* add suggested make dependencies

* remove package-lock.json during npm-update

* regenerate package-lock.json
2019-06-18 22:59:47 -04:00
Antoine GIRARD 74a6d2ba6c Fix relref link in docs (#7233) 2019-06-17 22:57:48 -04:00
techknowlogick 1f4a94b37d Add docs for INTERNAL_TOKEN_URI (#7234) 2019-06-17 22:52:03 -04:00
Mario Lubenkaandzeripath bc1325f173 Repository avatar fallback configuration (#7087)
* Only show repository avatar in list when one was selected

Signed-off-by: Mario Lubenka <[email protected]>

* Adds fallback configuration option for repository avatar

Signed-off-by: Mario Lubenka <[email protected]>

* Implements repository avatar fallback

Signed-off-by: Mario Lubenka <[email protected]>

* Adds admin task for deleting generated repository avatars

Signed-off-by: Mario Lubenka <[email protected]>

* Solve linting issues

Signed-off-by: Mario Lubenka <[email protected]>

* Save avatar before updating database

* Linting

* Update models/repo.go

Co-Authored-By: zeripath <[email protected]>
2019-06-02 14:40:12 +08:00
zeripath d3be7ffa3d Move serv hook functionality & drop GitLogger (#6993)
* Move hook functionality internally

* Internalise serv logic

* Remove old internal paths

* finally remove the gitlogger

* Disallow push on archived repositories

* fix lint error

* Update modules/private/key.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Updated routers/private/serv.go

* Fix LFS Locks over SSH

* rev-list needs to be run by the hook process

* fixup

* Improve git test

* Ensure that the lfs files are created with a different prefix

* Reduce the replication in git_test.go

* slight refactor

* Remove unnecessary "/"

* Restore ensureAnonymousClone

* Restore ensureAnonymousClone

* Run rev-list on server side

* Try passing in the alternative directories instead

* Mark test as skipped

* Improve git test

* Ensure that the lfs files are created with a different prefix
* Reduce the replication in git_test.go
* Remove unnecessary "/"
2019-06-01 23:00:21 +08:00
Sergey Dryabzhinsky 001aa9cffc Repository avatars (#6986)
* Repository avatars

- first variant of code from old work for gogs
- add migration 87
- add new option in app.ini
- add en-US locale string
- add new class in repository.less

* Add changed index.css, remove unused template name

* Update en-us doc about configuration options

* Add comments to new functions, add new option to docker app.ini

* Add comment for lint

* Remove variable, not needed

* Fix formatting

* Update swagger api template

* Check if avatar exists

* Fix avatar link/path checks

* Typo

* TEXT column can't have a default value

* Fixes:

- remove old avatar file on upload
- use ID in name of avatar file - users may upload same files
- add simple tests

* Fix fmt check

* Generate PNG instead of "static" GIF

* More informative comment

* Fix error message

* Update avatar upload checks:

- add file size check
- add new option
- update config docs
- add new string to en-us locale

* Fixes:

- use FileHEader field for check file size
- add new test - upload big image

* Fix formatting

* Update comments

* Update log message

* Removed wrong style - not needed

* Use Sync2 to migrate

* Update repos list view

- bigger avatar
- fix html blocks alignment

* A little adjust avatar size

* Use small icons for explore/repo list

* Use new cool avatar preparation func by @lafriks

* Missing changes for new function

* Remove unused import, move imports

* Missed new option definition in app.ini

Add file size check in user/profile avatar upload

* Use smaller field length for Avatar

* Use session to update repo DB data, update DeleteAvatar - use session too

* Fix err variable definition

* As suggested @lafriks - return as soon as possible, code readability
2019-05-29 22:22:26 -04:00
Lunny Xiao 2eb27160b9 when git version >= 2.18, git command could run with git wire protocol version 2 param if enabled (#7047) 2019-05-26 17:50:06 +08:00
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