Compare commits
236 Commits
v1.6.0
...
v1.7.0-rc3
Author | SHA1 | Date | |
---|---|---|---|
8da5237107 | |||
8006b1bc7a | |||
8d400320c6 | |||
e9c4609410 | |||
176a6048b4 | |||
483aa06b07 | |||
551dc58a4d | |||
41a2bfe3ae | |||
652e09fc3e | |||
c9b57a5135 | |||
2904d8d6aa | |||
109fc7975b | |||
3ee3a4b595 | |||
14e218cbd1 | |||
b5f4911afa | |||
9863591dca | |||
121da08730 | |||
76060613ef | |||
74b9a13f84 | |||
7c3722b366 | |||
f5be13efb6 | |||
8764f1512d | |||
4c52858c39 | |||
63bd1b9203 | |||
b46c279587 | |||
64995bae0f | |||
2c7661a524 | |||
945804f800 | |||
8bb0a6f425 | |||
2058c362a8 | |||
6e20b504b1 | |||
21357a4ae0 | |||
a82ba73346 | |||
4a685f8b87 | |||
58bdff53cd | |||
b0b35493ec | |||
ba2c02b75d | |||
4586ae390f | |||
f0db86b663 | |||
9f544e9356 | |||
a06ae0bdc7 | |||
b77c3eb5bd | |||
9a33798b30 | |||
330bf8d3b3 | |||
4a02a783c4 | |||
7cb1d8296d | |||
8dc09edb04 | |||
9d0dee88d2 | |||
b65e37ed72 | |||
c64963553a | |||
7fd34c0517 | |||
2a660a1de1 | |||
fe55ab2a68 | |||
e726e4b828 | |||
8730ee0e45 | |||
94c3963da0 | |||
b3b7598ec6 | |||
49ea6e0deb | |||
ebef3eff23 | |||
0bd802e3e1 | |||
f0374ad1ad | |||
af6bce3ad5 | |||
6db7dbd333 | |||
b1f3685015 | |||
58c4559d3b | |||
ba75319157 | |||
ccea91652f | |||
6e114f6791 | |||
15d6cf179d | |||
9681c83734 | |||
64680b72bd | |||
205a533645 | |||
284b0e12cb | |||
8a64e67456 | |||
1b3404eaca | |||
928417ae39 | |||
7e5abe2dc4 | |||
7c0c965532 | |||
da5a0b8382 | |||
4b4453cb92 | |||
8b864a328e | |||
fdec258c8d | |||
a0ecc5f24e | |||
20c54f88b2 | |||
2d707fe5e6 | |||
ce4885f761 | |||
9441bfaccc | |||
bc42b3ab6c | |||
552014a068 | |||
06ef5b68d4 | |||
c761625c69 | |||
f80b4f46ae | |||
c8a9384a70 | |||
0787056e07 | |||
a7ee4a6e95 | |||
fdb417643d | |||
5c13ba8d2e | |||
2dc805c0c6 | |||
d5d847e5c4 | |||
f17524bd0c | |||
eabbddcd98 | |||
0222623be9 | |||
08bf443016 | |||
294904321c | |||
e09fe48773 | |||
c03a9b3e42 | |||
3a1ed82529 | |||
ce9a5173fe | |||
5e022a98e6 | |||
d9b0b7f56e | |||
499d132124 | |||
7e587e097c | |||
fd37fb01fd | |||
3379141d81 | |||
49d9900b1f | |||
6467934d29 | |||
5af7f8bd72 | |||
0dcf31ae49 | |||
cef0f12c51 | |||
8ef177f8c5 | |||
499bff43d9 | |||
3a95e2d0ea | |||
e08c7e521b | |||
4651ba06c1 | |||
d9b51a781c | |||
241ee793b7 | |||
e033d217e9 | |||
89eea64e10 | |||
7278372388 | |||
e110943562 | |||
b97af15de6 | |||
4c1f1f9646 | |||
b3000ae623 | |||
d487a76ee2 | |||
7dd31eb8fb | |||
2852c3576a | |||
c5d098c32e | |||
599adde1bc | |||
de8f98192b | |||
c2f72b1346 | |||
e8b197d6f6 | |||
8f8ff5a295 | |||
078c404c3b | |||
92fb89f6e1 | |||
0fd56a71e4 | |||
18391c1410 | |||
7096085f2b | |||
57a8440db3 | |||
54259e2f88 | |||
225c48982b | |||
fa165621ed | |||
4b84928874 | |||
7d9a191a3c | |||
00533d3870 | |||
584844eada | |||
6c90dd1f4a | |||
c8b4c7af65 | |||
794049e824 | |||
7edb930240 | |||
6eff62ae09 | |||
22ad514297 | |||
b686bd0c94 | |||
10370651fc | |||
e5daa2698f | |||
d0f614a25b | |||
98ea1a5143 | |||
a3e084716e | |||
220ee6ae42 | |||
e61c6cd3db | |||
0ba57949e4 | |||
5fc0a12627 | |||
617a2433a3 | |||
aefeb8c465 | |||
db30d6d791 | |||
735b12eaf0 | |||
1ceae07560 | |||
d4e6278764 | |||
70a80e31cf | |||
7694c99ab3 | |||
abf6e0d90b | |||
8b4c4bd08f | |||
b8451190d8 | |||
a2ee2a3c67 | |||
fb14458010 | |||
48badd59e9 | |||
8a9e44d181 | |||
2b7c366f64 | |||
99c09dfbfa | |||
2af57c7820 | |||
f887085ee0 | |||
e500b82c2c | |||
e7822473e9 | |||
aeb5655c25 | |||
5f938c0c78 | |||
554581f848 | |||
890a0c3cee | |||
c258ae8ada | |||
ffd5fb8139 | |||
7e5eec430d | |||
70ad46133f | |||
317ddb7283 | |||
efa4e6bc6f | |||
159c2ffb0e | |||
25c49cf930 | |||
2ce72d4e00 | |||
6759237eda | |||
f38fce916e | |||
9458880c06 | |||
43f9233914 | |||
9b2fcadeef | |||
c2748ea7fe | |||
5a4648cdd6 | |||
583b1b8429 | |||
2313121354 | |||
22274464f4 | |||
dea3d849e1 | |||
cabdf84f1f | |||
971dccda16 | |||
a908b29a74 | |||
616b8f42f9 | |||
47e4efe0c5 | |||
fef0410b92 | |||
8db3bdc683 | |||
ea619b39b2 | |||
dd62ca7ba9 | |||
7bb4d610e5 | |||
eb0c848f5b | |||
637c5fe1eb | |||
1e34413238 | |||
e4b8103ac7 | |||
97da83d008 | |||
486e989a39 | |||
e79e9248fd | |||
c37d1a9e99 | |||
384ef124e7 | |||
35ae14050e |
60
.drone.yml
60
.drone.yml
@ -67,7 +67,7 @@ pipeline:
|
||||
image: golang:1.11
|
||||
pull: true
|
||||
environment:
|
||||
TAGS: bindata sqlite
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
commands:
|
||||
- make clean
|
||||
- make generate
|
||||
@ -87,7 +87,7 @@ pipeline:
|
||||
pull: true
|
||||
group: test
|
||||
environment:
|
||||
TAGS: bindata sqlite
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
commands:
|
||||
- make unit-test-coverage
|
||||
when:
|
||||
@ -99,7 +99,7 @@ pipeline:
|
||||
pull: true
|
||||
group: test
|
||||
environment:
|
||||
TAGS: bindata sqlite
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
commands:
|
||||
- make test
|
||||
when:
|
||||
@ -117,17 +117,19 @@ pipeline:
|
||||
when:
|
||||
event: [ tag ]
|
||||
|
||||
# Commented until db locking have been resolved!
|
||||
# test-sqlite:
|
||||
# image: golang:1.10
|
||||
# pull: true
|
||||
# group: test
|
||||
# environment:
|
||||
# TAGS: bindata
|
||||
# commands:
|
||||
# - make test-sqlite
|
||||
# when:
|
||||
# event: [ push, tag, pull_request ]
|
||||
test-sqlite:
|
||||
image: golang:1.11
|
||||
pull: true
|
||||
group: test
|
||||
environment:
|
||||
TAGS: bindata
|
||||
commands:
|
||||
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
- apt-get install -y git-lfs
|
||||
- (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.sqlite.test)' | sh)) &
|
||||
- make test-sqlite
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
test-mysql:
|
||||
image: golang:1.11
|
||||
@ -154,6 +156,7 @@ pipeline:
|
||||
commands:
|
||||
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
- apt-get install -y git-lfs
|
||||
- (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
|
||||
- make test-mysql
|
||||
when:
|
||||
event: [ tag ]
|
||||
@ -168,10 +171,25 @@ pipeline:
|
||||
commands:
|
||||
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
- apt-get install -y git-lfs
|
||||
- (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
|
||||
- make test-pgsql
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
test-mssql:
|
||||
image: golang:1.11
|
||||
pull: true
|
||||
group: test
|
||||
environment:
|
||||
TAGS: bindata
|
||||
TEST_LDAP: "1"
|
||||
commands:
|
||||
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
- apt-get install -y git-lfs
|
||||
- make test-mssql
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
generate-coverage:
|
||||
image: golang:1.11
|
||||
pull: true
|
||||
@ -196,7 +214,7 @@ pipeline:
|
||||
image: karalabe/xgo-latest:latest
|
||||
pull: true
|
||||
environment:
|
||||
TAGS: bindata sqlite
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
commands:
|
||||
- export PATH=$PATH:$GOPATH/bin
|
||||
- make release
|
||||
@ -258,6 +276,7 @@ pipeline:
|
||||
pull: true
|
||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
||||
bucket: releases
|
||||
acl: public-read
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
strip_prefix: dist/release/
|
||||
@ -271,6 +290,7 @@ pipeline:
|
||||
pull: true
|
||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
||||
bucket: releases
|
||||
acl: public-read
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
strip_prefix: dist/release/
|
||||
@ -285,6 +305,7 @@ pipeline:
|
||||
pull: true
|
||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
||||
bucket: releases
|
||||
acl: public-read
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
strip_prefix: dist/release/
|
||||
@ -340,6 +361,15 @@ services:
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
mssql:
|
||||
image: microsoft/mssql-server-linux:latest
|
||||
environment:
|
||||
- ACCEPT_EULA=Y
|
||||
- SA_PASSWORD=MwantsaSecurePassword1
|
||||
- MSSQL_PID=Standard
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
ldap:
|
||||
image: gitea/test-openldap:latest
|
||||
when:
|
||||
|
52
.github/stale.yml
vendored
Normal file
52
.github/stale.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 60
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 14
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- status/blocked
|
||||
- kind/security
|
||||
- lgtm/done
|
||||
- reviewed/confirmed
|
||||
- priority/critical
|
||||
- kind/proposal
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you
|
||||
for your contributions.
|
||||
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
closeComment: >
|
||||
This issue has been automatically closed because of inactivity.
|
||||
You can re-open it if needed.
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 1
|
||||
|
||||
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
|
||||
pulls:
|
||||
daysUntilStale: 60
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you
|
||||
for your contributions.
|
||||
closeComment: >
|
||||
This pull request has been automatically closed because of inactivity.
|
||||
You can re-open it if needed.
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,11 +53,14 @@ coverage.all
|
||||
/integrations/gitea-integration-mysql
|
||||
/integrations/gitea-integration-pgsql
|
||||
/integrations/gitea-integration-sqlite
|
||||
/integrations/gitea-integration-mssql
|
||||
/integrations/indexers-mysql
|
||||
/integrations/indexers-pgsql
|
||||
/integrations/indexers-sqlite
|
||||
/integrations/indexers-mssql
|
||||
/integrations/mysql.ini
|
||||
/integrations/pgsql.ini
|
||||
/integrations/mssql.ini
|
||||
/node_modules
|
||||
|
||||
|
||||
|
25
.revive.toml
Normal file
25
.revive.toml
Normal file
@ -0,0 +1,25 @@
|
||||
ignoreGeneratedHeader = false
|
||||
severity = "warning"
|
||||
confidence = 0.8
|
||||
errorCode = 1
|
||||
warningCode = 1
|
||||
|
||||
[rule.blank-imports]
|
||||
[rule.context-as-argument]
|
||||
[rule.context-keys-type]
|
||||
[rule.dot-imports]
|
||||
[rule.error-return]
|
||||
[rule.error-strings]
|
||||
[rule.error-naming]
|
||||
[rule.exported]
|
||||
[rule.if-return]
|
||||
[rule.increment-decrement]
|
||||
[rule.var-naming]
|
||||
[rule.var-declaration]
|
||||
[rule.package-comments]
|
||||
[rule.range]
|
||||
[rule.receiver-naming]
|
||||
[rule.time-naming]
|
||||
[rule.unexported-return]
|
||||
[rule.indent-error-flow]
|
||||
[rule.errorf]
|
197
CHANGELOG.md
197
CHANGELOG.md
@ -4,6 +4,203 @@ 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.7.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.7.0-rc3) - 2019-01-18
|
||||
* SECURITY
|
||||
* Do not display the raw OpenID error in the UI (#5705) (#5712)
|
||||
* When redirecting clean the path to avoid redirecting to external site (#5669) (#5679)
|
||||
* BUGFIX
|
||||
* Fix sqlite deadlock when assigning to a PR (#5640) (#5642)
|
||||
* Don't close issues via commits on non-default branch. (#5622) (#5643)
|
||||
* Fix commit page showing status for current default branch (#5650) (#5653)
|
||||
* Only count users own actions for heatmap contributions (#5647) (#5655)
|
||||
* Update xorm to fix issue postgresql dumping issues (#5680) (#5692)
|
||||
* Use correct value for "MSpan Structures Obtained" (#5706) (#5716)
|
||||
|
||||
## [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.7.0-rc2](https://github.com/go-gitea/gitea/releases/tag/v1.7.0-rc2) - 2019-01-04
|
||||
* SECURITY
|
||||
* Prevent DeleteFilePost doing arbitrary deletion (#5631)
|
||||
|
||||
## [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.7.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.7.0) - 2019-01-02
|
||||
* BREAKING
|
||||
* Restrict permission check on repositories and fix some problems (#5314)
|
||||
* Show only opened milestones on issues page milestone filter (#5051)
|
||||
* FEATURE
|
||||
* Implement git refs API for listing references (branches, tags and other) (#5354)
|
||||
* Approvals at Branch Protection (#5350)
|
||||
* Add raw blob endpoint to get objects by SHA ID (#5334)
|
||||
* Add api for user to create org (#5268)
|
||||
* Create AuthorizedKeysCommand (#5236)
|
||||
* User action heatmap (#5131)
|
||||
* Refactor heatmap to vue component (#5401)
|
||||
* Webhook for Pull Request approval/rejection (#5027)
|
||||
* Add command for migrating database (#4954)
|
||||
* Search keyword by splitting provided values by , (#4939)
|
||||
* Create Progressive Web App (#4730)
|
||||
* Give user a link to create PR after push (#4716)
|
||||
* Add rebase with merge commit merge style (#3844) (#4052)
|
||||
* BUGFIXES
|
||||
* Fix bug on modifying sshd username (#5624)
|
||||
* Delete tags in mirror which are removed for original repo. (#5609)
|
||||
* Fix wrong text getting saved on editing second comment on an issue. (#5608)
|
||||
* Fix nil pointer when adding a due date (#5587)
|
||||
* Fix type mismatch of format string (#5574)
|
||||
* Fix bug on upload file name (#5571)
|
||||
* Issue is not overdue when it is on the same date #5566 (#5568)
|
||||
* Fix indexer reindex bug when gitea restart (#5563)
|
||||
* Fix table name typo on SQL (#5562)
|
||||
* Synchronize SSH keys on login with LDAP + Fix SQLite deadlock on ldap ssh key deletion (#5557)
|
||||
* Fix makefile generate buildstep (#5556)
|
||||
* Fix nil pointer base branch bug (#5555)
|
||||
* Fix permission check on api create org (#5523)
|
||||
* Fix detect force push failure on deletion of protected branches (#5522)
|
||||
* Fix approvals limitation (#5521)
|
||||
* Fix bug when a read perm user to edit his issue (#5516)
|
||||
* Fix adding reaction fail for read permission user (#5515)
|
||||
* Fixing MSSQL timestamp type (#5511)
|
||||
* Fix forgot deletion of notification when delete repository (#5506)
|
||||
* Fix empty wiki (#5504)
|
||||
* Fix clone wiki failed via ssh (#5503)
|
||||
* Fix code review on mssql (#5502)
|
||||
* Fix lfs version check warning log when using ssh protocol (#5501)
|
||||
* Fix topic name length on database (#5493)
|
||||
* Ensure that the `closed_at` is set for closed issues (#5449)
|
||||
* Admin should be able to delete repos via the API even if he is not a member of the organization (#5443)
|
||||
* Word-Break the WebHook url to prevent a ui-break (#5432)
|
||||
* Fix forgot removed records when deleting user (#5429)
|
||||
* Fix repository deletion when there is large number of issues in it (#5426)
|
||||
* Fix heatmap colors for Chrome/Safari (#5421)
|
||||
* Fix password variable shadowing (#5405)
|
||||
* Fix dependent issue searching when gitea is run in subpath (#5392)
|
||||
* Don't force a password change for the admin user when creating an account via cli (#5391)
|
||||
* API: '/orgs/:org/repos': return private repos with read access (#5383)
|
||||
* Don't send assign webhooks when creating issue (#5365)
|
||||
* Removing Labels via EditPullRequest API (#5348)
|
||||
* Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)
|
||||
* Fix bug when users have serval teams with different units on different repositories (#5307)
|
||||
* Fix U2F if gitea is configured in subpath (#5302)
|
||||
* Fix file edit change preview functionality (#5300)
|
||||
* Update gitignore list (#5258)
|
||||
* Fixed heatmap not working in mssql (#5248)
|
||||
* Fixed wrong api request url for instances running in subfolders (#5247)
|
||||
* Fix compatibility heatmap with mysql 8 (#5232)
|
||||
* Fix data race on migrate repository (#5224)
|
||||
* Fix sqlite and mssql lock (#5214)
|
||||
* Fix sqlite lock (#5210)
|
||||
* Fix: Accept web-command cli flags if web-command is commited (#5200)
|
||||
* Fix: Add secret to all webhook's payload where it has been missing (#5199)
|
||||
* Fix race on updatesize (#5190)
|
||||
* Fix create team, update team missing units (#5188)
|
||||
* Fix sqlite lock (#5184 & #5176)
|
||||
* Fix showing pull request link when delete a branch (#5166)
|
||||
* Fix JSON result of empty array in heatmap data array (#5154)
|
||||
* Update build tags for sqlite_unlock notify (#5144)
|
||||
* This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql (#5136)
|
||||
* Fix deadlock when sqlite (#5118)
|
||||
* Add comment replies (#5104)
|
||||
* Fix home page template regression (#5102)
|
||||
* Fix regex to support optional end line of old section in diff hunk (#5096)
|
||||
* LDAP via simple auth separate bind user and search base (#5055)
|
||||
* Fix markdown image with link (#4675)
|
||||
* Fix to 3819 - Filtering issues by tags on main screen issues (#3824)
|
||||
* ENHANCEMENT
|
||||
* Delete organization endpoint added (#5601)
|
||||
* Update Licenses (#5558)
|
||||
* Support reverse proxy providing email (#5554)
|
||||
* Add git protocol v2 support via SSH on Docker image (#5520)
|
||||
* Add tests for api user orgs (#5494)
|
||||
* Allow link verification for services like Mastodon (#5481)
|
||||
* Improve team members and repositories settings UI (#5457)
|
||||
* Remove the required class from optional ssh port in installation page (#5428)
|
||||
* Explicitly disable Git credential helper (#5367)
|
||||
* Setting Labels via EditPullRequest API (#5347)
|
||||
* Implement pasting image from clipboard for browsers that supports that (#5317)
|
||||
* Milestone issues and pull requests (#5293)
|
||||
* Support envs on external render commands (#5278)
|
||||
* Add option to disable automatic mirror syncing. (#5242)
|
||||
* Remove unused db init on commands serv, update, hooks (#5225)
|
||||
* Serve audio files using HTML5 audio tag (#5221)
|
||||
* Pass link prefixes to external markup parsers (#5201)
|
||||
* Add AutoHead functionality. (#5186)
|
||||
* Fix emojis not showing in commit messages (#5168)
|
||||
* Block registration based on email domain (#5157)
|
||||
* Update vendor/go-sqlite3 (#5133 & #5162)
|
||||
* Update x/net lib (#5169)
|
||||
* Show review summary in pull requests (#5132)
|
||||
* Use type switch (#5122)
|
||||
* Remove duplicated if bodies (#5121)
|
||||
* Remove check for negative length (#5120)
|
||||
* Make switch more clear (#5119)
|
||||
* Use named const instead of a raw string (#5115)
|
||||
* Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094)
|
||||
* Refactor: err != nil check, just return error instead (#5093)
|
||||
* Add notification interface and refactor UI notifications (#5085)
|
||||
* Use APP_NAME on home page (#5048)
|
||||
* Explicitly decide whether to use TLS in mailer's configuration (#5024)
|
||||
* Generate random password (#5023)
|
||||
* UX of link account (Step 1) (#5006)
|
||||
* Make sure argsSet verifies string isn't empty too (#4980)
|
||||
* Improve performance of dashboard (#4977)
|
||||
* Keys API changes (#4960)
|
||||
* Add must-change-password flag to cli for creating a user (#4955)
|
||||
* Use native go method to get current user rather than environment variable (#4930)
|
||||
* Make gitea serv use api/internal (#4886)
|
||||
* Add support for search by uid (#4876)
|
||||
* Allow to add organization members as collaborators on organization owned repositories (#4748)
|
||||
* TESTING
|
||||
* Kill testing processes if the test takes too long (#5174)
|
||||
* Update outdated Go toolchain version for .drone.yml (#5146)
|
||||
* Increase the retry limit to 20 times and the interval to 200ms (#5134)
|
||||
* Retry test-fixtures loading in case of transaction rollback (#5125)
|
||||
* Added test environment for mssql (#4282)
|
||||
* BUILD
|
||||
* Replace lint to revive (#5422)
|
||||
* Update golang version in Dockerfile (#5246)
|
||||
* DOCS
|
||||
* Typo in routers/api/v1/org/org.go fixed. (#5598)
|
||||
* Update the docs for sqlite_unlock_notify (#5145)
|
||||
* CN translation of docs part (#5049)
|
||||
* Kubernetes deployment file (#5046)
|
||||
* MISC
|
||||
* Upgrade alpine to 3.8 (#5423)
|
||||
* Git-Trees API (#5403)
|
||||
* Only chown directories during docker setup if necessary. Fix #4425 (#5064)
|
||||
|
||||
## [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)
|
||||
|
@ -244,6 +244,11 @@ they served:
|
||||
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
||||
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
||||
|
||||
* 2019-01-01 ~ 2019-12-31
|
||||
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
||||
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
||||
* [Matti Ranta](https://github.com/techknowlogick) <matti@mdranta.net>
|
||||
|
||||
## Versions
|
||||
|
||||
Gitea has the `master` branch as a tip branch and has version branches
|
||||
@ -275,7 +280,7 @@ be reviewed by two maintainers and must pass the automatic tests.
|
||||
Code that you contribute should use the standard copyright header:
|
||||
|
||||
```
|
||||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
```
|
||||
|
@ -1,10 +1,10 @@
|
||||
|
||||
###################################
|
||||
#Build stage
|
||||
FROM golang:1.10-alpine3.7 AS build-env
|
||||
FROM golang:1.11-alpine3.8 AS build-env
|
||||
|
||||
ARG GITEA_VERSION
|
||||
ARG TAGS="sqlite"
|
||||
ARG TAGS="sqlite sqlite_unlock_notify"
|
||||
ENV TAGS "bindata $TAGS"
|
||||
|
||||
#Build deps
|
||||
@ -18,7 +18,7 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
||||
&& make clean generate build
|
||||
|
||||
FROM alpine:3.7
|
||||
FROM alpine:3.8
|
||||
LABEL maintainer="maintainers@gitea.io"
|
||||
|
||||
EXPOSE 22 3000
|
||||
|
266
Gopkg.lock
generated
266
Gopkg.lock
generated
File diff suppressed because it is too large
Load Diff
29
Gopkg.toml
29
Gopkg.toml
@ -14,12 +14,18 @@ ignored = ["google.golang.org/appengine*"]
|
||||
branch = "master"
|
||||
name = "code.gitea.io/sdk"
|
||||
|
||||
[[constraint]]
|
||||
# branch = "master"
|
||||
revision = "c74e08f039e56cef576e4336382b2a2d12d9e026"
|
||||
name = "github.com/blevesearch/bleve"
|
||||
#Not targetting v0.7.0 since standard where use only just after this tag
|
||||
|
||||
[[constraint]]
|
||||
revision = "12dd70caea0268ac0d6c2707d0611ef601e7c64e"
|
||||
name = "golang.org/x/crypto"
|
||||
|
||||
[[constraint]]
|
||||
revision = "a646d33e2ee3172a661fc09bca23bb4889a41bc8"
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
|
||||
[[constraint]]
|
||||
@ -27,18 +33,25 @@ ignored = ["google.golang.org/appengine*"]
|
||||
name = "golang.org/x/text"
|
||||
|
||||
[[constraint]]
|
||||
revision = "f2499483f923065a842d38eb4c7f1927e6fc6e6d"
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/go-xorm/xorm"
|
||||
#version = "0.6.5"
|
||||
revision = "ad69f7d8f0861a29438154bb0a20b60501298480"
|
||||
revision = "1cd2662be938bfee0e34af92fe448513e0560fb1"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/go-xorm/builder"
|
||||
version = "0.3.3"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/go-sql-driver/mysql"
|
||||
revision = "d523deb1b23d913de5bdada721a6071e71283618"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/mattn/go-sqlite3"
|
||||
revision = "c7c4067b79cc51e6dfdcef5c702e74b1e0fa7c75"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/gorilla/mux"
|
||||
revision = "757bef944d0f21880861c2dd9c871ca543023cba"
|
||||
@ -57,7 +70,7 @@ ignored = ["google.golang.org/appengine*"]
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/markbates/goth"
|
||||
version = "1.46.1"
|
||||
version = "1.47.2"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
@ -101,5 +114,9 @@ ignored = ["google.golang.org/appengine*"]
|
||||
source = "github.com/go-gitea/bolt"
|
||||
|
||||
[[override]]
|
||||
revision = "c10ba270aa0bf8b8c1c986e103859c67a9103061"
|
||||
branch = "master"
|
||||
name = "golang.org/x/oauth2"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/prometheus/client_golang"
|
||||
version = "0.9.0"
|
||||
|
@ -20,7 +20,9 @@ Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
|
||||
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
|
||||
Peter Žeby <morlinest@gmail.com> (@morlinest)
|
||||
Matti Ranta <matti@mdranta.net> (@techknowlogick)
|
||||
Michael Lustfield <mtecknology@debian.org> (@MTecknology)
|
||||
Jonas Franz <info@jonasfranz.software> (@JonasFranzDEV)
|
||||
Jonas Franz <info@jonasfranz.software> (@jonasfranz)
|
||||
Alexey Terentyev <axifnx@gmail.com> (@axifive)
|
||||
Lanre Adelowo <yo@lanre.wtf> (@adelowo)
|
||||
Konrad Langenberg <k@knt.li> (@kolaente)
|
||||
He-Long Zhang <outman99@hotmail.com> (@BetaCat0)
|
||||
Andrew Thornton <art27@cantab.net> (@zeripath)
|
||||
|
35
Makefile
35
Makefile
@ -54,6 +54,10 @@ TEST_PGSQL_HOST ?= pgsql:5432
|
||||
TEST_PGSQL_DBNAME ?= testgitea
|
||||
TEST_PGSQL_USERNAME ?= postgres
|
||||
TEST_PGSQL_PASSWORD ?= postgres
|
||||
TEST_MSSQL_HOST ?= mssql:1433
|
||||
TEST_MSSQL_DBNAME ?= gitea
|
||||
TEST_MSSQL_USERNAME ?= sa
|
||||
TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
EXECUTABLE := gitea.exe
|
||||
@ -74,9 +78,9 @@ clean:
|
||||
$(GO) clean -i ./...
|
||||
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) \
|
||||
integrations*.test \
|
||||
integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-sqlite/ \
|
||||
integrations/indexers-mysql/ integrations/indexers-pgsql integrations/indexers-sqlite \
|
||||
integrations/mysql.ini integrations/pgsql.ini
|
||||
integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-sqlite/ integrations/gitea-integration-mssql/ \
|
||||
integrations/indexers-mysql/ integrations/indexers-pgsql integrations/indexers-sqlite integrations/indexers-mssql \
|
||||
integrations/mysql.ini integrations/pgsql.ini integrations/mssql.ini
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
@ -89,7 +93,7 @@ vet:
|
||||
.PHONY: generate
|
||||
generate:
|
||||
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) get -u github.com/jteeuwen/go-bindata/...; \
|
||||
$(GO) get -u github.com/jteeuwen/go-bindata/go-bindata; \
|
||||
fi
|
||||
$(GO) generate $(PACKAGES)
|
||||
|
||||
@ -128,10 +132,10 @@ errcheck:
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) get -u golang.org/x/lint/golint; \
|
||||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) get -u github.com/mgechev/revive; \
|
||||
fi
|
||||
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
|
||||
revive -config .revive.toml -exclude=./vendor/... ./... || exit 1
|
||||
|
||||
.PHONY: misspell-check
|
||||
misspell-check:
|
||||
@ -159,7 +163,7 @@ fmt-check:
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(GO) test -tags=sqlite $(PACKAGES)
|
||||
$(GO) test -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
@ -170,7 +174,7 @@ coverage:
|
||||
|
||||
.PHONY: unit-test-coverage
|
||||
unit-test-coverage:
|
||||
for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
|
||||
for PKG in $(PACKAGES); do $(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
|
||||
|
||||
.PHONY: vendor
|
||||
vendor:
|
||||
@ -204,6 +208,11 @@ generate-ini:
|
||||
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
|
||||
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
|
||||
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
|
||||
sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
|
||||
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
|
||||
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
|
||||
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
|
||||
integrations/mssql.ini.tmpl > integrations/mssql.ini
|
||||
|
||||
.PHONY: test-mysql
|
||||
test-mysql: integrations.test generate-ini
|
||||
@ -213,6 +222,10 @@ test-mysql: integrations.test generate-ini
|
||||
test-pgsql: integrations.test generate-ini
|
||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
|
||||
|
||||
.PHONY: test-mssql
|
||||
test-mssql: integrations.test generate-ini
|
||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test
|
||||
|
||||
.PHONY: bench-sqlite
|
||||
bench-sqlite: integrations.sqlite.test
|
||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
|
||||
@ -234,7 +247,7 @@ integrations.test: $(SOURCES)
|
||||
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.test
|
||||
|
||||
integrations.sqlite.test: $(SOURCES)
|
||||
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite'
|
||||
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
|
||||
|
||||
integrations.cover.test: $(SOURCES)
|
||||
$(GO) test -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
||||
@ -347,6 +360,8 @@ update-translations:
|
||||
generate-images:
|
||||
mkdir -p $(TMPDIR)/images
|
||||
inkscape -f $(PWD)/assets/logo.svg -w 880 -h 880 -e $(PWD)/public/img/gitea-lg.png
|
||||
inkscape -f $(PWD)/assets/logo.svg -w 512 -h 512 -e $(PWD)/public/img/gitea-512.png
|
||||
inkscape -f $(PWD)/assets/logo.svg -w 192 -h 192 -e $(PWD)/public/img/gitea-192.png
|
||||
inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer1 -e $(TMPDIR)/images/sm-1.png
|
||||
inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer2 -e $(TMPDIR)/images/sm-2.png
|
||||
composite -compose atop $(TMPDIR)/images/sm-2.png $(TMPDIR)/images/sm-1.png $(PWD)/public/img/gitea-sm.png
|
||||
|
@ -38,7 +38,7 @@ More info: https://docs.gitea.io/en-us/install-from-source/
|
||||
./gitea web
|
||||
|
||||
NOTE: If you're interested in using our APIs, we have experimental
|
||||
support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
|
||||
support with [documentation](https://try.gitea.io/api/swagger).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
80
cmd/admin.go
80
cmd/admin.go
@ -6,6 +6,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"text/tabwriter"
|
||||
@ -13,6 +14,7 @@ import (
|
||||
"code.gitea.io/git"
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/auth/oauth2"
|
||||
"code.gitea.io/gitea/modules/generate"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
@ -59,6 +61,19 @@ var (
|
||||
Value: "custom/conf/app.ini",
|
||||
Usage: "Custom configuration file path",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "random-password",
|
||||
Usage: "Generate a random password for the user",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "must-change-password",
|
||||
Usage: "Force the user to change his/her password after initial login",
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "random-password-length",
|
||||
Usage: "Length of the random password to be generated",
|
||||
Value: 12,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -273,10 +288,30 @@ func runChangePassword(c *cli.Context) error {
|
||||
}
|
||||
|
||||
func runCreateUser(c *cli.Context) error {
|
||||
if err := argsSet(c, "name", "password", "email"); err != nil {
|
||||
if err := argsSet(c, "name", "email"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if c.IsSet("password") && c.IsSet("random-password") {
|
||||
return errors.New("cannot set both -random-password and -password flags")
|
||||
}
|
||||
|
||||
var password string
|
||||
|
||||
if c.IsSet("password") {
|
||||
password = c.String("password")
|
||||
} else if c.IsSet("random-password") {
|
||||
var err error
|
||||
password, err = generate.GetRandomString(c.Int("random-password-length"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("generated random password is '%s'\n", password)
|
||||
} else {
|
||||
return errors.New("must set either password or random-password flag")
|
||||
}
|
||||
|
||||
if c.IsSet("config") {
|
||||
setting.CustomConf = c.String("config")
|
||||
}
|
||||
@ -285,12 +320,26 @@ func runCreateUser(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// always default to true
|
||||
var changePassword = true
|
||||
|
||||
// If this is the first user being created.
|
||||
// Take it as the admin and don't force a password update.
|
||||
if n := models.CountUsers(); n == 0 {
|
||||
changePassword = false
|
||||
}
|
||||
|
||||
if c.IsSet("must-change-password") {
|
||||
changePassword = c.Bool("must-change-password")
|
||||
}
|
||||
|
||||
if err := models.CreateUser(&models.User{
|
||||
Name: c.String("name"),
|
||||
Email: c.String("email"),
|
||||
Passwd: c.String("password"),
|
||||
IsActive: true,
|
||||
IsAdmin: c.Bool("admin"),
|
||||
Name: c.String("name"),
|
||||
Email: c.String("email"),
|
||||
Passwd: password,
|
||||
IsActive: true,
|
||||
IsAdmin: c.Bool("admin"),
|
||||
MustChangePassword: changePassword,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("CreateUser: %v", err)
|
||||
}
|
||||
@ -412,16 +461,12 @@ func runAddOauth(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := models.CreateLoginSource(&models.LoginSource{
|
||||
return models.CreateLoginSource(&models.LoginSource{
|
||||
Type: models.LoginOAuth2,
|
||||
Name: c.String("name"),
|
||||
IsActived: true,
|
||||
Cfg: parseOAuth2Config(c),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func runUpdateOauth(c *cli.Context) error {
|
||||
@ -492,11 +537,7 @@ func runUpdateOauth(c *cli.Context) error {
|
||||
oAuth2Config.CustomURLMapping = customURLMapping
|
||||
source.Cfg = oAuth2Config
|
||||
|
||||
if err := models.UpdateSource(source); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return models.UpdateSource(source)
|
||||
}
|
||||
|
||||
func runListAuth(c *cli.Context) error {
|
||||
@ -543,8 +584,5 @@ func runDeleteAuth(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = models.DeleteSource(source); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return models.DeleteSource(source)
|
||||
}
|
||||
|
11
cmd/cmd.go
11
cmd/cmd.go
@ -9,6 +9,7 @@ package cmd
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
@ -22,15 +23,23 @@ func argsSet(c *cli.Context, args ...string) error {
|
||||
if !c.IsSet(a) {
|
||||
return errors.New(a + " is not set")
|
||||
}
|
||||
|
||||
if len(strings.TrimSpace(c.String(a))) == 0 {
|
||||
return errors.New(a + " is required")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func initDB() error {
|
||||
return initDBDisableConsole(false)
|
||||
}
|
||||
|
||||
func initDBDisableConsole(disableConsole bool) error {
|
||||
setting.NewContext()
|
||||
models.LoadConfigs()
|
||||
|
||||
setting.NewXORMLogService(false)
|
||||
setting.NewXORMLogService(disableConsole)
|
||||
if err := models.SetEngine(); err != nil {
|
||||
return fmt.Errorf("models.SetEngine: %v", err)
|
||||
}
|
||||
|
80
cmd/hook.go
80
cmd/hook.go
@ -8,8 +8,8 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -62,12 +62,6 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func hookSetup(logPath string) {
|
||||
setting.NewContext()
|
||||
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
|
||||
models.LoadConfigs()
|
||||
}
|
||||
|
||||
func runHookPreReceive(c *cli.Context) error {
|
||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||
return nil
|
||||
@ -79,7 +73,7 @@ func runHookPreReceive(c *cli.Context) error {
|
||||
setting.CustomConf = c.GlobalString("config")
|
||||
}
|
||||
|
||||
hookSetup("hooks/pre-receive.log")
|
||||
setup("hooks/pre-receive.log")
|
||||
|
||||
// the environment setted on serv command
|
||||
repoID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchRepoID), 10, 64)
|
||||
@ -112,10 +106,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 +125,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), "")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -155,7 +149,7 @@ func runHookUpdate(c *cli.Context) error {
|
||||
setting.CustomConf = c.GlobalString("config")
|
||||
}
|
||||
|
||||
hookSetup("hooks/update.log")
|
||||
setup("hooks/update.log")
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -171,9 +165,10 @@ func runHookPostReceive(c *cli.Context) error {
|
||||
setting.CustomConf = c.GlobalString("config")
|
||||
}
|
||||
|
||||
hookSetup("hooks/post-receive.log")
|
||||
setup("hooks/post-receive.log")
|
||||
|
||||
// the environment setted on serv command
|
||||
repoID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchRepoID), 10, 64)
|
||||
repoUser := os.Getenv(models.EnvRepoUsername)
|
||||
isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true")
|
||||
repoName := os.Getenv(models.EnvRepoName)
|
||||
@ -211,6 +206,47 @@ func runHookPostReceive(c *cli.Context) error {
|
||||
}); err != nil {
|
||||
log.GitLogger.Error(2, "Update: %v", err)
|
||||
}
|
||||
|
||||
if newCommitID != git.EmptySHA && strings.HasPrefix(refFullName, git.BranchPrefix) {
|
||||
branch := strings.TrimPrefix(refFullName, git.BranchPrefix)
|
||||
repo, pullRequestAllowed, err := private.GetRepository(repoID)
|
||||
if err != nil {
|
||||
log.GitLogger.Error(2, "get repo: %v", err)
|
||||
break
|
||||
}
|
||||
if !pullRequestAllowed {
|
||||
break
|
||||
}
|
||||
|
||||
baseRepo := repo
|
||||
if repo.IsFork {
|
||||
baseRepo = repo.BaseRepo
|
||||
}
|
||||
|
||||
if !repo.IsFork && branch == baseRepo.DefaultBranch {
|
||||
break
|
||||
}
|
||||
|
||||
pr, err := private.ActivePullRequest(baseRepo.ID, repo.ID, baseRepo.DefaultBranch, branch)
|
||||
if err != nil {
|
||||
log.GitLogger.Error(2, "get active pr: %v", err)
|
||||
break
|
||||
}
|
||||
|
||||
fmt.Fprintln(os.Stderr, "")
|
||||
if pr == nil {
|
||||
if repo.IsFork {
|
||||
branch = fmt.Sprintf("%s:%s", repo.OwnerName, branch)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "Create a new pull request for '%s':\n", branch)
|
||||
fmt.Fprintf(os.Stderr, " %s/compare/%s...%s\n", baseRepo.HTMLURL(), url.QueryEscape(baseRepo.DefaultBranch), url.QueryEscape(branch))
|
||||
} else {
|
||||
fmt.Fprint(os.Stderr, "Visit the existing pull request:\n")
|
||||
fmt.Fprintf(os.Stderr, " %s/pulls/%d\n", baseRepo.HTMLURL(), pr.Index)
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, "")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
|
85
cmd/keys.go
Normal file
85
cmd/keys.go
Normal file
@ -0,0 +1,85 @@
|
||||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
// CmdKeys represents the available keys sub-command
|
||||
var CmdKeys = cli.Command{
|
||||
Name: "keys",
|
||||
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
|
||||
Action: runKeys,
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "expected, e",
|
||||
Value: "git",
|
||||
Usage: "Expected user for whom provide key commands",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "username, u",
|
||||
Value: "",
|
||||
Usage: "Username trying to log in by SSH",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "type, t",
|
||||
Value: "",
|
||||
Usage: "Type of the SSH key provided to the SSH Server (requires content to be provided too)",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "content, k",
|
||||
Value: "",
|
||||
Usage: "Base64 encoded content of the SSH key provided to the SSH Server (requires type to be provided too)",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "config, c",
|
||||
Value: "custom/conf/app.ini",
|
||||
Usage: "Custom configuration file path",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func runKeys(c *cli.Context) error {
|
||||
if c.IsSet("config") {
|
||||
setting.CustomConf = c.String("config")
|
||||
}
|
||||
|
||||
if !c.IsSet("username") {
|
||||
return errors.New("No username provided")
|
||||
}
|
||||
// Check username matches the expected username
|
||||
if strings.TrimSpace(c.String("username")) != strings.TrimSpace(c.String("expected")) {
|
||||
return nil
|
||||
}
|
||||
|
||||
content := ""
|
||||
|
||||
if c.IsSet("type") && c.IsSet("content") {
|
||||
content = fmt.Sprintf("%s %s", strings.TrimSpace(c.String("type")), strings.TrimSpace(c.String("content")))
|
||||
}
|
||||
|
||||
if content == "" {
|
||||
return errors.New("No key type and content provided")
|
||||
}
|
||||
|
||||
if err := initDBDisableConsole(true); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
publicKey, err := models.SearchPublicKeyByContent(content)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(publicKey.AuthorizedString())
|
||||
return nil
|
||||
}
|
52
cmd/migrate.go
Normal file
52
cmd/migrate.go
Normal file
@ -0,0 +1,52 @@
|
||||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/migrations"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
// CmdMigrate represents the available migrate sub-command.
|
||||
var CmdMigrate = cli.Command{
|
||||
Name: "migrate",
|
||||
Usage: "Migrate the database",
|
||||
Description: "This is a command for migrating the database, so that you can run gitea admin create-user before starting the server.",
|
||||
Action: runMigrate,
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "config, c",
|
||||
Value: "custom/conf/app.ini",
|
||||
Usage: "Custom configuration file path",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func runMigrate(ctx *cli.Context) error {
|
||||
if ctx.IsSet("config") {
|
||||
setting.CustomConf = ctx.String("config")
|
||||
}
|
||||
|
||||
if err := initDB(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Trace("AppPath: %s", setting.AppPath)
|
||||
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
|
||||
log.Trace("Custom path: %s", setting.CustomPath)
|
||||
log.Trace("Log path: %s", setting.LogRootPath)
|
||||
models.LoadConfigs()
|
||||
|
||||
if err := models.NewEngine(migrations.Migrate); err != nil {
|
||||
log.Fatal(4, "Failed to initialize ORM engine: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
87
cmd/serv.go
87
cmd/serv.go
@ -14,15 +14,16 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/git"
|
||||
"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"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
version "github.com/mcuadros/go-version"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -49,20 +50,29 @@ var CmdServ = cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
func setup(logPath string) error {
|
||||
setting.NewContext()
|
||||
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
|
||||
models.LoadConfigs()
|
||||
func checkLFSVersion() {
|
||||
if setting.LFS.StartServer {
|
||||
//Disable LFS client hooks if installed for the current OS user
|
||||
//Needs at least git v2.1.2
|
||||
binVersion, err := git.BinVersion()
|
||||
if err != nil {
|
||||
fail(fmt.Sprintf("Error retrieving git version: %v", err), fmt.Sprintf("Error retrieving git version: %v", err))
|
||||
}
|
||||
|
||||
if setting.UseSQLite3 || setting.UseTiDB {
|
||||
workPath := setting.AppWorkPath
|
||||
if err := os.Chdir(workPath); err != nil {
|
||||
log.GitLogger.Fatal(4, "Failed to change directory %s: %v", workPath, err)
|
||||
if !version.Compare(binVersion, "2.1.2", ">=") {
|
||||
setting.LFS.StartServer = false
|
||||
println("LFS server support needs at least Git v2.1.2, disabled")
|
||||
} else {
|
||||
git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "filter.lfs.required=",
|
||||
"-c", "filter.lfs.smudge=", "-c", "filter.lfs.clean=")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setting.NewXORMLogService(true)
|
||||
return models.SetEngine()
|
||||
func setup(logPath string) {
|
||||
setting.NewContext()
|
||||
checkLFSVersion()
|
||||
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
|
||||
}
|
||||
|
||||
func parseCmd(cmd string) (string, string) {
|
||||
@ -101,10 +111,7 @@ func runServ(c *cli.Context) error {
|
||||
if c.IsSet("config") {
|
||||
setting.CustomConf = c.String("config")
|
||||
}
|
||||
|
||||
if err := setup("serv.log"); err != nil {
|
||||
fail("System init failed", fmt.Sprintf("setup: %v", err))
|
||||
}
|
||||
setup("serv.log")
|
||||
|
||||
if setting.SSH.Disabled {
|
||||
println("Gitea: SSH has been disabled")
|
||||
@ -159,11 +166,15 @@ func runServ(c *cli.Context) error {
|
||||
}()
|
||||
}
|
||||
|
||||
isWiki := false
|
||||
unitType := models.UnitTypeCode
|
||||
var (
|
||||
isWiki bool
|
||||
unitType = models.UnitTypeCode
|
||||
unitName = "code"
|
||||
)
|
||||
if strings.HasSuffix(reponame, ".wiki") {
|
||||
isWiki = true
|
||||
unitType = models.UnitTypeWiki
|
||||
unitName = "wiki"
|
||||
reponame = reponame[:len(reponame)-5]
|
||||
}
|
||||
|
||||
@ -175,9 +186,9 @@ func runServ(c *cli.Context) error {
|
||||
}
|
||||
os.Setenv(models.EnvRepoName, reponame)
|
||||
|
||||
repo, err := models.GetRepositoryByOwnerAndName(username, reponame)
|
||||
repo, err := private.GetRepositoryByOwnerAndName(username, reponame)
|
||||
if err != nil {
|
||||
if models.IsErrRepoNotExist(err) {
|
||||
if strings.Contains(err.Error(), "Failed to get repository: repository does not exist") {
|
||||
fail(accessDenied, "Repository does not exist: %s/%s", username, reponame)
|
||||
}
|
||||
fail("Internal error", "Failed to get repository: %v", err)
|
||||
@ -208,13 +219,13 @@ func runServ(c *cli.Context) error {
|
||||
keyID int64
|
||||
user *models.User
|
||||
)
|
||||
if requestedMode == models.AccessModeWrite || repo.IsPrivate {
|
||||
if requestedMode == models.AccessModeWrite || repo.IsPrivate || setting.Service.RequireSignInView {
|
||||
keys := strings.Split(c.Args()[0], "-")
|
||||
if len(keys) != 2 {
|
||||
fail("Key ID format error", "Invalid key argument: %s", c.Args()[0])
|
||||
}
|
||||
|
||||
key, err := models.GetPublicKeyByID(com.StrTo(keys[1]).MustInt64())
|
||||
key, err := private.GetPublicKeyByID(com.StrTo(keys[1]).MustInt64())
|
||||
if err != nil {
|
||||
fail("Invalid key ID", "Invalid key ID[%s]: %v", c.Args()[0], err)
|
||||
}
|
||||
@ -225,23 +236,22 @@ func runServ(c *cli.Context) error {
|
||||
if key.Mode < requestedMode {
|
||||
fail("Key permission denied", "Cannot push with deployment key: %d", key.ID)
|
||||
}
|
||||
|
||||
// Check if this deploy key belongs to current repository.
|
||||
if !models.HasDeployKey(key.ID, repo.ID) {
|
||||
has, err := private.HasDeployKey(key.ID, repo.ID)
|
||||
if err != nil {
|
||||
fail("Key access denied", "Failed to access internal api: [key_id: %d, repo_id: %d]", key.ID, repo.ID)
|
||||
}
|
||||
if !has {
|
||||
fail("Key access denied", "Deploy key access denied: [key_id: %d, repo_id: %d]", key.ID, repo.ID)
|
||||
}
|
||||
|
||||
// Update deploy key activity.
|
||||
deployKey, err := models.GetDeployKeyByRepo(key.ID, repo.ID)
|
||||
if err != nil {
|
||||
fail("Internal error", "GetDeployKey: %v", err)
|
||||
}
|
||||
|
||||
deployKey.UpdatedUnix = util.TimeStampNow()
|
||||
if err = models.UpdateDeployKeyCols(deployKey, "updated_unix"); err != nil {
|
||||
if err = private.UpdateDeployKeyUpdated(key.ID, repo.ID); err != nil {
|
||||
fail("Internal error", "UpdateDeployKey: %v", err)
|
||||
}
|
||||
} else {
|
||||
user, err = models.GetUserByKeyID(key.ID)
|
||||
user, err = private.GetUserByKeyID(key.ID)
|
||||
if err != nil {
|
||||
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
|
||||
}
|
||||
@ -252,25 +262,19 @@ func runServ(c *cli.Context) error {
|
||||
user.Name, repoPath)
|
||||
}
|
||||
|
||||
mode, err := models.AccessLevel(user.ID, repo)
|
||||
mode, err := private.CheckUnitUser(user.ID, repo.ID, user.IsAdmin, unitType)
|
||||
if err != nil {
|
||||
fail("Internal error", "Failed to check access: %v", err)
|
||||
} else if mode < requestedMode {
|
||||
} else if *mode < requestedMode {
|
||||
clientMessage := accessDenied
|
||||
if mode >= models.AccessModeRead {
|
||||
if *mode >= models.AccessModeRead {
|
||||
clientMessage = "You do not have sufficient authorization for this action"
|
||||
}
|
||||
fail(clientMessage,
|
||||
"User %s does not have level %v access to repository %s",
|
||||
"User %s does not have level %v access to repository %s's "+unitName,
|
||||
user.Name, requestedMode, repoPath)
|
||||
}
|
||||
|
||||
if !repo.CheckUnitUser(user.ID, user.IsAdmin, unitType) {
|
||||
fail("You do not have allowed for this action",
|
||||
"User %s does not have allowed access to repository %s 's code",
|
||||
user.Name, repoPath)
|
||||
}
|
||||
|
||||
os.Setenv(models.EnvPusherName, user.Name)
|
||||
os.Setenv(models.EnvPusherID, fmt.Sprintf("%d", user.ID))
|
||||
}
|
||||
@ -325,9 +329,8 @@ func runServ(c *cli.Context) error {
|
||||
} else {
|
||||
gitcmd = exec.Command(verb, repoPath)
|
||||
}
|
||||
|
||||
if isWiki {
|
||||
if err = repo.InitWiki(); err != nil {
|
||||
if err = private.InitWiki(repo.ID); err != nil {
|
||||
fail("Internal error", "Failed to init wiki repo: %v", err)
|
||||
}
|
||||
}
|
||||
|
13
cmd/web.go
13
cmd/web.go
@ -80,7 +80,13 @@ func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler)
|
||||
Cache: autocert.DirCache(directory),
|
||||
Email: email,
|
||||
}
|
||||
go http.ListenAndServe(listenAddr+":"+setting.PortToRedirect, certManager.HTTPHandler(http.HandlerFunc(runLetsEncryptFallbackHandler))) // all traffic coming into HTTP will be redirect to HTTPS automatically (LE HTTP-01 validatio happens here)
|
||||
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,
|
||||
@ -96,7 +102,10 @@ func runLetsEncryptFallbackHandler(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Use HTTPS", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
target := setting.AppURL + r.URL.RequestURI()
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "debug",
|
||||
"buildFlags": "-tags=\"sqlite\"",
|
||||
"buildFlags": "-tags=\"sqlite sqlite_unlock_notify\"",
|
||||
"port": 2345,
|
||||
"host": "127.0.0.1",
|
||||
"program": "${workspaceRoot}/main.go",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"focus": false,
|
||||
"panel": "shared"
|
||||
},
|
||||
"args": ["build", "-tags=\"sqlite\""],
|
||||
"args": ["build", "-tags=\"sqlite sqlite_unlock_notify\""],
|
||||
"linux": {
|
||||
"args": ["-o", "gitea", "${workspaceRoot}/main.go"]
|
||||
},
|
||||
|
107
contrib/k8s/gitea.yml
Normal file
107
contrib/k8s/gitea.yml
Normal file
@ -0,0 +1,107 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: gitea
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: gitea
|
||||
namespace: gitea
|
||||
labels:
|
||||
app: gitea
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
name: gitea
|
||||
labels:
|
||||
app: gitea
|
||||
spec:
|
||||
containers:
|
||||
- name: gitea
|
||||
image: gitea/gitea:latest
|
||||
imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- mountPath: "/var/lib/gitea"
|
||||
name: "root"
|
||||
- mountPath: "/data"
|
||||
name: "data"
|
||||
ports:
|
||||
- containerPort: 22
|
||||
name: ssh
|
||||
protocol: TCP
|
||||
- containerPort: 3000
|
||||
name: http
|
||||
protocol: TCP
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
# Set up a data directory for gitea
|
||||
# For production usage, you should consider using PV/PVC instead(or simply using storage like NAS)
|
||||
# For more details, please see https://kubernetes.io/docs/concepts/storage/volumes/
|
||||
- name: "root"
|
||||
hostPath:
|
||||
# directory location on host
|
||||
path: "/var/lib/gitea"
|
||||
# this field is optional
|
||||
type: Directory
|
||||
- name: "data"
|
||||
hostPath:
|
||||
path: "/data/gitea"
|
||||
type: Directory
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gitea
|
||||
---
|
||||
# Using cluster mode
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: gitea-web
|
||||
namespace: gitea
|
||||
labels:
|
||||
app: gitea-web
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 3000
|
||||
name: http
|
||||
selector:
|
||||
app: gitea
|
||||
---
|
||||
# Using node-port mode
|
||||
# This mainly open a specific TCP port for SSH usage on each host,
|
||||
# so you can use a proxy layer to handle it(e.g. slb, nginx)
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: gitea-ssh
|
||||
namespace: gitea
|
||||
labels:
|
||||
app: gitea-ssh
|
||||
spec:
|
||||
ports:
|
||||
- port: 22
|
||||
targetPort: 22
|
||||
nodePort: 30022
|
||||
name: ssh
|
||||
selector:
|
||||
app: gitea
|
||||
type: NodePort
|
||||
---
|
||||
# Ingress is always suitable for HTTP usage,
|
||||
# we suggest using an proxy layer such as slb to send traffic to different ports.
|
||||
# Usually 80/443 for web and 22 directly for SSH.
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: gitea
|
||||
namespace: gitea
|
||||
spec:
|
||||
rules:
|
||||
- host: your-gitea-host.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: gitea-web
|
||||
servicePort: 80
|
@ -144,7 +144,7 @@ START_SSH_SERVER = false
|
||||
BUILTIN_SSH_SERVER_USER =
|
||||
; Domain name to be exposed in clone URL
|
||||
SSH_DOMAIN = %(DOMAIN)s
|
||||
; THe network interface the builtin SSH server should listen on
|
||||
; The network interface the builtin SSH server should listen on
|
||||
SSH_LISTEN_HOST =
|
||||
; Port number to be exposed in clone URL
|
||||
SSH_PORT = 22
|
||||
@ -152,6 +152,9 @@ SSH_PORT = 22
|
||||
SSH_LISTEN_PORT = %(SSH_PORT)s
|
||||
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
|
||||
SSH_ROOT_PATH =
|
||||
; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
|
||||
; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
|
||||
SSH_CREATE_AUTHORIZED_KEYS_FILE = true
|
||||
; For the built-in SSH server, choose the ciphers to support for SSH connections,
|
||||
; for system SSH this setting has no effect
|
||||
SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
|
||||
@ -258,11 +261,12 @@ COOKIE_USERNAME = gitea_awesome
|
||||
COOKIE_REMEMBER_NAME = gitea_incredible
|
||||
; Reverse proxy authentication header name of user name
|
||||
REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
|
||||
REVERSE_PROXY_AUTHENTICATION_EMAIL = X-WEBAUTH-EMAIL
|
||||
; The minimum password length for new Users
|
||||
MIN_PASSWORD_LENGTH = 6
|
||||
; True when users are allowed to import local server paths
|
||||
; Set to true to allow users to import local server paths
|
||||
IMPORT_LOCAL_PATHS = false
|
||||
; Prevent all users (including admin) from creating custom git hooks
|
||||
; Set to true to prevent all users (including admin) from creating custom git hooks
|
||||
DISABLE_GIT_HOOKS = false
|
||||
|
||||
[openid]
|
||||
@ -306,9 +310,12 @@ ACTIVE_CODE_LIVE_MINUTES = 180
|
||||
RESET_PASSWD_CODE_LIVE_MINUTES = 180
|
||||
; Whether a new user needs to confirm their email when registering.
|
||||
REGISTER_EMAIL_CONFIRM = false
|
||||
; List of domain names that are allowed to be used to register on a Gitea instance
|
||||
; gitea.io,example.com
|
||||
EMAIL_DOMAIN_WHITELIST=
|
||||
; Disallow registration, only allow admins to create accounts.
|
||||
DISABLE_REGISTRATION = false
|
||||
; Allow registration only using third part services, it works only when DISABLE_REGISTRATION is false
|
||||
; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false
|
||||
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
|
||||
; User must sign in to view anything.
|
||||
REQUIRE_SIGNIN_VIEW = false
|
||||
@ -317,14 +324,15 @@ ENABLE_NOTIFY_MAIL = false
|
||||
; More detail: https://github.com/gogits/gogs/issues/165
|
||||
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
|
||||
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
|
||||
ENABLE_REVERSE_PROXY_EMAIL = false
|
||||
; Enable captcha validation for registration
|
||||
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 =
|
||||
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
|
||||
@ -332,8 +340,10 @@ DEFAULT_KEEP_EMAIL_PRIVATE = false
|
||||
; 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
|
||||
; Repositories will use dependencies by default depending on this setting
|
||||
DEFAULT_ENABLE_DEPENDENCIES = true
|
||||
; Enable heatmap on users profiles.
|
||||
ENABLE_USER_HEATMAP = true
|
||||
; Enable Timetracking
|
||||
ENABLE_TIMETRACKING = true
|
||||
; Default value for EnableTimetracking
|
||||
@ -378,6 +388,8 @@ SKIP_VERIFY =
|
||||
USE_CERTIFICATE = false
|
||||
CERT_FILE = custom/mailer/cert.pem
|
||||
KEY_FILE = custom/mailer/key.pem
|
||||
; Should SMTP connection use TLS
|
||||
IS_TLS_ENABLED = false
|
||||
; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format
|
||||
FROM =
|
||||
; Mailer user name and password
|
||||
@ -537,7 +549,7 @@ SCHEDULE = @every 10m
|
||||
SCHEDULE = @every 24h
|
||||
TIMEOUT = 60s
|
||||
; Arguments for command 'git fsck', e.g. "--unreachable --tags"
|
||||
; see more on http://git-scm.com/docs/git-fsck/1.7.5
|
||||
; see more on http://git-scm.com/docs/git-fsck
|
||||
ARGS =
|
||||
|
||||
; Check repository statistics
|
||||
@ -576,7 +588,7 @@ MAX_GIT_DIFF_LINE_CHARACTERS = 5000
|
||||
; Max number of files shown in diff view
|
||||
MAX_GIT_DIFF_FILES = 100
|
||||
; Arguments for command 'git gc', e.g. "--aggressive --auto"
|
||||
; see more on http://git-scm.com/docs/git-gc/1.7.5
|
||||
; see more on http://git-scm.com/docs/git-gc/
|
||||
GC_ARGS =
|
||||
|
||||
; Operation timeout in seconds
|
||||
@ -654,3 +666,9 @@ FILE_EXTENSIONS = .adoc,.asciidoc
|
||||
RENDER_COMMAND = "asciidoc --out-file=- -"
|
||||
; Don't pass the file on STDIN, pass the filename as argument instead.
|
||||
IS_INPUT_FILE = false
|
||||
|
||||
[metrics]
|
||||
; Enables metrics endpoint. True or false; default is false.
|
||||
ENABLED = false
|
||||
; If you want to add authorization, specify a token here
|
||||
TOKEN =
|
||||
|
2
docker/Makefile
vendored
2
docker/Makefile
vendored
@ -8,7 +8,7 @@ DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||
.PHONY: docker
|
||||
docker:
|
||||
docker build --disable-content-trust=false -t $(DOCKER_REF) .
|
||||
# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite" .
|
||||
# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build:
|
||||
|
@ -39,5 +39,8 @@ if [ ! -f /data/gitea/conf/app.ini ]; then
|
||||
envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini
|
||||
fi
|
||||
|
||||
chown -R ${USER}:git /data/gitea /app/gitea /data/git
|
||||
# only chown if current owner is not already the gitea ${USER}. No recursive check to save time
|
||||
if ! [[ $(ls -ld /data/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/gitea; fi
|
||||
if ! [[ $(ls -ld /app/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /app/gitea; fi
|
||||
if ! [[ $(ls -ld /data/git | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/git; fi
|
||||
chmod 0755 /data/gitea /app/gitea /data/git
|
||||
|
@ -29,3 +29,5 @@ AllowUsers git
|
||||
|
||||
Banner none
|
||||
Subsystem sftp /usr/lib/ssh/sftp-server
|
||||
|
||||
AcceptEnv GIT_PROTOCOL
|
@ -4,7 +4,7 @@ if [ "${USER}" != "git" ]; then
|
||||
# rename user
|
||||
sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd
|
||||
# switch sshd config to different user
|
||||
sed -i -e "s/AllowUsers git/AllowUsers ${USER}/g" /etc/ssh/sshd_config
|
||||
sed -i -e "s/AllowUsers git$/AllowUsers ${USER}/g" /etc/ssh/sshd_config
|
||||
fi
|
||||
|
||||
## Change GID for USER?
|
||||
|
42
docs/README_ZH.md
Normal file
42
docs/README_ZH.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Gitea: 文档
|
||||
|
||||
[](http://drone.gitea.io/go-gitea/docs)
|
||||
[](https://discord.gg/NsatcWJ)
|
||||
[](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
|
||||
|
||||
## 关于托管方式
|
||||
|
||||
本页面托管在我们 Docker 容器内的基础设施上, 它会在每次推送到 `master` 分支的时候自动更新,如果你想自己管理这个页面,你可以从我们的 Docker 镜像 [gitea/docs](https://hub.docker.com/r/gitea/docs/) 中获取它。
|
||||
|
||||
## 安装 Hugo
|
||||
|
||||
本页面使用了 [Hugo](https://github.com/spf13/hugo) 静态页面生成工具,如果您有维护它的意愿,则需要在本地计算机上下载并安装 Hugo。Hugo 的安装教程不在本文档的讲述范围之内,详情请参见 [官方文档](https://gohugo.io/overview/installing/)。
|
||||
|
||||
## 如何部署
|
||||
|
||||
在 [localhost:1313](http://localhost:1313) 处构建和运行网站的命令如下,如果需要停止可以使用组合键 `Ctrl+C`:
|
||||
|
||||
```
|
||||
make server
|
||||
```
|
||||
|
||||
完成更改后,只需创建一个 Pull Request (PR),该 PR 一经合并网站将自动更新。
|
||||
|
||||
## 如何贡献您的代码
|
||||
|
||||
Fork -> Patch -> Push -> Pull Request
|
||||
|
||||
## 关于我们
|
||||
|
||||
* [维护者信息](https://github.com/orgs/go-gitea/people)
|
||||
* [代码贡献者信息](https://github.com/go-gitea/docs/graphs/contributors)
|
||||
|
||||
## 许可证
|
||||
|
||||
此项目采用 Apache-2.0 许可协议,请参见 [协议文件](LICENSE) 获取更多信息。
|
||||
|
||||
## 版权声明
|
||||
|
||||
```
|
||||
Copyright (c) 2016 The Gitea Authors <https://gitea.io>
|
||||
```
|
@ -62,7 +62,7 @@ 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
|
||||
@ -122,9 +122,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files.
|
||||
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
|
||||
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
|
||||
- `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.
|
||||
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, allows redirecting http requests on `PORT_TO_REDIRECT` to the https port Gitea listens on.
|
||||
- `PORT_TO_REDIRECT`: **80**: Port for the http redirection service to listen on. 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.
|
||||
@ -160,9 +159,11 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
information.
|
||||
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy
|
||||
authentication.
|
||||
- `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom
|
||||
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: Header name for reverse proxy
|
||||
authentication provided email.
|
||||
- `DISABLE_GIT_HOOKS`: **false**: Set to `true` to prevent all users (including admin) from creating custom
|
||||
git hooks.
|
||||
- `IMPORT_LOCAL_PATHS`: **false**: Prevent all users (including admin) from importing local path on server.
|
||||
- `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to prevent all users (including admin) from importing local path on server.
|
||||
|
||||
## OpenID (`openid`)
|
||||
|
||||
@ -188,11 +189,16 @@ 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_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a
|
||||
provided email rather than a generated email.
|
||||
- `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.
|
||||
- `ENABLE_USER_HEATMAP`: **true** Enable this to display the heatmap on users profiles.
|
||||
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
|
||||
on this instance.
|
||||
|
||||
## Webhook (`webhook`)
|
||||
|
||||
@ -219,6 +225,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
`FROM` and `SENDMAIL_PATH`.
|
||||
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be
|
||||
command or full path).
|
||||
- ``IS_TLS_ENABLED`` : **false** : Decide if SMTP connections should use TLS.
|
||||
|
||||
## Cache (`cache`)
|
||||
|
||||
@ -280,7 +287,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
|
||||
- `SCHEDULE`: **every 24h**: Cron syntax for scheduling repository health check.
|
||||
- `TIMEOUT`: **60s**: Time duration syntax for health check execution timeout.
|
||||
- `ARGS`: **\<empty\>**: Arguments for command `git fsck`, e.g. `--unreachable --tags`.
|
||||
- `ARGS`: **\<empty\>**: Arguments for command `git fsck`, e.g. `--unreachable --tags`. See more on http://git-scm.com/docs/git-fsck
|
||||
|
||||
### Cron - Repository Statistics Check (`cron.check_repo_stats`)
|
||||
|
||||
@ -292,7 +299,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
- `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view.
|
||||
- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view.
|
||||
- `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`.
|
||||
- `GC_ARGS`: **\<empty\>**: Arguments for command `git gc`, e.g. `--aggressive --auto`. See more on http://git-scm.com/docs/git-gc/
|
||||
|
||||
## Git - Timeout settings (`git.timeout`)
|
||||
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
|
||||
@ -301,9 +308,14 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
||||
- `PULL`: **300**: Git pull from internal repositories timeout seconds.
|
||||
- `GC`: **60**: Git repository GC timeout seconds.
|
||||
|
||||
## Metrics (`metrics`)
|
||||
|
||||
- `ENABLED`: **false**: Enables /metrics endpoint for prometheus.
|
||||
- `TOKEN`: **\<empty\>**: You need to specify the token, if you want to include in the authorization the metrics . The same token need to be used in prometheus parameters `bearer_token` or `bearer_token_file`.
|
||||
|
||||
## API (`api`)
|
||||
|
||||
- `ENABLE_SWAGGER_ENDPOINT`: **true**: Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true.
|
||||
|
||||
- `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.
|
||||
|
||||
## i18n (`i18n`)
|
||||
@ -358,6 +370,10 @@ IS_INPUT_FILE = false
|
||||
- RENDER\_COMMAND: External command to render all matching extensions.
|
||||
- IS\_INPUT\_FILE: **false** Input is not a standard input but a file param followed `RENDER_COMMAND`.
|
||||
|
||||
Two special environment variables are passed to the render command:
|
||||
- `GITEA_PREFIX_SRC`, which contains the current URL prefix in the `src` path tree. To be used as prefix for links.
|
||||
- `GITEA_PREFIX_RAW`, which contains the current URL prefix in the `raw` path tree. To be used as prefix for image paths.
|
||||
|
||||
## Other (`other`)
|
||||
|
||||
- `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer.
|
||||
|
@ -88,10 +88,14 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
|
||||
- `body_outer_post.tmpl`, before the bottom `<footer>` element.
|
||||
- `footer.tmpl`, right before the end of the `<body>` tag, a good place for additional Javascript.
|
||||
|
||||
## Adding Analytics to Gitea
|
||||
|
||||
Google Analytics, Matomo (previously Piwik), and other analytics services can be added to Gitea. To add the tracking code, refer to the `Other additions to the page` section of this document, and add the JavaScript to the `custom/templates/custom/header.tmpl` file.
|
||||
|
||||
## 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.
|
||||
As of version 1.6.0 Gitea has built-in themes. The two built-in themes are, 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.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user