Compare commits

..

308 Commits

Author SHA1 Message Date
eb0ee6bf58 Add 1.6.4 changelog (#5739) 2019-01-15 20:43:07 -05:00
937857e3af fix: use correct value for "MSpan Structures Obtained" #4742 (#5706) (#5715)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2019-01-13 16:32:05 +02:00
f5b43a615c When redirecting clean the path to avoid redirecting to //www.othersite.com (#5669) (#5703)
Fix #5627

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-12 14:57:50 -05:00
1c4293b37f fix public will not be reused as public key after deleting as deploy key (#5671) (#5685) 2019-01-10 09:23:04 -05:00
30560b0f9b Add changelog for 1.6.3 (#5637)
* Add changelog for 1.6.3 and 1.7.0-rc2

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

* Remove 1.7.0 entries

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-01-04 19:14:28 +01:00
6076674d3a SECURITY: protect DeleteFilePost et al with cleanUploadFileName (#5631) (#5634)
This commit wraps more of the TreePaths with cleanUploadFileName

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-04 17:29:36 +01:00
28cc3bd662 Fix wrong text getting saved on editing second comment on an issue. (#5608) (#5615)
* comments: Fix an incorrent DOM element selection.

This commit fixes a bug that was causing text from previously edited
comment to get saved when two comments were edited one after other.
Text area with id of `#content` isn't unique on the page but it was
being treated as unique by the event handling code.

Fixes: #5581.

* templates: Remove `id` from textarea in commit edit form.

An element is assigned an `id` only if it is unique for the whole page
but in this case there can be multiple textarea so it should have one.
2018-12-31 11:52:06 -05:00
2631f7f64d Changelog for 1.6.2 (#5567) 2018-12-21 10:08:46 -05:00
af4626a270 Immediate fix to htmlEncode user added text (#5575)
There are likely problems remaining with the way that initCommentForm
is creating its elements. I suspect that a malformed avatar url could
be used maliciously.
2018-12-21 09:05:47 -05:00
21c70e1ed2 backport 5571 (#5573) 2018-12-21 16:22:56 +08:00
b45d58805a fix indexer reindex bug when gitea restart (#5563) (#5564)
* fix issue indexer bug reindex when restart gitea

* also fix code indexer reindex when gitea restart
2018-12-19 09:51:53 -05:00
200b974e19 Backport #5537 Remove a double slash in the HTTPS redirect with Let's Encrypt (#5539)
Before:

$ curl 0.0.0.0:3001
<a href="https://gitea.example.com:3000//">Found</a>.

After:

$ curl 0.0.0.0:3001
<a href="https://gitea.example.com:3000/">Found</a>.

Fixes #5536
2018-12-13 10:42:38 -05:00
800271ee1f fix bug when a read perm user to edit his issue (#5516) (#5534) 2018-12-12 12:37:22 -05:00
e6362f3d23 fix detect force push failure on deletion of protected branches (#5522) (#5531) 2018-12-12 09:49:47 -05:00
716c2918be Backported #5525 Fix the Let's Encrypt handler (#5527)
* Fix the Let's Encrypt handler by listening on a valid address

Also handle errors in the HTTP server go routine, return a fatal error
when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

    2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
    start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
    permission denied

Closes #5280

* Fix a typo
2018-12-11 13:34:35 -05:00
60d7b614fe fix forgot deletion of notification when delete repository (#5506) (#5514) 2018-12-11 19:09:53 +08:00
9cf9a54dca fix undeleted content when deleting user (#5509) 2018-12-11 10:33:20 +08:00
2b4f87da46 Fix empty wiki (#5504) (#5508)
* fix wiki page when wiki path is exist but empty

* improve the error check
2018-12-10 22:37:56 +02:00
ad9f9cdc30 Add 1.6.1 changelog (#5500) 2018-12-09 21:06:16 +08:00
8237fd4a2d fix topic name length on database (#5493) (#5495) 2018-12-09 02:57:49 +02:00
8e4a0a978a ensure that the closed_at is set for closed (#5450)
right now the `closed_at` field for json responses is not filled during
the `APIIssue` creation for api responses.

For a closed issue you get a result like:
```json
"state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00",
"updated_at":"2018-11-30T10:49:19+01:00","closed_at":null,
"due_date":null,"pull_request":null}
```
which has no information about the closing date. (which exists in the
db and ui)
with this PR the result changes to this:

```json
:null,"assignee":null,"assignees":null,
"state":"closed",
"comments":0,"created_at":"2018-11-29T16:43:05+01:00",
"updated_at":"2018-12-02T19:17:05+01:00",
"closed_at":"2018-12-02T19:17:05+01:00",
"due_date":null,"pull_request":null}
```

fixes: https://github.com/go-gitea/gitea/issues/5446
Signed-off-by: Roman <romaaan.git@gmail.com>
2018-12-02 17:50:47 -05:00
c1275e2ba6 Admin should be able to delete repos even if he is not a member of the organization (#5443) (#5447) 2018-12-02 20:07:20 +02:00
7bc1faabdb word-break the WebHook url to prevent a ui-break (#5445)
right now, the url is displayed with an anchor tag with no classes. If
the url is really really long, the url will break out of the containing
div and (depending on the url length) the browser shows the horizontal
scrollbar.
This pr makes use of the already existing css class `dont-break-out`
which gives all the anchor the necessary properties to prevent the
break.
Another solution could be to introduce some classes like
`text text-break-word`, but that would duplicate the `dont-break-out`
class just for text elements that use the `text` class.

fixes: https://github.com/go-gitea/gitea/issues/5416
Signed-off-by: Roman <romaaan.git@gmail.com>
2018-12-02 10:47:45 -05:00
e406dc058d Fix repository deletion when there is large number of issues in it (#5426) (#5434) 2018-11-30 09:38:35 -05:00
328e38ebc7 Fix dependent issue searching when gitea is run in subpath (#5392) (#5400) 2018-11-25 19:27:17 -05:00
773addf727 Backported #5383 on v1.6: API: '/orgs/:org/repos': return private repos with read access (#5310) (#3829) (#5393)
Signed-off-by: Daniel Balko <inxonic+github@gmail.com>
2018-11-24 13:14:27 +02:00
0da8bc9ec0 add changelog of v1.6.0 (#5379)
* add changelog of v1.6.0

* improve changelog
2018-11-22 22:53:58 -05:00
5d69703d3c dont' send assign webhooks when creating issue (#5365) (#5369) 2018-11-21 23:12:17 +08:00
ffc0c7f611 Migration fixes 5318 1.6 backport (#5355)
* Remove field from migration to support upgrades from older version

That will ensure the field does not get queried in the Select if it does
not exist yet:

```
[I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "name", "content", "milestone_id", "priority", "assignee_id", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: column "ref" does not exist
```

see #5318

* Skip remove stale watcher migration if not required

Otherwise the migration will fail if executed from a older database
version without multiple IssueWatch feature.

```
2018/11/11 23:51:14 [I] [SQL] SELECT DISTINCT "issue_watch"."user_id", "issue"."repo_id" FROM "issue_watch" INNER JOIN issue ON issue_watch.issue_id = issue.id WHERE (issue_watch.is_watching = $1) LIMIT 50 []int
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: relation "issue_watch" does not exist
```

see #5318
2018-11-18 22:34:14 +02:00
8670decafb Fix create team, update team missing units (#5188) (#5313) 2018-11-11 12:43:56 -05:00
297e619074 Fix file edit change preview functionality (#5300) (#5311) 2018-11-10 16:12:58 +02:00
e9b984e162 fix bug when users have serval teams with different units on different repositories (#5307) (#5308) 2018-11-09 17:46:38 +08:00
5995b65175 Fix U2F if gitea is configured in subpath (#5302) (#5306) 2018-11-09 13:45:50 +08:00
996ce8cc03 Fix markdown image with link (#4675) (#5299)
* Fix markdown image with link

* Add gitea copyright notice

* add a test for markdown image with link

* remove svg related variables
2018-11-08 17:47:24 -05:00
fe7cef0e1f Add changelog for 1.5.3 release (#5227) (#5298) 2018-11-08 17:20:10 -05:00
464dcd1b66 Remove maxlines option for file logger (#5282) (#5287) 2018-11-07 09:14:44 +02:00
68938d5dc4 Backport fix broken translation (#5284) 2018-11-07 06:50:52 +02:00
9c11fafdb0 1.6.0-RC2 Changelog (#5275) 2018-11-04 17:07:08 -05:00
c0bbbdd30b Backport #5250 on v1.6: Fix Issue 5249 and protect /api/v1/admin routes with CSRF token (#5272)
* Add CSRF checking to reqToken and place CSRF in the post for deadline creation

Fixes #5226, #5249

* /api/v1/admin/users routes should have reqToken middleware
2018-11-04 10:42:15 -05:00
f95c966770 Backported wrong api request url for instances running in subfolders (#5247) (#5261) 2018-11-03 17:43:11 -04:00
14a074f979 fix: Accept web-command cli flags if web-command is commited (#5245)
* Added flags of default cmd CmdWeb to app-wide flags
* If command *is* specified app-wide flags are ignored

Backport of #5200
Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de>
2018-11-01 11:24:23 -04:00
3786369356 This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql (#5136) (#5229)
* This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql

* fix tests
2018-10-31 20:21:31 -04:00
79464216d9 fix data race on migrate repository (#5224) (#5230) 2018-10-31 20:23:13 +08:00
e28801ff1a fix: Add secret to all webhook's payload where it has been missing (#5208)
* Updated dependency manager via `dep ensure -update code.gitea.io/sdk`
* Gopkg.toml was not changed as sdk version is set to "master"
* affects webhooks for: Delete, Fork, IssueComment, Release
* also contains changes from go-gitea/go-sdk#125 and hence a swagger update

Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de>
Resolves: #4732, #5173
2018-10-30 17:14:12 +02:00
478ba7f318 fix sqlite lock (#5210) (#5223) 2018-10-30 14:21:55 +08:00
582213a858 Update go-macaron/session to latest mast to fix RCE-bug (#5195) 2018-10-30 13:36:50 +08:00
4d66de684f Fix race on updatesize (#5190) (#5215)
* fix race on updatesize

* fix more repoPath
2018-10-30 09:20:18 +08:00
d220a3d772 fix to 3819 - Backport (#5219) 2018-10-29 15:56:21 -04:00
7022957b15 fix sqlite and mssql lock (#5214) (#5218) 2018-10-29 14:10:50 -04:00
e7128e8c41 Fix sqlite lock (#5176) (#5179)
* fix sqlite lock

* fix sqlite lock on getUnitType
2018-10-25 17:30:25 +03:00
274ff0d011 Add comment replies (#5147)
*         Add comment replies

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

* Use review.ID instead

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-10-23 10:38:06 -04:00
7238bb329a Fix SQL quoting (#5137)
`show` is keyword in MySQL and has to be quoted to reference a column name. Use grave accents (ASCII code 96) for quoting to match rest of the source code. It's non-standard SQL, but it's supported by SQLite and MySQL.

Signed-off-by: Filip Navara <navara@emclient.com>
2018-10-22 14:46:47 -04:00
49d666f99a Fix regex to support optional end line of old section in diff hunk (#5097)
+ Named groups in reges for easier group parsing
2018-10-18 09:57:35 +08:00
1972383216 ZH-CN translation of Usage part (#5086) 2018-10-17 14:19:04 -04:00
25def0a808 [skip ci] Updated translations via Crowdin 2018-10-17 17:07:45 +00:00
cc63985876 Add change log for 1.6.0-rc1 (#5095)
* add change log for 1.6.0-rc1

* Fix some uppercases
2018-10-17 19:05:49 +02:00
8683c72483 [skip ci] Updated translations via Crowdin 2018-10-17 11:23:21 +00:00
4cdab02273 ZH-CN translation of Advanced part (#5090) 2018-10-17 14:21:20 +03:00
34695f460a Update process to include tag vX.Y.0-dev on master branch (#5091) 2018-10-16 22:50:11 +02:00
4090204944 CN translation of README (#5050) 2018-10-15 12:13:21 +08:00
970c690681 fix release creation via API (#5076)
* fix release creation via API

* fix release create tests
2018-10-15 06:52:52 +03:00
0cd8cecdf8 Fix dep for actual goth version used in dep lock file (#5078) 2018-10-12 23:49:27 +03:00
c42b366f0e Fix golint to new URL (#5079) 2018-10-12 23:01:41 +03:00
c0b2c8a5d6 Fixed spelling typos in CONTRIBUTING.md (#5061) 2018-10-10 10:13:34 -04:00
1ecf92ade2 Add HOWTO for releasing Gitea (#5054)
* Add HOWTO for releasing Gitea

Used instructions from: https://github.com/go-gitea/gitea/pull/2609#issuecomment-352159155

* Update CONTRIBUTING.md
2018-10-10 00:08:59 +03:00
f44d066876 Backport 1.5.2 changelog (#5053) 2018-10-09 12:29:08 -04:00
fb3954f9a5 Fix adding review comment in split view (#5038) 2018-10-09 08:46:23 +08:00
6df46c50b1 Remove links from topics in edit mode (#5026) 2018-10-06 17:20:48 -04:00
378af8ea88 Fix missing AppSubUrl in few more templates (#5021) 2018-10-05 19:41:09 -04:00
c6daee6da6 Fix missing AppSubUrl in some templates (#5020) 2018-10-05 20:22:33 +03:00
94cd7bb25b Hide outdated comments in file view (#5017)
* Hide outdated comments in file view

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

* Add unit test by adding "invalidated" comment to fixtures

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-10-05 11:49:30 -04:00
d7ca839c67 Fix a typo in app.ini.sample (#5015) 2018-10-05 11:06:47 +02:00
513db27377 Add missing envionment vars for DB with Docker (#5007)
Current docs demonstrate how to configure a database container but don't
explicitly specify that you should add additional environment variables
to the Gitea container to make it use the database. This just
demonstrates the changes required.

Signed-off-by: Dane Elwell <dane.elwell@ukfast.co.uk>
2018-10-03 17:16:48 +03:00
2b8dc17db7 README: update make command to build full release (#5004)
* update make command to build full release

* use quoted TAGS

`TAGS=bindata` => `TAGS="bindata"`
2018-10-03 08:33:46 +02:00
2e2eacf62a [skip ci] Updated translations via Crowdin 2018-10-02 19:22:42 +00:00
dba955be7c Upgrade gopkg.in/testfixtures.v2 (#4999) 2018-10-02 15:20:02 -04:00
b8d048fa0d [skip ci] Updated translations via Crowdin 2018-09-29 22:45:10 +00:00
ab5b245182 Disable debug routes unless PPROF is enabled in configuration (#4995) 2018-09-29 18:44:06 -04:00
fc0001caa1 Fix #rrggbbaa color to rgba for better browser compatibility (#4990) 2018-09-29 12:57:32 +03:00
81702e6ec9 Detect charset and convert non UTF-8 files for display (#4950)
* Detect charset and convert non UTF-8 files for display

* Refactor and move function to correct module

* Revert unrelated changes

* More unrelated changes

* Duplicate content for small text to have better encoding detection

* Check if original content is valid before duplicating it
2018-09-29 16:33:54 +08:00
6780661192 Fix layout of the topics editing form (#4971)
* Fix layout of the topic edit.

- made right-hand column wider so that it has enough space for "Done" button.

- fixed issue that jQuery's .show() breaks functionality of the Semantic UI Grid.

* Improve switching visibility of the topic edit

Changes to support old browsers that doesn't support 'flex' keyword.

- Removed style "display: none" from index.css so that
  the grid can be displayed without specifying new "display" style.

- Added style "display:none" to the grid element in HTML template
  as the initial style.

- In index.js, visibility of the grid element is changed by
  set "display:none" style to the element or removing it from the element.
2018-09-29 09:28:47 +03:00
e6d54d511d make sure milestone listing is consistent across board (#4987) 2018-09-28 06:59:46 +03:00
31d5488059 Fix user menu item styling (#4985) 2018-09-27 16:58:38 -04:00
39735723f5 [skip ci] Updated translations via Crowdin 2018-09-27 00:51:27 +00:00
b3393b5ca7 Adjust maintainers (#4979) 2018-09-27 08:50:10 +08:00
79b4d4729c [skip ci] Updated translations via Crowdin 2018-09-25 12:37:54 +00:00
4092b32bad Fix preview when adding new code review comment (#4975) 2018-09-25 14:36:45 +02:00
36e7cb9755 Update Swagger API to match the return of /users/search (#4847)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2018-09-21 16:56:26 +08:00
dab02b80fd ADD: Hint to function of docker version tags (#4967)
I wasn't sure about how tags work, maybe this is interesting for people with less knowledge of docker.
2018-09-21 09:43:31 +08:00
07af31d004 Fix #4877 to follow the OpenID Connect Audiences spec (#4878)
Signed-off-by: Gabriel Robertson <overminddl1@gmail.com>
2018-09-20 22:17:34 +03:00
364c029246 [skip ci] Updated translations via Crowdin 2018-09-20 05:50:04 +00:00
043ab2cd59 Fix null pointer dereference in ParseCommitWithSignature (#4962) 2018-09-20 13:49:07 +08:00
8b113cd8b6 [skip ci] Updated translations via Crowdin 2018-09-19 09:03:30 +00:00
91b164c778 Fix interpunction in English translation. (#4958) 2018-09-19 12:02:08 +03:00
552d8d3a4e [skip ci] Updated translations via Crowdin 2018-09-18 07:05:46 +00:00
d6b97c8557 fix url in discord webhook (#4953)
opening issues generates a webhook to discord that contains
a url to the gitea api. the message title in discord is therefore
referencing to the api instead of the issue itself.
2018-09-17 21:04:46 -10:00
4befec242a Code review UI improvements and bugfixes (#4682)
* Code review UI improvements

* More fixes to dark theme

* Style fix

* Fix to allow add code review comments only on review files tab

* More readability dark style fixes

* Fix commenting on deleted files. Fixes #4752

* Fix line blame getting for multiple corner cases
2018-09-17 17:59:49 +03:00
756eafaaf6 Fix some issues with special chars in branch names (#3767)
Signed-off-by: Robin Durner <github@nubenum.de>
2018-09-17 01:28:23 +03:00
acb6f8a518 make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945) 2018-09-16 18:27:43 +03:00
f6eb669b51 fix(topics): don't redirect to expole page. (#4938) 2018-09-15 06:32:59 -04:00
3e76e7826e [skip ci] Updated translations via Crowdin 2018-09-15 06:30:00 +00:00
661fd901bd doc: add Cloudron package (#4937)
Fixes #4936
2018-09-15 14:28:53 +08:00
2a6d3ba058 Allow admin toggle forcing a password change for newly created users (#4563) 2018-09-13 12:34:36 -04:00
f98040ad50 fix bug forget to remove Stopwatch when remove repository (#4928) 2018-09-13 22:58:01 +08:00
126ba796dc Force user to change password (#4489)
* redirect to login page after successfully activating account

* force users to change password if account was created by an admin

* force users to change password if account was created by an admin

* fixed build

* fixed build

* fix pending issues with translation and wrong routes

* make sure path check is safe

* remove unneccessary newline

* make sure users that don't have to view the form get redirected

* move route to use /settings prefix so as to make sure unauthenticated users can't view the page

* update as per @lafriks review

* add necessary comment

* remove unrelated changes

* support redirecting to location the user actually want to go to before being forced to change his/her password

* run make fmt

* added tests

* improve assertions

* add assertion

* fix copyright year

Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
2018-09-13 15:04:25 +03:00
10a2a904d7 Fix bug when repo remained bare if multiple branches pushed (#4923) 2018-09-13 11:40:35 +08:00
ea20adaa84 feat(repo): support search repository by topic name (#4505)
* feat(repo): support search repository by topic name
2018-09-13 10:33:48 +08:00
7dd93b2441 [skip ci] Updated translations via Crowdin 2018-09-12 14:47:24 +00:00
e91a2cf2ea Add/remove/list oauth providers via cli (#4591) 2018-09-12 10:46:02 -04:00
8e3e59fdb8 Fix: Let's Encrypt configuration settings (#4911)
ENABLE_LETSENCRYPT and LETSENCRYPT_ACCEPTTOS were not being properly loaded from the config file, always resulting in the default settings being in place.
2018-09-12 00:06:44 -04:00
b5b39a56ad [skip ci] Updated translations via Crowdin 2018-09-11 18:55:32 +00:00
08ed515b62 Remove zookeeper documentation (#4910)
Fix #3763
2018-09-11 21:54:23 +03:00
c64c595acc [skip ci] Updated translations via Crowdin 2018-09-11 14:44:00 +00:00
f1ad4bb3d5 Remove traces of embedded TiDB (#4906)
Fix #3357
2018-09-11 10:42:40 -04:00
8ee9922fe6 Add file name and branch to page title (#4902) 2018-09-10 13:01:49 -04:00
e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 2018-09-10 12:15:52 -04:00
387a4b09c1 allow api to create tags for releases (#4890) 2018-09-10 10:57:41 -04:00
15ebe4b853 [skip ci] Updated translations via Crowdin 2018-09-10 14:32:36 +00:00
be48397945 Slack webhook channel name cannot be empty or just contain an hashtag (#4786) 2018-09-10 10:31:08 -04:00
6e03390aa8 [skip ci] Updated translations via Crowdin 2018-09-09 18:12:41 +00:00
eea76a5241 fix: Crippled diff (#4726) (#4900)
* fix: Crippled diff (#4726)

* Regenerate css
2018-09-09 20:11:49 +02:00
vz
e9dbfc70b7 Move README_ZH.md Screenshots to Bottom (#4895)
- Move Screenshots to Bottom
2018-09-09 12:13:48 +08:00
1dee960b45 [skip ci] Updated translations via Crowdin 2018-09-09 03:37:12 +00:00
c43399cad8 Fixes repo branch endpoint summary (#4893)
in browser saw `/repos/{owner}/{repo}/branches/{branch} List a repository's branches` fixed

Addresses https://github.com/go-gitea/debian-packaging/pull/1

Fixes https://github.com/go-gitea/gitea#4892
2018-09-09 11:36:08 +08:00
d293a2b9d6 Add sudo functionality to the API (#4809) 2018-09-06 23:31:29 -04:00
e6a03813d4 Extract header and footer content to separate tmpl (#4797)
This change makes it easier to customize the header and footer content. Before this change, the whole header and footer had to be overridden, including the meta, style and script tags.

Signed-off-by: Lukas Bestle <mail@lukasbestle.com>
2018-09-07 10:59:06 +08:00
fab7937c62 Improve dependency UI (#4503) 2018-09-07 10:32:46 +08:00
fa4663e61e Add push webhook support for mirrored repositories (#4127) 2018-09-06 22:06:09 -04:00
bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810)
* Fix redirect with non-ascii branch names (#4764)

* Add integration tests for non-ascii branch redirect

* Fix mysql test and coverage test
2018-09-06 21:37:02 -04:00
13e8a0fe56 offline use of fonts (#4872) 2018-09-06 21:15:25 -04:00
303d7f7e9c Do not autocreate directory for new user/orgs (#4828) (#4849) 2018-09-06 20:40:58 -04:00
3c6cc56143 docs(comparison): correct GitLab CE multiple assignees for issues (#4885)
GitLab CE doesn't support multiple assignees for issues.  
That's an enterprise feature.  See: https://docs.gitlab.com/ee/user/project/issues/multiple_assignees_for_issues.html
2018-09-06 20:17:31 -04:00
bd1bf2a072 Remove feature global code search from GitLab CE (#4875) 2018-09-05 11:12:09 -04:00
a5cc3a9baf Punctuation changes in documentation (#4866) 2018-09-04 22:47:45 -04:00
061b1aa2d4 update comparsion docs to add file viewer items (#4865) 2018-09-04 22:07:24 -04:00
668a477c69 Fix trimming of markup section names (#4863)
Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>
2018-09-03 20:59:02 -04:00
e48df3ee47 issues api allow pulls and fix #4832 (#4852) 2018-09-03 13:20:54 -04:00
a4ee5627ed Backport 1.5.1 changelog (#4854) 2018-09-03 01:17:10 -04:00
01fd05a5cb [skip ci] Updated translations via Crowdin 2018-09-03 03:25:34 +00:00
83d1173634 Add missing History link to directory listings (#4829)
The feature to list commits from a subdirectory is already there but
so far the history link to it was missing. There is a History button
in the view_file.tmpl already so avoid showing two history buttons in
that case.

The GitHub webinterface has the same History button in the same place
so this makes gitea a little bit more compatible.

Signed-off-by: Bernhard Froehlich <decke@bluelife.at>
2018-09-02 23:24:19 -04:00
aad5cccec8 [skip ci] Updated translations via Crowdin 2018-08-31 21:23:17 +00:00
9500d394ec Minor fix to TRANSLATORS (#4836)
* Minor fix to TRANSLATORS

Replaced @ with AT and removed " accidentially put in few lines

* Update TRANSLATORS
2018-09-01 00:22:11 +03:00
b9ae16d15e Make reverse proxy auth optional (#4643)
* Make reverse proxy auth optional

If the option ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled, make
reverse proxy auth optional, instead of failing if the authentication
did not succeed.

Fixes #3973

Signed-off-by: Najib Idrissi <najib.idrissi.kaitouni@gmail.com>

* Update http.go
2018-08-29 10:39:16 -04:00
fcea86877f update image used for build-without-gcc step (#4818)
As we've dropped support for go 1.8 (see 1.5.0 release post),
now we need to ensure that a minimum of go 1.9 builds correctly.
2018-08-29 10:01:58 -04:00
a938ddf704 [skip ci] Updated translations via Crowdin 2018-08-29 13:46:42 +00:00
080428b2bf Upgrade images in .drone.yml to more recent versions (#4819) 2018-08-29 09:43:58 -04:00
179123de35 [skip ci] Updated translations via Crowdin 2018-08-28 15:50:29 +00:00
74d65b5b5b Update legacy branch and tag URLs in dashboard to new format (#4812) 2018-08-28 11:48:15 -04:00
34831afaa7 Locale for Edit and Remove due date issue (#4802) 2018-08-27 21:34:12 +03:00
51c3b4b4bf Add Orzech to translator list (#4801) 2018-08-26 23:31:10 -04:00
56d931aeac Hide home button when landing page is not set to home (#4651) 2018-08-26 22:23:27 -04:00
4ae5a54c1f Fix missing release title in webhook (#4783) (#4796) 2018-08-26 11:24:33 -04:00
b63e2e0ded Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (#4618)
* Update "Upgrade from Gogs" en-us doc

- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs go-gitea/gitea#4286, go-gitea/gitea#3558

* Update "Upgrade from Gogs" fr-fr doc

- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs go-gitea/gitea#4286, go-gitea/gitea#3558
2018-08-25 02:47:47 -04:00
0a24f5cac8 Disable 'May Import Local Repository' when is disabled by setting (Issue #4779) (#4780) 2018-08-24 01:00:22 -04:00
194a11eb11 Don't disclose emails of all users when sending out emails (#4664) 2018-08-24 00:41:26 -04:00
912953e82a API /admin/users/{username} missing parameter (#4775) 2018-08-23 19:59:47 -04:00
127f477056 MySQL TLS (#4642) 2018-08-23 18:42:02 -04:00
0dac1ff677 [skip ci] Updated translations via Crowdin 2018-08-23 18:13:57 +00:00
f766e9713b Add myself to maintainers (#4777) 2018-08-23 14:12:57 -04:00
3c39b6351c [skip ci] Updated translations via Crowdin 2018-08-23 06:16:16 +00:00
33bc2ebdfa Make sure to reset commit count in the cache on mirror syncing (#4720)
* Make sure to reset commit count in the cache on mirror syncing

* reset count of commits in all branches
2018-08-23 14:15:07 +08:00
6ca8fbd2f9 Fixed bug where team with admin privelege type doesn't get any unit attached to the team (#4719) 2018-08-21 13:02:32 -04:00
05dcfcfc33 [skip ci] Updated translations via Crowdin 2018-08-21 13:58:07 +00:00
b82c14b3d2 add letsencrypt to Gitea (#4189) 2018-08-21 09:56:50 -04:00
6c1a31ffaa User shouldn't be able to approve or reject his/her own PR (#4729)
* Make sure author cannot reject/approve their own PR

* Disable buttons in templates too

* Remove unneccessary if check since the switch below catches it

* Fix IsOwner check

* Update template and remove new template variable

* Add alert template and redirect to diff page on review failure

* Redirect to files diff as a little update to #4632
2018-08-20 07:04:01 +02:00
fa93857117 allow WIP marker to contains < or > (#4709) 2018-08-19 15:00:10 -04:00
a6cdda115d Display error when adding a user to a team twice (#4746) 2018-08-19 21:49:19 +03:00
b1ad5734c6 Add whitespace between chinese characters and english characters. (#4731)
Signed-off-by: Tosone <i@tosiney.com>
2018-08-17 09:26:00 +08:00
1b2aff02a2 [skip ci] Updated translations via Crowdin 2018-08-16 11:53:51 +00:00
50ce19eff7 Fix failure on creating pull request with assignees (#4419) (#4583) 2018-08-16 19:52:51 +08:00
8273479b41 [skip ci] Updated translations via Crowdin 2018-08-15 22:59:13 +00:00
b30f6b4099 Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 (#4722)
Signed-off-by: Andrew Phillips <theasp@gmail.com>
2018-08-16 01:58:12 +03:00
f24ba27d79 [skip ci] Updated translations via Crowdin 2018-08-15 11:56:09 +00:00
8f86c43b90 Fix incorrect caption of webhook setting (#4701) (#4717) 2018-08-15 14:55:17 +03:00
bc06ab4a31 [skip ci] Updated translations via Crowdin 2018-08-15 06:30:05 +00:00
92466129ec Improve URL validation for external wiki and external issues (#4710)
* Improve URL validation for external wiki  and external issues

* Do not allow also localhost address for external URLs
2018-08-15 09:29:37 +03:00
0449330dbc Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) 2018-08-14 23:16:37 +03:00
ca112f0a04 Add whitespace handling to PR-comparsion (#4683)
* Add whitespace handling to PR-comparsion

In a PR we have to keep an eye on a lot of different things. But sometimes the
bare code is the key-thing we want to care about and just don't want to care
about fixed indention on some places. Especially if we follow the pathfinder
rule we face a lot of these situations because these changes don't break the
code in many languages but improve the readability a lot.

So this change introduce a fine graned button to adjust the way how the
reviewer want to see whitespace-changes within the code.

The possibilities reflect the possibilities from git itself except of the
`--ignore-blank-lines` flag because that one is also handled by `-b` and is
really rare.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
2018-08-14 13:49:33 -04:00
03e558c29b [skip ci] Updated translations via Crowdin 2018-08-14 06:11:45 +00:00
e6777f7b9d Focus title input when clicking helper link (#4696) 2018-08-14 09:10:26 +03:00
df0eb7372c [skip ci] Updated translations via Crowdin 2018-08-13 19:05:41 +00:00
7781e8cef2 Disable merging a WIP Pull request (#4529)
* prevent pull request to be merged when PR is a WIP

* add tests

* add helper to prepend WIP: in PR title

* move default wip prefixes into settings

* use configurable WIP prefixes in javascript and default to first one in templates

* add documentation

* add unit test on pull model

Signed-off-by: Julien Tant <julien@craftyx.fr>
2018-08-13 22:04:39 +03:00
52c2cb15db add vendor to user reserved words and format words list according alphabet (#4685) 2018-08-13 08:02:18 +03:00
a4fa6bbc89 Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680) 2018-08-12 20:16:10 +03:00
6e68b61479 Fix dark theme diff box header backround color (#4674) 2018-08-12 21:55:48 +08:00
ce7c64c7e1 Use updated docs link on install page (#4668)
Fix #4665
2018-08-11 21:05:52 -04:00
3422077a89 make sure to set pr split view (#4617)
Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
2018-08-11 20:20:33 -04:00
7fbdd4f2ac Enable swagger validation back as issue with it has been fixed upstream (#4673) 2018-08-11 20:08:17 -04:00
3ad5399a31 Update gitea version in install-from-binary docs (#4670) 2018-08-11 15:47:14 -04:00
69a855f3d4 log user in after a successful sign up (#4615) 2018-08-11 15:33:19 -04:00
4a7de87071 Add gitea/issues link to 500 page (#4654) 2018-08-11 13:04:43 -04:00
5dfe8b4340 Add 1.5.0 changelog (#4661) 2018-08-11 04:38:44 -04:00
8da45ae2b3 improve comparison to add issue dependency (#4658) 2018-08-10 08:22:07 +03:00
0e04a2091a Fix Split-View line adjustment (#4622)
The $-function is unreachable in the previous implementation because jQuery is
not loaded yet. I fix this by executing the function after the content is
loaded, so jQuery is loaded at the time of execution and the call will not fail
anymore.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
2018-08-09 16:28:55 +08:00
578cf52ce5 Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0

* Optimize if structure
2018-08-09 09:04:16 +08:00
0e464995ce Remove link to GitHub issues (#4639) 2018-08-08 11:07:34 -04:00
152c6af97e Fix custom templates being ignored (#4638) 2018-08-08 14:15:48 +03:00
00bd6277a8 [skip ci] Updated translations via Crowdin 2018-08-08 05:21:16 +00:00
3b51c4f3fb Show review comment box only on a pull request page (#4636)
* Show review comment box only on a pull request page

* Fixed template check
2018-08-08 08:20:04 +03:00
32145b6de8 Push whitelist now doesn't apply to branch deletion (#4601) (#4607) 2018-08-08 11:17:10 +08:00
67a8688538 [skip ci] Updated translations via Crowdin 2018-08-07 18:49:38 +00:00
b1bc08e268 cmd/serve: pprof cpu and memory profile dumps to disk (#4560) 2018-08-07 14:49:18 -04:00
ed3589f429 [skip ci] Updated translations via Crowdin 2018-08-07 18:37:15 +00:00
5ae8408725 Fix starring icon after semantic ui update (#4628) 2018-08-07 14:36:21 -04:00
a42900c17f [skip ci] Updated translations via Crowdin 2018-08-07 17:16:52 +00:00
0df7cab4fb prevent empty review comment (#4632)
* prevent empty review comment

This would only require a comment for rejection and comment

* add tests

* add comment
2018-08-07 20:15:41 +03:00
59b10e66f7 An inactive user shouldn't be able to be added as a collaborator (#4535)
* an inactive user shouldn't be able to be a collaborator

* use translated error message

* add active user check when adding a new collaborator via the api

* fix translation text

* added collaborator test

* improvee testcases
2018-08-07 13:01:06 +03:00
c7a6ee5c0b Don't fail silently if trying to add a collaborator twice (#4533)
* don't fail silently if trying to add a collaborator twice

* fix translation text

* added collaborator test

* improvee testcases

* Added tests to make sure a collaborator cannot be added twice
2018-08-07 09:59:42 +08:00
7cb1c1cf20 [skip ci] Updated translations via Crowdin 2018-08-06 11:54:16 +00:00
9c0a374f3f Fix integer constant overflows in tests (#4616)
* Use integer limit value [1] instead of hard-coded magic constant for
  NonexistentID.

* Explicitly use int64 in order to avoid the following errors on 32 bit
  architectures:

  # code.gitea.io/gitea/integrations
  ./api_admin_test.go:50:34: constant 9223372036854775807 overflows int
  ./api_token_test.go:47:34: constant 9223372036854775807 overflows int
  [...]
  # code.gitea.io/gitea/models
  ./action_test.go:179:15: constant 9223372036854775807 overflows int

[1] https://golang.org/pkg/math/#pkg-constants

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
2018-08-06 14:52:53 +03:00
9ea327f1f7 [skip ci] Updated translations via Crowdin 2018-08-06 04:44:17 +00:00
6e64f9db8e Pull request review/approval and comment on code (#3748)
* Initial ui components for pull request review

* Add Review
Add IssueComment types

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

(cherry picked from commit 2b4daab)
Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replace ReviewComment with Content

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

* Add load functions
Add ReviewID to findComments

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

* Add create review comment implementation
Add migration for review
Other small changes

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

* Simplified create and find functions for review

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

* Moved "Pending" to first position

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

* Add GetCurrentReview to simplify fetching current review

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

* Preview for listing comments

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

* Move new comment form to its own file

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

* Implement Review form
Show Review comments on comment stream

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

* Add support for single comments
Showing buttons in context

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

* Add pending tag to pending review comments

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

* Add unit tests for Review

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

* Fetch all review ids at once
Add unit tests

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

* gofmt

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

* Improved comment rendering in "Files" view by adding Comments to DiffLine

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

* Add support for invalidating comments

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

* Switched back to code.gitea.io/git

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

* Moved review migration from v64 to v65

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

* Rebuild css

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

* gofmt

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

* Improve translations

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

* Fix unit tests by updating fixtures and updating outdated test

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

* Comments will be shown at the right place now

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

* Add support for deleting CodeComments

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

* Fix problems caused by files in subdirectories

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

* Add support for showing code comments of reviews in conversation

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

* Add support for "Show/Hide outdated"

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

* Update code.gitea.io/git

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

* Add support for new webhooks

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

* Update comparison

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

* Resolve conflicts

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

* Minor UI improvements

* update code.gitea.io/git

* Fix ui bug reported by @lunny causing wrong position of add button
Add functionality to "Cancel" button
Add scale effects to add button
Hide "Cancel" button for existing comments

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

* Prepare solving conflicts

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

* Show add button only if no comments already exist for the line

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

* Add missing vendor files

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

* Check if reviewer is nil

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

* Show forms only to users who are logged in

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

* Revert "Show forms only to users who are logged in"

This reverts commit c083682

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

* Save patch in comment
Render patch for code comments

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

* Add link to comment in code

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

* Add reply form to comment list
Show forms only to signed in users

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

* Add 'Reply' as translatable
Add CODE_COMMENT_LINES setting

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

* gofmt

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

* Fix problems introduced by checking for singed in user

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

* Add v70

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

* Update generated stylesheet

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

* Fix preview
Beginn with new review comment patch system

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

* Add new algo to generate diff for line range
Remove old algo used for cutting big diffs (it was very buggy)

* Add documentation and example for CutDiffAroundLine

* Fix example of CutDiffAroundLine

* Fix some comment UI rendering bugs

* Add code comment edit mode

* Send notifications / actions to users until review gets published
Fix diff generation bug
Fix wrong hashtag

* Fix vet errors

* Send notifications also for single comments

* Fix some notification bugs, fix link

* Fix: add comment icon is only shown on code lines

* Add lint comment

* Add unit tests for git diff

* Add more error messages

* Regenerated css

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

* fmt

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

* Regenerated CSS with latest less version

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

* Fix test by updating comment type to new ID

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

* Introducing CodeComments as type for map[string]map[int64][]*Comment
Other minor code improvements

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

* Fix data-tab issues

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

* Remove unnecessary change

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

* refactored checkForInvalidation

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

* Append comments instead of setting

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

* Use HeadRepo instead of BaseRepo

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

* Update migration

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

* Regenerated CSS

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

* Add copyright

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

* Update index.css

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-08-06 06:43:21 +02:00
9c354a539a fix bugs when too many IN variables (#4594) 2018-08-02 21:49:05 +08:00
c40f5d2d4c api: repos/search: add parameters to control the sort order (#3964)
The backend SearchRepositoryByName function supports several sort order
options, hook these up to the /repos/search API.

New parameters for /repos/search:
    'sort':  alpha, created, updated, size, or id
    'order': asc or desc

'sort' defaults to alpha.
'order' defaults to ascending, and is ignored if 'sort' is not specified.
The overall default behavior is unchanged (alphabetically ascending).

This partially implements issue #3963

Signed-off-by: Allen Wild <allenwild93@gmail.com>
2018-08-02 16:10:02 +08:00
819f50ccd5 fix panic issue on update avatar email (#4580) (#4581)
fix #4580
2018-08-01 17:38:56 +08:00
ced08d18a4 fix IsPullReuqestBroken->IsPullRequestBroken (#4578)
Signed-off-by: Julien Tant <julien@craftyx.fr>
2018-08-01 11:00:35 +08:00
d57233680b Add documentation on how to update Gitea to new version (#4500) 2018-07-30 11:35:05 -04:00
b11ddd8d4c fix status code label for a successful webhook (#4540) 2018-07-30 10:27:31 +03:00
e277b3e0e4 [skip ci] Updated translations via Crowdin 2018-07-30 06:05:23 +00:00
895e538836 Update jQuery to v1.12.4 (#4551)
Fix #4384
2018-07-30 02:04:24 -04:00
a74426d631 Swagger.v1.json template (#3572)
* Turn swagger.v1.json into template

* Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
2018-07-28 03:19:01 +03:00
412583a3f2 [skip ci] Updated translations via Crowdin 2018-07-27 19:12:26 +00:00
c1224124ea Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525) 2018-07-27 22:11:24 +03:00
5927599e43 [skip ci] Updated translations via Crowdin 2018-07-27 12:55:56 +00:00
adf3f004b6 Switch plaintext scratch tokens to use hash instead (#4331) 2018-07-27 08:54:50 -04:00
ac968c3c6f Fix out-of-transaction query in removeOrgUser (#4521) (#4522) 2018-07-27 02:41:36 +03:00
be4ec0cbba env var GITEA_PUSHER_EMAIL (#4516)
* env var GITEA_PUSHER_EMAIL

* set pusher email only if email address is not private
2018-07-26 19:38:55 +03:00
a847d16f5b [skip ci] Updated translations via Crowdin 2018-07-26 15:26:44 +00:00
8d1ad55598 Responsive design fixes (#4508)
* reset to master

* build css

* Fixed spacing
2018-07-26 18:25:41 +03:00
f847884d16 Fix doc typo (#4517)
* fix language list

Standardized the languages' names within the list displayed when picking up a language at the bottom of the webpages

* typo

fix a typo into documentation (template rather than templete)

* fix languages list
2018-07-26 12:57:45 +02:00
1b9b894731 Fix uk-UA locale. Fixes #4518 2018-07-26 13:30:56 +03:00
7a30208e05 [skip ci] Updated translations via Crowdin 2018-07-25 17:55:49 +00:00
630f234223 Add flash message after an account has been successfully activated (#4510)
* added new locale text
2018-07-25 20:54:56 +03:00
32f25598b3 [skip ci] Updated translations via Crowdin 2018-07-25 12:12:34 +00:00
4bf0cae1f5 Respect email privacy option in user search via API (#4512)
* respect user's email privacy option

* make email visible to admin irrespective of privacy option
2018-07-25 15:11:22 +03:00
d0fef4395f [skip ci] Updated translations via Crowdin 2018-07-24 10:22:04 +00:00
344dc07239 Add shortcut to save wiki page (#4452)
This allows saving the wiki page with Ctrl-Enter.
2018-07-24 12:20:52 +02:00
ba358ecbf5 Make max commits in graph configurable (#4498) 2018-07-23 17:12:06 +03:00
ae9dd239fb Fix migration from older releases (#4495) 2018-07-21 23:15:11 -04:00
ec43e5619b [skip ci] Updated translations via Crowdin 2018-07-21 18:18:18 +00:00
bed623600d Accept 'Data:' in commit graph (#4487) 2018-07-21 14:17:09 -04:00
5fa403c874 [skip ci] Updated translations via Crowdin 2018-07-20 21:09:20 +00:00
0bb1c84208 Add csv file render support defaultly (#4105)
* add csv file render support defaultly

* escaping csv column content
2018-07-21 00:08:15 +03:00
b174817b6a Improve English translation for new features. (#4481) 2018-07-20 12:40:08 -04:00
cc9fa062e6 [skip ci] Updated translations via Crowdin 2018-07-20 02:11:33 +00:00
0c59edaafa Update xorm to latest version and fix correct user table referencing in sql (#4473) 2018-07-20 10:10:17 +08:00
1e2da5d396 [skip ci] Updated translations via Crowdin 2018-07-19 17:59:34 +00:00
492ec97a46 Redirect to correct page after using scratch token (#4458) 2018-07-19 13:58:33 -04:00
d1337299e2 add valid for lfs oid (#4461) 2018-07-19 11:39:19 -04:00
9ca8aaecb4 [skip ci] Updated translations via Crowdin 2018-07-19 15:26:27 +00:00
91373901f6 Prevent html entity escaping (#4471) 2018-07-19 18:25:17 +03:00
fe78154895 relative URLs for LibreJS page (#4460)
Fix #4449
2018-07-18 17:23:40 +08:00
1bff02de55 Added dependencies for issues (#2196) (#2531) 2018-07-17 17:23:58 -04:00
7be5935c55 Add BSDmakefile to prevent errors when make is called under FreeBSD (#4446)
The syntax of the gitea Makefile is not platform-agnostic and is
specific to the GNU version of `make`. BSD platforms such as FreeBSD
ship with bmake (BSD make) as their default `make` program; attempting
to compile gitea by simply executing `make` causes a wall of errors to
show as a result of syntax incompatible with BSD make.

If a file named `BSDmakefile` is present, `bmake` will give it
preference over a generic `Makefile`. This `BSDmakefile` is taken from
the BSD-licensed `gmake-proxy` project [0], which transparently proxies
all `make` commands to `gmake` (GNU make) on systems where `bmake` is
the default, and if `gmake` is not installed an error message is
displayed.

[0]: https://github.com/neosmart/gmake-proxy
2018-07-16 20:45:51 +02:00
ef6813abc9 Issue due date api (#3890)
* Implemented basic api endpoint to manage deadlines

* Fixed checking for permissions

* Updating a deadline from the ui is now entirely done via the api

* cleanup

* Cosmetics

* fixed lint + fmt

* Added swagger model definition for deadline response

* Updated gitea-sdk

* Updated gitea-sdk

* More cleanup

* Generate swagger json

* Merge branch 'master' of https://github.com/go-gitea/gitea into issue-due-date-api

# Conflicts:
#	public/swagger.v1.json

* Fixed permission to update a deadline via api

* Re-added form to change a deadline

* Added client-side validation + not ignore error messages from the api

* Added locale for error message

* Merge branch 'master' of https://github.com/go-gitea/gitea

# Conflicts:
#	models/issue_comment.go

* Proper date validation

* Fixed indention

* moved css to css file

* added documentation for error codes

* after merge cleanup

* Added swagger description

* DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD

* DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD

* regenerated stylesheets
2018-07-16 14:43:00 +02:00
55d9ddf24a [skip ci] Updated translations via Crowdin 2018-07-15 00:44:24 +00:00
ca474af3c6 Added front-end topics validation (#4316) 2018-07-14 20:43:32 -04:00
8e103d3e76 [skip ci] Updated translations via Crowdin 2018-07-14 06:08:34 +00:00
a7c5e58635 Clean up arc-green theme (#4443)
* Resolve some issues with Arc Green

* Fix editor styles

* zeebra stripes

* generate CSS file
2018-07-14 09:07:30 +03:00
ca8c7bb2b5 [skip ci] Updated translations via Crowdin 2018-07-13 20:58:18 +00:00
aa27cbf229 Locale for button Edit on protected branch (#4442) 2018-07-13 16:57:20 -04:00
6813640d2f [skip ci] Updated translations via Crowdin 2018-07-13 15:22:00 +00:00
e95417ea2c Fix column droping for MSSQL that need new transaction for that (#4440) 2018-07-13 11:20:40 -04:00
659bc727bd Fix query parameter name comment in issue API (#4421) 2018-07-12 16:40:41 +03:00
e6b51200ab Final CSP header fix (#4432) 2018-07-12 19:48:33 +08:00
a7f90905df Fix drone git@next plugin Gitea version display when building tag (#4380) 2018-07-12 06:32:01 +03:00
8afd500c48 Add missing font hosts to CSP header (#4429) 2018-07-11 19:24:06 -04:00
8b21cdba78 Fix CSP header for docs (#4428) 2018-07-12 00:27:48 +02:00
3e950ef112 Use correct site id for netlify (#4427) 2018-07-11 23:45:03 +02:00
c55caeaf0c Update npm dependencies, regenerate CSS (#4415) 2018-07-11 10:54:28 -04:00
d84490a0df Replaced docker docs with netlify deployment (#4420) 2018-07-11 16:43:33 +02:00
c2ec38f9b7 Disable swagger validation while it is not fixed in upstream (#4423) 2018-07-11 10:03:52 -04:00
61f4ad2fc5 [skip ci] Updated translations via Crowdin 2018-07-11 11:37:10 +00:00
c9687c036d update TRANSLATORS (#4406) 2018-07-11 14:36:04 +03:00
3e445cce06 [skip ci] Updated translations via Crowdin 2018-07-08 20:42:36 +00:00
80169460ec Added question for Gitea hosted Gitea (#4397)
Currently some issues need to be resolved and features need to be implemented before we can move the Gitea development workflow to a Gitea instance. Many ask why Gitea isn't hosted on Gitea, now that's in the FAQ.
2018-07-08 22:41:31 +02:00
efd202f40f [skip ci] Updated translations via Crowdin 2018-07-07 01:55:43 +00:00
ab55ca7ebd Add ability to delete a token (#4235)
Fix #4234
2018-07-06 21:54:30 -04:00
1675fc4301 add git timeout settings docs (#4383) 2018-07-06 08:49:37 +03:00
61b40520ba GPG verification docs (#4381)
* GPG verification docs

* update URL
2018-07-06 09:36:54 +08:00
f1d6a1fffc Add the ability to have built in themes in Gitea (#4198)
This makes it easier for user who want to theme but
don't have the ability to know how to customize templates
all that is required is a change in a config option

The reason why I chose the DEFAULT_THEME as variable,
as perhaps in the future we will allow users to chose their
theme whon logged in just like we do with languages
2018-07-05 17:25:04 -04:00
28c1c90230 [skip ci] Updated translations via Crowdin 2018-07-05 20:42:15 +00:00
2a60e72fcd Replace src with raw to fix image paths (#4377)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-07-05 22:36:45 +02:00
cfb76cd99e [skip ci] Updated translations via Crowdin 2018-07-05 17:49:07 +00:00
7c943b1cad Implemented hover text showing user FullName (#4261)
For each action that is displayed in either the public activity overview
of a user, or in the dashboard overview, the link to the username is now
extended with a title attribute to show the FullName as hover text

Signed-off-by: Guido Diepen <site-github@guidodiepen.nl>
2018-07-05 19:48:18 +02:00
5bc8782d33 Don't display buttons if there are no system notifications (#4280)
* Don't display buttons if there are no notices

* remove redundant gt check
2018-07-05 17:35:42 +02:00
e07d3ad0fc Fixes repo membership check in API (#4341)
Untested, since I can't compile (yet).
2018-07-05 15:14:56 +08:00
f035dcd4f2 Add Recaptcha functionality to Gitea (#4044) 2018-07-05 00:13:05 -04:00
54fedd4070 Add default merge options when adding new repository (#4369) 2018-07-05 11:02:54 +08:00
07063e3e11 [skip ci] Updated translations via Crowdin 2018-07-05 00:05:18 +00:00
69e2ab1611 Allow administrator to create repository for any organization (#4368) 2018-07-05 01:51:02 +02:00
4eae810d63 [skip ci] Updated translations via Crowdin 2018-07-04 22:53:06 +00:00
4a8ee0b5cc Check that repositories can only be migrated to own user or organizations (#4366)
* 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:45:15 +03:00
b46066f17c fix repository last updated time update when delete a user who watched the repo (#4363) 2018-07-05 00:47:05 +03:00
95f0f62ea4 [skip ci] Updated translations via Crowdin 2018-07-04 20:24:23 +00:00
74f9f98f78 Simply remove tidb and deps (#3993) 2018-07-04 16:23:23 -04:00
2e3475f02c Fix typos in i18n variable names. (#4080) 2018-07-04 19:43:21 +08:00
df77ad31d5 [skip ci] Updated translations via Crowdin 2018-07-04 09:28:27 +00:00
c3bbf43970 Fix docker build (#4358)
/app/gitea/gitea is the file, and /usr/local/bin is where the symlink will be located
2018-07-04 12:27:30 +03:00
fc53f95f23 [skip ci] Updated translations via Crowdin 2018-07-04 00:45:44 +00:00
823318bfbe Add missing path in the Docker app.ini template (#2181) 2018-07-03 20:44:46 -04:00
5676f60cba Keep preseeded database password (#4284) 2018-07-03 20:09:55 -04:00
3fed13b0ee [skip ci] Updated translations via Crowdin 2018-07-03 23:53:28 +00:00
51ba3df5ff Add noreferrer to rel='noopener` for <a> tags (#4328) 2018-07-03 19:52:36 -04:00
4b654ad17f Update notification icon (#4343) 2018-07-03 19:16:46 -04:00
5d1a6382b6 #4354 Fix translation (#4355) 2018-07-03 19:03:31 -04:00
c71ee33057 Increase default TOTP secret size to 320 bits (#4287) 2018-07-03 18:10:35 -04:00
9d4c1ddfa1 Dep upgrade mysql lib (#4161)
*  update gopkg file to add sql dep
2018-07-03 17:58:31 -04:00
876 changed files with 28735 additions and 170884 deletions

View File

@ -22,7 +22,7 @@ pipeline:
branch: [ master ]
update-translations:
image: alpine:3.6
image: alpine:3.7
commands:
- mv ./options/locale/locale_en-US.ini ./options/
- sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
@ -56,7 +56,7 @@ pipeline:
event: [ push, tag, pull_request ]
build-without-gcc:
image: golang:1.8
image: golang:1.9
pull: true
commands:
- go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
@ -64,7 +64,7 @@ pipeline:
event: [ push, tag, pull_request ]
build:
image: golang:1.10
image: golang:1.11
pull: true
environment:
TAGS: bindata sqlite
@ -75,7 +75,7 @@ pipeline:
- make lint
- make fmt-check
- make swagger-check
# - make swagger-validate
- make swagger-validate
- make misspell-check
- make test-vendor
- make build
@ -83,7 +83,7 @@ pipeline:
event: [ push, tag, pull_request ]
test:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -95,7 +95,7 @@ pipeline:
branch: [ master ]
test:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -107,7 +107,7 @@ pipeline:
branch: [ release/* ]
test:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -130,7 +130,7 @@ pipeline:
# event: [ push, tag, pull_request ]
test-mysql:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -145,7 +145,7 @@ pipeline:
branch: [ master ]
test-mysql:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -159,7 +159,7 @@ pipeline:
event: [ tag ]
test-pgsql:
image: golang:1.10
image: golang:1.11
pull: true
group: test
environment:
@ -173,7 +173,7 @@ pipeline:
event: [ push, tag, pull_request ]
generate-coverage:
image: golang:1.10
image: golang:1.11
pull: true
environment:
TAGS: bindata
@ -203,7 +203,7 @@ pipeline:
when:
event: [ push, tag ]
build_docs:
build-docs:
image: webhippie/hugo:latest
pull: true
commands:
@ -212,26 +212,12 @@ pipeline:
- make clean
- make build
docker_docs:
image: plugins/docker:17.05
publish-docs:
image: lucap/drone-netlify:latest
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/docs
context: docs
dockerfile: docs/Dockerfile
tags: [ '${DRONE_BRANCH##release/v}' ]
when:
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' ]
secrets: [ netlify_token ]
site_id: d2260bae-7861-4c02-8646-8f6440b12672
path: docs/public/
when:
event: [ push ]
branch: [ master ]

51
BSDmakefile Normal file
View File

@ -0,0 +1,51 @@
# GNU makefile proxy script for BSD make
# Written and maintained by Mahmoud Al-Qudsi <mqudsi@neosmart.net>
# Copyright NeoSmart Technologies <https://neosmart.net/> 2014-2018
# Obtain updates from <https://github.com/neosmart/gmake-proxy>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JARG =
GMAKE = "gmake"
#When gmake is called from another make instance, -w is automatically added
#which causes extraneous messages about directory changes to be emitted.
#--no-print-directory silences these messages.
GARGS = "--no-print-directory"
.if "$(.MAKE.JOBS)" != ""
JARG = -j$(.MAKE.JOBS)
.endif
#by default bmake will cd into ./obj first
.OBJDIR: ./
.PHONY: FRC
$(.TARGETS): FRC
$(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.DONE .DEFAULT: .SILENT
$(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.ERROR: .SILENT
if ! which $(GMAKE) > /dev/null; then \
echo "GNU Make is required!"; \
fi

View File

@ -4,9 +4,234 @@ 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.5.0-RC2](https://github.com/go-gitea/gitea/releases/tag/v1.5.0-rc2) - 2018-07-21
## [1.6.4](https://github.com/go-gitea/gitea/releases/tag/v1.6.4) - 2019-01-15
* BUGFIX
* Fix SSH key now can be reused as public key after deleting as deploy key (#5671) (#5685)
* When redirecting clean the path to avoid redirecting to external site (#5669) (#5703)
* Fix to use correct value for "MSpan Structures Obtained" (#5706) (#5715)
## [1.6.3](https://github.com/go-gitea/gitea/releases/tag/v1.6.3) - 2019-01-04
* SECURITY
* Prevent DeleteFilePost doing arbitrary deletion (#5631)
* BUGFIX
* Fix wrong text getting saved on editing second comment on an issue (#5608)
## [1.6.2](https://github.com/go-gitea/gitea/releases/tag/v1.6.2) - 2018-12-21
* SECURITY
* Sanitize uploaded file names (#5571) (#5573)
* HTMLEncode user added text (#5570) (#5575)
* BUGFIXES
* Fix indexer reindex bug when gitea restart (#5563) (#5564)
* Remove a double slash in the HTTPS redirect with Let's Encrypt (#5537) (#5539)
* Fix bug when a read perm user to edit his issue (#5516) (#5534)
* Detect force push failure on deletion of protected branches (#5522) (#5531)
* Let's Encrypt handler listens on correct port for certificate validation (#5525) (#5527)
* Fix forgot deletion of notification when delete repository (#5506) (#5514)
* Fix undeleted content when deleting user (#5429) (#5509)
* Fix empty wiki (#5504) (#5508)
## [1.6.1](https://github.com/go-gitea/gitea/releases/tag/v1.6.1) - 2018-12-08
* BUGFIXES
* Fix dependent issue searching when gitea is run in subpath (#5392) (#5400)
* API: '/orgs/:org/repos': return private repos with read access (#5393)
* Fix repository deletion when there is large number of issues in it (#5426) (#5434)
* Word-break the WebHook url to prevent a ui-break (#5445)
* Admin should be able to delete repos via the API even if they are not a member of the organization (#5443) (#5447)
* Ensure that the `closed_at` is set for closed (#5450)
* Fix topic name length on database (#5493) (#5495)
## [1.6.0](https://github.com/go-gitea/gitea/releases/tag/v1.6.0) - 2018-11-22
* BREAKING
* Respect email privacy option in user search via API (#4512)
* Simply remove tidb and deps (#3993)
* Swagger.v1.json template (#3572)
* SECURITY
* Add CSRF checking to reqToken and add reqToken to admin API routes (#5272) (#5250)
* Improve URL validation for external wiki and external issues (#4710)
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706)
* Don't disclose emails of all users when sending out emails (#4664)
* Check that repositories can only be migrated to own user or organizations (#4366)
* FEATURE
* Add comment replies (#5147) (#5104)
* Pull request review/approval and comment on code (#3748)
* Added dependencies for issues (#2196) (#2531)
* Add the ability to have built in themes in Gitea and provide dark theme arc-green (#4198)
* Add sudo functionality to the API (#4809)
* Add oauth providers via cli (#4591)
* Disable merging a WIP Pull request (#4529)
* Force user to change password (#4489)
* Add letsencrypt to Gitea (#4189)
* Add push webhook support for mirrored repositories (#4127)
* Add csv file render support defaultly (#4105)
* Add Recaptcha functionality to Gitea (#4044)
* ENHANCEMENT
* Fix milestones sorted wrongly (#4987)
* Allow api to create tags for releases if they don't exist (#4890)
* Fix #4877 to follow the OpenID Connect Audiences spec (#4878)
* Enforce token on api routes [fixed critical security issue #4357] (#4840)
* Update legacy branch and tag URLs in dashboard to new format (#4812)
* Slack webhook channel name cannot be empty or just contain an hashtag (#4786)
* Add whitespace handling to PR-comparsion (#4683)
* Make reverse proxy auth optional (#4643)
* MySQL TLS (#4642)
* Make sure to set PR split view when creating/previewing a pull request (#4617)
* Log user in after a successful sign up (#4615)
* Fix typo IsPullReuqestBroken -> IsPullRequestBroken (#4578)
* Allow admin toggle forcing a password change for newly created users (#4563)
* Update jQuery to v1.12.4 (#4551)
* Env var GITEA_PUSHER_EMAIL (#4516)
* Feat(repo): support search repository by topic name (#4505)
* Small improvements to dependency UI (#4503)
* Make max commits in graph configurable (#4498)
* Add valid for lfs oid (#4461)
* Add shortcut to save wiki page (#4452)
* Allow administrator to create repository for any organization (#4368)
* Fix repository last updated time update when delete a user who watched the repo (#4363)
* Switch plaintext scratch tokens to use hash instead (#4331)
* Increase default TOTP secret size to 320 bits (#4287)
* Keep preseeded database password (#4284)
* Implemented hover text showing user FullName (#4261)
* Add ability to delete a token (#4235)
* Fix typos in i18n variable names. (#4080)
* Api: repos/search: add parameters to control the sort order (#3964)
* Add missing path in the Docker app.ini template (#2181)
* Add file name and branch to page title (#4902)
* Offline use of google fonts (#4872)
* Add missing History link to directory listings v2 (#4829)
* Locale for Edit and Remove due date issue (#4802)
* Disable 'May Import Local Repository' when is disabled by setting (Is… (#4780)
* API /admin/users/{username} missing parameter (#4775)
* Display error when adding a user to a team twice (#4746)
* Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 (#4722)
* Focus title input when clicking helper link (#4696)
* Add vendor to user reserved words and format words list according alphabet (#4685)
* Add gitea/issues link to 500 page (#4654)
* Hide home button when landing page is not set to home (#4651)
* Remove link to GitHub issues in 404 template (#4639)
* Cmd/serve: pprof cpu and memory profile dumps to disk (#4560)
* Add flash message after an account has been successfully activated (#4510)
* Prevent html entity escaping on delete branch (#4471)
* Locale for button Edit on protected branch (#4442)
* Update notification icon (#4343)
* Added front-end topics validation (#4316)
* Don't display buttons if there are no system notifications (#4280)
* Issue due date api (#3890)
* BUGFIXES
* dont' send assign webhooks when creating issue (#5365)
* Fix create team, update team missing units (#5188)
* Fix file edit change preview functionality (#5300)
* *ix bug when users have serval teams with different units on different repositories (#5307)
* Fix U2F if gitea is configured in subpath (#5302)
* Fix markdown image with link (#4675)
* Remove maxlines option for file logger (#5282)
* Fix wrong api request url for instances running in subfolders (#5261) (#5247)
* Accept web-command cli flags if web-command is commited (#5245) (#5200)
* Reduce join star, repo_topic, topic tables on repo search, to resolve extra columns problem on MSSQL (#5136) (#5229)
* Fix data race on migrate repository (#5224) (#5230)
* Add secret to all webhook's payload where it has been missing (#5208) (#5199)
* Fix sqlite and MSSQL lock (#5210) (#5223) (#5214) (#5218) (#5176) (#5179)
* Fix race on updatesize (#5190) (#5215)
* Fix filtering issues by tags on main screen issues (#5219) (#3824)
* Fix SQL quoting (#5137) (#5117)
* Fix regex to support optional end line of old section in diff hunk (#5097) (#5096)
* Fix release creation via API (#5076)
* Remove links from topics in edit mode (#5026)
* Fix missing AppSubUrl in few more templates (fixup) (#5021)
* Fix missing AppSubUrl in some templates (#5020)
* Hide outdated comments in file view (#5017)
* Upgrade gopkg.in/testfixtures.v2 (#4999)
* Disable debug routes unless PPROF is enabled in configuration (#4995)
* Fix user menu item styling (#4985)
* Fix layout of the topics editing form (#4971)
* Fix null pointer dereference in ParseCommitWithSignature (#4962)
* Fix url in discord webhook (#4953)
* Detect charset and convert non UTF-8 files for display (#4950)
* Make sure to catch the right error so it is displayed on the UI (#4945)
* Fix(topics): don't redirect to explore page. (#4938)
* Fix bug forget to remove Stopwatch when remove repository (#4928)
* Fix bug when repo remained bare if multiple branches pushed in single push (#4923)
* Fix: Crippled diff (#4726) (#4900)
* Fix trimming of markup section names (#4863)
* Issues api allow pulls and fix #4832 (#4852)
* Do not autocreate directory for new users/orgs (#4828) (#4849)
* Fix redirect with non-ascii branch names (#4764) (#4810)
* Fix missing release title in webhook (#4783) (#4796)
* User shouldn't be able to approve or reject his/her own PR (#4729)
* Make sure to reset commit count in the cache on mirror syncing (#4720)
* Fixed bug where team with admin privelege type doesn't get any unit (#4719)
* Fix incorrect caption of webhook setting (#4701) (#4717)
* Allow WIP marker to contains < or > (#4709)
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680)
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* Fix custom templates being ignored (#4638)
* Fix starring icon after semantic ui update (#4628)
* Fix Split-View line adjustment (#4622)
* Fix integer constant overflows in tests (#4616)
* Push whitelist now doesn't apply to branch deletion (#4601) (#4607)
* Fix bugs when too many IN variables (#4594)
* Fix failure on creating pull request with assignees (#4419) (#4583)
* Fix panic issue on update avatar email (#4580) (#4581)
* Fix status code label for a successful webhook (#4540)
* An inactive user shouldn't be able to be added as a collaborator (#4535)
* Don't fail silently if trying to add a collaborator twice (#4533)
* Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525)
* Fix out-of-transaction query in removeOrgUser (#4521) (#4522)
* Fix migration from older releases (#4495)
* Accept 'Data:' in commit graph (#4487)
* Update xorm to latest version and fix correct `user` table referencing in sql (#4473)
* Relative URLs for LibreJS page (#4460)
* Redirect to correct page after using scratch token (#4458)
* Fix column droping for MSSQL that need new transaction for that (#4440)
* Replace src with raw to fix image paths (#4377)
* Add default merge options when creating new repository (#4369)
* Fix docker build (#4358)
* Fixes repo membership check in API (#4341)
* Dep upgrade mysql lib (#4161)
* Fix some issues with special chars in branch names (#3767)
* Responsive design fixes (#4508)
* TRANSLATION
* Fix punctuation in English translation (#4958)
* Fix translation (#4355)
## [1.5.3](https://github.com/go-gitea/gitea/releases/tag/v1.5.3) - 2018-10-31
* SECURITY
* Fix remote command execution vulnerability in upstream library (#5177) (#5196)
## [1.5.2](https://github.com/go-gitea/gitea/releases/tag/v1.5.2) - 2018-10-09
* SECURITY
* Enforce token on api routes (#4840) (#4905)
* BUGFIXES
* Remove links from topics in edit mode (#5030)
* Detect charset and convert non UTF-8 files for display (#4950) (#4994)
* Fix layout of the topics editing form (#4971) (#4993)
* Fix null pointer dereference in ParseCommitWithSignature (#4964)
* Fix url in discord webhook (#4951)
* Fix font-cropping UI bug in diff (#4726) (#4929)
* Fix bug forget to remove Stopwatch when remove repository (#4933)
* Fix bug when repo remained bare if multiple branches pushed (#4927)
* Fix redirect with non-ascii branch names (#4764) (#4887)
* Fix issues api allow pulls (#4852) (#4862)
* Fix trimming of markup section names (#4864)
## [1.5.1](https://github.com/go-gitea/gitea/releases/tag/v1.5.1) - 2018-09-03
* SECURITY
* Don't disclose emails of all users when sending out emails (#4784)
* Improve URL validation for external wiki and external issues (#4710) (#4740)
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) (#4707)
* BUGFIXES
* Fix missing release title in webhook (#4783) (#4800)
* Make sure to reset commit count in the cache on mirror syncing (#4770)
* Fixed bug where team with admin privelege type doesn't get any unit (#4759)
* Fix failure on creating pull request with assignees (#4583) (#4727)
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4686)
* TRANSLATION
* Fix incorrect caption of webhook setting (#4701) (#4718)
## [1.5.0](https://github.com/go-gitea/gitea/releases/tag/v1.5.0) - 2018-08-10
* SECURITY
* Check that repositories can only be migrated to own user or organizations (#4366) (#4370)
* Limit uploaded avatar image-size to 4096px x 3072px by default (#4353)
* Do not allow to reuse TOTP passcode (#3878)
* BUGFIXES
* Fix column droping for MSSQL that need new transaction for that (#4440) (#4484)
* Redirect to correct page after using scratch token (#4458) (#4472)
@ -15,11 +240,12 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* 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)
* Fix out-of-transaction query in removeOrgUser (#4521) (#4524)
* Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519)
* Fix panic issue on update avatar email (#4580) (#4590)
* Fix bugs when too many IN variables (#4594) (#4597)
* Push whitelist now doesn't apply to branch deletion (#4601) (#4640)
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645) (#4650)
* FEATURE
* Add cli commands to regen hooks & keys (#3979)
* Add support for FIDO U2F (#3971)

View File

@ -16,6 +16,7 @@
- [Maintainers](#maintainers)
- [Owners](#owners)
- [Versions](#versions)
- [Releasing Gitea](#releasing-gitea)
- [Copyright](#copyright)
## Introduction
@ -68,7 +69,7 @@ whole tree to make sure the changes don't break other usage
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
we are using the server for continuous testing, following [these
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.
@ -92,7 +93,7 @@ You can find more information on how to get started with it on the [dep project
We do all translation work inside [Crowdin](https://crowdin.com/project/gitea).
The only translation that is maintained in this git repository is
[`en_US.ini`](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)
and is synced regularily to Crowdin. Once a translation has reached
and is synced regularly to Crowdin. Once a translation has reached
A SATISFACTORY PERCENTAGE it will be synced back into this repo and
included in the next released version.
@ -256,6 +257,19 @@ in production, please download the latest release tag version. All the
branches will be protected via GitHub, all the PRs to every branch must
be reviewed by two maintainers and must pass the automatic tests.
## Releasing Gitea
* Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future.
* Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
* If this is a big version first you have to create PR for changelog on branch `master` with PRs with label `changelog` and after it has been merged do following steps:
* Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`.
* When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
* Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
* And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically created a release and upload all the compiled binary. (But currently it didn't add the release notes automatically. Maybe we should fix that.)
* If needed send PR for changelog on branch `master`.
* Send PR to [blog repository](https://github.com/go-gitea/blog) announcing the release.
## Copyright
Code that you contribute should use the standard copyright header:

View File

@ -58,3 +58,4 @@ CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker /
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /usr/local/bin/gitea

529
Gopkg.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ ignored = ["google.golang.org/appengine*"]
name = "code.gitea.io/sdk"
[[constraint]]
revision = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94"
revision = "12dd70caea0268ac0d6c2707d0611ef601e7c64e"
name = "golang.org/x/crypto"
[[constraint]]
@ -30,16 +30,15 @@ ignored = ["google.golang.org/appengine*"]
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/go-sql-driver/mysql"
revision = "d523deb1b23d913de5bdada721a6071e71283618"
[[override]]
name = "github.com/gorilla/mux"
revision = "757bef944d0f21880861c2dd9c871ca543023cba"
@ -58,7 +57,7 @@ ignored = ["google.golang.org/appengine*"]
[[constraint]]
name = "github.com/markbates/goth"
version = "1.45.5"
version = "1.46.1"
[[constraint]]
branch = "master"

View File

@ -22,5 +22,5 @@ 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)
Lanre Adelowo <yo@lanre.wtf> (@adelowo)

View File

@ -42,6 +42,10 @@ TAGS ?=
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp')
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
SWAGGER_SPEC_S_TMPL := s|"basePath":\s*"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g
SWAGGER_SPEC_S_JSON := s|"basePath":\s*"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g
TEST_MYSQL_HOST ?= mysql:3306
TEST_MYSQL_DBNAME ?= testgitea
TEST_MYSQL_USERNAME ?= root
@ -57,6 +61,9 @@ else
EXECUTABLE := gitea
endif
# $(call strip-suffix,filename)
strip-suffix = $(firstword $(subst ., ,$(1)))
.PHONY: all
all: build
@ -91,11 +98,12 @@ generate-swagger:
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
fi
swagger generate spec -o ./public/swagger.v1.json
swagger generate spec -o './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
.PHONY: swagger-check
swagger-check: generate-swagger
@diff=$$(git diff public/swagger.v1.json); \
@diff=$$(git diff '$(SWAGGER_SPEC)'); \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-swagger' and commit the result:"; \
echo "$${diff}"; \
@ -107,7 +115,9 @@ 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
$(SED_INPLACE) '$(SWAGGER_SPEC_S_JSON)' './$(SWAGGER_SPEC)'
swagger validate './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
.PHONY: errcheck
errcheck:
@ -119,7 +129,7 @@ errcheck:
.PHONY: lint
lint:
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/golang/lint/golint; \
$(GO) get -u golang.org/x/lint/golint; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
@ -303,7 +313,7 @@ public/js/index.js: $(JAVASCRIPTS)
.PHONY: stylesheets-check
stylesheets-check: generate-stylesheets
@diff=$$(git diff public/css/index.css); \
@diff=$$(git diff public/css/*); \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-stylesheets' and commit the result:"; \
echo "$${diff}"; \
@ -313,6 +323,7 @@ stylesheets-check: generate-stylesheets
.PHONY: generate-stylesheets
generate-stylesheets:
node_modules/.bin/lessc --clean-css public/less/index.less public/css/index.css
$(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),node_modules/.bin/lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
.PHONY: swagger-ui
swagger-ui:

View File

@ -29,7 +29,7 @@ This project has been
From the root of the source tree, run:
make generate all
TAGS="bindata" make generate all
More info: https://docs.gitea.io/en-us/install-from-source/
@ -90,6 +90,10 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
**Why is this not hosted on a Gitea instance?**
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
## License
This project is licensed under the MIT License.

View File

@ -11,16 +11,9 @@
[![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)
| | | |
|:---:|:---:|:---:|
|![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)|
## 目标
Gitea的首要目标是创建一个极易安装运行非常快速安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言这使我们只要生成一个可执行程序即可。并且他还支持跨平台支持 Linux, macOS 和 Windows 以及各种架构除了x86amd64还包括 ARM 和 PowerPC。
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64还包括 ARM 和 PowerPC。
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)
@ -47,3 +40,12 @@ Fork -> Patch -> Push -> Pull Request
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) 文件中。
## 截图
| | | |
|:---:|:---:|:---:|
|![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)|

File diff suppressed because it is too large Load Diff

View File

@ -112,10 +112,15 @@ func runHookPreReceive(c *cli.Context) error {
branchName := strings.TrimPrefix(refFullName, git.BranchPrefix)
protectBranch, err := private.GetProtectedBranchBy(repoID, branchName)
if err != nil {
log.GitLogger.Fatal(2, "retrieve protected branches information failed")
fail("Internal error", fmt.Sprintf("retrieve protected branches information failed: %v", err))
}
if protectBranch != nil && protectBranch.IsProtected() {
// check and deletion
if newCommitID == git.EmptySHA {
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
}
// detect force push
if git.EmptySHA != oldCommitID {
output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
@ -126,17 +131,12 @@ func runHookPreReceive(c *cli.Context) error {
}
}
// check and deletion
if newCommitID == git.EmptySHA {
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
} else {
userID, _ := strconv.ParseInt(userIDStr, 10, 64)
canPush, err := private.CanUserPush(protectBranch.ID, userID)
if err != nil {
fail("Internal error", "Fail to detect user can push: %v", err)
} else if !canPush {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
}
userID, _ := strconv.ParseInt(userIDStr, 10, 64)
canPush, err := private.CanUserPush(protectBranch.ID, userID)
if err != nil {
fail("Internal error", "Fail to detect user can push: %v", err)
} else if !canPush {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
}
}
}

View File

@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/pprof"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
@ -42,6 +43,9 @@ var CmdServ = cli.Command{
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
cli.BoolFlag{
Name: "enable-pprof",
},
},
}
@ -143,6 +147,18 @@ func runServ(c *cli.Context) error {
username := strings.ToLower(rr[0])
reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git"))
if setting.EnablePprof || c.Bool("enable-pprof") {
if err := os.MkdirAll(setting.PprofDataPath, os.ModePerm); err != nil {
fail("Error while trying to create PPROF_DATA_PATH", "Error while trying to create PPROF_DATA_PATH: %v", err)
}
stopCPUProfiler := pprof.DumpCPUProfileForUsername(setting.PprofDataPath, username)
defer func() {
stopCPUProfiler()
pprof.DumpMemProfileForUsername(setting.PprofDataPath, username)
}()
}
isWiki := false
unitType := models.UnitTypeCode
if strings.HasSuffix(reponame, ".wiki") {

View File

@ -5,6 +5,7 @@
package cmd
import (
"crypto/tls"
"fmt"
"net"
"net/http"
@ -22,6 +23,7 @@ import (
"github.com/Unknwon/com"
context2 "github.com/gorilla/context"
"github.com/urfave/cli"
"golang.org/x/crypto/acme/autocert"
ini "gopkg.in/ini.v1"
)
@ -71,6 +73,42 @@ func runHTTPRedirector() {
}
}
func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler) error {
certManager := autocert.Manager{
Prompt: autocert.AcceptTOS,
HostPolicy: autocert.HostWhitelist(domain),
Cache: autocert.DirCache(directory),
Email: email,
}
go func() {
log.Info("Running Let's Encrypt handler on %s", setting.HTTPAddr+":"+setting.PortToRedirect)
var err = http.ListenAndServe(setting.HTTPAddr+":"+setting.PortToRedirect, certManager.HTTPHandler(http.HandlerFunc(runLetsEncryptFallbackHandler))) // all traffic coming into HTTP will be redirect to HTTPS automatically (LE HTTP-01 validation happens here)
if err != nil {
log.Fatal(4, "Failed to start the Let's Encrypt handler on port %s: %v", setting.PortToRedirect, err)
}
}()
server := &http.Server{
Addr: listenAddr,
Handler: m,
TLSConfig: &tls.Config{
GetCertificate: certManager.GetCertificate,
},
}
return server.ListenAndServeTLS("", "")
}
func runLetsEncryptFallbackHandler(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" && r.Method != "HEAD" {
http.Error(w, "Use HTTPS", http.StatusBadRequest)
return
}
// Remove the trailing slash at the end of setting.AppURL, the request
// URI always contains a leading slash, which would result in a double
// slash
target := strings.TrimRight(setting.AppURL, "/") + r.URL.RequestURI()
http.Redirect(w, r, target, http.StatusFound)
}
func runWeb(ctx *cli.Context) error {
if ctx.IsSet("config") {
setting.CustomConf = ctx.String("config")
@ -143,6 +181,10 @@ func runWeb(ctx *cli.Context) error {
case setting.HTTP:
err = runHTTP(listenAddr, context2.ClearHandler(m))
case setting.HTTPS:
if setting.EnableLetsEncrypt {
err = runLetsEncrypt(listenAddr, setting.Domain, setting.LetsEncryptDirectory, setting.LetsEncryptEmail, context2.ClearHandler(m))
break
}
if setting.RedirectOtherPort {
go runHTTPRedirector()
}

View File

@ -60,6 +60,10 @@ FILE_MAX_SIZE = 3
; Max number of files per upload. Defaults to 5
MAX_FILES = 5
[repository.pull-request]
; List of prefixes used in Pull Request title to mark them as Work In Progress
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]
[ui]
; Number of repositories that are displayed on one explore page
EXPLORE_PAGING_NUM = 20
@ -67,6 +71,10 @@ EXPLORE_PAGING_NUM = 20
ISSUE_PAGING_NUM = 10
; Number of maximum commits displayed in one activity feed
FEED_MAX_COMMIT_NUM = 5
; Number of maximum commits displayed in commit graph.
GRAPH_MAX_COMMIT_NUM = 100
; Number of line of codes shown for a code comment
CODE_COMMENT_LINES = 4
; Value of `theme-color` meta tag, used by Android >= 5.0
; An invalid color like "none" or "disable" will have the default style
; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
@ -75,13 +83,15 @@ THEME_COLOR_META_TAG = `#6cc644`
MAX_DISPLAY_FILE_SIZE = 8388608
; Whether the email of the user should be shown in the Explore Users page
SHOW_USER_EMAIL = true
; Set the default theme for the Gitea install
DEFAULT_THEME = gitea
[ui.admin]
; Number of users that are displayed on one page
USER_PAGING_NUM = 50
; Number of repos that are displayed on one page
REPO_PAGING_NUM = 50
; Number of notices that are displayed on in one page
; Number of notices that are displayed on one page
NOTICE_PAGING_NUM = 25
; Number of organizations that are displayed on one page
ORG_PAGING_NUM = 50
@ -181,6 +191,12 @@ STATIC_ROOT_PATH =
APP_DATA_PATH = data
; Application level GZIP support
ENABLE_GZIP = false
; Application profiling (memory and cpu)
; For "web" command it listens on localhost:6060
; For "serve" command it dumps to disk at PPROF_DATA_PATH as (cpuprofile|memprofile)_<username>_<temporary id>
ENABLE_PPROF = false
; PPROF_DATA_PATH, use an absolute path when you start gitea as service
PPROF_DATA_PATH = data/tmp/pprof
; Landing page, can be "home", "explore", or "organizations"
LANDING_PAGE = home
; Enables git-lfs support. true or false, default is false.
@ -207,9 +223,10 @@ NAME = gitea
USER = root
; Use PASSWD = `your password` for quoting if you use special characters in the password.
PASSWD =
; For "postgres" only, either "disable", "require" or "verify-full"
; For Postgres, either "disable" (default), "require", or "verify-full"
; For MySQL, either "false" (default), "true", or "skip-verify"
SSL_MODE = disable
; For "sqlite3" and "tidb", use absolute path when you start gitea as service
; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
PATH = data/gitea.db
; For "sqlite3" only. Query timeout
SQLITE_TIMEOUT = 500
@ -301,13 +318,22 @@ ENABLE_NOTIFY_MAIL = false
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
; Enable captcha validation for registration
ENABLE_CAPTCHA = true
ENABLE_CAPTCHA = false
; Type of captcha you want to use. Options: image, recaptcha
CAPTCHA_TYPE = image
; Enable recaptcha to use Google's recaptcha service
; Go to https://www.google.com/recaptcha/admin to sign up for a key
RECAPTCHA_SECRET =
RECAPTCHA_SITEKEY =
; Default value for KeepEmailPrivate
; Each new user will get the value of this setting copied into their profile
DEFAULT_KEEP_EMAIL_PRIVATE = false
; Default value for AllowCreateOrganization
; Every new user will have rights set to create organizations depending on this setting
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
; Default value for EnableDependencies
; Repositories will use depencies by default depending on this setting
DEFAULT_ENABLE_DEPENDENCIES = true
; Enable Timetracking
ENABLE_TIMETRACKING = true
; Default value for EnableTimetracking
@ -568,8 +594,8 @@ DEFAULT_INTERVAL = 8h
MIN_INTERVAL = 10m
[api]
; Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true.
ENABLE_SWAGGER_ENDPOINT = true
; Enables Swagger. True or false; default is true.
ENABLE_SWAGGER = true
; Max number of items in a page
MAX_RESPONSE_ITEMS = 50

View File

@ -29,4 +29,3 @@ AllowUsers git
Banner none
Subsystem sftp /usr/lib/ssh/sftp-server
UsePrivilegeSeparation no

View File

@ -4,6 +4,9 @@ RUN_MODE = $RUN_MODE
[repository]
ROOT = /data/git/repositories
[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
[repository.upload]
TEMP_PATH = /data/gitea/uploads
@ -14,6 +17,7 @@ HTTP_PORT = $HTTP_PORT
ROOT_URL = $ROOT_URL
DISABLE_SSH = $DISABLE_SSH
SSH_PORT = $SSH_PORT
LFS_CONTENT_PATH = /data/git/lfs
[database]
PATH = /data/gitea/gitea.db
@ -23,6 +27,9 @@ NAME = $DB_NAME
USER = $DB_USER
PASSWD = $DB_PASSWD
[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
[session]
PROVIDER_CONFIG = /data/gitea/sessions

1
docs/.gitignore vendored
View File

@ -1,2 +1,3 @@
public/
templates/swagger/v1_json.tmpl
themes/

View File

@ -1,22 +0,0 @@
# build stage
FROM golang:alpine AS build-env
RUN apk add --no-cache git
RUN go get -d -v github.com/mholt/caddy/caddy github.com/pedronasser/caddy-search github.com/simia-tech/caddy-locale
WORKDIR /go/src/github.com/mholt/caddy/caddy
RUN sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/pedronasser/caddy-search"' caddymain/run.go \
&& sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/simia-tech/caddy-locale"' caddymain/run.go \
&& go install -v . \
&& /go/bin/caddy -version
FROM alpine:edge
EXPOSE 80
RUN apk add --no-cache wget mailcap ca-certificates
COPY --from=build-env /go/bin/caddy /usr/sbin/caddy
COPY docker/caddy.conf /etc/caddy.conf
COPY public /srv/www
CMD ["/usr/sbin/caddy", "-conf", "/etc/caddy.conf"]

View File

@ -31,7 +31,7 @@ menu:
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
@ -79,7 +79,7 @@ languages:
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: 博客
url: https://blog.gitea.io/
@ -122,7 +122,7 @@ languages:
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: 部落格
url: https://blog.gitea.io/
@ -165,7 +165,7 @@ languages:
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
@ -208,7 +208,7 @@ languages:
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
@ -241,17 +241,17 @@ languages:
menu:
page:
- name: Site
url: /fr-fr/
url: https://gitea.io/en-us/
weight: 10
pre: home
post: active
- name: Documentation
url: https://docs.gitea.io/fr-fr/
url: /fr-fr/
weight: 20
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/

View File

@ -73,3 +73,7 @@ using BasicAuth, as follows:
$ curl --request GET --url https://yourusername:yourpassword@gitea.your.host/api/v1/users/yourusername/tokens
[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}]
```
## Sudo
The API allows admin users to sudo API requests as another user. Simply add either a `sudo=` parameter or `Sudo:` request header with the username of the user to sudo.

View File

@ -0,0 +1,71 @@
---
date: "2018-06-24:00:00+02:00"
title: "API 使用指南"
slug: "api-usage"
weight: 40
toc: true
draft: false
menu:
sidebar:
parent: "advanced"
name: "API 使用指南"
weight: 40
identifier: "api-usage"
---
# Gitea API 使用指南
## 开启/配置 API 访问
通常情况下, `ENABLE_SWAGGER_ENDPOINT` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat
Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) 中获取更多配置相关信息。
## 通过 API 认证
Gitea 支持以下几种 API 认证方式:
- HTTP basic authentication 方式
- 通过指定 `token=...` URL 查询参数方式
- 通过指定 `access_token=...` URL 查询参数方式
- 通过指定 `Authorization: token ...` HTTP header 方式
以上提及的认证方法接受相同的 apiKey token 类型,您可以在编码时通过查阅代码更好地理解这一点。
Gitea 调用解析查询参数以及头部信息来获取 token 的代码可以在 [modules/auth/auth.go](https://github.com/go-gitea/gitea/blob/6efdcaed86565c91a3dc77631372a9cc45a58e89/modules/auth/auth.go#L47) 中找到。
您可以通过您的 gitea web 界面来创建 apiKey token
`Settings | Applications | Generate New Token`.
### 关于 `Authorization:` header
由于一些历史原因Gitea 需要在 header 的 apiKey token 里引入前缀 `token`,类似于如下形式:
```
Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675
```
`curl` 命令为例,它会以如下形式携带在请求中:
```
curl -X POST "http://localhost:4000/api/v1/repos/test1/test1/issues" \
-H "accept: application/json" \
-H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \
-H "Content-Type: application/json" -d "{ \"body\": \"testing\", \"title\": \"test 20\"}" -i
```
正如上例所示,您也可以在 GET 请求中使用同一个 token 并以 `token=` 的查询参数形式携带 token 来进行认证。
## 通过 API 列出您发布的令牌
`/users/:name/tokens` 是一个特殊的接口,需要您使用 basic authentication 进行认证,具体原因在 issue 中
[#3842](https://github.com/go-gitea/gitea/issues/3842#issuecomment-397743346) 有所提及,使用方法如下所示:
### 使用 Basic authentication 认证:
```
$ curl --request GET --url https://yourusername:yourpassword@gitea.your.host/api/v1/users/yourusername/tokens
[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}]
```
## 使用 Sudo 方式请求 API
此 API 允许管理员借用其他用户身份进行 API 请求。只需在请求中指定查询参数 `sudo=` 或是指定 header 中的 `Sudo:` 为需要使用的用户 username 即可。

View File

@ -62,12 +62,18 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
HTTP protocol.
- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when
default SSH port is used.
### Repository - Pull Request (`repository.pull-request`)
- `WORK_IN_PROGRESS_PREFIXES`: **WIP:,\[WIP\]**: List of prefixes used in Pull Request
title to mark them as Work In Progress
## UI (`ui`)
- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page.
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
### UI - Admin (`ui.admin`)
@ -119,6 +125,11 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests
on another (https) port.
- `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true.
- `ENABLE_LETSENCRYPT`: **false**: If enabled you must set `DOMAIN` to valid internet facing domain (ensure DNS is set and port 80 is accessible by letsencrypt validation server).
By using Lets Encrypt **you must consent** to their [terms of service](https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf).
- `LETSENCRYPT_ACCEPTTOS`: **false**: This is an explicit check that you accept the terms of service for Let's Encrypt.
- `LETSENCRYPT_DIRECTORY`: **https**: Directory that Letsencrypt will use to cache information such as certs and private keys.
- `LETSENCRYPT_EMAIL`: **email@example.com**: Email used by Letsencrypt to notify about problems with issued certificates. (No default)
## Database (`database`)
@ -127,7 +138,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `NAME`: **gitea**: Database name.
- `USER`: **root**: Database username.
- `PASSWD`: **\<empty\>**: Database user password. Use \`your password\` for quoting if you use special characters in the password.
- `SSL_MODE`: **disable**: For PostgreSQL only.
- `SSL_MODE`: **disable**: For PostgreSQL and MySQL only.
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
- `LOG_SQL`: **true**: Log the executed SQL.
@ -177,7 +188,11 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication.
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration
for reverse authentication.
- `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration.
- `ENABLE_CAPTCHA`: **false**: Enable this to use captcha validation for registration.
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha\]
- `RECAPTCHA_SECRET`: **""**: Go to https://www.google.com/recaptcha/admin to get a secret for recaptcha.
- `RECAPTCHA_SITEKEY`: **""**: Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha.
- `DEFAULT_ENABLE_DEPENDENCIES`: **true** Enable this to have dependencies enabled by default.
## Webhook (`webhook`)
@ -202,8 +217,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
This is common on linux systems.
- Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`,
`FROM` and `SENDMAIL_PATH`.
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be
command or full path)
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be
command or full path).
## Cache (`cache`)
@ -227,7 +242,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
`http://cn.gravatar.com/avatar/`.
- `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only.
- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see
http://www.libravatar.org)
[http://www.libravatar.org](http://www.libravatar.org)).
- `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store local and cached files.
## Attachment (`attachment`)
@ -279,10 +294,17 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view.
- `GC_ARGS`: **\<empty\>**: Arguments for command `git gc`, e.g. `--aggressive --auto`.
## Git - Timeout settings (`git.timeout`)
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
- `MIRROR`: **300**: Mirror external repositories timeout seconds.
- `CLONE`: **300**: Git clone from internal repositories timeout seconds.
- `PULL`: **300**: Git pull from internal repositories timeout seconds.
- `GC`: **60**: Git repository GC timeout seconds.
## API (`api`)
- `ENABLE_SWAGGER_ENDPOINT`: **true**: Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true.
- `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page
- `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page.
## i18n (`i18n`)

View File

@ -187,6 +187,13 @@ menu:
- `MAX_GIT_DIFF_FILES`: 比较视图中的最大现实文件数目。
- `GC_ARGS`: 执行 `git gc` 命令的参数, 比如: `--aggressive --auto`
## Git - 超时设置 (`git.timeout`)
- `MIGRATE`: **600**: 迁移外部仓库时的超时时间,单位秒
- `MIRROR`: **300**: 镜像外部仓库的超时时间,单位秒
- `CLONE`: **300**: 内部仓库间克隆的超时时间,单位秒
- `PULL`: **300**: 内部仓库间拉取的超时时间,单位秒
- `GC`: **60**: git仓库GC的超时时间单位秒
## markup (`markup`)
外部渲染工具支持,你可以用你熟悉的文档渲染工具. 比如一下将新增一个名字为 `asciidoc` 的渲染工具which is followed `markup.` ini section. And there are some config items below.

View File

@ -59,7 +59,7 @@ to override can be found in the `templates` directory of Gitea source. Override
making a copy of the file under `custom/templates` using a full path structure
matching source.
Any statement contained inside `{{` and `}}` are Gitea's templete syntax and
Any statement contained inside `{{` and `}}` are Gitea's template syntax and
shouldn't be touched without fully understanding these components.
### Adding links and tabs
@ -91,3 +91,7 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
## Customizing gitignores, labels, licenses, locales, and readmes.
Place custom files in corresponding sub-folder under `custom/options`.
## Customizing the look of Gitea
Gitea has two built-in themes, the default theme `gitea`, and a dark theme `arc-green`. To change the look of your Gitea install change the value of `DEFAULT_THEME` in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini` to another one of the available options.

View File

@ -0,0 +1,88 @@
---
date: "2017-04-15T14:56:00+02:00"
title: "自定义 Gitea 配置"
slug: "customizing-gitea"
weight: 9
toc: false
draft: false
menu:
sidebar:
parent: "advanced"
name: "自定义 Gitea 配置"
weight: 9
identifier: "customizing-gitea"
---
# 自定义 Gitea 配置
Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板等默认配置。
如果从二进制部署 Gitea ,则所有默认路径都将相对于该 gitea 二进制文件如果从发行版安装则可能会将这些路径修改为Linux文件系统标准。Gitea
将会自动创建包括 `custom/` 在内的必要应用目录,应用本身的配置存放在
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:
- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/)
- [完整配置清单](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。
- [环境变量清单](https://docs.gitea.io/en-us/specific-variables/)
**注:** 必须完全重启 Gitea 以使配置生效。
## 使用自定义 /robots.txt
将 [想要展示的内容](http://www.robotstxt.org/) 存放在 `custom` 目录中的
`robots.txt` 文件来让 Gitea 使用自定义的`/robots.txt` (默认:空 404
## 使用自定义的公共文件
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/image.png 访问。
## 修改默认头像
替换以下目录中的 png 图片: `custom/public/img/avatar\_default.png`
## 自定义 Gitea 页面
您可以改变 Gitea `custom/templates` 的每个单页面。您可以在 Gitea 源码的 `templates` 目录中找到用于覆盖的模板文件,应用将根据
`custom/templates` 目录下的路径结构进行匹配和覆盖。
包含在 `{{``}}` 中的任何语句都是 Gitea 的模板语法,如果您不完全理解这些组件,不建议您对它们进行修改。
### 添加链接和页签
如果您只是想添加额外的链接到顶部导航栏或额外的选项卡到存储库视图,您可以将它们放在您 `custom/templates/custom/` 目录下的 `extra_links.tmpl``extra_tabs.tmpl` 文件中。
举例说明假设您在德国必须添加着名的法律要求的“Impressum”用以罗列谁负责网站的内容页面您只需将该页面放在您的
"custom/public/"目录下(比如 `custom/public/impressum.html`)并且将它与 `custom/templates/custom/extra_links.tmpl` 链接起来即可。
这个链接应当使用一个名为“item”的 class 来匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
`<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>`
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同样的方式来添加页签。它的具体样式需要与
`templates/repo/header.tmpl` 中已有的其他选项卡的样式匹配
([source in GitHub](https://github.com/go-gitea/gitea/blob/master/templates/repo/header.tmpl))
### 页面的其他新增内容
除了 `extra_links.tmpl``extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目录中存放一些其他有用的模板,例如:
- `header.tmpl`,在 `<head>` 标记结束之前的模板例如添加自定义CSS文件
- `body_outer_pre.tmpl`,在 `<body>` 标记开始处的模板
- `body_inner_pre.tmpl`,在顶部导航栏之前,但在主 container 内部的模板,例如添加一个 `<div class="full height">`
- `body_inner_post.tmpl`,在主 container 结束处的模板
- `body_outer_post.tmpl`,在底部 `<footer>` 元素之前.
- `footer.tmpl`,在 `<body>` 标签结束处的模板,可以在这里填写一些附加的 Javascript 脚本。
## 自定义 gitignoreslabels licenses locales 以及 readmes
将自定义文件放在 `custom/options` 下相应子的文件夹中即可
## 更改 Gitea 外观
Gitea 目前由两种内置主题,分别为默认 `gitea` 主题和深色主题 `arc-green`,您可以通过修改
`app.ini` [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) 部分的 `DEFAULT_THEME` 的值来变更至一个可用的 Gitea 外观。

View File

@ -17,7 +17,8 @@ menu:
首先你需要一些运行环境,这和 [从源代码安装]({{< relref "from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。
如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea使用Govendor来管理依赖因此所有依赖项都被工具自动copy在vendor子目录下。用下面的命令来下载源码
如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea 使用 Govendor
来管理依赖,因此所有依赖项都被工具自动 copy 在 vendor 子目录下。用下面的命令来下载源码:
```
go get -d code.gitea.io/gitea
@ -39,4 +40,4 @@ git fetch --all --prune
然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。
好了到这里你已经设置好了所有的开发Gitea所需的环境。欢迎成为 Gitea 的 Contributor。
好了,到这里你已经设置好了所有的开发 Gitea 所需的环境。欢迎成为 Gitea 的 Contributor。

View File

@ -0,0 +1,45 @@
---
date: "2017-01-14T11:00:00-02:00"
title: "Make 安装"
slug: "make"
weight: 10
toc: true
draft: false
menu:
sidebar:
parent: "advanced"
name: "Make 安装"
weight: 30
identifier: "make"
---
# 安装 Make
Gitea 大量使用了 Make 工具来自动执行任务并改进开发,本文将介绍如何安装 Make。
### 在 Linux 环境下
可以使用包管理工具来安装 Make。
Ubuntu/Debian 环境,执行以下命令:
```bash
sudo apt-get install make
```
Fedora/RHEL/CentOS执行以下命令
```bash
sudo yum install make
```
### 在 Windows 环境下
您可以参照以下三种方案在 Windows 环境安装 Make
- 直接使用 [exe文件](http://www.equation.com/servlet/equation.cmd?fa=make)将适合您系统的exe文件拷贝到某处并添加至环境变量 `PATH` 中。
- [32 位版本](ftp://ftp.equation.com/make/32/make.exe)
- [64 位版本](ftp://ftp.equation.com/make/64/make.exe)
- 使用 [MinGW](http://www.mingw.org/) 工具:
- 此处使用二进制文件 `mingw32-make.exe` 替代前面提到的 `make.exe`文件。同样您需要将包含此exe文件的 `bin` 目录添加至环境变量 `PATH`中。
- 通过 [Chocolatey](https://chocolatey.org/packages/make) 安装: 执行 `choco install make` 命令即可。

View File

@ -66,4 +66,3 @@ For documentation about each of the variables available, refer to the
## Miscellaneous
* `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.
* `ZOOKEEPER_PATH`: [Zookeeper](http://zookeeper.apache.org/) jar file path

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