Compare commits

..

682 Commits

Author SHA1 Message Date
40bbc7320c Add 1.5.0-rc2 changelog (#4488) 2018-07-21 20:06:06 +03:00
5da301bb70 Prevent html entity escaping (#4471) (#4485) 2018-07-20 18:39:40 -04:00
3e191935c8 Fix column droping for MSSQL that need new transaction for that (#4440) (#4484) 2018-07-20 15:27:30 -04:00
8a639ade58 Update xorm to latest version and fix correct user table referencing in sql (#4473) (#4483) 2018-07-20 21:48:15 +03:00
88d791013b add valid for lfs oid (#4461) (#4477) 2018-07-20 19:36:56 +03:00
b37ca4a6ff backport: Redirect to correct page after using scratch token (#4472) 2018-07-19 17:15:12 -04:00
678834883e Fix drone git@next plugin Gitea version display when building tag (#4380) (#4430) 2018-07-12 11:40:50 -04:00
1965eaf96e Disable swagger validation while it is not fixed in upstream (#4423) (#4431) 2018-07-12 19:49:40 +08:00
c784ac53ba Replace src with raw to fix image paths (#4386)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-07-07 00:44:16 +02:00
85f3966338 Fixes repo membership check in API (#4341) (#4379)
Untested, since I can't compile (yet).
2018-07-05 23:34:31 +03:00
f096e69e0a Add default merge options when adding new repository (#4369) (#4373) 2018-07-05 16:12:09 +02:00
768b41adba fix repository last updated time update when delete a user who watched the repo (#4363) (#4371) 2018-07-05 08:46:13 +02:00
155caa8e0a Check that repositories can only be migrated to own user or organizations (#4366) (#4370)
* Repositories can only migrated to own user or organizations

* Add check for organization that user does not belong to

* Allow admin to migrate repositories for other users
2018-07-05 01:18:06 +02:00
280ebcbf7c Update changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 23:24:48 +03:00
100a538622 [skip ci] Updated translations via Crowdin 2018-07-03 20:23:00 +00:00
1c7f951534 Change 1.5.0 RC1 release date in changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 23:21:44 +03:00
a4dfe4b9b1 [skip ci] Updated translations via Crowdin 2018-07-03 19:58:30 +00:00
5f52178421 Change 1.5.0 RC1 release date in changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 22:57:59 +03:00
83e72f17f6 [skip ci] Updated translations via Crowdin 2018-07-03 19:38:06 +00:00
9c6801c8d4 Add changelog for 1.5.0-RC1 (#4324) 2018-07-03 22:37:07 +03:00
bbf9abde49 [skip ci] Updated translations via Crowdin 2018-07-03 03:57:42 +00:00
cbee921c28 Limit uploaded avatar image-size to 4096x3072 by default (#4353) 2018-07-03 06:56:32 +03:00
69796ddd64 [skip ci] Updated translations via Crowdin 2018-07-02 12:43:33 +00:00
3089833167 Update TRANSLATORS (#4349) 2018-07-02 15:42:28 +03:00
f4b7b424c1 [skip ci] Updated translations via Crowdin 2018-07-01 06:03:32 +00:00
547f95417d Add myself as a maintainer (#4345) 2018-07-01 09:02:18 +03:00
e8a17e4558 [skip ci] Updated translations via Crowdin 2018-06-30 17:14:19 +00:00
4ee52b7161 Add scope to Gitlab oauth request (#4330)
Fix #3449
2018-06-30 20:13:17 +03:00
e87c540a87 Backport 1.4.3 changelog to master branch (#4323) 2018-06-27 15:06:39 +08:00
a711d41f54 [skip ci] Updated translations via Crowdin 2018-06-27 05:25:28 +00:00
91ff87c0e5 Fixed violation of the unique constraint for v68 migration (#4297) 2018-06-27 01:23:10 -04:00
a9ffbeb679 [skip ci] Updated translations via Crowdin 2018-06-26 14:46:26 +00:00
801843b011 Fix open redirect vulnerability on login screen (#4312)
* Fix open redirect vulnerability on login screen

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Reorder imports

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replace www. from Domain too

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-06-26 22:45:18 +08:00
b8c2420ae2 [skip ci] Updated translations via Crowdin 2018-06-25 12:13:56 +00:00
aaf6be3ee6 Create api-usage doc page (#4306)
* add api user guides in doc

* update user-guides api page

* fix typo: user guides -> user guide

* move api-usage page under advanced category

* flesh out API usage docs

* Build on work by @tungsheng

* Address issues raised in #4037, #3673, and #4243

* Close #4247

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-25 20:12:46 +08:00
8bb9b67a29 [skip ci] Updated translations via Crowdin 2018-06-24 21:25:00 +00:00
3e6d9b355e Add a basic SMF manifest for SunOS platforms (#4238)
Signed-off-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
2018-06-25 00:24:00 +03:00
3f0d9beece fix exclude files .sha265 to .sha256 (#4304) 2018-06-24 14:10:11 +03:00
a747a5d05f Add gpg-sign step to drone (#4188)
* Add gpg-sign step to drone

* add compressed releases to gpg-sign targets

* Use exclude to simplify file list

drone-plugins/drone-gpgsign#2
2018-06-24 14:40:30 +08:00
212fef0866 Add details about USER_UID and USER_GID environment variables (#4301) 2018-06-23 22:55:48 -04:00
e2721b6190 Remove call to update certs (#4296) 2018-06-21 17:12:56 -04:00
0b3ea42847 hide issues from org private repos w/o team assignment (#4034) 2018-06-21 12:00:13 -04:00
46d19c4676 Fix topics addition (Another solution) (#4031) (#4258)
* Added topics validation, fixed repo topics duplication (#4031)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added tests

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed fmt

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added comments to exported functions

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Deleted RemoveDuplicateTopics function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fixed lint

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added Copyright

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added query solution for duplicates

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed migration query

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Changed RegExp. Fixed migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed test for changed regexp

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Removed validation log messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed validate function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-21 17:09:46 +08:00
9ae7664df7 Fix webhook type conflation. (#4285)
- Fix typo that caused Gogs hooks to be created as Gitea hooks.
- Fix typo that caused Gogs hooks to be duplicated upon edit (though this bug was masked by the previous one).

Signed-off-by: Russell Aunger <rba@live.com>
2018-06-21 07:22:03 +02:00
ac110d1b73 [skip ci] Updated translations via Crowdin 2018-06-20 16:04:23 +00:00
cd29888906 Updated drone config to use the "next" git plugin (#4281) 2018-06-20 19:03:22 +03:00
d84da8fe65 Change parsing of postgresql settings (#4275)
* Change parsing of postgresql settings

Fix #4200

* Add copyright

* update postgresql connection string

* add tests
2018-06-20 08:06:01 +03:00
a93f13849c Fix not removed watches on unallowed repositories (#4201) 2018-06-19 15:44:33 -04:00
467ff4d343 Fix milestone appliance and permission checks (#4271)
* Fix milestone appliance
Fix missing permission check

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix comment

* Add Gitea copyright line
2018-06-19 23:15:11 +08:00
3f2f5752cb [skip ci] Updated translations via Crowdin 2018-06-19 08:51:02 +00:00
8c6b2324a7 Fix missing close tags in U2F (#4256) 2018-06-19 11:48:50 +03:00
69bfd81b1c fix missing data on redirects (#3975) 2018-06-18 14:24:45 -04:00
6e39f3d422 [skip ci] Updated translations via Crowdin 2018-06-18 17:18:22 +00:00
90ad73ae21 Reorganized feature comparison (#4264) 2018-06-18 13:16:53 -04:00
85414d8b75 Show second line by using >= 1 instead of > 1 (#4251)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-06-15 10:07:48 -04:00
3aafa0400e [skip ci] Updated translations via Crowdin 2018-06-15 12:43:56 +00:00
23ba5c870f markup: escape short wiki link (#4091) 2018-06-15 20:42:49 +08:00
c919b07a53 [skip ci] Updated translations via Crowdin 2018-06-15 07:48:26 +00:00
a7aaacb633 fix CreateIssueCommentOption reference (#4239)
* fixes a warning remaining from #4010 and #4220
2018-06-15 15:47:13 +08:00
a75f251195 [skip ci] Updated translations via Crowdin 2018-06-15 03:43:54 +00:00
adba2ad609 fix not respecting landing page setting (#4209)
* fix not respecting landing page setting

* fmt

* add landing page test
2018-06-15 11:42:46 +08:00
6efdcaed86 Fix swagger security parts (#4236) 2018-06-12 19:23:00 -04:00
2b8c0bb5e2 Delete reactions added to issues and comments when deleting repository (#4232) 2018-06-12 13:02:51 -04:00
406031d3cc fix bug when deleting a release (#4207) 2018-06-12 12:44:17 -04:00
908e8942cc Fix swagger errors (#4220)
Fix all the resting errors to have a valid swagger file.

They are still some warnings but nothing blocking.

Doing so I found that some request still misses son parameters for some POST/PUT/PATCH request. This means the a client generated from the swagger file will not work completely. 

Fix #4088 by activating validation in drone
Should fix #4010.
2018-06-12 22:59:22 +08:00
0ba165e2ea Improve wiki content width. (#4195) 2018-06-12 14:27:18 +03:00
0ea18698af [skip ci] Updated translations via Crowdin 2018-06-12 10:36:20 +00:00
7b773bd49f Fixed drone command in readme (#4222)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-12 13:34:56 +03:00
37359aee68 [skip ci] Updated translations via Crowdin 2018-06-11 22:55:33 +00:00
da898d4066 fix delete comment bug (#4216) 2018-06-11 18:54:30 -04:00
508092a248 [skip ci] Updated translations via Crowdin 2018-06-11 07:13:54 +00:00
3da0d437e9 Fixed spelling + clarity (#4213)
Message given when password was too short was incorrectly spelled and was not clear enough.
2018-06-11 03:12:38 -04:00
e3b77f92c1 [skip ci] Updated translations via Crowdin 2018-06-10 18:43:21 +00:00
2bb73fe12c HTML-escape text READMEs (#4192) 2018-06-10 21:42:16 +03:00
af57d6ab8a undo #3142 because processes don't use the util.Timestamp (#4203) 2018-06-10 09:48:45 +08:00
f54626df0b Add config path as an optional flag when changing pass via CLI (#4184) 2018-06-09 18:35:14 -04:00
9033eaeec1 Only show "You cannot fork a repository you own" when needed (#4130) 2018-06-09 16:51:10 -04:00
ef0bc57ae7 [skip ci] Updated translations via Crowdin 2018-06-09 19:16:38 +00:00
47f59589c5 Update backup and restore doc usage (#4165)
Edit example of `./gitea dump` to include -c option to pass app.ini

Signed-off-by: Jesse Lucas <jesse@jesselucas.com>
2018-06-09 15:16:16 -04:00
048468560f Add security advice to contrib guide (#4187)
* Improve contributing guidelines for security
2018-06-09 12:03:23 -04:00
8786c15221 [skip ci] Updated translations via Crowdin 2018-06-09 00:14:00 +00:00
512678a5a3 Move Screenshots to Bottom (#4128)
The 'above the fold' space is very important, it seems possibly wasted with screenshots which aren't legible without enlarging.

This is a proposal to move them down.
2018-06-08 20:13:41 -04:00
ed51aa9c92 improve backup document and add zh-cn backup document (#4145) 2018-06-08 19:47:51 -04:00
d41084c54a [skip ci] Updated translations via Crowdin 2018-06-08 18:10:06 +00:00
b5f61f1d15 Improve logging for e-mail and OpenID already in use errors (#4174) 2018-06-08 14:09:10 -04:00
3fbba2553a [skip ci] Updated translations via Crowdin 2018-06-08 01:24:38 +00:00
c9c5d164d5 Add myself as a maintainer (#4172) 2018-06-08 09:23:39 +08:00
a89d6253e0 Show only needed values in database configuration section depending on type (#4164) 2018-06-06 18:13:42 -05:00
e5fd43c231 [skip ci] Updated translations via Crowdin 2018-06-06 14:04:02 +00:00
83d956ce6b Fix typo (#4151)
Fix incorrect tmpl in oauth when we have a custom authorize url. The tmpl will append an additional character "v" every time we save the settings.
2018-06-06 22:02:37 +08:00
fa3ceb610d Fix link in HTTPS doc (#4135) 2018-06-05 17:36:15 +03:00
25b1a8099b [skip ci] Updated translations via Crowdin 2018-06-05 13:26:26 +00:00
1a6c97be9c update debian binary information (#4132) 2018-06-05 09:24:52 -04:00
2fcd9b69b7 [skip ci] Updated translations via Crowdin 2018-06-05 07:39:40 +00:00
1aee261aae More detailed documentation on how to set up from binary (#4121)
* More detailed documentation on how to set up from binary
Also change recommended file locations
2018-06-04 22:02:04 -04:00
6400d8a3cb 1.4.2 changelog (#4124) 2018-06-05 03:56:29 +03:00
0b718535b6 Add pronunciation to README.md (#4123) 2018-06-04 20:15:32 -04:00
b9be49cd96 Minor 'Installation with Docker' docs page fix (#4122) 2018-06-05 02:08:56 +03:00
809babb562 Update comparison.en-us.md with RhodeCode Community edition (#4112)
Added RhodeCode Community edition into comparison page
2018-06-04 15:01:35 -04:00
1bcabb8b1e Removed unnecessary line referencing LFS struct (#4113)
https://github.com/go-gitea/gitea/pull/4035#issuecomment-394286204

@ohwgiles points out that the config section should, in fact, still be in accordance with the "server" struct, which contains the "LFS" struct. I should just remove the line
```
sec = Cfg.Section("LFS")
```
2018-06-04 21:07:42 +03:00
d62bc3362b [skip ci] Updated translations via Crowdin 2018-06-04 05:35:46 +00:00
1f877f8c87 Add tag check to release draft creation (#3729) 2018-06-04 08:34:44 +03:00
fb1daad13d Add how-to for enabling HTTPS (#4101)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-06-03 09:55:23 +08:00
da466b0505 [skip ci] Updated translations via Crowdin 2018-06-03 01:15:41 +00:00
85b7fd1e61 Remove dupelicate link (#4100) 2018-06-03 09:14:37 +08:00
7893e5939a Update gitgraph.js to fix "Cannot read property color of undefined" (#4095)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-02 18:54:40 +03:00
9a1772b0fa [skip ci] Updated translations via Crowdin 2018-06-02 15:21:24 +00:00
a5f63fc4d1 swagger: add 'required: true' for params in URL (#4097)
* Partial fix for #4010

Swagger validation needs 'required: true' for parameters that are in
the URL path.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-02 18:20:28 +03:00
b8c1dc55b4 [skip ci] Updated translations via Crowdin 2018-06-02 11:30:08 +00:00
28fb255d91 Add make command to validate swagger file (#4096)
Partial fix for #4088
2018-06-02 14:29:12 +03:00
0549762fd0 [skip ci] Updated translations via Crowdin 2018-06-01 05:52:46 +00:00
39f2aa7c12 add simple descriptions for file API responses (#4089)
* Partial fix for #4010

Swagger needs a description field in each swagger:operation response.  Adding
minimal text for now on the way to getting swagger validate to pass.  Many
standard swagger client libraries will not work with gitea until validate
passes, so prioritizing that over better descriptions for now.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-01 13:51:49 +08:00
7707ad7a0a add simple descriptions for swagger validate (#4087)
* Partial fix for #4010

Swagger needs a comment line above each swagger:response comment -- it
uses these to populate the description: fields.  Adding minimal text
for now on the way to getting swagger validate to pass.  Many standard
swagger client libraries will not work at all with gitea until validate
passes, so prioritizing that over better descriptions for now.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-05-31 19:13:55 +08:00
728cc27284 Update Contribution docs with non-404 link (#4077) 2018-05-30 18:06:57 -04:00
af05212bf8 [skip ci] Updated translations via Crowdin 2018-05-30 13:25:15 +00:00
35c3510335 Fix #4081 Check for leading / in base before removing it (#4082) 2018-05-30 21:23:43 +08:00
15f6ec9632 LFS: make HTTP auth period configurable (#4035)
* LFS: make HTTP auth period configurable

* Formatting: Removed semicolon

Due to automated fmt-check failure (drone.gitea.io)

* applying code reviews

* Applied code review comment: Change HTTPAuthExpiry to time.Duration

* Updated config cheat sheet
2018-05-29 16:07:16 +08:00
832ca509d3 Remove autolink.js references (#4072)
* Autolink.js no longer used

Fixes #4069

* Remove autolink.js references

* Fix reference to u2f js
2018-05-29 13:54:15 +08:00
2139c152cb Fix relative markdown links with anchors (#4058)
* Replace '%28' with '#'
Add test case

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Use ResolveReference instead of strings.Replace

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-05-28 23:51:42 -04:00
f86f56e19c Added deletion of an empty line at the end of the file (#4050) (#4054)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-05-29 11:08:55 +08:00
9aa8fdc5d7 [skip ci] Updated translations via Crowdin 2018-05-29 00:26:42 +00:00
dc789ad7db Fix drone CLI install link (#4071)
Fixes #4070
2018-05-29 08:25:13 +08:00
5c95f7c7ce fix attachment ENABLED (#4064)
* fix attachment ENABLED

* change wrong name on app.ini.sample
2018-05-28 22:56:54 +08:00
fd274ffcd9 Fix wiki redirects (#3919)
When creating or editing a wiki page, the redirect to the wiki page does
not work because the file name is used instead of the page name.
2018-05-28 09:38:20 -04:00
0be2b34cec update git vendor (#4059) 2018-05-27 21:47:34 +03:00
b6604505e7 Update drone test instructions in CONTRIBUTING.md (#4055) 2018-05-27 13:01:02 -04:00
5095dfaed6 [skip ci] Updated translations via Crowdin 2018-05-27 10:49:19 +00:00
2986e942ee Mac OS X -> macOS (#4056) 2018-05-27 18:47:58 +08:00
2eabf18c9b add api section to config cheat sheet (#4037) 2018-05-24 16:36:45 -04:00
2a9799493a Make home.tmpl visible with Signin-View enabled (#4040)
Fix #3846
2018-05-24 15:51:28 -04:00
8ebd15e6a6 fix add a Ukrainian language (#4036) (#4042) 2018-05-24 15:35:46 -04:00
69e82c1761 [skip ci] Updated translations via Crowdin 2018-05-24 18:08:15 +00:00
3b35c6e47c add i18n section in config cheat sheet, reordered app.ini.sample (#4038)
* add i18n section in config cheat sheet, reordered app.ini.sample

* fix wrong default config
2018-05-24 14:07:02 -04:00
062111de3b [skip ci] Updated translations via Crowdin 2018-05-24 15:30:53 +00:00
e225b5c512 add a Ukrainian language (#4036) 2018-05-24 23:29:33 +08:00
81241b9380 [skip ci] Updated translations via Crowdin 2018-05-24 14:30:48 +00:00
3623f12a28 fix writer cannot read bare repo guide (#4033) 2018-05-24 22:28:53 +08:00
11da1e6146 [skip ci] Updated translations via Crowdin 2018-05-24 05:00:07 +00:00
cdb9478774 LDAP Public SSH Keys synchronization (#1844)
* Add LDAP Key Synchronization feature

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Add migration: add login source id column for public_key table

* Only update keys if needed

* Add function to only list pubkey synchronized from ldap

* Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it.

* Only get keys belonging to current login source id

* Set default login source id to 0

* Some minor cleanup. Add integration tests (updete dep testify)
2018-05-24 07:59:02 +03:00
b908ac9fab Added repository search ordered by stars or forks. Forks column in admin repo list. (#3969)
* Added repository search order by stars or forks.
Added Forks column to admin repository list.

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed search repo template

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-05-24 09:03:42 +08:00
ea2a938e8a [skip ci] Updated translations via Crowdin 2018-05-24 00:25:30 +00:00
48797e7199 Gitea with Caddy with sub-path documentation. (#4028)
Matches rest of headings
2018-05-24 08:24:04 +08:00
4ba9745cee [skip ci] Updated translations via Crowdin 2018-05-23 15:33:10 +00:00
b299d7bceb Add Environment Variables to Docker template (#4012)
* Add disable registration as an environment variable

for docker

* Add REQUIRE_SIGNIN_VIEW as env var to docker

* Add variables to template

* Update docker docs
2018-05-23 23:31:12 +08:00
60d95a0b85 fix bugs caused by #3929 (#3999) 2018-05-23 15:23:23 +08:00
71a8fe3e7c [skip ci] Updated translations via Crowdin 2018-05-23 06:13:29 +00:00
4ec8551490 fix webhook bug of response info is not displayed in UI (#4000) 2018-05-23 14:12:02 +08:00
a2f0c57584 [skip ci] Updated translations via Crowdin 2018-05-23 05:22:18 +00:00
416ded5f3e Add documentation for reverse proxies (#4022)
Fixes #3904
2018-05-23 13:21:17 +08:00
2c4b54dccc [skip ci] Updated translations via Crowdin 2018-05-22 23:10:02 +00:00
6f31911497 Add $GOPATH/bin to PATH for make releases (#4020)
Needed to access go tool gxz
2018-05-22 12:12:10 -04:00
45f3d4a719 [skip ci] Updated translations via Crowdin 2018-05-22 05:34:25 +00:00
dd3d78ffed Fix support channels (#4014)
Now matches navigation on Gitea website
2018-05-22 08:34:02 +03:00
b3a3024f03 doc: update LOCAL_ROOT_URL description for PROTOCOL = 'unix' case (#3760)
Update the sample configuration and config cheat sheet description for
the LOCAL_ROOT_URL configuration variable to mention the special case
required if PROTOCOL is set to 'unix'.

Fixes #3741.

Signed-off-by: Timothée Ravier <tim@siosm.fr>
2018-05-22 09:35:36 +08:00
d97bb9516c [skip ci] Updated translations via Crowdin 2018-05-21 23:10:17 +00:00
ee878e3951 Support secure cookie for csrf-token (#3839)
* dep: Update github.com/go-macaron/csrf

Update github.com/go-macaron/csrf with dep to revision 503617c6b372
to fix issue of csrf-token security.

This update includes following commits:
- Add support for the Cookie HttpOnly flag
- Support secure mode for csrf cookie

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>

* routers: set csrf-token security depending on COOKIE_SECURE

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>
2018-05-22 02:09:48 +03:00
31067c0a89 remove collaborative repositories from search on user profiles (#3996)
* remove collaborative repositories from search on user profiles

* rename 'My Repositories' to 'Repositories'
2018-05-21 23:07:34 +03:00
08c9617caa Provide compressed releases (#3991)
* Add release-compress to provide compressed releases

* check after compress
2018-05-21 14:50:39 -04:00
75982127c8 [doc] Update vendor tool section to dep (#4008) 2018-05-21 14:10:35 -04:00
b2bf1c9422 [skip ci] Updated translations via Crowdin 2018-05-21 17:24:25 +00:00
74e05e60ca Fix typo in U2F description (#4007) 2018-05-21 13:15:25 -04:00
d94472e89b fix #4003 (#4004)
Webhook and hook_task not cleaned up when delete repository
2018-05-21 21:30:30 +08:00
2690542adb [skip ci] Updated translations via Crowdin 2018-05-21 12:35:56 +00:00
3f3383dc0a Migrate to dep (#3972)
* Update makefile to use dep

* Migrate to dep

* Fix some deps

* Try to find a better version for golang.org/x/net

* Try to find a better version for golang.org/x/oauth2
2018-05-21 15:34:20 +03:00
d7fd9bf7bb [skip ci] Updated translations via Crowdin 2018-05-21 02:29:30 +00:00
6bdc556b7f Fix some webhooks bugs (#3981)
* fix some webhooks bugs

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix test

* fix clearlabels

* fix pullrequest webhook bug fix #3492

* update release webhook description

* remove unused code

* fix push webhook in pull request

* small changes
2018-05-21 10:28:29 +08:00
dc0ef38950 [skip ci] Updated translations via Crowdin 2018-05-21 01:06:08 +00:00
1ef98a6eaa Added doc for 'IMPORT_LOCAL_PATHS' (#3997) 2018-05-21 09:04:41 +08:00
d7cf7393d4 [skip ci] Updated translations via Crowdin 2018-05-20 10:10:05 +00:00
edc78b9633 Update to last common x/text (#3994) 2018-05-20 18:09:00 +08:00
000b2d33a9 [skip ci] Updated translations via Crowdin 2018-05-20 06:10:47 +00:00
8dca5ad526 Fetch missing file in github.com/davecgh/go-spew/spew (#3995) 2018-05-20 09:09:35 +03:00
81b4d38f01 [skip ci] Updated translations via Crowdin 2018-05-19 14:58:24 +00:00
c7a4317231 Update TRANSLATORS (#3933)
* Update TRANSLATORS

* Update TRANSLATORS

* Update TRANSLATORS

* Move to correct position so that list stays in alphabetical order
2018-05-19 22:57:32 +08:00
01835a4206 [skip ci] Updated translations via Crowdin 2018-05-19 14:13:44 +00:00
951309f76a Add support for FIDO U2F (#3971)
* Add support for U2F

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add vendor library
Add missing translations

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Minor improvements

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library
Add U2F error handling

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F login page to OAuth

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Move U2F user settings to a separate file

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit tests for u2f model
Renamed u2f table name

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix problems caused by refactoring

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F documentation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Remove not needed console.log-s

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add default values to app.ini.sample
Add FIDO U2F to comparison

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-05-19 17:12:37 +03:00
f933bcdfee [skip ci] Updated translations via Crowdin 2018-05-19 13:23:21 +00:00
44754774f1 Re-enable random avatar feature (#3988)
* reenable random avatar feature

* replace Size check by Filename check
2018-05-19 21:22:09 +08:00
917b9641ec Update to last common bleve (#3986) 2018-05-19 20:49:46 +08:00
1b7cd3d0b0 [skip ci] Updated translations via Crowdin 2018-05-19 01:03:22 +00:00
0857e289d5 fix links to prevent 404 after e.g. submitting a faulty form (#3982) 2018-05-18 21:02:04 -04:00
b574af27b8 [skip ci] Updated translations via Crowdin 2018-05-18 09:18:02 +00:00
0fa07ccf99 Added docs for configuring fail2ban (#3949) 2018-05-18 17:16:30 +08:00
2aabfc1afa Splitted the user settings code into several files to be more maintainable (#3968)
* refactor setting router code

splitted up one huge router settings file into the smaller files
representing the actual page structure

* move code to subfolder

* rename functions

* renamed files

* add copyright information
2018-05-17 12:05:00 +08:00
8f4d11af0b [skip ci] Updated translations via Crowdin 2018-05-17 01:36:23 +00:00
8176345c0e Add cli commands to regen hooks & keys (#3979)
* Add cli commands to regen hooks & keys

* make fmt

* Allow passing path to config as an option

* add docs
2018-05-17 09:35:07 +08:00
ecfc401eaa Allow Gitea to run as different USER in Docker (#3961)
* If using a different $USER then rename git user

* Chown based on $USER env

* Target only one part of passwd

* su-exec based on $USER

not a hardcoded value
2018-05-16 23:58:44 +08:00
4ceb92f311 [skip ci] Updated translations via Crowdin 2018-05-16 14:26:58 +00:00
80d1998981 add missing token validation and fix missing alert on application settings page (#3976) 2018-05-16 22:18:13 +08:00
d79829fc47 [skip ci] Updated translations via Crowdin 2018-05-16 14:03:37 +00:00
24941a1046 Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* load attributes when created release

* update comparsion doc
2018-05-16 22:01:55 +08:00
188fe6c301 [skip ci] Updated translations via Crowdin 2018-05-15 14:16:11 +00:00
e45331d6d2 add user language value to hidden input to enable saving of profile without changing language (#3967) 2018-05-15 17:14:40 +03:00
d3dce01cf7 [skip ci] Updated translations via Crowdin 2018-05-15 10:08:59 +00:00
099372d76c Refactor User Settings (#3900)
* moved avatar to profile page

* combined password change, email and account deletion into account settings page

* combined totp, access tokens, linked accounts and openid into security settings page

* move access tokens to applications settings page

* small change to restart drone build

* fix change avatar url on profile page

* redirect old settings urls to new ones

* enforce only one autofocus attribute on settings pages

* set correct redirect status code

* fmt fix
2018-05-15 13:07:32 +03:00
1546458f7d issue-2768: added new option allow_only_external_registration (#3910) 2018-05-13 15:51:16 +08:00
e74055878f Update xormstore dependency to fix OAuth2 support for MySQL (#3955) 2018-05-13 13:10:50 +08:00
2c34ef5d97 [skip ci] Updated translations via Crowdin 2018-05-13 01:51:56 +00:00
f6828e0b66 Fix blank topic on explore repo list (#3956) 2018-05-13 09:50:39 +08:00
c14870c5ac fix blank topic (#3948) 2018-05-11 16:15:18 +08:00
bc8400747a [skip ci] Updated translations via Crowdin 2018-05-11 07:56:33 +00:00
ff3971b830 Add LDAP integration tests (#3897)
* Add LDAP service for tests

* Add LDAP login source and test user sign-in

* Add checks to test if user data is correct

* Add LDAP user sync test

* Add failed user sign-in test
2018-05-11 15:55:32 +08:00
aafb0ea1c6 Activating Open Collective (#3821)
* Added backers and sponsors on the README

* Added call to donate after npm install (optional)

* Remove npm changes

* Update readme to leave only needed sections
2018-05-11 13:53:23 +08:00
20acbdfe03 Remove another mention of matrix (#3947) 2018-05-11 13:18:34 +08:00
91b3615219 Adjust z-index for floating labels (#3939) 2018-05-11 11:28:26 +08:00
253a2d636b [skip ci] Updated translations via Crowdin 2018-05-11 02:32:27 +00:00
8c7e632a3d remove build tag information for redis and memcache (#3940) 2018-05-11 10:31:33 +08:00
e5f7f7dbc7 [skip ci] Updated translations via Crowdin 2018-05-11 01:44:55 +00:00
54c73bdaf0 Fix comments in config1 (#3946)
* Fix some comments in custom/conf/app.ini.sample

Some comments in app.ini.sample were very vague, didn't contain much information.
Some of them have been fixed, but mistakes that need to be fixed by an expert still remain, see #3928

Signed-off-by: Mikolaj Holysz <miki123211@gmail.com>

* Add an additional comment pointing to more documentation.

Add an additional comment to the top of the sample configuration file.
It contains a link pointing to gitea's docs and the configcheat sheet, which contains
some explanations about the parameters in the config.

Signed-off-by: Mikolaj Holysz <miki123211@gmail.com>
2018-05-11 09:43:46 +08:00
4dc43b37be [skip ci] Updated translations via Crowdin 2018-05-11 00:43:53 +00:00
87ebaa97ee Add documentation in regards to issues/pull request templates (#3942)
* Add documentation in regards to issues/pull request templates

Fixes #3491

* update per suggestion to use list
2018-05-11 08:42:22 +08:00
6be7387ffb Fix release tag on README (#3945) 2018-05-10 23:38:57 +03:00
15d0ac7ed4 [skip ci] Updated translations via Crowdin 2018-05-10 15:46:04 +00:00
14ff2f840e Discord is the official channel - update README (#3943)
Matrix (and IRC) bridge drop too many messages which frustrate new user.
Let's only promote the official communication tool.
2018-05-10 17:43:52 +02:00
4607e1ac3d [skip ci] Updated translations via Crowdin 2018-05-10 12:55:00 +00:00
2431fc71da update multiple assignes feature in comparison (#3938) 2018-05-10 20:53:32 +08:00
0e0036106f [skip ci] Updated translations via Crowdin 2018-05-10 08:33:20 +00:00
af62ec5cc0 Note about adding permisions to binary (#3936)
in regards to binding to lower ports than 1024
2018-05-10 16:32:01 +08:00
2efdb0907c [skip ci] Updated translations via Crowdin 2018-05-10 07:00:07 +00:00
32deee9e52 Fix #3828 (#3935) 2018-05-10 14:58:49 +08:00
abff697f31 Update less.js to latest version (#3932) 2018-05-10 13:36:47 +08:00
60424b7bad Fixed issue deadline not showing on issue page (#3930) 2018-05-10 07:05:12 +03:00
ce791454cb [skip ci] Updated translations via Crowdin 2018-05-10 01:19:03 +00:00
382e7276b8 Fix multiple asssingee table migration (#3931) 2018-05-10 09:18:01 +08:00
95f2e2b57b Multiple assignees (#3705) 2018-05-09 19:29:04 +03:00
238a997ec0 [skip ci] Updated translations via Crowdin 2018-05-09 14:54:02 +00:00
14f16d6c2e snap-packaging for gitea (#2568)
* Modify tbraeutigam/gogs-snap for gitea

* Fix building on 16.04 (manually build go-bindata).
-> add _source.tar.bz2 to .gitignore (used by snapcraft cleanbuild)

* Streamline Snap packaging:
 - Take advantage of install-hooks (snapd 2.27)
 - Use snapctl configuration storage for unchanging values

* Move to using Snap Hooks for configuration

* Missed re-adding daemon statement

* Fix two warnings from Codacy.
2018-05-09 22:52:51 +08:00
02ecc03d6d [skip ci] Updated translations via Crowdin 2018-05-09 09:58:04 +00:00
16b34448d4 Compare git services in docs page (#3911) 2018-05-09 12:57:02 +03:00
139ebf806e [skip ci] Updated translations via Crowdin 2018-05-08 12:42:15 +00:00
b11b3a7a7c Fix English translation grammar and consistency. (#3921) 2018-05-08 15:40:52 +03:00
bb8014885f [skip ci] Updated translations via Crowdin 2018-05-08 06:06:49 +00:00
ea01decb6b fix wrong issue endpoints in swagger doc (#3914) 2018-05-08 14:05:18 +08:00
773530c917 [skip ci] Updated translations via Crowdin 2018-05-07 18:46:25 +00:00
9ae445c28f lock npm packages (#3912) 2018-05-07 21:46:04 +03:00
0b718e0d7b feat: testing in go 1.10 version. (#3899) 2018-05-07 22:49:57 +08:00
eec2179e73 [skip ci] Updated translations via Crowdin 2018-05-07 09:52:15 +00:00
73370b8cf7 consistent IsOverdue field name capitalization (#3909)
Milestone.IsOverDue vs Issue.IsOverdue, the former was also causing the
milestone list page template to fail to render if any milestones have a
due date assigned.

Signed-off-by: Travis J Parker <travis.parker@gmail.com>
2018-05-07 12:50:27 +03:00
e6b0a2db62 [skip ci] Updated translations via Crowdin 2018-05-07 05:09:51 +00:00
3a6f3c8c11 Fix code tab link when viewing tags (#3908)
Signed-off-by: Ambrose Chua <ambrose@chua.family>
2018-05-07 13:08:35 +08:00
04889b7ae5 [skip ci] Updated translations via Crowdin 2018-05-06 21:27:36 +00:00
c6a881e71b Fix placeholder of due date form (#3906) 2018-05-07 00:26:40 +03:00
8685b315a2 [skip ci] Updated translations via Crowdin 2018-05-05 14:31:50 +00:00
501fb228e6 Add option to use paged LDAP search when synchronizing users (#3895) 2018-05-05 17:30:47 +03:00
7467ff3d94 [skip ci] Updated translations via Crowdin 2018-05-05 00:29:34 +00:00
1fdf560678 Added user language setting (#3875)
* Added user language setting

* Added translation string for setting

* Fixed import order + typo

* improved checking if the user has a language saved in the db

* The current saved language is now set a default inside the dropdown

* fmt

* When a user signs in and doesn't have a language saved, the current browser language is saved

* updated gitea-sdk

* Merge branch 'master' of https://github.com/go-gitea/gitea into save-user-language

# Conflicts:
#	models/migrations/migrations.go
#	models/migrations/v62.go

* Made tests work again

* trigger CI

* trigger CI

* fmt

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* When loggin in, only the language col gets updated instead of everything
2018-05-05 08:28:30 +08:00
795dcc8ecf [skip ci] Updated translations via Crowdin 2018-05-04 13:24:58 +00:00
5f4cff6159 Release 1.4.x changelog (#3894) 2018-05-04 21:23:39 +08:00
1e1ece8f3d Do not allow to reuse TOTP passcode (#3878) 2018-05-02 18:02:02 +03:00
c58e1e437b test: reduce testing time. (#3885) 2018-05-02 21:56:19 +08:00
0ca359cdb4 [skip ci] Updated translations via Crowdin 2018-05-02 13:24:19 +00:00
b66d6b3449 Do not allow inactive users to access repositories using private keys (#3887) 2018-05-02 16:22:56 +03:00
9495429982 Add "error" as reserved username (#3882) 2018-05-02 11:06:31 +03:00
954e69f66d [skip ci] Updated translations via Crowdin 2018-05-02 06:11:27 +00:00
5ffdf9388b Fix to use only needed columns from tables to get repository git paths (#3870) 2018-05-02 09:10:19 +03:00
9ec7f6b954 pass secrets to drone build step for docker (#3879) 2018-05-02 00:33:49 +03:00
a98add1974 [skip ci] Updated translations via Crowdin 2018-05-01 19:05:52 +00:00
1a97030017 Issue due date (#3794)
* Started adding deadline to ui

* Implemented basic issue due date managing

* Improved UI for due date managing

* Added at least write access to the repo in order to modify issue due dates

* Ui improvements

* Added issue comments creation when adding/modifying/removing a due date

* Show due date in issue list

* Added api support for issue due dates

* Fixed lint suggestions

* Added deadline to sdk

* Updated css

* Added support for adding/modifiying deadlines for pull requests via api

* Fixed comments not created when updating or removing a deadline

* update sdk (will do properly once go-gitea/go-sdk#103 is merged)

* enhanced updateIssueDeadline

* Removed unnessecary Issue.DeadlineString

* UI improvements

* Small improvments to comment creation
+ ui & validation improvements

* Check if an issue is overdue is now a seperate function

* Updated go-sdk with govendor as it was merged

* Simplified isOverdue method

* removed unessecary deadline to 0 set

* Update swagger definitions

* Added missing return

* Added an explanary comment

* Improved updateIssueDeadline method so it'll only update `deadline_unix`

* Small changes and improvements
* no need to explicitly load the issue when updating a deadline, just use whats already there
* small optimisations

* Added check if a deadline was modified before updating it

* Moved comment creating logic into its own function

* Code cleanup for creating deadline comment

* locale improvement

* When modifying a deadline, the old deadline is saved with the comment

* small improvments to xorm session handling when updating an issue deadline
+ style nitpicks

* style nitpicks

* Moved checking for if the user has write acces to middleware
2018-05-01 22:05:28 +03:00
85d14cc229 Symlink icons (#1416) (#3826)
* Updated vendor code for code.gitea.io/git

* Display symlinks correctly for files and directories

* Added symlink tests

* Applied silverwinds stylesheet patch

Signed-off-by: Tris Forster <tris.git@shoddynet.org>
2018-05-01 10:04:36 +03:00
1928920a08 [skip ci] Updated translations via Crowdin 2018-05-01 01:46:31 +00:00
181b3a8f09 Fix path cleanup in multiple places (#3871) 2018-05-01 09:46:04 +08:00
fff022ef8a [skip ci] Updated translations via Crowdin 2018-04-30 17:55:00 +00:00
3e578b5d29 Fix docs site index page (#3868) 2018-04-30 20:54:38 +03:00
ca4a84a2d6 chore: simplify docker build process. (#2827)
* chore: simplify docker build process.

* chore: update docker plugin.
2018-04-30 03:47:39 +02:00
ff64f188fd Switch back to upstream goth repository and update govendor to latest goth version (#3863) 2018-04-30 09:05:59 +08:00
6f62d4f180 [skip ci] Updated translations via Crowdin 2018-04-29 19:36:12 +00:00
fb8535e305 Make Generate New Token panel shown by default (#3832)
This is mostly a 'feel' change. The behaviour that is currently on the
access tokens pages is, as far as I know, not present in any other parts
of the frontend, and there's no real good reason to keep the 'Generate
New Token' panel hidden by default in my opinion.
2018-04-29 22:34:59 +03:00
7ea4bfc561 API endpoint for testing webhook (#3550)
* API endpoint for testing webhook

* Empty commit to rerun CI
2018-04-29 14:21:33 +08:00
5a62eb30df Store OAuth2 session data in database (#3660)
* Store OAuth2 session data in database

* Rename table to `oauth2_session` and do not skip xormstorage initialization error
2018-04-29 09:09:24 +03:00
8d5f58d834 Shows total tracked time in issue and milestone list (#3341)
* Show total tracked time in issue and milestone list
Show total tracked time at issue page

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Optimizing TotalTimes by using SumInt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fixing wrong total times for milestones caused by a missing JOIN
Adding unit tests for total times

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Logging error instead of ignoring it

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Correcting spelling mistakes

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change error message to a short version

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add error handling to TotalTimes
Add variable for totalTimes

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Introduce TotalTrackedTimes as variable of issue
Load TotalTrackedTimes by loading attributes of IssueList
Load TotalTrackedTimes by loading attributes of single issue
Add Sec2Time as helper to use it in templates

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fixed test + gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Load TotalTrackedTimes via MilestoneList instead of single requests

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix test

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change comment from SQL query to description

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Check if timetracker is enabled

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix test by enabling timetracking

Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-04-29 13:58:47 +08:00
e3028d124f don't reset team/repo count when updating team via API (#3831)
fixes #3600
2018-04-29 13:22:57 +08:00
fc36567ee1 Update blackfriday dependency per #2994 (#3857)
Signed-off-by: PJ Eby <pje@telecommunity.com>
2018-04-29 13:07:36 +08:00
76106ab080 [skip ci] Updated translations via Crowdin 2018-04-29 04:48:36 +00:00
fd8d6405c8 Fix only updated_unix when adding a comment (#3855) 2018-04-29 12:48:14 +08:00
c3f2b8803f [skip ci] Updated translations via Crowdin 2018-04-28 20:46:38 +00:00
5424f75a63 Fix building of docs with latest hugo version (#3856) 2018-04-28 23:46:05 +03:00
fb2f8dcf3c [skip ci] Updated translations via Crowdin 2018-04-23 05:56:09 +00:00
320c9817bc Don't force due date to current time (#3830)
Fixes #3827
2018-04-23 13:55:03 +08:00
bae26421aa [skip ci] Updated translations via Crowdin 2018-04-21 01:23:11 +00:00
48b19a5d14 Explanation for missing releases (#3823)
Searched for missing releases/tags for some time, thought the solution might be helpful to others
2018-04-21 09:22:02 +08:00
725835b5b1 [skip ci] Updated translations via Crowdin 2018-04-20 09:15:19 +00:00
3506717e9c Add swagger check (#3811) 2018-04-20 17:13:50 +08:00
cf8c2e5951 [skip ci] Updated translations via Crowdin 2018-04-20 00:26:45 +00:00
f6013d5098 Some small template fixes (#3820) 2018-04-20 08:25:15 +08:00
bac6d05e78 Improve English grammar and consistency. (#3614)
* Start improving English grammar and consistency.

* Apply review comments, push translation further.

* Additional review changes; expand translation.

* Undo team/organization change, further translation.

* Add site administration; review comments; merge.

* Update hardcoded branch protection string tests.

* Update hardcoded branch deletion string test.

* Update another hardcoded translation string test.

* Add my nickname to the list of translators.

* Implement @lafriks review comments.

* Remove (now) unused branch deletion warnings.

* Remove (now) unused branch deletion warnings.
2018-04-19 17:24:31 +03:00
1d82e775cc [skip ci] Updated translations via Crowdin 2018-04-19 12:31:42 +00:00
7cc96de6cf Fix for UI broke when a repo is starred & watched (#3630) (#3810) 2018-04-19 20:30:11 +08:00
a0ea370c8c [skip ci] Updated translations via Crowdin 2018-04-19 01:10:26 +00:00
f86af9c280 Mention the possibility of resetting the password for new accounts (#3812)
This solves the problem of administrators creating accounts for users
that then do not know their initial password (without the administrator
sending it to them via some other channel).
2018-04-19 09:08:51 +08:00
66d3c541a0 [skip ci] Updated translations via Crowdin 2018-04-17 09:11:59 +00:00
071ca771fd Add opencollective badges on READMEs (#3808) 2018-04-17 17:10:34 +08:00
9add96a872 [skip ci] Updated translations via Crowdin 2018-04-17 00:57:59 +00:00
9f7c4d92c9 Added explanation for docker environment variables to docs (#3804) 2018-04-17 08:56:28 +08:00
b84e165ab4 [skip ci] Updated translations via Crowdin 2018-04-16 05:28:09 +00:00
5ba4ba3957 Fixed 0 closed issues not show 50% closed on activty page (#3802)
Fixes #3656. Also adds a light grey bar when there are both 0 merged
prs/closed issues and 0 open prs/issues.
2018-04-16 08:26:53 +03:00
804bc0aa2f [skip ci] Updated translations via Crowdin 2018-04-16 04:05:22 +00:00
775d487557 Removes extra space from the body and footer to prevent scrolling on a page that fits into the viewport (#3792)
Signed-off-by: Liam Cottam <killtheidols@hotmail.co.uk>
2018-04-16 07:04:36 +03:00
bec69f702b Add topic support (#3711)
* add topic models and unit tests

* fix comments

* fix comment

* add the UI to show or add topics for a repo

* show topics on repositories list

* fix test

* don't show manage topics link when no permission

* use green basic as topic label

* fix topic label color

* remove trace content

* remove debug function
2018-04-11 10:51:44 +08:00
1946ce2954 [skip ci] Updated translations via Crowdin 2018-04-10 12:40:23 +00:00
f321980a32 Fix typo in deleteUser (#3781)
num_watches was used where num_stars should have been used.
2018-04-10 20:39:01 +08:00
38a9cda4bb Remove unnecessary Safe tags (#3778) 2018-04-10 06:43:37 +03:00
8ee45eb614 Add EnableTimetracking option to app settings (#3719) 2018-04-09 23:15:32 +08:00
30c81a126c fix: show Clipboard button if disable HTTP of git protocol (#3773) 2018-04-09 22:49:59 +08:00
daf70d3a4e Use the active branch for the code tab (#3720) 2018-04-09 13:34:19 +03:00
1610296f54 Modify pagination. (#3766)
I wanted navigation to the page "first" and the page
"last" of the pages of commits. I discovered this
has already been implemented in one of the templates.

Signed-off-by: Tan Pheng Heong <phtan90@gmail.com>
2018-04-08 08:54:21 +08:00
7000b41851 [skip ci] Updated translations via Crowdin 2018-04-04 21:09:19 +00:00
ed4935e696 Clarify purpose of ROOT_URL (#3759) 2018-04-05 00:08:55 +03:00
5512ed3699 [skip ci] Updated translations via Crowdin 2018-04-04 12:01:02 +00:00
6b6c414bc3 Enhance healthcheck for database connectivity (#3754)
Modify the call to ping the database to fail gracefully if the
database has not yet been configured by the end user, such as
after a clean install. This allows /healthcheck to return a 200
with a modified status message instead of causing a PANIC.

Signed-off-by: Evan Sherwood <evan@sherwood.io>
2018-04-04 17:34:27 +08:00
3e06490d38 Add Size column to attachment (#3734)
* Add size column to attachment
Migrate attachments by calculating file sizes

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Calculate attachment size on creation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Log error instead of returning error

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-31 09:10:44 +08:00
d877bf7e15 Add config option to enable or disable log executed SQL (#3726)
* add config option to enable or disable log executed SQL

* rename ShowSQL to LogSQL
2018-03-30 22:49:46 +08:00
45d1fc03cb fix go vet error (#3740) 2018-03-30 07:21:27 +08:00
36ea53332d [skip ci] Updated translations via Crowdin 2018-03-29 13:34:02 +00:00
1c5cbc390b refactor: import order. (#3736) 2018-03-29 21:32:40 +08:00
a8beef890d [skip ci] Updated translations via Crowdin 2018-03-29 01:41:06 +00:00
ab5cc6f3a9 Correctly check http git access rights for reverse proxy authorized users (#3721) 2018-03-29 09:39:51 +08:00
4c6e170ceb [skip ci] Updated translations via Crowdin 2018-03-27 14:14:57 +00:00
15c6bb500b Add repository setting to enable/disable health checks (#3607)
New Feature:
  * Repository struct field for IsFsckEnabled (default true of course)
  * Admin Settings section on repo options page, accessible only by
    admin users

Possible Enhancements:
  * There's no way to force running health checks on all repos
    regardless of their IsFsckEnabled setting. This would be useful if
    there were an admin API or dashboard button to run fsck immediately.

Issue: https://github.com/go-gitea/gitea/issues/1712
Signed-off-by: Allen Wild <allenwild93@gmail.com>
2018-03-27 22:13:20 +08:00
321cc2a3d0 Set default branchname on first push (#3715) 2018-03-25 21:00:07 +08:00
cb87f29b76 Update certificates to enable self-signed certs (#3708)
Why:

* We are using self-signed ssl certificates for internal services, which results in failures when gitea tries to communicate through webhooks with these. We would like to enable gitea to be able to use these certificates without having to build custom docker images.

How

* We add the internal certificates to /usr/local/share/ca-certificates on the host
* We read-only mount /usr/local/share/ca-certificates from the host to /usr/local/share/ca-certificates in the container 
* We do a update-ca-certificates in the alpine container before starting gitea

This should have no consequence for users that do not have the need to handle self-signed certificates, as update-ca-certificates should be idempotent.
2018-03-25 13:47:06 +03:00
9350ba7947 Add protected branch whitelists for merging (#3689)
* Add database migrations for merge whitelist

* Add merge whitelist settings for protected branches

* Add checks for merge whitelists
2018-03-25 13:01:32 +03:00
04b7fd87b9 [skip ci] Updated translations via Crowdin 2018-03-23 14:12:13 +00:00
2dc6f15eca Don't warn users about *every* dirty form (#3707)
The choice regarding which forms should or should not trigger a warning
is subjective. I tried to be consistent and not warn about forms that:
 - run an action, rather than edit data: search, send an email.
 - delete data: a warning about losing data would be confusing

Note that forms on sign-in pages were already ignored (using a selector,
rather than an explicit class on the form element).

Fixes #3698.
2018-03-23 22:10:42 +08:00
e64aa18dc9 Change protected branch settings title to existing locale entry (#3694) 2018-03-21 20:12:49 +02:00
05abd03011 [skip ci] Updated translations via Crowdin 2018-03-20 21:40:24 +00:00
4ebdcbc5df Fix style of "In your repositories" when selected (#3699)
Signed-off-by: Alex Ward <alxwrd@googlemail.com>
2018-03-20 23:39:14 +02:00
43fc430c07 Improve release page UI (#3693)
* Improve release page ui by adding size

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add documentation to a.MustSize()

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-19 18:06:00 +02:00
47422c2635 [skip ci] Updated translations via Crowdin 2018-03-19 14:30:44 +00:00
59e70c5ee9 Escape branch name in dropdown menu (#3691)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-19 22:29:16 +08:00
c28bf94252 [skip ci] Updated translations via Crowdin 2018-03-18 01:33:53 +00:00
88aef6eea9 Codesearch message fix (#3684) 2018-03-18 03:32:36 +02:00
86bf3704ea [skip ci] Updated translations via Crowdin 2018-03-17 03:55:24 +00:00
3da0e3c404 Add myself to MAINTAINERS (#3680)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-16 21:49:03 +02:00
1324d62cd3 [skip ci] Updated translations via Crowdin 2018-03-16 14:05:58 +00:00
9e5d0a09eb Global code search support (#3664)
* add global code search on explore

* fix bug when no anyone public repos

* change the icon

* fix typo and add UnitTypeCode check for login non-admin user

* fix ui description when no match
2018-03-16 22:04:33 +08:00
4163cdf3ea [skip ci] Updated translations via Crowdin 2018-03-15 21:14:38 +00:00
7b2b900e13 Refactor and simplify redirect to url (#3674) 2018-03-15 22:13:34 +01:00
a2a49c93c7 Added checks for protected branches in pull requests (#3544)
* Added checks for protected branches in pull requests

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Moved check for protected branch into new function CheckUserAllowedToMerge

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Removed merge conflict lines from last commit

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Explicit check for error type in ViewIssue

Signed-off-by: Christian Wulff <NChris@posteo.net>
2018-03-13 11:46:14 +08:00
c0d41b1b77 Add label descriptions (#3662)
* Add label descriptions

* Add default descriptions to label template
2018-03-13 10:03:55 +08:00
ad33730dca Update markbates/goth libary to fix OAuth2 support (#3661) 2018-03-13 01:35:46 +02:00
575c109a02 [skip ci] Updated translations via Crowdin 2018-03-12 10:00:16 +00:00
0e26db8bcd Docker multi-stage (#2927)
* Setup docker multi-stage and little sugar at it

* Make codacy happy ?

* Revert back to what the official docker documentation suggest

Codacy don't seems to follow https://docs.docker.com/engine/reference/builder/#maintainer-deprecated

* Update golang version
2018-03-12 11:59:13 +02:00
b333e7129d Add separate string for the 'Create Team' button. (#3647)
* Add separate string for the 'Create Team' button.

* Add separate string for the 'Create Team' button.
2018-03-09 19:37:24 +02:00
f0aee3c467 [skip ci] Updated translations via Crowdin 2018-03-09 01:22:23 +00:00
de8a091767 Fix MySQL and PostgreSQL column drop SQL (#3649) 2018-03-09 09:20:57 +08:00
1a83581121 Added issue search via api (#3612)
* Started implementing issue api search

* Implemented issue search via api

* Added search to swagger.json

* Removed todo

* fmt

* Added comment to generate swagger json via "generate-swagger"

* Simplified search

* fmt

* Removed unessecary comment

* Removed unessecary declaration of the issues-variable

* Removed unessecary comment

* Removed unessecary comment

* Added explanation keyword

* Simplified check for empty keyword

* corrected check if keyword is empty
2018-03-07 12:00:56 +02:00
d71f510c62 [skip ci] Updated translations via Crowdin 2018-03-07 06:45:23 +00:00
dc4afef07f Fix column removal in MSSQL (#3638)
* Fix column removal in MSSQL

* Use xorm session in MSSQL drop column operations

* Add transaction as MSSQL alter table is transactional
2018-03-07 14:44:12 +08:00
4009c245a3 Make columns in split view of the same width (#3619)
as well as fix indentation and add 1px border to line counter of the new
code on the right.
2018-03-07 00:44:45 +02:00
9fc418a652 Add string to confirm wiki data erasure (#3629)
* Add a string to confirm wiki data erasure.

* Add a string to confirm wiki data erasure.
2018-03-06 15:25:21 +08:00
9a5e628a7e Add Attachment API (#3478)
* Add Attachment API
* repos/:owner/:repo/releases (add attachments)
* repos/:owner/:repo/releases/:id (add attachments)
* repos/:owner/:repo/releases/:id/attachments
* repos/:owner/:repo/releases/:id/attachments/:attachment_id

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Add unit tests for new attachment functions
Fix comments

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* fix lint

* Update vendor.json

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* remove version of sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix unit tests
Add missing license header

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add CreateReleaseAttachment
Add EditReleaseAttachment
Add DeleteReleaseAttachment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add filename query parameter for choosing another name for an attachment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix order of imports

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Restricting updatable attachment columns

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* gofmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update go-sdk
Replace Attachments with Assets

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Update go-sdk

Signed-off-by: Jonas Franz <info@jonasfranz.de>

* Updating go-sdk and regenerating swagger

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add missing file of go-sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Change origin of code.gitea.io/sdk to code.gitea.io/sdk
Update code.gitea.io/sdk

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update swagger

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Update updateAttachment
2018-03-06 09:22:16 +08:00
69ea5e4385 Fix wiki inter-links with cases and add tests for this case (#3560) 2018-03-05 20:39:12 +02:00
171914e9a7 Log attachment blocked events (#3615)
Include both a log entry and the blocked mime type in the gitea log when
an attachment upload is blocked.

Chosen log level is info; this may need to be dialed down to trace.
2018-03-05 08:51:10 +08:00
19d5192e8c Use Segoe UI for Latin characters before falling back to YaHei (#3616)
* Use Segoe UI for Latin characters before falling back to YaHei

This fixes issues with character rendering on hidpi displays and other
aliasing/hinting issues, as Segoe UI has been painstakingly hinted by
typographers for Microsoft while YaHei has not. See #3237 for more
details.

Closes #3237

* Include transformed LESS -> CSS in commit
2018-03-04 14:47:46 +08:00
7ea7c57406 [skip ci] Updated translations via Crowdin 2018-03-04 02:46:24 +00:00
b730498f02 Don't write to log NoCommitterAccount (#3621)
* Don't write to log NoCommitterAccount

It's way too verbose, and the information is also printed to the user
already. Fixes #3602.

* ignore err only if it's a ErrUserNotExist

* Replace with IsErrUserNotExist
2018-03-04 10:45:01 +08:00
78b54b49fa fix: Add feed for organization (#3594)
* feat: Add feed for organization

* fix: testing

* fix: testing

* fix: testing

* fix: testing
2018-03-03 13:21:16 +08:00
990709da8f [skip ci] Updated translations via Crowdin 2018-03-02 20:32:20 +00:00
595da53d3c Fix incorrect 'Erase Wiki Data' string identifier. (#3613) 2018-03-02 22:31:15 +02:00
f44c31f869 [skip ci] Updated translations via Crowdin 2018-03-02 09:11:11 +00:00
8606d9f5bc Add admin dashboard option to run health checks (#3606)
There's one for git gc, why not git fsck too?

Also add a couple more trace logs to GitFsck to see progress
2018-03-02 11:09:43 +02:00
2cd3622ddc [skip ci] Updated translations via Crowdin 2018-02-27 07:10:26 +00:00
535445c32e Rework special link parsing in the post-processing of markup (#3354)
* Get rid of autolink

* autolink in markdown

* Replace email addresses with mailto links

* better handling of links

* Remove autolink.js from footer

* Refactor entire html.go

* fix some bugs

* Make tests green, move what we can to html_internal_test, various other changes to processor logic

* Make markdown tests work again

This is just a description to allow me to force push in order to restart
the drone build.

* Fix failing markdown tests in routers/api/v1/misc

* Add license headers, log errors, future-proof <body>

* fix formatting
2018-02-27 09:09:18 +02:00
769ab1e424 fix gpg expired bug when time is zero (#3584) 2018-02-26 12:25:45 +02:00
521945a2d2 Fix missing translations when updating username. (#3564)
* Fix missing translations when updating username.

* Fix reserved username translated string test.

* Fix 'username reserved' string test a bit more.
2018-02-25 15:56:25 +02:00
fc265b036f feat: Add branch link in branch list. (#3576) 2018-02-24 23:17:59 +02:00
d2d0aea8a1 Fix the protected branch panic issue (#3567) 2018-02-23 18:10:03 +08:00
2d1c5c3756 Fix remove team member issue (#3566)
Put sess.Commit() out of the RemoveOrgUser function

Add an empty line to separate import packages
2018-02-23 16:42:02 +08:00
19bf4ddf80 Fix query protected branch bug (#3563)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
2018-02-22 20:14:15 -06:00
845ba9d153 fix: if Mirrors repo no content is fetched, updated time should not b… (#3551)
* fix: if Mirrors repo no content is fetched, updated time should not be changed

* fix: sync update time from mirror repo.

* fix: one single session.

* update comment.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-02-22 18:27:09 -06:00
e7cea92535 Update gogs to gitea migration manual (#3559)
Updates the manual for latest gogs changes.
2018-02-22 20:55:26 +08:00
04b3e8cbdc refactor: reduce sql query in retrieveFeeds (#3547) 2018-02-21 18:55:34 +08:00
d27d720f05 Use unique temp dirs in unit tests (#3494)
* Use unique temp dirs in unit tests

* Remove temp dirs after tests run

* os.RemoveAll -> removeAllWithRetry
2018-02-21 01:38:52 -06:00
2f5c1ba1db Bug fix for repo releases sorted (#3522)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>

Use TimeStampNow function
2018-02-21 09:38:03 +08:00
7b104f0cd0 Populate URL field of API commits (#3546)
* Populate URL field of API commits

* fix orgmode_test
2018-02-20 20:50:42 +08:00
7b297808ce Update markbates/goth library (#3533)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-19 07:10:51 +02:00
6f751409b4 Document generate commands (#3532)
* Document generate commands

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>

* Fix examples and grammar

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 21:23:41 -06:00
58893384e8 Add issue closed time column to fix activity closed issues list (#3537)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-19 10:39:26 +08:00
fb2c176491 [skip ci] Updated translations via Crowdin 2018-02-18 21:20:48 +00:00
3a9c698821 Force remove test repo root path in case previous test is still locking it (#3528)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 23:19:40 +02:00
ae30315a62 Fix escaping changed title in comments (#3530)
* Fix escaping changed title in comments

* Fix escaping of wiki page titile

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 22:06:37 +02:00
96c268c0fc Implements generator cli for secrets (#3531)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
2018-02-18 20:14:37 +02:00
e59fe7c8d9 [skip ci] Updated translations via Crowdin 2018-02-18 14:39:52 +00:00
02bc92a5c9 Fix app.ini sample file link in docs (#3529)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 22:38:50 +08:00
b29c358315 [skip ci] Updated translations via Crowdin 2018-02-16 14:03:54 +00:00
9303fc2015 Fix ellipses, 'a[n]' and 'username' (issue #3512). (#3518) 2018-02-16 08:02:40 -06:00
4b48a45bac [skip ci] Updated translations via Crowdin 2018-02-16 01:57:33 +00:00
869d73a25c Add info from #2286, minor fixes to YAML indentation (#3338)
* Add info from #2286, minor fixes to YAML indentation

* Add space to make YAML valid again
2018-02-15 19:56:10 -06:00
b104ab3ca1 Add option to enable or disable swagger endpoints (#3502) 2018-02-14 06:46:00 +02:00
4c9d9c221a Improve wiki test (#3493) 2018-02-13 11:19:49 +02:00
e87c063c90 Add missing licenses (#3497)
Signed-off-by:  Jonas Franz <info@jonasfranz.de>
2018-02-13 07:10:40 +02:00
fbdc00f464 Updating generate-licenses.go to fetch licenses from maintained repository. (#3484)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-02-12 20:20:30 +02:00
2cb4649acf Escape search query (#3486)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-02-11 15:42:28 +02:00
6eaeb01ecf Update code.gitea.io/git (#3482) 2018-02-10 20:19:26 +02:00
58771acacb Add EUPL v1.2 as license (Fixes go-gitea/gitea#3439) (#3475)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-02-09 15:11:19 +02:00
011f128c89 Fixes missing avatars in offline mode (#3471)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
2018-02-08 16:43:08 +01:00
9720f90905 Docs: Fix broken markdown with unescaped character (#3470) 2018-02-07 21:29:42 -06:00
be825aaa88 Clarify Indexer MAX_FILE_SIZE (#3469) 2018-02-07 20:10:36 -06:00
ffd0062438 Fix checklist padding (#3460)
* Changed style of checklist in issuelist.

* Adjusted padding for progressbar, updated index.css.

* Fixed another wrong tab to spaces.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-02-06 12:22:31 +02:00
a2648281a0 Improvements to git integration test (#3466) 2018-02-06 11:27:24 +02:00
a89592d4ab Reduce repo indexer disk usage (#3452) 2018-02-05 20:29:17 +02:00
283e87d814 Fix rendering of wiki page list if wiki repo contains other files (#3454)
* Fix rendering of wiki page list if wiki repo contains other files

* Improve wiki filename tests
2018-02-05 16:56:30 +02:00
b16c84de7b Fix synchronization bug in repo indexer (#3455) 2018-02-05 10:39:51 +02:00
17655cdf1b Enable caching on assets and avatars (#3376)
* Enable caching on assets and avatars

Fixes #3323

* Only set avatar in user BeforeUpdate when there is no avatar set

* add error checking after stat

* gofmt

* Change cache time for avatars to an hour
2018-02-04 00:37:05 +02:00
77f8bad2fb Update hard-coded version to 1.5.0-dev (#3450)
Now that 1.4.0 is out the new target is 1.5.0

(See #2390 and #2988 for more context if needed)
2018-02-03 17:03:43 +02:00
e9e2a9cdcc Allow square brackets in external issue patterns (#3408)
* Allow square brackets in external issue patterns

* Added false test cases for checklist elements
2018-02-03 11:51:02 +02:00
e08b3a592e Emoji Autocomplete (#3433)
* Implemented emoji autocomplete.

* Changed emoji access url.

* Reverted vendor css to default, moved all style changes to _tribute.less

* Made no-results overwriteable, added missing autocomplete to edit issue field.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-02-03 10:09:35 +02:00
b62ce2e246 [skip ci] Updated translations via Crowdin 2018-01-31 15:41:59 +00:00
10171b7e2f add changelog for 1.4.0 (#3435)
* add changelog for 1.4.0

* remove docs

* Remove some more noise

* Small reorganization, removed bugfixes that were not present in last stable version

* Move LFS lock to features, add just merged bugfix info
2018-01-31 17:40:57 +02:00
f9a5cc4d8e Use correct transaltion key for delete email button (#3422) 2018-01-31 00:31:06 +02:00
b3fd94c13d Add sensitive headers (#3429)
* Add HeaderWithSensitiveCase methods to respect casing

* Update webhook.go
2018-01-31 00:09:16 +02:00
d09704e903 [skip ci] Updated translations via Crowdin 2018-01-30 12:30:54 +00:00
ca4f5c37e6 Fix branch deletion for squash or rebase merged pull requests (#3425) 2018-01-30 14:29:39 +02:00
5911f98392 [skip ci] Updated translations via Crowdin 2018-01-29 17:50:28 +00:00
aef30071c9 Fix go-get content type (#3426) 2018-01-29 19:50:04 +02:00
7af81973cb [skip ci] Updated translations via Crowdin 2018-01-29 11:15:41 +00:00
46c7fe371d Fix PR merge error (#3421) 2018-01-29 12:18:20 +02:00
28b81899d0 Add doctype to go-get=1 reponse (#3423) 2018-01-29 03:12:04 +02:00
3968c1149e Fix SQL type error for webhooks (#3424) 2018-01-29 02:26:01 +02:00
e189b06baa Add mising LOCAL_WIKI_PATH documentation (#3420) 2018-01-28 19:16:28 +02:00
7fd2d8e392 [skip ci] Updated translations via Crowdin 2018-01-28 12:25:26 +00:00
bac6ac033a Fix race condition in repo renaming (#3418) 2018-01-28 14:24:59 +02:00
c55a027da3 Fix empty checkout bug (#3419) 2018-01-28 13:27:42 +02:00
36a94da8da doc: Improve integrations examples (#3416) 2018-01-27 20:52:41 +02:00
bcd7f42529 Added quoting for passwords in sample.app.ini and documentation (#3395) 2018-01-27 20:35:49 +02:00
b627f1131b Change local copy origin url after repository rename (#3399)
Fix #3378
2018-01-27 19:54:26 +02:00
9e842c8a72 Fix SSH auth lfs locks (#3152)
* Fix SSH auth LFS locks

* Activate SSH/lock test

* Remove debug

* Follow @lunny recommendation for AfterLoad method
2018-01-27 18:48:15 +02:00
97fe773491 fix MSSQL bug on org (#3405) 2018-01-27 17:20:59 +02:00
a0c397df08 Recognize more characters in crossreferenced repo name (#3413) 2018-01-27 14:33:32 +02:00
9e87fe8c06 [skip ci] Updated translations via Crowdin 2018-01-27 02:18:45 +00:00
07b4e47a56 Add myself to TRANSLATORS (#3415) 2018-01-26 20:17:26 -06:00
82a7b0292e [skip ci] Updated translations via Crowdin 2018-01-25 14:03:22 +00:00
d644e88107 HTML escape all lines of the search result (#3402)
Fixes #3383.
2018-01-22 23:28:16 +02:00
00d08473b8 Use GiteaServer as the user agent for http requests (#3404)
Otherwise we're still presenting ourselves as GogsServer...
2018-01-22 22:37:14 +02:00
1ce3572409 Remove useless check (#3384)
In #3377, I put check inside all write key function. This one is useless no.
2018-01-19 21:45:53 +02:00
05ab747054 Force-push to base repo's ref/pull/#/head (#3393)
* Force-push to base repo's ref/pull/#/head

Fixes force-pushing to pull request branches, otherwise failing with:

[...gitea/models/pull.go:1022 AddTestPullRequestTask()] [E] PushToBaseRepo: Push: exit status 1 - To /path/to/gitea-repositories/org/repo.git
 ! [rejected]        issue-fix -> refs/pull/20/head (non-fast-forward)

* format
2018-01-19 08:53:45 +02:00
ca306985d3 Change how merged PR commit info are prepared (#3368)
* Change how merged PR commits and diff are made

* Update code.gitea.io/git dependency

* Fix typo

* Remove unneeded local variable
2018-01-19 08:18:51 +02:00
b0d5bb909b Delete indexer DB entries when (re)creating index (#3385)
* comment
2018-01-17 23:51:07 +02:00
a880b17296 [skip ci] Updated translations via Crowdin 2018-01-16 21:27:57 +00:00
e722bdbb03 Update source installation requirements (#3124)
* Update source installation requirements

We require Golang 1.8 since we use `net/url.PathEscape` which was not introduced until then

* Use Golang 1.8 for build and test

If we state Golang 1.8 we should test using that version as well

* Use golang 1.8 only for single build to see if everything compiles

* Change back edge also for commented out sqlite test
2018-01-16 22:18:11 +01:00
095fb9f2e3 Add integrations tests from git cli (#3377)
* test: integration add git cli tests

Extracted form for easing review process and debug #3152

* test: integration add git cli big file commit

* fix:  Don't rewrite key if internal server
2018-01-16 13:07:47 +02:00
695b10bedd Fix API-Endpoint release (#3012)
* Fixes API-Endpoint release (#3005)

* Using context.ReferencesGitRepo(); doing the same in the PATCH route.

* Add release create, get and update test
2018-01-16 10:54:13 +02:00
cc0c4a30a7 [skip ci] Updated translations via Crowdin 2018-01-15 22:45:41 +00:00
a68bf746a4 Change reserved avatar name to correct - avatars (#3375) 2018-01-16 00:45:13 +02:00
e2bb7933e8 [skip ci] Updated translations via Crowdin 2018-01-15 06:04:51 +00:00
bec09378f9 Fix Delete repository message (#3260) 2018-01-15 08:03:30 +02:00
d29aa76777 Fix en-US locale (#3371) 2018-01-15 00:27:57 +02:00
6b9073b3a4 [skip ci] Updated translations via Crowdin 2018-01-14 22:10:15 +00:00
18bf6be398 Add myself as a translator (#3370) 2018-01-15 00:09:30 +02:00
6da5ed2594 [skip ci] Updated translations via Crowdin 2018-01-14 17:35:34 +00:00
ccdb94992d Asynchronously populate the repo indexer (#3366)
* Populate repo indexer in background

* Check if no repos exist

* race cond
2018-01-14 19:34:41 +02:00
a8325dd1cb [skip ci] Updated translations via Crowdin 2018-01-13 09:46:18 +00:00
7a2a3fbafc refactor(model): update user method. (#3360) 2018-01-13 11:45:16 +02:00
f7088292bb [skip ci] Updated translations via Crowdin 2018-01-12 22:17:50 +00:00
2b52f77e1b General refactor of the cmd package (#3328)
* General refactor of the cmd package

* Address breakage in runCreateUser

* Place "common" functions into cmd.go
2018-01-12 23:16:49 +01:00
079273e2ff Add MSSQL to supported database list of intall page (#3359) 2018-01-12 19:23:28 +02:00
eb0f166f50 Address issues pointed out by @lunny in #3339 (#3352) 2018-01-12 08:37:30 -06:00
51a18f7e54 [skip ci] Updated translations via Crowdin 2018-01-11 22:20:44 +00:00
e5b8b4b5ec Cleanup models.User.HashPassword (#3334) 2018-01-12 00:19:38 +02:00
9aed18073d [skip ci] Updated translations via Crowdin 2018-01-11 19:57:53 +00:00
ffc0bff46e Improve documentation about custom templates. (#3345)
Now includes all the template hooks in the page, and a detailed
example for the common case of adding an "about" page.
2018-01-11 21:56:40 +02:00
be1330ec89 Remove hardcoded paths to fix randomly failing tests (#3347)
* Remove hardcoded paths to fix randomly failing tests

* Use correct function for merge path
2018-01-11 00:46:59 +01:00
d8dff304c0 Fix randomly failing LFS lock tests in drone (#3346) 2018-01-11 00:09:56 +02:00
65861900cd Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound

* Change Handle(403) to NotFound, avoid using macaron's NotFound
2018-01-10 23:34:17 +02:00
45c264f681 Templates for extra links in top navbar and repo tool tabs. (#3308)
These templates add content to the top navbar
and to the repository page.
This way we do not have to copy and modify the whole
template, and re-modify it after upgrading Gitea if
it changes.

Signed-off-by: Alberto González Palomo <bugs@sentido-labs.com>
2018-01-10 08:19:50 +02:00
88a3bb6d42 Make the default action for the gitea executable that of running the webserver (#3331) 2018-01-10 06:58:08 +02:00
b5fba4cd42 Fix organization profile on mobile devices (#3332) 2018-01-10 01:11:01 +02:00
6070c9a5b8 [skip ci] Updated translations via Crowdin 2018-01-09 18:41:13 +00:00
84feb016f5 Remove useless fmt.Errorf("%v", err) (#3337) 2018-01-09 16:40:05 -02:00
e7295f27a9 Add MTecknology to MAINTAINERS list (#3335) 2018-01-09 07:27:26 +02:00
f737d37804 Add CodeTriage link to README (#3299) 2018-01-09 00:01:08 +01:00
3ee8be3849 General documentation cleanup (#3317)
* Clean up spelling, grammar, perspective, whitespace, language, markup, etc.
2018-01-08 23:48:42 +01:00
923c0105f4 Update gitea version on docs/install-from-binary (#3333)
* Update gitea version on docs/install-from-binary

* Update all versions
2018-01-09 00:48:05 +02:00
674cfb7cac Change EncodePasswd to HashPassword (#3329)
* Change EncodePasswd to HashPassword

* Create test+benchmark for HashPassword
2018-01-08 23:28:18 +01:00
f2b841d0ec Add some instructions about running integration tests (#3319)
* Add some instructions about running integration tests

* Add missing newline escape

* Suggest running a clean build
2018-01-08 18:29:52 +02:00
d663cef2a5 Fix branch name escaping in compare url (#3311)
* Fixes #3303
2018-01-08 17:17:24 +02:00
f48680888c Remove IsOwner, NumTeams from OrgUser (#3269) 2018-01-08 09:48:37 +02:00
cb868b7851 Add missing indexer doc in configuration (#3324)
* Add missing indexer doc in configuration

* Unify MAX_FILE_SIZE to 1024 * 1024
2018-01-08 07:03:52 +02:00
44053532bb Serve .patch for pull requests (#3305)
* Serve .patch for pull requests

Closes #3259
Updates "git" module, for GetFormatPatch

* Handle io.Copy error
2018-01-07 15:10:20 +02:00
18bb0f8f13 Ensure docs makefile downloads theme if failed before. (#3322)
The makefile did not download the theme if the directory "themes/gitea"
is there, even if empty.
On a fresh Ubuntu install, curl is not included, so the theme rule fails
just after creating the empty directory. When you try again after
installing curl, the rule is not triggered.

This could also happen if the download fails for other reasons.

This change makes the theme rule depend on the file "theme.toml"
which will be there only after unpacking a successfully downloaded
theme archive.

Signed-off-by: Alberto González Palomo <bugs@sentido-labs.com>
2018-01-07 14:11:17 +02:00
9d8260b3d6 [skip ci] Updated translations via Crowdin 2018-01-07 09:42:08 +00:00
6a6439c5c2 Enable Libravatar by default in new installations (#3287)
Pre-existing installs still have it default to off.
This is consistent with OpenID setting.
2018-01-07 11:41:09 +02:00
87f67fd392 [skip ci] Updated translations via Crowdin 2018-01-07 09:14:19 +00:00
835b890329 fix bug when a user delete but assigned on issue (#3318) 2018-01-07 11:13:10 +02:00
4002328179 [skip ci] Updated translations via Crowdin 2018-01-06 22:56:53 +00:00
e78786ef39 Writable deploy keys (closes #671) (#3225)
* Add is_writable checkbox to deploy keys interface

* Add writable key option to deploy key form

* Add support for writable ssh keys in the interface

* Rename IsWritable to ReadOnly

* Test: create read-only and read-write deploy keys via api

* Add DeployKey access mode migration

* Update gitea sdk via govendor

* Fix deploykey migration

* Add unittests for writable deploy keys

* Move template text to locale

* Remove implicit column update

* Remove duplicate locales

* Replace ReadOnly field with IsReadOnly method

* Fix deploy_keys related integration test

* Rename v54 migration with v55

* Fix migration hell
2018-01-07 00:55:53 +02:00
70b6c07590 Add defaults to config cheatsheet, and minor language cleanup. (#3290)
* Add defaults to config cheatsheet, and clean up document.

* Updates and touchups, per review.
2018-01-06 22:15:14 +02:00
52d93f7c31 [skip ci] Updated translations via Crowdin 2018-01-06 19:53:48 +00:00
6032682fc1 Add myself to MAINTAINERS (#3313) 2018-01-06 21:52:57 +02:00
8ef1711055 Make the space for repo actions wider on repo header (#3312) 2018-01-06 19:20:13 +02:00
2d31986236 [skip ci] Updated translations via Crowdin 2018-01-06 11:29:31 +00:00
bf78c95d80 add external tool docs (#3301) 2018-01-06 05:28:31 -06:00
15b8720c5d [skip ci] Updated translations via Crowdin 2018-01-05 18:57:58 +00:00
8ac1501ad7 Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Pull request options migration and UI in settings

* Add ignore whitespace functionality

* Fix settings if pull requests are disabled

* Fix migration transaction

* Merge with Rebase functionality

* UI changes and related functionality for pull request merging button

* Implement squash functionality

* Fix rebase merging

* Fix pull request merge tests

* Add squash and rebase tests

* Fix API method to reuse default message functions

* Some refactoring and small fixes

* Remove more hardcoded values from tests

* Remove unneeded check from API method

* Fix variable name and comment typo

* Fix reset commit count after PR merge
2018-01-05 20:56:50 +02:00
a192f3052e Serve pull request .diff files (#3293)
* Serve pull request .diff files

Closes #3259

* Add test for pull request redirection and .diff access

* Typo

* There's no need to test for pr.BaseRepo being nil after calling GetBaseRepo
2018-01-05 12:56:52 +02:00
ce7ae17b81 Fix swagger docs (#3300) 2018-01-04 14:31:40 +08:00
30fb81c71e Use issue number/index instead of id for API URL. (#3298)
Using the API calls, the issue objects retrieved by
/repos/{owner}/{repo}/issues
contains the wrong value in the "url" field:
it uses the "id" value instead of the "number" value.

For instance, in a new repo in try.gitea.io with just one issue:
[{
  "id": 896,
  "url": "https://try.gitea.io/api/v1/repos/AlbertoGP/uno/issues/896",
  "number": 1,
   ...
}]

The given URL does not work, but if you replace the "896" by "1" it
does.
2018-01-03 19:41:33 -06:00
9f8349af06 Fixed asterisk based tasklist items, fixed requirement for one char after last blank to be a valid task. (#3296)
Signed-off-by: modmew8 <modmew8@gmail.com>
2018-01-03 21:45:21 +02:00
5057c6b43f Fix guide link for webhooks in repository settings (#3291) (#3292)
Signed-off-by: Elouan Martinet <exa@elou.world>
2018-01-03 23:50:09 +08:00
daf08aeacd [skip ci] Updated translations via Crowdin 2018-01-03 08:35:03 +00:00
d996da6bab Added progressbar for issues (#1146). (#3171)
* Added progressbar for issues (#1146).

* Updated the generated index.css.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed stored progress percentage and changed it to css calc. Also added the issue task progress to the user/dashboard/issues.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed unnecessary blanks.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Formatted the files correctly, fmt-check terminates now without errors.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed variables, made computing the tasks on demand with precompiled regexp.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-01-03 02:34:13 -06:00
22a7a7ec9b Update standard copyright header for new year (#3289) 2018-01-02 20:03:24 -06:00
de9e36e90e [skip ci] Updated translations via Crowdin 2018-01-02 12:14:47 +00:00
732d31f750 refactor: ignore LGTM from author of pull request. (#3283) 2018-01-02 06:13:49 -06:00
274241c044 [skip ci] Updated translations via Crowdin 2018-01-02 10:33:40 +00:00
c4a8d4ce45 Add more additional template snippets (#3286) 2018-01-02 11:32:41 +01:00
a22037713e [skip ci] Updated translations via Crowdin 2018-01-02 02:38:10 +00:00
50b7ba1b70 Fix MS AD Search Attributes English translation (#3282) 2018-01-02 10:37:16 +08:00
289cd1ceb7 Update CONTRIBUTING.md with new Owners (#3281)
* Add in new owners to contributing.md

* Update date
2018-01-01 19:30:51 +02:00
7944ff7e71 [skip ci] Updated translations via Crowdin 2018-01-01 13:39:43 +00:00
bccbbcf12e Add build instruction in README, reorganize some sections (#3257)
* Add build instruction in README, reorganize some sections

* Add link to https://docs.gitea.io/en-us/install-from-source/
2018-01-01 15:38:49 +02:00
b05a17249b [skip ci] Updated translations via Crowdin 2017-12-31 14:47:00 +00:00
8cd987af0c Add repo-sync-releases admin command (#3254)
* Add repo-sync-releases admin command

Will help recovering corrupted database, see #3247

* Load repos in chunks of 10, exit with error if unable to get a list, scan private repos, fix typo

* Fix debug output about num releases

* Introduce RepositoryListDefaultPageSize constant, set to 64

Use it from the new admin command

* Use RepositoryListDefaultPageSize in more places

* Document RepositoryListDefaultPageSize
2017-12-31 16:45:46 +02:00
ae9cc8f972 [skip ci] Updated translations via Crowdin 2017-12-31 03:09:06 +00:00
c64924682e Fix race condition in team functions (#3268) 2017-12-30 21:08:08 -06:00
edce41ae65 go back to using CFB for AES decryption/encryption for 2FA (#3274) 2017-12-31 04:19:42 +02:00
d2736e268b Remove unused vendor github.com/stretchr/testify/require (#3273) 2017-12-31 09:11:08 +08:00
3850bad4c0 Remove unused consts/vars (#3270) 2017-12-30 19:10:48 -06:00
3d3faa2624 Responsive view (#2750)
* Viewport meta tag

* responsive: dashboard

* responsive: issues page

* responsive: Explore page

* responsive: navbar, and some navbar css refactoring

* responsive: button for collapsing navbar in mobile view

* Mark the hamburger button as active when pressed

* better homepage for responsive views

* Bring back jump class in navbar

The class was necessary, because this way the
dropdown doesn't assume the contents of the
selected item.

* make repository homes responsive

* Make file view page responsive

* Make forms look good on responsive views

* make commits and commit diff view responsive

* issues and PRs

* responsive wiki

* Don't place auto-init far off the page

* Minor changes to amend broken stuff

minor improvements

- make login/sign up in navbar stackable
- make navbar in explore and sign in not stackable

Change selected class in TestPullCompare

Fix typo that happened when rebasing

fix dashboard on org view

improve profile UI

Use clearing on file diff to fix broken UI caused by floating elements

remove unresolved merge conflict, and | Sanitize

Fix repo home not loading
2017-12-30 18:47:52 -06:00
2f8c65c885 Fixed link to Issue 165 in comment, that was broken by commit 2d68bd1ef98849da54c869b103e93719d1accb5e (index 8110ac85..0f6163c4 100644). (#3267) 2017-12-29 22:19:38 -06:00
08cf7d90ef Add docs for REDIRECT_OTHER_PORT and PORT_TO_REDIRECT config options (#3262) 2017-12-27 08:35:19 -06:00
4c9341f689 Fix bugs in issue dashboard stats (#3073) 2017-12-26 01:25:16 +02:00
fabf3f2fc2 Add an option to allow redirect of http port 80 to https. (#1928)
* Add an option to allow redirect of http port 80 to https.

This is an "opt in" option (default is to not redirect).  It will only redirect
if protocol is https and the new REDIRECT_PORT_80 option is set to true.

The Port to redirect in previous commit was hardcoded to 80, now it can be
specified in the app.ini, defaulting to 80.  The boolean option to turn
redirection on has been changed to REDIRECT_OTHER_PORT to be logically
consistent with the new port option.

Signed-off-by: Mike Fellows <mike.fellows@shaw.ca>
2017-12-25 23:23:43 +01:00
f5155b9913 Small improve on deleting attachements (#3145)
* Small improve on deleting attachements

* improve the sequence of deletion
2017-12-24 23:04:22 +02:00
cc7b8e3379 Add more bench (#3161)
* Improve makefile + Add benchs

* Apply recommendations of @ethantkoenig
2017-12-24 02:33:34 +02:00
a995ad90e1 [skip ci] Updated translations via Crowdin 2017-12-22 07:01:25 +00:00
156aa42ba0 Update code.gitea.io/git (#3251) 2017-12-22 09:00:30 +02:00
515cdaa85d Fix ignored errors when checking if organization, team member (#3177) 2017-12-21 09:43:26 +02:00
529482135c Support default private when creating or migrating repository (#3239)
* support default private when creating or migrating repository

* fix fmt

* use string constants on repository default private in app.ini

* fix fmt
2017-12-20 06:59:56 -06:00
e67b4055f9 Fix repo-transfer-and-team-repo-count bug (#3241) 2017-12-19 23:37:56 -06:00
7cf17e376b [skip ci] Updated translations via Crowdin 2017-12-20 03:42:21 +00:00
456648adac chore: upgrade gitea/git version (#3240)
ref: https://github.com/go-gitea/gitea/pull/3190
2017-12-19 21:41:29 -06:00
7b28154e8b Add missing repository setting docs in cheat sheet (#3230) 2017-12-19 04:40:21 -06:00
5332052019 Fixed missing end tag for organization link (#3229) 2017-12-19 09:47:30 +02:00
1123313240 Use correct camel casing for JavaScript (#3224)
JavaScript should be spelt with an uppercase 'S' as per seen in [Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
2017-12-18 19:31:32 -06:00
7e59587173 Open external tracker in blank window, consistently with wiki (#3227)
Closes #3216
2017-12-18 19:30:34 -06:00
0e384c6376 Check ignored errors for issue and milestone count (#3213) 2017-12-18 16:06:51 +02:00
9a0e2a8b07 Improve cron.archive_cleanup docs in cheat sheet and app.ini.sample (#3215)
Include defaults in cheat sheet, for that section
2017-12-17 16:37:34 +02:00
6abfa48c0e Remove unnecessary updates to issue indexer (#3212) 2017-12-17 13:53:02 +02:00
eb2b4df0ed Change SSL Mode from checkbox to string in admin page (#3208)
Closes #3207

Use a string, not a checkbox because "require", "verify-full",
"verify-ca" and "disable" values are supported ...
2017-12-16 23:25:00 +02:00
befa7445d2 Unit tests for routers/repo/issue_label (#3198) 2017-12-15 23:11:02 +02:00
bde0409433 Fix repo links on user profile (#3197) 2017-12-15 06:55:08 +02:00
1687aa59e6 Improve suppressed diff boxes (#3193) 2017-12-14 20:26:59 +02:00
f94c1b3943 Improvements for supporting UI Location (#3146)
* improvements for supporting UI Location

* improved the comment
2017-12-14 07:45:31 +08:00
b6d2243ac0 Make spacing in configuration file consistent (#3186)
This makes the spacing consistent across all options.

Signed-off-by: Patrick Lühne <patrick-github@luehne.de>
2017-12-14 00:22:59 +02:00
c06cc740de Reorder migrations, skip errors if running migration again (#3160)
* Reorder migrations, skip errors if running migration again

* Rename migration file names to match migration version

* Add note about ingored error
2017-12-13 16:52:18 +02:00
d3c5911ffc Fix wiki page list not rendering after updatedunix changes (#3175) 2017-12-13 21:46:56 +08:00
00bfa1d055 fix run web with -p push failed (#3154) 2017-12-13 16:57:28 +08:00
0b77dbc11c Fix new pull request link (#3133)
* Fix new pull request link

* Only show button for branches
2017-12-13 13:06:25 +08:00
e693fda325 [skip ci] Updated translations via Crowdin 2017-12-12 22:27:18 +00:00
859b9ad7ea fix org owner cannot be removed if there is not in owner team (#3164) 2017-12-13 00:26:31 +02:00
9f033bf2b5 Make test more robust (#3167) 2017-12-12 15:17:08 +08:00
2ad633344e [skip ci] Updated translations via Crowdin 2017-12-12 06:46:42 +00:00
e3f88719ab fix source download link when no code unit allowed (#3166) 2017-12-12 08:45:02 +02:00
f27a6461e3 Enable emoji for wiki view (#3158)
Enable emoji for wiki page content. It is enabled in the edit preview so the view should match.

Signed-off-by: Hamish Carpenter <hamish@hamishcarpenter.com>
2017-12-12 03:02:55 +02:00
4b5197beb4 Fix Uninitialized variable in ParsePatch (#3156) 2017-12-12 02:32:36 +02:00
3b525d5696 fix gpg tmpl (#3153) 2017-12-11 22:07:25 +08:00
b82519cadc Move build without gcc step up so that it's binary is not used in docker (#3147) 2017-12-11 10:42:13 +01:00
956354885a simple usage of x (#3144) 2017-12-11 09:16:23 +02:00
03ec35ed79 Mention completion for issue editor. (#3136)
* new issue mention

* Mention completion on new issue and view issue page.

* Code format.

* Require tribute in pull request page.
2017-12-11 14:03:04 +08:00
f2e20c81b6 Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
2017-12-11 06:37:04 +02:00
c082c3bce3 Restore make test target (#3139)
* Restore make test target

* make build -> go build
2017-12-11 10:31:07 +08:00
58a7de2aea Update code.gitea.io/git (#3137) 2017-12-11 10:23:34 +08:00
682ac11958 Log unexpected responses in integration tests (#3138)
* Log flash error message in integration tests

* Also log short, non-HTML responses
2017-12-11 10:15:27 +08:00
defc97afc2 Fixtures for public_key table (#3140) 2017-12-11 09:50:29 +08:00
d1efe2078a Fix integration tests (#3141) 2017-12-11 08:52:05 +08:00
41d6afe0e7 Fix compile failed without gcc (#3130)
* fix comile failed without gcc

* add sqlite tag for unit test
2017-12-10 16:08:19 +02:00
eb6cbedcc0 [skip ci] Updated translations via Crowdin 2017-12-10 02:52:04 +00:00
23ffdf42c8 Update alpine to 3.7 (#3121) 2017-12-10 10:50:50 +08:00
b8e45b1e19 Fix missing drone test on release/* (#3126)
* fix missing drone test on release/*

* remove test coverage on release/*
2017-12-09 12:17:40 +02:00
5b30964e54 [skip ci] Updated translations via Crowdin 2017-12-08 17:21:10 +00:00
d5d28721e2 Backport changelog for 1.3 release (#3120) 2017-12-08 18:20:48 +01:00
f8967fc638 [skip ci] Updated translations via Crowdin 2017-12-08 12:23:00 +00:00
ef78309b65 Improve LFS tests + fix lfs url refs + keep path upper/lowercase in db. (#3092)
* Add failing test

* Fix urls

* Improve url in tests

* improve testing

* Remove debug code

* Add deps

* LFS corner-case : Search on lower but store with case

* Temporary comment of blocking action

* fix hooks

* Use temporary repo for git client test

* Use userPassword in place of hard-coded password
2017-12-08 20:21:37 +08:00
aecfc56156 [skip ci] Updated translations via Crowdin 2017-12-08 05:23:04 +00:00
596308f213 Fix missing branch in release bug (#3108) 2017-12-08 13:22:02 +08:00
68179dc676 Remove unnecessary function call (#3109) 2017-12-08 09:02:34 +08:00
5e4427e4e7 Fix repo indexer and submodule bug (#3107) 2017-12-07 15:18:04 +08:00
311c83ad17 Allow adding collaborators with (fullname) (#3103)
* Allow adding collaborators with (fullname)

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Refactor username suffix to utils pkg

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>
2017-12-07 15:00:09 +08:00
7ec6cddd27 Add 'mark all read' option to notifications (#3097)
* Add 'mark all read' option to notifications

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Tests for reactions (#3083)

* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>

Fix reaction possition when there is attachments (#3099)

Refactor notifications swap function

* Accept change to drop beforeupdate call

* Update purge notifications error message for consistency

* Drop unnecessary check for mark all as read button

* Remove debugging comment
2017-12-07 13:52:57 +08:00
1ed7f18815 Rework button styles on repo and commit page (#3104) 2017-12-07 09:26:12 +08:00
54907dfbd1 Fix legacy URL redirects (#3100) 2017-12-07 09:09:02 +08:00
469ab99e9a Delete a user's public key via admin api (closes #3014) (#3059)
* Delete a user's public key via admin api

* Test admin ssh endpoint for creating a new ssh key

* Adapt public ssh key test to also test the delete operation

* Test that deleting a missing key will result in a 404

* Test that a normal user can't delete another user's ssh key

* Make DeletePublicKey return err

* Update swagger doc
2017-12-06 12:27:10 +02:00
c7fb6e3087 Fix reaction possition when there is attachments (#3099) 2017-12-06 11:17:50 +08:00
f1d8dda5b4 Tests for reactions (#3083)
* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2017-12-05 22:57:01 +02:00
3b89ee5501 fix button heights on commits page (#3091) 2017-12-05 14:31:33 +08:00
e2968b4c98 add quotation around ports in docker-compose.yml (#3090) 2017-12-05 14:03:40 +08:00
03eb47b216 Fix repo links (#3093) 2017-12-05 13:52:53 +08:00
2738effddf fix redis cache failed (#3086) 2017-12-04 23:00:14 +08:00
0332b8fb18 [skip ci] Updated translations via Crowdin 2017-12-04 14:06:04 +00:00
f4445510ae fixed in-page-link in CONTRIBUTING.md (#3087) 2017-12-04 16:05:12 +02:00
c0a7899416 Sort repos in issues dashboard sidebar (#3072)
* Sort repos in issues dashboard sidebar

* Sort repos by name
2017-12-04 12:39:01 +08:00
3c1b1ca78e Fix error message sanitiziation (#3082) 2017-12-04 03:48:03 +02:00
5dc37b187c Add reactions to issues/PR and comments (#2856) 2017-12-04 01:14:26 +02:00
e59adcde65 Use httptest in integration tests (#3080) 2017-12-04 00:46:01 +02:00
993b86628b Minor copy changes (#3074)
* Minor copy changes
Fixes #3058

* Use TrN for translations that depend on count
Fix minor type with branches count
2017-12-03 22:52:30 +02:00
ab62da283a Fix avatar URLs (#3069)
* Fix avatar URLs

* import order
2017-12-03 19:55:13 +08:00
7bab3d2fb1 Enable content trust when building image (#2972) 2017-12-03 18:21:10 +08:00
6d99840d1f [skip ci] Updated translations via Crowdin 2017-12-03 05:31:04 +00:00
a0964775ab Sanitize logs for mirror sync (#3057) 2017-12-03 13:29:41 +08:00
3163abedd6 Fix ref parsing in commit messages (#3067) 2017-12-03 10:20:12 +08:00
b0971ae37c Reduce overhead of upgrades for users with custom stylesheets/JS (#3051) 2017-12-03 02:26:06 +02:00
4947cfb7b0 Remove box-shadow from UI, fix dashboard issue (#3065) 2017-12-03 01:16:35 +02:00
ef5364950b fix issue list branch link broken (#3061) 2017-12-02 21:57:47 +02:00
d44aa831f3 Convert tabs to spaces in .less files (#3064) 2017-12-02 21:48:43 +02:00
f9db60e3bd Adjust branch button size (#3063) 2017-12-02 19:57:51 +02:00
8cd616e977 Fix misalignment issue in repo header (#3062) 2017-12-02 19:20:52 +02:00
b3d5ba6f90 Fix missing password length check when change password (#3039)
* fix missing password length check when change password

* add tests for change password
2017-12-02 19:11:22 +02:00
35cc5b0402 Remove GetRepositoryByRef and add GetRepositoryByOwnerAndName (#3043)
* remove GetRepositoryByRef and add GetRepositoryByOwnerAndName

* fix tests

* fix tests bug

* some improvements
2017-12-02 15:34:39 +08:00
674422b642 Fix CSS instructions in CONTRIBUTING.md (#3053) 2017-12-02 13:48:57 +08:00
d8d38ed059 Dashboard: Fix line height problem in issue titles (#3054) 2017-12-02 10:49:39 +08:00
57edc3155f Default log level to Info without hardcoding it in installer (#3041) 2017-12-01 15:41:27 +08:00
9a8805d785 remove duplicated sanitize (#3037) 2017-11-30 21:38:33 +02:00
13e59c8b7a remove unused variable (#3038) 2017-11-30 20:44:25 +02:00
91f3d77ceb Unit tests for wiki routers (#3022) 2017-11-30 17:52:15 +02:00
82e8486f13 Update docs for LDAP (via BindDN) user sync option. (#2985) 2017-11-30 21:36:53 +08:00
474dfcc798 French translation for docs (#3030)
original PR go-gitea/docs#147 and author @0xbaadf00d
2017-11-30 20:45:48 +08:00
d517b56682 add notice for docker run gitea http port issue (#3020) 2017-11-30 19:18:35 +08:00
86ee41ec03 Expandable commit bodies (#2980)
* Initial working state of expandable commit bodies

* Fix all commits having showing button for multiline commits

* Refactor checking multiline messages method

* Force newlines with <br> in commit body

* Show multiple lines in the list view of repositories

* Fixed proper newlines and minor refactor

Use <pre> instead of <p>, this is so we can use \n instead of having to manually place <br> into the HTML. Makes it easier to display commit bodies.

* Fix commit list messages jumping around

* Fix indentation in view_list.tmpl

* Use vertical-align: baseline instead of top

* Refactor commit button toggle function

* Remove RenderCommitBodyLink function

* Add comments

* Add newline at the end of _repository.less

* Fix long commit bodies not properly wrapping inside <pre>

* Don't split on double newlines

* Show the commit body in commit view

* Update stylesheets

* Add/fix comments and run make fmt

* Fix spaces not being tabs
2017-11-30 13:08:40 +08:00
4cf90aa865 [skip ci] Updated translations via Crowdin 2017-11-29 20:53:22 +00:00
013db70fce Removed unused field in form (#3023) 2017-11-29 22:52:34 +02:00
033ad9a79f [skip ci] Updated translations via Crowdin 2017-11-29 12:50:43 +00:00
67b0d2175d Set OpenID support on by default when installing new instance (#3010) 2017-11-29 14:47:42 +02:00
b9452c48ac [skip ci] Updated translations via Crowdin 2017-11-29 09:11:10 +00:00
899c900e59 use unique name for docs docker build step in CI (#3018)
Otherwise drone may combine the logs
2017-11-29 11:08:23 +02:00
dab2b354c7 Removing disqus from docs site (#3015)
Gitea now has a forum which is probably a better venue for
these types of conversations
2017-11-29 11:57:29 +08:00
cbc6bbfbeb [skip ci] Updated translations via Crowdin 2017-11-29 01:52:11 +00:00
551f3cbe42 Memory usage improvements (#3013)
* govendor update code.gitea.io/git

Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>

* Greatly improve memory usage

Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2017-11-29 09:50:39 +08:00
4035ab05fa Fix git lfs path (#3016)
* add suffix .git

* Remove Content-Type on GET methods

* Add migrations to force creation before any further potential migration
2017-11-29 01:35:23 +02:00
c80d147fa9 Improve memory usage when reaching diff limits (#2990)
Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2017-11-29 01:22:24 +02:00
d39b88ae88 Fix master build for docs docker (#3004) 2017-11-29 00:17:23 +02:00
d99f4ab003 Git LFS lock api (#2938)
* Implement routes

* move to api/sdk and create model

* Implement add + list

* List return 200 empty list no 404

* Add verify lfs lock api

* Add delete and start implementing auth control

* Revert to code.gitea.io/sdk/gitea vendor

* Apply needed check for all lfs locks route

* Add simple tests

* fix lint

* Improve tests

* Add delete test + fix

* Add lfs ascii header

* Various fixes from review + remove useless code + add more corner case testing

* Remove repo link since only id is needed.

Save a little of memory and cpu time.

* Improve tests

* Use TEXT column format for path + test

* fix mispell

* Use NewRequestWithJSON for POST tests

* Clean path

* Improve DB format

* Revert uniquess repoid+path

* (Re)-setup uniqueness + max path length

* Fixed TEXT in place of VARCHAR

* Settle back to maximum VARCHAR(3072)

* Let place for repoid in key

* Let place for repoid in key

* Let place for repoid in key

* Revert back
2017-11-28 22:58:37 +02:00
6ad4990a65 Add fingerprint to ssh key endpoints. (#3009)
* Add fingerprint to ssh key endpoints.

* Update gitea sdk vendor
2017-11-28 17:21:39 +02:00
0c69b768b9 [skip ci] Updated translations via Crowdin 2017-11-28 09:44:21 +00:00
b7ebaf6d20 Various wiki bug fixes (#2996)
* Update macaron

* Various wiki bug fixes
2017-11-28 17:43:51 +08:00
6a58e3f9fc Dockerfile for docs copy proper files into image (#2989)
fixes docker build from: #2874
2017-11-27 14:08:25 +02:00
1028ef2def Don't print SQL in unit tests (#2995)
* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
2017-11-27 12:29:48 +02:00
8b58772659 [ci skip] Fix #2964 Document updated proposal process (#2999) 2017-11-27 09:14:34 +02:00
621efaa340 Update link for tips on how to get faster reviews (#2997)
Kubernetes merged guides, and this is now the current location of guide
2017-11-27 08:11:15 +02:00
8ee08fe8bc Remove duplicate "Max Diff Lines" from config view (#2987)
Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2017-11-27 06:56:50 +02:00
0e76f38e4d [ci skip] Add @techknowlogick to MAINTAINERS file (#2993) 2017-11-27 11:38:49 +08:00
cc2b1fea9a Adding time tracking to feature list (#2982)
Now that 1.3 is out time tracking is a new feature
go-gitea/docs#148
2017-11-27 10:47:43 +08:00
238bb80cdd Update hard-coded version to 1.4.0-dev (#2988)
Now that 1.3.0 is out the new target is 1.4.0
2017-11-27 10:12:45 +08:00
0d4c63fd70 Fix go-get, src and raw urls to new scheme (#2978) 2017-11-27 02:58:54 +02:00
fb5c6b6444 Import docs into main repository (#2874)
* import docs into main repository

Signed-off-by: Matti Ranta <matti@mdranta.net>
2017-11-26 23:44:32 +02:00
f148a4a1ed Fix coverage reports (#2974) 2017-11-26 20:07:40 +02:00
4d85c1d3c8 Fix fault PR renaming app.ini (#2977) 2017-11-26 18:02:38 +02:00
7091db8192 Rename conf dir > custom.sample (#1522)
* Explain app.ini purpose
2017-11-26 17:16:58 +08:00
716ac1214f Enable admin to search by email (#2888) 2017-11-26 16:40:38 +08:00
061c501d54 Fix error when add user has full name to team (#2973)
* fix error when add user has full name to team

* add comment for extra uname check
2017-11-26 10:01:48 +02:00
16c55e1a5b [skip ci] Updated translations via Crowdin 2017-11-26 02:01:56 +00:00
d23a3e96f1 Fix bench deps since #2916 (#2971) 2017-11-26 10:00:57 +08:00
40c545ddbc Fix files/commits of merged PRs (#2937) 2017-11-25 21:47:19 +08:00
183da4c2c1 Fix language names (#2955) 2017-11-23 12:00:48 +08:00
42d781a709 Update gitgraph.js to fix blurry commit graph on HiDPI screens (#2957) 2017-11-23 00:08:26 +08:00
2cb6c51158 Fix over-escaped characters (#2956) 2017-11-22 15:09:48 +08:00
dbb7715b0b Remove render issue link (#2954)
* Remove function that does nothing

* Remove unused import
2017-11-22 08:25:47 +02:00
ea78a6db57 Spaces to tabs in templates (#2953) 2017-11-21 13:43:00 +08:00
0f6dc411df Remove unnecessary IssueList attribute loads (#2936) 2017-11-21 13:28:22 +08:00
10b54df2b2 Add dingtalk webhook (#2777)
* add dingtalk webhook type

* add vendor

* some fixes

* fix name check

* fix name check & improvment
2017-11-21 06:26:43 +02:00
420fc8efc2 Disable add key button if SSH is disabled (#2873) 2017-11-21 11:49:33 +08:00
1f7aab6e19 Drop deprecated GOGS_WORK_DIR use (#2946) 2017-11-21 09:52:47 +08:00
fd09d1ffb8 Drop unmaintained gogs migration script (#2947) 2017-11-21 08:52:48 +08:00
e00df9fb8e [skip ci] Updated translations via Crowdin 2017-11-20 23:37:46 +00:00
e4f96c60cd App restarts to quickly if it fails to start. (#2945) 2017-11-21 01:37:23 +02:00
7e6c198f21 Apply LANDING_PAGE config options for logged in users (#2894)
* Extended LANDINGPAGE config variable to logged in users and added switch for 'organizations' in addition to 'home' and 'explore'.

* Updated comments.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to trigger when user logs in and added switch for 'organizations' in addition to 'home' and 'explore'.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to logged in users and added switch for 'organizations' in addition to 'home' and 'explore'.

* Updated comments.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to trigger when user logs in and added switch for 'organizations' in addition to 'home' and 'explore'.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Removed superfluous conditional and correct whitespace.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Update app.ini

Reverted new line.

* Formatting.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>
2017-11-20 15:48:09 +08:00
c3b6383b3a Fix comment API paths (#2813) 2017-11-20 15:24:07 +08:00
876bafb7ef Fix API status code for hook creation (#2814)
* Fix API status code for hook creation

* Named constants for response statuses
2017-11-20 15:00:53 +08:00
061f65ff29 Restore build as the default make rule (#2935) 2017-11-19 09:50:23 +02:00
6ee65757c7 Combine identical Makefile rules (#2916) 2017-11-17 18:17:39 +08:00
1cb01817c9 [skip ci] Updated translations via Crowdin 2017-11-17 03:17:21 +00:00
b23cf16981 Fix govendor for x/crupto curve25519 (#2925) 2017-11-17 11:16:47 +08:00
b33ce46a48 [skip ci] Updated translations via Crowdin 2017-11-16 13:17:13 +00:00
dac0f14f34 Docker multi-arch base (#1985)
* Create docker/manifest/base.yml

serve as base for build docker image for most platform (386,amd64,arm,arm64)

* Add make task docker-multi-arch-push-manifest

To update references of a multi-arch image on docker registry.

* Use SED_INPLACE generic sed command

* Delete Dockerfile.aarch64

Delete Dockerfile.rpi

* Use gitea/gitea-base as base

and replace deprecated MAINTAINER by LABEL (https://docs.docker.com/engine/reference/builder/#maintainer-deprecated)

* Fix rebase

* Use sapk/gitea-base as base

* Split makefile for docker

* Fix version to v3.6

Could use in later version edge of alpine official library that support multi-arch for armhf.

* Remove sapk/gitea-base and use directly new official alpine multi-arch
2017-11-16 15:16:40 +02:00
7c3e605698 Fix memcache support when value is returned as string always (#2924) 2017-11-16 15:06:34 +08:00
222e7c3f06 [skip ci] Updated translations via Crowdin 2017-11-16 05:54:31 +00:00
3138417c63 Update golang x/crypto dependencies (#2923) 2017-11-16 07:53:23 +02:00
074f6c1b49 [skip ci] Updated translations via Crowdin 2017-11-15 08:12:05 +00:00
d22a8dc022 Page parameter for repo search API (#2915) 2017-11-15 16:10:26 +08:00
a30cc637c6 [skip ci] Updated translations via Crowdin 2017-11-15 03:35:51 +00:00
a6f337046f Update go-ini dependency and remove semicolon hack in translations (#2913) 2017-11-15 11:34:42 +08:00
bd23e36bec Add owner to delete repo message (#2886) 2017-11-15 09:37:16 +08:00
1624 changed files with 107839 additions and 72370 deletions

View File

@ -1,5 +0,0 @@
*
!gitea
!docker
!public
!templates

View File

@ -1,10 +1,10 @@
workspace:
base: /srv/app
base: /go
path: src/code.gitea.io/gitea
clone:
git:
image: plugins/git:1
image: plugins/git:next
depth: 50
tags: true
@ -55,18 +55,27 @@ pipeline:
when:
event: [ push, tag, pull_request ]
build-without-gcc:
image: golang:1.8
pull: true
commands:
- go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
when:
event: [ push, tag, pull_request ]
build:
image: webhippie/golang:edge
image: golang:1.10
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make clean
- make generate
- make vet
- make lint
- make fmt-check
- make swagger-check
# - make swagger-validate
- make misspell-check
- make test-vendor
- make build
@ -74,12 +83,11 @@ pipeline:
event: [ push, tag, pull_request ]
test:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make unit-test-coverage
when:
@ -87,12 +95,11 @@ pipeline:
branch: [ master ]
test:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make test
when:
@ -100,12 +107,11 @@ pipeline:
branch: [ release/* ]
test:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make test
when:
@ -113,60 +119,64 @@ pipeline:
# Commented until db locking have been resolved!
# test-sqlite:
# image: webhippie/golang:edge
# image: golang:1.10
# pull: true
# group: test
# environment:
# TAGS: bindata
# GOPATH: /srv/app
# commands:
# - make test-sqlite
# when:
# event: [ push, tag, pull_request ]
test-mysql:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
TEST_LDAP: "1"
commands:
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
- apt-get install -y git-lfs
- make integration-test-coverage
when:
event: [ push, pull_request ]
branch: [ master ]
test-mysql:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
TEST_LDAP: "1"
commands:
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
- apt-get install -y git-lfs
- make test-mysql
when:
event: [ tag ]
test-pgsql:
image: webhippie/golang:edge
image: golang:1.10
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
TEST_LDAP: "1"
commands:
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
- apt-get install -y git-lfs
- make test-pgsql
when:
event: [ push, tag, pull_request ]
generate-coverage:
image: webhippie/golang:edge
image: golang:1.10
pull: true
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make coverage
when:
@ -187,23 +197,47 @@ pipeline:
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- export PATH=$PATH:$GOPATH/bin
- make release
when:
event: [ push, tag ]
docker:
build_docs:
image: webhippie/hugo:latest
pull: true
commands:
- cd docs
- make trans-copy
- make clean
- make build
docker_docs:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/gitea
tags: [ '${DRONE_TAG##v}' ]
repo: gitea/docs
context: docs
dockerfile: docs/Dockerfile
tags: [ '${DRONE_BRANCH##release/v}' ]
when:
event: [ tag ]
event: [ push ]
branch: [ release/* ]
docker_docs:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/docs
context: docs
dockerfile: docs/Dockerfile
tags: [ 'latest' ]
when:
event: [ push ]
branch: [ master ]
docker:
image: plugins/docker:17.05
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/gitea
@ -213,14 +247,25 @@ pipeline:
branch: [ release/* ]
docker:
image: plugins/docker:17.05
pull: true
image: plugins/docker:17.12
secrets: [ docker_username, docker_password ]
pull: true
repo: gitea/gitea
tags: [ 'latest' ]
default_tags: true
when:
event: [ push ]
branch: [ master ]
event: [ push, tag ]
gpg-sign:
image: plugins/gpgsign:1
pull: true
secrets: [ gpgsign_key, gpgsign_passphrase ]
detach_sign: true
files:
- dist/release/*
excludes:
- dist/release/*.sha256
when:
event: [ push, tag ]
release:
image: plugins/s3:1
@ -308,3 +353,8 @@ services:
- POSTGRES_DB=test
when:
event: [ push, tag, pull_request ]
ldap:
image: gitea/test-openldap:latest
when:
event: [ push, tag, pull_request ]

10
.gitignore vendored
View File

@ -59,3 +59,13 @@ coverage.all
/integrations/mysql.ini
/integrations/pgsql.ini
/node_modules
# Snapcraft
snap/.snapcraft/
parts/
stage/
prime/
*.snap
*.snap-build
*_source.tar.bz2

3
.lgtm
View File

@ -1,2 +1,3 @@
self_approval_off = false
pattern = "(?)LGTM"
self_approval_off = true
ignore_maintainers_file = true

View File

@ -1,23 +1,231 @@
# Changelog
## [1.3.3](https://github.com/go-gitea/gitea/releases/tag/v1.3.3) - 2018-02-15
* SECURITY
* Fix escaping changed title in comments (#3530) (#3535)
* Escape search query display (#3486) (#3489)
* BUGFIXES
* Fix repo-transfer-and-team-repo-count bug (#3241) (#3244)
* Open external tracker in blank window, consistently with wiki (#3227) (#3228)
* Change SSL Mode from checkbox to string in admin page (#3208) (#3211)
This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).
## [1.3.2](https://github.com/go-gitea/gitea/releases/tag/v1.3.2) - 2017-12-14
## [1.5.0-RC2](https://github.com/go-gitea/gitea/releases/tag/v1.5.0-rc2) - 2018-07-21
* SECURITY
* Check that repositories can only be migrated to own user or organizations (#4366) (#4370)
* BUGFIXES
* fix run web with -p push failed (#3154) (#3179)
* Fix source download link when no code unit allowed (#3166) (#3169)
* Allow adding collaborators with (fullname) (#3103) (#3168)
* Fix repo links (#3093) (#3163)
* Fix Uninitialized variable in ParsePatch (#3156) (#3162)
* Fix migration order v1.3 (#3157)
* Fix avatar URLs (#3069) (#3143)
* Fix column droping for MSSQL that need new transaction for that (#4440) (#4484)
* Redirect to correct page after using scratch token (#4458) (#4472)
* Replace src with raw to fix image paths (#4377) (#4386)
* Fixes repo membership check in API (#4341) (#4379)
* Add default merge options when adding new repository (#4369) (#4373)
* Fix repository last updated time update when delete a user who watched the repo (#4363) (#4371)
* Fix html entity escaping in branch deletion message (#4471) (#4485)
## [1.5.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.5.0-rc1) - 2018-07-04
* SECURITY
* Limit uploaded avatar image-size to 4096px x 3072px by default (#4353)
* Do not allow to reuse TOTP passcode (#3878)
* FEATURE
* Add cli commands to regen hooks & keys (#3979)
* Add support for FIDO U2F (#3971)
* Added user language setting (#3875)
* LDAP Public SSH Keys synchronization (#1844)
* Add topic support (#3711)
* Multiple assignees (#3705)
* Add protected branch whitelists for merging (#3689)
* Global code search support (#3664)
* Add label descriptions (#3662)
* Add issue search via API (#3612)
* Add repository setting to enable/disable health checks (#3607)
* Emoji Autocomplete (#3433)
* Implements generator cli for secrets (#3531)
* ENHANCEMENT
* Add more webhooks support and refactor webhook templates directory (#3929)
* Add new option to allow only OAuth2/OpenID user registration (#3910)
* Add option to use paged LDAP search when synchronizing users (#3895)
* Symlink icons (#1416)
* Improve release page UI (#3693)
* Add admin dashboard option to run health checks (#3606)
* Add branch link in branch list (#3576)
* Reduce sql query times in retrieveFeeds (#3547)
* Option to enable or disable swagger endpoints (#3502)
* Add missing licenses (#3497)
* Reduce repo indexer disk usage (#3452)
* Enable caching on assets and avatars (#3376)
* Add repository search ordered by stars/forks. Forks column in admin repo list (#3969)
* Add Environment Variables to Docker template (#4012)
* LFS: make HTTP auth period configurable (#4035)
* Add config path as an optionial flag when changing pass via CLI (#4184)
* Refactor User Settings sections (#3900)
* Allow square brackets in external issue patterns (#3408)
* Add Attachment API (#3478)
* Add EnableTimetracking option to app settings (#3719)
* Add config option to enable or disable log executed SQL (#3726)
* Shows total tracked time in issue and milestone list (#3341)
* TRANSLATION
* Improve English grammar and consistency (#3614)
* DEPLOYMENT
* Allow Gitea to run as different USER in Docker (#3961)
* Provide compressed release binaries (#3991)
* Sign release binaries (#4188)
## [1.4.3](https://github.com/go-gitea/gitea/releases/tag/v1.4.3) - 2018-06-26
* SECURITY
* HTML-escape plain-text READMEs (#4192) (#4214)
* Fix open redirect vulnerability on login screen (#4312) (#4312)
* BUGFIXES
* Fix broken monitoring page when running processes are shown (#4203) (#4208)
* Fix delete comment bug (#4216) (#4228)
* Delete reactions added to issues and comments when deleting repository (#4232) (#4237)
* Fix wiki URL encoding bug (#4091) (#4254)
* Fix code tab link when viewing tags (#3908) (#4263)
* Fix webhook type conflation (#4285) (#4285)
## [1.4.2](https://github.com/go-gitea/gitea/releases/tag/v1.4.2) - 2018-06-04
* BUGFIXES
* Adjust z-index for floating labels (#3939) (#3950)
* Add missing token validation on application settings page (#3976) #3978
* Webhook and hook_task clean up (#4006)
* Fix webhook bug of response info is not displayed in UI (#4023)
* Fix writer cannot read bare repo guide (#4033) (#4039)
* Don't force due date to current time (#3830) (#4057)
* Fix wiki redirects (#3919) (#4065)
* Fix attachment ENABLED (#4064) (#4066)
* Added deletion of an empty line at the end of file (#4054) (#4074)
* Use ResolveReference instead of path.Join (#4073)
* Fix #4081 Check for leading / in base before removing it (#4083)
* Respository's home page not updated after first push (#4075)
## [1.4.1](https://github.com/go-gitea/gitea/releases/tag/v1.4.1) - 2018-05-03
* BREAKING
* Add "error" as reserved username (#3882) (#3886)
* SECURITY
* Do not allow inactive users to access repositories using private key (#3887) (#3889)
* Fix path cleanup in file editor, when initilizing new repository and LFS oids (#3871) (#3873)
* Remove unnecessary allowed safe HTML (#3778) (#3779)
* Correctly check http git access rights for reverse proxy authorized users (#3721) (#3743)
* BUGFIXES
* Fix to use only needed columns from tables to get repository git paths (#3870) (#3883)
* Fix GPG expire time display when time is zero (#3584) (#3884)
* Fix to update only issue last update time when adding a comment (#3855) (#3860)
* Fix repository star count after deleting user (#3781) (#3783)
* Use the active branch for the code tab (#3720) (#3776)
* Set default branch name on first push (#3715) (#3723)
* Show clipboard button if disable HTTP of git protocol (#3773) (#3774)
## [1.4.0](https://github.com/go-gitea/gitea/releases/tag/v1.4.0) - 2018-03-25
* BREAKING
* Drop deprecated GOGS\_WORK\_DIR use (#2946)
* Fix API status code for hook creation (#2814)
* SECURITY
* Escape branch name in dropdown menu (#3691) (#3692)
* Refactor and simplify to correctly validate redirect to URL (#3674) (#3676)
* Fix escaping changed title in comments (#3530) (#3534)
 * Escape search query (#3486) (#3488)
* Sanitize logs for mirror sync (#3057)
* FEATURE
* Serve .patch and .diff for pull requests (#3305, #3293)
* Add repo-sync-releases admin command (#3254)
* Support default private when creating or migrating repository (#3239)
* Writable deploy keys (closes #671) (#3225)
* Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Added progressbar for issues with checkboxes (#1146). (#3171)
* Mention completion for issue editor. (#3136)
* Add 'mark all read' option to notifications (#3097)
* Git LFS lock api (#2938)
* Add reactions to issues/PR and comments (#2856)
* Add dingtalk webhook (#2777)
* Responsive view (#2750)
* BUGFIXES
* Fix wiki inter-links with spaces (#3560) (#3632)
* Fix query protected branch bug (#3563) (#3571)
* Fix remove team member issue (#3566) (#3570)
* Fix the protected branch panic issue (#3567) (#3569)
* If Mirrors repository no content is fetched, updated time should not be changed (#3551) (#3565)
* Bug fix for mirrored repository releases sorted (#3522) (#3555)
* Add issue closed time column to fix activity closed issues list (#3537) (#3540)
 * Update markbates/goth library to support OAuth2 with new dropbox API (#3533) (#3539)
 * Fixes missing avatars in offline mode (#3471) (#3477)
 * Fix synchronization bug in repo indexer (#3455) (#3461)
 * Fix rendering of wiki page list if wiki repo contains other files (#3454) (#3463)
* Fix webhook X-GitHub-* headers casing for better compatibility (#3429)
* Add content type and doctype to requests made with go-get (#3426, #3423)
* Fix SQL type error for webhooks (#3424)
* Fix PR merge error (#3421)
* Recognize more characters in crossreferenced repo name (#3413)
* Fix MSSQL bug on org (#3405)
* HTML escape all lines of the search result (#3402)
* Change local copy origin url after repository rename (#3399)
* Force-push to base repo's ref/pull/#/head (#3393)
* Fix bug when a user delete but assigned on issue (#3318)
* Use issue number/index instead of id for API URL. Fix #3297 (#3298)
* Fix repo-transfer-and-team-repo-count bug (#3241)
* Fix always-on SSL Mode checkbox in admin page (#3208)
* Fix source download link when no code unit allowed (#3166)
* Fix org owner cannot be removed if he is not in owner team (#3164)
* Fix run web with -p push failed (#3154)
* Fix gpg tmpl (#3153)
* Fix SSH auth lfs locks (#3152)
* Improvements for supporting UI Location (#3146)
* Fix new pull request link (#3133)
* Fix missing branch in release bug (#3108)
* Allow adding collaborators with (fullname) (#3103)
* Fix repo links (#3093)
* fix lfs url refs + keep path upper/lowercase in db. (#3092)
* Fix redis session failed (#3086)
* Fix bugs in issue dashboard stats (#3073)
* Fix avatar URLs (#3069)
* Fix ref parsing in commit messages (#3067)
* Fix issue list branch link broken (#3061)
* sendmail: correct option to set envelope-sender (#3044)
* Fix missing password length check when change password (#3039)
* Fix git lfs path (#3016)
* Fix API-Endpoint release (#3005) (#3012)
* Set OpenID support on by default when installing new instance (#3010)
* Various wiki bug fixes (#2996)
* Fix go-get, src and raw urls to new scheme (#2978)
* Fix error when add user has full name to team (#2973)
* Fix memcache support when value is returned as string always (#2924)
* ENHANCEMENT
* Use GiteaServer as the user agent for http requests (#3404)
* Delete indexer DB entries when (re)creating index (#3385)
* Change how merged PR commit info are prepared (#3368)
* Asynchronously populate the repo indexer (#3366)
* Make the default action for the gitea executable that of running the webserver (#3331)
* Templates for extra links in top navbar and repo tool tabs. (#3308)
* Fixed asterisk based tasklist items #3295 (#3296)
* Add more additional template snippets (#3286)
* Open external tracker in blank window, consistently with wiki (#3227)
* Fix repo links on user profile (#3197)
* Enable emoji for wiki view (#3158)
* Small improve on deleting attachements (#3145)
* Reduce overhead of upgrades for users with custom stylesheets/JS (#3051)
* Default log level to Info without hardcoding it in installer (#3041)
* Memory usage improvements (#3013)
* Add fingerprint to ssh key endpoints. (#3009)
* Improve memory usage when reaching diff limits (#2990)
* Expandable commit bodies (#2980)
* Update gitgraph.js to fix blurry commit graph on HiDPI screens (#2957)
* Fix language names (#2955)
* Remove render issue link (#2954)
* Page parameter for repo search API (#2915)
* Apply LANDING\_PAGE config options for logged in users (#2894)
* Enable admin to search by email (#2888)
* Hide add key button if SSH is disabled (#2873)
* Fix comment API paths (#2813)
* Add an option to allow redirect of http port 80 to https. (#1928)
* MISC
* Fix organization profile on mobile devices (#3332)
* Fix guide link for webhooks in repository settings (#3291) (#3292)
* Enable Libravatar by default in new installations (#3287)
* Improve suppressed diff boxes (#3193)
* fix button heights on commits page (#3091)
* Minor copy changes (#3074)
* Sort repos in issues dashboard sidebar (#3072)
* Remove box-shadow from UI, fix dashboard issue (#3065)
* Adjust branch button size (#3063)
* Fix misalignment issue in repo header (#3062)
* Delete a user's public key via admin api (closes #3014) (#3059)
* Dashboard: Fix line height problem in issue titles (#3054)
* Remove duplicate "Max Diff Lines" from config view (#2987)
* Drop unmaintained gogs migration script (#2947)
* App restarts to quickly if it fails to start. (#2945)
* Add owner to delete repo message (#2886)
## [1.3.1](https://github.com/go-gitea/gitea/releases/tag/v1.3.1) - 2017-12-08
* BUGFIXES

View File

@ -11,7 +11,7 @@
- [Translation](#translation)
- [Code review](#code-review)
- [Styleguide](#styleguide)
- [Sign your work](#sign-your-work)
- [Sign-off your work](#sign-off-your-work)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
- [Owners](#owners)
@ -48,10 +48,12 @@ getting free help.
## Discuss your design
The project welcomes submissions. If you want to change or add something,
please let everyone know what you're working on—[file an issue](https://github.com/go-gitea/gitea/issues/new)!
Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals)
before they can be accepted.
The project welcomes submissions. If you want to change or add something,
please let everyone know what you're working on—[file an issue](https://github.com/go-gitea/gitea/issues/new)!
Significant changes must go through the change proposal process
before they can be accepted. To create a proposal, file an issue with
your proposed changes documented, and make sure to note in the title
of the issue that it is a proposal.
This process gives everyone a chance to validate the design, helps
prevent duplication of effort, and ensures that the idea fits inside
@ -67,14 +69,14 @@ and keep the compatibility on upgrade. To make sure you are
running the test suite exactly like we do, you should install
the CLI for [Drone CI](https://github.com/drone/drone), as
we are using the server for continous testing, following [these
instructions](http://readme.drone.io/usage/getting-started-cli). After that,
you can simply call `drone exec` within your working directory and it will try
to run the test suite locally.
instructions](http://docs.drone.io/cli-installation/). After that,
you can simply call `drone exec --local --build-event "pull_request"` within
your working directory and it will try to run the test suite locally.
## Vendoring
We keep a cached copy of dependencies within the `vendor/` directory,
managing updates via [govendor](http://github.com/kardianos/govendor).
managing updates via [dep](https://github.com/golang/dep).
Pull requests should only include `vendor/` updates if they are part of
the same change, be it a bugfix or a feature addition.
@ -83,6 +85,8 @@ The `vendor/` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
You can find more information on how to get started with it on the [dep project website](https://golang.github.io/dep/docs/introduction.html).
## Translation
We do all translation work inside [Crowdin](https://crowdin.com/project/gitea).
@ -98,7 +102,7 @@ Generally, the go build tools are installed as-needed in the `Makefile`.
An exception are the tools to build the CSS and images.
- To build CSS: Install [Node.js](https://nodejs.org/en/download/package-manager)
with `npm` and then run `npm install` and `make stylesheets`.
with `npm` and then run `npm install` and `make generate-stylesheets`.
- To build Images: ImageMagick, inkscape and zopflipng binaries must be
available in your `PATH` to run `make generate-images`.
@ -109,8 +113,8 @@ makes the change, even if they are an owner or a maintainer. We use GitHub's
pull request workflow to do that. And, we also use [LGTM](http://lgtm.co)
to ensure every PR is reviewed by at least 2 maintainers.
Please try to make your pull request easy to review for us. And, please read
the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md)* guide;
Please try to make your pull request easy to review for us. And, please read
the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews)* guide;
it has lots of useful tips for any project you may want to contribute.
Some of the key points:
@ -172,11 +176,11 @@ obtain a final version that is maintained in this branch. A release is
maintained by issuing patch releases to only correct critical problems
such as crashes or security issues.
Major release cycles are bimonthly. They always begin on the 25th and end on
the 24th (i.e., the 25th of December to February 24th).
Major release cycles are bimonthly. They always begin on the 25th and end on
the 24th (i.e., the 25th of December to February 24th).
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.
@ -197,6 +201,10 @@ an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team.
For security reasons, Maintainers should use 2FA for their accounts and
if possible provide gpg signed commits.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
https://help.github.com/articles/signing-commits-with-gpg/
## Owners
@ -207,6 +215,9 @@ be the main owner, and the other two the assistant owners. When the new
owners have been elected, the old owners will give up ownership to the
newly elected owners. If an owner is unable to do so, the other owners
will assist in ceding ownership to the newly elected owners.
For security reasons, Owners or any account with write access (like a bot)
must use 2FA.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
After the election, the new owners should proactively agree
with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the
@ -227,6 +238,11 @@ they served:
* [Thomas Boerger](https://github.com/tboerger) <thomas@webhippie.de>
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
* 2018-01-01 ~ 2018-12-31
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
## Versions
Gitea has the `master` branch as a tip branch and has version branches
@ -245,7 +261,7 @@ be reviewed by two maintainers and must pass the automatic tests.
Code that you contribute should use the standard copyright header:
```
// Copyright 2017 The Gitea Authors. All rights reserved.
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
```

View File

@ -1,21 +1,41 @@
FROM alpine:3.6
LABEL maintainer="The Gitea Authors"
###################################
#Build stage
FROM golang:1.10-alpine3.7 AS build-env
ARG GITEA_VERSION
ARG TAGS="sqlite"
ENV TAGS "bindata $TAGS"
#Build deps
RUN apk --no-cache add build-base git
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean generate build
FROM alpine:3.7
LABEL maintainer="maintainers@gitea.io"
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
ca-certificates \
curl \
gettext \
git \
linux-pam \
s6 \
curl \
openssh \
gettext \
s6 \
sqlite \
su-exec \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
@ -30,7 +50,6 @@ RUN addgroup \
ENV USER git
ENV GITEA_CUSTOM /data/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
@ -38,4 +57,4 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker /
COPY gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea

View File

@ -1,43 +0,0 @@
FROM multiarch/alpine:aarch64-v3.6
LABEL maintainer="The Gitea Authors"
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
openssh \
gettext \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea
COPY docker /
COPY gitea /app/gitea/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

View File

@ -1,41 +0,0 @@
FROM multiarch/alpine:armhf-v3.6
LABEL maintainer="The Gitea Authors"
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
openssh \
gettext \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker /
COPY gitea /app/gitea/gitea

880
Gopkg.lock generated Normal file

File diff suppressed because it is too large Load Diff

106
Gopkg.toml Normal file
View File

@ -0,0 +1,106 @@
ignored = ["google.golang.org/appengine*"]
[prune]
go-tests = true
unused-packages = true
non-go = true
[[constraint]]
branch = "master"
name = "code.gitea.io/git"
[[constraint]]
branch = "master"
name = "code.gitea.io/sdk"
[[constraint]]
revision = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94"
name = "golang.org/x/crypto"
[[constraint]]
revision = "a646d33e2ee3172a661fc09bca23bb4889a41bc8"
name = "golang.org/x/sys"
[[constraint]]
revision = "2bf8f2a19ec09c670e931282edfe6567f6be21c9"
name = "golang.org/x/text"
[[constraint]]
revision = "f2499483f923065a842d38eb4c7f1927e6fc6e6d"
name = "golang.org/x/net"
[[constraint]]
#version = "v1.0.0"
revision = "33197485abe227dcb254644cf5081c9a3c281669"
name = "github.com/pingcap/tidb"
[[override]]
name = "github.com/go-xorm/xorm"
#version = "0.6.5"
revision = "ad69f7d8f0861a29438154bb0a20b60501298480"
[[override]]
name = "github.com/gorilla/mux"
revision = "757bef944d0f21880861c2dd9c871ca543023cba"
[[constraint]]
name = "github.com/gorilla/context"
version = "1.1.1"
[[constraint]]
name = "github.com/lafriks/xormstore"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/lunny/dingtalk_webhook"
[[constraint]]
name = "github.com/markbates/goth"
version = "1.45.5"
[[constraint]]
branch = "master"
name = "github.com/mcuadros/go-version"
[[constraint]]
branch = "master"
name = "github.com/russross/blackfriday"
[[constraint]]
branch = "master"
name = "github.com/tstranex/u2f"
[[constraint]]
name = "gopkg.in/editorconfig/editorconfig-core-go.v1"
version = "1.2.0"
[[constraint]]
branch = "v2"
name = "gopkg.in/gomail.v2"
[[constraint]]
name = "gopkg.in/ini.v1"
version = "1.31.1"
[[constraint]]
name = "gopkg.in/ldap.v2"
version = "2.4.1"
[[constraint]]
name = "gopkg.in/macaron.v1"
version = "1.2.4"
[[constraint]]
name = "gopkg.in/testfixtures.v2"
version = "2.0.0"
[[override]]
name = "github.com/boltdb/bolt"
revision = "ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7"
source = "github.com/go-gitea/bolt"
[[override]]
revision = "c10ba270aa0bf8b8c1c986e103859c67a9103061"
name = "golang.org/x/oauth2"

View File

@ -7,6 +7,7 @@ Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
Matthias Loibl <mail@matthiasloibl.com> (@metalmatze)
Morgan Bazalgette <the@howl.moe> (@thehowl)
Rachid Zarouali <nobody@nobody.tld> (@xinity)
Rémy Boulanouar <admin@dblk.org> (@DblK)
Sandro Santilli <strk@kbt.io> (@strk)
@ -18,3 +19,8 @@ Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
Peter Žeby <morlinest@gmail.com> (@morlinest)
Matti Ranta <matti@mdranta.net> (@techknowlogick)
Michael Lustfield <mtecknology@debian.org> (@MTecknology)
Jonas Franz <info@jonasfranz.software> (@JonasFranzDEV)
Flynn Lufmons <fluf@warpmail.net> (@flufmonster)
Alexey Terentyev <axifnx@gmail.com> (@axifive)

125
Makefile
View File

@ -15,14 +15,25 @@ else
endif
BINDATA := modules/{options,public,templates}/bindata.go
DOCKER_TAG := gitea/gitea:latest
GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
GOFMT ?= gofmt -s
GOFLAGS := -i -v
EXTRA_GOFLAGS ?=
LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)"
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
GITEA_VERSION := $(VERSION)
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
GITEA_VERSION := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
LDFLAGS := -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))
SOURCES ?= $(shell find . -name "*.go" -type f)
@ -46,19 +57,11 @@ else
EXECUTABLE := gitea
endif
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
endif
.PHONY: all
all: build
include docker/Makefile
.PHONY: clean
clean:
$(GO) clean -i ./...
@ -90,6 +93,22 @@ generate-swagger:
fi
swagger generate spec -o ./public/swagger.v1.json
.PHONY: swagger-check
swagger-check: generate-swagger
@diff=$$(git diff public/swagger.v1.json); \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-swagger' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
.PHONY: swagger-validate
swagger-validate:
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
fi
swagger validate ./public/swagger.v1.json
.PHONY: errcheck
errcheck:
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
@ -130,38 +149,35 @@ fmt-check:
.PHONY: test
test:
$(GO) test $(PACKAGES)
$(GO) test -tags=sqlite $(PACKAGES)
.PHONY: coverage
coverage:
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/wadey/gocovmerge; \
fi
echo "mode: set" > coverage.all
for PKG in $(PACKAGES); do\
egrep "$$PKG[^/]*\.go" integration.coverage.out > int.coverage.out;\
gocovmerge $$GOPATH/src/$$PKG/coverage.out int.coverage.out > pkg.coverage.out;\
grep -h -v "^mode:" pkg.coverage.out >> coverage.all;\
mv pkg.coverage.out $$GOPATH/src/$$PKG/coverage.out;\
rm int.coverage.out;\
done;
gocovmerge integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all;\
.PHONY: unit-test-coverage
unit-test-coverage:
for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
.PHONY: vendor
vendor:
@hash dep > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/golang/dep/cmd/dep; \
fi
dep ensure -vendor-only
.PHONY: test-vendor
test-vendor:
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/kardianos/govendor; \
fi
govendor list +unused | tee "$(TMPDIR)/wc-gitea-unused"
[ $$(cat "$(TMPDIR)/wc-gitea-unused" | wc -l) -eq 0 ] || echo "Warning: /!\\ Some vendor are not used /!\\"
govendor list +outside | tee "$(TMPDIR)/wc-gitea-outside"
[ $$(cat "$(TMPDIR)/wc-gitea-outside" | wc -l) -eq 0 ] || exit 1
govendor status || exit 1
test-vendor: vendor
@diff=$$(git diff vendor/); \
if [ -n "$$diff" ]; then \
echo "Please run 'make vendor' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
#TODO add dep status -missing when implemented
.PHONY: test-sqlite
test-sqlite: integrations.sqlite.test
@ -180,35 +196,32 @@ generate-ini:
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
.PHONY: test-mysql
test-mysql: integrations.mysql.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
test-mysql: integrations.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test
.PHONY: test-pgsql
test-pgsql: integrations.pgsql.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
test-pgsql: integrations.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
.PHONY: bench-sqlite
bench-sqlite: integrations.sqlite.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.bench .
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
.PHONY: bench-mysql
bench-mysql: integrations.mysql.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.bench .
bench-mysql: integrations.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
.PHONY: bench-pgsql
bench-pgsql: integrations.pgsql.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.bench .
bench-pgsql: integrations.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
.PHONY: integration-test-coverage
integration-test-coverage: integrations.cover.test generate-ini
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
integrations.mysql.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.mysql.test
integrations.pgsql.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
integrations.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.test
integrations.sqlite.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite'
@ -229,13 +242,8 @@ build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES)
$(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
.PHONY: docker
docker:
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" webhippie/golang:edge make clean generate build
docker build -t $(DOCKER_TAG) .
.PHONY: release
release: release-dirs release-windows release-linux release-darwin release-copy release-check
release: release-dirs release-windows release-linux release-darwin release-copy release-compress release-check
.PHONY: release-dirs
release-dirs:
@ -279,6 +287,13 @@ release-copy:
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-compress
release-compress:
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
fi
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),gxz -k -9 $(notdir $(file));)
.PHONY: javascripts
javascripts: public/js/index.js
@ -297,12 +312,12 @@ stylesheets-check: generate-stylesheets
.PHONY: generate-stylesheets
generate-stylesheets:
node_modules/.bin/lessc --no-ie-compat --clean-css public/less/index.less public/css/index.css
node_modules/.bin/lessc --clean-css public/less/index.less public/css/index.css
.PHONY: swagger-ui
swagger-ui:
rm -Rf public/vendor/assets/swagger-ui
git clone --depth=10 -b v3.3.2 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
git clone --depth=10 -b v3.13.4 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
mv $(TMPDIR)/swagger-ui/dist public/vendor/assets/swagger-ui
rm -Rf $(TMPDIR)/swagger-ui
$(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../../swagger.v1.json;g" public/vendor/assets/swagger-ui/index.html

View File

@ -4,19 +4,13 @@
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![Join the Matrix chat at https://matrix.to/#/#gitea:matrix.org](https://img.shields.io/badge/matrix-%23gitea%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gitea:matrix.org)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea)
## Purpose
@ -31,24 +25,37 @@ This project has been
[forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from
[Gogs](https://gogs.io) since 2016.11 but changed a lot.
## Notes
## Building
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
3. If you're interested in using our APIs, we have experimental support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
From the root of the source tree, run:
## Docs
make generate all
For more information and instructions about how to install Gitea, please look
at our [documentation](https://docs.gitea.io/en-us/). If you have questions
that are not covered by the documentation, you can get in contact with us on
our [Discord server](https://discord.gg/NsatcWJ),
[Matrix room](https://matrix.to/#/#gitea:matrix.org),
or [forum](https://discourse.gitea.io/)!
More info: https://docs.gitea.io/en-us/install-from-source/
## Using
./gitea web
NOTE: If you're interested in using our APIs, we have experimental
support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
## Contributing
Fork -> Patch -> Push -> Pull Request
Expected workflow is: Fork -> Patch -> Push -> Pull Request
NOTES:
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
## Further information
For more information and instructions about how to install Gitea, please look
at our [documentation](https://docs.gitea.io/en-us/). If you have questions
that are not covered by the documentation, you can get in contact with us on
our [Discord server](https://discord.gg/NsatcWJ),
or [forum](https://discourse.gitea.io/)!
## Authors
@ -56,8 +63,45 @@ Fork -> Patch -> Push -> Pull Request
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
* [Translators](options/locale/TRANSLATORS)
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)]
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)]
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
## License
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file
for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|

View File

@ -8,7 +8,8 @@
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea)
| | | |
|:---:|:---:|:---:|

View File

@ -8,7 +8,9 @@ package cmd
import (
"fmt"
"code.gitea.io/git"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
@ -18,12 +20,12 @@ var (
// CmdAdmin represents the available admin sub-command.
CmdAdmin = cli.Command{
Name: "admin",
Usage: "Perform admin operations on command line",
Description: `Allow using internal logic of Gitea without hacking into the source code
to make automatic initialization process more smoothly`,
Usage: "Command line interface to perform common administrative operations",
Subcommands: []cli.Command{
subcmdCreateUser,
subcmdChangePassword,
subcmdRepoSyncReleases,
subcmdRegenerate,
},
}
@ -34,17 +36,14 @@ to make automatic initialization process more smoothly`,
Flags: []cli.Flag{
cli.StringFlag{
Name: "name",
Value: "",
Usage: "Username",
},
cli.StringFlag{
Name: "password",
Value: "",
Usage: "User password",
},
cli.StringFlag{
Name: "email",
Value: "",
Usage: "User email address",
},
cli.BoolFlag{
@ -74,62 +73,97 @@ to make automatic initialization process more smoothly`,
Value: "",
Usage: "New password to set for user",
},
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}
subcmdRepoSyncReleases = cli.Command{
Name: "repo-sync-releases",
Usage: "Synchronize repository releases with tags",
Action: runRepoSyncReleases,
}
subcmdRegenerate = cli.Command{
Name: "regenerate",
Usage: "Regenerate specific files",
Subcommands: []cli.Command{
microcmdRegenHooks,
microcmdRegenKeys,
},
}
microcmdRegenHooks = cli.Command{
Name: "hooks",
Usage: "Regenerate git-hooks",
Action: runRegenerateHooks,
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}
microcmdRegenKeys = cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Action: runRegenerateKeys,
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}
)
func runChangePassword(c *cli.Context) error {
if !c.IsSet("password") {
return fmt.Errorf("Password is not specified")
} else if !c.IsSet("username") {
return fmt.Errorf("Username is not specified")
}
setting.NewContext()
models.LoadConfigs()
setting.NewXORMLogService(false)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
}
uname := c.String("username")
user, err := models.GetUserByName(uname)
if err != nil {
return fmt.Errorf("%v", err)
}
user.Passwd = c.String("password")
if user.Salt, err = models.GetUserSalt(); err != nil {
return fmt.Errorf("%v", err)
}
user.EncodePasswd()
if err := models.UpdateUserCols(user, "passwd", "salt"); err != nil {
return fmt.Errorf("%v", err)
}
fmt.Printf("User '%s' password has been successfully updated!\n", uname)
return nil
}
func runCreateUser(c *cli.Context) error {
if !c.IsSet("name") {
return fmt.Errorf("Username is not specified")
} else if !c.IsSet("password") {
return fmt.Errorf("Password is not specified")
} else if !c.IsSet("email") {
return fmt.Errorf("Email is not specified")
if err := argsSet(c, "username", "password"); err != nil {
return err
}
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
setting.NewContext()
models.LoadConfigs()
if err := initDB(); err != nil {
return err
}
setting.NewXORMLogService(false)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
uname := c.String("username")
user, err := models.GetUserByName(uname)
if err != nil {
return err
}
if user.Salt, err = models.GetUserSalt(); err != nil {
return err
}
user.HashPassword(c.String("password"))
if err := models.UpdateUserCols(user, "passwd", "salt"); err != nil {
return err
}
fmt.Printf("%s's password has been successfully updated!\n", user.Name)
return nil
}
func runCreateUser(c *cli.Context) error {
if err := argsSet(c, "name", "password", "email"); err != nil {
return err
}
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
if err := initDB(); err != nil {
return err
}
if err := models.CreateUser(&models.User{
@ -145,3 +179,86 @@ func runCreateUser(c *cli.Context) error {
fmt.Printf("New user '%s' has been successfully created!\n", c.String("name"))
return nil
}
func runRepoSyncReleases(c *cli.Context) error {
if err := initDB(); err != nil {
return err
}
log.Trace("Synchronizing repository releases (this may take a while)")
for page := 1; ; page++ {
repos, count, err := models.SearchRepositoryByName(&models.SearchRepoOptions{
Page: page,
PageSize: models.RepositoryListDefaultPageSize,
Private: true,
})
if err != nil {
return fmt.Errorf("SearchRepositoryByName: %v", err)
}
if len(repos) == 0 {
break
}
log.Trace("Processing next %d repos of %d", len(repos), count)
for _, repo := range repos {
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RepoPath())
gitRepo, err := git.OpenRepository(repo.RepoPath())
if err != nil {
log.Warn("OpenRepository: %v", err)
continue
}
oldnum, err := getReleaseCount(repo.ID)
if err != nil {
log.Warn(" GetReleaseCountByRepoID: %v", err)
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
if err = models.SyncReleasesWithTags(repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
continue
}
count, err = getReleaseCount(repo.ID)
if err != nil {
log.Warn(" GetReleaseCountByRepoID: %v", err)
continue
}
log.Trace(" repo %s releases synchronized to tags: from %d to %d",
repo.FullName(), oldnum, count)
}
}
return nil
}
func getReleaseCount(id int64) (int64, error) {
return models.GetReleaseCountByRepoID(
id,
models.FindReleasesOptions{
IncludeTags: true,
},
)
}
func runRegenerateHooks(c *cli.Context) error {
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
if err := initDB(); err != nil {
return err
}
return models.SyncRepositoryHooks()
}
func runRegenerateKeys(c *cli.Context) error {
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
if err := initDB(); err != nil {
return err
}
return models.RewriteAllPublicKeys()
}

View File

@ -90,16 +90,16 @@ func pemBlockForKey(priv interface{}) *pem.Block {
}
}
func runCert(ctx *cli.Context) error {
if len(ctx.String("host")) == 0 {
log.Fatal("Missing required --host parameter")
func runCert(c *cli.Context) error {
if err := argsSet(c, "host"); err != nil {
return err
}
var priv interface{}
var err error
switch ctx.String("ecdsa-curve") {
switch c.String("ecdsa-curve") {
case "":
priv, err = rsa.GenerateKey(rand.Reader, ctx.Int("rsa-bits"))
priv, err = rsa.GenerateKey(rand.Reader, c.Int("rsa-bits"))
case "P224":
priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader)
case "P256":
@ -109,23 +109,23 @@ func runCert(ctx *cli.Context) error {
case "P521":
priv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
default:
log.Fatalf("Unrecognized elliptic curve: %q", ctx.String("ecdsa-curve"))
log.Fatalf("Unrecognized elliptic curve: %q", c.String("ecdsa-curve"))
}
if err != nil {
log.Fatalf("Failed to generate private key: %v", err)
}
var notBefore time.Time
if len(ctx.String("start-date")) == 0 {
notBefore = time.Now()
} else {
notBefore, err = time.Parse("Jan 2 15:04:05 2006", ctx.String("start-date"))
if startDate := c.String("start-date"); startDate != "" {
notBefore, err = time.Parse("Jan 2 15:04:05 2006", startDate)
if err != nil {
log.Fatalf("Failed to parse creation date: %v", err)
}
} else {
notBefore = time.Now()
}
notAfter := notBefore.Add(ctx.Duration("duration"))
notAfter := notBefore.Add(c.Duration("duration"))
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
@ -147,7 +147,7 @@ func runCert(ctx *cli.Context) error {
BasicConstraintsValid: true,
}
hosts := strings.Split(ctx.String("host"), ",")
hosts := strings.Split(c.String("host"), ",")
for _, h := range hosts {
if ip := net.ParseIP(h); ip != nil {
template.IPAddresses = append(template.IPAddresses, ip)
@ -156,7 +156,7 @@ func runCert(ctx *cli.Context) error {
}
}
if ctx.Bool("ca") {
if c.Bool("ca") {
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
}

38
cmd/cmd.go Normal file
View File

@ -0,0 +1,38 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Package cmd provides subcommands to the gitea binary - such as "web" or
// "admin".
package cmd
import (
"errors"
"fmt"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
// argsSet checks that all the required arguments are set. args is a list of
// arguments that must be set in the passed Context.
func argsSet(c *cli.Context, args ...string) error {
for _, a := range args {
if !c.IsSet(a) {
return errors.New(a + " is not set")
}
}
return nil
}
func initDB() error {
setting.NewContext()
models.LoadConfigs()
setting.NewXORMLogService(false)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
}
return nil
}

View File

@ -68,19 +68,19 @@ func runDump(ctx *cli.Context) error {
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
log.Fatalf("Path does not exist: %s", tmpDir)
}
TmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
tmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
if err != nil {
log.Fatalf("Failed to create tmp work directory: %v", err)
}
log.Printf("Creating tmp work dir: %s", TmpWorkDir)
log.Printf("Creating tmp work dir: %s", tmpWorkDir)
// work-around #1103
if os.Getenv("TMPDIR") == "" {
os.Setenv("TMPDIR", TmpWorkDir)
os.Setenv("TMPDIR", tmpWorkDir)
}
reposDump := path.Join(TmpWorkDir, "gitea-repo.zip")
dbDump := path.Join(TmpWorkDir, "gitea-db.sql")
reposDump := path.Join(tmpWorkDir, "gitea-repo.zip")
dbDump := path.Join(tmpWorkDir, "gitea-db.sql")
log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
zip.Verbose = ctx.Bool("verbose")
@ -146,10 +146,10 @@ func runDump(ctx *cli.Context) error {
log.Printf("Can't change file access permissions mask to 0600: %v", err)
}
log.Printf("Removing tmp work dir: %s", TmpWorkDir)
log.Printf("Removing tmp work dir: %s", tmpWorkDir)
if err := os.RemoveAll(TmpWorkDir); err != nil {
log.Fatalf("Failed to remove %s: %v", TmpWorkDir, err)
if err := os.RemoveAll(tmpWorkDir); err != nil {
log.Fatalf("Failed to remove %s: %v", tmpWorkDir, err)
}
log.Printf("Finish dumping in file %s", fileName)

83
cmd/generate.go Normal file
View File

@ -0,0 +1,83 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"code.gitea.io/gitea/modules/generate"
"github.com/urfave/cli"
)
var (
// CmdGenerate represents the available generate sub-command.
CmdGenerate = cli.Command{
Name: "generate",
Usage: "Command line interface for running generators",
Subcommands: []cli.Command{
subcmdSecret,
},
}
subcmdSecret = cli.Command{
Name: "secret",
Usage: "Generate a secret token",
Subcommands: []cli.Command{
microcmdGenerateInternalToken,
microcmdGenerateLfsJwtSecret,
microcmdGenerateSecretKey,
},
}
microcmdGenerateInternalToken = cli.Command{
Name: "INTERNAL_TOKEN",
Usage: "Generate a new INTERNAL_TOKEN",
Action: runGenerateInternalToken,
}
microcmdGenerateLfsJwtSecret = cli.Command{
Name: "LFS_JWT_SECRET",
Usage: "Generate a new LFS_JWT_SECRET",
Action: runGenerateLfsJwtSecret,
}
microcmdGenerateSecretKey = cli.Command{
Name: "SECRET_KEY",
Usage: "Generate a new SECRET_KEY",
Action: runGenerateSecretKey,
}
)
func runGenerateInternalToken(c *cli.Context) error {
internalToken, err := generate.NewInternalToken()
if err != nil {
return err
}
fmt.Printf("%s\n", internalToken)
return nil
}
func runGenerateLfsJwtSecret(c *cli.Context) error {
JWTSecretBase64, err := generate.NewLfsJwtSecret()
if err != nil {
return err
}
fmt.Printf("%s\n", JWTSecretBase64)
return nil
}
func runGenerateSecretKey(c *cli.Context) error {
secretKey, err := generate.NewSecretKey()
if err != nil {
return err
}
fmt.Printf("%s\n", secretKey)
return nil
}

View File

@ -37,7 +37,7 @@ var (
},
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpadte,
subcmdHookUpdate,
subcmdHookPostReceive,
},
}
@ -48,7 +48,7 @@ var (
Description: "This command should only be called by Git",
Action: runHookPreReceive,
}
subcmdHookUpadte = cli.Command{
subcmdHookUpdate = cli.Command{
Name: "update",
Usage: "Delegate update Git hook",
Description: "This command should only be called by Git",

View File

@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/Unknwon/com"
"github.com/dgrijalva/jwt-go"
@ -158,18 +159,10 @@ func runServ(c *cli.Context) error {
}
os.Setenv(models.EnvRepoName, reponame)
repoUser, err := models.GetUserByName(username)
if err != nil {
if models.IsErrUserNotExist(err) {
fail("Repository owner does not exist", "Unregistered owner: %s", username)
}
fail("Internal error", "Failed to get repository owner (%s): %v", username, err)
}
repo, err := models.GetRepositoryByName(repoUser.ID, reponame)
repo, err := models.GetRepositoryByOwnerAndName(username, reponame)
if err != nil {
if models.IsErrRepoNotExist(err) {
fail(accessDenied, "Repository does not exist: %s/%s", repoUser.Name, reponame)
fail(accessDenied, "Repository does not exist: %s/%s", username, reponame)
}
fail("Internal error", "Failed to get repository: %v", err)
}
@ -227,8 +220,8 @@ func runServ(c *cli.Context) error {
fail("Internal error", "GetDeployKey: %v", err)
}
deployKey.Updated = time.Now()
if err = models.UpdateDeployKey(deployKey); err != nil {
deployKey.UpdatedUnix = util.TimeStampNow()
if err = models.UpdateDeployKeyCols(deployKey, "updated_unix"); err != nil {
fail("Internal error", "UpdateDeployKey: %v", err)
}
} else {
@ -237,6 +230,12 @@ func runServ(c *cli.Context) error {
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
}
if !user.IsActive || user.ProhibitLogin {
fail("Your account is not active or has been disabled by Administrator",
"User %s is disabled and have no access to repository %s",
user.Name, repoPath)
}
mode, err := models.AccessLevel(user.ID, repo)
if err != nil {
fail("Internal error", "Failed to check access: %v", err)
@ -263,15 +262,19 @@ func runServ(c *cli.Context) error {
//LFS token authentication
if verb == lfsAuthenticateVerb {
url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, repoUser.Name, repo.Name)
url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, username, repo.Name)
now := time.Now()
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
claims := jwt.MapClaims{
"repo": repo.ID,
"op": lfsVerb,
"exp": now.Add(5 * time.Minute).Unix(),
"exp": now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
"nbf": now.Unix(),
})
}
if user != nil {
claims["user"] = user.ID
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
// Sign and get the complete encoded token as a string using the secret
tokenString, err := token.SignedString(setting.LFS.JWTSecretBytes)

View File

@ -51,6 +51,26 @@ and it takes care of all the other things for you`,
},
}
func runHTTPRedirector() {
source := fmt.Sprintf("%s:%s", setting.HTTPAddr, setting.PortToRedirect)
dest := strings.TrimSuffix(setting.AppURL, "/")
log.Info("Redirecting: %s to %s", source, dest)
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
target := dest + r.URL.Path
if len(r.URL.RawQuery) > 0 {
target += "?" + r.URL.RawQuery
}
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
})
var err = runHTTP(source, context2.ClearHandler(handler))
if err != nil {
log.Fatal(4, "Failed to start port redirection: %v", err)
}
}
func runWeb(ctx *cli.Context) error {
if ctx.IsSet("config") {
setting.CustomConf = ctx.String("config")
@ -101,11 +121,9 @@ func runWeb(ctx *cli.Context) error {
}
}
var listenAddr string
if setting.Protocol == setting.UnixSocket {
listenAddr = fmt.Sprintf("%s", setting.HTTPAddr)
} else {
listenAddr = fmt.Sprintf("%s:%s", setting.HTTPAddr, setting.HTTPPort)
listenAddr := setting.HTTPAddr
if setting.Protocol != setting.UnixSocket {
listenAddr += ":" + setting.HTTPPort
}
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
@ -115,6 +133,7 @@ func runWeb(ctx *cli.Context) error {
if setting.EnablePprof {
go func() {
log.Info("Starting pprof server on localhost:6060")
log.Info("%v", http.ListenAndServe("localhost:6060", nil))
}()
}
@ -124,6 +143,9 @@ func runWeb(ctx *cli.Context) error {
case setting.HTTP:
err = runHTTP(listenAddr, context2.ClearHandler(m))
case setting.HTTPS:
if setting.RedirectOtherPort {
go runHTTPRedirector()
}
err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m))
case setting.FCGI:
listener, err := net.Listen("tcp", listenAddr)

View File

@ -24,8 +24,8 @@
# Default values
NAME=gitea
GITEA_HOME=/home/git/gitea
GITEA_PATH=${GITEA_HOME}/$NAME
GITEA_HOME=/var/lib/${NAME}
GITEA_PATH=/usr/local/bin/${NAME}
GITEA_USER=git
SERVICENAME="Gitea - Git with a cup of tea"
LOCKFILE=/var/lock/subsys/gitea
@ -49,11 +49,11 @@ DAEMON_OPTS="--check $NAME"
start() {
cd ${GITEA_HOME}
echo -n "Starting ${SERVICENAME}: "
daemon $DAEMON_OPTS "${GITEA_PATH} web > ${LOGFILE} 2>&1 &"
daemon $DAEMON_OPTS "${GITEA_PATH} web -c /etc/${NAME}/app.ini > ${LOGFILE} 2>&1 &"
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${LOCKFILE}
return $RETVAL
}
@ -63,7 +63,7 @@ stop() {
killproc ${NAME}
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${LOCKFILE}
[ $RETVAL = 0 ] && rm -f ${LOCKFILE}
}
case "$1" in

View File

@ -14,17 +14,20 @@
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Git with a cup of tea"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="Gitea - Git with a cup of tea"
NAME=gitea
SERVICEVERBOSE=yes
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WORKINGDIR=/home/git/gitea
DAEMON=$WORKINGDIR/$NAME
DAEMON_ARGS="web"
WORKINGDIR=/var/lib/$NAME
DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="web -c /etc/$NAME/app.ini"
USER=git
USERBIND="setcap cap_net_bind_service=+ep"
USERBIND=""
# If you want to bind Gitea to a port below 1024 uncomment
# the line below
#USERBIND="setcap cap_net_bind_service=+ep"
STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}"
# Read configuration variable file if it is present
@ -36,7 +39,7 @@ STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}"
do_start()
{
$USERBIND $DAEMON
sh -c "USER=$USER start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\
sh -c "USER=$USER HOME=/home/$USER GITEA_WORK_DIR=$WORKINGDIR start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\
--background --chdir $WORKINGDIR --chuid $USER \\
--exec $DAEMON -- $DAEMON_ARGS"
}

View File

@ -19,9 +19,9 @@ load_rc_config $name
: ${gitea_user:="git"}
: ${gitea_enable:="NO"}
: ${gitea_directory:="/home/git"}
: ${gitea_directory:="/var/lib/gitea"}
command="${gitea_directory}/gitea web"
command="/usr/local/bin/gitea web -c /etc/gitea/app.ini"
procname="$(echo $command |cut -d' ' -f1)"
pidfile="${gitea_directory}/${name}.pid"
@ -33,6 +33,7 @@ gitea_start() {
cd ${gitea_directory}
export USER=${gitea_user}
export HOME=/usr/home/${gitea_user}
export GITEA_WORK_DIR=${gitea_directory}
/usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command
}

View File

@ -1,11 +1,11 @@
#!/sbin/openrc-run
DIR=/home/git/gitea
DIR=/var/lib/gitea
USER=git
start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
command="${DIR}/gitea"
command_args="web"
command="/usr/local/bin/gitea"
command_args="web -c /etc/gitea/app.ini"
command_background=yes
pidfile=/var/run/gitea.pid

View File

@ -2,11 +2,11 @@
#
# $OpenBSD$
daemon="/home/git/gitea/gitea"
daemon="/usr/local/bin/gitea"
daemon_user="git"
daemon_flags="web"
daemon_flags="web -c /etc/gitea/app.ini"
gitea_directory="/home/git/gitea"
gitea_directory="/var/lib/gitea"
rc_bg=YES

View File

@ -0,0 +1,46 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="export">
<service name="gitea" type="service" version="1">
<create_default_instance enabled="false"/>
<dependency name="network" grouping="require_all" restart_on="refresh" type="service">
<service_fmri value="svc:/milestone/network:default"/>
</dependency>
<dependency name="filesystem" grouping="require_all" restart_on="refresh" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<exec_method
type="method"
name="start"
exec="/opt/local/bin/gitea web"
timeout_seconds="60">
<method_context>
<method_credential user="git" group="git" />
<method_environment>
<envvar name='GITEA_WORK_DIR' value='/opt/local/share/gitea'/>
<envvar name='GITEA_CUSTOM' value='/opt/local/etc/gitea'/>
<envvar name='HOME' value='/var/db/gitea'/>
<envvar name='PATH' value='/opt/local/bin:${PATH}'/>
<envvar name='USER' value='git'/>
</method_environment>
</method_context>
</exec_method>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
<property_group name="application" type="application"></property_group>
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="child"/>
<propval name="ignore_error" type="astring" value="core,signal"/>
</property_group>
<template>
<common_name>
<loctext xml:lang="C">A painless, self-hosted Git service</loctext>
</common_name>
</template>
</service>
</service_bundle>

View File

@ -18,10 +18,10 @@
# Default values
NAME=gitea
GITEA_HOME=/home/git/gitea
GITEA_PATH=${GITEA_HOME}/$NAME
GITEA_HOME=/var/lib/$NAME
GITEA_PATH=/usr/local/bin/$NAME
GITEA_USER=git
SERVICENAME="Git - with a cup of tea"
SERVICENAME="Gitea - Git with a cup of tea"
LOCKFILE=/var/lock/subsys/gitea
LOGPATH=${GITEA_HOME}/log
LOGFILE=${LOGPATH}/error.log
@ -58,7 +58,7 @@ case "$1" in
# return skipped as service is already running
(exit 5)
else
su - ${GITEA_USER} -c "USER=${GITEA_USER} ${GITEA_PATH} web 2>&1 >>${LOGFILE} &"
su - ${GITEA_USER} -c "USER=${GITEA_USER} GITEA_WORK_DIR=${GITEA_HOME} ${GITEA_PATH} web -c /etc/${NAME}/app.ini 2>&1 >>${LOGFILE} &"
fi
# Remember status and be verbose

Some files were not shown because too many files have changed in this diff Show More