mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-18 21:41:05 +00:00
Compare commits
1145 Commits
v1.12.0-de
...
v1.14.0-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4a3785218 | ||
|
|
76ac83402b | ||
|
|
07c9f6dca4 | ||
|
|
33e0e37537 | ||
|
|
8fa74045c4 | ||
|
|
01f991ac88 | ||
|
|
36e41d4764 | ||
|
|
80a6b0f5bc | ||
|
|
93f7525061 | ||
|
|
97980146c5 | ||
|
|
e70df67d47 | ||
|
|
a2a05d164b | ||
|
|
edfebe65b1 | ||
|
|
aa73b7b7e5 | ||
|
|
49b1948cb1 | ||
|
|
dfa7291f8f | ||
|
|
da32d0e72a | ||
|
|
2d75d6f664 | ||
|
|
daa393cb48 | ||
|
|
6b1266b6b3 | ||
|
|
ade9c8dc3c | ||
|
|
f4ffe8ed54 | ||
|
|
f2858600af | ||
|
|
8be3e439c2 | ||
|
|
b546eda7a8 | ||
|
|
bf6ed724a6 | ||
|
|
9513638715 | ||
|
|
c752ccee64 | ||
|
|
0e4f663126 | ||
|
|
845d0afb33 | ||
|
|
64133126cd | ||
|
|
e35f7e81ae | ||
|
|
7edf7eb46c | ||
|
|
9066d09c57 | ||
|
|
7eb8460132 | ||
|
|
6f2784911f | ||
|
|
d65cd5677a | ||
|
|
1c523e2129 | ||
|
|
ea69ec6f0f | ||
|
|
06f1cdde6e | ||
|
|
508aca1cc0 | ||
|
|
9b81193166 | ||
|
|
f06ee37e24 | ||
|
|
529c5ffe12 | ||
|
|
a5ba8188da | ||
|
|
144fa5a537 | ||
|
|
1bf40ca0df | ||
|
|
4df6807b81 | ||
|
|
e00e8d8ad3 | ||
|
|
e0b7727804 | ||
|
|
8fe8ab5cbf | ||
|
|
d49242287d | ||
|
|
f5436b4a67 | ||
|
|
77f360b1b8 | ||
|
|
a23c128ba6 | ||
|
|
c584364b90 | ||
|
|
6eea301829 | ||
|
|
df4bbcd235 | ||
|
|
b5e76dddb8 | ||
|
|
91118bc73d | ||
|
|
78aded1eaa | ||
|
|
5e1c51cdb6 | ||
|
|
cda44750cb | ||
|
|
67a5573310 | ||
|
|
48703c3c68 | ||
|
|
01c7204895 | ||
|
|
922d698842 | ||
|
|
10e04da28c | ||
|
|
3f3a4f5b41 | ||
|
|
72636fd664 | ||
|
|
5460bf8903 | ||
|
|
45727c32c3 | ||
|
|
54091e074c | ||
|
|
7a34fc0ae8 | ||
|
|
54dd28f159 | ||
|
|
86b8c81240 | ||
|
|
6fc129fe62 | ||
|
|
77f3dbed6d | ||
|
|
b428f9feb5 | ||
|
|
1827f892de | ||
|
|
1d2553abbf | ||
|
|
156f54d6e2 | ||
|
|
c6da033656 | ||
|
|
992f387139 | ||
|
|
818d921bbb | ||
|
|
551473b294 | ||
|
|
a43cf283de | ||
|
|
7670a9db10 | ||
|
|
f2c29f2d25 | ||
|
|
615e784150 | ||
|
|
0d0e01eaa9 | ||
|
|
fe79b13ab2 | ||
|
|
1bcf1ad643 | ||
|
|
9b6361f8a0 | ||
|
|
1267e678fa | ||
|
|
3878e985b6 | ||
|
|
4c6ac08182 | ||
|
|
5cfc1f573f | ||
|
|
feb1a8cabc | ||
|
|
ffa7dd6880 | ||
|
|
b606f13365 | ||
|
|
4a654a8d44 | ||
|
|
14e718695a | ||
|
|
7f8e3192cd | ||
|
|
f404bdde9b | ||
|
|
c85c9d40c2 | ||
|
|
82179a6e81 | ||
|
|
fb467c7e74 | ||
|
|
b49ebc2ba8 | ||
|
|
b725c4ee53 | ||
|
|
95ff55991e | ||
|
|
34d9cb335c | ||
|
|
d71eaacbf2 | ||
|
|
274430f40b | ||
|
|
f1ab1c532b | ||
|
|
3c360801b3 | ||
|
|
7a7f56044a | ||
|
|
6fa19a8458 | ||
|
|
b5109272db | ||
|
|
efebb824ac | ||
|
|
ba20dd7a7b | ||
|
|
01ad714715 | ||
|
|
3f522cdaad | ||
|
|
f215e015df | ||
|
|
1c3278c2fa | ||
|
|
63e8bdaf73 | ||
|
|
060d46dd25 | ||
|
|
ec6a35aeb1 | ||
|
|
2dbca92a0f | ||
|
|
3f9eb93cc6 | ||
|
|
b74ed16c41 | ||
|
|
23f064e813 | ||
|
|
fec1521555 | ||
|
|
e7ffc67ad5 | ||
|
|
037d5a33a0 | ||
|
|
7e5499575b | ||
|
|
7f966f316b | ||
|
|
355788db46 | ||
|
|
4979f15c3f | ||
|
|
89c94e2f8e | ||
|
|
25ddf77b51 | ||
|
|
54ae448588 | ||
|
|
7250f5342f | ||
|
|
1418288734 | ||
|
|
5995326d51 | ||
|
|
1fb5bbd098 | ||
|
|
06480af472 | ||
|
|
afea4faa33 | ||
|
|
9c439a7c99 | ||
|
|
a9decf0dac | ||
|
|
d8b5235ded | ||
|
|
ace8a283f1 | ||
|
|
ec5677b7a2 | ||
|
|
07995e2301 | ||
|
|
772b5e0f54 | ||
|
|
88823f3e29 | ||
|
|
d9085fe176 | ||
|
|
0d14c2fb93 | ||
|
|
81ed47c29d | ||
|
|
6c61f498ea | ||
|
|
3d0ad2885a | ||
|
|
d5e6211987 | ||
|
|
342e49e325 | ||
|
|
08a905f614 | ||
|
|
ed2bdf455c | ||
|
|
c950ea10ab | ||
|
|
642c3c258b | ||
|
|
6a1a6332de | ||
|
|
00a806de68 | ||
|
|
33f606ce4c | ||
|
|
6c4e9623cc | ||
|
|
53b656582e | ||
|
|
b2bda11595 | ||
|
|
f91bb745d6 | ||
|
|
55e05ad1ce | ||
|
|
8ce10fb6e1 | ||
|
|
ae528d8321 | ||
|
|
c18c6cf4cf | ||
|
|
ffddf3f8a6 | ||
|
|
26c4a049da | ||
|
|
dd1a651b58 | ||
|
|
910947fbcd | ||
|
|
7777017b43 | ||
|
|
4eb0a1dfaf | ||
|
|
e0ac545043 | ||
|
|
25c870faa9 | ||
|
|
29ac1f9122 | ||
|
|
a064153235 | ||
|
|
bfd9ca33b7 | ||
|
|
fd60ebfe14 | ||
|
|
daefdd1385 | ||
|
|
47289344e2 | ||
|
|
4f8dad37f8 | ||
|
|
5b10da241b | ||
|
|
4d1c41d4e2 | ||
|
|
c3e8c9441a | ||
|
|
4c42fce401 | ||
|
|
7354efe702 | ||
|
|
e10327168d | ||
|
|
0db9043aa7 | ||
|
|
b333aa7db4 | ||
|
|
a775428516 | ||
|
|
33ac0cc125 | ||
|
|
fcc410c350 | ||
|
|
ffa12bdb71 | ||
|
|
0cd49aaebd | ||
|
|
e153cf07c3 | ||
|
|
6483dbc8ec | ||
|
|
7be0939332 | ||
|
|
090024db37 | ||
|
|
96969ddec8 | ||
|
|
1fbc50f974 | ||
|
|
c6e4bc53aa | ||
|
|
bea343ce09 | ||
|
|
3865ecbf13 | ||
|
|
e204398754 | ||
|
|
0ed8d268ad | ||
|
|
7a5465fc56 | ||
|
|
e4b3f35b8d | ||
|
|
489c8a1478 | ||
|
|
9af60ce0bb | ||
|
|
cfd8e8a489 | ||
|
|
226aef7e0f | ||
|
|
91e7ad569a | ||
|
|
a722dd72db | ||
|
|
d17efaa114 | ||
|
|
1b9d5074a7 | ||
|
|
ad2bf376df | ||
|
|
0b198eb392 | ||
|
|
f7b3e06026 | ||
|
|
332dbe7393 | ||
|
|
f727e3e1c9 | ||
|
|
3408fb73b6 | ||
|
|
43c303d35c | ||
|
|
0c6a802731 | ||
|
|
0ed5e103fe | ||
|
|
b613d70b41 | ||
|
|
a755e5adeb | ||
|
|
e8958bfc38 | ||
|
|
0cc4aadf58 | ||
|
|
6590cac89b | ||
|
|
1c35353c53 | ||
|
|
f10d3ea803 | ||
|
|
67ec27150e | ||
|
|
69b8d7ba19 | ||
|
|
78509b5f9b | ||
|
|
9a17e2830b | ||
|
|
913ac9cacd | ||
|
|
1ea1cade85 | ||
|
|
7404786420 | ||
|
|
bc11caff94 | ||
|
|
9fdb4f887b | ||
|
|
e80eda7d01 | ||
|
|
385433d2f4 | ||
|
|
dba5d82f86 | ||
|
|
bab1204db4 | ||
|
|
b51bd7f1d6 | ||
|
|
e1535c74cc | ||
|
|
9837b598fc | ||
|
|
144de79c1b | ||
|
|
bda9e51fef | ||
|
|
482b0e6d47 | ||
|
|
2a52aeec49 | ||
|
|
45c0ec3152 | ||
|
|
fb603825f5 | ||
|
|
ca81b6528b | ||
|
|
e710a34981 | ||
|
|
4c557eff5d | ||
|
|
d7456106bf | ||
|
|
f083bd70df | ||
|
|
6c5266c9ca | ||
|
|
42a5e39b3b | ||
|
|
844d9b46f3 | ||
|
|
6d6b5ceaa5 | ||
|
|
5c0697ad1e | ||
|
|
8fa7a4b511 | ||
|
|
f1a7cd6757 | ||
|
|
baa93855e8 | ||
|
|
ad4a644fb3 | ||
|
|
7af2ccd511 | ||
|
|
514201af5d | ||
|
|
702e98c5ec | ||
|
|
5fd9f72104 | ||
|
|
ed81a95a84 | ||
|
|
dead2a9b2d | ||
|
|
72eeb13e4d | ||
|
|
714ab71ddc | ||
|
|
84eac6ed6c | ||
|
|
3ecd030cd5 | ||
|
|
3981f1b127 | ||
|
|
ea775e67fb | ||
|
|
a0c4c1ce0d | ||
|
|
3270e7a443 | ||
|
|
66843f2237 | ||
|
|
82b71881d8 | ||
|
|
807a41ca9a | ||
|
|
58f57b3b6c | ||
|
|
9bc69ff26e | ||
|
|
d257485bc0 | ||
|
|
17fbbe97d7 | ||
|
|
9abc16a280 | ||
|
|
7187fdbb1c | ||
|
|
afd89b1767 | ||
|
|
e1eee2d00a | ||
|
|
7ba6fea0b7 | ||
|
|
274f9233ab | ||
|
|
1fe909757c | ||
|
|
3bf1c4fad0 | ||
|
|
1d47a25759 | ||
|
|
d5b6931dbe | ||
|
|
eb1bf2377b | ||
|
|
d3b5edacb6 | ||
|
|
cbc60f5c70 | ||
|
|
c5d5d63c9c | ||
|
|
211321fb93 | ||
|
|
ed2f6e137b | ||
|
|
f8601f3f09 | ||
|
|
e25d4867be | ||
|
|
65444c5ea3 | ||
|
|
7d14d6c1c1 | ||
|
|
69b3dd6362 | ||
|
|
b611ae1908 | ||
|
|
eb4db0445b | ||
|
|
e90e122b39 | ||
|
|
f3fb3c6f56 | ||
|
|
019e577d54 | ||
|
|
125ffb87f0 | ||
|
|
4b97f9018b | ||
|
|
63f3c42be9 | ||
|
|
2ae8c7ab1c | ||
|
|
ee047312a1 | ||
|
|
26bf4c51fb | ||
|
|
0c0f049d09 | ||
|
|
1bf7b8d7c1 | ||
|
|
dd8ec12188 | ||
|
|
d2cee3eea6 | ||
|
|
43a397ce9a | ||
|
|
e7d65cbc6e | ||
|
|
e429c1164e | ||
|
|
2026d885d6 | ||
|
|
7a8a05cc44 | ||
|
|
fcabbae168 | ||
|
|
b78448e94e | ||
|
|
d4e35b9dc6 | ||
|
|
a0484890c1 | ||
|
|
9b804f4ed4 | ||
|
|
d461591aac | ||
|
|
fb70b5d207 | ||
|
|
7c2cf236f8 | ||
|
|
ae23bbdae3 | ||
|
|
9c9c3348bb | ||
|
|
c6943cca52 | ||
|
|
7c0862b6d9 | ||
|
|
69a77b2a73 | ||
|
|
f19cac41d2 | ||
|
|
fff0204cab | ||
|
|
0c9eb468e9 | ||
|
|
d15bb17b78 | ||
|
|
dcb543ac2a | ||
|
|
a5440fcb1e | ||
|
|
1701d57fb2 | ||
|
|
1ca652c826 | ||
|
|
e14f6088f8 | ||
|
|
61a172900e | ||
|
|
95d478c29c | ||
|
|
87fbb54abb | ||
|
|
62e6c9bc6c | ||
|
|
02fbe1e5dc | ||
|
|
1984b6a11b | ||
|
|
5b9e7cf53c | ||
|
|
51463a0a09 | ||
|
|
9cabd56fc0 | ||
|
|
05b1af990e | ||
|
|
4027c5dd7c | ||
|
|
d285b5d35a | ||
|
|
d1e67d7ade | ||
|
|
f50364a5b0 | ||
|
|
ac3cfad23d | ||
|
|
ee97e6a66a | ||
|
|
eb60a5d054 | ||
|
|
8a0049bb03 | ||
|
|
b37c7dd384 | ||
|
|
2ef318e6f1 | ||
|
|
e266ba30cc | ||
|
|
c9d1e40dfc | ||
|
|
bd7d6a3d73 | ||
|
|
e01bac8404 | ||
|
|
be1b33c197 | ||
|
|
4e1c7cc4ef | ||
|
|
c18b0529ed | ||
|
|
74bd9691c6 | ||
|
|
faa676cc8b | ||
|
|
22c952ac7a | ||
|
|
73b155d5f2 | ||
|
|
a4ba1ad5ed | ||
|
|
0cc21fb72d | ||
|
|
25a6705b86 | ||
|
|
d87dbd7519 | ||
|
|
02e990a89b | ||
|
|
78d17b4b43 | ||
|
|
0171dda728 | ||
|
|
96add8c319 | ||
|
|
e770c2b850 | ||
|
|
e17e3f71f4 | ||
|
|
8cd7e93b9a | ||
|
|
0dfbef5f70 | ||
|
|
2c1ae6c82d | ||
|
|
f1a42f5d5e | ||
|
|
983cbb2c9f | ||
|
|
e5c5080f26 | ||
|
|
28a7708d69 | ||
|
|
48598a7e83 | ||
|
|
42a31c797b | ||
|
|
2872a04f27 | ||
|
|
6ab4d76ced | ||
|
|
33391e04fe | ||
|
|
8a6790b2aa | ||
|
|
e61c09ed73 | ||
|
|
5e5c893555 | ||
|
|
502e38c33c | ||
|
|
3585bb73ef | ||
|
|
4d9f59a45d | ||
|
|
7b260acd7b | ||
|
|
15300699c4 | ||
|
|
bac65f1b82 | ||
|
|
b3e06523c1 | ||
|
|
999ae61d01 | ||
|
|
e4d6f2e9e5 | ||
|
|
11dcc17763 | ||
|
|
24f8625790 | ||
|
|
bf60146444 | ||
|
|
f6d5303e02 | ||
|
|
838fef2ae8 | ||
|
|
7e96268fb0 | ||
|
|
1f12dc8e88 | ||
|
|
2fd78c151e | ||
|
|
2f6aadffa8 | ||
|
|
f2a6cd6401 | ||
|
|
f220286c00 | ||
|
|
1de19e0c76 | ||
|
|
8a36c46a7e | ||
|
|
cd7f1fd72b | ||
|
|
63e5bf6ef7 | ||
|
|
8bdc9795d8 | ||
|
|
78cbd0ca72 | ||
|
|
8d6fa00da0 | ||
|
|
e67c042511 | ||
|
|
bfb25e4be1 | ||
|
|
4315e313d1 | ||
|
|
46ef562a16 | ||
|
|
859094ef0a | ||
|
|
e6c9f19b8f | ||
|
|
7ecb25b41b | ||
|
|
4609eba2e7 | ||
|
|
415fc8288f | ||
|
|
d0c690f160 | ||
|
|
7cf23399a0 | ||
|
|
ea1ed802a3 | ||
|
|
8baf5ca228 | ||
|
|
a3afb88f1b | ||
|
|
7744b36e56 | ||
|
|
0186497e67 | ||
|
|
4497db96e0 | ||
|
|
d25f44285a | ||
|
|
2753d72773 | ||
|
|
8e20daaede | ||
|
|
366ca88eea | ||
|
|
d489def5ed | ||
|
|
45631083a4 | ||
|
|
ed8e064f5e | ||
|
|
54513452a1 | ||
|
|
b609a25014 | ||
|
|
0e24af6951 | ||
|
|
4fa2e217c1 | ||
|
|
3bcc6e7a9e | ||
|
|
07c4ed4cda | ||
|
|
0122cf9cdc | ||
|
|
9542b7317d | ||
|
|
6ea2701cd9 | ||
|
|
fd9e8951d8 | ||
|
|
670db99f4f | ||
|
|
bae5293d24 | ||
|
|
a4da46d182 | ||
|
|
3b498ebc77 | ||
|
|
b92a5d8d64 | ||
|
|
633f52c220 | ||
|
|
84a419de98 | ||
|
|
b49a195839 | ||
|
|
48ad76c25e | ||
|
|
a60f506dd7 | ||
|
|
bac57ab590 | ||
|
|
8188176b58 | ||
|
|
63591016b3 | ||
|
|
d08996c7b9 | ||
|
|
3973a4609e | ||
|
|
8d081950e6 | ||
|
|
6a62884782 | ||
|
|
16980d13ce | ||
|
|
a6168fa25d | ||
|
|
cedbd3684f | ||
|
|
dbd5e4bb8d | ||
|
|
3a46d1ef58 | ||
|
|
078d2fbd4c | ||
|
|
30399cf04a | ||
|
|
12f9dd8fa9 | ||
|
|
88ef04dbe9 | ||
|
|
075f33c48c | ||
|
|
8a0bb7cd04 | ||
|
|
26e931ae34 | ||
|
|
56f222d44c | ||
|
|
ae2916c792 | ||
|
|
62c2c17031 | ||
|
|
9fc9c1de98 | ||
|
|
c5b08f6d5a | ||
|
|
38fb087d19 | ||
|
|
4384320db9 | ||
|
|
217647f331 | ||
|
|
0d03fbf2ca | ||
|
|
d1562bfc34 | ||
|
|
15d3aa7b95 | ||
|
|
c6d6c51ada | ||
|
|
2ab185d3ab | ||
|
|
3c4388f668 | ||
|
|
60cb9fe448 | ||
|
|
510e4bd245 | ||
|
|
ae56411e9f | ||
|
|
cd994f6354 | ||
|
|
480ac25ed5 | ||
|
|
7e401fb026 | ||
|
|
482ba937ed | ||
|
|
a87a64e6a1 | ||
|
|
712d88ea1d | ||
|
|
eea25f8d71 | ||
|
|
858c35b731 | ||
|
|
8f489131f3 | ||
|
|
af7ffaa279 | ||
|
|
ce5f2b9845 | ||
|
|
e3b719863b | ||
|
|
b918609acc | ||
|
|
7761245d08 | ||
|
|
2281b048af | ||
|
|
9ad04240a6 | ||
|
|
1fd2beb6e9 | ||
|
|
2ff585f0da | ||
|
|
772df93671 | ||
|
|
043ed32ab5 | ||
|
|
9c54fef17c | ||
|
|
4b66d9ad98 | ||
|
|
0ea479561d | ||
|
|
6764daf7e5 | ||
|
|
0b1bb96441 | ||
|
|
ebc35f2b2e | ||
|
|
9ef2f62a79 | ||
|
|
c86478ec47 | ||
|
|
ae20de7771 | ||
|
|
8aef7aefd0 | ||
|
|
5b1327eb56 | ||
|
|
ec0743bab8 | ||
|
|
d9aa007a9e | ||
|
|
daf62841f6 | ||
|
|
fc2f2c7602 | ||
|
|
b948ecb2d2 | ||
|
|
4dee08a6b4 | ||
|
|
121103fecf | ||
|
|
180286da0c | ||
|
|
c1a2887c02 | ||
|
|
3b685e1f0d | ||
|
|
81324cf37c | ||
|
|
a07cc0df76 | ||
|
|
d31a9c544f | ||
|
|
e24ee48776 | ||
|
|
6891b90303 | ||
|
|
5389b6cde1 | ||
|
|
92a05f87f0 | ||
|
|
ec40e593cf | ||
|
|
98ddf87b03 | ||
|
|
1fb783efb0 | ||
|
|
5fcd18a2c4 | ||
|
|
c376a8addc | ||
|
|
4d2c2962d3 | ||
|
|
654a970644 | ||
|
|
1dd3f19ee3 | ||
|
|
03ba974481 | ||
|
|
6c81b738f7 | ||
|
|
6c38f371ea | ||
|
|
1426126690 | ||
|
|
6bf78d2b57 | ||
|
|
9e6a79bea9 | ||
|
|
1645d4a5d8 | ||
|
|
61cd0ce866 | ||
|
|
262fce6db4 | ||
|
|
f399cd326b | ||
|
|
6a4de37f7e | ||
|
|
80a3745fc8 | ||
|
|
cdef92b3ff | ||
|
|
492b7d6357 | ||
|
|
c8780984f8 | ||
|
|
a7f7d1399f | ||
|
|
26cb7e4b39 | ||
|
|
5f47835f4c | ||
|
|
d1c547468a | ||
|
|
48648d1d86 | ||
|
|
ae3cfa8449 | ||
|
|
48842ed108 | ||
|
|
0159851cc3 | ||
|
|
2447ffc74a | ||
|
|
b6adf80a80 | ||
|
|
83e9ac57a1 | ||
|
|
d729d685d0 | ||
|
|
bc4f7ba69b | ||
|
|
2b573f49cf | ||
|
|
13fcd04fe4 | ||
|
|
8770bceafa | ||
|
|
0973c03601 | ||
|
|
6c2a59b50c | ||
|
|
5a26192350 | ||
|
|
ca8ecf7ffc | ||
|
|
b9e281265e | ||
|
|
b682a2c1b2 | ||
|
|
e282fbe753 | ||
|
|
9ecf732abc | ||
|
|
a3fe9d87f2 | ||
|
|
c99ae4cff4 | ||
|
|
4a4977a1f0 | ||
|
|
a05a30c1c1 | ||
|
|
8ffc0ed13f | ||
|
|
628ee1d82e | ||
|
|
42752f3902 | ||
|
|
2b2b3e4c37 | ||
|
|
ac2304f7a0 | ||
|
|
df231b7255 | ||
|
|
68a2af6d68 | ||
|
|
1ac46186ff | ||
|
|
19db3f4f0a | ||
|
|
363e51d19c | ||
|
|
aaff47ad75 | ||
|
|
777015c2c2 | ||
|
|
27a6e03906 | ||
|
|
cefbf73aea | ||
|
|
5734524378 | ||
|
|
218d922d33 | ||
|
|
09f7d84f4c | ||
|
|
5814079bf5 | ||
|
|
880ae454db | ||
|
|
479ef5c379 | ||
|
|
3f3a081758 | ||
|
|
ba8efe3547 | ||
|
|
1cc33c37ff | ||
|
|
2874ab54bc | ||
|
|
94f60e199b | ||
|
|
594db7fb43 | ||
|
|
304542af31 | ||
|
|
f6315fb477 | ||
|
|
c8b1c4b10a | ||
|
|
1ee6c13f11 | ||
|
|
cfac97542b | ||
|
|
a5aa5c58c1 | ||
|
|
f576756b18 | ||
|
|
bbe13b60cd | ||
|
|
cc9d2deb60 | ||
|
|
684b7a999f | ||
|
|
209b17c4e2 | ||
|
|
aa3c0f8eba | ||
|
|
ac07418011 | ||
|
|
48f24c7b32 | ||
|
|
fa1c958f1c | ||
|
|
5acba4609a | ||
|
|
f761a37a0f | ||
|
|
17f8de7a54 | ||
|
|
a39557f8fb | ||
|
|
2c5b3c72e8 | ||
|
|
0cb22121f4 | ||
|
|
b534a5164f | ||
|
|
2842f6cf42 | ||
|
|
3affe9516a | ||
|
|
a3b185d54c | ||
|
|
2b2373f6c2 | ||
|
|
c6cee44134 | ||
|
|
ce7510a80f | ||
|
|
19aab76853 | ||
|
|
a730dc1419 | ||
|
|
160c23c4ab | ||
|
|
4280d44a45 | ||
|
|
3ea5d864b9 | ||
|
|
464b583c6c | ||
|
|
2cf99f89c6 | ||
|
|
de0b2d4e32 | ||
|
|
8e035f81c0 | ||
|
|
dcefcc10e6 | ||
|
|
d9b5c21625 | ||
|
|
a6fd2f23f7 | ||
|
|
d0a18a1270 | ||
|
|
a1ad188326 | ||
|
|
fe2cacf5ea | ||
|
|
3af51f1ab7 | ||
|
|
14ca111f33 | ||
|
|
dc812f8ba5 | ||
|
|
7cb1e1f609 | ||
|
|
b636cd6fd4 | ||
|
|
34b6983f56 | ||
|
|
d98df0ede3 | ||
|
|
cdec70f3f8 | ||
|
|
2d1ade3415 | ||
|
|
9d652002c6 | ||
|
|
ea4c139cd2 | ||
|
|
4395c607ed | ||
|
|
495354c4bd | ||
|
|
6e4480835f | ||
|
|
141d52cc0f | ||
|
|
f36104e410 | ||
|
|
4c1ff57f1a | ||
|
|
02fa329a7c | ||
|
|
0d9f9f7de1 | ||
|
|
726e1e5279 | ||
|
|
ab73b56575 | ||
|
|
bd2335671f | ||
|
|
e8955173a9 | ||
|
|
8730b091e3 | ||
|
|
560744fb33 | ||
|
|
9f55769804 | ||
|
|
3aedc795c4 | ||
|
|
cd5b0e262e | ||
|
|
5d78792385 | ||
|
|
a00974c3b8 | ||
|
|
926e63bb9e | ||
|
|
24be06d7a6 | ||
|
|
5cb201dc93 | ||
|
|
b97917a6e7 | ||
|
|
55b4b4e8a5 | ||
|
|
793719a50d | ||
|
|
8443ca109b | ||
|
|
75739d00cb | ||
|
|
0a7c5623d7 | ||
|
|
f32bf902e7 | ||
|
|
f2a0be1683 | ||
|
|
e682a92295 | ||
|
|
02a52d683b | ||
|
|
39b792f424 | ||
|
|
7305b555d3 | ||
|
|
04afd9d1e2 | ||
|
|
3547e84a05 | ||
|
|
e25348da88 | ||
|
|
5c55793e0e | ||
|
|
788b8b1440 | ||
|
|
ae55dc7a6b | ||
|
|
814ca9ffea | ||
|
|
3761bdb640 | ||
|
|
8d9f9c3237 | ||
|
|
f7e3767929 | ||
|
|
ac3c467770 | ||
|
|
31df012968 | ||
|
|
723b199271 | ||
|
|
38c773d8a5 | ||
|
|
1752a976e1 | ||
|
|
5789e60316 | ||
|
|
6af13dbac2 | ||
|
|
88fe7b5a72 | ||
|
|
f6f49700cc | ||
|
|
035db78018 | ||
|
|
460bc32c71 | ||
|
|
e963525c5e | ||
|
|
0b8b81e029 | ||
|
|
b02d2c3772 | ||
|
|
3eb323901c | ||
|
|
b797b76abd | ||
|
|
c7c61778bc | ||
|
|
b6d01ccdca | ||
|
|
7c287b9f0b | ||
|
|
689e7e8831 | ||
|
|
21243bb46f | ||
|
|
ee4e8542c7 | ||
|
|
3856fd7c10 | ||
|
|
c81ab17de9 | ||
|
|
0903b1ac8c | ||
|
|
9e0e2a9fcf | ||
|
|
34e6a4e057 | ||
|
|
6da87eda8b | ||
|
|
c572ee2b61 | ||
|
|
b5851b7d1a | ||
|
|
a2d7999e93 | ||
|
|
50a97272b9 | ||
|
|
6ccd19ef86 | ||
|
|
7b66400f55 | ||
|
|
29fbe63ba9 | ||
|
|
eb8abffcc1 | ||
|
|
6b798feaf6 | ||
|
|
e7e0097148 | ||
|
|
b72af7ee71 | ||
|
|
a4cd1f12f8 | ||
|
|
9a829b98f0 | ||
|
|
7fd60c6d8d | ||
|
|
ef5f176517 | ||
|
|
03b7e11bd6 | ||
|
|
fb43fbe0aa | ||
|
|
17f652a91c | ||
|
|
580f73ad79 | ||
|
|
97cabf39cd | ||
|
|
4e302baa4c | ||
|
|
76053ac31a | ||
|
|
50932ce8af | ||
|
|
7d9946f989 | ||
|
|
75918d9dc6 | ||
|
|
c642cd0676 | ||
|
|
a0d35fb6ad | ||
|
|
5cf224abe3 | ||
|
|
84bcb3451a | ||
|
|
dcb0cf7470 | ||
|
|
9a2e47b23a | ||
|
|
c18144086f | ||
|
|
aaaaeb7050 | ||
|
|
9cc9e47158 | ||
|
|
414c9ee76a | ||
|
|
c86bc8e061 | ||
|
|
c3d9a5f846 | ||
|
|
4744e1e0f7 | ||
|
|
b2b86ea870 | ||
|
|
6603045476 | ||
|
|
0052d788da | ||
|
|
1d54479585 | ||
|
|
d833ca3be5 | ||
|
|
c483419184 | ||
|
|
db87e91227 | ||
|
|
f7f04e94bd | ||
|
|
c72a471215 | ||
|
|
57217cabe3 | ||
|
|
4a04740daf | ||
|
|
4159866528 | ||
|
|
66a9ef9036 | ||
|
|
591ca030f0 | ||
|
|
c8f0613741 | ||
|
|
1982194dc5 | ||
|
|
a552af8f0d | ||
|
|
5df72ef7e7 | ||
|
|
9249c810b8 | ||
|
|
984ee0113b | ||
|
|
41be230867 | ||
|
|
0ba610011b | ||
|
|
2f9e6cae48 | ||
|
|
8d212f778c | ||
|
|
e9dc3bcb79 | ||
|
|
7257c39ddf | ||
|
|
ba40263fdd | ||
|
|
aa29f1c2b9 | ||
|
|
b00e62c12b | ||
|
|
08611fb765 | ||
|
|
0198bbedc1 | ||
|
|
a4c7ad99e5 | ||
|
|
6a02a4f57a | ||
|
|
c42c31a111 | ||
|
|
45968b9f44 | ||
|
|
32b8172e56 | ||
|
|
59b9b77a0d | ||
|
|
d8e6acda8c | ||
|
|
742e26f5a5 | ||
|
|
c9187b8116 | ||
|
|
6e23a1b843 | ||
|
|
da5e3fa299 | ||
|
|
f8e015e8e4 | ||
|
|
43bb85908d | ||
|
|
57b6f83191 | ||
|
|
dbb74978f7 | ||
|
|
fdf750e4d4 | ||
|
|
a44854c287 | ||
|
|
18f4aaee64 | ||
|
|
cd4f7ba5bf | ||
|
|
b9df5da1f4 | ||
|
|
b09ec508c3 | ||
|
|
119173130a | ||
|
|
c58bc4bf80 | ||
|
|
6f6edb8fab | ||
|
|
866ce126ec | ||
|
|
791353c03b | ||
|
|
486e4c8087 | ||
|
|
71e73db2ff | ||
|
|
507d0ec57a | ||
|
|
a6b8de282c | ||
|
|
b16534b0e4 | ||
|
|
505e456f26 | ||
|
|
a1f11a05e9 | ||
|
|
d9de58beee | ||
|
|
0396fcf4b5 | ||
|
|
a104864da2 | ||
|
|
38cd9ba47b | ||
|
|
680dfab2ee | ||
|
|
99082eebd7 | ||
|
|
64029e1468 | ||
|
|
b7c82cd1a9 | ||
|
|
ce66ca7f9f | ||
|
|
940ed92392 | ||
|
|
472a7702a7 | ||
|
|
a5018d099d | ||
|
|
4f9d59be17 | ||
|
|
319eb83112 | ||
|
|
71e4c75a61 | ||
|
|
28f8308d47 | ||
|
|
452b69b71e | ||
|
|
c97494a4f4 | ||
|
|
4ed7d2a2bb | ||
|
|
1bdffefc05 | ||
|
|
e9e8638f18 | ||
|
|
4974b7c120 | ||
|
|
ab69b9b1a6 | ||
|
|
c25969e694 | ||
|
|
3dc6af3d70 | ||
|
|
28e5e7fcbc | ||
|
|
4468b0b2b2 | ||
|
|
d0e7361bd9 | ||
|
|
606d9d63f6 | ||
|
|
1853131d42 | ||
|
|
a2683e5ddb | ||
|
|
310699bca7 | ||
|
|
bfda0f3864 | ||
|
|
cbf5dffaf2 | ||
|
|
33738ff91b | ||
|
|
1bf9e44bda | ||
|
|
6b6f20b6d4 | ||
|
|
4563eb873d | ||
|
|
922a239079 | ||
|
|
1f0b797ddc | ||
|
|
b0849abf3d | ||
|
|
b52ec4a19e | ||
|
|
41cebeb8fa | ||
|
|
6a3de9e25f | ||
|
|
d26aee3830 | ||
|
|
0e799c26ba | ||
|
|
9f959ac064 | ||
|
|
f1f56da4d1 | ||
|
|
e008b68c9c | ||
|
|
4ddfe0d07a | ||
|
|
812cfd0ad9 | ||
|
|
d3fc9c08c8 | ||
|
|
b10c416f9e | ||
|
|
e74c4e1be9 | ||
|
|
b51fd30522 | ||
|
|
316db0fe79 | ||
|
|
fcc8cdd446 | ||
|
|
c0d71f5e26 | ||
|
|
4ee70a9ec9 | ||
|
|
7e20f1cb5b | ||
|
|
49f8b20570 | ||
|
|
dfca884b15 | ||
|
|
74cc3c5e18 | ||
|
|
bb4261a5ed | ||
|
|
33176e8d27 | ||
|
|
50475fff06 | ||
|
|
cac69903ae | ||
|
|
b9ed8d8497 | ||
|
|
7179e49881 | ||
|
|
d2693f18de | ||
|
|
5bfb9bc2b6 | ||
|
|
067eff8eba | ||
|
|
da3e85a502 | ||
|
|
74c6414250 | ||
|
|
77171abcad | ||
|
|
e37e217602 | ||
|
|
842bba94ac | ||
|
|
77fecec64f | ||
|
|
82dbb34c9c | ||
|
|
5c092eb0ef | ||
|
|
41f05588ed | ||
|
|
9588d2c622 | ||
|
|
23163e98a3 | ||
|
|
16f39ce426 | ||
|
|
3c5a4d094a | ||
|
|
0ef11ff2c9 | ||
|
|
b57a735e77 | ||
|
|
4be7cf0405 | ||
|
|
5180deb819 | ||
|
|
6034f8bcaa | ||
|
|
4f597b1866 | ||
|
|
1b86f174ce | ||
|
|
38d5f88a81 | ||
|
|
7eace60bb6 | ||
|
|
731bdef4be | ||
|
|
12960b9d18 | ||
|
|
0010fde8a2 | ||
|
|
6e4baee91d | ||
|
|
c52d48aae4 | ||
|
|
2cb5878529 | ||
|
|
3d6f1731b5 | ||
|
|
eeb968eab5 | ||
|
|
e93826675c | ||
|
|
9ffa89249e | ||
|
|
90577853ce | ||
|
|
1b1b51d919 | ||
|
|
a4cab2bbfa | ||
|
|
0040f8bf67 | ||
|
|
a88f3663eb | ||
|
|
8cdb6662c8 | ||
|
|
30690f6644 | ||
|
|
4dc62dadce | ||
|
|
7a67bcc204 | ||
|
|
70fab7e26a | ||
|
|
2e85ad665a | ||
|
|
7c8e116987 | ||
|
|
0e4e14d0f5 | ||
|
|
d66b9a4690 | ||
|
|
0ad0357233 | ||
|
|
7c48085ff4 | ||
|
|
f7ecc2bee7 | ||
|
|
10e2f29144 | ||
|
|
c571c5bb28 | ||
|
|
09aa122bd1 | ||
|
|
9b7737df2d | ||
|
|
281029529b | ||
|
|
063b1d260f | ||
|
|
ad5c43ae5d | ||
|
|
980ef24251 | ||
|
|
27e3cddfbe | ||
|
|
cc4da79fb6 | ||
|
|
59c31b490f | ||
|
|
7ac116c9b5 | ||
|
|
cc07b9ca37 | ||
|
|
8592fb7121 | ||
|
|
0dadea19bc | ||
|
|
c97e988380 | ||
|
|
bc362ea3c6 | ||
|
|
0a2cba972a | ||
|
|
d21b974f6c | ||
|
|
743022116d | ||
|
|
4ec7a659ce | ||
|
|
8bef490f2f | ||
|
|
ca714db4fd | ||
|
|
0be25e2150 | ||
|
|
c02dee8bc4 | ||
|
|
08208cdfb8 | ||
|
|
b40107c416 | ||
|
|
089b34858c | ||
|
|
3d63caa542 | ||
|
|
71979d9663 | ||
|
|
d00ebf445b | ||
|
|
4c54477bb5 | ||
|
|
d6741de934 | ||
|
|
514e269b1d | ||
|
|
ecb176851b | ||
|
|
b252b23f16 | ||
|
|
17837986f0 | ||
|
|
d79ff1dd32 | ||
|
|
856030c530 | ||
|
|
ad31d6b5e8 | ||
|
|
ef89e75d0e | ||
|
|
88c14326b1 | ||
|
|
1bec60e02a | ||
|
|
d26885e2bf | ||
|
|
1648bf2b60 | ||
|
|
561e7a9a59 | ||
|
|
ca33a95778 | ||
|
|
f072d4566f | ||
|
|
9814dd68ad | ||
|
|
686850e21f | ||
|
|
baadb51445 | ||
|
|
b74d30ae27 | ||
|
|
6cf71ee0e8 | ||
|
|
a0cc4b3d08 | ||
|
|
240258a3e5 | ||
|
|
2a06d3a590 | ||
|
|
b264c30394 | ||
|
|
14c97c0501 | ||
|
|
4f63f283c4 | ||
|
|
4af7c47b38 | ||
|
|
97eb37e823 | ||
|
|
57cca44c5e | ||
|
|
f685edf510 | ||
|
|
3723b0647f | ||
|
|
6c27f3e4e5 | ||
|
|
a291a0eddc | ||
|
|
d501aec427 | ||
|
|
51140a970f | ||
|
|
408bc2c8b5 | ||
|
|
fbb0880d37 | ||
|
|
848502d04c | ||
|
|
8d99ee2773 | ||
|
|
36d9237e60 | ||
|
|
2c25e75dca | ||
|
|
73cf0e2614 | ||
|
|
bf847b9397 | ||
|
|
972b3bf3b0 | ||
|
|
bdfe4e258f | ||
|
|
f490291bea | ||
|
|
5c3be56f7b | ||
|
|
29ed07ee02 | ||
|
|
d01763ee14 | ||
|
|
20d4f9206d | ||
|
|
209045f55b | ||
|
|
ad4026431b | ||
|
|
3f0cb8b33a | ||
|
|
e83daf77ad | ||
|
|
61f603cd8a | ||
|
|
48890ce546 | ||
|
|
052bff0cff | ||
|
|
ea67e563dd | ||
|
|
f9f2c163b1 | ||
|
|
828a27feeb | ||
|
|
7cd47046ea | ||
|
|
cac30abefc | ||
|
|
7e8ced07b3 | ||
|
|
1737fca220 | ||
|
|
8cffae65a6 | ||
|
|
e6baa656f7 | ||
|
|
a3f90948d8 | ||
|
|
453f6e6e5a | ||
|
|
cf4f2cfa3e | ||
|
|
bbd910ed1b | ||
|
|
52cfd2743c | ||
|
|
b1c331c845 | ||
|
|
e72c5cb02a | ||
|
|
ad6f2323b7 | ||
|
|
73f5ca70de | ||
|
|
b10cb7b258 | ||
|
|
61830ace0b | ||
|
|
311ed516ce | ||
|
|
f036de5a94 | ||
|
|
c61b902538 | ||
|
|
dcaa5643d7 | ||
|
|
b3f4f812d8 | ||
|
|
2fa1078911 | ||
|
|
e5a008f7b2 | ||
|
|
7225453d5f | ||
|
|
83fe7d414e | ||
|
|
661289d480 | ||
|
|
a2809b391d | ||
|
|
ed5140d235 | ||
|
|
85fb33a65f | ||
|
|
43c09134a9 | ||
|
|
2f928316db | ||
|
|
ca181100ca | ||
|
|
10e8da1f1a | ||
|
|
c7f3d1627f | ||
|
|
19ebe2b956 | ||
|
|
cf7ece6245 | ||
|
|
28b934b3ae | ||
|
|
37bd5787fc | ||
|
|
460e42391e | ||
|
|
2e5d37463e | ||
|
|
da1633a5d4 | ||
|
|
e03d627769 | ||
|
|
984b85c1a7 | ||
|
|
3378fc9149 | ||
|
|
ac1e411b2b | ||
|
|
263c859558 | ||
|
|
6618348e23 | ||
|
|
288e487232 | ||
|
|
9269b7f627 | ||
|
|
3fc4f3670c | ||
|
|
ec4d0cdd56 |
9
.air.conf
Normal file
9
.air.conf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
root = "."
|
||||||
|
tmp_dir = ".air"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
cmd = "make backend"
|
||||||
|
bin = "gitea"
|
||||||
|
include_ext = ["go", "tmpl"]
|
||||||
|
exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata"]
|
||||||
|
include_dir = ["cmd", "models", "modules", "options", "routers", "services", "templates"]
|
||||||
@@ -22,6 +22,10 @@ groups:
|
|||||||
name: SECURITY
|
name: SECURITY
|
||||||
labels:
|
labels:
|
||||||
- kind/security
|
- kind/security
|
||||||
|
-
|
||||||
|
name: API
|
||||||
|
labels:
|
||||||
|
- kind/api
|
||||||
-
|
-
|
||||||
name: BUGFIXES
|
name: BUGFIXES
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
164
.drone.yml
164
.drone.yml
@@ -11,24 +11,77 @@ workspace:
|
|||||||
path: src/code.gitea.io/gitea
|
path: src/code.gitea.io/gitea
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: pre-build
|
- name: deps-frontend
|
||||||
pull: always
|
pull: always
|
||||||
image: node:10 # this step is kept at the lowest version of node that we support
|
image: node:14
|
||||||
commands:
|
commands:
|
||||||
- make webpack
|
- make node_modules
|
||||||
|
|
||||||
- name: build-without-gcc
|
- name: lint-frontend
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.11 # this step is kept as the lowest version of golang that we support
|
image: node:14
|
||||||
|
commands:
|
||||||
|
- make lint-frontend
|
||||||
|
depends_on: [deps-frontend]
|
||||||
|
|
||||||
|
- name: lint-backend
|
||||||
|
pull: always
|
||||||
|
image: golang:1.15
|
||||||
|
commands:
|
||||||
|
- make lint-backend
|
||||||
|
environment:
|
||||||
|
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
||||||
|
GOSUMDB: sum.golang.org
|
||||||
|
TAGS: bindata sqlite sqlite_unlock_notify
|
||||||
|
|
||||||
|
- name: checks-frontend
|
||||||
|
pull: always
|
||||||
|
image: node:14
|
||||||
|
commands:
|
||||||
|
- make checks-frontend
|
||||||
|
depends_on: [deps-frontend]
|
||||||
|
|
||||||
|
- name: checks-backend
|
||||||
|
pull: always
|
||||||
|
image: golang:1.14
|
||||||
|
commands:
|
||||||
|
- make checks-backend
|
||||||
|
depends_on: [lint-backend]
|
||||||
|
|
||||||
|
- name: build-frontend
|
||||||
|
pull: always
|
||||||
|
image: node:14
|
||||||
|
commands:
|
||||||
|
- make frontend
|
||||||
|
depends_on: [lint-frontend]
|
||||||
|
|
||||||
|
- name: build-backend-no-gcc
|
||||||
|
pull: always
|
||||||
|
image: golang:1.13 # this step is kept as the lowest version of golang that we support
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
commands:
|
commands:
|
||||||
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
||||||
|
depends_on: [checks-backend]
|
||||||
|
|
||||||
- name: build-linux-386
|
- name: build-backend-arm64
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
|
environment:
|
||||||
|
GO111MODULE: on
|
||||||
|
GOPROXY: off
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: arm64
|
||||||
|
TAGS: bindata
|
||||||
|
commands:
|
||||||
|
- make backend # test cross compile
|
||||||
|
- rm ./gitea # clean
|
||||||
|
depends_on: [checks-backend]
|
||||||
|
|
||||||
|
- name: build-backend-386
|
||||||
|
pull: always
|
||||||
|
image: golang:1.15
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
@@ -36,16 +89,7 @@ steps:
|
|||||||
GOARCH: 386
|
GOARCH: 386
|
||||||
commands:
|
commands:
|
||||||
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
|
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
|
||||||
|
depends_on: [checks-backend]
|
||||||
- name: check
|
|
||||||
pull: always
|
|
||||||
image: golang:1.13
|
|
||||||
commands:
|
|
||||||
- make clean golangci-lint revive swagger-check swagger-validate test-vendor
|
|
||||||
environment:
|
|
||||||
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
|
||||||
GOSUMDB: sum.golang.org
|
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -55,6 +99,9 @@ platform:
|
|||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- compliance
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
base: /go
|
base: /go
|
||||||
path: src/code.gitea.io/gitea
|
path: src/code.gitea.io/gitea
|
||||||
@@ -92,6 +139,14 @@ services:
|
|||||||
discovery.type: single-node
|
discovery.type: single-node
|
||||||
image: elasticsearch:7.5.0
|
image: elasticsearch:7.5.0
|
||||||
|
|
||||||
|
- name: minio
|
||||||
|
image: minio/minio:RELEASE.2020-10-09T22-55-05Z
|
||||||
|
commands:
|
||||||
|
- minio server /data
|
||||||
|
environment:
|
||||||
|
MINIO_ACCESS_KEY: 123456
|
||||||
|
MINIO_SECRET_KEY: 12345678
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: fetch-tags
|
- name: fetch-tags
|
||||||
pull: default
|
pull: default
|
||||||
@@ -105,10 +160,9 @@ steps:
|
|||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
- make backend
|
||||||
- make build
|
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
||||||
GOSUMDB: sum.golang.org
|
GOSUMDB: sum.golang.org
|
||||||
@@ -116,13 +170,13 @@ steps:
|
|||||||
|
|
||||||
- name: tag-pre-condition
|
- name: tag-pre-condition
|
||||||
pull: always
|
pull: always
|
||||||
image: alpine/git
|
image: drone/git
|
||||||
commands:
|
commands:
|
||||||
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
|
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
|
||||||
|
|
||||||
- name: unit-test
|
- name: unit-test
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make unit-test-coverage test-check
|
- make unit-test-coverage test-check
|
||||||
environment:
|
environment:
|
||||||
@@ -133,7 +187,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-mysql
|
- name: test-mysql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@@ -142,12 +196,14 @@ steps:
|
|||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
TEST_LDAP: 1
|
TEST_LDAP: 1
|
||||||
|
USE_REPO_TEST_DIR: 1
|
||||||
|
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
- name: test-mysql8
|
- name: test-mysql8
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@@ -156,12 +212,13 @@ steps:
|
|||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
TEST_LDAP: 1
|
TEST_LDAP: 1
|
||||||
|
USE_REPO_TEST_DIR: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
- name: test-mssql
|
- name: test-mssql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@@ -170,12 +227,13 @@ steps:
|
|||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
TEST_LDAP: 1
|
TEST_LDAP: 1
|
||||||
|
USE_REPO_TEST_DIR: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
- name: generate-coverage
|
- name: generate-coverage
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make coverage
|
- make coverage
|
||||||
environment:
|
environment:
|
||||||
@@ -191,14 +249,13 @@ steps:
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
- name: coverage
|
- name: coverage-codecov
|
||||||
pull: always
|
pull: always
|
||||||
image: robertstettner/drone-codecov
|
image: plugins/codecov
|
||||||
settings:
|
settings:
|
||||||
files:
|
files:
|
||||||
- coverage.all
|
- coverage.all
|
||||||
environment:
|
token:
|
||||||
CODECOV_TOKEN:
|
|
||||||
from_secret: codecov_token
|
from_secret: codecov_token
|
||||||
depends_on:
|
depends_on:
|
||||||
- generate-coverage
|
- generate-coverage
|
||||||
@@ -209,8 +266,6 @@ steps:
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: testing-arm64
|
name: testing-arm64
|
||||||
@@ -219,6 +274,9 @@ platform:
|
|||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- compliance
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
base: /go
|
base: /go
|
||||||
path: src/code.gitea.io/gitea
|
path: src/code.gitea.io/gitea
|
||||||
@@ -248,10 +306,9 @@ steps:
|
|||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
- make backend
|
||||||
- make build
|
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
||||||
GOSUMDB: sum.golang.org
|
GOSUMDB: sum.golang.org
|
||||||
@@ -259,7 +316,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-sqlite
|
- name: test-sqlite
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@@ -267,12 +324,13 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
|
USE_REPO_TEST_DIR: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
- name: test-pgsql
|
- name: test-pgsql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@@ -281,6 +339,7 @@ steps:
|
|||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
TEST_LDAP: 1
|
TEST_LDAP: 1
|
||||||
|
USE_REPO_TEST_DIR: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
@@ -317,9 +376,9 @@ steps:
|
|||||||
|
|
||||||
- name: update
|
- name: update
|
||||||
pull: default
|
pull: default
|
||||||
image: alpine:3.11
|
image: alpine:3.12
|
||||||
commands:
|
commands:
|
||||||
- ./scripts/update-locales.sh
|
- ./build/update-locales.sh
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
pull: always
|
pull: always
|
||||||
@@ -348,7 +407,7 @@ steps:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: release-master
|
name: release-latest
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@@ -379,14 +438,13 @@ steps:
|
|||||||
|
|
||||||
- name: static
|
- name: static
|
||||||
pull: always
|
pull: always
|
||||||
image: techknowlogick/xgo:latest
|
image: techknowlogick/xgo:go-1.15.x
|
||||||
commands:
|
commands:
|
||||||
- apt update && apt -y install curl
|
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt -y install nodejs
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
|
||||||
- export PATH=$PATH:$GOPATH/bin
|
- export PATH=$PATH:$GOPATH/bin
|
||||||
- make release
|
- make release
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: off
|
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
TAGS: bindata sqlite sqlite_unlock_notify
|
||||||
|
|
||||||
- name: gpg-sign
|
- name: gpg-sign
|
||||||
@@ -404,7 +462,7 @@ steps:
|
|||||||
GPGSIGN_PASSPHRASE:
|
GPGSIGN_PASSPHRASE:
|
||||||
from_secret: gpgsign_passphrase
|
from_secret: gpgsign_passphrase
|
||||||
|
|
||||||
- name: release-branch-release
|
- name: release-branch
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
settings:
|
settings:
|
||||||
@@ -426,7 +484,7 @@ steps:
|
|||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|
||||||
- name: release
|
- name: release-master
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
settings:
|
settings:
|
||||||
@@ -477,14 +535,13 @@ steps:
|
|||||||
|
|
||||||
- name: static
|
- name: static
|
||||||
pull: always
|
pull: always
|
||||||
image: techknowlogick/xgo:latest
|
image: techknowlogick/xgo:go-1.15.x
|
||||||
commands:
|
commands:
|
||||||
- apt update && apt -y install curl
|
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt -y install nodejs
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
|
||||||
- export PATH=$PATH:$GOPATH/bin
|
- export PATH=$PATH:$GOPATH/bin
|
||||||
- make release
|
- make release
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: off
|
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
TAGS: bindata sqlite sqlite_unlock_notify
|
||||||
|
|
||||||
- name: gpg-sign
|
- name: gpg-sign
|
||||||
@@ -502,7 +559,7 @@ steps:
|
|||||||
GPGSIGN_PASSPHRASE:
|
GPGSIGN_PASSPHRASE:
|
||||||
from_secret: gpgsign_passphrase
|
from_secret: gpgsign_passphrase
|
||||||
|
|
||||||
- name: release
|
- name: release-tag
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
settings:
|
settings:
|
||||||
@@ -537,6 +594,9 @@ platform:
|
|||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- compliance
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-docs
|
- name: build-docs
|
||||||
pull: always
|
pull: always
|
||||||
@@ -742,7 +802,7 @@ depends_on:
|
|||||||
- testing-arm64
|
- testing-arm64
|
||||||
- translations
|
- translations
|
||||||
- release-version
|
- release-version
|
||||||
- release-master
|
- release-latest
|
||||||
- docker-linux-amd64-release
|
- docker-linux-amd64-release
|
||||||
- docker-linux-arm64-release
|
- docker-linux-arm64-release
|
||||||
- docker-manifest
|
- docker-manifest
|
||||||
|
|||||||
@@ -1,34 +1,22 @@
|
|||||||
# http://editorconfig.org
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
indent_style = space
|
||||||
insert_final_newline = true
|
indent_size = 2
|
||||||
trim_trailing_whitespace = true
|
tab_width = 2
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.md]
|
[*.{go,tmpl,html}]
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
[*.go]
|
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 8
|
|
||||||
|
|
||||||
[*.{tmpl,html}]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.less]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.{yml,json}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.js]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.svg]
|
||||||
|
insert_final_newline = false
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
359
.eslintrc
359
.eslintrc
@@ -1,56 +1,389 @@
|
|||||||
root: true
|
root: true
|
||||||
|
reportUnusedDisableDirectives: true
|
||||||
extends:
|
|
||||||
- eslint-config-airbnb-base
|
|
||||||
- eslint:recommended
|
|
||||||
|
|
||||||
ignorePatterns:
|
ignorePatterns:
|
||||||
- /web_src/js/vendor
|
- /web_src/js/vendor
|
||||||
|
|
||||||
parserOptions:
|
parserOptions:
|
||||||
|
sourceType: module
|
||||||
ecmaVersion: 2020
|
ecmaVersion: 2020
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- eslint-plugin-unicorn
|
||||||
|
- eslint-plugin-import
|
||||||
|
|
||||||
env:
|
env:
|
||||||
browser: true
|
es2021: true
|
||||||
es6: true
|
|
||||||
jquery: true
|
|
||||||
node: true
|
node: true
|
||||||
|
|
||||||
globals:
|
globals:
|
||||||
__webpack_public_path__: true
|
__webpack_public_path__: true
|
||||||
CodeMirror: false
|
CodeMirror: false
|
||||||
Dropzone: false
|
Dropzone: false
|
||||||
emojify: false
|
|
||||||
SimpleMDE: false
|
SimpleMDE: false
|
||||||
u2fApi: false
|
u2fApi: false
|
||||||
|
|
||||||
|
overrides:
|
||||||
|
- files: ["web_src/**/*.js"]
|
||||||
|
env:
|
||||||
|
browser: true
|
||||||
|
jquery: true
|
||||||
|
node: false
|
||||||
|
- files: ["web_src/**/*worker.js"]
|
||||||
|
env:
|
||||||
|
worker: true
|
||||||
|
rules:
|
||||||
|
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
|
||||||
|
- files: ["build/generate-images.js"]
|
||||||
|
rules:
|
||||||
|
import/no-unresolved: [0]
|
||||||
|
import/no-extraneous-dependencies: [0]
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
|
accessor-pairs: [2]
|
||||||
|
array-bracket-newline: [0]
|
||||||
|
array-bracket-spacing: [2, never]
|
||||||
|
array-callback-return: [0]
|
||||||
|
array-element-newline: [0]
|
||||||
arrow-body-style: [0]
|
arrow-body-style: [0]
|
||||||
|
arrow-parens: [2, always]
|
||||||
|
arrow-spacing: [2, {before: true, after: true}]
|
||||||
|
block-scoped-var: [2]
|
||||||
|
brace-style: [2, 1tbs, {allowSingleLine: true}]
|
||||||
camelcase: [0]
|
camelcase: [0]
|
||||||
|
capitalized-comments: [0]
|
||||||
|
class-methods-use-this: [0]
|
||||||
comma-dangle: [2, only-multiline]
|
comma-dangle: [2, only-multiline]
|
||||||
|
comma-spacing: [2, {before: false, after: true}]
|
||||||
|
comma-style: [2, last]
|
||||||
|
complexity: [0]
|
||||||
|
computed-property-spacing: [2, never]
|
||||||
consistent-return: [0]
|
consistent-return: [0]
|
||||||
|
consistent-this: [0]
|
||||||
|
constructor-super: [2]
|
||||||
|
curly: [0]
|
||||||
|
default-case-last: [2]
|
||||||
default-case: [0]
|
default-case: [0]
|
||||||
|
default-param-last: [0]
|
||||||
|
dot-location: [2, property]
|
||||||
|
dot-notation: [0]
|
||||||
|
eol-last: [2]
|
||||||
|
eqeqeq: [2]
|
||||||
|
for-direction: [2]
|
||||||
|
func-call-spacing: [2, never]
|
||||||
|
func-name-matching: [2]
|
||||||
func-names: [0]
|
func-names: [0]
|
||||||
import/extensions: [0]
|
func-style: [0]
|
||||||
|
function-call-argument-newline: [0]
|
||||||
|
function-paren-newline: [0]
|
||||||
|
generator-star-spacing: [0]
|
||||||
|
getter-return: [2]
|
||||||
|
grouped-accessor-pairs: [2]
|
||||||
|
guard-for-in: [0]
|
||||||
|
id-blacklist: [0]
|
||||||
|
id-length: [0]
|
||||||
|
id-match: [0]
|
||||||
|
implicit-arrow-linebreak: [0]
|
||||||
|
import/default: [0]
|
||||||
|
import/dynamic-import-chunkname: [0]
|
||||||
|
import/export: [2]
|
||||||
|
import/exports-last: [0]
|
||||||
|
import/extensions: [2, always, {ignorePackages: true}]
|
||||||
|
import/first: [2]
|
||||||
|
import/group-exports: [0]
|
||||||
|
import/max-dependencies: [0]
|
||||||
|
import/named: [2]
|
||||||
|
import/namespace: [0]
|
||||||
|
import/newline-after-import: [0]
|
||||||
|
import/no-absolute-path: [0]
|
||||||
|
import/no-amd: [0]
|
||||||
|
import/no-anonymous-default-export: [0]
|
||||||
|
import/no-commonjs: [0]
|
||||||
|
import/no-cycle: [0]
|
||||||
|
import/no-default-export: [0]
|
||||||
|
import/no-deprecated: [0]
|
||||||
|
import/no-dynamic-require: [0]
|
||||||
|
import/no-extraneous-dependencies: [2]
|
||||||
|
import/no-internal-modules: [0]
|
||||||
|
import/no-mutable-exports: [2]
|
||||||
|
import/no-named-as-default-member: [0]
|
||||||
|
import/no-named-as-default: [2]
|
||||||
|
import/no-named-default: [0]
|
||||||
|
import/no-named-export: [0]
|
||||||
|
import/no-namespace: [0]
|
||||||
|
import/no-nodejs-modules: [0]
|
||||||
|
import/no-relative-parent-imports: [0]
|
||||||
|
import/no-restricted-paths: [0]
|
||||||
|
import/no-self-import: [2]
|
||||||
|
import/no-unassigned-import: [0]
|
||||||
|
import/no-unresolved: [2, {commonjs: true}]
|
||||||
|
import/no-unused-modules: [0]
|
||||||
|
import/no-useless-path-segments: [2, {commonjs: true}]
|
||||||
|
import/no-webpack-loader-syntax: [2]
|
||||||
|
import/order: [0]
|
||||||
import/prefer-default-export: [0]
|
import/prefer-default-export: [0]
|
||||||
|
import/unambiguous: [0]
|
||||||
|
indent: [2, 2, {SwitchCase: 1}]
|
||||||
|
init-declarations: [0]
|
||||||
|
key-spacing: [2]
|
||||||
|
keyword-spacing: [2]
|
||||||
|
line-comment-position: [0]
|
||||||
|
linebreak-style: [2, unix]
|
||||||
|
lines-around-comment: [0]
|
||||||
|
lines-between-class-members: [0]
|
||||||
|
max-classes-per-file: [0]
|
||||||
|
max-depth: [0]
|
||||||
max-len: [0]
|
max-len: [0]
|
||||||
|
max-lines-per-function: [0]
|
||||||
|
max-lines: [0]
|
||||||
|
max-nested-callbacks: [0]
|
||||||
|
max-params: [0]
|
||||||
|
max-statements-per-line: [0]
|
||||||
|
max-statements: [0]
|
||||||
|
multiline-comment-style: [2, separate-lines]
|
||||||
|
multiline-ternary: [0]
|
||||||
|
new-cap: [0]
|
||||||
|
new-parens: [2]
|
||||||
newline-per-chained-call: [0]
|
newline-per-chained-call: [0]
|
||||||
no-alert: [0]
|
no-alert: [0]
|
||||||
|
no-array-constructor: [2]
|
||||||
|
no-async-promise-executor: [2]
|
||||||
|
no-await-in-loop: [0]
|
||||||
|
no-bitwise: [0]
|
||||||
|
no-buffer-constructor: [0]
|
||||||
|
no-caller: [2]
|
||||||
|
no-case-declarations: [2]
|
||||||
|
no-class-assign: [2]
|
||||||
|
no-compare-neg-zero: [2]
|
||||||
no-cond-assign: [2, except-parens]
|
no-cond-assign: [2, except-parens]
|
||||||
|
no-confusing-arrow: [0]
|
||||||
no-console: [1, {allow: [info, warn, error]}]
|
no-console: [1, {allow: [info, warn, error]}]
|
||||||
|
no-const-assign: [2]
|
||||||
|
no-constant-condition: [0]
|
||||||
|
no-constructor-return: [2]
|
||||||
no-continue: [0]
|
no-continue: [0]
|
||||||
|
no-control-regex: [0]
|
||||||
|
no-debugger: [1]
|
||||||
|
no-delete-var: [2]
|
||||||
|
no-div-regex: [0]
|
||||||
|
no-dupe-args: [2]
|
||||||
|
no-dupe-class-members: [2]
|
||||||
|
no-dupe-else-if: [2]
|
||||||
|
no-dupe-keys: [2]
|
||||||
|
no-duplicate-case: [2]
|
||||||
|
no-duplicate-imports: [2]
|
||||||
|
no-else-return: [2]
|
||||||
|
no-empty-character-class: [2]
|
||||||
|
no-empty-function: [0]
|
||||||
|
no-empty-pattern: [2]
|
||||||
|
no-empty: [2, {allowEmptyCatch: true}]
|
||||||
|
no-eq-null: [2]
|
||||||
|
no-eval: [2]
|
||||||
|
no-ex-assign: [2]
|
||||||
|
no-extend-native: [2]
|
||||||
|
no-extra-bind: [2]
|
||||||
|
no-extra-boolean-cast: [2]
|
||||||
|
no-extra-label: [0]
|
||||||
|
no-extra-parens: [0]
|
||||||
|
no-extra-semi: [2]
|
||||||
|
no-fallthrough: [2]
|
||||||
|
no-floating-decimal: [0]
|
||||||
|
no-func-assign: [2]
|
||||||
|
no-global-assign: [2]
|
||||||
|
no-implicit-coercion: [0]
|
||||||
|
no-implicit-globals: [0]
|
||||||
|
no-implied-eval: [2]
|
||||||
|
no-import-assign: [2]
|
||||||
|
no-inline-comments: [0]
|
||||||
|
no-inner-declarations: [2]
|
||||||
|
no-invalid-regexp: [2]
|
||||||
|
no-invalid-this: [0]
|
||||||
|
no-irregular-whitespace: [2]
|
||||||
|
no-iterator: [2]
|
||||||
|
no-label-var: [2]
|
||||||
|
no-labels: [2]
|
||||||
|
no-lone-blocks: [2]
|
||||||
|
no-lonely-if: [0]
|
||||||
|
no-loop-func: [0]
|
||||||
|
no-loss-of-precision: [2]
|
||||||
|
no-magic-numbers: [0]
|
||||||
|
no-misleading-character-class: [2]
|
||||||
no-mixed-operators: [0]
|
no-mixed-operators: [0]
|
||||||
|
no-mixed-spaces-and-tabs: [2]
|
||||||
no-multi-assign: [0]
|
no-multi-assign: [0]
|
||||||
|
no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true, VariableDeclarator: true}}]
|
||||||
|
no-multi-str: [2]
|
||||||
|
no-negated-condition: [0]
|
||||||
|
no-nested-ternary: [0]
|
||||||
|
no-new-func: [2]
|
||||||
|
no-new-object: [2]
|
||||||
|
no-new-symbol: [2]
|
||||||
|
no-new-wrappers: [2]
|
||||||
no-new: [0]
|
no-new: [0]
|
||||||
|
no-obj-calls: [2]
|
||||||
|
no-octal-escape: [2]
|
||||||
|
no-octal: [2]
|
||||||
no-param-reassign: [0]
|
no-param-reassign: [0]
|
||||||
no-plusplus: [0]
|
no-plusplus: [0]
|
||||||
no-restricted-syntax: [0]
|
no-promise-executor-return: [0]
|
||||||
|
no-proto: [2]
|
||||||
|
no-prototype-builtins: [2]
|
||||||
|
no-redeclare: [2]
|
||||||
|
no-regex-spaces: [2]
|
||||||
|
no-restricted-exports: [0]
|
||||||
|
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top]
|
||||||
|
no-restricted-imports: [0]
|
||||||
|
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement]
|
||||||
|
no-return-assign: [0]
|
||||||
|
no-return-await: [0]
|
||||||
|
no-script-url: [2]
|
||||||
|
no-self-assign: [2, {props: true}]
|
||||||
|
no-self-compare: [2]
|
||||||
|
no-sequences: [2]
|
||||||
|
no-setter-return: [2]
|
||||||
|
no-shadow-restricted-names: [2]
|
||||||
no-shadow: [0]
|
no-shadow: [0]
|
||||||
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
|
no-sparse-arrays: [2]
|
||||||
no-use-before-define: [0]
|
no-tabs: [2]
|
||||||
|
no-template-curly-in-string: [2]
|
||||||
|
no-ternary: [0]
|
||||||
|
no-this-before-super: [2]
|
||||||
|
no-throw-literal: [2]
|
||||||
|
no-trailing-spaces: [2]
|
||||||
|
no-undef-init: [2]
|
||||||
|
no-undef: [2, {typeof: true}]
|
||||||
|
no-undefined: [0]
|
||||||
|
no-underscore-dangle: [0]
|
||||||
|
no-unexpected-multiline: [2]
|
||||||
|
no-unmodified-loop-condition: [2]
|
||||||
|
no-unneeded-ternary: [0]
|
||||||
|
no-unreachable-loop: [2]
|
||||||
|
no-unreachable: [2]
|
||||||
|
no-unsafe-finally: [2]
|
||||||
|
no-unsafe-negation: [2]
|
||||||
|
no-unused-expressions: [2]
|
||||||
|
no-unused-labels: [2]
|
||||||
|
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, ignoreRestSiblings: false}]
|
||||||
|
no-use-before-define: [2, nofunc]
|
||||||
|
no-useless-backreference: [0]
|
||||||
|
no-useless-call: [2]
|
||||||
|
no-useless-catch: [2]
|
||||||
|
no-useless-computed-key: [2]
|
||||||
|
no-useless-concat: [2]
|
||||||
|
no-useless-constructor: [2]
|
||||||
|
no-useless-escape: [2]
|
||||||
|
no-useless-rename: [2]
|
||||||
|
no-useless-return: [2]
|
||||||
no-var: [2]
|
no-var: [2]
|
||||||
|
no-void: [2]
|
||||||
|
no-warning-comments: [0]
|
||||||
|
no-whitespace-before-property: [2]
|
||||||
|
no-with: [2]
|
||||||
|
nonblock-statement-body-position: [2]
|
||||||
|
object-curly-newline: [0]
|
||||||
|
object-curly-spacing: [2, never]
|
||||||
|
object-shorthand: [2, always]
|
||||||
one-var-declaration-per-line: [0]
|
one-var-declaration-per-line: [0]
|
||||||
one-var: [0]
|
one-var: [0]
|
||||||
|
operator-assignment: [2, always]
|
||||||
|
operator-linebreak: [2, after]
|
||||||
|
padded-blocks: [2, never]
|
||||||
|
padding-line-between-statements: [0]
|
||||||
|
prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}]
|
||||||
prefer-const: [2, {destructuring: all}]
|
prefer-const: [2, {destructuring: all}]
|
||||||
prefer-destructuring: [0]
|
prefer-destructuring: [0]
|
||||||
|
prefer-exponentiation-operator: [2]
|
||||||
|
prefer-named-capture-group: [0]
|
||||||
|
prefer-numeric-literals: [2]
|
||||||
|
prefer-object-spread: [0]
|
||||||
|
prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
|
||||||
|
prefer-regex-literals: [2]
|
||||||
|
prefer-rest-params: [2]
|
||||||
|
prefer-spread: [2]
|
||||||
|
prefer-template: [2]
|
||||||
|
quote-props: [0]
|
||||||
|
quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
|
||||||
radix: [2, as-needed]
|
radix: [2, as-needed]
|
||||||
|
require-atomic-updates: [0]
|
||||||
|
require-await: [0]
|
||||||
|
require-unicode-regexp: [0]
|
||||||
|
require-yield: [2]
|
||||||
|
rest-spread-spacing: [2, never]
|
||||||
|
semi-spacing: [2, {before: false, after: true}]
|
||||||
|
semi-style: [2, last]
|
||||||
|
semi: [2, always, {omitLastInOneLineBlock: true}]
|
||||||
|
sort-imports: [0]
|
||||||
|
sort-keys: [0]
|
||||||
|
sort-vars: [0]
|
||||||
|
space-before-blocks: [2, always]
|
||||||
|
space-in-parens: [2, never]
|
||||||
|
space-infix-ops: [2]
|
||||||
|
space-unary-ops: [2]
|
||||||
|
spaced-comment: [2, always]
|
||||||
|
strict: [0]
|
||||||
|
switch-colon-spacing: [2]
|
||||||
|
symbol-description: [2]
|
||||||
|
template-curly-spacing: [2, never]
|
||||||
|
template-tag-spacing: [2, never]
|
||||||
|
unicode-bom: [2, never]
|
||||||
|
unicorn/better-regex: [0]
|
||||||
|
unicorn/catch-error-name: [0]
|
||||||
|
unicorn/consistent-function-scoping: [2]
|
||||||
|
unicorn/custom-error-definition: [0]
|
||||||
|
unicorn/error-message: [0]
|
||||||
|
unicorn/escape-case: [0]
|
||||||
|
unicorn/expiring-todo-comments: [0]
|
||||||
|
unicorn/explicit-length-check: [0]
|
||||||
|
unicorn/filename-case: [0]
|
||||||
|
unicorn/import-index: [0]
|
||||||
|
unicorn/new-for-builtins: [2]
|
||||||
|
unicorn/no-abusive-eslint-disable: [0]
|
||||||
|
unicorn/no-array-instanceof: [0]
|
||||||
|
unicorn/no-console-spaces: [0]
|
||||||
|
unicorn/no-fn-reference-in-iterator: [0]
|
||||||
|
unicorn/no-for-loop: [0]
|
||||||
|
unicorn/no-hex-escape: [0]
|
||||||
|
unicorn/no-keyword-prefix: [0]
|
||||||
|
unicorn/no-nested-ternary: [0]
|
||||||
|
unicorn/no-new-buffer: [0]
|
||||||
|
unicorn/no-null: [0]
|
||||||
|
unicorn/no-object-as-default-parameter: [2]
|
||||||
|
unicorn/no-process-exit: [0]
|
||||||
|
unicorn/no-reduce: [2]
|
||||||
|
unicorn/no-unreadable-array-destructuring: [0]
|
||||||
|
unicorn/no-unsafe-regex: [0]
|
||||||
|
unicorn/no-unused-properties: [2]
|
||||||
|
unicorn/no-useless-undefined: [0]
|
||||||
|
unicorn/no-zero-fractions: [2]
|
||||||
|
unicorn/number-literal-case: [0]
|
||||||
|
unicorn/prefer-add-event-listener: [2]
|
||||||
|
unicorn/prefer-array-find: [2]
|
||||||
|
unicorn/prefer-dataset: [2]
|
||||||
|
unicorn/prefer-event-key: [2]
|
||||||
|
unicorn/prefer-includes: [2]
|
||||||
|
unicorn/prefer-modern-dom-apis: [0]
|
||||||
|
unicorn/prefer-negative-index: [2]
|
||||||
|
unicorn/prefer-node-append: [0]
|
||||||
|
unicorn/prefer-node-remove: [0]
|
||||||
|
unicorn/prefer-number-properties: [0]
|
||||||
|
unicorn/prefer-optional-catch-binding: [2]
|
||||||
|
unicorn/prefer-query-selector: [0]
|
||||||
|
unicorn/prefer-reflect-apply: [0]
|
||||||
|
unicorn/prefer-replace-all: [0]
|
||||||
|
unicorn/prefer-set-has: [0]
|
||||||
|
unicorn/prefer-spread: [0]
|
||||||
|
unicorn/prefer-starts-ends-with: [2]
|
||||||
|
unicorn/prefer-string-slice: [0]
|
||||||
|
unicorn/prefer-text-content: [2]
|
||||||
|
unicorn/prefer-trim-start-end: [2]
|
||||||
|
unicorn/prefer-type-error: [0]
|
||||||
|
unicorn/prevent-abbreviations: [0]
|
||||||
|
unicorn/string-content: [0]
|
||||||
|
unicorn/throw-new-error: [2]
|
||||||
|
use-isnan: [2]
|
||||||
|
valid-typeof: [2, {requireStringLiterals: true}]
|
||||||
|
vars-on-top: [0]
|
||||||
|
wrap-iife: [2, inside]
|
||||||
|
wrap-regex: [0]
|
||||||
|
yield-star-spacing: [2, after]
|
||||||
|
yoda: [2, never]
|
||||||
|
|||||||
8
.gitattributes
vendored
8
.gitattributes
vendored
@@ -1,7 +1,3 @@
|
|||||||
* text=auto eol=lf
|
* text=auto eol=lf
|
||||||
conf/* linguist-vendored
|
/vendor/** -text -eol linguist-vendored
|
||||||
docker/* linguist-vendored
|
/public/vendor/** -text -eol linguist-vendored
|
||||||
options/* linguist-vendored
|
|
||||||
public/* linguist-vendored
|
|
||||||
scripts/* linguist-vendored
|
|
||||||
templates/* linguist-vendored
|
|
||||||
|
|||||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -44,6 +44,7 @@ coverage.all
|
|||||||
*.log
|
*.log
|
||||||
|
|
||||||
/gitea
|
/gitea
|
||||||
|
/gitea-vet
|
||||||
/debug
|
/debug
|
||||||
/integrations.test
|
/integrations.test
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ coverage.all
|
|||||||
/custom/*
|
/custom/*
|
||||||
!/custom/conf
|
!/custom/conf
|
||||||
/custom/conf/*
|
/custom/conf/*
|
||||||
!/custom/conf/app.ini.sample
|
!/custom/conf/app.example.ini
|
||||||
/data
|
/data
|
||||||
/indexers
|
/indexers
|
||||||
/log
|
/log
|
||||||
@@ -67,6 +68,7 @@ coverage.all
|
|||||||
/integrations/indexers-pgsql
|
/integrations/indexers-pgsql
|
||||||
/integrations/indexers-sqlite
|
/integrations/indexers-sqlite
|
||||||
/integrations/indexers-mssql
|
/integrations/indexers-mssql
|
||||||
|
/integrations/sqlite.ini
|
||||||
/integrations/mysql.ini
|
/integrations/mysql.ini
|
||||||
/integrations/mysql8.ini
|
/integrations/mysql8.ini
|
||||||
/integrations/pgsql.ini
|
/integrations/pgsql.ini
|
||||||
@@ -74,10 +76,13 @@ coverage.all
|
|||||||
/node_modules
|
/node_modules
|
||||||
/yarn.lock
|
/yarn.lock
|
||||||
/public/js
|
/public/js
|
||||||
|
/public/serviceworker.js
|
||||||
/public/css
|
/public/css
|
||||||
/public/fomantic
|
/public/fonts
|
||||||
/public/img/svg
|
/public/img/webpack
|
||||||
|
/web_src/fomantic/build
|
||||||
/VERSION
|
/VERSION
|
||||||
|
/.air
|
||||||
|
|
||||||
# Snapcraft
|
# Snapcraft
|
||||||
snap/.snapcraft/
|
snap/.snapcraft/
|
||||||
|
|||||||
@@ -98,3 +98,12 @@ issues:
|
|||||||
- path: models/update.go
|
- path: models/update.go
|
||||||
linters:
|
linters:
|
||||||
- unused
|
- unused
|
||||||
|
- path: cmd/dump.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- text: "commentFormatting: put a space between `//` and comment text"
|
||||||
|
linters:
|
||||||
|
- gocritic
|
||||||
|
- text: "exitAfterDefer:"
|
||||||
|
linters:
|
||||||
|
- gocritic
|
||||||
|
|||||||
1
.ignore
1
.ignore
@@ -1,6 +1,5 @@
|
|||||||
/vendor
|
/vendor
|
||||||
/public/vendor/plugins
|
/public/vendor/plugins
|
||||||
/public/vendor/assets
|
|
||||||
/modules/options/bindata.go
|
/modules/options/bindata.go
|
||||||
/modules/public/bindata.go
|
/modules/public/bindata.go
|
||||||
/modules/templates/bindata.go
|
/modules/templates/bindata.go
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
extends: stylelint-config-standard
|
extends: stylelint-config-standard
|
||||||
|
|
||||||
ignoreFiles:
|
|
||||||
- web_src/less/vendor/**/*
|
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
at-rule-empty-line-before: null
|
at-rule-empty-line-before: null
|
||||||
block-closing-brace-empty-line-before: null
|
block-closing-brace-empty-line-before: null
|
||||||
color-hex-length: null
|
color-hex-length: null
|
||||||
comment-empty-line-before: null
|
comment-empty-line-before: null
|
||||||
|
declaration-block-single-line-max-declarations: null
|
||||||
declaration-empty-line-before: null
|
declaration-empty-line-before: null
|
||||||
indentation: 4
|
indentation: 2
|
||||||
no-descending-specificity: null
|
no-descending-specificity: null
|
||||||
number-leading-zero: never
|
number-leading-zero: never
|
||||||
rule-empty-line-before: null
|
rule-empty-line-before: null
|
||||||
selector-pseudo-element-colon-notation: null
|
selector-pseudo-element-colon-notation: null
|
||||||
|
shorthand-property-no-redundant-values: true
|
||||||
|
|||||||
819
CHANGELOG.md
819
CHANGELOG.md
@@ -4,6 +4,819 @@ 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
|
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).
|
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||||
|
|
||||||
|
## [1.13.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.13.0-RC1) - 2020-10-14
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Mitigate Security vulnerability in the git hook feature (#13058)
|
||||||
|
* Disable DSA ssh keys by default (#13056)
|
||||||
|
* Set TLS minimum version to 1.2 (#12689)
|
||||||
|
* Use argon as default password hash algorithm (#12688)
|
||||||
|
* BREAKING
|
||||||
|
* Don't replace underscores in auto-generated IDs in goldmark (#12805)
|
||||||
|
* Add Primary Key to Topic and RepoTopic tables (#12639)
|
||||||
|
* Disable password complexity check default (#12557)
|
||||||
|
* Change PIDFile default from /var/run/gitea.pid to /run/gitea.pid (#12500)
|
||||||
|
* Add extension Support to Attachments (allow all types for releases) (#12465)
|
||||||
|
* Remove IE11 Support (#11470)
|
||||||
|
* FEATURES
|
||||||
|
* Adopt repositories (#12920)
|
||||||
|
* Check passwords against HaveIBeenPwned (#12716)
|
||||||
|
* Gitea 2 Gitea migration (#12657)
|
||||||
|
* Support storing Avatars in minio (#12516)
|
||||||
|
* Allow addition of gpg keyring with multiple keys (#12487)
|
||||||
|
* Add email notify for new release (#12463)
|
||||||
|
* Add Access-Control-Expose-Headers (#12446)
|
||||||
|
* UserProfile Page: Render Description (#12415)
|
||||||
|
* Add command to recreate tables (#12407)
|
||||||
|
* Add mermaid JS renderer (#12334)
|
||||||
|
* Add ssh certificate support (#12281)
|
||||||
|
* Add spent time to referenced issue in commit message (#12220)
|
||||||
|
* Initial support for push options (#12169)
|
||||||
|
* Provide option to unlink a fork (#11858)
|
||||||
|
* Show exact tag for commit on diff view (#11846)
|
||||||
|
* Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777)
|
||||||
|
* Issue templates directory (#11450)
|
||||||
|
* Add a storage layer for attachments (#11387)
|
||||||
|
* Add hide activity option (#11353)
|
||||||
|
* Add push commits history comment on PR time-line (#11167)
|
||||||
|
* Support elastic search for code search (#10273)
|
||||||
|
* Kanban board (#8346)
|
||||||
|
* API
|
||||||
|
* If User is Admin, show 500 error message on PROD mode too (#13115)
|
||||||
|
* Add Timestamp to Tag list API (#13026)
|
||||||
|
* Return sample message for login error in api context (#12994)
|
||||||
|
* Add IsTemplate option in create repo ui and api (#12942)
|
||||||
|
* GetReleaseByID return 404 if not found (#12933)
|
||||||
|
* Get release by tags endpoint (#12932)
|
||||||
|
* NotificationSubject show Issue/Pull State (#12901)
|
||||||
|
* Expose its limitation settings (#12714)
|
||||||
|
* Add Created & Updated to Milestone (#12662)
|
||||||
|
* Milestone endpoints accept names too (#12649)
|
||||||
|
* Expose Attachment Settings in the API (#12514)
|
||||||
|
* Add Issue and Repo info to StopWatch (#12458)
|
||||||
|
* Add cron running API (#12421)
|
||||||
|
* Add Update Pull HeadBranch Function (#12419)
|
||||||
|
* Add TOTP header to Swagger Documentation (#12402)
|
||||||
|
* Delete Token accept names too (#12366)
|
||||||
|
* Add name filter for GetMilestoneList (#12336)
|
||||||
|
* Fixed count of filtered issues when api request. (#12275)
|
||||||
|
* Do not override API issue pagination with UI settings (#12068)
|
||||||
|
* Expose useful General Repo settings settings (#11758)
|
||||||
|
* Return error when trying to create Mirrors but Mirrors are globally disabled (#11757)
|
||||||
|
* Provide diff and patch API endpoints (#11751)
|
||||||
|
* Allow to create closed milestones (#11745)
|
||||||
|
* Add language Statistics endpoint (#11737)
|
||||||
|
* Add Endpoint to get GetGeneralUI Settings (#11735) & (#11854)
|
||||||
|
* Issue/Pull expose IsLocked Property on API (#11708)
|
||||||
|
* Add endpoint for Branch Creation (#11607)
|
||||||
|
* Add pagination headers on endpoints that support total count from database (#11145)
|
||||||
|
* BUGFIXES
|
||||||
|
* Show original author's reviews on pull summary box (#13127)
|
||||||
|
* Update golangci-lint to version 1.31.0 (#13102)
|
||||||
|
* Fix line break for MS teams webhook (#13081)
|
||||||
|
* Fix Issue & Pull Request comment headers on mobile (#13039)
|
||||||
|
* Avoid setting the CONN_STR in queues unless it is meant to be set (#13025)
|
||||||
|
* Remove code-view class from diff view (#13011)
|
||||||
|
* Fix the color of PR comment hyperlinks. (#13009)
|
||||||
|
* (Re)Load issue labels when changing them (#13007)
|
||||||
|
* Fix Media links in org files not liked to media files (#12997)
|
||||||
|
* Always return a list from GetCommitsFromIDs (#12981)
|
||||||
|
* Only set the user password if the password field would have been shown (#12980)
|
||||||
|
* Fix admin/config page (#12979)
|
||||||
|
* Changed width of commit signature avatar (#12961)
|
||||||
|
* Completely quote AppPath and CustomConf paths (#12955)
|
||||||
|
* Fix handling of migration errors (#12928)
|
||||||
|
* Fix anonymous GL migration (#12862)
|
||||||
|
* Fix git open close bug (#12834)
|
||||||
|
* Fix markdown meta parsing (#12817)
|
||||||
|
* Add default storage configurations (#12813)
|
||||||
|
* Show PR settings on empty repos (#12808)
|
||||||
|
* Disable watch and star if not signed in (#12807)
|
||||||
|
* Whilst changing the character set to utf8mb4 we should set ROW_FORMAT=dynamic too (#12804)
|
||||||
|
* Set opengraph attributes on org pages (#12803)
|
||||||
|
* Return error when creating gitlabdownloader failed (#12790)
|
||||||
|
* Add migration for password algorithm change (#12784)
|
||||||
|
* Compare SSH_DOMAIN when parsing submodule URLs (#12753)
|
||||||
|
* Fix editor.commit_empty_file_text locale string (#12744)
|
||||||
|
* Fix wrong poster message for code comment on Pull view (#11721)
|
||||||
|
* Escape failed highlighted files (#12685)
|
||||||
|
* Ensure that all migration requests are cancellable (#12669)
|
||||||
|
* Ensure RepoPath is lowercased in gitea serv (#12668)
|
||||||
|
* Do not disable commit changes button on repost (#12644)
|
||||||
|
* Dark theme for line numbers in blame view (#12632)
|
||||||
|
* Fix message when deleting last owner from an organization (#12628)
|
||||||
|
* Use shellquote to unpack arguments to gitea serv (#12624)
|
||||||
|
* Fix signing.wont_sign.%!s(<nil>) if Require Signing commits but not signed in. (#12581)
|
||||||
|
* Set utf8mb4 as the default charset on MySQL if CHARSET is unset (#12563)
|
||||||
|
* Set context for running CreateArchive to that of the request (#12555)
|
||||||
|
* Prevent redirect back to /user/events (#12462)
|
||||||
|
* Re-attempt to delete temporary upload if the file is locked by another process (#12447)
|
||||||
|
* Mirror System Notice reports are too frequent (#12438)
|
||||||
|
* Do not show arrows on comment diffs on pull comment pages (#12434)
|
||||||
|
* Fix milestone links (#12405)
|
||||||
|
* Increase size of the language column in language_stat (#12396)
|
||||||
|
* Use transaction in V102 migration (#12395)
|
||||||
|
* Only use --exclude on name-rev with git >= 2.13 (#12347)
|
||||||
|
* Add action feed for new release (#12324)
|
||||||
|
* Set NoAutoTime when updating is_archived (#12266)
|
||||||
|
* Support Force-update in Mirror and improve Tracing in mirror (#12242)
|
||||||
|
* Avoid sending "0 new commits" webhooks (#12212)
|
||||||
|
* Fix U2F button icon (#12167)
|
||||||
|
* models/repo_sign.go: break out of loops (#12159)
|
||||||
|
* Ensure that git commit tree continues properly over the page (#12142)
|
||||||
|
* Rewrite GitGraph.js (#12137)
|
||||||
|
* Fix repo API listing stability (#12057)
|
||||||
|
* Add team support for review request (#12039)
|
||||||
|
* Fix 500 error on repos with no tags (#11870)
|
||||||
|
* Fix nil pointer in default issue mail template (#11862)
|
||||||
|
* Fix commit search in all branches (#11849)
|
||||||
|
* Don't consider tag refs as valid for branch name (#11847)
|
||||||
|
* Don't add same line code comment box twice (#11837)
|
||||||
|
* Fix visibility of forked public repos from private orgs (#11717)
|
||||||
|
* Fix chardet test and add ordering option (#11621)
|
||||||
|
* Fix number of files, total additions, and deletions on Diff pages (#11614)
|
||||||
|
* Properly handle and return empty string for dangling commits in GetBranchName (#11587)
|
||||||
|
* Include query in sign in redirect (#11579)
|
||||||
|
* Fix Enter not working in SimpleMDE (#11564)
|
||||||
|
* Fix bug about can't skip commits base on base branch (#11555)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Add HostCertificate to sshd_config in Docker image (#13143)
|
||||||
|
* Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124)
|
||||||
|
* Improve error feedback for duplicate deploy keys (#13112)
|
||||||
|
* Set appropriate `autocomplete` attributes on password fields (#13078)
|
||||||
|
* Adding visual cue for "Limited" & "Private" organizations. (#13040)
|
||||||
|
* Fix Pull Request merge buttons on mobile (#13035)
|
||||||
|
* Gitea serv, hooks, manager and the like should always display Fatals (#13032)
|
||||||
|
* CSS tweaks to warning/error segments and misc fixes (#13024)
|
||||||
|
* Fix formatting of branches ahead-behind on narrow windows (#12989)
|
||||||
|
* Add config option to make create-on-push repositories public by default (#12936)
|
||||||
|
* Disable migration items when mirror is selected (#12918)
|
||||||
|
* Add the checkbox quick button to the comment tool bar also (#12885)
|
||||||
|
* Support GH enterprise (#12863)
|
||||||
|
* Simplify CheckUnitUser logic (#12854)
|
||||||
|
* Fix background of signed-commits on arc-green of timeline commits (#12837)
|
||||||
|
* Move git update-server-info to hooks (#12826)
|
||||||
|
* Add ui style for "Open a blank issue" button (#12824)
|
||||||
|
* Use a simple format for the big number on ui (#12822)
|
||||||
|
* Make SVG size argument optional (#12814)
|
||||||
|
* Add placeholder text for bio profile text form (#12792)
|
||||||
|
* Set language via AJAX (#12785)
|
||||||
|
* Show git-pull-request icon for closed pull request (#12742)
|
||||||
|
* Migrate version parsing library to hashicorp/go-version (#12719)
|
||||||
|
* Only use async pre-empt hack if go < 1.15 (#12718)
|
||||||
|
* Inform user about meaning of an hourglass on reviews (#12713)
|
||||||
|
* Add a migrate service type switch page (#12697)
|
||||||
|
* Migrations: Gitlab Add Reactions Support for Issues & MergeRequests (#12695)
|
||||||
|
* Remove duplicate logic in initListSubmits (#12660)
|
||||||
|
* Set avatar image dimensions (#12654)
|
||||||
|
* Rename models.ProtectedBranchRepoID/PRID to models.EnvRepoID/PRID and ensure EnvPusherEmail is set (#12646)
|
||||||
|
* Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752)
|
||||||
|
* Add postgres schema to the search_path on database connection (#12634)
|
||||||
|
* Git migration UX improvements (#12619)
|
||||||
|
* Add link to home page on swagger ui (#12601)
|
||||||
|
* hCaptcha Support (#12594)
|
||||||
|
* OpenGraph: use repo avatar if exist (#12586)
|
||||||
|
* Reaction picker display improvements (#12576)
|
||||||
|
* Fix emoji replacements, make emoji images consistent (#12567)
|
||||||
|
* Increase clickable area on files table links (#12553)
|
||||||
|
* Set z-index for sticky diff box lower (#12537)
|
||||||
|
* Report error if API merge is not allowed (#12528)
|
||||||
|
* LFS support to be stored on minio (#12518)
|
||||||
|
* Show 2FA info on Admin Pannel: Users List (#12515)
|
||||||
|
* Milestone Issue/Pull List: Add octicons type (#12499)
|
||||||
|
* Make dashboard newsfeed list length a configurable item (#12469)
|
||||||
|
* Add placeholder text for send testing email button in admin/config (#12452)
|
||||||
|
* Add SVG favicon (#12437)
|
||||||
|
* In issue comments, put issue participants also in completion list when hitting @ (#12433)
|
||||||
|
* Collapse Swagger UI tags by default (#12428)
|
||||||
|
* Detect full references to issues and pulls in commit messages (#12399)
|
||||||
|
* Allow common redis and leveldb connections (#12385)
|
||||||
|
* Don't use legacy method to send Matrix Webhook (#12348)
|
||||||
|
* Remove padding/border-radius on image diffs (#12346)
|
||||||
|
* Render the git graph on the server (#12333)
|
||||||
|
* Fix clone panel in wiki position not always align right (#12326)
|
||||||
|
* Rework 'make generate-images' (#12316)
|
||||||
|
* Refactor webhook payload convertion (#12310)
|
||||||
|
* Move jquery-minicolors to npm/webpack (#12305)
|
||||||
|
* Support use nvarchar for all varchar columns when using mssql (#12269)
|
||||||
|
* Update Octicons to v10 (#12240)
|
||||||
|
* Disable search box autofocus (#12229)
|
||||||
|
* Replace code fold icons with octicons (#12222)
|
||||||
|
* Ensure syntax highlighting is the same inside diffs (#12205)
|
||||||
|
* Auto-init repo on license, .gitignore select (#12202)
|
||||||
|
* Default to showing closed Issues/PR list when there are only closed issues/PRs (#12200)
|
||||||
|
* Enable cloning via Git Wire Protocol v2 over HTTP (#12170)
|
||||||
|
* Direct SVG rendering (#12157)
|
||||||
|
* Improve arc-green code colors (#12111)
|
||||||
|
* Allow admin to merge pr with protected file changes (#12078)
|
||||||
|
* Show description on individual milestone view (#12055)
|
||||||
|
* Update the wiki repository remote origin while update the mirror repository's Clone From URL (#12053)
|
||||||
|
* Server-side syntax highlighting for all code (#12047)
|
||||||
|
* Use Fomantic's fluid padded for blame full width (#12023)
|
||||||
|
* Use custom SVGs for commit signing lock icon (#12017)
|
||||||
|
* Make tabs smaller (#12003)
|
||||||
|
* Fix sticky diff stats container (#12002)
|
||||||
|
* Move fomantic and jQuery to main webpack bundle (#11997)
|
||||||
|
* Use enry language type to detect special languages (#11974)
|
||||||
|
* Use only first line of commit when creating referenced comment (#11960)
|
||||||
|
* Rename custom/conf/app.ini.sample to custom/conf/app.example.ini for better syntax light on editor (#11926)
|
||||||
|
* Fix double divider on issue sidebar (#11919)
|
||||||
|
* Shorten markdown heading anchors links (#11903)
|
||||||
|
* Add org avatar on top of internal repo icon (#11895)
|
||||||
|
* Use label to describe repository type (#11891)
|
||||||
|
* Make repository size unclickable on repo summary bar (#11887)
|
||||||
|
* Rework blame template and styling (#11885)
|
||||||
|
* Fix icon alignment for show/hide outdated link on resolved conversation (#11881)
|
||||||
|
* Vertically align review icons on repository sidebar (#11880)
|
||||||
|
* Better align items using flex within review request box (#11879)
|
||||||
|
* Only write to global gitconfig if necessary (#11876)
|
||||||
|
* Disable all typographic replacements in markdown renderer (#11871)
|
||||||
|
* Improve label edit buttons labels (#11841)
|
||||||
|
* Use crispEdges rendering for octicon-internal-repo (#11801)
|
||||||
|
* Show update branch item in merge box when it's necessary (#11761)
|
||||||
|
* Add compare link to releases (#11752)
|
||||||
|
* Allow site admin to disable mirrors (#11740)
|
||||||
|
* Export monaco editor on window.codeEditors (#11739)
|
||||||
|
* Add configurable Trust Models (#11712)
|
||||||
|
* Show full GPG commit status on PR commit history (#11702)
|
||||||
|
* Fix align issues and decrease avatar size on PR timeline (#11689)
|
||||||
|
* Replace jquery-datetimepicker with native date input (#11684)
|
||||||
|
* Change Style of Tags on Comments (#11668)
|
||||||
|
* Fix missing styling for shabox on PR commit history (#11625)
|
||||||
|
* Apply padding to approval icons on PR list (#11622)
|
||||||
|
* Fix message wrapping on PR commit list (#11616)
|
||||||
|
* Right-align status icon on pull request commit history (#11594)
|
||||||
|
* Add missing padding for multi-commit list on PR view (#11593)
|
||||||
|
* Do not show avatar for "{{user}} added X commits" (#11591)
|
||||||
|
* Fix styling and padding for commit list on PR view (#11588)
|
||||||
|
* Style code review comment for arc-green (#11572)
|
||||||
|
* Use default commit message for wiki edits (#11550)
|
||||||
|
* Add internal-repo octicon for public repos of private org (#11529)
|
||||||
|
* Fix dropzone color on arc-green (#11514)
|
||||||
|
* Insert ui divider directly in templates instead of from inside heatmap vue component (#11508)
|
||||||
|
* Move tributejs to npm/webpack (#11497)
|
||||||
|
* Fix text-transform on wiki revisions page (#11486)
|
||||||
|
* Do not show lock icon on repo list for public repos in private org (#11445)
|
||||||
|
* Include LFS when calculating repo size (#11060)
|
||||||
|
* Add check for LDAP group membership (#10869)
|
||||||
|
* When starting new stopwatch stop previous if it is still running (#10533)
|
||||||
|
* Add queue for code indexer (#10332)
|
||||||
|
* Move all push update operations to a queue (#10133)
|
||||||
|
* Cache last commit when pushing for big repository (#10109)
|
||||||
|
* Change/remove a branch of an open issue (#9080)
|
||||||
|
* Sortable Tables Header By Click (#7980)
|
||||||
|
* TESTING
|
||||||
|
* Use community codecov drone plugin (#12468)
|
||||||
|
* Add more tests for diff highlighting (#12467)
|
||||||
|
* Don't put integration test data outside of test folder (#11746)
|
||||||
|
* Add debug option to hooks (#11624)
|
||||||
|
* Log slow tests (#11487)
|
||||||
|
* TRANSLATION
|
||||||
|
* Translate two small lables on commit statuse list (#12821)
|
||||||
|
* Make issues.force_push_codes message shorter (#11575)
|
||||||
|
* BUILD
|
||||||
|
* Bump min required golang to 1.13 (#12717)
|
||||||
|
* Add 'make watch' (#12636)
|
||||||
|
* Extract Swagger CSS to its own file (#12616)
|
||||||
|
* Update eslint config (#12609)
|
||||||
|
* Avoid unnecessary system-ui expansion (#12522)
|
||||||
|
* Make the default PID file compile-time settable (#12485)
|
||||||
|
* Add 'watch-backend' (#12330)
|
||||||
|
* Detect version of sed in Makefile (#12319)
|
||||||
|
* Update gitea-vet to v0.2.1 (#12282)
|
||||||
|
* Add logic to build stable and edge builds for gitea snap (#12052)
|
||||||
|
* Fix missing CGO_EXTRA_FLAGS build arg for docker (#11782)
|
||||||
|
* Alpine 3.12 (#11720)
|
||||||
|
* Enable stylelint's shorthand-property-no-redundant-values (#11436)
|
||||||
|
* DOCS
|
||||||
|
* Change default log configuration (#13088)
|
||||||
|
* Add automatic JS license generation (#11810)
|
||||||
|
* Remove page size limit comment from swagger (#11806)
|
||||||
|
* Narrow down Edge version in browser support docs (#11640)
|
||||||
|
|
||||||
|
## [1.12.5](https://github.com/go-gitea/gitea/releases/tag/v1.12.5) - 2020-10-01
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Allow U2F with default settings for gitea in subpath (#12990) (#13001)
|
||||||
|
* Prevent empty div when editing comment (#12404) (#12991)
|
||||||
|
* On mirror update also update address in DB (#12964) (#12967)
|
||||||
|
* Allow extended config on cron settings (#12939) (#12943)
|
||||||
|
* Open transaction when adding Avatar email-hash pairs to the DB (#12577) (#12940)
|
||||||
|
* Fix internal server error from ListUserOrgs API (#12910) (#12915)
|
||||||
|
* Update only the repository columns that need updating (#12900) (#12912)
|
||||||
|
* Fix panic when adding long comment (#12892) (#12894)
|
||||||
|
* Add size limit for content of comment on action ui (#12881) (#12890)
|
||||||
|
* Convert User expose ID each time (#12855) (#12883)
|
||||||
|
* Support slashes in release tags (#12864) (#12882)
|
||||||
|
* Add missing information to CreateRepo API endpoint (#12848) (#12867)
|
||||||
|
* On Migration respect old DefaultBranch (#12843) (#12858)
|
||||||
|
* Fix notifications page links (#12838) (#12853)
|
||||||
|
* Stop cloning unnecessarily on PR update (#12839) (#12852)
|
||||||
|
* Escape more things that are passed through str2html (#12622) (#12850)
|
||||||
|
* Remove double escape on labels addition in comments (#12809) (#12810)
|
||||||
|
* Fix "only mail on mention" bug (#12775) (#12789)
|
||||||
|
* Fix yet another bug with diff file names (#12771) (#12776)
|
||||||
|
* RepoInit Respect AlternateDefaultBranch (#12746) (#12751)
|
||||||
|
* Fix Avatar Resize (resize algo NearestNeighbor -> Bilinear) (#12745) (#12750)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* gitea dump: include version & Check InstallLock (#12760) (#12762)
|
||||||
|
|
||||||
|
## [1.12.4](https://github.com/go-gitea/gitea/releases/tag/v1.12.4) - 2020-09-02
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Escape provider name in oauth2 provider redirect (#12648) (#12650)
|
||||||
|
* Escape Email on password reset page (#12610) (#12612)
|
||||||
|
* When reading expired sessions - expire them (#12686) (#12690)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* StaticRootPath configurable at compile time (#12371) (#12652)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix to show an issue that is related to a deleted issue (#12651) (#12692)
|
||||||
|
* Expire time acknowledged for cache (#12605) (#12611)
|
||||||
|
* Fix diff path unquoting (#12554) (#12575)
|
||||||
|
* Improve HTML escaping helper (#12562)
|
||||||
|
* models: break out of loop (#12386) (#12561)
|
||||||
|
* Default empty merger list to those with write permissions (#12535) (#12560)
|
||||||
|
* Skip SSPI authentication attempts for /api/internal (#12556) (#12559)
|
||||||
|
* Prevent NPE on commenting on lines with invalidated comments (#12549) (#12550)
|
||||||
|
* Remove hardcoded ES indexername (#12521) (#12526)
|
||||||
|
* Fix bug preventing transfer to private organization (#12497) (#12501)
|
||||||
|
* Keys should not verify revoked email addresses (#12486) (#12495)
|
||||||
|
* Do not add prefix on http/https submodule links (#12477) (#12479)
|
||||||
|
* Fix ignored login on compare (#12476) (#12478)
|
||||||
|
* Fix incorrect error logging in Stats indexer and OAuth2 (#12387) (#12422)
|
||||||
|
* Upgrade google/go-github to v32.1.0 (#12361) (#12390)
|
||||||
|
* Render emoji's of Commit message on feed-page (#12373)
|
||||||
|
* Fix handling of diff on unrelated branches when Git 2.28 used (#12370)
|
||||||
|
|
||||||
|
## [1.12.3](https://github.com/go-gitea/gitea/releases/tag/v1.12.3) - 2020-07-28
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Don't change creation date when updating Release (#12343) (#12351)
|
||||||
|
* Show 404 page when release not found (#12328) (#12332)
|
||||||
|
* Fix emoji detection in certain cases (#12320) (#12327)
|
||||||
|
* Reduce emoji size (#12317) (#12327)
|
||||||
|
* Fix double-indirection bug in logging IDs (#12294) (#12308)
|
||||||
|
* Link to pull list page on sidebar when view pr (#12256) (#12263)
|
||||||
|
* Extend Notifications API and return pinned notifications by default (#12164) (#12232)
|
||||||
|
|
||||||
|
## [1.12.2](https://github.com/go-gitea/gitea/releases/tag/v1.12.2) - 2020-07-11
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* When deleting repository decrese user repository count in cache (#11954) (#12188)
|
||||||
|
* Return full commit message instead of summary in commits API (#12186) (#12187)
|
||||||
|
* Properly set HEAD when a repo is created with a default branch that is not named 'master' (#12135) (#12182)
|
||||||
|
* Ensure GPG Subkeys are verified (#12155) (#12168)
|
||||||
|
* Fix failing to cache last commit with key being to long (#12151) (#12161)
|
||||||
|
* Multiple small admin dashboard fixes (#12153) (#12156)
|
||||||
|
* Remove spurious logging of " Delete all repository archives" at startup (#12139) (#12148)
|
||||||
|
* Fix repository setup instructions when default branch is not named 'master' (#12122) (#12147)
|
||||||
|
* Move EventSource to SharedWorker (#12095) (#12130)
|
||||||
|
* Fix ui bug in wiki commit page (#12089) (#12125)
|
||||||
|
* Fix gitgraph branch continues after merge (#12044) (#12105)
|
||||||
|
* Set the base url when migrating from Gitlab using access token or username without password (#11852) (#12104)
|
||||||
|
* Ensure BlameReaders close at end of request (#12102) (#12103)
|
||||||
|
* Fix panic when adding review comment (#12058)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Disable dropzone's timeout for file uploads (#12024) (#12032)
|
||||||
|
|
||||||
|
## [1.12.1](https://github.com/go-gitea/gitea/releases/tag/v1.12.1) - 2020-06-21
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Handle multiple merges in gitgraph.js (#11996) (#12000)
|
||||||
|
* Add serviceworker.js to KnownPublicEntries (#11992) (#11994)
|
||||||
|
* For language detection do not try to analyze big files by content (#11971) (#11975)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Fix scrollable header on dropdowns (#11893) (#11965)
|
||||||
|
|
||||||
|
## [1.11.8](https://github.com/go-gitea/gitea/releases/tag/v1.11.8) - 2020-06-21
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Really fix __webpack_public_path__ for 1.11 (#11961)
|
||||||
|
|
||||||
|
## [1.12.0](https://github.com/go-gitea/gitea/releases/tag/v1.12.0) - 2020-06-17
|
||||||
|
|
||||||
|
* BREAKING
|
||||||
|
* When using API CreateRelease set created_unix to the tag commit time (#11218)
|
||||||
|
* Enable ENABLE_HARD_LINE_BREAK by default for rendering markdown (#11162)
|
||||||
|
* Fix sanitizer config - multiple rules (#11133)
|
||||||
|
* Remove check on username when using AccessToken authentication for the API (#11015)
|
||||||
|
* Return 404 from Contents API when items don't exist (#10323)
|
||||||
|
* Notification API should always return a JSON object with the current count of notifications (#10059)
|
||||||
|
* Remove migration support from versions earlier than 1.6.0 (#10026)
|
||||||
|
* SECURITY
|
||||||
|
* Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) (#11662)
|
||||||
|
* FEATURES
|
||||||
|
* Improve config logging when WrappedQueue times out (#11174)
|
||||||
|
* Add branch delete to API (#11112)
|
||||||
|
* Use markdown frontmatter to provide Table of contents, language and frontmatter rendering (#11047)
|
||||||
|
* Add a way to mark Conversation (code comment) resolved (#11037)
|
||||||
|
* Handle yaml frontmatter in markdown (#11016)
|
||||||
|
* Cache PullRequest Divergence (#10914)
|
||||||
|
* Make `gitea admin auth list` formatting configurable (#10844)
|
||||||
|
* Add Matrix webhook (#10831)
|
||||||
|
* Add Organization Wide Labels (#10814)
|
||||||
|
* Allow to set protected file patterns for files that can not be changed under no conditions (#10806)
|
||||||
|
* Option to set default branch at repository creation (#10803)
|
||||||
|
* Add request review from specific reviewers feature in pull request (#10756)
|
||||||
|
* Add NextCloud oauth (#10562)
|
||||||
|
* System-wide webhooks (#10546)
|
||||||
|
* Relax sanitization as per https://github.com/jch/html-pipeline (#10527)
|
||||||
|
* Use media links for img in post-process (#10515)
|
||||||
|
* Add API endpoints to manage OAuth2 Application (list/create/delete) (#10437)
|
||||||
|
* Render READMEs in docs/ .gitea or .github from root (#10361)
|
||||||
|
* Add feishu webhook support (#10229)
|
||||||
|
* Cache last commit to accelerate the repository directory page visit (#10069)
|
||||||
|
* Implement basic app.ini and path checks to doctor cmd (#10064)
|
||||||
|
* Make WorkerPools and Queues flushable (#10001)
|
||||||
|
* Implement "embedded" command to extract static resources (#9982)
|
||||||
|
* Add API endpoint for repo transfer (#9947)
|
||||||
|
* Make archive prefixing configurable with a global setting (#9943)
|
||||||
|
* Add Unique Queue infrastructure and move TestPullRequests to this (#9856)
|
||||||
|
* Issue/PR Context Popups (#9822)
|
||||||
|
* Add "Update Branch" button to Pull Requests (#9784)
|
||||||
|
* Add require signed commit for protected branch (#9708)
|
||||||
|
* Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532)
|
||||||
|
* Add API notification endpoints (#9488)
|
||||||
|
* Issue search support elasticsearch (#9428)
|
||||||
|
* Add API branch protection endpoint (#9311)
|
||||||
|
* Add a new command doctor to check if some wrong configurations on gitea instance (#9095)
|
||||||
|
* Add support for migrating from Gitlab (#9084)
|
||||||
|
* Add support for database schema in PostgreSQL (#8819)
|
||||||
|
* Add setting to set default and global disabled repository units. (#8788)
|
||||||
|
* Language statistics bar for repositories (#8037)
|
||||||
|
* Restricted users (#6274)
|
||||||
|
* BUGFIXES
|
||||||
|
* Fix commenting on non-utf8 encoded files (#11916) (#11950)
|
||||||
|
* Use google/uuid to instead satori/go.uuid (#11943) (#11946)
|
||||||
|
* Align show/hide outdated button on code review block (#11932) (#11944)
|
||||||
|
* Update to go-git v5.1.0 (#11936) (#11941)
|
||||||
|
* Use ID or Where to instead directly use Get when load object from database (#11925) (#11934)
|
||||||
|
* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) (#11915)
|
||||||
|
* Invalidate comments when file is shortened (#11882) (#11884)
|
||||||
|
* Rework api/user/repos for pagination (#11827) (#11877)
|
||||||
|
* Handle more pathological branch and tag names (#11843) (#11863)
|
||||||
|
* Add doctor check to set IsArchived false if it is null (partial #11853) (#11859)
|
||||||
|
* Prevent panic on empty HOST for mysql (#11850) (#11856)
|
||||||
|
* Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)
|
||||||
|
* Fix reply octicon (#11821) (#11822)
|
||||||
|
* Honor DEFAULT_PAGING_NUM for API (#11805) (#11813)
|
||||||
|
* Ensure rejected push to refs/pull/index/head fails nicely (#11724) (#11809)
|
||||||
|
* In File Create/Update API return 404 if Branch does not exist (#11791) (#11795)
|
||||||
|
* Fix doer of rename repo (#11789) (#11794)
|
||||||
|
* Initialize SimpleMDE when making a code comment (#11749) (#11785)
|
||||||
|
* Fix timezone on issue deadline (#11697) (#11784)
|
||||||
|
* Fix to allow comment poster to edit or delete his own comments (#11671) (#11774)
|
||||||
|
* Show full 500 error in API when Gitea in dev mode (#11641) (#11753)
|
||||||
|
* Add missing templates for Matrix system webhooks (#11729) (#11748)
|
||||||
|
* Fix verification of subkeys of default gpg key (#11713) (#11747)
|
||||||
|
* Fix styling for commiter on diff view (#11715) (#11744)
|
||||||
|
* Properly truncate system notices (#11714) (#11742)
|
||||||
|
* Handle expected errors in FileCreate & FileUpdate API (#11643) (#11718)
|
||||||
|
* Fix missing authorization check on pull for public repos of private/limited org (#11656) (#11682)
|
||||||
|
* Doctor check & fix db consistency (#11111) (#11676)
|
||||||
|
* Exclude generated files from language statistics (#11653) (#11670)
|
||||||
|
* Return json on 500 error from API (#11574) (#11659)
|
||||||
|
* When must change password only show Signout (#11600) (#11637)
|
||||||
|
* Backport various styling fixes (#11619)
|
||||||
|
* Fix wrong milestone in webhook message (#11596) (#11611)
|
||||||
|
* Fix serviceworker output file and misc improvements (#11562) (#11610)
|
||||||
|
* When initialising repositories ensure that the user doing the creation is the initializer (#11601) (#11608)
|
||||||
|
* Prevent empty query parameter being set on dashboard (#11561) (#11604)
|
||||||
|
* Fix images in wiki edit preview (#11546) (#11602)
|
||||||
|
* Prevent (caught) panic on login (#11590) (#11597)
|
||||||
|
* Prevent transferring repos to invisible orgs (#11517) (#11549)
|
||||||
|
* Move serviceworker to workbox and fix SSE interference (#11538) (#11547)
|
||||||
|
* API PullReviewComment HTMLPullURL should return the HTMLURL (#11501) (#11533)
|
||||||
|
* Fix repo-list private and total count bugs (#11500) (#11532)
|
||||||
|
* Fix form action template substitutions on admin pages (backport #11519) (#11531)
|
||||||
|
* Fix a bug where the reaction emoji doesn't disappear. (#11489) (#11530)
|
||||||
|
* TrimSpace when reading InternalToken from a file (#11502) (#11524)
|
||||||
|
* Fix selected line color in arc-green (#11492) (#11520)
|
||||||
|
* Make localstorage read ssh or https correctly (#11483) (#11490)
|
||||||
|
* Check branch protection on IsUserAllowedToUpdate (#11448)
|
||||||
|
* Fix margin on attached segment headers when they are separated by other element (#11425)
|
||||||
|
* Fix webhook template when validation errors occur (#11421)
|
||||||
|
* Fix NPE in template due to missing signing key on commit page (#11392)
|
||||||
|
* Restore active background to Register button on Register page (#11390)
|
||||||
|
* Fix hook failure due to relative LFS_CONTENT_PATH (#11362)
|
||||||
|
* Correctly set the organization num repos (#11339)
|
||||||
|
* Prevent 500 with badly formed task list (#11328)
|
||||||
|
* Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327)
|
||||||
|
* Handle panics that percolate up to the graceful module (#11291)
|
||||||
|
* Don't allow registration via the web form, when AllowOnlyExternalRegistration is True (#11248)
|
||||||
|
* Patch fomantic-ui to workaround build issue (#11244)
|
||||||
|
* Prevent panic during wrappedConn close at hammertime (#11219)
|
||||||
|
* On logout force redirect to start page (#11202)
|
||||||
|
* Fix creation of Organization repos by Users with max created personal repos (#11183)
|
||||||
|
* Add option to increase provided OAuth2 token maximum size (#11180)
|
||||||
|
* Log the indexer path on failure (#11172)
|
||||||
|
* Ensure that relative paths in edit preview work (#11143)
|
||||||
|
* Make API EditIssue and EditPullRequest issue notifications (#11123)
|
||||||
|
* Send 404 immediately for known public requests (#11117)
|
||||||
|
* Remove nil inserts in models (#11096)
|
||||||
|
* Add GetReviews() to RetryDownloader (#11093)
|
||||||
|
* Remove nonexistent serviceworker entries (#11091)
|
||||||
|
* Simplify and fix GetApprovalCounts (#11086)
|
||||||
|
* Fix wiki revision template and simplify some tmpl conditions (#11080)
|
||||||
|
* Make branch parameter optional for /api/v1/repos/{owner}/{repo}/contents/{filepath} (#11067)
|
||||||
|
* Align review-item svg octicons (#11065)
|
||||||
|
* Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997)
|
||||||
|
* Users should not be able to prohibit their own login (#10970)
|
||||||
|
* Fix scrollbar issues in dropdowns (#10897)
|
||||||
|
* Change the order of issues.closed_by to list opening user first (#10876)
|
||||||
|
* Allow site admin to check /api/v1/orgs endpoints (#10867)
|
||||||
|
* Avoid logging []byte in queue failures - convert to string first (#10865)
|
||||||
|
* Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863)
|
||||||
|
* Fix assignees double load bug (#10856)
|
||||||
|
* Handle push rejection in branch and upload (#10854)
|
||||||
|
* In authorized_keys use double-quote for windows compatibility (#10841)
|
||||||
|
* Fix milestone template (#10824)
|
||||||
|
* log.Fatal on failure to listen to SSH port (#10795)
|
||||||
|
* Fix forked repo has no icon and language stat. (#10791)
|
||||||
|
* Fix tag/release deletion (#10663)
|
||||||
|
* Fix webhook migration (#10641)
|
||||||
|
* Migration for deleting orphaned dependencies (#10617)
|
||||||
|
* Add migration to fix the old broken merge-bases (#10604)
|
||||||
|
* Update templates for Go 1.14 (#10596)
|
||||||
|
* Remove unnecessary parentheses in wiki/view template (#10583)
|
||||||
|
* Change default value of DefaultCommandExecutionTimeout to match docs (#10581)
|
||||||
|
* Handle panic in indexer initialisation better (#10534)
|
||||||
|
* Set correct content_type value for Gogs/Gitea webhooks (#9504) (#10456)
|
||||||
|
* Fixed wrong AppSubUrl in multiple templates (#10447)
|
||||||
|
* Fix profile page CSS (#10406)
|
||||||
|
* Inject SVG sprite via ajax (#10320)
|
||||||
|
* Fix migration information update bug when linked github account (#10310)
|
||||||
|
* Allow admin to check org membership by API for other users (#10201)
|
||||||
|
* Fix topics dropdown (#10167)
|
||||||
|
* Ensure DeleteUser is not allowed to Delete Orgs and visa versa (#10134)
|
||||||
|
* Fix IsErrPullClosed (#10093)
|
||||||
|
* Accept punctuation after simple+cross repository issue references (#10091)
|
||||||
|
* On merge of already closed PR redirect back to the pulls page (#10010)
|
||||||
|
* Fix crowdin update script (#9969)
|
||||||
|
* Fix pull view when head repository or head branch missed and close related pull requests when delete head repository or head branch (#9927)
|
||||||
|
* Add option to prevent LDAP from deactivating everything on empty search (#9879)
|
||||||
|
* Fix admin handling at merge of PR (#9749)
|
||||||
|
* err_admin_name_pattern_not_allowed String Clarification (#9731)
|
||||||
|
* Fix wrong original git service type on a migrated repository (#9693)
|
||||||
|
* Fix ref links in issue overviews for tags (#8742)
|
||||||
|
* ENHANCEMENTS
|
||||||
|
* Fix search form button overlap (#11840) (#11864)
|
||||||
|
* Make tabular menu styling consistent for arc-green (#11570) (#11798)
|
||||||
|
* Add option to API to update PullRequest base branch (#11666) (#11796)
|
||||||
|
* Increase maximum SQLite variables count to 32766 (#11696) (#11783)
|
||||||
|
* Update emoji dataset with skin tone variants (#11678) (#11763)
|
||||||
|
* Add logging to long migrations (#11647) (#11691)
|
||||||
|
* Change language statistics to save size instead of percentage (#11681) (#11690)
|
||||||
|
* Allow different HardBreaks settings for documents and comments (#11515) (#11599)
|
||||||
|
* Fix alignment for commits on dashboard (#11595) (#11680)
|
||||||
|
* Default MSSQL port 0 to allow automatic detection by default (#11642) (#11673)
|
||||||
|
* Handle expected errors in AddGPGkey API (#11644) (#11661)
|
||||||
|
* Close EventSource before unloading the page (#11539) (#11557)
|
||||||
|
* Ensure emoji render with regular font-weight (#11541) (#11545)
|
||||||
|
* Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11542)
|
||||||
|
* Tweak reaction buttons (#11516)
|
||||||
|
* Use more toned colors for selected line (#11493) (#11511)
|
||||||
|
* Increase width for authors on commit view (#11441)
|
||||||
|
* Hide archived repos by default in repo-list (#11440)
|
||||||
|
* Better styling for code review comment textarea (#11428)
|
||||||
|
* Support view individual commit for wiki pages (#11415)
|
||||||
|
* Fix yellow background on active elements in code review (#11414)
|
||||||
|
* Better styling for code review comment form (#11413)
|
||||||
|
* Change install description on homepage (#11395)
|
||||||
|
* Ensure search action button is coalesced to adjacent input (#11385)
|
||||||
|
* Switch code editor to Monaco (#11366)
|
||||||
|
* Add paging and archive/private repository filtering to dashboard list (#11321)
|
||||||
|
* Changed image of openid-connect logo for better look on arc-green theme (#11312)
|
||||||
|
* Load Repo Topics on blame view too (#11307)
|
||||||
|
* Change the style in admin notice content view from `<p>` to `<pre>` (#11301)
|
||||||
|
* Allow log.xxx.default to set logging settings for the default logger only (#11292)
|
||||||
|
* Automatically attempt auto recovery of broken disk queues (Update lunny/levelqueue to 0.3.0) (#11285)
|
||||||
|
* Make sendmail a Process and have default timeout (#11256)
|
||||||
|
* Check value of skip-repository flag in dump command (#11254)
|
||||||
|
* Fix submit review form (#11252)
|
||||||
|
* Allow unauthenticated users to compare (#11240)
|
||||||
|
* Add EventSource support (#11235)
|
||||||
|
* Refactor Milestone related (#11225)
|
||||||
|
* Add pull review API endpoints (#11224)
|
||||||
|
* Add a 'this' to issue close/reopened messages (#11204)
|
||||||
|
* When migrating from Gitlab map Approvals to approving Reviews (#11147)
|
||||||
|
* Improve representation of attachments in issues (#11141)
|
||||||
|
* Protect default branch against deletion (#11115)
|
||||||
|
* Add X-Total-Count on /repos/{owner]/{repo}/pulls API endpoint (#11113)
|
||||||
|
* Fix status label on branches list vertical alignment (#11109)
|
||||||
|
* Add single release page and latest redirect (#11102)
|
||||||
|
* Add missing commit states to PR checks template (#11085)
|
||||||
|
* Change icon on title for merged PR to git-merge (#11064)
|
||||||
|
* Add MergePull comment type instead of close for merge PR (#11058)
|
||||||
|
* Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055)
|
||||||
|
* Consolidate author name across timeline (#11053)
|
||||||
|
* Refactor UpdateOAuth2Application (#11034)
|
||||||
|
* Support unicode emojis and remove emojify.js (#11032)
|
||||||
|
* Add git hook "warning" to admin panel (#11030)
|
||||||
|
* Add flash notify for email preference setting success (#11027)
|
||||||
|
* Remove package code.gitea.io/gitea/modules/git import out of models (#11025)
|
||||||
|
* Match arc-green code tag color to code blocks (#11023)
|
||||||
|
* Move syntax highlighting to web worker (#11017)
|
||||||
|
* Prevent merge of outdated PRs on protected branches (#11012)
|
||||||
|
* Add Get/Update for api/v1/user/applications/oauth2 (#11008)
|
||||||
|
* Upgrade to most recent bluemonday (#11007)
|
||||||
|
* Tweak code tags in markdown (#11000)
|
||||||
|
* Reject duplicate AccessToken names (#10994)
|
||||||
|
* Fix Ctrl-Enter shortcut for issues (#10986)
|
||||||
|
* Provide `OwnerName` field for README template (#10981)
|
||||||
|
* Prettify Timeline (#10972)
|
||||||
|
* Add issue subscription check to API (#10967)
|
||||||
|
* Use AJAX for notifications table (#10961)
|
||||||
|
* Adjust label padding (#10957)
|
||||||
|
* Avoiding directory execution on hook (#10954) (#10955)
|
||||||
|
* Migrate ActivityHeatmap to Vue SFC (#10953)
|
||||||
|
* Change merge strategy: do not check write access if user in merge white list (#10951)
|
||||||
|
* Enable GO111MODULE=on globally in Makefile (#10939)
|
||||||
|
* API endpoint to get single commit via SHA and Ref (#10915)
|
||||||
|
* Add accordion to release list and hide non-latest (#10910)
|
||||||
|
* Split dashboard elements into separate template files (#10885)
|
||||||
|
* Add more message on sidebar menus (#10872)
|
||||||
|
* Set MySQL rowtype to dynamic for new tables (#10833)
|
||||||
|
* Completely fix task-list checkbox styling (#10798)
|
||||||
|
* Hide gear icon for user who can't use them on sidebar (#10750)
|
||||||
|
* Refactor Cron and merge dashboard tasks (#10745)
|
||||||
|
* Change review status icons on pr view style to github style (#10737)
|
||||||
|
* Make pagination optional for API list notification endpoints (#10714)
|
||||||
|
* Fix tab indentation in code view (#10671)
|
||||||
|
* Fix task-list checkbox styling (#10668)
|
||||||
|
* Multiple LFS improvements (#10667)
|
||||||
|
* Make PR message on pushes configurable (#10664)
|
||||||
|
* Move dropzone.js to npm/webpack (#10645)
|
||||||
|
* Ensure Update button is enabled even when CI has failed (#10640)
|
||||||
|
* Add restricted user filter to LDAP authentication (#10600)
|
||||||
|
* Add Yandex OAuth2 provider (#8335) (#10564)
|
||||||
|
* Make avatar lookup occur at image request (#10540)
|
||||||
|
* Prevent accidential selection of language stats bar (#10537)
|
||||||
|
* Add fluid-icon (#10491)
|
||||||
|
* Inform participants on UI too (#10473)
|
||||||
|
* Build with go 1.14 (and raise minimum go version to 1.12) (#10467)
|
||||||
|
* Add max-file-size to LFS (#10463)
|
||||||
|
* Enable paggination for ListRepoTags API (#10454)
|
||||||
|
* Update JS dependencies (#10450)
|
||||||
|
* Show the username as a fallback on feeds if full name is blank (#10438)
|
||||||
|
* Various dark theme fixes (#10416)
|
||||||
|
* Display pull request head branch even the branch deleted or repository deleted (#10413)
|
||||||
|
* Prevent Firefox from using apple-touch-icon (#10402)
|
||||||
|
* Fix input[type=file] on dark theme (#10382)
|
||||||
|
* Improve mobile review-box sizing (#10297)
|
||||||
|
* Notification: queue ui.go notification-service (#10281)
|
||||||
|
* Add detected file language to code search (#10256)
|
||||||
|
* Index code and stats only for non-empty repositories (#10251)
|
||||||
|
* Add Approval Counts to pulls list (#10238)
|
||||||
|
* Limit label list height on edit issue page (#10216)
|
||||||
|
* Improve 404 error message (#10214)
|
||||||
|
* Tweak locale to respect singular conflicting file message in PR list (#10177)
|
||||||
|
* Fix commit view (#10169)
|
||||||
|
* Reorganize frontend files and tooling (#10168)
|
||||||
|
* Allow emoji on popup label (#10166)
|
||||||
|
* ListIssues add filter for milestones API (#10148)
|
||||||
|
* Show if a PR has conflicting files on the PR lists (#10130)
|
||||||
|
* Fix inconsistent label color format in API (#10129)
|
||||||
|
* Show download count info in release list (#10124)
|
||||||
|
* Add Octicon SVG spritemap (#10107)
|
||||||
|
* Update aria-fixed semantic-dropdown to fomantic master (#10096)
|
||||||
|
* Fix apple-touch-icon, regenerate images (#10065)(#10006)
|
||||||
|
* Style blockquote for default issue mail template (#10024)
|
||||||
|
* More expansions in template repositories (#10021)
|
||||||
|
* Allow list collaborators for users with Read access to repo (#9995)
|
||||||
|
* Add explicit dimensions to navbar avatar (#9986)
|
||||||
|
* Remove loadCSS and preload woff2 icon fonts (#9976)
|
||||||
|
* Fix commit view JS features, reimplement folding (#9968)
|
||||||
|
* Fix review avatar image (#9962)
|
||||||
|
* Improve notification pager (#9821)
|
||||||
|
* Move jquery and jquery-migrate to npm/webpack (#9813)
|
||||||
|
* Change font to Roboto to support more charsets (#9803)
|
||||||
|
* Move mailer to use a queue (#9789)
|
||||||
|
* Issue search on my related repositories (#9758)
|
||||||
|
* Add "before" query to ListIssueComments and ListRepoIssueComments API (#9685)
|
||||||
|
* Move tracked time api convert to convert package (#9665)
|
||||||
|
* Improve PR info in default merge message (#9635)
|
||||||
|
* Granular webhook events (#9626)
|
||||||
|
* Add Reviewed-on in commit message (#9623)
|
||||||
|
* Add top author stats to activity page (#9615)
|
||||||
|
* Allow repo admin to merge PR regardless of review status (#9611)
|
||||||
|
* Migrate reactions when migrating repository from github (#9599)
|
||||||
|
* API orgEditTeam make Fields optional (#9556)
|
||||||
|
* Move create/fork repository from models to modules/repository (#9489)
|
||||||
|
* Migrate reviews when migrating repository from github (#9463)
|
||||||
|
* Times API add filters (#9373)
|
||||||
|
* Move push commits from models to modules/repository (#9370)
|
||||||
|
* Add API endpoint to check notifications [Extend #9488] (#9595)
|
||||||
|
* Add GET /orgs API endpoint (#9560)
|
||||||
|
* API add/generalize pagination (#9452)
|
||||||
|
* Make create org repo API call same as github (#9186)
|
||||||
|
* BUILD
|
||||||
|
* Turn off go modules for xgo and gxz (#10963)
|
||||||
|
* Add gitea-vet (#10948)
|
||||||
|
* Rename scripts to build and add revive command as a new build tool command (#10942)
|
||||||
|
* Add 'make lint', restructure 'compliance' pipeline (#10861)
|
||||||
|
* Move JS build dependencies to 'dependencies' (#10763)
|
||||||
|
* Use whitelist to find go files, run find only once (#10594)
|
||||||
|
* Move vue and vue-calendar-heatmap to npm/webpack (#10188)
|
||||||
|
* Move jquery.are-you-sure to npm/webpack (#10063)
|
||||||
|
* Move highlight.js to npm/webpack (#10011)
|
||||||
|
* Generate Bindata if TAGS="bindata" and not up-to-date (#10004)
|
||||||
|
* Move CSS build to webpack (#9983)
|
||||||
|
* Move fomantic target, update 'make help' (#9945)
|
||||||
|
* Add css extraction and minification to webpack (#9944)
|
||||||
|
* Misc webpack tweaks (#9924)
|
||||||
|
* Make node_modules a order-only prerequisite (#9923)
|
||||||
|
* Update documentation for the go module era (#9751)
|
||||||
|
* Move swagger-ui to webpack/npm and update it to 3.24.3 (#9714)
|
||||||
|
* Use npm to manage fomantic and only build needed components (#9561)
|
||||||
|
* MISC
|
||||||
|
* Add gnupg to Dockerfile (#11365)
|
||||||
|
* Update snapcraft.yaml for core18 and latest features (#11300)
|
||||||
|
* Update JS dependencies, min Node.js version 10.13 (#11246)
|
||||||
|
* Change default charset for MySQL on install to utf8mb4 (#10989)
|
||||||
|
* Return issue subscription status from API subscribe (#10966)
|
||||||
|
* Fix queue log param (#10733)
|
||||||
|
* Add warning when using relative path to app.ini (#10104)
|
||||||
|
|
||||||
|
## [1.11.7](https://github.com/go-gitea/gitea/releases/tag/v1.11.7) - 2020-06-18
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Use ID or Where to instead directly use Get when load object from database (#11925) (#11935)
|
||||||
|
* Fix __webpack_public_path__ for 1.11 (#11907)
|
||||||
|
* Fix verification of subkeys of default gpg key (#11713) (#11902)
|
||||||
|
* Remove unnecessary parentheses in wiki/view template (#11781)
|
||||||
|
* Doctor fix xorm.Count nil on sqlite error (#11741)
|
||||||
|
|
||||||
|
## [1.11.6](https://github.com/go-gitea/gitea/releases/tag/v1.11.6) - 2020-05-30
|
||||||
|
|
||||||
|
* SECURITY
|
||||||
|
* Fix missing authorization check on pull for public repos of private/limited org (#11656) (#11683)
|
||||||
|
* Use session for retrieving org teams (#11438) (#11439)
|
||||||
|
* BUGFIXES
|
||||||
|
* Return json on 500 error from API (#11574) (#11660)
|
||||||
|
* Fix wrong milestone in webhook message (#11596) (#11612)
|
||||||
|
* Prevent (caught) panic on login (#11590) (#11598)
|
||||||
|
* Fix commit page js error (#11527)
|
||||||
|
* Use media links for img in post-process (#10515) (#11504)
|
||||||
|
* Ensure public repositories in private organizations are visible and fix admin organizations list (#11465) (#11475)
|
||||||
|
* Set correct Content-Type value for Gogs/Gitea webhooks (#9504) (#10456) (#11461)
|
||||||
|
* Allow all members of private orgs to see public repos (#11442) (#11459)
|
||||||
|
* Whenever the ctx.Session is updated, release it to save it before sending the redirect (#11456) (#11457)
|
||||||
|
* Forcibly clean and destroy the session on logout (#11447) (#11451)
|
||||||
|
* Fix /api/v1/orgs/* endpoints by changing parameter to :org from :orgname (#11381)
|
||||||
|
* Add tracked time fix to doctor (part of #11111) (#11138)
|
||||||
|
* Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11544)
|
||||||
|
* Remove unnecessary parentheses in wiki/revision.tmpl to allow 1.11 to build on go1.14 (#11481)
|
||||||
|
|
||||||
|
## [1.11.5](https://github.com/go-gitea/gitea/releases/tag/v1.11.5) - 2020-05-09
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Prevent timer leaks in Workerpool and others (#11333) (#11340)
|
||||||
|
* Fix tracked time issues (#11349) (#11354)
|
||||||
|
* Add NotifySyncPushCommits to indexer notifier (#11309) (#11338)
|
||||||
|
* Allow X in addition to x in tasks (#10979) (#11335)
|
||||||
|
* When delete tracked time through the API return 404 not 500 (#11319) (#11326)
|
||||||
|
* Prevent duplicate records in organizations list when creating a repository (#11303) (#11325)
|
||||||
|
* Manage port in submodule refurl (#11305) (#11323)
|
||||||
|
* api.Context.NotFound(...) should tolerate nil (#11288) (#11306)
|
||||||
|
* Show pull request selection even when unrelated branches (#11239) (#11283)
|
||||||
|
* Repo: milestone: make /milestone/:id endpoint accessible (#11264) (#11282)
|
||||||
|
* Fix GetContents(): Dont't ignore Executables (#11192) (#11209)
|
||||||
|
* Fix submodule paths when AppSubUrl is not root (#11098) (#11176)
|
||||||
|
* Prevent clones and pushes to disabled wiki (#11131) (#11134)
|
||||||
|
* Remove errant third closing curly-bracket from account.tmpl and send account ID in account.tmpl (#11130)
|
||||||
|
* On Repo Deletion: Delete related TrackedTimes too (#11110) (#11125)
|
||||||
|
* Refresh codemirror on show pull comment tab (#11100) (#11122)
|
||||||
|
* Fix merge dialog on protected branch with missing required statuses (#11074) (#11084)
|
||||||
|
* Load pr Issue Poster on API too (#11033) (#11039)
|
||||||
|
* Fix release counter on API repository info (#10968) (#10996)
|
||||||
|
* Generate Diff and Patch direct from Pull head (#10936) (#10938)
|
||||||
|
* Fix rebase conflict detection in git 2.26 (#10929) (#10930)
|
||||||
|
* ENHANCEMENT
|
||||||
|
* Fix 404 and 500 image size in small size screen (#11043) (#11049)
|
||||||
|
* Multiple Gitea Doctor improvements (#10943) (#10990) (#10064) (#9095) (#10991)
|
||||||
|
|
||||||
|
## [1.11.4](https://github.com/go-gitea/gitea/releases/tag/v1.11.4) - 2020-04-01
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Only update merge_base if not already merged (#10909)
|
||||||
|
* Fix milestones too many SQL variables bug (#10880) (#10904)
|
||||||
|
* Protect against NPEs in notifications list (#10879) (#10883)
|
||||||
|
* Convert plumbing.ErrObjectNotFound to git.ErrNotExist in getCommit (#10862) (#10868)
|
||||||
|
* Convert plumbing.ErrReferenceNotFound to git.ErrNotExist in GetRefCommitID (#10676) (#10797)
|
||||||
|
* Account for empty lines in receive-hook message (#10773) (#10784)
|
||||||
|
* Fix bug on branch API (#10767) (#10775)
|
||||||
|
* Migrate to go-git/go-git v5.0.0 (#10735) (#10753)
|
||||||
|
* Fix hiding of fields in authorization source page (#10734) (#10752)
|
||||||
|
* Prevent default for linkAction (#10742) (#10743)
|
||||||
|
|
||||||
|
## [1.11.3](https://github.com/go-gitea/gitea/releases/tag/v1.11.3) - 2020-03-10
|
||||||
|
|
||||||
|
* BUGFIXES
|
||||||
|
* Prevent panic in stopwatch (#10670) (#10673)
|
||||||
|
* Fix bug on pull view when required status check no ci result (#10648) (#10651)
|
||||||
|
* Build explicitly with Go 1.13 (#10684)
|
||||||
|
|
||||||
## [1.11.2](https://github.com/go-gitea/gitea/releases/tag/v1.11.2) - 2020-03-06
|
## [1.11.2](https://github.com/go-gitea/gitea/releases/tag/v1.11.2) - 2020-03-06
|
||||||
|
|
||||||
* BREAKING
|
* BREAKING
|
||||||
@@ -512,6 +1325,12 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
|||||||
* Update CodeMirror to version 5.49.0 (#8381)
|
* Update CodeMirror to version 5.49.0 (#8381)
|
||||||
* Wiki editor: enable side-by-side button (#7242)
|
* Wiki editor: enable side-by-side button (#7242)
|
||||||
|
|
||||||
|
## [1.10.6](https://github.com/go-gitea/gitea/releases/tag/v1.10.6) - 2020-03-10
|
||||||
|
|
||||||
|
This is a re-tag version of v1.10.5 and also explicitly built with Go 1.13.
|
||||||
|
|
||||||
|
WARNING: v1.10.5 is incorrectly tagged targeting 1.12-dev and should **not** be used.
|
||||||
|
|
||||||
## [1.10.5](https://github.com/go-gitea/gitea/releases/tag/v1.10.5) - 2020-03-06
|
## [1.10.5](https://github.com/go-gitea/gitea/releases/tag/v1.10.5) - 2020-03-06
|
||||||
|
|
||||||
* BUGFIXES
|
* BUGFIXES
|
||||||
|
|||||||
@@ -71,23 +71,21 @@ to make sure your changes don't cause regression elsewhere.
|
|||||||
|
|
||||||
Here's how to run the test suite:
|
Here's how to run the test suite:
|
||||||
|
|
||||||
- Install the correct version of the drone-cli package. As of this
|
- code lint
|
||||||
writing, the correct drone-cli version is
|
|
||||||
[1.2.0](https://docs.drone.io/cli/install/).
|
|
||||||
- Ensure you have enough free disk space. You will need at least
|
|
||||||
15-20 Gb of free disk space to hold all of the containers drone
|
|
||||||
creates (a default AWS or GCE disk size won't work -- see
|
|
||||||
[#6243](https://github.com/go-gitea/gitea/issues/6243)).
|
|
||||||
- Change into the base directory of your copy of the gitea repository,
|
|
||||||
and run `drone exec --event pull_request`.
|
|
||||||
- At the moment `drone exec` doesn't support the Docker Toolbox on Windows 10
|
|
||||||
(see [drone-cli#135](https://github.com/drone/drone-cli/issues/135))
|
|
||||||
|
|
||||||
The drone version, command line, and disk requirements do change over
|
| | |
|
||||||
time (see [#4053](https://github.com/go-gitea/gitea/issues/4053) and
|
| :-------------------- | :---------------------------------------------------------------- |
|
||||||
[#6243](https://github.com/go-gitea/gitea/issues/6243)); if you
|
|``make lint`` | lint everything (not suggest if you only change one type code) |
|
||||||
discover any issues, please feel free to send us a pull request to
|
|``make lint-frontend`` | lint frontend files |
|
||||||
update these instructions.
|
|``make lint-backend`` | lint backend files |
|
||||||
|
|
||||||
|
- run test code (Suggest run in linux)
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| :------------------------------------- | :----------------------------------------------- |
|
||||||
|
|``make test[\#TestSpecificName]`` | run unit test |
|
||||||
|
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for sqlite |
|
||||||
|
|[More detail message about integrations](integrations/README.md) |
|
||||||
|
|
||||||
## Vendoring
|
## Vendoring
|
||||||
|
|
||||||
@@ -295,25 +293,25 @@ and lead the development of Gitea.
|
|||||||
To honor the past owners, here's the history of the owners and the time
|
To honor the past owners, here's the history of the owners and the time
|
||||||
they served:
|
they served:
|
||||||
|
|
||||||
* 2016-11-04 ~ 2017-12-31
|
* 2020-01-01 ~ 2020-12-31 - https://github.com/go-gitea/gitea/issues/9230
|
||||||
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
* [Lunny Xiao](https://gitea.com/lunny) <xiaolunwen@gmail.com>
|
||||||
* [Thomas Boerger](https://github.com/tboerger) <thomas@webhippie.de>
|
* [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) <lauris@nix.lv>
|
||||||
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
* [Matti Ranta](https://gitea.com/techknowlogick) <techknowlogick@gitea.io>
|
||||||
|
|
||||||
* 2018-01-01 ~ 2018-12-31
|
* 2019-01-01 ~ 2019-12-31 - https://github.com/go-gitea/gitea/issues/5572
|
||||||
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
|
||||||
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
|
||||||
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
|
||||||
|
|
||||||
* 2019-01-01 ~ 2019-12-31
|
|
||||||
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
||||||
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
||||||
* [Matti Ranta](https://github.com/techknowlogick) <techknowlogick@gitea.io>
|
* [Matti Ranta](https://github.com/techknowlogick) <techknowlogick@gitea.io>
|
||||||
|
|
||||||
* 2020-01-01 ~ 2020-12-31
|
* 2018-01-01 ~ 2018-12-31 - https://github.com/go-gitea/gitea/issues/3255
|
||||||
* [Lunny Xiao](https://gitea.com/lunny) <xiaolunwen@gmail.com>
|
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
||||||
* [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) <lauris@nix.lv>
|
* [Lauris Bukšis-Haberkorns](https://github.com/lafriks) <lauris@nix.lv>
|
||||||
* [Matti Ranta](https://gitea.com/techknowlogick) <techknowlogick@gitea.io>
|
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
||||||
|
|
||||||
|
* 2016-11-04 ~ 2017-12-31
|
||||||
|
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
|
||||||
|
* [Thomas Boerger](https://github.com/tboerger) <thomas@webhippie.de>
|
||||||
|
* [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
|
||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
|
|
||||||
###################################
|
###################################
|
||||||
#Build stage
|
#Build stage
|
||||||
FROM golang:1.13-alpine3.11 AS build-env
|
FROM golang:1.15-alpine3.12 AS build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
ENV GOPROXY ${GOPROXY:-direct}
|
ENV GOPROXY ${GOPROXY:-direct}
|
||||||
|
|
||||||
ARG GITEA_VERSION
|
ARG GITEA_VERSION
|
||||||
ARG TAGS="sqlite sqlite_unlock_notify"
|
ARG TAGS="sqlite sqlite_unlock_notify"
|
||||||
ENV TAGS "bindata $TAGS"
|
ENV TAGS "bindata timetzdata $TAGS"
|
||||||
|
ARG CGO_EXTRA_CFLAGS
|
||||||
|
|
||||||
#Build deps
|
#Build deps
|
||||||
RUN apk --no-cache add build-base git nodejs npm
|
RUN apk --no-cache add build-base git nodejs npm
|
||||||
@@ -21,7 +22,7 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
|||||||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
||||||
&& make clean-all build
|
&& make clean-all build
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.12
|
||||||
LABEL maintainer="maintainers@gitea.io"
|
LABEL maintainer="maintainers@gitea.io"
|
||||||
|
|
||||||
EXPOSE 22 3000
|
EXPOSE 22 3000
|
||||||
@@ -37,7 +38,7 @@ RUN apk --no-cache add \
|
|||||||
s6 \
|
s6 \
|
||||||
sqlite \
|
sqlite \
|
||||||
su-exec \
|
su-exec \
|
||||||
tzdata
|
gnupg
|
||||||
|
|
||||||
RUN addgroup \
|
RUN addgroup \
|
||||||
-S -g 1000 \
|
-S -g 1000 \
|
||||||
|
|||||||
@@ -36,3 +36,4 @@ Mura Li <typeless@ctli.io> (@typeless)
|
|||||||
6543 <6543@obermui.de> (@6543)
|
6543 <6543@obermui.de> (@6543)
|
||||||
jaqra <jaqra@hotmail.com> (@jaqra)
|
jaqra <jaqra@hotmail.com> (@jaqra)
|
||||||
David Svantesson <davidsvantesson@gmail.com> (@davidsvantesson)
|
David Svantesson <davidsvantesson@gmail.com> (@davidsvantesson)
|
||||||
|
CirnoT <gitea.m@i32.pl> (@CirnoT)
|
||||||
|
|||||||
370
Makefile
370
Makefile
@@ -1,36 +1,62 @@
|
|||||||
|
|
||||||
|
ifeq ($(USE_REPO_TEST_DIR),1)
|
||||||
|
|
||||||
|
# This rule replaces the whole Makefile when we're trying to use /tmp repository temporary files
|
||||||
|
location = $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||||
|
self := $(location)
|
||||||
|
|
||||||
|
%:
|
||||||
|
@tmpdir=`mktemp --tmpdir -d` ; \
|
||||||
|
echo Using temporary directory $$tmpdir for test repositories ; \
|
||||||
|
USE_REPO_TEST_DIR= $(MAKE) -f $(self) --no-print-directory REPO_TEST_DIR=$$tmpdir/ $@ ; \
|
||||||
|
STATUS=$$? ; rm -r "$$tmpdir" ; exit $$STATUS
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# This is the "normal" part of the Makefile
|
||||||
|
|
||||||
DIST := dist
|
DIST := dist
|
||||||
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
||||||
IMPORT := code.gitea.io/gitea
|
IMPORT := code.gitea.io/gitea
|
||||||
export GO111MODULE=off
|
export GO111MODULE=on
|
||||||
|
|
||||||
GO ?= go
|
GO ?= go
|
||||||
SED_INPLACE := sed -i
|
|
||||||
SHASUM ?= shasum -a 256
|
SHASUM ?= shasum -a 256
|
||||||
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
||||||
COMMA := ,
|
COMMA := ,
|
||||||
|
|
||||||
|
XGO_VERSION := go-1.15.x
|
||||||
|
MIN_GO_VERSION := 001013000
|
||||||
|
MIN_NODE_VERSION := 010013000
|
||||||
|
|
||||||
|
DOCKER_IMAGE ?= gitea/gitea
|
||||||
|
DOCKER_TAG ?= latest
|
||||||
|
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||||
|
|
||||||
ifeq ($(HAS_GO), GO)
|
ifeq ($(HAS_GO), GO)
|
||||||
GOPATH ?= $(shell $(GO) env GOPATH)
|
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||||
export PATH := $(GOPATH)/bin:$(PATH)
|
export PATH := $(GOPATH)/bin:$(PATH)
|
||||||
|
|
||||||
|
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
|
||||||
|
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(OS), Windows_NT)
|
ifeq ($(OS), Windows_NT)
|
||||||
|
GOFLAGS := -v -buildmode=exe
|
||||||
EXECUTABLE ?= gitea.exe
|
EXECUTABLE ?= gitea.exe
|
||||||
else
|
else
|
||||||
|
GOFLAGS := -v
|
||||||
EXECUTABLE ?= gitea
|
EXECUTABLE ?= gitea
|
||||||
UNAME_S := $(shell uname -s)
|
endif
|
||||||
ifeq ($(UNAME_S),Darwin)
|
|
||||||
SED_INPLACE := sed -i ''
|
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
||||||
endif
|
SED_INPLACE := sed -i
|
||||||
ifeq ($(UNAME_S),FreeBSD)
|
else
|
||||||
SED_INPLACE := sed -i ''
|
SED_INPLACE := sed -i ''
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GOFMT ?= gofmt -s
|
GOFMT ?= gofmt -s
|
||||||
|
|
||||||
GOFLAGS := -v
|
|
||||||
EXTRA_GOFLAGS ?=
|
EXTRA_GOFLAGS ?=
|
||||||
|
|
||||||
MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
|
MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
|
||||||
@@ -62,21 +88,29 @@ endif
|
|||||||
|
|
||||||
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
|
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
|
||||||
|
|
||||||
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/)))
|
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list -mod=vendor ./... | grep -v /vendor/)))
|
||||||
|
|
||||||
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
|
FOMANTIC_CONFIGS := semantic.json web_src/fomantic/theme.config.less web_src/fomantic/_site/globals/site.variables
|
||||||
WEBPACK_CONFIGS := webpack.config.js .eslintrc .stylelintrc
|
FOMANTIC_DEST := web_src/fomantic/build/semantic.js web_src/fomantic/build/semantic.css
|
||||||
|
FOMANTIC_DEST_DIR := web_src/fomantic/build
|
||||||
|
|
||||||
|
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f) $(FOMANTIC_DEST)
|
||||||
|
WEBPACK_CONFIGS := webpack.config.js
|
||||||
WEBPACK_DEST := public/js/index.js public/css/index.css
|
WEBPACK_DEST := public/js/index.js public/css/index.css
|
||||||
WEBPACK_DEST_DIRS := public/js public/css
|
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
|
||||||
|
|
||||||
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
|
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
|
||||||
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
|
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
|
||||||
|
|
||||||
|
SVG_DEST_DIR := public/img/svg
|
||||||
|
|
||||||
|
AIR_TMP_DIR := .air
|
||||||
|
|
||||||
TAGS ?=
|
TAGS ?=
|
||||||
TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS))
|
TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS))
|
||||||
TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
|
TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
|
||||||
|
|
||||||
GO_DIRS := cmd integrations models modules routers scripts services vendor
|
GO_DIRS := cmd integrations models modules routers build services vendor
|
||||||
GO_SOURCES := $(wildcard *.go)
|
GO_SOURCES := $(wildcard *.go)
|
||||||
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
|
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
|
||||||
|
|
||||||
@@ -86,15 +120,12 @@ endif
|
|||||||
|
|
||||||
GO_SOURCES_OWN := $(filter-out vendor/% %/bindata.go, $(GO_SOURCES))
|
GO_SOURCES_OWN := $(filter-out vendor/% %/bindata.go, $(GO_SOURCES))
|
||||||
|
|
||||||
FOMANTIC_CONFIGS := semantic.json web_src/fomantic/theme.config.less web_src/fomantic/_site/globals/site.variables
|
#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/swagger
|
||||||
FOMANTIC_DEST := public/fomantic/semantic.min.js public/fomantic/semantic.min.css
|
SWAGGER := $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
|
||||||
FOMANTIC_DEST_DIR := public/fomantic
|
|
||||||
|
|
||||||
#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/swagger@v0.20.1
|
|
||||||
SWAGGER := GO111MODULE=on $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
|
|
||||||
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
|
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
|
||||||
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g
|
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g
|
||||||
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g
|
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g
|
||||||
|
SWAGGER_EXCLUDE := code.gitea.io/sdk
|
||||||
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
|
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
|
||||||
|
|
||||||
TEST_MYSQL_HOST ?= mysql:3306
|
TEST_MYSQL_HOST ?= mysql:3306
|
||||||
@@ -118,35 +149,46 @@ TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
|
|||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
include docker/Makefile
|
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
@echo "Make Routines:"
|
@echo "Make Routines:"
|
||||||
@echo " - \"\" equivalent to \"build\""
|
@echo " - \"\" equivalent to \"build\""
|
||||||
@echo " - build build everything"
|
@echo " - build build everything"
|
||||||
@echo " - frontend build frontend files"
|
@echo " - frontend build frontend files"
|
||||||
@echo " - backend build backend files"
|
@echo " - backend build backend files"
|
||||||
@echo " - clean delete backend and integration files"
|
@echo " - watch watch everything and continuously rebuild"
|
||||||
@echo " - clean-all delete backend, frontend and integration files"
|
@echo " - watch-frontend watch frontend files and continuously rebuild"
|
||||||
@echo " - webpack build webpack files"
|
@echo " - watch-backend watch backend files and continuously rebuild"
|
||||||
@echo " - fomantic build fomantic files"
|
@echo " - clean delete backend and integration files"
|
||||||
@echo " - generate run \"go generate\""
|
@echo " - clean-all delete backend, frontend and integration files"
|
||||||
@echo " - fmt format the Go code"
|
@echo " - lint lint everything"
|
||||||
@echo " - generate-swagger generate the swagger spec from code comments"
|
@echo " - lint-frontend lint frontend files"
|
||||||
@echo " - swagger-validate check if the swagger spec is valid"
|
@echo " - lint-backend lint backend files"
|
||||||
@echo " - revive run code linter revive"
|
@echo " - checks run various consistency checks"
|
||||||
@echo " - misspell check if a word is written wrong"
|
@echo " - checks-frontend check frontend files"
|
||||||
@echo " - vet examines Go source code and reports suspicious constructs"
|
@echo " - checks-backend check backend files"
|
||||||
@echo " - test run unit test"
|
@echo " - webpack build webpack files"
|
||||||
@echo " - test-sqlite run integration test for sqlite"
|
@echo " - svg build svg files"
|
||||||
@echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
|
@echo " - fomantic build fomantic files"
|
||||||
|
@echo " - generate run \"go generate\""
|
||||||
|
@echo " - fmt format the Go code"
|
||||||
|
@echo " - generate-license update license files"
|
||||||
|
@echo " - generate-gitignore update gitignore files"
|
||||||
|
@echo " - generate-swagger generate the swagger spec from code comments"
|
||||||
|
@echo " - swagger-validate check if the swagger spec is valid"
|
||||||
|
@echo " - golangci-lint run golangci-lint linter"
|
||||||
|
@echo " - revive run revive linter"
|
||||||
|
@echo " - misspell check for misspellings"
|
||||||
|
@echo " - vet examines Go source code and reports suspicious constructs"
|
||||||
|
@echo " - test[\#TestSpecificName] run unit test"
|
||||||
|
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
|
||||||
|
@echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
|
||||||
|
|
||||||
.PHONY: go-check
|
.PHONY: go-check
|
||||||
go-check:
|
go-check:
|
||||||
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');))
|
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
|
||||||
@if [ "$(GO_VERSION)" -lt "001011000" ]; then \
|
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
|
||||||
echo "Gitea requires Go 1.11 or greater to build. You can get it at https://golang.org/dl/"; \
|
echo "Gitea requires Go 1.13 or greater to build. You can get it at https://golang.org/dl/"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -159,16 +201,16 @@ git-check:
|
|||||||
|
|
||||||
.PHONY: node-check
|
.PHONY: node-check
|
||||||
node-check:
|
node-check:
|
||||||
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');))
|
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | cut -c2- | tr '.' ' ');))
|
||||||
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
|
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
|
||||||
@if [ "$(NODE_VERSION)" -lt "010000000" -o "$(NPM_MISSING)" = "1" ]; then \
|
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
|
||||||
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
|
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: clean-all
|
.PHONY: clean-all
|
||||||
clean-all: clean
|
clean-all: clean
|
||||||
rm -rf $(WEBPACK_DEST_DIRS) $(FOMANTIC_DEST_DIR)
|
rm -rf $(WEBPACK_DEST_ENTRIES) $(FOMANTIC_DEST_DIR)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@@ -185,7 +227,11 @@ fmt:
|
|||||||
|
|
||||||
.PHONY: vet
|
.PHONY: vet
|
||||||
vet:
|
vet:
|
||||||
$(GO) vet $(PACKAGES)
|
# Default vet
|
||||||
|
$(GO) vet $(GO_PACKAGES)
|
||||||
|
# Custom vet
|
||||||
|
$(GO) build -mod=vendor code.gitea.io/gitea-vet
|
||||||
|
$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
|
||||||
|
|
||||||
.PHONY: $(TAGS_EVIDENCE)
|
.PHONY: $(TAGS_EVIDENCE)
|
||||||
$(TAGS_EVIDENCE):
|
$(TAGS_EVIDENCE):
|
||||||
@@ -198,7 +244,7 @@ endif
|
|||||||
|
|
||||||
.PHONY: generate-swagger
|
.PHONY: generate-swagger
|
||||||
generate-swagger:
|
generate-swagger:
|
||||||
$(SWAGGER) generate spec -o './$(SWAGGER_SPEC)'
|
$(SWAGGER) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
|
||||||
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
|
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
|
||||||
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
|
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
|
||||||
|
|
||||||
@@ -220,28 +266,25 @@ swagger-validate:
|
|||||||
.PHONY: errcheck
|
.PHONY: errcheck
|
||||||
errcheck:
|
errcheck:
|
||||||
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u github.com/kisielk/errcheck; \
|
GO111MODULE=off $(GO) get -u github.com/kisielk/errcheck; \
|
||||||
fi
|
fi
|
||||||
errcheck $(PACKAGES)
|
errcheck $(GO_PACKAGES)
|
||||||
|
|
||||||
.PHONY: revive
|
.PHONY: revive
|
||||||
revive:
|
revive:
|
||||||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
GO111MODULE=on $(GO) run -mod=vendor build/lint.go -config .revive.toml -exclude=./vendor/... ./... || exit 1
|
||||||
$(GO) get -u github.com/mgechev/revive; \
|
|
||||||
fi
|
|
||||||
revive -config .revive.toml -exclude=./vendor/... ./... || exit 1
|
|
||||||
|
|
||||||
.PHONY: misspell-check
|
.PHONY: misspell-check
|
||||||
misspell-check:
|
misspell-check:
|
||||||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
||||||
fi
|
fi
|
||||||
misspell -error -i unknwon,destory $(GO_SOURCES_OWN)
|
misspell -error -i unknwon,destory $(GO_SOURCES_OWN)
|
||||||
|
|
||||||
.PHONY: misspell
|
.PHONY: misspell
|
||||||
misspell:
|
misspell:
|
||||||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
||||||
fi
|
fi
|
||||||
misspell -w -i unknwon $(GO_SOURCES_OWN)
|
misspell -w -i unknwon $(GO_SOURCES_OWN)
|
||||||
|
|
||||||
@@ -255,9 +298,45 @@ fmt-check:
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
.PHONY: checks
|
||||||
|
checks: checks-frontend checks-backend
|
||||||
|
|
||||||
|
.PHONY: checks-frontend
|
||||||
|
checks-frontend: svg-check
|
||||||
|
|
||||||
|
.PHONY: checks-backend
|
||||||
|
checks-backend: misspell-check test-vendor swagger-check swagger-validate
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint: lint-frontend lint-backend
|
||||||
|
|
||||||
|
.PHONY: lint-frontend
|
||||||
|
lint-frontend: node_modules
|
||||||
|
npx eslint web_src/js build webpack.config.js
|
||||||
|
npx stylelint web_src/less
|
||||||
|
|
||||||
|
.PHONY: lint-backend
|
||||||
|
lint-backend: golangci-lint revive vet
|
||||||
|
|
||||||
|
.PHONY: watch
|
||||||
|
watch:
|
||||||
|
bash tools/watch.sh
|
||||||
|
|
||||||
|
.PHONY: watch-frontend
|
||||||
|
watch-frontend: node-check $(FOMANTIC_DEST) node_modules
|
||||||
|
rm -rf $(WEBPACK_DEST_ENTRIES)
|
||||||
|
NODE_ENV=development npx webpack --hide-modules --display-entrypoints=false --watch --progress
|
||||||
|
|
||||||
|
.PHONY: watch-backend
|
||||||
|
watch-backend: go-check
|
||||||
|
@hash air > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
|
GO111MODULE=off $(GO) get -u github.com/cosmtrek/air; \
|
||||||
|
fi
|
||||||
|
air -c .air.conf
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' $(GO_PACKAGES)
|
||||||
|
|
||||||
.PHONY: test-check
|
.PHONY: test-check
|
||||||
test-check:
|
test-check:
|
||||||
@@ -273,22 +352,19 @@ test-check:
|
|||||||
|
|
||||||
.PHONY: test\#%
|
.PHONY: test\#%
|
||||||
test\#%:
|
test\#%:
|
||||||
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -run $* $(PACKAGES)
|
$(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -run $(subst .,/,$*) $(GO_PACKAGES)
|
||||||
|
|
||||||
.PHONY: coverage
|
.PHONY: coverage
|
||||||
coverage:
|
coverage:
|
||||||
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all
|
||||||
$(GO) get -u github.com/wadey/gocovmerge; \
|
|
||||||
fi
|
|
||||||
gocovmerge integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all;\
|
|
||||||
|
|
||||||
.PHONY: unit-test-coverage
|
.PHONY: unit-test-coverage
|
||||||
unit-test-coverage:
|
unit-test-coverage:
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||||
|
|
||||||
.PHONY: vendor
|
.PHONY: vendor
|
||||||
vendor:
|
vendor:
|
||||||
GO111MODULE=on $(GO) mod tidy && GO111MODULE=on $(GO) mod vendor
|
$(GO) mod tidy && $(GO) mod vendor
|
||||||
|
|
||||||
.PHONY: test-vendor
|
.PHONY: test-vendor
|
||||||
test-vendor: vendor
|
test-vendor: vendor
|
||||||
@@ -299,16 +375,20 @@ test-vendor: vendor
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
generate-ini-sqlite:
|
||||||
|
sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
|
||||||
|
integrations/sqlite.ini.tmpl > integrations/sqlite.ini
|
||||||
|
|
||||||
.PHONY: test-sqlite
|
.PHONY: test-sqlite
|
||||||
test-sqlite: integrations.sqlite.test
|
test-sqlite: integrations.sqlite.test generate-ini-sqlite
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
|
||||||
|
|
||||||
.PHONY: test-sqlite\#%
|
.PHONY: test-sqlite\#%
|
||||||
test-sqlite\#%: integrations.sqlite.test
|
test-sqlite\#%: integrations.sqlite.test generate-ini-sqlite
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $*
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$*)
|
||||||
|
|
||||||
.PHONY: test-sqlite-migration
|
.PHONY: test-sqlite-migration
|
||||||
test-sqlite-migration: migrations.sqlite.test
|
test-sqlite-migration: migrations.sqlite.test generate-ini-sqlite
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
|
||||||
|
|
||||||
generate-ini-mysql:
|
generate-ini-mysql:
|
||||||
@@ -316,6 +396,7 @@ generate-ini-mysql:
|
|||||||
-e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
|
-e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
|
||||||
-e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
|
-e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
|
||||||
-e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
|
-e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
|
||||||
|
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
|
||||||
integrations/mysql.ini.tmpl > integrations/mysql.ini
|
integrations/mysql.ini.tmpl > integrations/mysql.ini
|
||||||
|
|
||||||
.PHONY: test-mysql
|
.PHONY: test-mysql
|
||||||
@@ -324,7 +405,7 @@ test-mysql: integrations.mysql.test generate-ini-mysql
|
|||||||
|
|
||||||
.PHONY: test-mysql\#%
|
.PHONY: test-mysql\#%
|
||||||
test-mysql\#%: integrations.mysql.test generate-ini-mysql
|
test-mysql\#%: integrations.mysql.test generate-ini-mysql
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $*
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$*)
|
||||||
|
|
||||||
.PHONY: test-mysql-migration
|
.PHONY: test-mysql-migration
|
||||||
test-mysql-migration: migrations.mysql.test generate-ini-mysql
|
test-mysql-migration: migrations.mysql.test generate-ini-mysql
|
||||||
@@ -335,6 +416,7 @@ generate-ini-mysql8:
|
|||||||
-e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
|
-e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
|
||||||
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
|
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
|
||||||
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
|
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
|
||||||
|
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
|
||||||
integrations/mysql8.ini.tmpl > integrations/mysql8.ini
|
integrations/mysql8.ini.tmpl > integrations/mysql8.ini
|
||||||
|
|
||||||
.PHONY: test-mysql8
|
.PHONY: test-mysql8
|
||||||
@@ -343,7 +425,7 @@ test-mysql8: integrations.mysql8.test generate-ini-mysql8
|
|||||||
|
|
||||||
.PHONY: test-mysql8\#%
|
.PHONY: test-mysql8\#%
|
||||||
test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
|
test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $*
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*)
|
||||||
|
|
||||||
.PHONY: test-mysql8-migration
|
.PHONY: test-mysql8-migration
|
||||||
test-mysql8-migration: migrations.mysql8.test generate-ini-mysql8
|
test-mysql8-migration: migrations.mysql8.test generate-ini-mysql8
|
||||||
@@ -355,6 +437,7 @@ generate-ini-pgsql:
|
|||||||
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
|
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
|
||||||
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
|
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
|
||||||
-e 's|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \
|
-e 's|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \
|
||||||
|
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
|
||||||
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
|
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
|
||||||
|
|
||||||
.PHONY: test-pgsql
|
.PHONY: test-pgsql
|
||||||
@@ -363,7 +446,7 @@ test-pgsql: integrations.pgsql.test generate-ini-pgsql
|
|||||||
|
|
||||||
.PHONY: test-pgsql\#%
|
.PHONY: test-pgsql\#%
|
||||||
test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
|
test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $*
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$*)
|
||||||
|
|
||||||
.PHONY: test-pgsql-migration
|
.PHONY: test-pgsql-migration
|
||||||
test-pgsql-migration: migrations.pgsql.test generate-ini-pgsql
|
test-pgsql-migration: migrations.pgsql.test generate-ini-pgsql
|
||||||
@@ -374,6 +457,7 @@ generate-ini-mssql:
|
|||||||
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
|
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
|
||||||
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
|
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
|
||||||
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
|
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
|
||||||
|
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
|
||||||
integrations/mssql.ini.tmpl > integrations/mssql.ini
|
integrations/mssql.ini.tmpl > integrations/mssql.ini
|
||||||
|
|
||||||
.PHONY: test-mssql
|
.PHONY: test-mssql
|
||||||
@@ -382,14 +466,14 @@ test-mssql: integrations.mssql.test generate-ini-mssql
|
|||||||
|
|
||||||
.PHONY: test-mssql\#%
|
.PHONY: test-mssql\#%
|
||||||
test-mssql\#%: integrations.mssql.test generate-ini-mssql
|
test-mssql\#%: integrations.mssql.test generate-ini-mssql
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $*
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*)
|
||||||
|
|
||||||
.PHONY: test-mssql-migration
|
.PHONY: test-mssql-migration
|
||||||
test-mssql-migration: migrations.mssql.test generate-ini-mssql
|
test-mssql-migration: migrations.mssql.test generate-ini-mssql
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test -test.failfast
|
||||||
|
|
||||||
.PHONY: bench-sqlite
|
.PHONY: bench-sqlite
|
||||||
bench-sqlite: integrations.sqlite.test
|
bench-sqlite: integrations.sqlite.test generate-ini-sqlite
|
||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
|
||||||
|
|
||||||
.PHONY: bench-mysql
|
.PHONY: bench-mysql
|
||||||
@@ -409,22 +493,22 @@ integration-test-coverage: integrations.cover.test generate-ini-mysql
|
|||||||
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
|
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
|
||||||
|
|
||||||
integrations.mysql.test: git-check $(GO_SOURCES)
|
integrations.mysql.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
|
||||||
|
|
||||||
integrations.mysql8.test: git-check $(GO_SOURCES)
|
integrations.mysql8.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
|
||||||
|
|
||||||
integrations.pgsql.test: git-check $(GO_SOURCES)
|
integrations.pgsql.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
|
||||||
|
|
||||||
integrations.mssql.test: git-check $(GO_SOURCES)
|
integrations.mssql.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
|
||||||
|
|
||||||
integrations.sqlite.test: git-check $(GO_SOURCES)
|
integrations.sqlite.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
|
||||||
|
|
||||||
integrations.cover.test: git-check $(GO_SOURCES)
|
integrations.cover.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
||||||
|
|
||||||
.PHONY: migrations.mysql.test
|
.PHONY: migrations.mysql.test
|
||||||
migrations.mysql.test: $(GO_SOURCES)
|
migrations.mysql.test: $(GO_SOURCES)
|
||||||
@@ -451,7 +535,7 @@ check: test
|
|||||||
|
|
||||||
.PHONY: install $(TAGS_PREREQ)
|
.PHONY: install $(TAGS_PREREQ)
|
||||||
install: $(wildcard *.go)
|
install: $(wildcard *.go)
|
||||||
$(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: frontend backend
|
build: frontend backend
|
||||||
@@ -464,13 +548,13 @@ backend: go-check generate $(EXECUTABLE)
|
|||||||
|
|
||||||
.PHONY: generate
|
.PHONY: generate
|
||||||
generate: $(TAGS_PREREQ)
|
generate: $(TAGS_PREREQ)
|
||||||
GO111MODULE=on $(GO) generate -mod=vendor -tags '$(TAGS)' $(PACKAGES)
|
CC= GOOS= GOARCH= $(GO) generate -mod=vendor -tags '$(TAGS)' $(GO_PACKAGES)
|
||||||
|
|
||||||
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
||||||
GO111MODULE=on $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: frontend generate release-windows release-linux release-darwin release-copy release-compress release-sources release-check
|
release: frontend generate release-windows release-linux release-darwin release-copy release-compress release-sources release-docs release-check
|
||||||
|
|
||||||
$(DIST_DIRS):
|
$(DIST_DIRS):
|
||||||
mkdir -p $(DIST_DIRS)
|
mkdir -p $(DIST_DIRS)
|
||||||
@@ -478,9 +562,10 @@ $(DIST_DIRS):
|
|||||||
.PHONY: release-windows
|
.PHONY: release-windows
|
||||||
release-windows: | $(DIST_DIRS)
|
release-windows: | $(DIST_DIRS)
|
||||||
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u src.techknowlogick.com/xgo; \
|
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
|
||||||
fi
|
fi
|
||||||
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
|
@echo "Warning: windows version is built using golang 1.14"
|
||||||
|
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
|
||||||
ifeq ($(CI),drone)
|
ifeq ($(CI),drone)
|
||||||
cp /build/* $(DIST)/binaries
|
cp /build/* $(DIST)/binaries
|
||||||
endif
|
endif
|
||||||
@@ -488,9 +573,9 @@ endif
|
|||||||
.PHONY: release-linux
|
.PHONY: release-linux
|
||||||
release-linux: | $(DIST_DIRS)
|
release-linux: | $(DIST_DIRS)
|
||||||
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u src.techknowlogick.com/xgo; \
|
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
|
||||||
fi
|
fi
|
||||||
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
|
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
|
||||||
ifeq ($(CI),drone)
|
ifeq ($(CI),drone)
|
||||||
cp /build/* $(DIST)/binaries
|
cp /build/* $(DIST)/binaries
|
||||||
endif
|
endif
|
||||||
@@ -498,9 +583,9 @@ endif
|
|||||||
.PHONY: release-darwin
|
.PHONY: release-darwin
|
||||||
release-darwin: | $(DIST_DIRS)
|
release-darwin: | $(DIST_DIRS)
|
||||||
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u src.techknowlogick.com/xgo; \
|
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
|
||||||
fi
|
fi
|
||||||
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
|
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
|
||||||
ifeq ($(CI),drone)
|
ifeq ($(CI),drone)
|
||||||
cp /build/* $(DIST)/binaries
|
cp /build/* $(DIST)/binaries
|
||||||
endif
|
endif
|
||||||
@@ -516,16 +601,27 @@ release-check: | $(DIST_DIRS)
|
|||||||
.PHONY: release-compress
|
.PHONY: release-compress
|
||||||
release-compress: | $(DIST_DIRS)
|
release-compress: | $(DIST_DIRS)
|
||||||
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
$(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
|
GO111MODULE=off $(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
|
||||||
fi
|
fi
|
||||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
|
||||||
|
|
||||||
.PHONY: release-sources
|
.PHONY: release-sources
|
||||||
release-sources: | $(DIST_DIRS) node_modules
|
release-sources: | $(DIST_DIRS) node_modules
|
||||||
echo $(VERSION) > $(STORED_VERSION_FILE)
|
echo $(VERSION) > $(STORED_VERSION_FILE)
|
||||||
tar --exclude=./$(DIST) --exclude=./.git --exclude=./$(MAKE_EVIDENCE_DIR) --exclude=./node_modules/.cache -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
|
tar --exclude=./$(DIST) --exclude=./.git --exclude=./$(MAKE_EVIDENCE_DIR) --exclude=./node_modules/.cache --exclude=./$(AIR_TMP_DIR) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
|
||||||
rm -f $(STORED_VERSION_FILE)
|
rm -f $(STORED_VERSION_FILE)
|
||||||
|
|
||||||
|
.PHONY: release-docs
|
||||||
|
release-docs: | $(DIST_DIRS) docs
|
||||||
|
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
|
||||||
|
|
||||||
|
.PHONY: docs
|
||||||
|
docs:
|
||||||
|
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
|
curl -sL https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
|
||||||
|
fi
|
||||||
|
cd docs; make trans-copy clean build-offline;
|
||||||
|
|
||||||
node_modules: package-lock.json
|
node_modules: package-lock.json
|
||||||
npm install --no-save
|
npm install --no-save
|
||||||
@touch node_modules
|
@touch node_modules
|
||||||
@@ -535,24 +631,15 @@ npm-update: node-check | node_modules
|
|||||||
npx updates -cu
|
npx updates -cu
|
||||||
rm -rf node_modules package-lock.json
|
rm -rf node_modules package-lock.json
|
||||||
npm install --package-lock
|
npm install --package-lock
|
||||||
|
@touch node_modules
|
||||||
.PHONY: js
|
|
||||||
js:
|
|
||||||
@echo "'make js' is deprecated, please use 'make webpack'"
|
|
||||||
$(MAKE) webpack
|
|
||||||
|
|
||||||
.PHONY: css
|
|
||||||
css:
|
|
||||||
@echo "'make css' is deprecated, please use 'make webpack'"
|
|
||||||
$(MAKE) webpack
|
|
||||||
|
|
||||||
.PHONY: fomantic
|
.PHONY: fomantic
|
||||||
fomantic: $(FOMANTIC_DEST)
|
fomantic: $(FOMANTIC_DEST)
|
||||||
|
|
||||||
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) package-lock.json | node_modules
|
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) | node_modules
|
||||||
rm -rf $(FOMANTIC_DEST_DIR)
|
rm -rf $(FOMANTIC_DEST_DIR)
|
||||||
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
|
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
|
||||||
cp web_src/fomantic/_site/globals/* node_modules/fomantic-ui/src/_site/globals/
|
cp -r web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/
|
||||||
npx gulp -f node_modules/fomantic-ui/gulpfile.js build
|
npx gulp -f node_modules/fomantic-ui/gulpfile.js build
|
||||||
@touch $(FOMANTIC_DEST)
|
@touch $(FOMANTIC_DEST)
|
||||||
|
|
||||||
@@ -560,11 +647,25 @@ $(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) package-lock.json | node_modules
|
|||||||
webpack: $(WEBPACK_DEST)
|
webpack: $(WEBPACK_DEST)
|
||||||
|
|
||||||
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_modules
|
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json | node_modules
|
||||||
npx eslint web_src/js webpack.config.js
|
rm -rf $(WEBPACK_DEST_ENTRIES)
|
||||||
npx stylelint web_src/less
|
|
||||||
npx webpack --hide-modules --display-entrypoints=false
|
npx webpack --hide-modules --display-entrypoints=false
|
||||||
@touch $(WEBPACK_DEST)
|
@touch $(WEBPACK_DEST)
|
||||||
|
|
||||||
|
.PHONY: svg
|
||||||
|
svg: node-check | node_modules
|
||||||
|
rm -rf $(SVG_DEST_DIR)
|
||||||
|
node build/generate-svg.js
|
||||||
|
|
||||||
|
.PHONY: svg-check
|
||||||
|
svg-check: svg
|
||||||
|
@git add $(SVG_DEST_DIR)
|
||||||
|
@diff=$$(git diff --cached $(SVG_DEST_DIR)); \
|
||||||
|
if [ -n "$$diff" ]; then \
|
||||||
|
echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
|
||||||
|
echo "$${diff}"; \
|
||||||
|
exit 1; \
|
||||||
|
fi;
|
||||||
|
|
||||||
.PHONY: update-translations
|
.PHONY: update-translations
|
||||||
update-translations:
|
update-translations:
|
||||||
mkdir -p ./translations
|
mkdir -p ./translations
|
||||||
@@ -575,36 +676,19 @@ update-translations:
|
|||||||
mv ./translations/*.ini ./options/locale/
|
mv ./translations/*.ini ./options/locale/
|
||||||
rmdir ./translations
|
rmdir ./translations
|
||||||
|
|
||||||
|
.PHONY: generate-license
|
||||||
|
generate-license:
|
||||||
|
GO111MODULE=on $(GO) run build/generate-licenses.go
|
||||||
|
|
||||||
|
.PHONY: generate-gitignore
|
||||||
|
generate-gitignore:
|
||||||
|
GO111MODULE=on $(GO) run build/generate-gitignores.go
|
||||||
|
|
||||||
|
|
||||||
.PHONY: generate-images
|
.PHONY: generate-images
|
||||||
generate-images:
|
generate-images:
|
||||||
$(eval TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp'))
|
npm install --no-save --no-package-lock xmldom fabric imagemin-zopfli
|
||||||
mkdir -p $(TMPDIR)/images
|
node build/generate-images.js
|
||||||
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
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 200 -h 200 -e $(PWD)/public/img/avatar_default.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 180 -h 180 -e $(PWD)/public/img/favicon.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 128 -h 128 -e $(TMPDIR)/images/128-raw.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 64 -h 64 -e $(TMPDIR)/images/64-raw.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer1 -e $(TMPDIR)/images/32-1.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer2 -e $(TMPDIR)/images/32-2.png
|
|
||||||
composite -compose atop $(TMPDIR)/images/32-2.png $(TMPDIR)/images/32-1.png $(TMPDIR)/images/32-raw.png
|
|
||||||
inkscape -f $(PWD)/assets/logo.svg -w 16 -h 16 -jC -i layer1 -e $(TMPDIR)/images/16-raw.png
|
|
||||||
zopflipng -m -y $(TMPDIR)/images/128-raw.png $(TMPDIR)/images/128.png
|
|
||||||
zopflipng -m -y $(TMPDIR)/images/64-raw.png $(TMPDIR)/images/64.png
|
|
||||||
zopflipng -m -y $(TMPDIR)/images/32-raw.png $(TMPDIR)/images/32.png
|
|
||||||
zopflipng -m -y $(TMPDIR)/images/16-raw.png $(TMPDIR)/images/16.png
|
|
||||||
rm -f $(TMPDIR)/images/*-*.png
|
|
||||||
convert $(TMPDIR)/images/16.png $(TMPDIR)/images/32.png \
|
|
||||||
$(TMPDIR)/images/64.png $(TMPDIR)/images/128.png \
|
|
||||||
$(PWD)/public/img/favicon.ico
|
|
||||||
convert -flatten $(PWD)/public/img/favicon.png $(PWD)/public/img/apple-touch-icon.png
|
|
||||||
|
|
||||||
rm -rf $(TMPDIR)/images
|
|
||||||
$(foreach file, $(shell find public/img -type f -name '*.png' ! -name 'loading.png'),zopflipng -m -y $(file) $(file);)
|
|
||||||
|
|
||||||
.PHONY: pr\#%
|
.PHONY: pr\#%
|
||||||
pr\#%: clean-all
|
pr\#%: clean-all
|
||||||
@@ -614,6 +698,18 @@ pr\#%: clean-all
|
|||||||
golangci-lint:
|
golangci-lint:
|
||||||
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
export BINARY="golangci-lint"; \
|
export BINARY="golangci-lint"; \
|
||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.20.0; \
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.31.0; \
|
||||||
fi
|
fi
|
||||||
golangci-lint run --timeout 5m
|
golangci-lint run --timeout 5m
|
||||||
|
|
||||||
|
.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 sqlite_unlock_notify" .
|
||||||
|
|
||||||
|
.PHONY: docker-build
|
||||||
|
docker-build:
|
||||||
|
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" CGO_EXTRA_CFLAGS="$(CGO_EXTRA_CFLAGS)" webhippie/golang:edge make clean build
|
||||||
|
|
||||||
|
# This endif closes the if at the top of the file
|
||||||
|
endif
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
|
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
|
||||||
|
|
||||||
[](https://drone.gitea.io/go-gitea/gitea)
|
[](https://drone.gitea.io/go-gitea/gitea)
|
||||||
[](https://discord.gg/Gitea)
|
[](https://discord.gg/Gitea)
|
||||||
[](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
|
[](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
|
||||||
[](https://codecov.io/gh/go-gitea/gitea)
|
[](https://codecov.io/gh/go-gitea/gitea)
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
[](https://opencollective.com/gitea)
|
[](https://opencollective.com/gitea)
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://crowdin.com/project/gitea)
|
[](https://crowdin.com/project/gitea)
|
||||||
|
[](https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea)
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
@@ -39,12 +40,14 @@ or if sqlite support is required:
|
|||||||
|
|
||||||
The `build` target is split into two sub-targets:
|
The `build` target is split into two sub-targets:
|
||||||
|
|
||||||
- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater.
|
- `make backend` which requires [Go 1.13](https://golang.org/dl/) or greater.
|
||||||
- `make frontend` which requires [Node.js 10](https://nodejs.org/en/download/) or greater.
|
- `make frontend` which requires [Node.js 10.13](https://nodejs.org/en/download/) or greater.
|
||||||
|
|
||||||
If pre-built frontend files are present it is possible to only build the backend:
|
If pre-built frontend files are present it is possible to only build the backend:
|
||||||
|
|
||||||
TAGS="bindata" make backend
|
TAGS="bindata" make backend
|
||||||
|
|
||||||
|
Parallelism is not supported for these targets, so please don't include `-j <num>`.
|
||||||
|
|
||||||
More info: https://docs.gitea.io/en-us/install-from-source/
|
More info: https://docs.gitea.io/en-us/install-from-source/
|
||||||
|
|
||||||
|
|||||||
10
SECURITY.md
Normal file
10
SECURITY.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Reporting security issues
|
||||||
|
|
||||||
|
The Gitea maintainers take security seriously.
|
||||||
|
If you discover a security issue, please bring it to their attention right away!
|
||||||
|
|
||||||
|
### Reporting a Vulnerability
|
||||||
|
|
||||||
|
Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`.
|
||||||
|
|
||||||
|
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it.
|
||||||
1
assets/emoji.json
Normal file
1
assets/emoji.json
Normal file
File diff suppressed because one or more lines are too long
@@ -115,6 +115,7 @@
|
|||||||
<g
|
<g
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer3"
|
id="layer3"
|
||||||
|
class="detail-remove"
|
||||||
inkscape:label="Layer 3"
|
inkscape:label="Layer 3"
|
||||||
style="display:inline">
|
style="display:inline">
|
||||||
<g
|
<g
|
||||||
@@ -157,4 +158,4 @@
|
|||||||
style="fill:none;stroke:#609926;stroke-width:2.68000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
style="fill:none;stroke:#609926;stroke-width:2.68000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
32
build.go
Normal file
32
build.go
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// Copyright 2020 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.
|
||||||
|
|
||||||
|
//+build vendor
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
// Libraries that are included to vendor utilities used during build.
|
||||||
|
// These libraries will not be included in a normal compilation.
|
||||||
|
|
||||||
|
import (
|
||||||
|
// for lint
|
||||||
|
_ "github.com/mgechev/dots"
|
||||||
|
_ "github.com/mgechev/revive/formatter"
|
||||||
|
_ "github.com/mgechev/revive/lint"
|
||||||
|
_ "github.com/mgechev/revive/rule"
|
||||||
|
_ "github.com/mitchellh/go-homedir"
|
||||||
|
_ "github.com/pelletier/go-toml"
|
||||||
|
|
||||||
|
// for embed
|
||||||
|
_ "github.com/shurcooL/vfsgen"
|
||||||
|
|
||||||
|
// for cover merge
|
||||||
|
_ "golang.org/x/tools/cover"
|
||||||
|
|
||||||
|
// for vet
|
||||||
|
_ "code.gitea.io/gitea-vet"
|
||||||
|
|
||||||
|
// for swagger
|
||||||
|
_ "github.com/go-swagger/go-swagger/cmd/swagger"
|
||||||
|
)
|
||||||
221
build/generate-emoji.go
Normal file
221
build/generate-emoji.go
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||||
|
// Copyright 2015 Kenneth Shaw
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"go/format"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"regexp"
|
||||||
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"unicode/utf8"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
gemojiURL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
|
||||||
|
maxUnicodeVersion = 12
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")
|
||||||
|
)
|
||||||
|
|
||||||
|
// Gemoji is a set of emoji data.
|
||||||
|
type Gemoji []Emoji
|
||||||
|
|
||||||
|
// Emoji represents a single emoji and associated data.
|
||||||
|
type Emoji struct {
|
||||||
|
Emoji string `json:"emoji"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Aliases []string `json:"aliases"`
|
||||||
|
UnicodeVersion string `json:"unicode_version,omitempty"`
|
||||||
|
SkinTones bool `json:"skin_tones,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't include some fields in JSON
|
||||||
|
func (e Emoji) MarshalJSON() ([]byte, error) {
|
||||||
|
type emoji Emoji
|
||||||
|
x := emoji(e)
|
||||||
|
x.UnicodeVersion = ""
|
||||||
|
x.Description = ""
|
||||||
|
x.SkinTones = false
|
||||||
|
return json.Marshal(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
// generate data
|
||||||
|
buf, err := generate()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// write
|
||||||
|
err = ioutil.WriteFile(*flagOut, buf, 0644)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var replacer = strings.NewReplacer(
|
||||||
|
"main.Gemoji", "Gemoji",
|
||||||
|
"main.Emoji", "\n",
|
||||||
|
"}}", "},\n}",
|
||||||
|
", Description:", ", ",
|
||||||
|
", Aliases:", ", ",
|
||||||
|
", UnicodeVersion:", ", ",
|
||||||
|
", SkinTones:", ", ",
|
||||||
|
)
|
||||||
|
|
||||||
|
var emojiRE = regexp.MustCompile(`\{Emoji:"([^"]*)"`)
|
||||||
|
|
||||||
|
func generate() ([]byte, error) {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
// load gemoji data
|
||||||
|
res, err := http.Get(gemojiURL)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer res.Body.Close()
|
||||||
|
|
||||||
|
// read all
|
||||||
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// unmarshal
|
||||||
|
var data Gemoji
|
||||||
|
err = json.Unmarshal(body, &data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var skinTones = make(map[string]string)
|
||||||
|
|
||||||
|
skinTones["\U0001f3fb"] = "Light Skin Tone"
|
||||||
|
skinTones["\U0001f3fc"] = "Medium-Light Skin Tone"
|
||||||
|
skinTones["\U0001f3fd"] = "Medium Skin Tone"
|
||||||
|
skinTones["\U0001f3fe"] = "Medium-Dark Skin Tone"
|
||||||
|
skinTones["\U0001f3ff"] = "Dark Skin Tone"
|
||||||
|
|
||||||
|
var tmp Gemoji
|
||||||
|
|
||||||
|
//filter out emoji that require greater than max unicode version
|
||||||
|
for i := range data {
|
||||||
|
val, _ := strconv.ParseFloat(data[i].UnicodeVersion, 64)
|
||||||
|
if int(val) <= maxUnicodeVersion {
|
||||||
|
tmp = append(tmp, data[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data = tmp
|
||||||
|
|
||||||
|
sort.Slice(data, func(i, j int) bool {
|
||||||
|
return data[i].Aliases[0] < data[j].Aliases[0]
|
||||||
|
})
|
||||||
|
|
||||||
|
aliasMap := make(map[string]int, len(data))
|
||||||
|
|
||||||
|
for i, e := range data {
|
||||||
|
if e.Emoji == "" || len(e.Aliases) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for _, a := range e.Aliases {
|
||||||
|
if a == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
aliasMap[a] = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// gitea customizations
|
||||||
|
i, ok := aliasMap["tada"]
|
||||||
|
if ok {
|
||||||
|
data[i].Aliases = append(data[i].Aliases, "hooray")
|
||||||
|
}
|
||||||
|
i, ok = aliasMap["laughing"]
|
||||||
|
if ok {
|
||||||
|
data[i].Aliases = append(data[i].Aliases, "laugh")
|
||||||
|
}
|
||||||
|
|
||||||
|
// write a JSON file to use with tribute (write before adding skin tones since we can't support them there yet)
|
||||||
|
file, _ := json.Marshal(data)
|
||||||
|
_ = ioutil.WriteFile("assets/emoji.json", file, 0644)
|
||||||
|
|
||||||
|
// Add skin tones to emoji that support it
|
||||||
|
var (
|
||||||
|
s []string
|
||||||
|
newEmoji string
|
||||||
|
newDescription string
|
||||||
|
newData Emoji
|
||||||
|
)
|
||||||
|
|
||||||
|
for i := range data {
|
||||||
|
if data[i].SkinTones {
|
||||||
|
for k, v := range skinTones {
|
||||||
|
s = strings.Split(data[i].Emoji, "")
|
||||||
|
|
||||||
|
if utf8.RuneCountInString(data[i].Emoji) == 1 {
|
||||||
|
s = append(s, k)
|
||||||
|
} else {
|
||||||
|
// insert into slice after first element because all emoji that support skin tones
|
||||||
|
// have that modifer placed at this spot
|
||||||
|
s = append(s, "")
|
||||||
|
copy(s[2:], s[1:])
|
||||||
|
s[1] = k
|
||||||
|
}
|
||||||
|
|
||||||
|
newEmoji = strings.Join(s, "")
|
||||||
|
newDescription = data[i].Description + ": " + v
|
||||||
|
newAlias := data[i].Aliases[0] + "_" + strings.ReplaceAll(v, " ", "_")
|
||||||
|
|
||||||
|
newData = Emoji{newEmoji, newDescription, []string{newAlias}, "12.0", false}
|
||||||
|
data = append(data, newData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add header
|
||||||
|
str := replacer.Replace(fmt.Sprintf(hdr, gemojiURL, data))
|
||||||
|
|
||||||
|
// change the format of the unicode string
|
||||||
|
str = emojiRE.ReplaceAllStringFunc(str, func(s string) string {
|
||||||
|
var err error
|
||||||
|
s, err = strconv.Unquote(s[len("{Emoji:"):])
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return "{" + strconv.QuoteToASCII(s)
|
||||||
|
})
|
||||||
|
|
||||||
|
// format
|
||||||
|
return format.Source([]byte(str))
|
||||||
|
}
|
||||||
|
|
||||||
|
const hdr = `
|
||||||
|
// Copyright 2020 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 emoji
|
||||||
|
|
||||||
|
// Code generated by gen.go. DO NOT EDIT.
|
||||||
|
// Sourced from %s
|
||||||
|
//
|
||||||
|
var GemojiData = %#v
|
||||||
|
`
|
||||||
@@ -15,16 +15,22 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var (
|
var (
|
||||||
prefix = "gitea-gitignore"
|
prefix = "gitea-gitignore"
|
||||||
url = "https://api.github.com/repos/github/gitignore/tarball"
|
url = "https://api.github.com/repos/github/gitignore/tarball"
|
||||||
destination = ""
|
githubApiToken = ""
|
||||||
|
githubUsername = ""
|
||||||
|
destination = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
flag.StringVar(&destination, "dest", "options/gitignore/", "destination for the gitignores")
|
flag.StringVar(&destination, "dest", "options/gitignore/", "destination for the gitignores")
|
||||||
|
flag.StringVar(&githubUsername, "username", "", "github username")
|
||||||
|
flag.StringVar(&githubApiToken, "token", "", "github api token")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
file, err := ioutil.TempFile(os.TempDir(), prefix)
|
file, err := ioutil.TempFile(os.TempDir(), prefix)
|
||||||
@@ -33,14 +39,21 @@ func main() {
|
|||||||
log.Fatalf("Failed to create temp file. %s", err)
|
log.Fatalf("Failed to create temp file. %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer os.Remove(file.Name())
|
defer util.Remove(file.Name())
|
||||||
|
|
||||||
resp, err := http.Get(url)
|
|
||||||
|
|
||||||
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to download archive. %s", err)
|
log.Fatalf("Failed to download archive. %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(githubApiToken) > 0 && len(githubUsername) > 0 {
|
||||||
|
req.SetBasicAuth(githubUsername, githubApiToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to download archive. %s", err)
|
||||||
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if _, err := io.Copy(file, resp.Body); err != nil {
|
if _, err := io.Copy(file, resp.Body); err != nil {
|
||||||
101
build/generate-images.js
Executable file
101
build/generate-images.js
Executable file
@@ -0,0 +1,101 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const imageminZopfli = require('imagemin-zopfli');
|
||||||
|
const {fabric} = require('fabric');
|
||||||
|
const {DOMParser, XMLSerializer} = require('xmldom');
|
||||||
|
const {readFile, writeFile} = require('fs').promises;
|
||||||
|
const {resolve} = require('path');
|
||||||
|
const Svgo = require('svgo');
|
||||||
|
|
||||||
|
function exit(err) {
|
||||||
|
if (err) console.error(err);
|
||||||
|
process.exit(err ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadSvg(svg) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
fabric.loadSVGFromString(svg, (objects, options) => {
|
||||||
|
resolve({objects, options});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateSvgFavicon(svg, outputFile) {
|
||||||
|
const svgo = new Svgo({
|
||||||
|
plugins: [
|
||||||
|
{removeDimensions: true},
|
||||||
|
{
|
||||||
|
addAttributesToSVGElement: {
|
||||||
|
attributes: [
|
||||||
|
{'width': '32'},
|
||||||
|
{'height': '32'},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const {data} = await svgo.optimize(svg);
|
||||||
|
await writeFile(outputFile, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generate(svg, outputFile, {size, bg, removeDetail} = {}) {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const serializer = new XMLSerializer();
|
||||||
|
const document = parser.parseFromString(svg);
|
||||||
|
|
||||||
|
if (removeDetail) {
|
||||||
|
for (const el of Array.from(document.getElementsByTagName('g') || [])) {
|
||||||
|
for (const attribute of Array.from(el.attributes || [])) {
|
||||||
|
if (attribute.name === 'class' && attribute.value === 'detail-remove') {
|
||||||
|
el.parentNode.removeChild(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
svg = serializer.serializeToString(document);
|
||||||
|
|
||||||
|
const {objects, options} = await loadSvg(svg);
|
||||||
|
const canvas = new fabric.Canvas();
|
||||||
|
canvas.setDimensions({width: size, height: size});
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
ctx.scale(options.width ? (size / options.width) : 1, options.height ? (size / options.height) : 1);
|
||||||
|
|
||||||
|
if (bg) {
|
||||||
|
canvas.add(new fabric.Rect({
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
height: size * (1 / (size / options.height)),
|
||||||
|
width: size * (1 / (size / options.width)),
|
||||||
|
fill: 'white',
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas.add(fabric.util.groupSVGElements(objects, options));
|
||||||
|
canvas.renderAll();
|
||||||
|
|
||||||
|
let png = Buffer.from([]);
|
||||||
|
for await (const chunk of canvas.createPNGStream()) {
|
||||||
|
png = Buffer.concat([png, chunk]);
|
||||||
|
}
|
||||||
|
|
||||||
|
png = await imageminZopfli({more: true})(png);
|
||||||
|
await writeFile(outputFile, png);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const svg = await readFile(resolve(__dirname, '../assets/logo.svg'), 'utf8');
|
||||||
|
await generateSvgFavicon(svg, resolve(__dirname, '../public/img/favicon.svg'));
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/gitea-lg.png'), {size: 880});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/gitea-512.png'), {size: 512});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/gitea-192.png'), {size: 192});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/gitea-sm.png'), {size: 120});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180, removeDetail: true});
|
||||||
|
await generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
main().then(exit).catch(exit);
|
||||||
|
|
||||||
118
build/generate-licenses.go
Normal file
118
build/generate-licenses.go
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"archive/tar"
|
||||||
|
"compress/gzip"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"path"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var (
|
||||||
|
prefix = "gitea-licenses"
|
||||||
|
url = "https://api.github.com/repos/spdx/license-list-data/tarball"
|
||||||
|
githubApiToken = ""
|
||||||
|
githubUsername = ""
|
||||||
|
destination = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
flag.StringVar(&destination, "dest", "options/license/", "destination for the licenses")
|
||||||
|
flag.StringVar(&githubUsername, "username", "", "github username")
|
||||||
|
flag.StringVar(&githubApiToken, "token", "", "github api token")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
file, err := ioutil.TempFile(os.TempDir(), prefix)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to create temp file. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
defer util.Remove(file.Name())
|
||||||
|
|
||||||
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to download archive. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(githubApiToken) > 0 && len(githubUsername) > 0 {
|
||||||
|
req.SetBasicAuth(githubUsername, githubApiToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to download archive. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if _, err := io.Copy(file, resp.Body); err != nil {
|
||||||
|
log.Fatalf("Failed to copy archive to file. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := file.Seek(0, 0); err != nil {
|
||||||
|
log.Fatalf("Failed to reset seek on archive. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gz, err := gzip.NewReader(file)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to gunzip the archive. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
tr := tar.NewReader(gz)
|
||||||
|
|
||||||
|
for {
|
||||||
|
hdr, err := tr.Next()
|
||||||
|
|
||||||
|
if err == io.EOF {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to iterate archive. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !strings.Contains(hdr.Name, "/text/") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if filepath.Ext(hdr.Name) != ".txt" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(filepath.Base(hdr.Name), "README") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(filepath.Base(hdr.Name), "deprecated_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
out, err := os.Create(path.Join(destination, strings.TrimSuffix(filepath.Base(hdr.Name), ".txt")))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to create new file. %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
defer out.Close()
|
||||||
|
|
||||||
|
if _, err := io.Copy(out, tr); err != nil {
|
||||||
|
log.Fatalf("Failed to write new file. %s", err)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("Written %s\n", out.Name())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Done")
|
||||||
|
}
|
||||||
65
build/generate-svg.js
Executable file
65
build/generate-svg.js
Executable file
@@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fastGlob = require('fast-glob');
|
||||||
|
const Svgo = require('svgo');
|
||||||
|
const {resolve, parse} = require('path');
|
||||||
|
const {readFile, writeFile, mkdir} = require('fs').promises;
|
||||||
|
|
||||||
|
const glob = (pattern) => fastGlob.sync(pattern, {cwd: resolve(__dirname), absolute: true});
|
||||||
|
const outputDir = resolve(__dirname, '../public/img/svg');
|
||||||
|
|
||||||
|
function exit(err) {
|
||||||
|
if (err) console.error(err);
|
||||||
|
process.exit(err ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function processFile(file, {prefix = ''} = {}) {
|
||||||
|
let name = parse(file).name;
|
||||||
|
if (prefix) name = `${prefix}-${name}`;
|
||||||
|
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
|
||||||
|
|
||||||
|
const svgo = new Svgo({
|
||||||
|
plugins: [
|
||||||
|
{removeXMLNS: true},
|
||||||
|
{removeDimensions: true},
|
||||||
|
{
|
||||||
|
addClassesToSVGElement: {
|
||||||
|
classNames: [
|
||||||
|
'svg',
|
||||||
|
name,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
addAttributesToSVGElement: {
|
||||||
|
attributes: [
|
||||||
|
{'width': '16'},
|
||||||
|
{'height': '16'},
|
||||||
|
{'aria-hidden': 'true'},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const {data} = await svgo.optimize(await readFile(file, 'utf8'));
|
||||||
|
await writeFile(resolve(outputDir, `${name}.svg`), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
try {
|
||||||
|
await mkdir(outputDir);
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
for (const file of glob('../node_modules/@primer/octicons/build/svg/*-16.svg')) {
|
||||||
|
await processFile(file, {prefix: 'octicon'});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const file of glob('../web_src/svg/*.svg')) {
|
||||||
|
await processFile(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main().then(exit).catch(exit);
|
||||||
|
|
||||||
119
build/gocovmerge.go
Normal file
119
build/gocovmerge.go
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||||
|
// Copyright (c) 2015, Wade Simmons
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// gocovmerge takes the results from multiple `go test -coverprofile` runs and
|
||||||
|
// merges them into one profile
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"sort"
|
||||||
|
|
||||||
|
"golang.org/x/tools/cover"
|
||||||
|
)
|
||||||
|
|
||||||
|
func mergeProfiles(p *cover.Profile, merge *cover.Profile) {
|
||||||
|
if p.Mode != merge.Mode {
|
||||||
|
log.Fatalf("cannot merge profiles with different modes")
|
||||||
|
}
|
||||||
|
// Since the blocks are sorted, we can keep track of where the last block
|
||||||
|
// was inserted and only look at the blocks after that as targets for merge
|
||||||
|
startIndex := 0
|
||||||
|
for _, b := range merge.Blocks {
|
||||||
|
startIndex = mergeProfileBlock(p, b, startIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) int {
|
||||||
|
sortFunc := func(i int) bool {
|
||||||
|
pi := p.Blocks[i+startIndex]
|
||||||
|
return pi.StartLine >= pb.StartLine && (pi.StartLine != pb.StartLine || pi.StartCol >= pb.StartCol)
|
||||||
|
}
|
||||||
|
|
||||||
|
i := 0
|
||||||
|
if sortFunc(i) != true {
|
||||||
|
i = sort.Search(len(p.Blocks)-startIndex, sortFunc)
|
||||||
|
}
|
||||||
|
i += startIndex
|
||||||
|
if i < len(p.Blocks) && p.Blocks[i].StartLine == pb.StartLine && p.Blocks[i].StartCol == pb.StartCol {
|
||||||
|
if p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {
|
||||||
|
log.Fatalf("OVERLAP MERGE: %v %v %v", p.FileName, p.Blocks[i], pb)
|
||||||
|
}
|
||||||
|
switch p.Mode {
|
||||||
|
case "set":
|
||||||
|
p.Blocks[i].Count |= pb.Count
|
||||||
|
case "count", "atomic":
|
||||||
|
p.Blocks[i].Count += pb.Count
|
||||||
|
default:
|
||||||
|
log.Fatalf("unsupported covermode: '%s'", p.Mode)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if i > 0 {
|
||||||
|
pa := p.Blocks[i-1]
|
||||||
|
if pa.EndLine >= pb.EndLine && (pa.EndLine != pb.EndLine || pa.EndCol > pb.EndCol) {
|
||||||
|
log.Fatalf("OVERLAP BEFORE: %v %v %v", p.FileName, pa, pb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if i < len(p.Blocks)-1 {
|
||||||
|
pa := p.Blocks[i+1]
|
||||||
|
if pa.StartLine <= pb.StartLine && (pa.StartLine != pb.StartLine || pa.StartCol < pb.StartCol) {
|
||||||
|
log.Fatalf("OVERLAP AFTER: %v %v %v", p.FileName, pa, pb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p.Blocks = append(p.Blocks, cover.ProfileBlock{})
|
||||||
|
copy(p.Blocks[i+1:], p.Blocks[i:])
|
||||||
|
p.Blocks[i] = pb
|
||||||
|
}
|
||||||
|
return i + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func addProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile {
|
||||||
|
i := sort.Search(len(profiles), func(i int) bool { return profiles[i].FileName >= p.FileName })
|
||||||
|
if i < len(profiles) && profiles[i].FileName == p.FileName {
|
||||||
|
mergeProfiles(profiles[i], p)
|
||||||
|
} else {
|
||||||
|
profiles = append(profiles, nil)
|
||||||
|
copy(profiles[i+1:], profiles[i:])
|
||||||
|
profiles[i] = p
|
||||||
|
}
|
||||||
|
return profiles
|
||||||
|
}
|
||||||
|
|
||||||
|
func dumpProfiles(profiles []*cover.Profile, out io.Writer) {
|
||||||
|
if len(profiles) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Fprintf(out, "mode: %s\n", profiles[0].Mode)
|
||||||
|
for _, p := range profiles {
|
||||||
|
for _, b := range p.Blocks {
|
||||||
|
fmt.Fprintf(out, "%s:%d.%d,%d.%d %d %d\n", p.FileName, b.StartLine, b.StartCol, b.EndLine, b.EndCol, b.NumStmt, b.Count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
var merged []*cover.Profile
|
||||||
|
|
||||||
|
for _, file := range flag.Args() {
|
||||||
|
profiles, err := cover.ParseProfiles(file)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to parse profiles: %v", err)
|
||||||
|
}
|
||||||
|
for _, p := range profiles {
|
||||||
|
merged = addProfile(merged, p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dumpProfiles(merged, os.Stdout)
|
||||||
|
}
|
||||||
325
build/lint.go
Normal file
325
build/lint.go
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||||
|
// Copyright (c) 2018 Minko Gechev. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mgechev/dots"
|
||||||
|
"github.com/mgechev/revive/formatter"
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
"github.com/mgechev/revive/rule"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
|
"github.com/pelletier/go-toml"
|
||||||
|
)
|
||||||
|
|
||||||
|
func fail(err string) {
|
||||||
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultRules = []lint.Rule{
|
||||||
|
&rule.VarDeclarationsRule{},
|
||||||
|
&rule.PackageCommentsRule{},
|
||||||
|
&rule.DotImportsRule{},
|
||||||
|
&rule.BlankImportsRule{},
|
||||||
|
&rule.ExportedRule{},
|
||||||
|
&rule.VarNamingRule{},
|
||||||
|
&rule.IndentErrorFlowRule{},
|
||||||
|
&rule.IfReturnRule{},
|
||||||
|
&rule.RangeRule{},
|
||||||
|
&rule.ErrorfRule{},
|
||||||
|
&rule.ErrorNamingRule{},
|
||||||
|
&rule.ErrorStringsRule{},
|
||||||
|
&rule.ReceiverNamingRule{},
|
||||||
|
&rule.IncrementDecrementRule{},
|
||||||
|
&rule.ErrorReturnRule{},
|
||||||
|
&rule.UnexportedReturnRule{},
|
||||||
|
&rule.TimeNamingRule{},
|
||||||
|
&rule.ContextKeysType{},
|
||||||
|
&rule.ContextAsArgumentRule{},
|
||||||
|
}
|
||||||
|
|
||||||
|
var allRules = append([]lint.Rule{
|
||||||
|
&rule.ArgumentsLimitRule{},
|
||||||
|
&rule.CyclomaticRule{},
|
||||||
|
&rule.FileHeaderRule{},
|
||||||
|
&rule.EmptyBlockRule{},
|
||||||
|
&rule.SuperfluousElseRule{},
|
||||||
|
&rule.ConfusingNamingRule{},
|
||||||
|
&rule.GetReturnRule{},
|
||||||
|
&rule.ModifiesParamRule{},
|
||||||
|
&rule.ConfusingResultsRule{},
|
||||||
|
&rule.DeepExitRule{},
|
||||||
|
&rule.UnusedParamRule{},
|
||||||
|
&rule.UnreachableCodeRule{},
|
||||||
|
&rule.AddConstantRule{},
|
||||||
|
&rule.FlagParamRule{},
|
||||||
|
&rule.UnnecessaryStmtRule{},
|
||||||
|
&rule.StructTagRule{},
|
||||||
|
&rule.ModifiesValRecRule{},
|
||||||
|
&rule.ConstantLogicalExprRule{},
|
||||||
|
&rule.BoolLiteralRule{},
|
||||||
|
&rule.RedefinesBuiltinIDRule{},
|
||||||
|
&rule.ImportsBlacklistRule{},
|
||||||
|
&rule.FunctionResultsLimitRule{},
|
||||||
|
&rule.MaxPublicStructsRule{},
|
||||||
|
&rule.RangeValInClosureRule{},
|
||||||
|
&rule.RangeValAddress{},
|
||||||
|
&rule.WaitGroupByValueRule{},
|
||||||
|
&rule.AtomicRule{},
|
||||||
|
&rule.EmptyLinesRule{},
|
||||||
|
&rule.LineLengthLimitRule{},
|
||||||
|
&rule.CallToGCRule{},
|
||||||
|
&rule.DuplicatedImportsRule{},
|
||||||
|
&rule.ImportShadowingRule{},
|
||||||
|
&rule.BareReturnRule{},
|
||||||
|
&rule.UnusedReceiverRule{},
|
||||||
|
&rule.UnhandledErrorRule{},
|
||||||
|
&rule.CognitiveComplexityRule{},
|
||||||
|
&rule.StringOfIntRule{},
|
||||||
|
}, defaultRules...)
|
||||||
|
|
||||||
|
var allFormatters = []lint.Formatter{
|
||||||
|
&formatter.Stylish{},
|
||||||
|
&formatter.Friendly{},
|
||||||
|
&formatter.JSON{},
|
||||||
|
&formatter.NDJSON{},
|
||||||
|
&formatter.Default{},
|
||||||
|
&formatter.Unix{},
|
||||||
|
&formatter.Checkstyle{},
|
||||||
|
&formatter.Plain{},
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFormatters() map[string]lint.Formatter {
|
||||||
|
result := map[string]lint.Formatter{}
|
||||||
|
for _, f := range allFormatters {
|
||||||
|
result[f.Name()] = f
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLintingRules(config *lint.Config) []lint.Rule {
|
||||||
|
rulesMap := map[string]lint.Rule{}
|
||||||
|
for _, r := range allRules {
|
||||||
|
rulesMap[r.Name()] = r
|
||||||
|
}
|
||||||
|
|
||||||
|
lintingRules := []lint.Rule{}
|
||||||
|
for name := range config.Rules {
|
||||||
|
rule, ok := rulesMap[name]
|
||||||
|
if !ok {
|
||||||
|
fail("cannot find rule: " + name)
|
||||||
|
}
|
||||||
|
lintingRules = append(lintingRules, rule)
|
||||||
|
}
|
||||||
|
|
||||||
|
return lintingRules
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseConfig(path string) *lint.Config {
|
||||||
|
config := &lint.Config{}
|
||||||
|
file, err := ioutil.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
|
fail("cannot read the config file")
|
||||||
|
}
|
||||||
|
err = toml.Unmarshal(file, config)
|
||||||
|
if err != nil {
|
||||||
|
fail("cannot parse the config file: " + err.Error())
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
func normalizeConfig(config *lint.Config) {
|
||||||
|
if config.Confidence == 0 {
|
||||||
|
config.Confidence = 0.8
|
||||||
|
}
|
||||||
|
severity := config.Severity
|
||||||
|
if severity != "" {
|
||||||
|
for k, v := range config.Rules {
|
||||||
|
if v.Severity == "" {
|
||||||
|
v.Severity = severity
|
||||||
|
}
|
||||||
|
config.Rules[k] = v
|
||||||
|
}
|
||||||
|
for k, v := range config.Directives {
|
||||||
|
if v.Severity == "" {
|
||||||
|
v.Severity = severity
|
||||||
|
}
|
||||||
|
config.Directives[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getConfig() *lint.Config {
|
||||||
|
config := defaultConfig()
|
||||||
|
if configPath != "" {
|
||||||
|
config = parseConfig(configPath)
|
||||||
|
}
|
||||||
|
normalizeConfig(config)
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFormatter() lint.Formatter {
|
||||||
|
formatters := getFormatters()
|
||||||
|
formatter := formatters["default"]
|
||||||
|
if formatterName != "" {
|
||||||
|
f, ok := formatters[formatterName]
|
||||||
|
if !ok {
|
||||||
|
fail("unknown formatter " + formatterName)
|
||||||
|
}
|
||||||
|
formatter = f
|
||||||
|
}
|
||||||
|
return formatter
|
||||||
|
}
|
||||||
|
|
||||||
|
func buildDefaultConfigPath() string {
|
||||||
|
var result string
|
||||||
|
if homeDir, err := homedir.Dir(); err == nil {
|
||||||
|
result = filepath.Join(homeDir, "revive.toml")
|
||||||
|
if _, err := os.Stat(result); err != nil {
|
||||||
|
result = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func defaultConfig() *lint.Config {
|
||||||
|
defaultConfig := lint.Config{
|
||||||
|
Confidence: 0.0,
|
||||||
|
Severity: lint.SeverityWarning,
|
||||||
|
Rules: map[string]lint.RuleConfig{},
|
||||||
|
}
|
||||||
|
for _, r := range defaultRules {
|
||||||
|
defaultConfig.Rules[r.Name()] = lint.RuleConfig{}
|
||||||
|
}
|
||||||
|
return &defaultConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
func normalizeSplit(strs []string) []string {
|
||||||
|
res := []string{}
|
||||||
|
for _, s := range strs {
|
||||||
|
t := strings.Trim(s, " \t")
|
||||||
|
if len(t) > 0 {
|
||||||
|
res = append(res, t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
func getPackages() [][]string {
|
||||||
|
globs := normalizeSplit(flag.Args())
|
||||||
|
if len(globs) == 0 {
|
||||||
|
globs = append(globs, ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
packages, err := dots.ResolvePackages(globs, normalizeSplit(excludePaths))
|
||||||
|
if err != nil {
|
||||||
|
fail(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return packages
|
||||||
|
}
|
||||||
|
|
||||||
|
type arrayFlags []string
|
||||||
|
|
||||||
|
func (i *arrayFlags) String() string {
|
||||||
|
return strings.Join([]string(*i), " ")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i *arrayFlags) Set(value string) error {
|
||||||
|
*i = append(*i, value)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var configPath string
|
||||||
|
var excludePaths arrayFlags
|
||||||
|
var formatterName string
|
||||||
|
var help bool
|
||||||
|
|
||||||
|
var originalUsage = flag.Usage
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
flag.Usage = func() {
|
||||||
|
originalUsage()
|
||||||
|
}
|
||||||
|
// command line help strings
|
||||||
|
const (
|
||||||
|
configUsage = "path to the configuration TOML file, defaults to $HOME/revive.toml, if present (i.e. -config myconf.toml)"
|
||||||
|
excludeUsage = "list of globs which specify files to be excluded (i.e. -exclude foo/...)"
|
||||||
|
formatterUsage = "formatter to be used for the output (i.e. -formatter stylish)"
|
||||||
|
)
|
||||||
|
|
||||||
|
defaultConfigPath := buildDefaultConfigPath()
|
||||||
|
|
||||||
|
flag.StringVar(&configPath, "config", defaultConfigPath, configUsage)
|
||||||
|
flag.Var(&excludePaths, "exclude", excludeUsage)
|
||||||
|
flag.StringVar(&formatterName, "formatter", "", formatterUsage)
|
||||||
|
flag.Parse()
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
config := getConfig()
|
||||||
|
formatter := getFormatter()
|
||||||
|
packages := getPackages()
|
||||||
|
|
||||||
|
revive := lint.New(func(file string) ([]byte, error) {
|
||||||
|
return ioutil.ReadFile(file)
|
||||||
|
})
|
||||||
|
|
||||||
|
lintingRules := getLintingRules(config)
|
||||||
|
|
||||||
|
failures, err := revive.Lint(packages, lintingRules, *config)
|
||||||
|
if err != nil {
|
||||||
|
fail(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
formatChan := make(chan lint.Failure)
|
||||||
|
exitChan := make(chan bool)
|
||||||
|
|
||||||
|
var output string
|
||||||
|
go (func() {
|
||||||
|
output, err = formatter.Format(formatChan, *config)
|
||||||
|
if err != nil {
|
||||||
|
fail(err.Error())
|
||||||
|
}
|
||||||
|
exitChan <- true
|
||||||
|
})()
|
||||||
|
|
||||||
|
exitCode := 0
|
||||||
|
for f := range failures {
|
||||||
|
if f.Confidence < config.Confidence {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if exitCode == 0 {
|
||||||
|
exitCode = config.WarningCode
|
||||||
|
}
|
||||||
|
if c, ok := config.Rules[f.RuleName]; ok && c.Severity == lint.SeverityError {
|
||||||
|
exitCode = config.ErrorCode
|
||||||
|
}
|
||||||
|
if c, ok := config.Directives[f.RuleName]; ok && c.Severity == lint.SeverityError {
|
||||||
|
exitCode = config.ErrorCode
|
||||||
|
}
|
||||||
|
|
||||||
|
formatChan <- f
|
||||||
|
}
|
||||||
|
|
||||||
|
close(formatChan)
|
||||||
|
<-exitChan
|
||||||
|
if output != "" {
|
||||||
|
fmt.Println(output)
|
||||||
|
}
|
||||||
|
|
||||||
|
os.Exit(exitCode)
|
||||||
|
}
|
||||||
46
cmd/admin.go
46
cmd/admin.go
@@ -6,6 +6,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
@@ -146,6 +147,32 @@ var (
|
|||||||
Name: "list",
|
Name: "list",
|
||||||
Usage: "List auth sources",
|
Usage: "List auth sources",
|
||||||
Action: runListAuth,
|
Action: runListAuth,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.IntFlag{
|
||||||
|
Name: "min-width",
|
||||||
|
Usage: "Minimal cell width including any padding for the formatted table",
|
||||||
|
Value: 0,
|
||||||
|
},
|
||||||
|
cli.IntFlag{
|
||||||
|
Name: "tab-width",
|
||||||
|
Usage: "width of tab characters in formatted table (equivalent number of spaces)",
|
||||||
|
Value: 8,
|
||||||
|
},
|
||||||
|
cli.IntFlag{
|
||||||
|
Name: "padding",
|
||||||
|
Usage: "padding added to a cell before computing its width",
|
||||||
|
Value: 1,
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "pad-char",
|
||||||
|
Usage: `ASCII char used for padding if padchar == '\\t', the Writer will assume that the width of a '\\t' in the formatted output is tabwidth, and cells are left-aligned independent of align_left (for correct-looking results, tabwidth must correspond to the tab width in the viewer displaying the result)`,
|
||||||
|
Value: "\t",
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "vertical-bars",
|
||||||
|
Usage: "Set to true to print vertical bars between columns",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
idFlag = cli.Int64Flag{
|
idFlag = cli.Int64Flag{
|
||||||
@@ -239,6 +266,13 @@ func runChangePassword(c *cli.Context) error {
|
|||||||
if !pwd.IsComplexEnough(c.String("password")) {
|
if !pwd.IsComplexEnough(c.String("password")) {
|
||||||
return errors.New("Password does not meet complexity requirements")
|
return errors.New("Password does not meet complexity requirements")
|
||||||
}
|
}
|
||||||
|
pwned, err := pwd.IsPwned(context.Background(), c.String("password"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if pwned {
|
||||||
|
return errors.New("The password you chose is on a list of stolen passwords previously exposed in public data breaches. Please try again with a different password.\nFor more details, see https://haveibeenpwned.com/Passwords")
|
||||||
|
}
|
||||||
uname := c.String("username")
|
uname := c.String("username")
|
||||||
user, err := models.GetUserByName(uname)
|
user, err := models.GetUserByName(uname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -535,8 +569,18 @@ func runListAuth(c *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flags := tabwriter.AlignRight
|
||||||
|
if c.Bool("vertical-bars") {
|
||||||
|
flags |= tabwriter.Debug
|
||||||
|
}
|
||||||
|
|
||||||
|
padChar := byte('\t')
|
||||||
|
if len(c.String("pad-char")) > 0 {
|
||||||
|
padChar = c.String("pad-char")[0]
|
||||||
|
}
|
||||||
|
|
||||||
// loop through each source and print
|
// loop through each source and print
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)
|
w := tabwriter.NewWriter(os.Stdout, c.Int("min-width"), c.Int("tab-width"), c.Int("padding"), padChar, flags)
|
||||||
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
|
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
|
||||||
for _, source := range loginSources {
|
for _, source := range loginSources {
|
||||||
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, models.LoginNames[source.Type], source.IsActived)
|
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, models.LoginNames[source.Type], source.IsActived)
|
||||||
|
|||||||
584
cmd/doctor.go
584
cmd/doctor.go
@@ -6,18 +6,27 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"bytes"
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
golog "log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/tabwriter"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models"
|
||||||
|
"code.gitea.io/gitea/models/migrations"
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/options"
|
"code.gitea.io/gitea/modules/options"
|
||||||
|
"code.gitea.io/gitea/modules/repository"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
"xorm.io/builder"
|
||||||
|
"xorm.io/xorm"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@@ -28,10 +37,59 @@ var CmdDoctor = cli.Command{
|
|||||||
Usage: "Diagnose problems",
|
Usage: "Diagnose problems",
|
||||||
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration.",
|
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration.",
|
||||||
Action: runDoctor,
|
Action: runDoctor,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "list",
|
||||||
|
Usage: "List the available checks",
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "default",
|
||||||
|
Usage: "Run the default checks (if neither --run or --all is set, this is the default behaviour)",
|
||||||
|
},
|
||||||
|
cli.StringSliceFlag{
|
||||||
|
Name: "run",
|
||||||
|
Usage: "Run the provided checks - (if --default is set, the default checks will also run)",
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "all",
|
||||||
|
Usage: "Run all the available checks",
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "fix",
|
||||||
|
Usage: "Automatically fix what we can",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "log-file",
|
||||||
|
Usage: `Name of the log file (default: "doctor.log"). Set to "-" to output to stdout, set to "" to disable`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Subcommands: []cli.Command{
|
||||||
|
cmdRecreateTable,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmdRecreateTable = cli.Command{
|
||||||
|
Name: "recreate-table",
|
||||||
|
Usage: "Recreate tables from XORM definitions and copy the data.",
|
||||||
|
ArgsUsage: "[TABLE]... : (TABLEs to recreate - leave blank for all)",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
Usage: "Print SQL commands sent",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Description: `The database definitions Gitea uses change across versions, sometimes changing default values and leaving old unused columns.
|
||||||
|
|
||||||
|
This command will cause Xorm to recreate tables, copying over the data and deleting the old table.
|
||||||
|
|
||||||
|
You should back-up your database before doing this and ensure that your database is up-to-date first.`,
|
||||||
|
Action: runRecreateTable,
|
||||||
}
|
}
|
||||||
|
|
||||||
type check struct {
|
type check struct {
|
||||||
title string
|
title string
|
||||||
|
name string
|
||||||
|
isDefault bool
|
||||||
f func(ctx *cli.Context) ([]string, error)
|
f func(ctx *cli.Context) ([]string, error)
|
||||||
abortIfFailed bool
|
abortIfFailed bool
|
||||||
skipDatabaseInit bool
|
skipDatabaseInit bool
|
||||||
@@ -42,30 +100,183 @@ var checklist = []check{
|
|||||||
{
|
{
|
||||||
// NOTE: this check should be the first in the list
|
// NOTE: this check should be the first in the list
|
||||||
title: "Check paths and basic configuration",
|
title: "Check paths and basic configuration",
|
||||||
|
name: "paths",
|
||||||
|
isDefault: true,
|
||||||
f: runDoctorPathInfo,
|
f: runDoctorPathInfo,
|
||||||
abortIfFailed: true,
|
abortIfFailed: true,
|
||||||
skipDatabaseInit: true,
|
skipDatabaseInit: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Check if OpenSSH authorized_keys file id correct",
|
title: "Check Database Version",
|
||||||
f: runDoctorLocationMoved,
|
name: "check-db-version",
|
||||||
|
isDefault: true,
|
||||||
|
f: runDoctorCheckDBVersion,
|
||||||
|
abortIfFailed: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Check consistency of database",
|
||||||
|
name: "check-db-consistency",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorCheckDBConsistency,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Check if OpenSSH authorized_keys file is up-to-date",
|
||||||
|
name: "authorized_keys",
|
||||||
|
isDefault: true,
|
||||||
|
f: runDoctorAuthorizedKeys,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Check if SCRIPT_TYPE is available",
|
||||||
|
name: "script-type",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorScriptType,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Check if hook files are up-to-date and executable",
|
||||||
|
name: "hooks",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorHooks,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Recalculate merge bases",
|
||||||
|
name: "recalculate_merge_bases",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorPRMergeBase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Recalculate Stars number for all user",
|
||||||
|
name: "recalculate_stars_number",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorUserStarNum,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Enable push options",
|
||||||
|
name: "enable-push-options",
|
||||||
|
isDefault: false,
|
||||||
|
f: runDoctorEnablePushOptions,
|
||||||
},
|
},
|
||||||
// more checks please append here
|
// more checks please append here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runRecreateTable(ctx *cli.Context) error {
|
||||||
|
// Redirect the default golog to here
|
||||||
|
golog.SetFlags(0)
|
||||||
|
golog.SetPrefix("")
|
||||||
|
golog.SetOutput(log.NewLoggerAsWriter("INFO", log.GetLogger(log.DEFAULT)))
|
||||||
|
|
||||||
|
setting.NewContext()
|
||||||
|
setting.InitDBConfig()
|
||||||
|
|
||||||
|
setting.EnableXORMLog = ctx.Bool("debug")
|
||||||
|
setting.Database.LogSQL = ctx.Bool("debug")
|
||||||
|
setting.Cfg.Section("log").Key("XORM").SetValue(",")
|
||||||
|
|
||||||
|
setting.NewXORMLogService(!ctx.Bool("debug"))
|
||||||
|
if err := models.SetEngine(); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
args := ctx.Args()
|
||||||
|
names := make([]string, 0, ctx.NArg())
|
||||||
|
for i := 0; i < ctx.NArg(); i++ {
|
||||||
|
names = append(names, args.Get(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
beans, err := models.NamesToBean(names...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
recreateTables := migrations.RecreateTables(beans...)
|
||||||
|
|
||||||
|
return models.NewEngine(context.Background(), func(x *xorm.Engine) error {
|
||||||
|
if err := migrations.EnsureUpToDate(x); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return recreateTables(x)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func runDoctor(ctx *cli.Context) error {
|
func runDoctor(ctx *cli.Context) error {
|
||||||
|
|
||||||
// Silence the console logger
|
// Silence the default loggers
|
||||||
// TODO: Redirect all logs into `doctor.log` ignoring any other log configuration
|
|
||||||
log.DelNamedLogger("console")
|
log.DelNamedLogger("console")
|
||||||
log.DelNamedLogger(log.DEFAULT)
|
log.DelNamedLogger(log.DEFAULT)
|
||||||
|
|
||||||
|
// Now setup our own
|
||||||
|
logFile := ctx.String("log-file")
|
||||||
|
if !ctx.IsSet("log-file") {
|
||||||
|
logFile = "doctor.log"
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(logFile) == 0 {
|
||||||
|
log.NewLogger(1000, "doctor", "console", `{"level":"NONE","stacktracelevel":"NONE","colorize":"%t"}`)
|
||||||
|
} else if logFile == "-" {
|
||||||
|
log.NewLogger(1000, "doctor", "console", `{"level":"trace","stacktracelevel":"NONE"}`)
|
||||||
|
} else {
|
||||||
|
log.NewLogger(1000, "doctor", "file", fmt.Sprintf(`{"filename":%q,"level":"trace","stacktracelevel":"NONE"}`, logFile))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally redirect the default golog to here
|
||||||
|
golog.SetFlags(0)
|
||||||
|
golog.SetPrefix("")
|
||||||
|
golog.SetOutput(log.NewLoggerAsWriter("INFO", log.GetLogger(log.DEFAULT)))
|
||||||
|
|
||||||
|
if ctx.IsSet("list") {
|
||||||
|
w := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0)
|
||||||
|
_, _ = w.Write([]byte("Default\tName\tTitle\n"))
|
||||||
|
for _, check := range checklist {
|
||||||
|
if check.isDefault {
|
||||||
|
_, _ = w.Write([]byte{'*'})
|
||||||
|
}
|
||||||
|
_, _ = w.Write([]byte{'\t'})
|
||||||
|
_, _ = w.Write([]byte(check.name))
|
||||||
|
_, _ = w.Write([]byte{'\t'})
|
||||||
|
_, _ = w.Write([]byte(check.title))
|
||||||
|
_, _ = w.Write([]byte{'\n'})
|
||||||
|
}
|
||||||
|
return w.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
|
var checks []check
|
||||||
|
if ctx.Bool("all") {
|
||||||
|
checks = checklist
|
||||||
|
} else if ctx.IsSet("run") {
|
||||||
|
addDefault := ctx.Bool("default")
|
||||||
|
names := ctx.StringSlice("run")
|
||||||
|
for i, name := range names {
|
||||||
|
names[i] = strings.ToLower(strings.TrimSpace(name))
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, check := range checklist {
|
||||||
|
if addDefault && check.isDefault {
|
||||||
|
checks = append(checks, check)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for _, name := range names {
|
||||||
|
if name == check.name {
|
||||||
|
checks = append(checks, check)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, check := range checklist {
|
||||||
|
if check.isDefault {
|
||||||
|
checks = append(checks, check)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dbIsInit := false
|
dbIsInit := false
|
||||||
|
|
||||||
for i, check := range checklist {
|
for i, check := range checks {
|
||||||
if !dbIsInit && !check.skipDatabaseInit {
|
if !dbIsInit && !check.skipDatabaseInit {
|
||||||
// Only open database after the most basic configuration check
|
// Only open database after the most basic configuration check
|
||||||
if err := initDB(); err != nil {
|
setting.EnableXORMLog = false
|
||||||
|
if err := initDBDisableConsole(true); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")
|
fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")
|
||||||
return nil
|
return nil
|
||||||
@@ -90,14 +301,6 @@ func runDoctor(ctx *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func exePath() (string, error) {
|
|
||||||
file, err := exec.LookPath(os.Args[0])
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return filepath.Abs(file)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runDoctorPathInfo(ctx *cli.Context) ([]string, error) {
|
func runDoctorPathInfo(ctx *cli.Context) ([]string, error) {
|
||||||
|
|
||||||
res := make([]string, 0, 10)
|
res := make([]string, 0, 10)
|
||||||
@@ -115,16 +318,31 @@ func runDoctorPathInfo(ctx *cli.Context) ([]string, error) {
|
|||||||
|
|
||||||
check := func(name, path string, is_dir, required, is_write bool) {
|
check := func(name, path string, is_dir, required, is_write bool) {
|
||||||
res = append(res, fmt.Sprintf("%-25s '%s'", name+":", path))
|
res = append(res, fmt.Sprintf("%-25s '%s'", name+":", path))
|
||||||
if fi, err := os.Stat(path); err != nil {
|
fi, err := os.Stat(path)
|
||||||
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) && ctx.Bool("fix") && is_dir {
|
||||||
|
if err := os.MkdirAll(path, 0777); err != nil {
|
||||||
|
res = append(res, fmt.Sprintf(" ERROR: %v", err))
|
||||||
|
fail = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fi, err = os.Stat(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
if required {
|
if required {
|
||||||
res = append(res, fmt.Sprintf(" ERROR: %v", err))
|
res = append(res, fmt.Sprintf(" ERROR: %v", err))
|
||||||
fail = true
|
fail = true
|
||||||
} else {
|
return
|
||||||
res = append(res, fmt.Sprintf(" NOTICE: not accessible (%v)", err))
|
|
||||||
}
|
}
|
||||||
} else if is_dir && !fi.IsDir() {
|
res = append(res, fmt.Sprintf(" NOTICE: not accessible (%v)", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if is_dir && !fi.IsDir() {
|
||||||
res = append(res, " ERROR: not a directory")
|
res = append(res, " ERROR: not a directory")
|
||||||
fail = true
|
fail = true
|
||||||
|
return
|
||||||
} else if !is_dir && !fi.Mode().IsRegular() {
|
} else if !is_dir && !fi.Mode().IsRegular() {
|
||||||
res = append(res, " ERROR: not a regular file")
|
res = append(res, " ERROR: not a regular file")
|
||||||
fail = true
|
fail = true
|
||||||
@@ -164,14 +382,16 @@ func runDoctorWritableDir(path string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := os.Remove(tmpFile.Name()); err != nil {
|
if err := util.Remove(tmpFile.Name()); err != nil {
|
||||||
fmt.Printf("Warning: can't remove temporary file: '%s'\n", tmpFile.Name())
|
fmt.Printf("Warning: can't remove temporary file: '%s'\n", tmpFile.Name())
|
||||||
}
|
}
|
||||||
tmpFile.Close()
|
tmpFile.Close()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func runDoctorLocationMoved(ctx *cli.Context) ([]string, error) {
|
const tplCommentPrefix = `# gitea public key`
|
||||||
|
|
||||||
|
func runDoctorAuthorizedKeys(ctx *cli.Context) ([]string, error) {
|
||||||
if setting.SSH.StartBuiltinServer || !setting.SSH.CreateAuthorizedKeysFile {
|
if setting.SSH.StartBuiltinServer || !setting.SSH.CreateAuthorizedKeysFile {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -179,49 +399,303 @@ func runDoctorLocationMoved(ctx *cli.Context) ([]string, error) {
|
|||||||
fPath := filepath.Join(setting.SSH.RootPath, "authorized_keys")
|
fPath := filepath.Join(setting.SSH.RootPath, "authorized_keys")
|
||||||
f, err := os.Open(fPath)
|
f, err := os.Open(fPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
return []string{fmt.Sprintf("Error whilst opening authorized_keys: %v. Attempting regeneration", err)}, models.RewriteAllPublicKeys()
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
var firstline string
|
linesInAuthorizedKeys := map[string]bool{}
|
||||||
|
|
||||||
scanner := bufio.NewScanner(f)
|
scanner := bufio.NewScanner(f)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
firstline = strings.TrimSpace(scanner.Text())
|
line := scanner.Text()
|
||||||
if len(firstline) == 0 || firstline[0] == '#' {
|
if strings.HasPrefix(line, tplCommentPrefix) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
break
|
linesInAuthorizedKeys[line] = true
|
||||||
}
|
}
|
||||||
|
f.Close()
|
||||||
|
|
||||||
// command="/Volumes/data/Projects/gitea/gitea/gitea --config
|
// now we regenerate and check if there are any lines missing
|
||||||
if len(firstline) > 0 {
|
regenerated := &bytes.Buffer{}
|
||||||
exp := regexp.MustCompile(`^[ \t]*(?:command=")([^ ]+) --config='([^']+)' serv key-([^"]+)",(?:[^ ]+) ssh-rsa ([^ ]+) ([^ ]+)[ \t]*$`)
|
if err := models.RegeneratePublicKeys(regenerated); err != nil {
|
||||||
|
return nil, err
|
||||||
// command="/home/user/gitea --config='/home/user/etc/app.ini' serv key-999",option-1,option-2,option-n ssh-rsa public-key-value key-name
|
}
|
||||||
res := exp.FindStringSubmatch(firstline)
|
scanner = bufio.NewScanner(regenerated)
|
||||||
if res == nil {
|
for scanner.Scan() {
|
||||||
return nil, errors.New("Unknow authorized_keys format")
|
line := scanner.Text()
|
||||||
}
|
if strings.HasPrefix(line, tplCommentPrefix) {
|
||||||
|
continue
|
||||||
giteaPath := res[1] // => /home/user/gitea
|
}
|
||||||
iniPath := res[2] // => /home/user/etc/app.ini
|
if ok := linesInAuthorizedKeys[line]; ok {
|
||||||
|
continue
|
||||||
p, err := exePath()
|
}
|
||||||
if err != nil {
|
if ctx.Bool("fix") {
|
||||||
return nil, err
|
return []string{"authorized_keys is out of date, attempting regeneration"}, models.RewriteAllPublicKeys()
|
||||||
}
|
}
|
||||||
p, err = filepath.Abs(p)
|
return nil, fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(giteaPath) > 0 && giteaPath != p {
|
|
||||||
return []string{fmt.Sprintf("Gitea exe path wants %s but %s on %s", p, giteaPath, fPath)}, nil
|
|
||||||
}
|
|
||||||
if len(iniPath) > 0 && iniPath != setting.CustomConf {
|
|
||||||
return []string{fmt.Sprintf("Gitea config path wants %s but %s on %s", setting.CustomConf, iniPath, fPath)}, nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runDoctorCheckDBVersion(ctx *cli.Context) ([]string, error) {
|
||||||
|
if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
return []string{fmt.Sprintf("WARN: Got Error %v during ensure up to date", err), "Attempting to migrate to the latest DB version to fix this."}, models.NewEngine(context.Background(), migrations.Migrate)
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func iterateRepositories(each func(*models.Repository) ([]string, error)) ([]string, error) {
|
||||||
|
results := []string{}
|
||||||
|
err := models.Iterate(
|
||||||
|
models.DefaultDBContext(),
|
||||||
|
new(models.Repository),
|
||||||
|
builder.Gt{"id": 0},
|
||||||
|
func(idx int, bean interface{}) error {
|
||||||
|
res, err := each(bean.(*models.Repository))
|
||||||
|
results = append(results, res...)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
)
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func iteratePRs(repo *models.Repository, each func(*models.Repository, *models.PullRequest) ([]string, error)) ([]string, error) {
|
||||||
|
results := []string{}
|
||||||
|
err := models.Iterate(
|
||||||
|
models.DefaultDBContext(),
|
||||||
|
new(models.PullRequest),
|
||||||
|
builder.Eq{"base_repo_id": repo.ID},
|
||||||
|
func(idx int, bean interface{}) error {
|
||||||
|
res, err := each(repo, bean.(*models.PullRequest))
|
||||||
|
results = append(results, res...)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
)
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorHooks(ctx *cli.Context) ([]string, error) {
|
||||||
|
// Need to iterate across all of the repositories
|
||||||
|
return iterateRepositories(func(repo *models.Repository) ([]string, error) {
|
||||||
|
results, err := repository.CheckDelegateHooks(repo.RepoPath())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if len(results) > 0 && ctx.Bool("fix") {
|
||||||
|
return []string{fmt.Sprintf("regenerated hooks for %s", repo.FullName())}, repository.CreateDelegateHooks(repo.RepoPath())
|
||||||
|
}
|
||||||
|
|
||||||
|
return results, nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorPRMergeBase(ctx *cli.Context) ([]string, error) {
|
||||||
|
numRepos := 0
|
||||||
|
numPRs := 0
|
||||||
|
numPRsUpdated := 0
|
||||||
|
results, err := iterateRepositories(func(repo *models.Repository) ([]string, error) {
|
||||||
|
numRepos++
|
||||||
|
return iteratePRs(repo, func(repo *models.Repository, pr *models.PullRequest) ([]string, error) {
|
||||||
|
numPRs++
|
||||||
|
results := []string{}
|
||||||
|
pr.BaseRepo = repo
|
||||||
|
repoPath := repo.RepoPath()
|
||||||
|
|
||||||
|
oldMergeBase := pr.MergeBase
|
||||||
|
|
||||||
|
if !pr.HasMerged {
|
||||||
|
var err error
|
||||||
|
pr.MergeBase, err = git.NewCommand("merge-base", "--", pr.BaseBranch, pr.GetGitRefName()).RunInDir(repoPath)
|
||||||
|
if err != nil {
|
||||||
|
var err2 error
|
||||||
|
pr.MergeBase, err2 = git.NewCommand("rev-parse", git.BranchPrefix+pr.BaseBranch).RunInDir(repoPath)
|
||||||
|
if err2 != nil {
|
||||||
|
results = append(results, fmt.Sprintf("WARN: Unable to get merge base for PR ID %d, #%d onto %s in %s/%s", pr.ID, pr.Index, pr.BaseBranch, pr.BaseRepo.OwnerName, pr.BaseRepo.Name))
|
||||||
|
log.Error("Unable to get merge base for PR ID %d, Index %d in %s/%s. Error: %v & %v", pr.ID, pr.Index, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, err, err2)
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
parentsString, err := git.NewCommand("rev-list", "--parents", "-n", "1", pr.MergedCommitID).RunInDir(repoPath)
|
||||||
|
if err != nil {
|
||||||
|
results = append(results, fmt.Sprintf("WARN: Unable to get parents for merged PR ID %d, #%d onto %s in %s/%s", pr.ID, pr.Index, pr.BaseBranch, pr.BaseRepo.OwnerName, pr.BaseRepo.Name))
|
||||||
|
log.Error("Unable to get parents for merged PR ID %d, Index %d in %s/%s. Error: %v", pr.ID, pr.Index, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, err)
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
parents := strings.Split(strings.TrimSpace(parentsString), " ")
|
||||||
|
if len(parents) < 2 {
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
args := append([]string{"merge-base", "--"}, parents[1:]...)
|
||||||
|
args = append(args, pr.GetGitRefName())
|
||||||
|
|
||||||
|
pr.MergeBase, err = git.NewCommand(args...).RunInDir(repoPath)
|
||||||
|
if err != nil {
|
||||||
|
results = append(results, fmt.Sprintf("WARN: Unable to get merge base for merged PR ID %d, #%d onto %s in %s/%s", pr.ID, pr.Index, pr.BaseBranch, pr.BaseRepo.OwnerName, pr.BaseRepo.Name))
|
||||||
|
log.Error("Unable to get merge base for merged PR ID %d, Index %d in %s/%s. Error: %v", pr.ID, pr.Index, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, err)
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pr.MergeBase = strings.TrimSpace(pr.MergeBase)
|
||||||
|
if pr.MergeBase != oldMergeBase {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
if err := pr.UpdateCols("merge_base"); err != nil {
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("#%d onto %s in %s/%s: MergeBase should be %s but is %s", pr.Index, pr.BaseBranch, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, oldMergeBase, pr.MergeBase))
|
||||||
|
}
|
||||||
|
numPRsUpdated++
|
||||||
|
}
|
||||||
|
return results, nil
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
results = append(results, fmt.Sprintf("%d PR mergebases updated of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
|
||||||
|
} else {
|
||||||
|
if numPRsUpdated > 0 && err == nil {
|
||||||
|
return results, fmt.Errorf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
|
||||||
|
}
|
||||||
|
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorUserStarNum(ctx *cli.Context) ([]string, error) {
|
||||||
|
return nil, models.DoctorUserStarNum()
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorScriptType(ctx *cli.Context) ([]string, error) {
|
||||||
|
path, err := exec.LookPath(setting.ScriptType)
|
||||||
|
if err != nil {
|
||||||
|
return []string{fmt.Sprintf("ScriptType %s is not on the current PATH", setting.ScriptType)}, err
|
||||||
|
}
|
||||||
|
return []string{fmt.Sprintf("ScriptType %s is on the current PATH at %s", setting.ScriptType, path)}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorCheckDBConsistency(ctx *cli.Context) ([]string, error) {
|
||||||
|
var results []string
|
||||||
|
|
||||||
|
// make sure DB version is uptodate
|
||||||
|
if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
|
||||||
|
return nil, fmt.Errorf("model version on the database does not match the current Gitea version. Model consistency will not be checked until the database is upgraded")
|
||||||
|
}
|
||||||
|
|
||||||
|
//find labels without existing repo or org
|
||||||
|
count, err := models.CountOrphanedLabels()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if count > 0 {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
if err = models.DeleteOrphanedLabels(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d labels without existing repository/organisation deleted", count))
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("%d labels without existing repository/organisation", count))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//find issues without existing repository
|
||||||
|
count, err = models.CountOrphanedIssues()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if count > 0 {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
if err = models.DeleteOrphanedIssues(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d issues without existing repository deleted", count))
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("%d issues without existing repository", count))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//find pulls without existing issues
|
||||||
|
count, err = models.CountOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if count > 0 {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
if err = models.DeleteOrphanedObjects("pull_request", "issue", "pull_request.issue_id=issue.id"); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d pull requests without existing issue deleted", count))
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("%d pull requests without existing issue", count))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//find tracked times without existing issues/pulls
|
||||||
|
count, err = models.CountOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if count > 0 {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
if err = models.DeleteOrphanedObjects("tracked_time", "issue", "tracked_time.issue_id=issue.id"); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d tracked times without existing issue deleted", count))
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("%d tracked times without existing issue", count))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
count, err = models.CountNullArchivedRepository()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if count > 0 {
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
updatedCount, err := models.FixNullArchivedRepository()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
results = append(results, fmt.Sprintf("%d repositories with null is_archived updated", updatedCount))
|
||||||
|
} else {
|
||||||
|
results = append(results, fmt.Sprintf("%d repositories with null is_archived", count))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ToDo: function to recalc all counters
|
||||||
|
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func runDoctorEnablePushOptions(ctx *cli.Context) ([]string, error) {
|
||||||
|
numRepos := 0
|
||||||
|
_, err := iterateRepositories(func(repo *models.Repository) ([]string, error) {
|
||||||
|
numRepos++
|
||||||
|
r, err := git.OpenRepository(repo.RepoPath())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer r.Close()
|
||||||
|
|
||||||
|
if ctx.Bool("fix") {
|
||||||
|
_, err := git.NewCommand("config", "receive.advertisePushOptions", "true").RunInDir(r.Path)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, nil
|
||||||
|
})
|
||||||
|
|
||||||
|
var prefix string
|
||||||
|
if !ctx.Bool("fix") {
|
||||||
|
prefix = "DRY RUN: "
|
||||||
|
}
|
||||||
|
return []string{fmt.Sprintf("%sEnabled push options for %d repositories.", prefix, numRepos)}, err
|
||||||
|
}
|
||||||
|
|||||||
338
cmd/dump.go
338
cmd/dump.go
@@ -6,22 +6,124 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/storage"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"github.com/unknwon/cae/zip"
|
"gitea.com/macaron/session"
|
||||||
|
archiver "github.com/mholt/archiver/v3"
|
||||||
"github.com/unknwon/com"
|
"github.com/unknwon/com"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func addFile(w archiver.Writer, filePath string, absPath string, verbose bool) error {
|
||||||
|
if verbose {
|
||||||
|
log.Info("Adding file %s\n", filePath)
|
||||||
|
}
|
||||||
|
file, err := os.Open(absPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
fileInfo, err := file.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return w.Write(archiver.File{
|
||||||
|
FileInfo: archiver.FileInfo{
|
||||||
|
FileInfo: fileInfo,
|
||||||
|
CustomName: filePath,
|
||||||
|
},
|
||||||
|
ReadCloser: file,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func addRecursive(w archiver.Writer, dirPath string, absPath string, verbose bool) error {
|
||||||
|
if verbose {
|
||||||
|
log.Info("Adding dir %s\n", dirPath)
|
||||||
|
}
|
||||||
|
dir, err := os.Open(absPath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Could not open directory %s: %s", absPath, err)
|
||||||
|
}
|
||||||
|
defer dir.Close()
|
||||||
|
|
||||||
|
files, err := dir.Readdir(0)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Unable to list files in %s: %s", absPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := addFile(w, dirPath, absPath, false); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, fileInfo := range files {
|
||||||
|
if fileInfo.IsDir() {
|
||||||
|
err = addRecursive(w, filepath.Join(dirPath, fileInfo.Name()), filepath.Join(absPath, fileInfo.Name()), verbose)
|
||||||
|
} else {
|
||||||
|
err = addFile(w, filepath.Join(dirPath, fileInfo.Name()), filepath.Join(absPath, fileInfo.Name()), verbose)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func isSubdir(upper string, lower string) (bool, error) {
|
||||||
|
if relPath, err := filepath.Rel(upper, lower); err != nil {
|
||||||
|
return false, err
|
||||||
|
} else if relPath == "." || !strings.HasPrefix(relPath, ".") {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type outputType struct {
|
||||||
|
Enum []string
|
||||||
|
Default string
|
||||||
|
selected string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o outputType) Join() string {
|
||||||
|
return strings.Join(o.Enum, ", ")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *outputType) Set(value string) error {
|
||||||
|
for _, enum := range o.Enum {
|
||||||
|
if enum == value {
|
||||||
|
o.selected = value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Errorf("allowed values are %s", o.Join())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o outputType) String() string {
|
||||||
|
if o.selected == "" {
|
||||||
|
return o.Default
|
||||||
|
}
|
||||||
|
return o.selected
|
||||||
|
}
|
||||||
|
|
||||||
|
var outputTypeEnum = &outputType{
|
||||||
|
Enum: []string{"zip", "tar", "tar.gz", "tar.xz", "tar.bz2"},
|
||||||
|
Default: "zip",
|
||||||
|
}
|
||||||
|
|
||||||
// CmdDump represents the available dump sub-command.
|
// CmdDump represents the available dump sub-command.
|
||||||
var CmdDump = cli.Command{
|
var CmdDump = cli.Command{
|
||||||
Name: "dump",
|
Name: "dump",
|
||||||
@@ -33,7 +135,7 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
|
|||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "file, f",
|
Name: "file, f",
|
||||||
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
|
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
|
||||||
Usage: "Name of the dump file which will be created.",
|
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "verbose, V",
|
Name: "verbose, V",
|
||||||
@@ -52,6 +154,15 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
|
|||||||
Name: "skip-repository, R",
|
Name: "skip-repository, R",
|
||||||
Usage: "Skip the repository dumping",
|
Usage: "Skip the repository dumping",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "skip-log, L",
|
||||||
|
Usage: "Skip the log dumping",
|
||||||
|
},
|
||||||
|
cli.GenericFlag{
|
||||||
|
Name: "type",
|
||||||
|
Value: outputTypeEnum,
|
||||||
|
Usage: fmt.Sprintf("Dump output format: %s", outputTypeEnum.Join()),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +172,27 @@ func fatal(format string, args ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runDump(ctx *cli.Context) error {
|
func runDump(ctx *cli.Context) error {
|
||||||
|
var file *os.File
|
||||||
|
fileName := ctx.String("file")
|
||||||
|
if fileName == "-" {
|
||||||
|
file = os.Stdout
|
||||||
|
err := log.DelLogger("console")
|
||||||
|
if err != nil {
|
||||||
|
fatal("Deleting default logger failed. Can not write to stdout: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
setting.NewContext()
|
setting.NewContext()
|
||||||
|
// make sure we are logging to the console no matter what the configuration tells us do to
|
||||||
|
if _, err := setting.Cfg.Section("log").NewKey("MODE", "console"); err != nil {
|
||||||
|
fatal("Setting logging mode to console failed: %v", err)
|
||||||
|
}
|
||||||
|
if _, err := setting.Cfg.Section("log.console").NewKey("STDERR", "true"); err != nil {
|
||||||
|
fatal("Setting console logger to stderr failed: %v", err)
|
||||||
|
}
|
||||||
|
if !setting.InstallLock {
|
||||||
|
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
|
||||||
|
return fmt.Errorf("gitea is not initialized")
|
||||||
|
}
|
||||||
setting.NewServices() // cannot access session settings otherwise
|
setting.NewServices() // cannot access session settings otherwise
|
||||||
|
|
||||||
err := models.SetEngine()
|
err := models.SetEngine()
|
||||||
@@ -69,44 +200,76 @@ func runDump(ctx *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := storage.Init(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if file == nil {
|
||||||
|
file, err = os.Create(fileName)
|
||||||
|
if err != nil {
|
||||||
|
fatal("Unable to open %s: %v", fileName, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
|
verbose := ctx.Bool("verbose")
|
||||||
|
outType := ctx.String("type")
|
||||||
|
var iface interface{}
|
||||||
|
if fileName == "-" {
|
||||||
|
iface, err = archiver.ByExtension(fmt.Sprintf(".%s", outType))
|
||||||
|
} else {
|
||||||
|
iface, err = archiver.ByExtension(fileName)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
fatal("Unable to get archiver for extension: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
w, _ := iface.(archiver.Writer)
|
||||||
|
if err := w.Create(file); err != nil {
|
||||||
|
fatal("Creating archiver.Writer failed: %v", err)
|
||||||
|
}
|
||||||
|
defer w.Close()
|
||||||
|
|
||||||
|
if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") {
|
||||||
|
log.Info("Skip dumping local repositories")
|
||||||
|
} else {
|
||||||
|
log.Info("Dumping local repositories... %s", setting.RepoRootPath)
|
||||||
|
if err := addRecursive(w, "repos", setting.RepoRootPath, verbose); err != nil {
|
||||||
|
fatal("Failed to include repositories: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := storage.LFS.IterateObjects(func(objPath string, object storage.Object) error {
|
||||||
|
info, err := object.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return w.Write(archiver.File{
|
||||||
|
FileInfo: archiver.FileInfo{
|
||||||
|
FileInfo: info,
|
||||||
|
CustomName: path.Join("data", "lfs", objPath),
|
||||||
|
},
|
||||||
|
ReadCloser: object,
|
||||||
|
})
|
||||||
|
}); err != nil {
|
||||||
|
fatal("Failed to dump LFS objects: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tmpDir := ctx.String("tempdir")
|
tmpDir := ctx.String("tempdir")
|
||||||
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
|
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
|
||||||
fatal("Path does not exist: %s", tmpDir)
|
fatal("Path does not exist: %s", tmpDir)
|
||||||
}
|
}
|
||||||
tmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
|
|
||||||
|
dbDump, err := ioutil.TempFile(tmpDir, "gitea-db.sql")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal("Failed to create tmp work directory: %v", err)
|
fatal("Failed to create tmp file: %v", err)
|
||||||
}
|
}
|
||||||
log.Info("Creating tmp work dir: %s", tmpWorkDir)
|
defer func() {
|
||||||
|
if err := util.Remove(dbDump.Name()); err != nil {
|
||||||
// work-around #1103
|
log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err)
|
||||||
if os.Getenv("TMPDIR") == "" {
|
|
||||||
os.Setenv("TMPDIR", tmpWorkDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
dbDump := path.Join(tmpWorkDir, "gitea-db.sql")
|
|
||||||
|
|
||||||
fileName := ctx.String("file")
|
|
||||||
log.Info("Packing dump files...")
|
|
||||||
z, err := zip.Create(fileName)
|
|
||||||
if err != nil {
|
|
||||||
fatal("Failed to create %s: %v", fileName, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
zip.Verbose = ctx.Bool("verbose")
|
|
||||||
|
|
||||||
if ctx.IsSet("skip-repository") {
|
|
||||||
log.Info("Skip dumping local repositories")
|
|
||||||
} else {
|
|
||||||
log.Info("Dumping local repositories...%s", setting.RepoRootPath)
|
|
||||||
reposDump := path.Join(tmpWorkDir, "gitea-repo.zip")
|
|
||||||
if err := zip.PackTo(setting.RepoRootPath, reposDump, true); err != nil {
|
|
||||||
fatal("Failed to dump local repositories: %v", err)
|
|
||||||
}
|
}
|
||||||
if err := z.AddFile("gitea-repo.zip", reposDump); err != nil {
|
}()
|
||||||
fatal("Failed to include gitea-repo.zip: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
targetDBType := ctx.String("database")
|
targetDBType := ctx.String("database")
|
||||||
if len(targetDBType) > 0 && targetDBType != setting.Database.Type {
|
if len(targetDBType) > 0 && targetDBType != setting.Database.Type {
|
||||||
@@ -115,25 +278,29 @@ func runDump(ctx *cli.Context) error {
|
|||||||
log.Info("Dumping database...")
|
log.Info("Dumping database...")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := models.DumpDatabase(dbDump, targetDBType); err != nil {
|
if err := models.DumpDatabase(dbDump.Name(), targetDBType); err != nil {
|
||||||
fatal("Failed to dump database: %v", err)
|
fatal("Failed to dump database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := z.AddFile("gitea-db.sql", dbDump); err != nil {
|
if err := addFile(w, "gitea-db.sql", dbDump.Name(), verbose); err != nil {
|
||||||
fatal("Failed to include gitea-db.sql: %v", err)
|
fatal("Failed to include gitea-db.sql: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(setting.CustomConf) > 0 {
|
if len(setting.CustomConf) > 0 {
|
||||||
log.Info("Adding custom configuration file from %s", setting.CustomConf)
|
log.Info("Adding custom configuration file from %s", setting.CustomConf)
|
||||||
if err := z.AddFile("app.ini", setting.CustomConf); err != nil {
|
if err := addFile(w, "app.ini", setting.CustomConf, verbose); err != nil {
|
||||||
fatal("Failed to include specified app.ini: %v", err)
|
fatal("Failed to include specified app.ini: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customDir, err := os.Stat(setting.CustomPath)
|
customDir, err := os.Stat(setting.CustomPath)
|
||||||
if err == nil && customDir.IsDir() {
|
if err == nil && customDir.IsDir() {
|
||||||
if err := z.AddDir("custom", setting.CustomPath); err != nil {
|
if is, _ := isSubdir(setting.AppDataPath, setting.CustomPath); !is {
|
||||||
fatal("Failed to include custom: %v", err)
|
if err := addRecursive(w, "custom", setting.CustomPath, verbose); err != nil {
|
||||||
|
fatal("Failed to include custom: %v", err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Info("Custom dir %s is inside data dir %s, skipped", setting.CustomPath, setting.AppDataPath)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Info("Custom dir %s doesn't exist, skipped", setting.CustomPath)
|
log.Info("Custom dir %s doesn't exist, skipped", setting.CustomPath)
|
||||||
@@ -142,42 +309,83 @@ func runDump(ctx *cli.Context) error {
|
|||||||
if com.IsExist(setting.AppDataPath) {
|
if com.IsExist(setting.AppDataPath) {
|
||||||
log.Info("Packing data directory...%s", setting.AppDataPath)
|
log.Info("Packing data directory...%s", setting.AppDataPath)
|
||||||
|
|
||||||
var sessionAbsPath string
|
var excludes []string
|
||||||
if setting.SessionConfig.Provider == "file" {
|
if setting.Cfg.Section("session").Key("PROVIDER").Value() == "file" {
|
||||||
sessionAbsPath = setting.SessionConfig.ProviderConfig
|
var opts session.Options
|
||||||
|
if err = json.Unmarshal([]byte(setting.SessionConfig.ProviderConfig), &opts); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
excludes = append(excludes, opts.ProviderConfig)
|
||||||
}
|
}
|
||||||
if err := zipAddDirectoryExclude(z, "data", setting.AppDataPath, sessionAbsPath); err != nil {
|
|
||||||
|
excludes = append(excludes, setting.RepoRootPath)
|
||||||
|
excludes = append(excludes, setting.LFS.Path)
|
||||||
|
excludes = append(excludes, setting.Attachment.Path)
|
||||||
|
excludes = append(excludes, setting.LogRootPath)
|
||||||
|
if err := addRecursiveExclude(w, "data", setting.AppDataPath, excludes, verbose); err != nil {
|
||||||
fatal("Failed to include data directory: %v", err)
|
fatal("Failed to include data directory: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if com.IsExist(setting.LogRootPath) {
|
if err := storage.Attachments.IterateObjects(func(objPath string, object storage.Object) error {
|
||||||
if err := z.AddDir("log", setting.LogRootPath); err != nil {
|
info, err := object.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return w.Write(archiver.File{
|
||||||
|
FileInfo: archiver.FileInfo{
|
||||||
|
FileInfo: info,
|
||||||
|
CustomName: path.Join("data", "attachments", objPath),
|
||||||
|
},
|
||||||
|
ReadCloser: object,
|
||||||
|
})
|
||||||
|
}); err != nil {
|
||||||
|
fatal("Failed to dump attachments: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Doesn't check if LogRootPath exists before processing --skip-log intentionally,
|
||||||
|
// ensuring that it's clear the dump is skipped whether the directory's initialized
|
||||||
|
// yet or not.
|
||||||
|
if ctx.IsSet("skip-log") && ctx.Bool("skip-log") {
|
||||||
|
log.Info("Skip dumping log files")
|
||||||
|
} else if com.IsExist(setting.LogRootPath) {
|
||||||
|
if err := addRecursive(w, "log", setting.LogRootPath, verbose); err != nil {
|
||||||
fatal("Failed to include log: %v", err)
|
fatal("Failed to include log: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = z.Close(); err != nil {
|
if fileName != "-" {
|
||||||
_ = os.Remove(fileName)
|
if err = w.Close(); err != nil {
|
||||||
fatal("Failed to save %s: %v", fileName, err)
|
_ = util.Remove(fileName)
|
||||||
|
fatal("Failed to save %s: %v", fileName, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.Chmod(fileName, 0600); err != nil {
|
||||||
|
log.Info("Can't change file access permissions mask to 0600: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.Chmod(fileName, 0600); err != nil {
|
if fileName != "-" {
|
||||||
log.Info("Can't change file access permissions mask to 0600: %v", err)
|
log.Info("Finish dumping in file %s", fileName)
|
||||||
|
} else {
|
||||||
|
log.Info("Finish dumping to stdout")
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Removing tmp work dir: %s", tmpWorkDir)
|
|
||||||
|
|
||||||
if err := os.RemoveAll(tmpWorkDir); err != nil {
|
|
||||||
fatal("Failed to remove %s: %v", tmpWorkDir, err)
|
|
||||||
}
|
|
||||||
log.Info("Finish dumping in file %s", fileName)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// zipAddDirectoryExclude zips absPath to specified zipPath inside z excluding excludeAbsPath
|
func contains(slice []string, s string) bool {
|
||||||
func zipAddDirectoryExclude(zip *zip.ZipArchive, zipPath, absPath string, excludeAbsPath string) error {
|
for _, v := range slice {
|
||||||
|
if v == s {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// addRecursiveExclude zips absPath to specified insidePath inside writer excluding excludeAbsPath
|
||||||
|
func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeAbsPath []string, verbose bool) error {
|
||||||
absPath, err := filepath.Abs(absPath)
|
absPath, err := filepath.Abs(absPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -188,24 +396,24 @@ func zipAddDirectoryExclude(zip *zip.ZipArchive, zipPath, absPath string, exclud
|
|||||||
}
|
}
|
||||||
defer dir.Close()
|
defer dir.Close()
|
||||||
|
|
||||||
zip.AddEmptyDir(zipPath)
|
|
||||||
|
|
||||||
files, err := dir.Readdir(0)
|
files, err := dir.Readdir(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
currentAbsPath := path.Join(absPath, file.Name())
|
currentAbsPath := path.Join(absPath, file.Name())
|
||||||
currentZipPath := path.Join(zipPath, file.Name())
|
currentInsidePath := path.Join(insidePath, file.Name())
|
||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
if currentAbsPath != excludeAbsPath {
|
if !contains(excludeAbsPath, currentAbsPath) {
|
||||||
if err = zipAddDirectoryExclude(zip, currentZipPath, currentAbsPath, excludeAbsPath); err != nil {
|
if err := addFile(w, currentInsidePath, currentAbsPath, false); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = addRecursiveExclude(w, currentInsidePath, currentAbsPath, excludeAbsPath, verbose); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if err = zip.AddFile(currentZipPath, currentAbsPath); err != nil {
|
if err = addFile(w, currentInsidePath, currentAbsPath, verbose); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/generate"
|
"code.gitea.io/gitea/modules/generate"
|
||||||
|
|
||||||
|
"github.com/mattn/go-isatty"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,7 +61,12 @@ func runGenerateInternalToken(c *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s\n", internalToken)
|
fmt.Printf("%s", internalToken)
|
||||||
|
|
||||||
|
if isatty.IsTerminal(os.Stdout.Fd()) {
|
||||||
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +76,12 @@ func runGenerateLfsJwtSecret(c *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s\n", JWTSecretBase64)
|
fmt.Printf("%s", JWTSecretBase64)
|
||||||
|
|
||||||
|
if isatty.IsTerminal(os.Stdout.Fd()) {
|
||||||
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +91,11 @@ func runGenerateSecretKey(c *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s\n", secretKey)
|
fmt.Printf("%s", secretKey)
|
||||||
|
|
||||||
|
if isatty.IsTerminal(os.Stdout.Fd()) {
|
||||||
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
55
cmd/hook.go
55
cmd/hook.go
@@ -19,6 +19,7 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@@ -45,18 +46,33 @@ var (
|
|||||||
Usage: "Delegate pre-receive Git hook",
|
Usage: "Delegate pre-receive Git hook",
|
||||||
Description: "This command should only be called by Git",
|
Description: "This command should only be called by Git",
|
||||||
Action: runHookPreReceive,
|
Action: runHookPreReceive,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
subcmdHookUpdate = cli.Command{
|
subcmdHookUpdate = cli.Command{
|
||||||
Name: "update",
|
Name: "update",
|
||||||
Usage: "Delegate update Git hook",
|
Usage: "Delegate update Git hook",
|
||||||
Description: "This command should only be called by Git",
|
Description: "This command should only be called by Git",
|
||||||
Action: runHookUpdate,
|
Action: runHookUpdate,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
subcmdHookPostReceive = cli.Command{
|
subcmdHookPostReceive = cli.Command{
|
||||||
Name: "post-receive",
|
Name: "post-receive",
|
||||||
Usage: "Delegate post-receive Git hook",
|
Usage: "Delegate post-receive Git hook",
|
||||||
Description: "This command should only be called by Git",
|
Description: "This command should only be called by Git",
|
||||||
Action: runHookPostReceive,
|
Action: runHookPostReceive,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -113,15 +129,8 @@ func (d *delayWriter) Close() error {
|
|||||||
if d == nil {
|
if d == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
stopped := d.timer.Stop()
|
stopped := util.StopTimer(d.timer)
|
||||||
if stopped {
|
if stopped || d.buf == nil {
|
||||||
return nil
|
|
||||||
}
|
|
||||||
select {
|
|
||||||
case <-d.timer.C:
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
if d.buf == nil {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
_, err := d.internal.Write(d.buf.Bytes())
|
_, err := d.internal.Write(d.buf.Bytes())
|
||||||
@@ -144,7 +153,7 @@ func runHookPreReceive(c *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
setup("hooks/pre-receive.log", false)
|
setup("hooks/pre-receive.log", c.Bool("debug"))
|
||||||
|
|
||||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||||
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
||||||
@@ -161,7 +170,7 @@ Gitea or set your environment appropriately.`, "")
|
|||||||
username := os.Getenv(models.EnvRepoUsername)
|
username := os.Getenv(models.EnvRepoUsername)
|
||||||
reponame := os.Getenv(models.EnvRepoName)
|
reponame := os.Getenv(models.EnvRepoName)
|
||||||
userID, _ := strconv.ParseInt(os.Getenv(models.EnvPusherID), 10, 64)
|
userID, _ := strconv.ParseInt(os.Getenv(models.EnvPusherID), 10, 64)
|
||||||
prID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchPRID), 10, 64)
|
prID, _ := strconv.ParseInt(os.Getenv(models.EnvPRID), 10, 64)
|
||||||
isDeployKey, _ := strconv.ParseBool(os.Getenv(models.EnvIsDeployKey))
|
isDeployKey, _ := strconv.ParseBool(os.Getenv(models.EnvIsDeployKey))
|
||||||
|
|
||||||
hookOptions := private.HookOptions{
|
hookOptions := private.HookOptions{
|
||||||
@@ -169,6 +178,7 @@ Gitea or set your environment appropriately.`, "")
|
|||||||
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories),
|
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories),
|
||||||
GitObjectDirectory: os.Getenv(private.GitObjectDirectory),
|
GitObjectDirectory: os.Getenv(private.GitObjectDirectory),
|
||||||
GitQuarantinePath: os.Getenv(private.GitQuarantinePath),
|
GitQuarantinePath: os.Getenv(private.GitQuarantinePath),
|
||||||
|
GitPushOptions: pushOptions(),
|
||||||
ProtectedBranchID: prID,
|
ProtectedBranchID: prID,
|
||||||
IsDeployKey: isDeployKey,
|
IsDeployKey: isDeployKey,
|
||||||
}
|
}
|
||||||
@@ -275,11 +285,17 @@ func runHookUpdate(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runHookPostReceive(c *cli.Context) error {
|
func runHookPostReceive(c *cli.Context) error {
|
||||||
|
// First of all run update-server-info no matter what
|
||||||
|
if _, err := git.NewCommand("update-server-info").Run(); err != nil {
|
||||||
|
return fmt.Errorf("Failed to call 'git update-server-info': %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now if we're an internal don't do anything else
|
||||||
if os.Getenv(models.EnvIsInternal) == "true" {
|
if os.Getenv(models.EnvIsInternal) == "true" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
setup("hooks/post-receive.log", false)
|
setup("hooks/post-receive.log", c.Bool("debug"))
|
||||||
|
|
||||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||||
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
||||||
@@ -317,6 +333,7 @@ Gitea or set your environment appropriately.`, "")
|
|||||||
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories),
|
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories),
|
||||||
GitObjectDirectory: os.Getenv(private.GitObjectDirectory),
|
GitObjectDirectory: os.Getenv(private.GitObjectDirectory),
|
||||||
GitQuarantinePath: os.Getenv(private.GitQuarantinePath),
|
GitQuarantinePath: os.Getenv(private.GitQuarantinePath),
|
||||||
|
GitPushOptions: pushOptions(),
|
||||||
}
|
}
|
||||||
oldCommitIDs := make([]string, hookBatchSize)
|
oldCommitIDs := make([]string, hookBatchSize)
|
||||||
newCommitIDs := make([]string, hookBatchSize)
|
newCommitIDs := make([]string, hookBatchSize)
|
||||||
@@ -429,3 +446,17 @@ func hookPrintResults(results []private.HookPostReceiveBranchResult) {
|
|||||||
os.Stderr.Sync()
|
os.Stderr.Sync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func pushOptions() map[string]string {
|
||||||
|
opts := make(map[string]string)
|
||||||
|
if pushCount, err := strconv.Atoi(os.Getenv(private.GitPushOptionCount)); err == nil {
|
||||||
|
for idx := 0; idx < pushCount; idx++ {
|
||||||
|
opt := os.Getenv(fmt.Sprintf("GIT_PUSH_OPTION_%d", idx))
|
||||||
|
kv := strings.SplitN(opt, "=", 2)
|
||||||
|
if len(kv) == 2 {
|
||||||
|
opts[kv[0]] = kv[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return opts
|
||||||
|
}
|
||||||
|
|||||||
380
cmd/manager.go
380
cmd/manager.go
@@ -10,6 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@@ -25,16 +26,27 @@ var (
|
|||||||
subcmdShutdown,
|
subcmdShutdown,
|
||||||
subcmdRestart,
|
subcmdRestart,
|
||||||
subcmdFlushQueues,
|
subcmdFlushQueues,
|
||||||
|
subcmdLogging,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
subcmdShutdown = cli.Command{
|
subcmdShutdown = cli.Command{
|
||||||
Name: "shutdown",
|
Name: "shutdown",
|
||||||
Usage: "Gracefully shutdown the running process",
|
Usage: "Gracefully shutdown the running process",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
Action: runShutdown,
|
Action: runShutdown,
|
||||||
}
|
}
|
||||||
subcmdRestart = cli.Command{
|
subcmdRestart = cli.Command{
|
||||||
Name: "restart",
|
Name: "restart",
|
||||||
Usage: "Gracefully restart the running process - (not implemented for windows servers)",
|
Usage: "Gracefully restart the running process - (not implemented for windows servers)",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
Action: runRestart,
|
Action: runRestart,
|
||||||
}
|
}
|
||||||
subcmdFlushQueues = cli.Command{
|
subcmdFlushQueues = cli.Command{
|
||||||
@@ -46,17 +58,331 @@ var (
|
|||||||
Name: "timeout",
|
Name: "timeout",
|
||||||
Value: 60 * time.Second,
|
Value: 60 * time.Second,
|
||||||
Usage: "Timeout for the flushing process",
|
Usage: "Timeout for the flushing process",
|
||||||
},
|
}, cli.BoolFlag{
|
||||||
cli.BoolFlag{
|
|
||||||
Name: "non-blocking",
|
Name: "non-blocking",
|
||||||
Usage: "Set to true to not wait for flush to complete before returning",
|
Usage: "Set to true to not wait for flush to complete before returning",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
defaultLoggingFlags = []cli.Flag{
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "group, g",
|
||||||
|
Usage: "Group to add logger to - will default to \"default\"",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "name, n",
|
||||||
|
Usage: "Name of the new logger - will default to mode",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "level, l",
|
||||||
|
Usage: "Logging level for the new logger",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "stacktrace-level, L",
|
||||||
|
Usage: "Stacktrace logging level",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "flags, F",
|
||||||
|
Usage: "Flags for the logger",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "expression, e",
|
||||||
|
Usage: "Matching expression for the logger",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "prefix, p",
|
||||||
|
Usage: "Prefix for the logger",
|
||||||
|
}, cli.BoolFlag{
|
||||||
|
Name: "color",
|
||||||
|
Usage: "Use color in the logs",
|
||||||
|
}, cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
subcmdLogging = cli.Command{
|
||||||
|
Name: "logging",
|
||||||
|
Usage: "Adjust logging commands",
|
||||||
|
Subcommands: []cli.Command{
|
||||||
|
{
|
||||||
|
Name: "pause",
|
||||||
|
Usage: "Pause logging (Gitea will buffer logs up to a certain point and will drop them after that point)",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: runPauseLogging,
|
||||||
|
}, {
|
||||||
|
Name: "resume",
|
||||||
|
Usage: "Resume logging",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: runResumeLogging,
|
||||||
|
}, {
|
||||||
|
Name: "release-and-reopen",
|
||||||
|
Usage: "Cause Gitea to release and re-open files used for logging",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: runReleaseReopenLogging,
|
||||||
|
}, {
|
||||||
|
Name: "remove",
|
||||||
|
Usage: "Remove a logger",
|
||||||
|
ArgsUsage: "[name] Name of logger to remove",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "group, g",
|
||||||
|
Usage: "Group to add logger to - will default to \"default\"",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: runRemoveLogger,
|
||||||
|
}, {
|
||||||
|
Name: "add",
|
||||||
|
Usage: "Add a logger",
|
||||||
|
Subcommands: []cli.Command{
|
||||||
|
{
|
||||||
|
Name: "console",
|
||||||
|
Usage: "Add a console logger",
|
||||||
|
Flags: append(defaultLoggingFlags,
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "stderr",
|
||||||
|
Usage: "Output console logs to stderr - only relevant for console",
|
||||||
|
}),
|
||||||
|
Action: runAddConsoleLogger,
|
||||||
|
}, {
|
||||||
|
Name: "file",
|
||||||
|
Usage: "Add a file logger",
|
||||||
|
Flags: append(defaultLoggingFlags, []cli.Flag{
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "filename, f",
|
||||||
|
Usage: "Filename for the logger - this must be set.",
|
||||||
|
}, cli.BoolTFlag{
|
||||||
|
Name: "rotate, r",
|
||||||
|
Usage: "Rotate logs",
|
||||||
|
}, cli.Int64Flag{
|
||||||
|
Name: "max-size, s",
|
||||||
|
Usage: "Maximum size in bytes before rotation",
|
||||||
|
}, cli.BoolTFlag{
|
||||||
|
Name: "daily, d",
|
||||||
|
Usage: "Rotate logs daily",
|
||||||
|
}, cli.IntFlag{
|
||||||
|
Name: "max-days, D",
|
||||||
|
Usage: "Maximum number of daily logs to keep",
|
||||||
|
}, cli.BoolTFlag{
|
||||||
|
Name: "compress, z",
|
||||||
|
Usage: "Compress rotated logs",
|
||||||
|
}, cli.IntFlag{
|
||||||
|
Name: "compression-level, Z",
|
||||||
|
Usage: "Compression level to use",
|
||||||
|
},
|
||||||
|
}...),
|
||||||
|
Action: runAddFileLogger,
|
||||||
|
}, {
|
||||||
|
Name: "conn",
|
||||||
|
Usage: "Add a net conn logger",
|
||||||
|
Flags: append(defaultLoggingFlags, []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "reconnect-on-message, R",
|
||||||
|
Usage: "Reconnect to host for every message",
|
||||||
|
}, cli.BoolFlag{
|
||||||
|
Name: "reconnect, r",
|
||||||
|
Usage: "Reconnect to host when connection is dropped",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "protocol, P",
|
||||||
|
Usage: "Set protocol to use: tcp, unix, or udp (defaults to tcp)",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "address, a",
|
||||||
|
Usage: "Host address and port to connect to (defaults to :7020)",
|
||||||
|
},
|
||||||
|
}...),
|
||||||
|
Action: runAddConnLogger,
|
||||||
|
}, {
|
||||||
|
Name: "smtp",
|
||||||
|
Usage: "Add an SMTP logger",
|
||||||
|
Flags: append(defaultLoggingFlags, []cli.Flag{
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "username, u",
|
||||||
|
Usage: "Mail server username",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "password, P",
|
||||||
|
Usage: "Mail server password",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "host, H",
|
||||||
|
Usage: "Mail server host (defaults to: 127.0.0.1:25)",
|
||||||
|
}, cli.StringSliceFlag{
|
||||||
|
Name: "send-to, s",
|
||||||
|
Usage: "Email address(es) to send to",
|
||||||
|
}, cli.StringFlag{
|
||||||
|
Name: "subject, S",
|
||||||
|
Usage: "Subject header of sent emails",
|
||||||
|
},
|
||||||
|
}...),
|
||||||
|
Action: runAddSMTPLogger,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func runRemoveLogger(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
group := c.String("group")
|
||||||
|
if len(group) == 0 {
|
||||||
|
group = log.DEFAULT
|
||||||
|
}
|
||||||
|
name := c.Args().First()
|
||||||
|
statusCode, msg := private.RemoveLogger(group, name)
|
||||||
|
switch statusCode {
|
||||||
|
case http.StatusInternalServerError:
|
||||||
|
fail("InternalServerError", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func runAddSMTPLogger(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
vals := map[string]interface{}{}
|
||||||
|
mode := "smtp"
|
||||||
|
if c.IsSet("host") {
|
||||||
|
vals["host"] = c.String("host")
|
||||||
|
} else {
|
||||||
|
vals["host"] = "127.0.0.1:25"
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.IsSet("username") {
|
||||||
|
vals["username"] = c.String("username")
|
||||||
|
}
|
||||||
|
if c.IsSet("password") {
|
||||||
|
vals["password"] = c.String("password")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !c.IsSet("send-to") {
|
||||||
|
return fmt.Errorf("Some recipients must be provided")
|
||||||
|
}
|
||||||
|
vals["sendTos"] = c.StringSlice("send-to")
|
||||||
|
|
||||||
|
if c.IsSet("subject") {
|
||||||
|
vals["subject"] = c.String("subject")
|
||||||
|
} else {
|
||||||
|
vals["subject"] = "Diagnostic message from Gitea"
|
||||||
|
}
|
||||||
|
|
||||||
|
return commonAddLogger(c, mode, vals)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runAddConnLogger(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
vals := map[string]interface{}{}
|
||||||
|
mode := "conn"
|
||||||
|
vals["net"] = "tcp"
|
||||||
|
if c.IsSet("protocol") {
|
||||||
|
switch c.String("protocol") {
|
||||||
|
case "udp":
|
||||||
|
vals["net"] = "udp"
|
||||||
|
case "unix":
|
||||||
|
vals["net"] = "unix"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if c.IsSet("address") {
|
||||||
|
vals["address"] = c.String("address")
|
||||||
|
} else {
|
||||||
|
vals["address"] = ":7020"
|
||||||
|
}
|
||||||
|
if c.IsSet("reconnect") {
|
||||||
|
vals["reconnect"] = c.Bool("reconnect")
|
||||||
|
}
|
||||||
|
if c.IsSet("reconnect-on-message") {
|
||||||
|
vals["reconnectOnMsg"] = c.Bool("reconnect-on-message")
|
||||||
|
}
|
||||||
|
return commonAddLogger(c, mode, vals)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runAddFileLogger(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
vals := map[string]interface{}{}
|
||||||
|
mode := "file"
|
||||||
|
if c.IsSet("filename") {
|
||||||
|
vals["filename"] = c.String("filename")
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("filename must be set when creating a file logger")
|
||||||
|
}
|
||||||
|
if c.IsSet("rotate") {
|
||||||
|
vals["rotate"] = c.Bool("rotate")
|
||||||
|
}
|
||||||
|
if c.IsSet("max-size") {
|
||||||
|
vals["maxsize"] = c.Int64("max-size")
|
||||||
|
}
|
||||||
|
if c.IsSet("daily") {
|
||||||
|
vals["daily"] = c.Bool("daily")
|
||||||
|
}
|
||||||
|
if c.IsSet("max-days") {
|
||||||
|
vals["maxdays"] = c.Int("max-days")
|
||||||
|
}
|
||||||
|
if c.IsSet("compress") {
|
||||||
|
vals["compress"] = c.Bool("compress")
|
||||||
|
}
|
||||||
|
if c.IsSet("compression-level") {
|
||||||
|
vals["compressionLevel"] = c.Int("compression-level")
|
||||||
|
}
|
||||||
|
return commonAddLogger(c, mode, vals)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runAddConsoleLogger(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
vals := map[string]interface{}{}
|
||||||
|
mode := "console"
|
||||||
|
if c.IsSet("stderr") && c.Bool("stderr") {
|
||||||
|
vals["stderr"] = c.Bool("stderr")
|
||||||
|
}
|
||||||
|
return commonAddLogger(c, mode, vals)
|
||||||
|
}
|
||||||
|
|
||||||
|
func commonAddLogger(c *cli.Context, mode string, vals map[string]interface{}) error {
|
||||||
|
if len(c.String("level")) > 0 {
|
||||||
|
vals["level"] = log.FromString(c.String("level")).String()
|
||||||
|
}
|
||||||
|
if len(c.String("stacktrace-level")) > 0 {
|
||||||
|
vals["stacktraceLevel"] = log.FromString(c.String("stacktrace-level")).String()
|
||||||
|
}
|
||||||
|
if len(c.String("expression")) > 0 {
|
||||||
|
vals["expression"] = c.String("expression")
|
||||||
|
}
|
||||||
|
if len(c.String("prefix")) > 0 {
|
||||||
|
vals["prefix"] = c.String("prefix")
|
||||||
|
}
|
||||||
|
if len(c.String("flags")) > 0 {
|
||||||
|
vals["flags"] = log.FlagsFromString(c.String("flags"))
|
||||||
|
}
|
||||||
|
if c.IsSet("color") {
|
||||||
|
vals["colorize"] = c.Bool("color")
|
||||||
|
}
|
||||||
|
group := "default"
|
||||||
|
if c.IsSet("group") {
|
||||||
|
group = c.String("group")
|
||||||
|
}
|
||||||
|
name := mode
|
||||||
|
if c.IsSet("name") {
|
||||||
|
name = c.String("name")
|
||||||
|
}
|
||||||
|
statusCode, msg := private.AddLogger(group, name, mode, vals)
|
||||||
|
switch statusCode {
|
||||||
|
case http.StatusInternalServerError:
|
||||||
|
fail("InternalServerError", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func runShutdown(c *cli.Context) error {
|
func runShutdown(c *cli.Context) error {
|
||||||
setup("manager", false)
|
setup("manager", c.Bool("debug"))
|
||||||
statusCode, msg := private.Shutdown()
|
statusCode, msg := private.Shutdown()
|
||||||
switch statusCode {
|
switch statusCode {
|
||||||
case http.StatusInternalServerError:
|
case http.StatusInternalServerError:
|
||||||
@@ -68,7 +394,7 @@ func runShutdown(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runRestart(c *cli.Context) error {
|
func runRestart(c *cli.Context) error {
|
||||||
setup("manager", false)
|
setup("manager", c.Bool("debug"))
|
||||||
statusCode, msg := private.Restart()
|
statusCode, msg := private.Restart()
|
||||||
switch statusCode {
|
switch statusCode {
|
||||||
case http.StatusInternalServerError:
|
case http.StatusInternalServerError:
|
||||||
@@ -80,7 +406,7 @@ func runRestart(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runFlushQueues(c *cli.Context) error {
|
func runFlushQueues(c *cli.Context) error {
|
||||||
setup("manager", false)
|
setup("manager", c.Bool("debug"))
|
||||||
statusCode, msg := private.FlushQueues(c.Duration("timeout"), c.Bool("non-blocking"))
|
statusCode, msg := private.FlushQueues(c.Duration("timeout"), c.Bool("non-blocking"))
|
||||||
switch statusCode {
|
switch statusCode {
|
||||||
case http.StatusInternalServerError:
|
case http.StatusInternalServerError:
|
||||||
@@ -90,3 +416,39 @@ func runFlushQueues(c *cli.Context) error {
|
|||||||
fmt.Fprintln(os.Stdout, msg)
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runPauseLogging(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
statusCode, msg := private.PauseLogging()
|
||||||
|
switch statusCode {
|
||||||
|
case http.StatusInternalServerError:
|
||||||
|
fail("InternalServerError", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func runResumeLogging(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
statusCode, msg := private.ResumeLogging()
|
||||||
|
switch statusCode {
|
||||||
|
case http.StatusInternalServerError:
|
||||||
|
fail("InternalServerError", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func runReleaseReopenLogging(c *cli.Context) error {
|
||||||
|
setup("manager", c.Bool("debug"))
|
||||||
|
statusCode, msg := private.ReleaseReopenLogging()
|
||||||
|
switch statusCode {
|
||||||
|
case http.StatusInternalServerError:
|
||||||
|
fail("InternalServerError", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintln(os.Stdout, msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
190
cmd/migrate_storage.go
Normal file
190
cmd/migrate_storage.go
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
// Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models"
|
||||||
|
"code.gitea.io/gitea/models/migrations"
|
||||||
|
"code.gitea.io/gitea/modules/log"
|
||||||
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/storage"
|
||||||
|
|
||||||
|
"github.com/urfave/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CmdMigrateStorage represents the available migrate storage sub-command.
|
||||||
|
var CmdMigrateStorage = cli.Command{
|
||||||
|
Name: "migrate-storage",
|
||||||
|
Usage: "Migrate the storage",
|
||||||
|
Description: "This is a command for migrating storage.",
|
||||||
|
Action: runMigrateStorage,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "type, t",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Kinds of files to migrate, currently only 'attachments' is supported",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "storage, s",
|
||||||
|
Value: "",
|
||||||
|
Usage: "New storage type: local (default) or minio",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "path, p",
|
||||||
|
Value: "",
|
||||||
|
Usage: "New storage placement if store is local (leave blank for default)",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-endpoint",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage endpoint",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-access-key-id",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage accessKeyID",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-secret-access-key",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage secretAccessKey",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-bucket",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage bucket",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-location",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage location to create bucket",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "minio-base-path",
|
||||||
|
Value: "",
|
||||||
|
Usage: "Minio storage basepath on the bucket",
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "minio-use-ssl",
|
||||||
|
Usage: "Enable SSL for minio",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func migrateAttachments(dstStorage storage.ObjectStorage) error {
|
||||||
|
return models.IterateAttachment(func(attach *models.Attachment) error {
|
||||||
|
_, err := storage.Copy(dstStorage, attach.RelativePath(), storage.Attachments, attach.RelativePath())
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func migrateLFS(dstStorage storage.ObjectStorage) error {
|
||||||
|
return models.IterateLFS(func(mo *models.LFSMetaObject) error {
|
||||||
|
_, err := storage.Copy(dstStorage, mo.RelativePath(), storage.LFS, mo.RelativePath())
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func migrateAvatars(dstStorage storage.ObjectStorage) error {
|
||||||
|
return models.IterateUser(func(user *models.User) error {
|
||||||
|
_, err := storage.Copy(dstStorage, user.CustomAvatarRelativePath(), storage.Avatars, user.CustomAvatarRelativePath())
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func migrateRepoAvatars(dstStorage storage.ObjectStorage) error {
|
||||||
|
return models.IterateRepository(func(repo *models.Repository) error {
|
||||||
|
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func runMigrateStorage(ctx *cli.Context) error {
|
||||||
|
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)
|
||||||
|
setting.InitDBConfig()
|
||||||
|
|
||||||
|
if err := models.NewEngine(context.Background(), migrations.Migrate); err != nil {
|
||||||
|
log.Fatal("Failed to initialize ORM engine: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
goCtx := context.Background()
|
||||||
|
|
||||||
|
if err := storage.Init(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var dstStorage storage.ObjectStorage
|
||||||
|
var err error
|
||||||
|
switch strings.ToLower(ctx.String("storage")) {
|
||||||
|
case "":
|
||||||
|
fallthrough
|
||||||
|
case string(storage.LocalStorageType):
|
||||||
|
p := ctx.String("path")
|
||||||
|
if p == "" {
|
||||||
|
log.Fatal("Path must be given when storage is loal")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
dstStorage, err = storage.NewLocalStorage(
|
||||||
|
goCtx,
|
||||||
|
storage.LocalStorageConfig{
|
||||||
|
Path: p,
|
||||||
|
})
|
||||||
|
case string(storage.MinioStorageType):
|
||||||
|
dstStorage, err = storage.NewMinioStorage(
|
||||||
|
goCtx,
|
||||||
|
storage.MinioStorageConfig{
|
||||||
|
Endpoint: ctx.String("minio-endpoint"),
|
||||||
|
AccessKeyID: ctx.String("minio-access-key-id"),
|
||||||
|
SecretAccessKey: ctx.String("minio-secret-access-key"),
|
||||||
|
Bucket: ctx.String("minio-bucket"),
|
||||||
|
Location: ctx.String("minio-location"),
|
||||||
|
BasePath: ctx.String("minio-base-path"),
|
||||||
|
UseSSL: ctx.Bool("minio-use-ssl"),
|
||||||
|
})
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("Unsupported storage type: %s", ctx.String("storage"))
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
tp := strings.ToLower(ctx.String("type"))
|
||||||
|
switch tp {
|
||||||
|
case "attachments":
|
||||||
|
if err := migrateAttachments(dstStorage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case "lfs":
|
||||||
|
if err := migrateLFS(dstStorage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case "avatars":
|
||||||
|
if err := migrateAvatars(dstStorage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case "repo-avatars":
|
||||||
|
if err := migrateRepoAvatars(dstStorage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("Unsupported storage: %s", ctx.String("type"))
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Warn("All files have been copied to the new placement but old files are still on the orignial placement.")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
73
cmd/serv.go
73
cmd/serv.go
@@ -18,12 +18,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
|
"code.gitea.io/gitea/modules/lfs"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/pprof"
|
"code.gitea.io/gitea/modules/pprof"
|
||||||
"code.gitea.io/gitea/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/dgrijalva/jwt-go"
|
"github.com/dgrijalva/jwt-go"
|
||||||
|
"github.com/kballard/go-shellquote"
|
||||||
"github.com/unknwon/com"
|
"github.com/unknwon/com"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@@ -49,8 +51,11 @@ var CmdServ = cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setup(logPath string, debug bool) {
|
func setup(logPath string, debug bool) {
|
||||||
if !debug {
|
_ = log.DelLogger("console")
|
||||||
_ = log.DelLogger("console")
|
if debug {
|
||||||
|
_ = log.NewLogger(1000, "console", "console", `{"level":"trace","stacktracelevel":"NONE","stderr":true}`)
|
||||||
|
} else {
|
||||||
|
_ = log.NewLogger(1000, "console", "console", `{"level":"fatal","stacktracelevel":"NONE","stderr":true}`)
|
||||||
}
|
}
|
||||||
setting.NewContext()
|
setting.NewContext()
|
||||||
if debug {
|
if debug {
|
||||||
@@ -58,14 +63,6 @@ func setup(logPath string, debug bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseCmd(cmd string) (string, string) {
|
|
||||||
ss := strings.SplitN(cmd, " ", 2)
|
|
||||||
if len(ss) != 2 {
|
|
||||||
return "", ""
|
|
||||||
}
|
|
||||||
return ss[0], strings.Replace(ss[1], "'/", "'", 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
allowedCommands = map[string]models.AccessMode{
|
allowedCommands = map[string]models.AccessMode{
|
||||||
"git-upload-pack": models.AccessModeRead,
|
"git-upload-pack": models.AccessModeRead,
|
||||||
@@ -116,16 +113,34 @@ func runServ(c *cli.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fail("Internal error", "Failed to check provided key: %v", err)
|
fail("Internal error", "Failed to check provided key: %v", err)
|
||||||
}
|
}
|
||||||
if key.Type == models.KeyTypeDeploy {
|
switch key.Type {
|
||||||
|
case models.KeyTypeDeploy:
|
||||||
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
|
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
|
||||||
} else {
|
case models.KeyTypePrincipal:
|
||||||
|
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Gitea does not provide shell access.")
|
||||||
|
default:
|
||||||
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
|
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
|
||||||
}
|
}
|
||||||
println("If this is unexpected, please log in with password and setup Gitea under another user.")
|
println("If this is unexpected, please log in with password and setup Gitea under another user.")
|
||||||
return nil
|
return nil
|
||||||
|
} else if c.Bool("debug") {
|
||||||
|
log.Debug("SSH_ORIGINAL_COMMAND: %s", os.Getenv("SSH_ORIGINAL_COMMAND"))
|
||||||
}
|
}
|
||||||
|
|
||||||
verb, args := parseCmd(cmd)
|
words, err := shellquote.Split(cmd)
|
||||||
|
if err != nil {
|
||||||
|
fail("Error parsing arguments", "Failed to parse arguments: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(words) < 2 {
|
||||||
|
fail("Too few arguments", "Too few arguments in cmd: %s", cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
verb := words[0]
|
||||||
|
repoPath := words[1]
|
||||||
|
if repoPath[0] == '/' {
|
||||||
|
repoPath = repoPath[1:]
|
||||||
|
}
|
||||||
|
|
||||||
var lfsVerb string
|
var lfsVerb string
|
||||||
if verb == lfsAuthenticateVerb {
|
if verb == lfsAuthenticateVerb {
|
||||||
@@ -133,17 +148,17 @@ func runServ(c *cli.Context) error {
|
|||||||
fail("Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
|
fail("Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
argsSplit := strings.Split(args, " ")
|
if len(words) > 2 {
|
||||||
if len(argsSplit) >= 2 {
|
lfsVerb = words[2]
|
||||||
args = strings.TrimSpace(argsSplit[0])
|
|
||||||
lfsVerb = strings.TrimSpace(argsSplit[1])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repoPath := strings.ToLower(strings.Trim(args, "'"))
|
// LowerCase and trim the repoPath as that's how they are stored.
|
||||||
|
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
|
||||||
|
|
||||||
rr := strings.SplitN(repoPath, "/", 2)
|
rr := strings.SplitN(repoPath, "/", 2)
|
||||||
if len(rr) != 2 {
|
if len(rr) != 2 {
|
||||||
fail("Invalid repository path", "Invalid repository path: %v", args)
|
fail("Invalid repository path", "Invalid repository path: %v", repoPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
username := strings.ToLower(rr[0])
|
username := strings.ToLower(rr[0])
|
||||||
@@ -202,23 +217,27 @@ func runServ(c *cli.Context) error {
|
|||||||
os.Setenv(models.EnvRepoName, results.RepoName)
|
os.Setenv(models.EnvRepoName, results.RepoName)
|
||||||
os.Setenv(models.EnvRepoUsername, results.OwnerName)
|
os.Setenv(models.EnvRepoUsername, results.OwnerName)
|
||||||
os.Setenv(models.EnvPusherName, results.UserName)
|
os.Setenv(models.EnvPusherName, results.UserName)
|
||||||
|
os.Setenv(models.EnvPusherEmail, results.UserEmail)
|
||||||
os.Setenv(models.EnvPusherID, strconv.FormatInt(results.UserID, 10))
|
os.Setenv(models.EnvPusherID, strconv.FormatInt(results.UserID, 10))
|
||||||
os.Setenv(models.ProtectedBranchRepoID, strconv.FormatInt(results.RepoID, 10))
|
os.Setenv(models.EnvRepoID, strconv.FormatInt(results.RepoID, 10))
|
||||||
os.Setenv(models.ProtectedBranchPRID, fmt.Sprintf("%d", 0))
|
os.Setenv(models.EnvPRID, fmt.Sprintf("%d", 0))
|
||||||
os.Setenv(models.EnvIsDeployKey, fmt.Sprintf("%t", results.IsDeployKey))
|
os.Setenv(models.EnvIsDeployKey, fmt.Sprintf("%t", results.IsDeployKey))
|
||||||
os.Setenv(models.EnvKeyID, fmt.Sprintf("%d", results.KeyID))
|
os.Setenv(models.EnvKeyID, fmt.Sprintf("%d", results.KeyID))
|
||||||
|
os.Setenv(models.EnvAppURL, setting.AppURL)
|
||||||
|
|
||||||
//LFS token authentication
|
//LFS token authentication
|
||||||
if verb == lfsAuthenticateVerb {
|
if verb == lfsAuthenticateVerb {
|
||||||
url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, url.PathEscape(results.OwnerName), url.PathEscape(results.RepoName))
|
url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, url.PathEscape(results.OwnerName), url.PathEscape(results.RepoName))
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
claims := jwt.MapClaims{
|
claims := lfs.Claims{
|
||||||
"repo": results.RepoID,
|
StandardClaims: jwt.StandardClaims{
|
||||||
"op": lfsVerb,
|
ExpiresAt: now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
|
||||||
"exp": now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
|
NotBefore: now.Unix(),
|
||||||
"nbf": now.Unix(),
|
},
|
||||||
"user": results.UserID,
|
RepoID: results.RepoID,
|
||||||
|
Op: lfsVerb,
|
||||||
|
UserID: results.UserID,
|
||||||
}
|
}
|
||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
||||||
|
|
||||||
|
|||||||
10
cmd/web.go
10
cmd/web.go
@@ -7,6 +7,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
|
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
|
||||||
"os"
|
"os"
|
||||||
@@ -40,7 +41,7 @@ and it takes care of all the other things for you`,
|
|||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "pid, P",
|
Name: "pid, P",
|
||||||
Value: "/var/run/gitea.pid",
|
Value: setting.PIDFile,
|
||||||
Usage: "Custom pid file path",
|
Usage: "Custom pid file path",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -92,7 +93,7 @@ func runLetsEncryptFallbackHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
// Remove the trailing slash at the end of setting.AppURL, the request
|
// Remove the trailing slash at the end of setting.AppURL, the request
|
||||||
// URI always contains a leading slash, which would result in a double
|
// URI always contains a leading slash, which would result in a double
|
||||||
// slash
|
// slash
|
||||||
target := strings.TrimRight(setting.AppURL, "/") + r.URL.RequestURI()
|
target := strings.TrimSuffix(setting.AppURL, "/") + r.URL.RequestURI()
|
||||||
http.Redirect(w, r, target, http.StatusFound)
|
http.Redirect(w, r, target, http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,8 @@ func runWeb(ctx *cli.Context) error {
|
|||||||
|
|
||||||
// Set pid file setting
|
// Set pid file setting
|
||||||
if ctx.IsSet("pid") {
|
if ctx.IsSet("pid") {
|
||||||
setting.CustomPID = ctx.String("pid")
|
setting.PIDFile = ctx.String("pid")
|
||||||
|
setting.WritePIDFile = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform global initialization
|
// Perform global initialization
|
||||||
@@ -156,7 +158,7 @@ func runWeb(ctx *cli.Context) error {
|
|||||||
|
|
||||||
listenAddr := setting.HTTPAddr
|
listenAddr := setting.HTTPAddr
|
||||||
if setting.Protocol != setting.UnixSocket && setting.Protocol != setting.FCGIUnix {
|
if setting.Protocol != setting.UnixSocket && setting.Protocol != setting.FCGIUnix {
|
||||||
listenAddr += ":" + setting.HTTPPort
|
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
|
||||||
}
|
}
|
||||||
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
|
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"taskName": "Build",
|
"label": "Build",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "go",
|
"command": "go",
|
||||||
"group": "build",
|
"group": "build",
|
||||||
@@ -12,20 +12,19 @@
|
|||||||
"focus": false,
|
"focus": false,
|
||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
},
|
},
|
||||||
"args": ["build"],
|
|
||||||
"linux": {
|
"linux": {
|
||||||
"args": [ "-o", "gitea", "${workspaceRoot}/main.go" ]
|
"args": ["build", "-o", "gitea", "${workspaceRoot}/main.go" ]
|
||||||
},
|
},
|
||||||
"osx": {
|
"osx": {
|
||||||
"args": [ "-o", "gitea", "${workspaceRoot}/main.go" ]
|
"args": ["build", "-o", "gitea", "${workspaceRoot}/main.go" ]
|
||||||
},
|
},
|
||||||
"windows": {
|
"windows": {
|
||||||
"args": [ "-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
|
"args": ["build", "-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$go"]
|
"problemMatcher": ["$go"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"taskName": "Build (with SQLite3)",
|
"label": "Build (with SQLite3)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "go",
|
"command": "go",
|
||||||
"group": "build",
|
"group": "build",
|
||||||
@@ -35,15 +34,14 @@
|
|||||||
"focus": false,
|
"focus": false,
|
||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
},
|
},
|
||||||
"args": ["build", "-tags=\"sqlite sqlite_unlock_notify\""],
|
|
||||||
"linux": {
|
"linux": {
|
||||||
"args": ["-o", "gitea", "${workspaceRoot}/main.go"]
|
"args": ["build", "-tags=\"sqlite sqlite_unlock_notify\"", "-o", "gitea", "${workspaceRoot}/main.go"]
|
||||||
},
|
},
|
||||||
"osx": {
|
"osx": {
|
||||||
"args": ["-o", "gitea", "${workspaceRoot}/main.go"]
|
"args": ["build", "-tags=\"sqlite sqlite_unlock_notify\"", "-o", "gitea", "${workspaceRoot}/main.go"]
|
||||||
},
|
},
|
||||||
"windows": {
|
"windows": {
|
||||||
"args": ["-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
|
"args": ["build", "-tags=\"sqlite sqlite_unlock_notify\"", "-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$go"]
|
"problemMatcher": ["$go"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
|||||||
DESC="Gitea - Git with a cup of tea"
|
DESC="Gitea - Git with a cup of tea"
|
||||||
NAME=gitea
|
NAME=gitea
|
||||||
SERVICEVERBOSE=yes
|
SERVICEVERBOSE=yes
|
||||||
PIDFILE=/var/run/$NAME.pid
|
PIDFILE=/run/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
WORKINGDIR=/var/lib/$NAME
|
WORKINGDIR=/var/lib/$NAME
|
||||||
DAEMON=/usr/local/bin/$NAME
|
DAEMON=/usr/local/bin/$NAME
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
|
|||||||
command="/usr/local/bin/gitea"
|
command="/usr/local/bin/gitea"
|
||||||
command_args="web -c /etc/gitea/app.ini"
|
command_args="web -c /etc/gitea/app.ini"
|
||||||
command_background=yes
|
command_background=yes
|
||||||
pidfile=/var/run/gitea.pid
|
pidfile=/run/gitea.pid
|
||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ case "$1" in
|
|||||||
|
|
||||||
# Return value is slightly different for the status command:
|
# Return value is slightly different for the status command:
|
||||||
# 0 - service up and running
|
# 0 - service up and running
|
||||||
# 1 - service dead, but /var/run/ pid file exists
|
# 1 - service dead, but /run/ pid file exists
|
||||||
# 2 - service dead, but /var/lock/ lock file exists
|
# 2 - service dead, but /var/lock/ lock file exists
|
||||||
# 3 - service not running (unused)
|
# 3 - service not running (unused)
|
||||||
# 4 - service status unknown :-(
|
# 4 - service status unknown :-(
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Privacy Policy</h1>
|
<h1>Privacy Policy</h1>
|
||||||
|
|
||||||
<h4>Last updated: December 28, 2019</h4>
|
<h4>Last updated: January 29, 2020</h4>
|
||||||
|
|
||||||
<h2>Who We Are?</h2>
|
<h2>Who We Are?</h2>
|
||||||
|
|
||||||
@@ -191,6 +191,6 @@
|
|||||||
|
|
||||||
<h2>COPYING</h2>
|
<h2>COPYING</h2>
|
||||||
|
|
||||||
<p>This document is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 Public Domain license</a>.</p>
|
<p>This document is licensed under CC0 Public Domain License. See <a href="https://creativecommons.org/publicdomain/zero/1.0/legalcode">full legal code here</a>.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Terms of Service</h1>
|
<h1>Terms of Service</h1>
|
||||||
|
|
||||||
<h4>Last updated: December 31, 2019</h4>
|
<h4>Last updated: January 29, 2020</h4>
|
||||||
|
|
||||||
<p>Thank you for choosing Your Gitea Instance! Before you use it, please read this Terms of Service agreement carefully, which contains important contract between us and our users.</p>
|
<p>Thank you for choosing Your Gitea Instance! Before you use it, please read this Terms of Service agreement carefully, which contains important contract between us and our users.</p>
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
|
|
||||||
<p>If you'd like to use our trademarks, you must follow all of our trademark guidelines.</p>
|
<p>If you'd like to use our trademarks, you must follow all of our trademark guidelines.</p>
|
||||||
|
|
||||||
<p>This Agreement is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO Public Domain License</a>.</p>
|
<p>This Agreement is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/legalcode">CCO Public Domain License</a>.</p>
|
||||||
|
|
||||||
<h2>API Terms</h2>
|
<h2>API Terms</h2>
|
||||||
|
|
||||||
|
|||||||
26
contrib/options/label/Advanced
Normal file
26
contrib/options/label/Advanced
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#424242 Status: Needs feedback ; Feedback is needed
|
||||||
|
#fbc02d Status: In progress ; Work is in progress
|
||||||
|
#43a047 Status: Completed ; Work is complete
|
||||||
|
#00796b Status: Help wanted ;
|
||||||
|
#880e4f Status: Blocked ;
|
||||||
|
#b0bec5 Status: Stale ;
|
||||||
|
|
||||||
|
#d32f2f Kind: Bug ;
|
||||||
|
#607d8b Kind: Question ;
|
||||||
|
#9c27b0 Kind: Security ;
|
||||||
|
#795548 Kind: Testing ;
|
||||||
|
#c62828 Kind: Breaking ;
|
||||||
|
#37474f Kind: Documentation ;
|
||||||
|
#0288d1 Kind: Feature ;
|
||||||
|
#2e7d32 Kind: Enhancement ;
|
||||||
|
#f4511e Kind: Maintenance ;
|
||||||
|
|
||||||
|
#546e7a Reviewed: Invalid ; Something was marked as invalid
|
||||||
|
#616161 Reviewed: Duplicate; Something exists already
|
||||||
|
#795548 Reviewed: Confirmed ; Something has been confirmed
|
||||||
|
#eeeeee Reviewed: Wontfix ; Something won't be fixed
|
||||||
|
|
||||||
|
#d32f2f Priority: High ; The priority is high
|
||||||
|
#e64a19 Priority: Medium ; The priority is medium
|
||||||
|
#4caf50 Priority: Low ; The priority is low
|
||||||
|
#b71c1c Priority: Critical ; The priority is critical
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// Copyright 2020 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 main
|
package main
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -25,15 +29,15 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/markup"
|
"code.gitea.io/gitea/modules/markup"
|
||||||
"code.gitea.io/gitea/modules/markup/external"
|
"code.gitea.io/gitea/modules/markup/external"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/routers"
|
"code.gitea.io/gitea/routers"
|
||||||
"code.gitea.io/gitea/routers/routes"
|
"code.gitea.io/gitea/routers/routes"
|
||||||
|
|
||||||
|
"github.com/go-git/go-git/v5"
|
||||||
|
"github.com/go-git/go-git/v5/config"
|
||||||
|
"github.com/go-git/go-git/v5/plumbing"
|
||||||
context2 "github.com/gorilla/context"
|
context2 "github.com/gorilla/context"
|
||||||
"github.com/unknwon/com"
|
"github.com/unknwon/com"
|
||||||
"gopkg.in/src-d/go-git.v4"
|
|
||||||
"gopkg.in/src-d/go-git.v4/config"
|
|
||||||
"gopkg.in/src-d/go-git.v4/plumbing"
|
|
||||||
"gopkg.in/testfixtures.v2"
|
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -92,14 +96,12 @@ func runPR() {
|
|||||||
setting.Database.LogSQL = true
|
setting.Database.LogSQL = true
|
||||||
//x, err = xorm.NewEngine("sqlite3", "file::memory:?cache=shared")
|
//x, err = xorm.NewEngine("sqlite3", "file::memory:?cache=shared")
|
||||||
|
|
||||||
var helper testfixtures.Helper = &testfixtures.SQLite{}
|
|
||||||
models.NewEngine(context.Background(), func(_ *xorm.Engine) error {
|
models.NewEngine(context.Background(), func(_ *xorm.Engine) error {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
models.HasEngine = true
|
models.HasEngine = true
|
||||||
//x.ShowSQL(true)
|
//x.ShowSQL(true)
|
||||||
err = models.InitFixtures(
|
err = models.InitFixtures(
|
||||||
helper,
|
|
||||||
path.Join(curDir, "models/fixtures/"),
|
path.Join(curDir, "models/fixtures/"),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -107,8 +109,8 @@ func runPR() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
models.LoadFixtures()
|
models.LoadFixtures()
|
||||||
os.RemoveAll(setting.RepoRootPath)
|
util.RemoveAll(setting.RepoRootPath)
|
||||||
os.RemoveAll(models.LocalCopyPath())
|
util.RemoveAll(models.LocalCopyPath())
|
||||||
com.CopyDir(path.Join(curDir, "integrations/gitea-repositories-meta"), setting.RepoRootPath)
|
com.CopyDir(path.Join(curDir, "integrations/gitea-repositories-meta"), setting.RepoRootPath)
|
||||||
|
|
||||||
log.Printf("[PR] Setting up router\n")
|
log.Printf("[PR] Setting up router\n")
|
||||||
@@ -140,20 +142,20 @@ func runPR() {
|
|||||||
|
|
||||||
log.Printf("[PR] Cleaning up ...\n")
|
log.Printf("[PR] Cleaning up ...\n")
|
||||||
/*
|
/*
|
||||||
if err = os.RemoveAll(setting.Indexer.IssuePath); err != nil {
|
if err = util.RemoveAll(setting.Indexer.IssuePath); err != nil {
|
||||||
fmt.Printf("os.RemoveAll: %v\n", err)
|
fmt.Printf("util.RemoveAll: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if err = os.RemoveAll(setting.Indexer.RepoPath); err != nil {
|
if err = util.RemoveAll(setting.Indexer.RepoPath); err != nil {
|
||||||
fmt.Printf("Unable to remove repo indexer: %v\n", err)
|
fmt.Printf("Unable to remove repo indexer: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if err = os.RemoveAll(setting.RepoRootPath); err != nil {
|
if err = util.RemoveAll(setting.RepoRootPath); err != nil {
|
||||||
log.Fatalf("os.RemoveAll: %v\n", err)
|
log.Fatalf("util.RemoveAll: %v\n", err)
|
||||||
}
|
}
|
||||||
if err = os.RemoveAll(setting.AppDataPath); err != nil {
|
if err = util.RemoveAll(setting.AppDataPath); err != nil {
|
||||||
log.Fatalf("os.RemoveAll: %v\n", err)
|
log.Fatalf("util.RemoveAll: %v\n", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +199,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
remoteUpstream := "origin" //Default
|
remoteUpstream := "origin" //Default
|
||||||
for _, r := range remotes {
|
for _, r := range remotes {
|
||||||
if r.Config().URLs[0] == "https://github.com/go-gitea/gitea" || r.Config().URLs[0] == "git@github.com:go-gitea/gitea.git" { //fetch at index 0
|
if r.Config().URLs[0] == "https://github.com/go-gitea/gitea.git" ||
|
||||||
|
r.Config().URLs[0] == "https://github.com/go-gitea/gitea" ||
|
||||||
|
r.Config().URLs[0] == "git@github.com:go-gitea/gitea.git" { //fetch at index 0
|
||||||
remoteUpstream = r.Config().Name
|
remoteUpstream = r.Config().Name
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
1215
custom/conf/app.example.ini
Normal file
1215
custom/conf/app.example.ini
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,998 +0,0 @@
|
|||||||
|
|
||||||
; This file lists the default values used by Gitea
|
|
||||||
; Copy required sections to your own app.ini (default is custom/conf/app.ini)
|
|
||||||
; and modify as needed.
|
|
||||||
|
|
||||||
; see https://docs.gitea.io/en-us/config-cheat-sheet/ for additional documentation.
|
|
||||||
|
|
||||||
; App name that shows in every page title
|
|
||||||
APP_NAME = Gitea: Git with a cup of tea
|
|
||||||
; Change it if you run locally
|
|
||||||
RUN_USER = git
|
|
||||||
; Either "dev", "prod" or "test", default is "dev"
|
|
||||||
RUN_MODE = dev
|
|
||||||
|
|
||||||
[repository]
|
|
||||||
ROOT =
|
|
||||||
SCRIPT_TYPE = bash
|
|
||||||
; Default ANSI charset
|
|
||||||
ANSI_CHARSET =
|
|
||||||
; Force every new repository to be private
|
|
||||||
FORCE_PRIVATE = false
|
|
||||||
; Default privacy setting when creating a new repository, allowed values: last, private, public. Default is last which means the last setting used.
|
|
||||||
DEFAULT_PRIVATE = last
|
|
||||||
; Global limit of repositories per user, applied at creation time. -1 means no limit
|
|
||||||
MAX_CREATION_LIMIT = -1
|
|
||||||
; Mirror sync queue length, increase if mirror syncing starts hanging
|
|
||||||
MIRROR_QUEUE_LENGTH = 1000
|
|
||||||
; Patch test queue length, increase if pull request patch testing starts hanging
|
|
||||||
PULL_REQUEST_QUEUE_LENGTH = 1000
|
|
||||||
; Preferred Licenses to place at the top of the List
|
|
||||||
; The name here must match the filename in conf/license or custom/conf/license
|
|
||||||
PREFERRED_LICENSES = Apache License 2.0,MIT License
|
|
||||||
; Disable the ability to interact with repositories using the HTTP protocol
|
|
||||||
DISABLE_HTTP_GIT = false
|
|
||||||
; Value for Access-Control-Allow-Origin header, default is not to present
|
|
||||||
; WARNING: This maybe harmful to you website if you do not give it a right value.
|
|
||||||
ACCESS_CONTROL_ALLOW_ORIGIN =
|
|
||||||
; Force ssh:// clone url instead of scp-style uri when default SSH port is used
|
|
||||||
USE_COMPAT_SSH_URI = false
|
|
||||||
; Close issues as long as a commit on any branch marks it as fixed
|
|
||||||
DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
|
|
||||||
; Allow users to push local repositories to Gitea and have them automatically created for a user or an org
|
|
||||||
ENABLE_PUSH_CREATE_USER = false
|
|
||||||
ENABLE_PUSH_CREATE_ORG = false
|
|
||||||
; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki
|
|
||||||
DISABLED_REPO_UNITS =
|
|
||||||
; Comma separated list of default repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki.
|
|
||||||
; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
|
|
||||||
; External wiki and issue tracker can't be enabled by default as it requires additional settings.
|
|
||||||
; Disabled repo units will not be added to new repositories regardless if it is in the default list.
|
|
||||||
DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki
|
|
||||||
; Prefix archive files by placing them in a directory named after the repository
|
|
||||||
PREFIX_ARCHIVE_FILES = true
|
|
||||||
|
|
||||||
[repository.editor]
|
|
||||||
; List of file extensions for which lines should be wrapped in the CodeMirror editor
|
|
||||||
; Separate extensions with a comma. To line wrap files without an extension, just put a comma
|
|
||||||
LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,
|
|
||||||
; Valid file modes that have a preview API associated with them, such as api/v1/markdown
|
|
||||||
; Separate the values by commas. The preview tab in edit mode won't be displayed if the file extension doesn't match
|
|
||||||
PREVIEWABLE_FILE_MODES = markdown
|
|
||||||
|
|
||||||
[repository.local]
|
|
||||||
; Path for local repository copy. Defaults to `tmp/local-repo`
|
|
||||||
LOCAL_COPY_PATH = tmp/local-repo
|
|
||||||
; Path for local wiki copy. Defaults to `tmp/local-wiki`
|
|
||||||
LOCAL_WIKI_PATH = tmp/local-wiki
|
|
||||||
|
|
||||||
[repository.upload]
|
|
||||||
; Whether repository file uploads are enabled. Defaults to `true`
|
|
||||||
ENABLED = true
|
|
||||||
; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
|
|
||||||
TEMP_PATH = data/tmp/uploads
|
|
||||||
; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
|
|
||||||
ALLOWED_TYPES =
|
|
||||||
; Max size of each file in megabytes. Defaults to 3MB
|
|
||||||
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]
|
|
||||||
; List of keywords used in Pull Request comments to automatically close a related issue
|
|
||||||
CLOSE_KEYWORDS=close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved
|
|
||||||
; List of keywords used in Pull Request comments to automatically reopen a related issue
|
|
||||||
REOPEN_KEYWORDS=reopen,reopens,reopened
|
|
||||||
; In the default merge message for squash commits include at most this many commits
|
|
||||||
DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT=50
|
|
||||||
; In the default merge message for squash commits limit the size of the commit messages to this
|
|
||||||
DEFAULT_MERGE_MESSAGE_SIZE=5120
|
|
||||||
; In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list
|
|
||||||
DEFAULT_MERGE_MESSAGE_ALL_AUTHORS=false
|
|
||||||
; In default merge messages limit the number of approvers listed as Reviewed-by: to this many
|
|
||||||
DEFAULT_MERGE_MESSAGE_MAX_APPROVERS=10
|
|
||||||
; In default merge messages only include approvers who are official
|
|
||||||
DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY=true
|
|
||||||
|
|
||||||
[repository.issue]
|
|
||||||
; List of reasons why a Pull Request or Issue can be locked
|
|
||||||
LOCK_REASONS=Too heated,Off-topic,Resolved,Spam
|
|
||||||
|
|
||||||
[repository.signing]
|
|
||||||
; GPG key to use to sign commits, Defaults to the default - that is the value of git config --get user.signingkey
|
|
||||||
; run in the context of the RUN_USER
|
|
||||||
; Switch to none to stop signing completely
|
|
||||||
SIGNING_KEY = default
|
|
||||||
; If a SIGNING_KEY ID is provided and is not set to default, use the provided Name and Email address as the signer.
|
|
||||||
; These should match a publicized name and email address for the key. (When SIGNING_KEY is default these are set to
|
|
||||||
; the results of git config --get user.name and git config --get user.email respectively and can only be overrided
|
|
||||||
; by setting the SIGNING_KEY ID to the correct ID.)
|
|
||||||
SIGNING_NAME =
|
|
||||||
SIGNING_EMAIL =
|
|
||||||
; Determines when gitea should sign the initial commit when creating a repository
|
|
||||||
; Either:
|
|
||||||
; - never
|
|
||||||
; - pubkey: only sign if the user has a pubkey
|
|
||||||
; - twofa: only sign if the user has logged in with twofa
|
|
||||||
; - always
|
|
||||||
; options other than none and always can be combined as comma separated list
|
|
||||||
INITIAL_COMMIT = always
|
|
||||||
; Determines when to sign for CRUD actions
|
|
||||||
; - as above
|
|
||||||
; - parentsigned: requires that the parent commit is signed.
|
|
||||||
CRUD_ACTIONS = pubkey, twofa, parentsigned
|
|
||||||
; Determines when to sign Wiki commits
|
|
||||||
; - as above
|
|
||||||
WIKI = never
|
|
||||||
; Determines when to sign on merges
|
|
||||||
; - basesigned: require that the parent of commit on the base repo is signed.
|
|
||||||
; - commitssigned: require that all the commits in the head branch are signed.
|
|
||||||
; - approved: only sign when merging an approved pr to a protected branch
|
|
||||||
MERGES = pubkey, twofa, basesigned, commitssigned
|
|
||||||
|
|
||||||
[cors]
|
|
||||||
; More information about CORS can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers
|
|
||||||
; enable cors headers (disabled by default)
|
|
||||||
ENABLED=false
|
|
||||||
; scheme of allowed requests
|
|
||||||
SCHEME=http
|
|
||||||
; list of requesting domains that are allowed
|
|
||||||
ALLOW_DOMAIN=*
|
|
||||||
; allow subdomains of headers listed above to request
|
|
||||||
ALLOW_SUBDOMAIN=false
|
|
||||||
; list of methods allowed to request
|
|
||||||
METHODS=GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
|
|
||||||
; max time to cache response
|
|
||||||
MAX_AGE=10m
|
|
||||||
; allow request with credentials
|
|
||||||
ALLOW_CREDENTIALS=false
|
|
||||||
|
|
||||||
[ui]
|
|
||||||
; Number of repositories that are displayed on one explore page
|
|
||||||
EXPLORE_PAGING_NUM = 20
|
|
||||||
; Number of issues that are displayed on one page
|
|
||||||
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
|
|
||||||
THEME_COLOR_META_TAG = `#6cc644`
|
|
||||||
; Max size of files to be displayed (default is 8MiB)
|
|
||||||
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
|
|
||||||
; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
|
|
||||||
THEMES = gitea,arc-green
|
|
||||||
; All available reactions. Allow users react with different emoji's
|
|
||||||
; For the whole list look at https://gitea.com/gitea/gitea.com/issues/8
|
|
||||||
REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
|
|
||||||
; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
|
|
||||||
DEFAULT_SHOW_FULL_NAME = false
|
|
||||||
; Whether to search within description at repository search on explore page.
|
|
||||||
SEARCH_REPO_DESCRIPTION = true
|
|
||||||
; Whether to enable a Service Worker to cache frontend assets
|
|
||||||
USE_SERVICE_WORKER = true
|
|
||||||
|
|
||||||
[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 one page
|
|
||||||
NOTICE_PAGING_NUM = 25
|
|
||||||
; Number of organizations that are displayed on one page
|
|
||||||
ORG_PAGING_NUM = 50
|
|
||||||
|
|
||||||
[ui.user]
|
|
||||||
; Number of repos that are displayed on one page
|
|
||||||
REPO_PAGING_NUM = 15
|
|
||||||
|
|
||||||
[ui.meta]
|
|
||||||
AUTHOR = Gitea - Git with a cup of tea
|
|
||||||
DESCRIPTION = Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go
|
|
||||||
KEYWORDS = go,git,self-hosted,gitea
|
|
||||||
|
|
||||||
[markdown]
|
|
||||||
; Enable hard line break extension
|
|
||||||
ENABLE_HARD_LINE_BREAK = false
|
|
||||||
; Comma separated list of custom URL-Schemes that are allowed as links when rendering Markdown
|
|
||||||
; for example git,magnet,ftp (more at https://en.wikipedia.org/wiki/List_of_URI_schemes)
|
|
||||||
; URLs starting with http and https are always displayed, whatever is put in this entry.
|
|
||||||
CUSTOM_URL_SCHEMES =
|
|
||||||
; List of file extensions that should be rendered/edited as Markdown
|
|
||||||
; Separate the extensions with a comma. To render files without any extension as markdown, just put a comma
|
|
||||||
FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
|
|
||||||
|
|
||||||
[server]
|
|
||||||
; The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'.
|
|
||||||
PROTOCOL = http
|
|
||||||
DOMAIN = localhost
|
|
||||||
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
|
|
||||||
; when STATIC_URL_PREFIX is empty it will follow ROOT_URL
|
|
||||||
STATIC_URL_PREFIX =
|
|
||||||
; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket.
|
|
||||||
HTTP_ADDR = 0.0.0.0
|
|
||||||
HTTP_PORT = 3000
|
|
||||||
; If REDIRECT_OTHER_PORT is true, and PROTOCOL is set to https an http server
|
|
||||||
; will be started on PORT_TO_REDIRECT and it will redirect plain, non-secure http requests to the main
|
|
||||||
; ROOT_URL. Defaults are false for REDIRECT_OTHER_PORT and 80 for
|
|
||||||
; PORT_TO_REDIRECT.
|
|
||||||
REDIRECT_OTHER_PORT = false
|
|
||||||
PORT_TO_REDIRECT = 80
|
|
||||||
; Permission for unix socket
|
|
||||||
UNIX_SOCKET_PERMISSION = 666
|
|
||||||
; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
|
|
||||||
; In most cases you do not need to change the default value.
|
|
||||||
; Alter it only if your SSH server node is not the same as HTTP node.
|
|
||||||
; Do not set this variable if PROTOCOL is set to 'unix'.
|
|
||||||
LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
|
|
||||||
; Disable SSH feature when not available
|
|
||||||
DISABLE_SSH = false
|
|
||||||
; Whether to use the builtin SSH server or not.
|
|
||||||
START_SSH_SERVER = false
|
|
||||||
; Username to use for the builtin SSH server. If blank, then it is the value of RUN_USER.
|
|
||||||
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
|
|
||||||
SSH_LISTEN_HOST =
|
|
||||||
; Port number to be exposed in clone URL
|
|
||||||
SSH_PORT = 22
|
|
||||||
; The port number the builtin SSH server should listen on
|
|
||||||
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
|
|
||||||
; For the built-in SSH server, choose the key exchange algorithms to support for SSH connections,
|
|
||||||
; for system SSH this setting has no effect
|
|
||||||
SSH_SERVER_KEY_EXCHANGES = diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, curve25519-sha256@libssh.org
|
|
||||||
; For the built-in SSH server, choose the MACs to support for SSH connections,
|
|
||||||
; for system SSH this setting has no effect
|
|
||||||
SSH_SERVER_MACS = hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1, hmac-sha1-96
|
|
||||||
; Directory to create temporary files in when testing public keys using ssh-keygen,
|
|
||||||
; default is the system temporary directory.
|
|
||||||
SSH_KEY_TEST_PATH =
|
|
||||||
; Path to ssh-keygen, default is 'ssh-keygen' which means the shell is responsible for finding out which one to call.
|
|
||||||
SSH_KEYGEN_PATH = ssh-keygen
|
|
||||||
; Enable SSH Authorized Key Backup when rewriting all keys, default is true
|
|
||||||
SSH_BACKUP_AUTHORIZED_KEYS = true
|
|
||||||
; Enable exposure of SSH clone URL to anonymous visitors, default is false
|
|
||||||
SSH_EXPOSE_ANONYMOUS = false
|
|
||||||
; Indicate whether to check minimum key size with corresponding type
|
|
||||||
MINIMUM_KEY_SIZE_CHECK = false
|
|
||||||
; Disable CDN even in "prod" mode
|
|
||||||
OFFLINE_MODE = false
|
|
||||||
DISABLE_ROUTER_LOG = false
|
|
||||||
; Generate steps:
|
|
||||||
; $ ./gitea cert -ca=true -duration=8760h0m0s -host=myhost.example.com
|
|
||||||
;
|
|
||||||
; Or from a .pfx file exported from the Windows certificate store (do
|
|
||||||
; not forget to export the private key):
|
|
||||||
; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
|
|
||||||
; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
|
|
||||||
; Paths are relative to CUSTOM_PATH
|
|
||||||
CERT_FILE = https/cert.pem
|
|
||||||
KEY_FILE = https/key.pem
|
|
||||||
; Root directory containing templates and static files.
|
|
||||||
; default is the path where Gitea is executed
|
|
||||||
STATIC_ROOT_PATH =
|
|
||||||
; Default path for App data
|
|
||||||
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", "organizations" or "login"
|
|
||||||
; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in.
|
|
||||||
LANDING_PAGE = home
|
|
||||||
; Enables git-lfs support. true or false, default is false.
|
|
||||||
LFS_START_SERVER = false
|
|
||||||
; Where your lfs files reside, default is data/lfs.
|
|
||||||
LFS_CONTENT_PATH = data/lfs
|
|
||||||
; LFS authentication secret, change this yourself
|
|
||||||
LFS_JWT_SECRET =
|
|
||||||
; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
|
|
||||||
LFS_HTTP_AUTH_EXPIRY = 20m
|
|
||||||
; Maximum allowed LFS file size in bytes (Set to 0 for no limit).
|
|
||||||
LFS_MAX_FILE_SIZE = 0
|
|
||||||
; Allow graceful restarts using SIGHUP to fork
|
|
||||||
ALLOW_GRACEFUL_RESTARTS = true
|
|
||||||
; After a restart the parent will finish ongoing requests before
|
|
||||||
; shutting down. Force shutdown if this process takes longer than this delay.
|
|
||||||
; set to a negative value to disable
|
|
||||||
GRACEFUL_HAMMER_TIME = 60s
|
|
||||||
; Allows the setting of a startup timeout and waithint for Windows as SVC service
|
|
||||||
; 0 disables this.
|
|
||||||
STARTUP_TIMEOUT = 0
|
|
||||||
; Static resources, includes resources on custom/, public/ and all uploaded avatars web browser cache time, default is 6h
|
|
||||||
STATIC_CACHE_TIME = 6h
|
|
||||||
|
|
||||||
; Define allowed algorithms and their minimum key length (use -1 to disable a type)
|
|
||||||
[ssh.minimum_key_sizes]
|
|
||||||
ED25519 = 256
|
|
||||||
ECDSA = 256
|
|
||||||
RSA = 2048
|
|
||||||
DSA = 1024
|
|
||||||
|
|
||||||
[database]
|
|
||||||
; Either "mysql", "postgres", "mssql" or "sqlite3", it's your choice
|
|
||||||
DB_TYPE = mysql
|
|
||||||
HOST = 127.0.0.1:3306
|
|
||||||
NAME = gitea
|
|
||||||
USER = root
|
|
||||||
; Use PASSWD = `your password` for quoting if you use special characters in the password.
|
|
||||||
PASSWD =
|
|
||||||
; For Postgres, schema to use if different from "public". The schema must exist beforehand,
|
|
||||||
; the user must have creation privileges on it, and the user search path must be set
|
|
||||||
; to the look into the schema first. e.g.:ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;
|
|
||||||
SCHEMA =
|
|
||||||
; For Postgres, either "disable" (default), "require", or "verify-full"
|
|
||||||
; For MySQL, either "false" (default), "true", or "skip-verify"
|
|
||||||
SSL_MODE = disable
|
|
||||||
; For MySQL only, either "utf8" or "utf8mb4", default is "utf8".
|
|
||||||
; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
|
|
||||||
CHARSET = utf8
|
|
||||||
; 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
|
|
||||||
; For iterate buffer, default is 50
|
|
||||||
ITERATE_BUFFER_SIZE = 50
|
|
||||||
; Show the database generated SQL
|
|
||||||
LOG_SQL = true
|
|
||||||
; Maximum number of DB Connect retries
|
|
||||||
DB_RETRIES = 10
|
|
||||||
; Backoff time per DB retry (time.Duration)
|
|
||||||
DB_RETRY_BACKOFF = 3s
|
|
||||||
; Max idle database connections on connnection pool, default is 2
|
|
||||||
MAX_IDLE_CONNS = 2
|
|
||||||
; Database connection max life time, default is 0 or 3s mysql (See #6804 & #7071 for reasoning)
|
|
||||||
CONN_MAX_LIFETIME = 3s
|
|
||||||
; Database maximum number of open connections, default is 0 meaning no maximum
|
|
||||||
MAX_OPEN_CONNS = 0
|
|
||||||
|
|
||||||
[indexer]
|
|
||||||
; Issue indexer type, currently support: bleve, db or elasticsearch, default is bleve
|
|
||||||
ISSUE_INDEXER_TYPE = bleve
|
|
||||||
; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch
|
|
||||||
ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200
|
|
||||||
; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
|
|
||||||
ISSUE_INDEXER_NAME = gitea_issues
|
|
||||||
; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
|
|
||||||
ISSUE_INDEXER_PATH = indexers/issues.bleve
|
|
||||||
; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
|
|
||||||
ISSUE_INDEXER_QUEUE_TYPE = levelqueue
|
|
||||||
; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
|
|
||||||
; default is indexers/issues.queue
|
|
||||||
ISSUE_INDEXER_QUEUE_DIR = indexers/issues.queue
|
|
||||||
; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
|
|
||||||
ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
|
|
||||||
; Batch queue number, default is 20
|
|
||||||
ISSUE_INDEXER_QUEUE_BATCH_NUMBER = 20
|
|
||||||
; Timeout the indexer if it takes longer than this to start.
|
|
||||||
; Set to zero to disable timeout.
|
|
||||||
STARTUP_TIMEOUT=30s
|
|
||||||
|
|
||||||
; repo indexer by default disabled, since it uses a lot of disk space
|
|
||||||
REPO_INDEXER_ENABLED = false
|
|
||||||
REPO_INDEXER_PATH = indexers/repos.bleve
|
|
||||||
UPDATE_BUFFER_LEN = 20
|
|
||||||
MAX_FILE_SIZE = 1048576
|
|
||||||
; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include
|
|
||||||
; in the index; default is empty
|
|
||||||
REPO_INDEXER_INCLUDE =
|
|
||||||
; A comma separated list of glob patterns to exclude from the index; ; default is empty
|
|
||||||
REPO_INDEXER_EXCLUDE =
|
|
||||||
|
|
||||||
[queue]
|
|
||||||
; Specific queues can be individually configured with [queue.name]. [queue] provides defaults
|
|
||||||
;
|
|
||||||
; General queue queue type, currently support: persistable-channel, channel, level, redis, dummy
|
|
||||||
; default to persistable-channel
|
|
||||||
TYPE = persistable-channel
|
|
||||||
; data-dir for storing persistable queues and level queues, individual queues will be named by their type
|
|
||||||
DATADIR = queues/
|
|
||||||
; Default queue length before a channel queue will block
|
|
||||||
LENGTH = 20
|
|
||||||
; Batch size to send for batched queues
|
|
||||||
BATCH_LENGTH = 20
|
|
||||||
; Connection string for redis queues this will store the redis connection string.
|
|
||||||
CONN_STR = "addrs=127.0.0.1:6379 db=0"
|
|
||||||
; Provide the suffix of the default redis queue name - specific queues can be overriden within in their [queue.name] sections.
|
|
||||||
QUEUE_NAME = "_queue"
|
|
||||||
; If the queue cannot be created at startup - level queues may need a timeout at startup - wrap the queue:
|
|
||||||
WRAP_IF_NECESSARY = true
|
|
||||||
; Attempt to create the wrapped queue at max
|
|
||||||
MAX_ATTEMPTS = 10
|
|
||||||
; Timeout queue creation
|
|
||||||
TIMEOUT = 15m30s
|
|
||||||
; Create a pool with this many workers
|
|
||||||
WORKERS = 1
|
|
||||||
; Dynamically scale the worker pool to at this many workers
|
|
||||||
MAX_WORKERS = 10
|
|
||||||
; Add boost workers when the queue blocks for BLOCK_TIMEOUT
|
|
||||||
BLOCK_TIMEOUT = 1s
|
|
||||||
; Remove the boost workers after BOOST_TIMEOUT
|
|
||||||
BOOST_TIMEOUT = 5m
|
|
||||||
; During a boost add BOOST_WORKERS
|
|
||||||
BOOST_WORKERS = 5
|
|
||||||
|
|
||||||
[admin]
|
|
||||||
; Disallow regular (non-admin) users from creating organizations.
|
|
||||||
DISABLE_REGULAR_ORG_CREATION = false
|
|
||||||
; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
|
|
||||||
DEFAULT_EMAIL_NOTIFICATIONS = enabled
|
|
||||||
|
|
||||||
[security]
|
|
||||||
; Whether the installer is disabled
|
|
||||||
INSTALL_LOCK = false
|
|
||||||
; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
|
|
||||||
SECRET_KEY = !#@FDEWREWR&*(
|
|
||||||
; How long to remember that a user is logged in before requiring relogin (in days)
|
|
||||||
LOGIN_REMEMBER_DAYS = 7
|
|
||||||
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
|
|
||||||
; Set to true to allow users to import local server paths
|
|
||||||
IMPORT_LOCAL_PATHS = false
|
|
||||||
; Set to true to prevent all users (including admin) from creating custom git hooks
|
|
||||||
DISABLE_GIT_HOOKS = false
|
|
||||||
; Set to false to allow pushes to gitea repositories despite having an incomplete environment - NOT RECOMMENDED
|
|
||||||
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET = true
|
|
||||||
;Comma separated list of character classes required to pass minimum complexity.
|
|
||||||
;If left empty or no valid values are specified, the default values ("lower,upper,digit,spec") will be used.
|
|
||||||
;Use "off" to disable checking.
|
|
||||||
PASSWORD_COMPLEXITY = lower,upper,digit,spec
|
|
||||||
; Password Hash algorithm, either "pbkdf2", "argon2", "scrypt" or "bcrypt"
|
|
||||||
PASSWORD_HASH_ALGO = pbkdf2
|
|
||||||
; Set false to allow JavaScript to read CSRF cookie
|
|
||||||
CSRF_COOKIE_HTTP_ONLY = true
|
|
||||||
|
|
||||||
[openid]
|
|
||||||
;
|
|
||||||
; OpenID is an open, standard and decentralized authentication protocol.
|
|
||||||
; Your identity is the address of a webpage you provide, which describes
|
|
||||||
; how to prove you are in control of that page.
|
|
||||||
;
|
|
||||||
; For more info: https://en.wikipedia.org/wiki/OpenID
|
|
||||||
;
|
|
||||||
; Current implementation supports OpenID-2.0
|
|
||||||
;
|
|
||||||
; Tested to work providers at the time of writing:
|
|
||||||
; - Any GNUSocial node (your.hostname.tld/username)
|
|
||||||
; - Any SimpleID provider (http://simpleid.koinic.net)
|
|
||||||
; - http://openid.org.cn/
|
|
||||||
; - openid.stackexchange.com
|
|
||||||
; - login.launchpad.net
|
|
||||||
; - <username>.livejournal.com
|
|
||||||
;
|
|
||||||
; Whether to allow signin in via OpenID
|
|
||||||
ENABLE_OPENID_SIGNIN = true
|
|
||||||
; Whether to allow registering via OpenID
|
|
||||||
; Do not include to rely on rhw DISABLE_REGISTRATION setting
|
|
||||||
;ENABLE_OPENID_SIGNUP = true
|
|
||||||
; Allowed URI patterns (POSIX regexp).
|
|
||||||
; Space separated.
|
|
||||||
; Only these would be allowed if non-blank.
|
|
||||||
; Example value: trusted.domain.org trusted.domain.net
|
|
||||||
WHITELISTED_URIS =
|
|
||||||
; Forbidden URI patterns (POSIX regexp).
|
|
||||||
; Space separated.
|
|
||||||
; Only used if WHITELISTED_URIS is blank.
|
|
||||||
; Example value: loadaverage.org/badguy stackexchange.com/.*spammer
|
|
||||||
BLACKLISTED_URIS =
|
|
||||||
|
|
||||||
[service]
|
|
||||||
; Time limit to confirm account/email registration
|
|
||||||
ACTIVE_CODE_LIVE_MINUTES = 180
|
|
||||||
; Time limit to perform the reset of a forgotten password
|
|
||||||
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-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
|
|
||||||
; Mail notification
|
|
||||||
ENABLE_NOTIFY_MAIL = false
|
|
||||||
; This setting enables gitea to be signed in with HTTP BASIC Authentication using the user's password
|
|
||||||
; If you set this to false you will not be able to access the tokens endpoints on the API with your password
|
|
||||||
; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token
|
|
||||||
ENABLE_BASIC_AUTHENTICATION = true
|
|
||||||
; 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 =
|
|
||||||
; Change this to use recaptcha.net or other recaptcha service
|
|
||||||
RECAPTCHA_URL = https://www.google.com/recaptcha/
|
|
||||||
; 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
|
|
||||||
; Either "public", "limited" or "private", default is "public"
|
|
||||||
; Limited is for signed user only
|
|
||||||
; Private is only for member of the organization
|
|
||||||
; Public is for everyone
|
|
||||||
DEFAULT_ORG_VISIBILITY = public
|
|
||||||
; Default value for DefaultOrgMemberVisible
|
|
||||||
; True will make the membership of the users visible when added to the organisation
|
|
||||||
DEFAULT_ORG_MEMBER_VISIBLE = false
|
|
||||||
; Default value for EnableDependencies
|
|
||||||
; Repositories will use dependencies by default depending on this setting
|
|
||||||
DEFAULT_ENABLE_DEPENDENCIES = true
|
|
||||||
; Dependencies can be added from any repository where the user is granted access or only from the current repository depending on this setting.
|
|
||||||
ALLOW_CROSS_REPOSITORY_DEPENDENCIES = true
|
|
||||||
; Enable heatmap on users profiles.
|
|
||||||
ENABLE_USER_HEATMAP = true
|
|
||||||
; Enable Timetracking
|
|
||||||
ENABLE_TIMETRACKING = true
|
|
||||||
; Default value for EnableTimetracking
|
|
||||||
; Repositories will use timetracking by default depending on this setting
|
|
||||||
DEFAULT_ENABLE_TIMETRACKING = true
|
|
||||||
; Default value for AllowOnlyContributorsToTrackTime
|
|
||||||
; Only users with write permissions can track time if this is true
|
|
||||||
DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME = true
|
|
||||||
; Default value for the domain part of the user's email address in the git log
|
|
||||||
; if he has set KeepEmailPrivate to true. The user's email will be replaced with a
|
|
||||||
; concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.
|
|
||||||
NO_REPLY_ADDRESS = noreply.%(DOMAIN)s
|
|
||||||
; Show Registration button
|
|
||||||
SHOW_REGISTRATION_BUTTON = true
|
|
||||||
; Show milestones dashboard page - a view of all the user's milestones
|
|
||||||
SHOW_MILESTONES_DASHBOARD_PAGE = true
|
|
||||||
; Default value for AutoWatchNewRepos
|
|
||||||
; When adding a repo to a team or creating a new repo all team members will watch the
|
|
||||||
; repo automatically if enabled
|
|
||||||
AUTO_WATCH_NEW_REPOS = true
|
|
||||||
; Default value for AutoWatchOnChanges
|
|
||||||
; Make the user watch a repository When they commit for the first time
|
|
||||||
AUTO_WATCH_ON_CHANGES = false
|
|
||||||
|
|
||||||
[webhook]
|
|
||||||
; Hook task queue length, increase if webhook shooting starts hanging
|
|
||||||
QUEUE_LENGTH = 1000
|
|
||||||
; Deliver timeout in seconds
|
|
||||||
DELIVER_TIMEOUT = 5
|
|
||||||
; Allow insecure certification
|
|
||||||
SKIP_TLS_VERIFY = false
|
|
||||||
; Number of history information in each page
|
|
||||||
PAGING_NUM = 10
|
|
||||||
; Proxy server URL, support http://, https//, socks://, blank will follow environment http_proxy/https_proxy
|
|
||||||
PROXY_URL =
|
|
||||||
; Comma separated list of host names requiring proxy. Glob patterns (*) are accepted; use ** to match all hosts.
|
|
||||||
PROXY_HOSTS =
|
|
||||||
|
|
||||||
[mailer]
|
|
||||||
ENABLED = false
|
|
||||||
; Buffer length of channel, keep it as it is if you don't know what it is.
|
|
||||||
SEND_BUFFER_LEN = 100
|
|
||||||
; Prefix displayed before subject in mail
|
|
||||||
SUBJECT_PREFIX =
|
|
||||||
; Mail server
|
|
||||||
; Gmail: smtp.gmail.com:587
|
|
||||||
; QQ: smtp.qq.com:465
|
|
||||||
; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
|
|
||||||
HOST =
|
|
||||||
; Disable HELO operation when hostnames are different.
|
|
||||||
DISABLE_HELO =
|
|
||||||
; Custom hostname for HELO operation, if no value is provided, one is retrieved from system.
|
|
||||||
HELO_HOSTNAME =
|
|
||||||
; Do not verify the certificate of the server. Only use this for self-signed certificates
|
|
||||||
SKIP_VERIFY =
|
|
||||||
; Use client certificate
|
|
||||||
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
|
|
||||||
USER =
|
|
||||||
; Use PASSWD = `your password` for quoting if you use special characters in the password.
|
|
||||||
PASSWD =
|
|
||||||
; Send mails as plain text
|
|
||||||
SEND_AS_PLAIN_TEXT = false
|
|
||||||
; Set Mailer Type (either SMTP, sendmail or dummy to just send to the log)
|
|
||||||
MAILER_TYPE = smtp
|
|
||||||
; Specify an alternative sendmail binary
|
|
||||||
SENDMAIL_PATH = sendmail
|
|
||||||
; Specify any extra sendmail arguments
|
|
||||||
SENDMAIL_ARGS =
|
|
||||||
|
|
||||||
[cache]
|
|
||||||
; if the cache enabled
|
|
||||||
ENABLED = true
|
|
||||||
; Either "memory", "redis", or "memcache", default is "memory"
|
|
||||||
ADAPTER = memory
|
|
||||||
; For "memory" only, GC interval in seconds, default is 60
|
|
||||||
INTERVAL = 60
|
|
||||||
; For "redis" and "memcache", connection host address
|
|
||||||
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
|
|
||||||
; memcache: `127.0.0.1:11211`
|
|
||||||
HOST =
|
|
||||||
; Time to keep items in cache if not used, default is 16 hours.
|
|
||||||
; Setting it to 0 disables caching
|
|
||||||
ITEM_TTL = 16h
|
|
||||||
|
|
||||||
; Last commit cache
|
|
||||||
[cache.last_commit]
|
|
||||||
; if the cache enabled
|
|
||||||
ENABLED = true
|
|
||||||
; Time to keep items in cache if not used, default is 8760 hours.
|
|
||||||
; Setting it to 0 disables caching
|
|
||||||
ITEM_TTL = 8760h
|
|
||||||
; Only enable the cache when repository's commits count great than
|
|
||||||
COMMITS_COUNT = 1000
|
|
||||||
|
|
||||||
[session]
|
|
||||||
; Either "memory", "file", or "redis", default is "memory"
|
|
||||||
PROVIDER = memory
|
|
||||||
; Provider config options
|
|
||||||
; memory: doesn't have any config yet
|
|
||||||
; file: session file path, e.g. `data/sessions`
|
|
||||||
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
|
|
||||||
; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
|
|
||||||
PROVIDER_CONFIG = data/sessions
|
|
||||||
; Session cookie name
|
|
||||||
COOKIE_NAME = i_like_gitea
|
|
||||||
; If you use session in https only, default is false
|
|
||||||
COOKIE_SECURE = false
|
|
||||||
; Enable set cookie, default is true
|
|
||||||
ENABLE_SET_COOKIE = true
|
|
||||||
; Session GC time interval in seconds, default is 86400 (1 day)
|
|
||||||
GC_INTERVAL_TIME = 86400
|
|
||||||
; Session life time in seconds, default is 86400 (1 day)
|
|
||||||
SESSION_LIFE_TIME = 86400
|
|
||||||
|
|
||||||
[picture]
|
|
||||||
AVATAR_UPLOAD_PATH = data/avatars
|
|
||||||
REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
|
|
||||||
; How Gitea deals with missing repository avatars
|
|
||||||
; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
|
|
||||||
REPOSITORY_AVATAR_FALLBACK = none
|
|
||||||
REPOSITORY_AVATAR_FALLBACK_IMAGE = /img/repo_default.png
|
|
||||||
; Max Width and Height of uploaded avatars.
|
|
||||||
; This is to limit the amount of RAM used when resizing the image.
|
|
||||||
AVATAR_MAX_WIDTH = 4096
|
|
||||||
AVATAR_MAX_HEIGHT = 3072
|
|
||||||
; Maximum alloved file size for uploaded avatars.
|
|
||||||
; This is to limit the amount of RAM used when resizing the image.
|
|
||||||
AVATAR_MAX_FILE_SIZE = 1048576
|
|
||||||
; Chinese users can choose "duoshuo"
|
|
||||||
; or a custom avatar source, like: http://cn.gravatar.com/avatar/
|
|
||||||
GRAVATAR_SOURCE = gravatar
|
|
||||||
; This value will always be true in offline mode.
|
|
||||||
DISABLE_GRAVATAR = false
|
|
||||||
; Federated avatar lookup uses DNS to discover avatar associated
|
|
||||||
; with emails, see https://www.libravatar.org
|
|
||||||
; This value will always be false in offline mode or when Gravatar is disabled.
|
|
||||||
ENABLE_FEDERATED_AVATAR = false
|
|
||||||
|
|
||||||
[attachment]
|
|
||||||
; Whether attachments are enabled. Defaults to `true`
|
|
||||||
ENABLED = true
|
|
||||||
; Path for attachments. Defaults to `data/attachments`
|
|
||||||
PATH = data/attachments
|
|
||||||
; One or more allowed types, e.g. image/jpeg|image/png
|
|
||||||
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip
|
|
||||||
; Max size of each file. Defaults to 4MB
|
|
||||||
MAX_SIZE = 4
|
|
||||||
; Max number of files per upload. Defaults to 5
|
|
||||||
MAX_FILES = 5
|
|
||||||
|
|
||||||
[time]
|
|
||||||
; Specifies the format for fully outputted dates. Defaults to RFC1123
|
|
||||||
; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano
|
|
||||||
; For more information about the format see http://golang.org/pkg/time/#pkg-constants
|
|
||||||
FORMAT =
|
|
||||||
; Location the UI time display i.e. Asia/Shanghai
|
|
||||||
; Empty means server's location setting
|
|
||||||
DEFAULT_UI_LOCATION =
|
|
||||||
|
|
||||||
[log]
|
|
||||||
ROOT_PATH =
|
|
||||||
; Either "console", "file", "conn", "smtp" or "database", default is "console"
|
|
||||||
; Use comma to separate multiple modes, e.g. "console, file"
|
|
||||||
MODE = console
|
|
||||||
; Buffer length of the channel, keep it as it is if you don't know what it is.
|
|
||||||
BUFFER_LEN = 10000
|
|
||||||
REDIRECT_MACARON_LOG = false
|
|
||||||
MACARON = file
|
|
||||||
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Info"
|
|
||||||
ROUTER_LOG_LEVEL = Info
|
|
||||||
ROUTER = console
|
|
||||||
ENABLE_ACCESS_LOG = false
|
|
||||||
ACCESS_LOG_TEMPLATE = {{.Ctx.RemoteAddr}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}\" \"{{.Ctx.Req.UserAgent}}"
|
|
||||||
ACCESS = file
|
|
||||||
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
|
|
||||||
LEVEL = Info
|
|
||||||
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "None"
|
|
||||||
STACKTRACE_LEVEL = None
|
|
||||||
|
|
||||||
; Generic log modes
|
|
||||||
[log.x]
|
|
||||||
FLAGS = stdflags
|
|
||||||
EXPRESSION =
|
|
||||||
PREFIX =
|
|
||||||
COLORIZE = false
|
|
||||||
|
|
||||||
; For "console" mode only
|
|
||||||
[log.console]
|
|
||||||
LEVEL =
|
|
||||||
STDERR = false
|
|
||||||
|
|
||||||
; For "file" mode only
|
|
||||||
[log.file]
|
|
||||||
LEVEL =
|
|
||||||
; Set the file_name for the logger. If this is a relative path this
|
|
||||||
; will be relative to ROOT_PATH
|
|
||||||
FILE_NAME =
|
|
||||||
; This enables automated log rotate(switch of following options), default is true
|
|
||||||
LOG_ROTATE = true
|
|
||||||
; Max number of lines in a single file, default is 1000000
|
|
||||||
MAX_LINES = 1000000
|
|
||||||
; Max size shift of a single file, default is 28 means 1 << 28, 256MB
|
|
||||||
MAX_SIZE_SHIFT = 28
|
|
||||||
; Segment log daily, default is true
|
|
||||||
DAILY_ROTATE = true
|
|
||||||
; delete the log file after n days, default is 7
|
|
||||||
MAX_DAYS = 7
|
|
||||||
; compress logs with gzip
|
|
||||||
COMPRESS = true
|
|
||||||
; compression level see godoc for compress/gzip
|
|
||||||
COMPRESSION_LEVEL = -1
|
|
||||||
|
|
||||||
; For "conn" mode only
|
|
||||||
[log.conn]
|
|
||||||
LEVEL =
|
|
||||||
; Reconnect host for every single message, default is false
|
|
||||||
RECONNECT_ON_MSG = false
|
|
||||||
; Try to reconnect when connection is lost, default is false
|
|
||||||
RECONNECT = false
|
|
||||||
; Either "tcp", "unix" or "udp", default is "tcp"
|
|
||||||
PROTOCOL = tcp
|
|
||||||
; Host address
|
|
||||||
ADDR =
|
|
||||||
|
|
||||||
; For "smtp" mode only
|
|
||||||
[log.smtp]
|
|
||||||
LEVEL =
|
|
||||||
; Name displayed in mail title, default is "Diagnostic message from server"
|
|
||||||
SUBJECT = Diagnostic message from server
|
|
||||||
; Mail server
|
|
||||||
HOST =
|
|
||||||
; Mailer user name and password
|
|
||||||
USER =
|
|
||||||
; Use PASSWD = `your password` for quoting if you use special characters in the password.
|
|
||||||
PASSWD =
|
|
||||||
; Receivers, can be one or more, e.g. 1@example.com,2@example.com
|
|
||||||
RECEIVERS =
|
|
||||||
|
|
||||||
[cron]
|
|
||||||
; Enable running cron tasks periodically.
|
|
||||||
ENABLED = true
|
|
||||||
; Run cron tasks when Gitea starts.
|
|
||||||
RUN_AT_START = false
|
|
||||||
|
|
||||||
; Update mirrors
|
|
||||||
[cron.update_mirrors]
|
|
||||||
SCHEDULE = @every 10m
|
|
||||||
|
|
||||||
; Repository health check
|
|
||||||
[cron.repo_health_check]
|
|
||||||
SCHEDULE = @every 24h
|
|
||||||
TIMEOUT = 60s
|
|
||||||
; Arguments for command 'git fsck', e.g. "--unreachable --tags"
|
|
||||||
; see more on http://git-scm.com/docs/git-fsck
|
|
||||||
ARGS =
|
|
||||||
|
|
||||||
; Check repository statistics
|
|
||||||
[cron.check_repo_stats]
|
|
||||||
RUN_AT_START = true
|
|
||||||
SCHEDULE = @every 24h
|
|
||||||
|
|
||||||
; Clean up old repository archives
|
|
||||||
[cron.archive_cleanup]
|
|
||||||
; Whether to enable the job
|
|
||||||
ENABLED = true
|
|
||||||
; Whether to always run at least once at start up time (if ENABLED)
|
|
||||||
RUN_AT_START = true
|
|
||||||
; Time interval for job to run
|
|
||||||
SCHEDULE = @every 24h
|
|
||||||
; Archives created more than OLDER_THAN ago are subject to deletion
|
|
||||||
OLDER_THAN = 24h
|
|
||||||
|
|
||||||
; Synchronize external user data (only LDAP user synchronization is supported)
|
|
||||||
[cron.sync_external_users]
|
|
||||||
; Synchronize external user data when starting server (default false)
|
|
||||||
RUN_AT_START = false
|
|
||||||
; Interval as a duration between each synchronization (default every 24h)
|
|
||||||
SCHEDULE = @every 24h
|
|
||||||
; Create new users, update existing user data and disable users that are not in external source anymore (default)
|
|
||||||
; or only create new users if UPDATE_EXISTING is set to false
|
|
||||||
UPDATE_EXISTING = true
|
|
||||||
|
|
||||||
; Update migrated repositories' issues and comments' posterid, it will always attempt synchronization when the instance starts.
|
|
||||||
[cron.update_migration_post_id]
|
|
||||||
; Interval as a duration between each synchronization. (default every 24h)
|
|
||||||
SCHEDULE = @every 24h
|
|
||||||
|
|
||||||
[git]
|
|
||||||
; The path of git executable. If empty, Gitea searches through the PATH environment.
|
|
||||||
PATH =
|
|
||||||
; Disables highlight of added and removed changes
|
|
||||||
DISABLE_DIFF_HIGHLIGHT = false
|
|
||||||
; Max number of lines allowed in a single file in diff view
|
|
||||||
MAX_GIT_DIFF_LINES = 1000
|
|
||||||
; Max number of allowed characters in a line in diff view
|
|
||||||
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/
|
|
||||||
GC_ARGS =
|
|
||||||
; If use git wire protocol version 2 when git version >= 2.18, default is true, set to false when you always want git wire protocol version 1
|
|
||||||
ENABLE_AUTO_GIT_WIRE_PROTOCOL = true
|
|
||||||
; Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled)
|
|
||||||
PULL_REQUEST_PUSH_MESSAGE = true
|
|
||||||
|
|
||||||
; Operation timeout in seconds
|
|
||||||
[git.timeout]
|
|
||||||
DEFAULT = 360
|
|
||||||
MIGRATE = 600
|
|
||||||
MIRROR = 300
|
|
||||||
CLONE = 300
|
|
||||||
PULL = 300
|
|
||||||
GC = 60
|
|
||||||
|
|
||||||
[mirror]
|
|
||||||
; Default interval as a duration between each check
|
|
||||||
DEFAULT_INTERVAL = 8h
|
|
||||||
; Min interval as a duration must be > 1m
|
|
||||||
MIN_INTERVAL = 10m
|
|
||||||
|
|
||||||
[api]
|
|
||||||
; Enables Swagger. True or false; default is true.
|
|
||||||
ENABLE_SWAGGER = true
|
|
||||||
; Max number of items in a page
|
|
||||||
MAX_RESPONSE_ITEMS = 50
|
|
||||||
; Default paging number of api
|
|
||||||
DEFAULT_PAGING_NUM = 30
|
|
||||||
; Default and maximum number of items per page for git trees api
|
|
||||||
DEFAULT_GIT_TREES_PER_PAGE = 1000
|
|
||||||
; Default size of a blob returned by the blobs API (default is 10MiB)
|
|
||||||
DEFAULT_MAX_BLOB_SIZE = 10485760
|
|
||||||
|
|
||||||
[oauth2]
|
|
||||||
; Enables OAuth2 provider
|
|
||||||
ENABLE = true
|
|
||||||
; Lifetime of an OAuth2 access token in seconds
|
|
||||||
ACCESS_TOKEN_EXPIRATION_TIME=3600
|
|
||||||
; Lifetime of an OAuth2 access token in hours
|
|
||||||
REFRESH_TOKEN_EXPIRATION_TIME=730
|
|
||||||
; Check if refresh token got already used
|
|
||||||
INVALIDATE_REFRESH_TOKENS=false
|
|
||||||
; OAuth2 authentication secret for access and refresh tokens, change this to a unique string.
|
|
||||||
JWT_SECRET=Bk0yK7Y9g_p56v86KaHqjSbxvNvu3SbKoOdOt2ZcXvU
|
|
||||||
|
|
||||||
[i18n]
|
|
||||||
LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR
|
|
||||||
NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,Українська,日本語,español,português do Brasil,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어
|
|
||||||
|
|
||||||
; Used for datetimepicker
|
|
||||||
[i18n.datelang]
|
|
||||||
en-US = en
|
|
||||||
zh-CN = zh
|
|
||||||
zh-HK = zh-HK
|
|
||||||
zh-TW = zh-TW
|
|
||||||
de-DE = de
|
|
||||||
fr-FR = fr
|
|
||||||
nl-NL = nl
|
|
||||||
lv-LV = lv
|
|
||||||
ru-RU = ru
|
|
||||||
uk-UA = uk
|
|
||||||
ja-JP = ja
|
|
||||||
es-ES = es
|
|
||||||
pt-BR = pt-BR
|
|
||||||
pl-PL = pl
|
|
||||||
bg-BG = bg
|
|
||||||
it-IT = it
|
|
||||||
fi-FI = fi
|
|
||||||
tr-TR = tr
|
|
||||||
cs-CZ = cs-CZ
|
|
||||||
sr-SP = sr
|
|
||||||
sv-SE = sv
|
|
||||||
ko-KR = ko
|
|
||||||
|
|
||||||
[U2F]
|
|
||||||
; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
|
|
||||||
; Two Factor authentication with security keys
|
|
||||||
; https://developers.yubico.com/U2F/App_ID.html
|
|
||||||
;APP_ID = http://localhost:3000/
|
|
||||||
; Comma seperated list of trusted facets
|
|
||||||
;TRUSTED_FACETS = http://localhost:3000/
|
|
||||||
|
|
||||||
; Extension mapping to highlight class
|
|
||||||
; e.g. .toml=ini
|
|
||||||
[highlight.mapping]
|
|
||||||
|
|
||||||
[other]
|
|
||||||
SHOW_FOOTER_BRANDING = false
|
|
||||||
; Show version information about Gitea and Go in the footer
|
|
||||||
SHOW_FOOTER_VERSION = true
|
|
||||||
; Show template execution time in the footer
|
|
||||||
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
|
|
||||||
|
|
||||||
[markup.sanitizer]
|
|
||||||
; The following keys can be used multiple times to define sanitation policy rules.
|
|
||||||
;ELEMENT = span
|
|
||||||
;ALLOW_ATTR = class
|
|
||||||
;REGEXP = ^(info|warning|error)$
|
|
||||||
|
|
||||||
[markup.asciidoc]
|
|
||||||
ENABLED = false
|
|
||||||
; List of file extensions that should be rendered by an external command
|
|
||||||
FILE_EXTENSIONS = .adoc,.asciidoc
|
|
||||||
; External command to render all matching extensions
|
|
||||||
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 =
|
|
||||||
|
|
||||||
[task]
|
|
||||||
; Task queue type, could be `channel` or `redis`.
|
|
||||||
QUEUE_TYPE = channel
|
|
||||||
; Task queue length, available only when `QUEUE_TYPE` is `channel`.
|
|
||||||
QUEUE_LENGTH = 1000
|
|
||||||
; Task queue connection string, available only when `QUEUE_TYPE` is `redis`.
|
|
||||||
; If there is a password of redis, use `addrs=127.0.0.1:6379 password=123 db=0`.
|
|
||||||
QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
|
|
||||||
|
|
||||||
[migrations]
|
|
||||||
; Max attempts per http/https request on migrations.
|
|
||||||
MAX_ATTEMPTS = 3
|
|
||||||
; Backoff time per http/https request retry (seconds)
|
|
||||||
RETRY_BACKOFF = 3
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#Makefile related to docker
|
|
||||||
|
|
||||||
DOCKER_IMAGE ?= gitea/gitea
|
|
||||||
DOCKER_TAG ?= latest
|
|
||||||
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 sqlite_unlock_notify" .
|
|
||||||
|
|
||||||
.PHONY: docker-build
|
|
||||||
docker-build:
|
|
||||||
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" webhippie/golang:edge make clean build
|
|
||||||
7
docker/README.md
Normal file
7
docker/README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Gitea - Docker
|
||||||
|
|
||||||
|
Dockerfile is found in root of repository.
|
||||||
|
|
||||||
|
Docker image can be found on [docker hub](https://hub.docker.com/r/gitea/gitea)
|
||||||
|
|
||||||
|
Documentation on using docker image can be found on [Gitea Docs site](https://docs.gitea.io/en-us/install-with-docker/)
|
||||||
@@ -26,6 +26,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
|
|||||||
# Substitude the environment variables in the template
|
# Substitude the environment variables in the template
|
||||||
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
|
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
|
||||||
RUN_MODE=${RUN_MODE:-"dev"} \
|
RUN_MODE=${RUN_MODE:-"dev"} \
|
||||||
|
DOMAIN=${DOMAIN:-"localhost"} \
|
||||||
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
|
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
|
||||||
HTTP_PORT=${HTTP_PORT:-"3000"} \
|
HTTP_PORT=${HTTP_PORT:-"3000"} \
|
||||||
ROOT_URL=${ROOT_URL:-""} \
|
ROOT_URL=${ROOT_URL:-""} \
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ TEMP_PATH = /data/gitea/uploads
|
|||||||
|
|
||||||
[server]
|
[server]
|
||||||
APP_DATA_PATH = /data/gitea
|
APP_DATA_PATH = /data/gitea
|
||||||
|
DOMAIN = $DOMAIN
|
||||||
SSH_DOMAIN = $SSH_DOMAIN
|
SSH_DOMAIN = $SSH_DOMAIN
|
||||||
HTTP_PORT = $HTTP_PORT
|
HTTP_PORT = $HTTP_PORT
|
||||||
ROOT_URL = $ROOT_URL
|
ROOT_URL = $ROOT_URL
|
||||||
@@ -28,6 +29,7 @@ HOST = $DB_HOST
|
|||||||
NAME = $DB_NAME
|
NAME = $DB_NAME
|
||||||
USER = $DB_USER
|
USER = $DB_USER
|
||||||
PASSWD = $DB_PASSWD
|
PASSWD = $DB_PASSWD
|
||||||
|
LOG_SQL = false
|
||||||
|
|
||||||
[indexer]
|
[indexer]
|
||||||
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
||||||
@@ -43,6 +45,11 @@ REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
|
|||||||
PATH = /data/gitea/attachments
|
PATH = /data/gitea/attachments
|
||||||
|
|
||||||
[log]
|
[log]
|
||||||
|
MODE = console
|
||||||
|
LEVEL = info
|
||||||
|
REDIRECT_MACARON_LOG = true
|
||||||
|
MACARON = console
|
||||||
|
ROUTER = console
|
||||||
ROOT_PATH = /data/gitea/log
|
ROOT_PATH = /data/gitea/log
|
||||||
|
|
||||||
[security]
|
[security]
|
||||||
|
|||||||
@@ -8,11 +8,18 @@ ListenAddress ::
|
|||||||
LogLevel INFO
|
LogLevel INFO
|
||||||
|
|
||||||
HostKey /data/ssh/ssh_host_ed25519_key
|
HostKey /data/ssh/ssh_host_ed25519_key
|
||||||
|
HostCertificate /data/ssh/ssh_host_ed25519_cert
|
||||||
HostKey /data/ssh/ssh_host_rsa_key
|
HostKey /data/ssh/ssh_host_rsa_key
|
||||||
HostKey /data/ssh/ssh_host_dsa_key
|
HostCertificate /data/ssh/ssh_host_rsa_cert
|
||||||
HostKey /data/ssh/ssh_host_ecdsa_key
|
HostKey /data/ssh/ssh_host_ecdsa_key
|
||||||
|
HostCertificate /data/ssh/ssh_host_ecdsa_cert
|
||||||
|
HostKey /data/ssh/ssh_host_dsa_key
|
||||||
|
HostCertificate /data/ssh/ssh_host_dsa_cert
|
||||||
|
|
||||||
AuthorizedKeysFile .ssh/authorized_keys
|
AuthorizedKeysFile .ssh/authorized_keys
|
||||||
|
AuthorizedPrincipalsFile .ssh/authorized_principals
|
||||||
|
TrustedUserCAKeys /data/git/.ssh/gitea-trusted-user-ca-keys.pem
|
||||||
|
CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
|
||||||
|
|
||||||
UseDNS no
|
UseDNS no
|
||||||
AllowAgentForwarding no
|
AllowAgentForwarding no
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ server: $(THEME)
|
|||||||
build: $(THEME)
|
build: $(THEME)
|
||||||
hugo --cleanDestinationDir
|
hugo --cleanDestinationDir
|
||||||
|
|
||||||
|
.PHONY: build-offline
|
||||||
|
build-offline: $(THEME)
|
||||||
|
hugo --baseURL="/" --cleanDestinationDir
|
||||||
|
|
||||||
.PHONY: update
|
.PHONY: update
|
||||||
update: $(THEME)
|
update: $(THEME)
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ params:
|
|||||||
description: Git with a cup of tea
|
description: Git with a cup of tea
|
||||||
author: The Gitea Authors
|
author: The Gitea Authors
|
||||||
website: https://docs.gitea.io
|
website: https://docs.gitea.io
|
||||||
version: 1.11.2
|
version: 1.12.5
|
||||||
minGoVersion: 1.11
|
minGoVersion: 1.13
|
||||||
goVersion: 1.13
|
goVersion: 1.15
|
||||||
minNodeVersion: 10
|
minNodeVersion: 10.13
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
home:
|
home:
|
||||||
@@ -52,6 +52,10 @@ menu:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: Translation
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: Downloads
|
- name: Downloads
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -100,6 +104,10 @@ languages:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: 翻译
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: 下载
|
- name: 下载
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -143,6 +151,10 @@ languages:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: 翻译
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: 下载
|
- name: 下载
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -186,6 +198,10 @@ languages:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: Translation
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: Downloads
|
- name: Downloads
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -229,6 +245,10 @@ languages:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: Translation
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: Downloads
|
- name: Downloads
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -272,6 +292,10 @@ languages:
|
|||||||
url: https://code.gitea.io/
|
url: https://code.gitea.io/
|
||||||
weight: 40
|
weight: 40
|
||||||
pre: code
|
pre: code
|
||||||
|
- name: Translation
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
- name: Téléchargement
|
- name: Téléchargement
|
||||||
url: https://dl.gitea.io/
|
url: https://dl.gitea.io/
|
||||||
weight: 50
|
weight: 50
|
||||||
@@ -288,3 +312,50 @@ languages:
|
|||||||
url: https://discourse.gitea.io/
|
url: https://discourse.gitea.io/
|
||||||
weight: 80
|
weight: 80
|
||||||
pre: group
|
pre: group
|
||||||
|
|
||||||
|
pt-pt:
|
||||||
|
weight: 6
|
||||||
|
languageName: Português de Portugal
|
||||||
|
menu:
|
||||||
|
page:
|
||||||
|
- name: Página inicial
|
||||||
|
url: https://gitea.io/pt-pt/
|
||||||
|
weight: 10
|
||||||
|
pre: home
|
||||||
|
- name: Documentação
|
||||||
|
url: /pt-pt/
|
||||||
|
weight: 20
|
||||||
|
pre: question
|
||||||
|
post: active
|
||||||
|
- name: API
|
||||||
|
url: https://try.gitea.io/api/swagger
|
||||||
|
weight: 45
|
||||||
|
pre: plug
|
||||||
|
- name: Blog
|
||||||
|
url: https://blog.gitea.io/
|
||||||
|
weight: 30
|
||||||
|
pre: rss
|
||||||
|
- name: Código-fonte
|
||||||
|
url: https://code.gitea.io/
|
||||||
|
weight: 40
|
||||||
|
pre: code
|
||||||
|
- name: Tradução
|
||||||
|
url: https://crowdin.com/project/gitea
|
||||||
|
weight: 41
|
||||||
|
pre: language
|
||||||
|
- name: Descarregamentos
|
||||||
|
url: https://dl.gitea.io/
|
||||||
|
weight: 50
|
||||||
|
pre: download
|
||||||
|
- name: GitHub
|
||||||
|
url: https://github.com/go-gitea/
|
||||||
|
weight: 60
|
||||||
|
pre: github
|
||||||
|
- name: Discussão no Discord
|
||||||
|
url: https://discord.gg/Gitea
|
||||||
|
weight: 70
|
||||||
|
pre: comment
|
||||||
|
- name: Fórum
|
||||||
|
url: https://discourse.gitea.io/
|
||||||
|
weight: 80
|
||||||
|
pre: group
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Listing all embedded files with `openid` in their path:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ gitea embedded list '**openid**'
|
$ gitea embedded list '**openid**'
|
||||||
public/img/auth/openid_connect.png
|
public/img/auth/openid_connect.svg
|
||||||
public/img/openid-16x16.png
|
public/img/openid-16x16.png
|
||||||
templates/user/auth/finalize_openid.tmpl
|
templates/user/auth/finalize_openid.tmpl
|
||||||
templates/user/auth/signin_openid.tmpl
|
templates/user/auth/signin_openid.tmpl
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ or any corresponding location. When installing from a distribution, this will
|
|||||||
typically be found at `/etc/gitea/conf/app.ini`.
|
typically be found at `/etc/gitea/conf/app.ini`.
|
||||||
|
|
||||||
The defaults provided here are best-effort (not built automatically). They are
|
The defaults provided here are best-effort (not built automatically). They are
|
||||||
accurately recorded in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
accurately recorded in [app.example.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
(s/master/\<tag|release\>). Any string in the format `%(X)s` is a feature powered
|
(s/master/\<tag|release\>). Any string in the format `%(X)s` is a feature powered
|
||||||
by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively.
|
by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively.
|
||||||
|
|
||||||
@@ -46,10 +46,12 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
an absolute path.
|
an absolute path.
|
||||||
- `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`,
|
- `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`,
|
||||||
but some users report that only `sh` is available.
|
but some users report that only `sh` is available.
|
||||||
- `ANSI_CHARSET`: **\<empty\>**: The default charset for an unrecognized charset.
|
- `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Adding `defaults` will place the unnamed charsets at that point.
|
||||||
|
- `ANSI_CHARSET`: **\<empty\>**: Default ANSI charset to override non-UTF-8 charsets to.
|
||||||
- `FORCE_PRIVATE`: **false**: Force every new repository to be private.
|
- `FORCE_PRIVATE`: **false**: Force every new repository to be private.
|
||||||
- `DEFAULT_PRIVATE`: **last**: Default private when creating a new repository.
|
- `DEFAULT_PRIVATE`: **last**: Default private when creating a new repository.
|
||||||
\[last, private, public\]
|
\[last, private, public\]
|
||||||
|
- `DEFAULT_PUSH_CREATE_PRIVATE`: **true**: Default private when creating a new repository with push-to-create.
|
||||||
- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user,
|
- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user,
|
||||||
`-1` means no limit.
|
`-1` means no limit.
|
||||||
- `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it
|
- `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it
|
||||||
@@ -68,7 +70,18 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed.
|
- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed.
|
||||||
- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user.
|
- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user.
|
||||||
- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org.
|
- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org.
|
||||||
|
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects\]
|
||||||
|
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects**: Comma separated list of default repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
|
||||||
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
|
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
|
||||||
|
- `DISABLE_MIRRORS`: **false**: Disable the creation of **new** mirrors. Pre-existing mirrors remain valid.
|
||||||
|
- `DEFAULT_BRANCH`: **master**: Default branch name of all repositories.
|
||||||
|
- `ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to adopt unadopted repositories
|
||||||
|
- `ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to delete unadopted repositories
|
||||||
|
|
||||||
|
### Repository - Editor (`repository.editor`)
|
||||||
|
|
||||||
|
- `LINE_WRAP_EXTENSIONS`: **.txt,.md,.markdown,.mdown,.mkd,**: List of file extensions for which lines should be wrapped in the Monaco editor. Separate extensions with a comma. To line wrap files without an extension, just put a comma
|
||||||
|
- `PREVIEWABLE_FILE_MODES`: **markdown**: Valid file modes that have a preview API associated with them, such as `api/v1/markdown`. Separate the values by commas. The preview tab in edit mode won't be displayed if the file extension doesn't match.
|
||||||
|
|
||||||
### Repository - Pull Request (`repository.pull-request`)
|
### Repository - Pull Request (`repository.pull-request`)
|
||||||
|
|
||||||
@@ -88,6 +101,18 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
|
|
||||||
- `LOCK_REASONS`: **Too heated,Off-topic,Resolved,Spam**: A list of reasons why a Pull Request or Issue can be locked
|
- `LOCK_REASONS`: **Too heated,Off-topic,Resolved,Spam**: A list of reasons why a Pull Request or Issue can be locked
|
||||||
|
|
||||||
|
### Repository - Upload (`repository.upload`)
|
||||||
|
|
||||||
|
- `ENABLED`: **true**: Whether repository file uploads are enabled
|
||||||
|
- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (tmp gets deleted on gitea restart)
|
||||||
|
- `ALLOWED_TYPES`: **\<empty\>**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
|
- `FILE_MAX_SIZE`: **3**: Max size of each file in megabytes.
|
||||||
|
- `MAX_FILES`: **5**: Max number of files per upload
|
||||||
|
|
||||||
|
### Repository - Release (`repository.release`)
|
||||||
|
|
||||||
|
- `ALLOWED_TYPES`: **\<empty\>**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
|
|
||||||
### Repository - Signing (`repository.signing`)
|
### Repository - Signing (`repository.signing`)
|
||||||
|
|
||||||
- `SIGNING_KEY`: **default**: \[none, KEYID, default \]: Key to sign with.
|
- `SIGNING_KEY`: **default**: \[none, KEYID, default \]: Key to sign with.
|
||||||
@@ -98,6 +123,10 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `twofa`: Only sign if the user is logged in with twofa
|
- `twofa`: Only sign if the user is logged in with twofa
|
||||||
- `always`: Always sign
|
- `always`: Always sign
|
||||||
- Options other than `never` and `always` can be combined as a comma separated list.
|
- Options other than `never` and `always` can be combined as a comma separated list.
|
||||||
|
- `DEFAULT_TRUST_MODEL`: **collaborator**: \[collaborator, committer, collaboratorcommitter\]: The default trust model used for verifying commits.
|
||||||
|
- `collaborator`: Trust signatures signed by keys of collaborators.
|
||||||
|
- `committer`: Trust signatures that match committers (This matches GitHub and will force Gitea signed commits to have Gitea as the commmitter).
|
||||||
|
- `collaboratorcommitter`: Trust signatures signed by keys of collaborators which match the commiter.
|
||||||
- `WIKI`: **never**: \[never, pubkey, twofa, always, parentsigned\]: Sign commits to wiki.
|
- `WIKI`: **never**: \[never, pubkey, twofa, always, parentsigned\]: Sign commits to wiki.
|
||||||
- `CRUD_ACTIONS`: **pubkey, twofa, parentsigned**: \[never, pubkey, twofa, parentsigned, always\]: Sign CRUD actions.
|
- `CRUD_ACTIONS`: **pubkey, twofa, parentsigned**: \[never, pubkey, twofa, parentsigned, always\]: Sign CRUD actions.
|
||||||
- Options as above, with the addition of:
|
- Options as above, with the addition of:
|
||||||
@@ -108,6 +137,19 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `headsigned`: Only sign if the head commit in the head branch is signed.
|
- `headsigned`: Only sign if the head commit in the head branch is signed.
|
||||||
- `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed.
|
- `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed.
|
||||||
|
|
||||||
|
## Repository - Local (`repository.local`)
|
||||||
|
|
||||||
|
- `LOCAL_COPY_PATH`: **tmp/local-repo**: Path for temporary local repository copies. Defaults to `tmp/local-repo`
|
||||||
|
|
||||||
|
## Repository - Upload (`repository.upload`)
|
||||||
|
|
||||||
|
- `ENABLED`: **true**: Whether repository file uploads are enabled. Defaults to `true`
|
||||||
|
- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
|
||||||
|
- `ALLOWED_TYPES`: **_empty_**:; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
|
||||||
|
- `FILE_MAX_SIZE`: **3**: Max size of each file in megabytes. Defaults to 3MB
|
||||||
|
- `MAX_FILES`: **5**: Max number of files per upload. Defaults to 5
|
||||||
|
|
||||||
|
|
||||||
## CORS (`cors`)
|
## CORS (`cors`)
|
||||||
|
|
||||||
- `ENABLED`: **false**: enable cors headers (disabled by default)
|
- `ENABLED`: **false**: enable cors headers (disabled by default)
|
||||||
@@ -124,11 +166,18 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
|
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
|
||||||
- `MEMBERS_PAGING_NUM`: **20**: Number of members that are shown in organization members.
|
- `MEMBERS_PAGING_NUM`: **20**: Number of members that are shown in organization members.
|
||||||
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
|
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
|
||||||
|
- `FEED_PAGING_NUM`: **20**: Number of items that are displayed in home feed.
|
||||||
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
|
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
|
||||||
|
- `CODE_COMMENT_LINES`: **4**: Number of line of codes shown for a code comment.
|
||||||
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
|
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
|
||||||
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes
|
- `SHOW_USER_EMAIL`: **true**: Whether the email of the user should be shown in the Explore Users page.
|
||||||
|
- `THEMES`: **gitea,arc-green**: All available themes. Allow users select personalized themes.
|
||||||
regardless of the value of `DEFAULT_THEME`.
|
regardless of the value of `DEFAULT_THEME`.
|
||||||
- `REACTIONS`: All available reactions. Allow users react with different emoji's.
|
- `THEME_COLOR_META_TAG`: **#6cc644**: 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
|
||||||
|
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
|
||||||
|
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
|
||||||
|
Values can be emoji alias (:smile:) or a unicode emoji.
|
||||||
|
For custom reactions, add a tightly cropped square image to public/emoji/img/reaction_name.png
|
||||||
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
|
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
|
||||||
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
|
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
|
||||||
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.
|
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.
|
||||||
@@ -140,9 +189,27 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page.
|
- `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page.
|
||||||
- `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page.
|
- `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page.
|
||||||
|
|
||||||
|
### UI - Metadata (`ui.meta`)
|
||||||
|
|
||||||
|
- `AUTHOR`: **Gitea - Git with a cup of tea**: Author meta tag of the homepage.
|
||||||
|
- `DESCRIPTION`: **Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go**: Description meta tag of the homepage.
|
||||||
|
- `KEYWORDS`: **go,git,self-hosted,gitea**: Keywords meta tag of the homepage.
|
||||||
|
|
||||||
|
### UI - Notification (`ui.notification`)
|
||||||
|
|
||||||
|
- `MIN_TIMEOUT`: **10s**: These options control how often notification endpoint is polled to update the notification count. On page load the notification count will be checked after `MIN_TIMEOUT`. The timeout will increase to `MAX_TIMEOUT` by `TIMEOUT_STEP` if the notification count is unchanged. Set MIN_TIMEOUT to 0 to turn off.
|
||||||
|
- `MAX_TIMEOUT`: **60s**.
|
||||||
|
- `TIMEOUT_STEP`: **10s**.
|
||||||
|
- `EVENT_SOURCE_UPDATE_TIME`: **10s**: This setting determines how often the database is queried to update notification counts. If the browser client supports `EventSource` and `SharedWorker`, a `SharedWorker` will be used in preference to polling notification endpoint. Set to **-1** to disable the `EventSource`.
|
||||||
|
|
||||||
## Markdown (`markdown`)
|
## Markdown (`markdown`)
|
||||||
|
|
||||||
- `ENABLE_HARD_LINE_BREAK`: **false**: Enable Markdown's hard line break extension.
|
- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: Render soft line breaks as hard line breaks in comments, which
|
||||||
|
means a single newline character between paragraphs will cause a line break and adding
|
||||||
|
trailing whitespace to paragraphs is not necessary to force a line break.
|
||||||
|
- `ENABLE_HARD_LINE_BREAK_IN_DOCUMENTS`: **false**: Render soft line breaks as hard line breaks in documents, which
|
||||||
|
means a single newline character between paragraphs will cause a line break and adding
|
||||||
|
trailing whitespace to paragraphs is not necessary to force a line break.
|
||||||
- `CUSTOM_URL_SCHEMES`: Use a comma separated list (ftp,git,svn) to indicate additional
|
- `CUSTOM_URL_SCHEMES`: Use a comma separated list (ftp,git,svn) to indicate additional
|
||||||
URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are
|
URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are
|
||||||
always displayed
|
always displayed
|
||||||
@@ -174,25 +241,49 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
most cases you do not need to change the default value. Alter it only if
|
most cases you do not need to change the default value. Alter it only if
|
||||||
your SSH server node is not the same as HTTP node. Do not set this variable
|
your SSH server node is not the same as HTTP node. Do not set this variable
|
||||||
if `PROTOCOL` is set to `unix`.
|
if `PROTOCOL` is set to `unix`.
|
||||||
|
|
||||||
- `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
|
- `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
|
||||||
- `START_SSH_SERVER`: **false**: When enabled, use the built-in SSH server.
|
- `START_SSH_SERVER`: **false**: When enabled, use the built-in SSH server.
|
||||||
|
- `BUILTIN_SSH_SERVER_USER`: **%(RUN_USER)s**: Username to use for the built-in SSH Server.
|
||||||
- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of this server, used for displayed clone URL.
|
- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of this server, used for displayed clone URL.
|
||||||
- `SSH_PORT`: **22**: SSH port displayed in clone URL.
|
- `SSH_PORT`: **22**: SSH port displayed in clone URL.
|
||||||
- `SSH_LISTEN_HOST`: **0.0.0.0**: Listen address for the built-in SSH server.
|
- `SSH_LISTEN_HOST`: **0.0.0.0**: Listen address for the built-in SSH server.
|
||||||
- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
|
- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
|
||||||
|
- `SSH_ROOT_PATH`: **~/.ssh**: Root path of SSH directory.
|
||||||
|
- `SSH_CREATE_AUTHORIZED_KEYS_FILE`: **true**: 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_TRUSTED_USER_CA_KEYS`: **\<empty\>**: Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. Multiple keys should be comma separated. E.g.`ssh-<algorithm> <key>` or `ssh-<algorithm> <key1>, ssh-<algorithm> <key2>`. For more information see `TrustedUserCAKeys` in the sshd config man pages. When empty no file will be created and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` will default to `off`.
|
||||||
|
- `SSH_TRUSTED_USER_CA_KEYS_FILENAME`: **`RUN_USER`/.ssh/gitea-trusted-user-ca-keys.pem**: Absolute path of the `TrustedUserCaKeys` file gitea will manage. If you're running your own ssh server and you want to use the gitea managed file you'll also need to modify your sshd_config to point to this file. The official docker image will automatically work without further configuration.
|
||||||
|
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
|
||||||
|
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
||||||
|
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
|
||||||
|
- `SSH_SERVER_CIPHERS`: **aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
|
||||||
|
- `SSH_SERVER_KEY_EXCHANGES`: **diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, curve25519-sha256@libssh.org**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
|
||||||
|
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1, hmac-sha1-96**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
|
||||||
|
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
|
||||||
|
- `SSH_KEYGEN_PATH`: **ssh-keygen**: Path to ssh-keygen, default is 'ssh-keygen' which means the shell is responsible for finding out which one to call.
|
||||||
|
- `SSH_BACKUP_AUTHORIZED_KEYS`: **true**: Enable SSH Authorized Key Backup when rewriting all keys, default is true.
|
||||||
|
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.
|
||||||
|
- `MINIMUM_KEY_SIZE_CHECK`: **true**: Indicate whether to check minimum key size with corresponding type.
|
||||||
|
|
||||||
- `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures.
|
- `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures.
|
||||||
- `DISABLE_ROUTER_LOG`: **false**: Mute printing of the router log.
|
- `DISABLE_ROUTER_LOG`: **false**: Mute printing of the router log.
|
||||||
- `CERT_FILE`: **https/cert.pem**: Cert file path used for HTTPS. From 1.11 paths are relative to `CUSTOM_PATH`.
|
- `CERT_FILE`: **https/cert.pem**: Cert file path used for HTTPS. When chaining, the server certificate must come first, then intermediate CA certificates (if any). From 1.11 paths are relative to `CUSTOM_PATH`.
|
||||||
- `KEY_FILE`: **https/key.pem**: Key file path used for HTTPS. From 1.11 paths are relative to `CUSTOM_PATH`.
|
- `KEY_FILE`: **https/key.pem**: Key file path used for HTTPS. From 1.11 paths are relative to `CUSTOM_PATH`.
|
||||||
- `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path.
|
- `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path.
|
||||||
|
- `APP_DATA_PATH`: **data** (**/data/gitea** on docker): Default path for application data.
|
||||||
- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars.
|
- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars.
|
||||||
- `ENABLE_GZIP`: **false**: Enables application-level GZIP support.
|
- `ENABLE_GZIP`: **false**: Enables application-level GZIP support.
|
||||||
|
- `ENABLE_PPROF`: **false**: Application profiling (memory and cpu). For "web" command it listens on localhost:6060. For "serv" command it dumps to disk at `PPROF_DATA_PATH` as `(cpuprofile|memprofile)_<username>_<temporary id>`
|
||||||
|
- `PPROF_DATA_PATH`: **data/tmp/pprof**: `PPROF_DATA_PATH`, use an absolute path when you start gitea as service
|
||||||
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\].
|
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\].
|
||||||
|
|
||||||
- `LFS_START_SERVER`: **false**: Enables git-lfs support.
|
- `LFS_START_SERVER`: **false**: Enables git-lfs support.
|
||||||
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files.
|
- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)/lfs**: Default LFS content path. (if it is on local storage.)
|
||||||
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
|
- `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.
|
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
|
||||||
- `LFS_MAX_FILE_SIZE`: **0**: Maximum allowed LFS file size in bytes (Set to 0 for no limit).
|
- `LFS_MAX_FILE_SIZE`: **0**: Maximum allowed LFS file size in bytes (Set to 0 for no limit).
|
||||||
|
- `LFS_LOCKS_PAGING_NUM`: **50**: Maximum number of LFS Locks returned per page.
|
||||||
|
|
||||||
- `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.
|
- `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.
|
- `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).
|
- `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).
|
||||||
@@ -214,8 +305,21 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
|
|||||||
- `SCHEMA`: **\<empty\>**: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand,
|
- `SCHEMA`: **\<empty\>**: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand,
|
||||||
the user must have creation privileges on it, and the user search path must be set to the look into the schema first
|
the user must have creation privileges on it, and the user search path must be set to the look into the schema first
|
||||||
(e.g. `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`).
|
(e.g. `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`).
|
||||||
- `SSL_MODE`: **disable**: For PostgreSQL and MySQL only.
|
- `SSL_MODE`: **disable**: SSL/TLS encryption mode for connecting to the database. This option is only applied for PostgreSQL and MySQL.
|
||||||
- `CHARSET`: **utf8**: For MySQL only, either "utf8" or "utf8mb4", default is "utf8". NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
|
- Valid values for MySQL:
|
||||||
|
- `true`: Enable TLS with verification of the database server certificate against its root certificate. When selecting this option make sure that the root certificate required to validate the database server certificate (e.g. the CA certificate) is on the system certificate store of both the database and Gitea servers. See your system documentation for instructions on how to add a CA certificate to the certificate store.
|
||||||
|
- `false`: Disable TLS.
|
||||||
|
- `disable`: Alias for `false`, for compatibility with PostgreSQL.
|
||||||
|
- `skip-verify`: Enable TLS without database server certificate verification. Use this option if you have self-signed or invalid certificate on the database server.
|
||||||
|
- `prefer`: Enable TLS with fallback to non-TLS connection.
|
||||||
|
- Valid values for PostgreSQL:
|
||||||
|
- `disable`: Disable TLS.
|
||||||
|
- `require`: Enable TLS without any verifications.
|
||||||
|
- `verify-ca`: Enable TLS with verification of the database server certificate against its root certificate.
|
||||||
|
- `verify-full`: Enable TLS and verify the database server name matches the given certificate in either the `Common Name` or `Subject Alternative Name` fields.
|
||||||
|
- `SQLITE_TIMEOUT`: **500**: Query timeout for sqlite3 only.
|
||||||
|
- `ITERATE_BUFFER_SIZE`: **50**: Internal buffer size for iterating.
|
||||||
|
- `CHARSET`: **utf8mb4**: For MySQL only, either "utf8" or "utf8mb4". NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
|
||||||
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
|
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
|
||||||
- `LOG_SQL`: **true**: Log the executed SQL.
|
- `LOG_SQL`: **true**: Log the executed SQL.
|
||||||
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
|
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
|
||||||
@@ -240,7 +344,11 @@ relation to port exhaustion.
|
|||||||
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: Batch queue number.
|
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: Batch queue number.
|
||||||
|
|
||||||
- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size).
|
- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size).
|
||||||
|
- `REPO_INDEXER_TYPE`: **bleve**: Code search engine type, could be `bleve` or `elasticsearch`.
|
||||||
- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: Index file used for code search.
|
- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: Index file used for code search.
|
||||||
|
- `REPO_INDEXER_CONN_STR`: ****: Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:changeme@localhost:9200
|
||||||
|
- `REPO_INDEXER_NAME`: **gitea_codes**: Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch
|
||||||
|
|
||||||
- `REPO_INDEXER_INCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **include** in the index. Use `**.txt` to match any files with .txt extension. An empty list means include all files.
|
- `REPO_INDEXER_INCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **include** in the index. Use `**.txt` to match any files with .txt extension. An empty list means include all files.
|
||||||
- `REPO_INDEXER_EXCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **exclude** from the index. Files that match this list will not be indexed, even if they match in `REPO_INDEXER_INCLUDE`.
|
- `REPO_INDEXER_EXCLUDE`: **empty**: A comma separated list of glob patterns (see https://github.com/gobwas/glob) to **exclude** from the index. Files that match this list will not be indexed, even if they match in `REPO_INDEXER_INCLUDE`.
|
||||||
- `REPO_INDEXER_EXCLUDE_VENDORED`: **true**: Exclude vendored files from index.
|
- `REPO_INDEXER_EXCLUDE_VENDORED`: **true**: Exclude vendored files from index.
|
||||||
@@ -251,15 +359,13 @@ relation to port exhaustion.
|
|||||||
## Queue (`queue` and `queue.*`)
|
## Queue (`queue` and `queue.*`)
|
||||||
|
|
||||||
- `TYPE`: **persistable-channel**: General queue type, currently support: `persistable-channel`, `channel`, `level`, `redis`, `dummy`
|
- `TYPE`: **persistable-channel**: General queue type, currently support: `persistable-channel`, `channel`, `level`, `redis`, `dummy`
|
||||||
- `DATADIR`: **queues/**: Base DataDir for storing persistent and level queues. `DATADIR` for inidividual queues can be set in `queue.name` sections but will default to `DATADIR/`**`name`**.
|
- `DATADIR`: **queues/**: Base DataDir for storing persistent and level queues. `DATADIR` for individual queues can be set in `queue.name` sections but will default to `DATADIR/`**`name`**.
|
||||||
- `LENGTH`: **20**: Maximal queue size before channel queues block
|
- `LENGTH`: **20**: Maximal queue size before channel queues block
|
||||||
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
|
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
|
||||||
- `CONN_STR`: **addrs=127.0.0.1:6379 db=0**: Connection string for the redis queue type.
|
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. Options can be set using query params. Similarly LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**
|
||||||
- `QUEUE_NAME`: **_queue**: The suffix for default redis queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overriden in the specific `queue.name` section.
|
- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overriden in the specific `queue.name` section.
|
||||||
- `SET_NAME`: **_unique**: The suffix that will added to the default redis
|
- `SET_NAME`: **_unique**: The suffix that will be added to the default redis and disk queue `set` name for unique queues. Individual queues will default to
|
||||||
set name for unique queues. Individual queues will default to
|
**`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific `queue.name` section.
|
||||||
**`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific
|
|
||||||
`queue.name` section.
|
|
||||||
- `WRAP_IF_NECESSARY`: **true**: Will wrap queues with a timeoutable queue if the selected queue is not ready to be created - (Only relevant for the level queue.)
|
- `WRAP_IF_NECESSARY`: **true**: Will wrap queues with a timeoutable queue if the selected queue is not ready to be created - (Only relevant for the level queue.)
|
||||||
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
|
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
|
||||||
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
|
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
|
||||||
@@ -271,7 +377,9 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `BOOST_WORKERS`: **5**: This many workers will be added to the worker pool if there is a boost.
|
- `BOOST_WORKERS`: **5**: This many workers will be added to the worker pool if there is a boost.
|
||||||
|
|
||||||
## Admin (`admin`)
|
## Admin (`admin`)
|
||||||
|
|
||||||
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
|
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
|
||||||
|
- `DISABLE_REGULAR_ORG_CREATION`: **false**: Disallow regular (non-admin) users from creating organizations.
|
||||||
|
|
||||||
## Security (`security`)
|
## Security (`security`)
|
||||||
|
|
||||||
@@ -285,20 +393,27 @@ set name for unique queues. Individual queues will default to
|
|||||||
authentication.
|
authentication.
|
||||||
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: Header name for reverse proxy
|
- `REVERSE_PROXY_AUTHENTICATION_EMAIL`: **X-WEBAUTH-EMAIL**: Header name for reverse proxy
|
||||||
authentication provided email.
|
authentication provided email.
|
||||||
- `DISABLE_GIT_HOOKS`: **false**: Set to `true` to prevent all users (including admin) from creating custom
|
- `DISABLE_GIT_HOOKS`: **true**: Set to `false` to enable users with git hook privilege to create custom git hooks.
|
||||||
git hooks.
|
WARNING: Custom git hooks can be used to perform arbitrary code execution on the host operating system.
|
||||||
|
This enables the users to access and modify this config file and the Gitea database and interrupt the Gitea service.
|
||||||
|
By modifying the Gitea database, users can gain Gitea administrator privileges.
|
||||||
|
It also enables them to access other resources available to the user on the operating system that is running the
|
||||||
|
Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
|
||||||
|
This maybe harmful to you website or your operating system.
|
||||||
- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**: Set to `false` to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to gitea repositories you should set the environment appropriately.
|
- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**: Set to `false` to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to gitea repositories you should set the environment appropriately.
|
||||||
- `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to 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.
|
||||||
- `INTERNAL_TOKEN`: **\<random at every install if no uri set\>**: Secret used to validate communication within Gitea binary.
|
- `INTERNAL_TOKEN`: **\<random at every install if no uri set\>**: Secret used to validate communication within Gitea binary.
|
||||||
- `INTERNAL_TOKEN_URI`: **<empty>**: Instead of defining internal token in the configuration, this configuration option can be used to give Gitea a path to a file that contains the internal token (example value: `file:/etc/gitea/internal_token`)
|
- `INTERNAL_TOKEN_URI`: **<empty>**: Instead of defining internal token in the configuration, this configuration option can be used to give Gitea a path to a file that contains the internal token (example value: `file:/etc/gitea/internal_token`)
|
||||||
- `PASSWORD_HASH_ALGO`: **pbkdf2**: The hash algorithm to use \[pbkdf2, argon2, scrypt, bcrypt\].
|
- `PASSWORD_HASH_ALGO`: **argon2**: The hash algorithm to use \[argon2, pbkdf2, scrypt, bcrypt\].
|
||||||
- `CSRF_COOKIE_HTTP_ONLY`: **true**: Set false to allow JavaScript to read CSRF cookie.
|
- `CSRF_COOKIE_HTTP_ONLY`: **true**: Set false to allow JavaScript to read CSRF cookie.
|
||||||
- `PASSWORD_COMPLEXITY`: **lower,upper,digit,spec**: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, the default values will be used. Possible values are:
|
- `MIN_PASSWORD_LENGTH`: **6**: Minimum password length for new users.
|
||||||
|
- `PASSWORD_COMPLEXITY`: **off**: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, checking is disabled (off):
|
||||||
- lower - use one or more lower latin characters
|
- lower - use one or more lower latin characters
|
||||||
- upper - use one or more upper latin characters
|
- upper - use one or more upper latin characters
|
||||||
- digit - use one or more digits
|
- digit - use one or more digits
|
||||||
- spec - use one or more special characters as ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``
|
- spec - use one or more special characters as ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``
|
||||||
- off - do not check password complexity
|
- off - do not check password complexity
|
||||||
|
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
|
||||||
|
|
||||||
## OpenID (`openid`)
|
## OpenID (`openid`)
|
||||||
|
|
||||||
@@ -336,13 +451,20 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `ENABLE_CAPTCHA`: **false**: Enable this to use captcha validation for registration.
|
- `ENABLE_CAPTCHA`: **false**: Enable this to use captcha validation for registration.
|
||||||
- `REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA`: **false**: Enable this to force captcha validation
|
- `REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA`: **false**: Enable this to force captcha validation
|
||||||
even for External Accounts (i.e. GitHub, OpenID Connect, etc). You must `ENABLE_CAPTCHA` also.
|
even for External Accounts (i.e. GitHub, OpenID Connect, etc). You must `ENABLE_CAPTCHA` also.
|
||||||
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha\]
|
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha, hcaptcha\]
|
||||||
- `RECAPTCHA_SECRET`: **""**: Go to https://www.google.com/recaptcha/admin to get a secret for 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.
|
- `RECAPTCHA_SITEKEY`: **""**: Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha.
|
||||||
- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**: Set the recaptcha url - allows the use of recaptcha net.
|
- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**: Set the recaptcha url - allows the use of recaptcha net.
|
||||||
|
- `HCAPTCHA_SECRET`: **""**: Sign up at https://www.hcaptcha.com/ to get a secret for hcaptcha.
|
||||||
|
- `HCAPTCHA_SITEKEY`: **""**: Sign up at https://www.hcaptcha.com/ to get a sitekey for hcaptcha.
|
||||||
|
- `DEFAULT_KEEP_EMAIL_PRIVATE`: **false**: By default set users to keep their email address private.
|
||||||
|
- `DEFAULT_ALLOW_CREATE_ORGANIZATION`: **true**: Allow new users to create organizations by default.
|
||||||
- `DEFAULT_ENABLE_DEPENDENCIES`: **true**: Enable this to have dependencies enabled by default.
|
- `DEFAULT_ENABLE_DEPENDENCIES`: **true**: Enable this to have dependencies enabled by default.
|
||||||
- `ALLOW_CROSS_REPOSITORY_DEPENDENCIES` : **true** Enable this to allow dependencies on issues from any repository where the user is granted access.
|
- `ALLOW_CROSS_REPOSITORY_DEPENDENCIES` : **true** Enable this to allow dependencies on issues from any repository where the user is granted access.
|
||||||
- `ENABLE_USER_HEATMAP`: **true**: Enable this to display the heatmap on users profiles.
|
- `ENABLE_USER_HEATMAP`: **true**: Enable this to display the heatmap on users profiles.
|
||||||
|
- `ENABLE_TIMETRACKING`: **true**: Enable Timetracking feature.
|
||||||
|
- `DEFAULT_ENABLE_TIMETRACKING`: **true**: Allow repositories to use timetracking by deault.
|
||||||
|
- `DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME`: **true**: Only allow users with write permissions to track time.
|
||||||
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
|
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
|
||||||
on this instance.
|
on this instance.
|
||||||
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
|
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
|
||||||
@@ -355,6 +477,15 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `NO_REPLY_ADDRESS`: **DOMAIN** Default value for the domain part of the user's email address in the git log if he has set KeepEmailPrivate to true.
|
- `NO_REPLY_ADDRESS`: **DOMAIN** Default value for the domain part of the user's email address in the git log if he has set KeepEmailPrivate to true.
|
||||||
The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.
|
The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.
|
||||||
|
|
||||||
|
## SSH Minimum Key Sizes (`ssh.minimum_key_sizes`)
|
||||||
|
|
||||||
|
Define allowed algorithms and their minimum key length (use -1 to disable a type):
|
||||||
|
|
||||||
|
- `ED25519`: **256**
|
||||||
|
- `ECDSA`: **256**
|
||||||
|
- `RSA`: **2048**
|
||||||
|
- `DSA`: **-1**: DSA is now disabled by default. Set to **1024** to re-enable but ensure you may need to reconfigure your SSHD provider
|
||||||
|
|
||||||
## Webhook (`webhook`)
|
## Webhook (`webhook`)
|
||||||
|
|
||||||
- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
|
- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
|
||||||
@@ -370,12 +501,22 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `DISABLE_HELO`: **\<empty\>**: Disable HELO operation.
|
- `DISABLE_HELO`: **\<empty\>**: Disable HELO operation.
|
||||||
- `HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
|
- `HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
|
||||||
- `HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
|
- `HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
|
||||||
|
- Using opportunistic TLS via STARTTLS on port 587 is recommended per RFC 6409.
|
||||||
|
- `IS_TLS_ENABLED` : **false** : Forcibly use TLS to connect even if not on a default SMTPS port.
|
||||||
|
- Note, if the port ends with `465` SMTPS/SMTP over TLS will be used despite this setting.
|
||||||
|
- Otherwise if `IS_TLS_ENABLED=false` and the server supports `STARTTLS` this will be used. Thus if `STARTTLS` is preferred you should set `IS_TLS_ENABLED=false`.
|
||||||
- `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or
|
- `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or
|
||||||
the "Name" \<email@example.com\> format.
|
the "Name" \<email@example.com\> format.
|
||||||
- `USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
|
- `USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
|
||||||
- `PASSWD`: **\<empty\>**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password.
|
- `PASSWD`: **\<empty\>**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password.
|
||||||
- `SKIP_VERIFY`: **\<empty\>**: Do not verify the self-signed certificates.
|
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or `HOST=localhost`. See [Email Setup]({{< relref "doc/usage/email-setup.en-us.md" >}}) for more information.
|
||||||
|
- `SEND_AS_PLAIN_TEXT`: **false**: Send mails as plain text.
|
||||||
|
- `SKIP_VERIFY`: **false**: Whether or not to skip verification of certificates; `true` to disable verification.
|
||||||
|
- **Warning:** This option is unsafe. Consider adding the certificate to the system trust store instead.
|
||||||
- **Note:** Gitea only supports SMTP with STARTTLS.
|
- **Note:** Gitea only supports SMTP with STARTTLS.
|
||||||
|
- `USE_CERTIFICATE`: **false**: Use client certificate.
|
||||||
|
- `CERT_FILE`: **custom/mailer/cert.pem**
|
||||||
|
- `KEY_FILE`: **custom/mailer/key.pem**
|
||||||
- `SUBJECT_PREFIX`: **\<empty\>**: Prefix to be placed before e-mail subject lines.
|
- `SUBJECT_PREFIX`: **\<empty\>**: Prefix to be placed before e-mail subject lines.
|
||||||
- `MAILER_TYPE`: **smtp**: \[smtp, sendmail, dummy\]
|
- `MAILER_TYPE`: **smtp**: \[smtp, sendmail, dummy\]
|
||||||
- **smtp** Use SMTP to send mail
|
- **smtp** Use SMTP to send mail
|
||||||
@@ -387,7 +528,9 @@ set name for unique queues. Individual queues will default to
|
|||||||
- Enabling dummy will ignore all settings except `ENABLED`, `SUBJECT_PREFIX` and `FROM`.
|
- Enabling dummy will ignore all settings except `ENABLED`, `SUBJECT_PREFIX` and `FROM`.
|
||||||
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be
|
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be
|
||||||
command or full path).
|
command or full path).
|
||||||
- ``IS_TLS_ENABLED`` : **false** : Decide if SMTP connections should use TLS.
|
- `SENDMAIL_ARGS`: **_empty_**: Specify any extra sendmail arguments.
|
||||||
|
- `SENDMAIL_TIMEOUT`: **5m**: default timeout for sending email through sendmail
|
||||||
|
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue.
|
||||||
|
|
||||||
## Cache (`cache`)
|
## Cache (`cache`)
|
||||||
|
|
||||||
@@ -395,7 +538,7 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`.
|
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`.
|
||||||
- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory cache only.
|
- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory cache only.
|
||||||
- `HOST`: **\<empty\>**: Connection string for `redis` and `memcache`.
|
- `HOST`: **\<empty\>**: Connection string for `redis` and `memcache`.
|
||||||
- Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
|
- Redis: `redis://:macaron@127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
|
||||||
- Memcache: `127.0.0.1:9090;127.0.0.1:9091`
|
- Memcache: `127.0.0.1:9090;127.0.0.1:9091`
|
||||||
- `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to 0 disables caching.
|
- `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to 0 disables caching.
|
||||||
|
|
||||||
@@ -412,6 +555,7 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
|
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
|
||||||
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
|
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
|
||||||
- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
|
- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
|
||||||
|
- `SESSION_LIFE_TIME`: **86400**: Session life time in seconds, default is 86400 (1 day)
|
||||||
|
|
||||||
## Picture (`picture`)
|
## Picture (`picture`)
|
||||||
|
|
||||||
@@ -420,25 +564,45 @@ set name for unique queues. Individual queues will default to
|
|||||||
- `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only.
|
- `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only.
|
||||||
- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see
|
- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see
|
||||||
[http://www.libravatar.org](http://www.libravatar.org)).
|
[http://www.libravatar.org](http://www.libravatar.org)).
|
||||||
|
|
||||||
|
- `AVATAR_STORAGE_TYPE`: **default**: Storage type defined in `[storage.xxx]`. Default is `default` which will read `[storage]` if no section `[storage]` will be a type `local`.
|
||||||
- `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store user avatar image files.
|
- `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store user avatar image files.
|
||||||
- `REPOSITORY_AVATAR_UPLOAD_PATH`: **data/repo-avatars**: Path to store repository avatar image files.
|
|
||||||
- `REPOSITORY_AVATAR_FALLBACK`: **none**: How Gitea deals with missing repository avatars
|
|
||||||
- none = no avatar will be displayed
|
|
||||||
- random = random avatar will be generated
|
|
||||||
- image = default image will be used (which is set in `REPOSITORY_AVATAR_DEFAULT_IMAGE`)
|
|
||||||
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: Image used as default repository avatar (if `REPOSITORY_AVATAR_FALLBACK` is set to image and none was uploaded)
|
|
||||||
- `AVATAR_MAX_WIDTH`: **4096**: Maximum avatar image width in pixels.
|
- `AVATAR_MAX_WIDTH`: **4096**: Maximum avatar image width in pixels.
|
||||||
- `AVATAR_MAX_HEIGHT`: **3072**: Maximum avatar image height in pixels.
|
- `AVATAR_MAX_HEIGHT`: **3072**: Maximum avatar image height in pixels.
|
||||||
- `AVATAR_MAX_FILE_SIZE`: **1048576** (1Mb): Maximum avatar image file size in bytes.
|
- `AVATAR_MAX_FILE_SIZE`: **1048576** (1Mb): Maximum avatar image file size in bytes.
|
||||||
|
|
||||||
## Attachment (`attachment`)
|
- `REPOSITORY_AVATAR_STORAGE_TYPE`: **default**: Storage type defined in `[storage.xxx]`. Default is `default` which will read `[storage]` if no section `[storage]` will be a type `local`.
|
||||||
|
- `REPOSITORY_AVATAR_UPLOAD_PATH`: **data/repo-avatars**: Path to store repository avatar image files.
|
||||||
|
- `REPOSITORY_AVATAR_FALLBACK`: **none**: How Gitea deals with missing repository avatars
|
||||||
|
- none = no avatar will be displayed
|
||||||
|
- random = random avatar will be generated
|
||||||
|
- image = default image will be used (which is set in `REPOSITORY_AVATAR_FALLBACK_IMAGE`)
|
||||||
|
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: Image used as default repository avatar (if `REPOSITORY_AVATAR_FALLBACK` is set to image and none was uploaded)
|
||||||
|
|
||||||
- `ENABLED`: **true**: Enable this to allow uploading attachments.
|
|
||||||
- `PATH`: **data/attachments**: Path to store attachments.
|
## Project (`project`)
|
||||||
- `ALLOWED_TYPES`: **see app.ini.sample**: Allowed MIME types, e.g. `image/jpeg|image/png`.
|
|
||||||
Use `*/*` for all types.
|
Default templates for project boards:
|
||||||
|
|
||||||
|
- `PROJECT_BOARD_BASIC_KANBAN_TYPE`: **To Do, In Progress, Done**
|
||||||
|
- `PROJECT_BOARD_BUG_TRIAGE_TYPE`: **Needs Triage, High Priority, Low Priority, Closed**
|
||||||
|
|
||||||
|
## Issue and pull request attachments (`attachment`)
|
||||||
|
|
||||||
|
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
|
||||||
|
- `ALLOWED_TYPES`: **.docx,.gif,.gz,.jpeg,.jpg,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
- `MAX_SIZE`: **4**: Maximum size (MB).
|
- `MAX_SIZE`: **4**: Maximum size (MB).
|
||||||
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
|
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
|
||||||
|
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||||
|
- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.
|
||||||
|
- `PATH`: **data/attachments**: Path to store attachments only available when STORAGE_TYPE is `local`
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio`
|
||||||
|
|
||||||
## Log (`log`)
|
## Log (`log`)
|
||||||
|
|
||||||
@@ -506,6 +670,7 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
|
|||||||
|
|
||||||
- `ENABLED`: **true**: Run cron tasks periodically.
|
- `ENABLED`: **true**: Run cron tasks periodically.
|
||||||
- `RUN_AT_START`: **false**: Run cron tasks at application start-up.
|
- `RUN_AT_START`: **false**: Run cron tasks at application start-up.
|
||||||
|
- `NO_SUCCESS_NOTICE`: **false**: Set to true to switch off success notices.
|
||||||
|
|
||||||
### Cron - Cleanup old repository archives (`cron.archive_cleanup`)
|
### Cron - Cleanup old repository archives (`cron.archive_cleanup`)
|
||||||
|
|
||||||
@@ -517,6 +682,7 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
|
|||||||
### Cron - Update Mirrors (`cron.update_mirrors`)
|
### Cron - Update Mirrors (`cron.update_mirrors`)
|
||||||
|
|
||||||
- `SCHEDULE`: **@every 10m**: Cron syntax for scheduling update mirrors, e.g. `@every 3h`.
|
- `SCHEDULE`: **@every 10m**: Cron syntax for scheduling update mirrors, e.g. `@every 3h`.
|
||||||
|
- `NO_SUCCESS_NOTICE`: **true**: The cron task for update mirrors success report is not very useful - as it just means that the mirrors have been queued. Therefore this is turned off by default.
|
||||||
|
|
||||||
### Cron - Repository Health Check (`cron.repo_health_check`)
|
### Cron - Repository Health Check (`cron.repo_health_check`)
|
||||||
|
|
||||||
@@ -529,13 +695,19 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
|
|||||||
- `RUN_AT_START`: **true**: Run repository statistics check at start time.
|
- `RUN_AT_START`: **true**: Run repository statistics check at start time.
|
||||||
- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository statistics check.
|
- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository statistics check.
|
||||||
|
|
||||||
### Cron - Update Migration Poster ID (`cron.update_migration_post_id`)
|
### Cron - Update Migration Poster ID (`cron.update_migration_poster_id`)
|
||||||
|
|
||||||
- `SCHEDULE`: **@every 24h** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
|
- `SCHEDULE`: **@every 24h** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
|
||||||
|
|
||||||
|
### Cron - Sync External Users (`cron.sync_external_users`)
|
||||||
|
|
||||||
|
- `SCHEDULE`: **@every 24h** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
|
||||||
|
- `UPDATE_EXISTING`: **true**: Create new users, update existing user data and disable users that are not in external source anymore (default) or only create new users if UPDATE_EXISTING is set to false.
|
||||||
|
|
||||||
## Git (`git`)
|
## Git (`git`)
|
||||||
|
|
||||||
- `PATH`: **""**: The path of git executable. If empty, Gitea searches through the PATH environment.
|
- `PATH`: **""**: The path of git executable. If empty, Gitea searches through the PATH environment.
|
||||||
|
- `DISABLE_DIFF_HIGHLIGHT`: **false**: Disables highlight of added and removed changes.
|
||||||
- `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view.
|
- `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_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.
|
- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view.
|
||||||
@@ -570,39 +742,15 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
|
|||||||
|
|
||||||
- `ENABLE`: **true**: Enables OAuth2 provider.
|
- `ENABLE`: **true**: Enables OAuth2 provider.
|
||||||
- `ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds
|
- `ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds
|
||||||
- `REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 access token in hours
|
- `REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 refresh token in hours
|
||||||
- `INVALIDATE_REFRESH_TOKEN`: **false**: Check if refresh token got already used
|
- `INVALIDATE_REFRESH_TOKENS`: **false**: Check if refresh token has already been used
|
||||||
- `JWT_SECRET`: **\<empty\>**: OAuth2 authentication secret for access and refresh tokens, change this a unique string.
|
- `JWT_SECRET`: **\<empty\>**: OAuth2 authentication secret for access and refresh tokens, change this a unique string.
|
||||||
|
- `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider
|
||||||
|
|
||||||
## i18n (`i18n`)
|
## i18n (`i18n`)
|
||||||
|
|
||||||
- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR**: List of locales shown in language selector
|
- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR**: List of locales shown in language selector
|
||||||
- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,日本語,español,português do Brasil,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어**: Visible names corresponding to the locales
|
- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,日本語,español,português do Brasil,Português de Portugal,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어**: Visible names corresponding to the locales
|
||||||
|
|
||||||
### i18n - Datepicker Language (`i18n.datelang`)
|
|
||||||
Maps locales to the languages used by the datepicker plugin
|
|
||||||
|
|
||||||
- `en-US`: **en**
|
|
||||||
- `zh-CN`: **zh**
|
|
||||||
- `zh-HK`: **zh-HK**
|
|
||||||
- `zh-TW`: **zh-TW**
|
|
||||||
- `de-DE`: **de**
|
|
||||||
- `fr-FR`: **fr**
|
|
||||||
- `nl-NL`: **nl**
|
|
||||||
- `lv-LV`: **lv**
|
|
||||||
- `ru-RU`: **ru**
|
|
||||||
- `ja-JP`: **ja**
|
|
||||||
- `es-ES`: **es**
|
|
||||||
- `pt-BR`: **pt-BR**
|
|
||||||
- `pl-PL`: **pl**
|
|
||||||
- `bg-BG`: **bg**
|
|
||||||
- `it-IT`: **it**
|
|
||||||
- `fi-FI`: **fi**
|
|
||||||
- `tr-TR`: **tr**
|
|
||||||
- `cs-CZ`: **cs-CZ**
|
|
||||||
- `sr-SP`: **sr**
|
|
||||||
- `sv-SE`: **sv**
|
|
||||||
- `ko-KR`: **ko**
|
|
||||||
|
|
||||||
## U2F (`U2F`)
|
## U2F (`U2F`)
|
||||||
- `APP_ID`: **`ROOT_URL`**: Declares the facet of the application. Requires HTTPS.
|
- `APP_ID`: **`ROOT_URL`**: Declares the facet of the application. Requires HTTPS.
|
||||||
@@ -634,7 +782,7 @@ Two special environment variables are passed to the render command:
|
|||||||
Gitea supports customizing the sanitization policy for rendered HTML. The example below will support KaTeX output from pandoc.
|
Gitea supports customizing the sanitization policy for rendered HTML. The example below will support KaTeX output from pandoc.
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[markup.sanitizer]
|
[markup.sanitizer.TeX]
|
||||||
; Pandoc renders TeX segments as <span>s with the "math" class, optionally
|
; Pandoc renders TeX segments as <span>s with the "math" class, optionally
|
||||||
; with "inline" or "display" classes depending on context.
|
; with "inline" or "display" classes depending on context.
|
||||||
ELEMENT = span
|
ELEMENT = span
|
||||||
@@ -646,7 +794,7 @@ REGEXP = ^\s*((math(\s+|$)|inline(\s+|$)|display(\s+|$)))+
|
|||||||
- `ALLOW_ATTR`: The attribute this policy allows. Must be non-empty.
|
- `ALLOW_ATTR`: The attribute this policy allows. Must be non-empty.
|
||||||
- `REGEXP`: A regex to match the contents of the attribute against. Must be present but may be empty for unconditional whitelisting of this attribute.
|
- `REGEXP`: A regex to match the contents of the attribute against. Must be present but may be empty for unconditional whitelisting of this attribute.
|
||||||
|
|
||||||
You may redefine `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` multiple times; each time all three are defined is a single policy entry.
|
Multiple sanitisation rules can be defined by adding unique subsections, e.g. `[markup.sanitizer.TeX-2]`.
|
||||||
|
|
||||||
## Time (`time`)
|
## Time (`time`)
|
||||||
|
|
||||||
@@ -655,18 +803,74 @@ You may redefine `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` multiple times; each time
|
|||||||
|
|
||||||
## Task (`task`)
|
## Task (`task`)
|
||||||
|
|
||||||
- Task queue configuration has been moved to `queue.task` however, the below configuration values are kept for backwards compatibilityx:
|
Task queue configuration has been moved to `queue.task`. However, the below configuration values are kept for backwards compatibility:
|
||||||
|
|
||||||
- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`.
|
- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`.
|
||||||
- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`.
|
- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`.
|
||||||
- `QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If there redis needs a password, use `addrs=127.0.0.1:6379 password=123 db=0`.
|
- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://123@127.0.0.1:6379/0`.
|
||||||
|
|
||||||
## Migrations (`migrations`)
|
## Migrations (`migrations`)
|
||||||
|
|
||||||
- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
|
- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
|
||||||
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
|
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
|
||||||
|
|
||||||
|
## Mirror (`mirror`)
|
||||||
|
|
||||||
|
- `DEFAULT_INTERVAL`: **8h**: Default interval between each check
|
||||||
|
- `MIN_INTERVAL`: **10m**: Minimum interval for checking. (Must be >1m).
|
||||||
|
|
||||||
|
## LFS (`lfs`)
|
||||||
|
|
||||||
|
Storage configuration for lfs data. It will be derived from default `[storage]` or
|
||||||
|
`[storage.xxx]` when set `STORAGE_TYPE` to `xxx`. When derived, the default of `PATH`
|
||||||
|
is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`.
|
||||||
|
|
||||||
|
- `STORAGE_TYPE`: **local**: Storage type for lfs, `local` for local disk or `minio` for s3 compatible object storage service or other name defined with `[storage.xxx]`
|
||||||
|
- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.
|
||||||
|
- `CONTENT_PATH`: **./data/lfs**: Where to store LFS files, only available when `STORAGE_TYPE` is `local`.
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when `STORAGE_TYPE is` `minio`
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the lfs only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_BASE_PATH`: **lfs/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
|
||||||
|
|
||||||
|
## Storage (`storage`)
|
||||||
|
|
||||||
|
Default storage configuration for attachments, lfs, avatars and etc.
|
||||||
|
|
||||||
|
- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio endpoint to connect only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID to connect only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey to connect only available when `STORAGE_TYPE is` `minio`
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the data only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
|
||||||
|
|
||||||
|
And you can also define a customize storage like below:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[storage.my_minio]
|
||||||
|
STORAGE_TYPE = minio
|
||||||
|
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_ENDPOINT = localhost:9000
|
||||||
|
; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_ACCESS_KEY_ID =
|
||||||
|
; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_SECRET_ACCESS_KEY =
|
||||||
|
; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_BUCKET = gitea
|
||||||
|
; Minio location to create bucket only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_LOCATION = us-east-1
|
||||||
|
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_USE_SSL = false
|
||||||
|
```
|
||||||
|
|
||||||
|
And used by `[attachment]`, `[lfs]` and etc. as `STORAGE_TYPE`.
|
||||||
|
|
||||||
## Other (`other`)
|
## Other (`other`)
|
||||||
|
|
||||||
- `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer.
|
- `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer.
|
||||||
- `SHOW_FOOTER_VERSION`: **true**: Show Gitea version information in the footer.
|
- `SHOW_FOOTER_VERSION`: **true**: Show Gitea and Go version information in the footer.
|
||||||
- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer.
|
- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ menu:
|
|||||||
|
|
||||||
# 配置说明
|
# 配置说明
|
||||||
|
|
||||||
这是针对Gitea配置文件的说明,你可以了解Gitea的强大配置。需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。所有默认值可以通过 [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) 查看到。如果你发现 `%(X)s` 这样的内容,请查看 [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。
|
这是针对Gitea配置文件的说明,你可以了解Gitea的强大配置。需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。所有默认值可以通过 [app.example.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini) 查看到。如果你发现 `%(X)s` 这样的内容,请查看 [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。
|
||||||
|
|
||||||
## Overall (`DEFAULT`)
|
## Overall (`DEFAULT`)
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@ menu:
|
|||||||
- `ANSI_CHARSET`: 默认字符编码。
|
- `ANSI_CHARSET`: 默认字符编码。
|
||||||
- `FORCE_PRIVATE`: 强制所有git工程必须私有。
|
- `FORCE_PRIVATE`: 强制所有git工程必须私有。
|
||||||
- `DEFAULT_PRIVATE`: 默认创建的git工程为私有。 可以是`last`, `private` 或 `public`。默认值是 `last`表示用户最后创建的Repo的选择。
|
- `DEFAULT_PRIVATE`: 默认创建的git工程为私有。 可以是`last`, `private` 或 `public`。默认值是 `last`表示用户最后创建的Repo的选择。
|
||||||
|
- `DEFAULT_PUSH_CREATE_PRIVATE`: **true**: 通过 ``push-to-create`` 方式创建的仓库是否默认为私有仓库.
|
||||||
- `MAX_CREATION_LIMIT`: 全局最大每个用户创建的git工程数目, `-1` 表示没限制。
|
- `MAX_CREATION_LIMIT`: 全局最大每个用户创建的git工程数目, `-1` 表示没限制。
|
||||||
- `PULL_REQUEST_QUEUE_LENGTH`: 小心:合并请求测试队列的长度,尽量放大。
|
- `PULL_REQUEST_QUEUE_LENGTH`: 小心:合并请求测试队列的长度,尽量放大。
|
||||||
|
|
||||||
@@ -69,8 +70,8 @@ menu:
|
|||||||
- `STATIC_CACHE_TIME`: **6h**: 静态资源文件,包括 `custom/`, `public/` 和所有上传的头像的浏览器缓存时间。
|
- `STATIC_CACHE_TIME`: **6h**: 静态资源文件,包括 `custom/`, `public/` 和所有上传的头像的浏览器缓存时间。
|
||||||
- `ENABLE_GZIP`: 启用应用级别的 GZIP 压缩。
|
- `ENABLE_GZIP`: 启用应用级别的 GZIP 压缩。
|
||||||
- `LANDING_PAGE`: 未登录用户的默认页面,可选 `home` 或 `explore`。
|
- `LANDING_PAGE`: 未登录用户的默认页面,可选 `home` 或 `explore`。
|
||||||
|
|
||||||
- `LFS_START_SERVER`: 是否启用 git-lfs 支持. 可以为 `true` 或 `false`, 默认是 `false`。
|
- `LFS_START_SERVER`: 是否启用 git-lfs 支持. 可以为 `true` 或 `false`, 默认是 `false`。
|
||||||
- `LFS_CONTENT_PATH`: 存放 lfs 命令上传的文件的地方,默认是 `data/lfs`。
|
|
||||||
- `LFS_JWT_SECRET`: LFS 认证密钥,改成自己的。
|
- `LFS_JWT_SECRET`: LFS 认证密钥,改成自己的。
|
||||||
|
|
||||||
## Database (`database`)
|
## Database (`database`)
|
||||||
@@ -81,7 +82,7 @@ menu:
|
|||||||
- `USER`: 数据库用户名。
|
- `USER`: 数据库用户名。
|
||||||
- `PASSWD`: 数据库用户密码。
|
- `PASSWD`: 数据库用户密码。
|
||||||
- `SSL_MODE`: MySQL 或 PostgreSQL数据库是否启用SSL模式。
|
- `SSL_MODE`: MySQL 或 PostgreSQL数据库是否启用SSL模式。
|
||||||
- `CHARSET`: **utf8**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
|
- `CHARSET`: **utf8mb4**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
|
||||||
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
|
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
|
||||||
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
|
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
|
||||||
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
|
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
|
||||||
@@ -98,8 +99,12 @@ menu:
|
|||||||
- `ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: 当 `ISSUE_INDEXER_QUEUE_TYPE` 为 `redis` 时,保存Redis队列的连接字符串。
|
- `ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: 当 `ISSUE_INDEXER_QUEUE_TYPE` 为 `redis` 时,保存Redis队列的连接字符串。
|
||||||
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: 队列处理中批量提交数量。
|
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: 队列处理中批量提交数量。
|
||||||
|
|
||||||
- `REPO_INDEXER_ENABLED`: **false**: 是否启用代码搜索(启用后会占用比较大的磁盘空间)。
|
- `REPO_INDEXER_ENABLED`: **false**: 是否启用代码搜索(启用后会占用比较大的磁盘空间,如果是bleve可能需要占用约6倍存储空间)。
|
||||||
|
- `REPO_INDEXER_TYPE`: **bleve**: 代码搜索引擎类型,可以为 `bleve` 或者 `elasticsearch`。
|
||||||
- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: 用于代码搜索的索引文件路径。
|
- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: 用于代码搜索的索引文件路径。
|
||||||
|
- `REPO_INDEXER_CONN_STR`: ****: 代码搜索引擎连接字符串,当 `REPO_INDEXER_TYPE` 为 `elasticsearch` 时有效。例如: http://elastic:changeme@localhost:9200
|
||||||
|
- `REPO_INDEXER_NAME`: **gitea_codes**: 代码搜索引擎的名字,当 `REPO_INDEXER_TYPE` 为 `elasticsearch` 时有效。
|
||||||
|
|
||||||
- `UPDATE_BUFFER_LEN`: **20**: 代码索引请求的缓冲区长度。
|
- `UPDATE_BUFFER_LEN`: **20**: 代码索引请求的缓冲区长度。
|
||||||
- `MAX_FILE_SIZE`: **1048576**: 进行解析的源代码文件的最大长度,小于该值时才会索引。
|
- `MAX_FILE_SIZE`: **1048576**: 进行解析的源代码文件的最大长度,小于该值时才会索引。
|
||||||
|
|
||||||
@@ -177,13 +182,35 @@ menu:
|
|||||||
- `DISABLE_GRAVATAR`: 开启则只使用内部头像。
|
- `DISABLE_GRAVATAR`: 开启则只使用内部头像。
|
||||||
- `ENABLE_FEDERATED_AVATAR`: 启用头像联盟支持 (参见 http://www.libravatar.org)
|
- `ENABLE_FEDERATED_AVATAR`: 启用头像联盟支持 (参见 http://www.libravatar.org)
|
||||||
|
|
||||||
|
- `AVATAR_STORAGE_TYPE`: **local**: 头像存储类型,可以为 `local` 或 `minio`,分别支持本地文件系统和 minio 兼容的API。
|
||||||
|
- `AVATAR_UPLOAD_PATH`: **data/avatars**: 存储头像的文件系统路径。
|
||||||
|
- `AVATAR_MAX_WIDTH`: **4096**: 头像最大宽度,单位像素。
|
||||||
|
- `AVATAR_MAX_HEIGHT`: **3072**: 头像最大高度,单位像素。
|
||||||
|
- `AVATAR_MAX_FILE_SIZE`: **1048576** (1Mb): 头像最大大小。
|
||||||
|
|
||||||
|
- `REPOSITORY_AVATAR_STORAGE_TYPE`: **local**: 仓库头像存储类型,可以为 `local` 或 `minio`,分别支持本地文件系统和 minio 兼容的API。
|
||||||
|
- `REPOSITORY_AVATAR_UPLOAD_PATH`: **data/repo-avatars**: 存储仓库头像的路径。
|
||||||
|
- `REPOSITORY_AVATAR_FALLBACK`: **none**: 当头像丢失时的处理方式
|
||||||
|
- none = 不显示头像
|
||||||
|
- random = 显示随机生成的头像
|
||||||
|
- image = 显示默认头像,通过 `REPOSITORY_AVATAR_FALLBACK_IMAGE` 设置
|
||||||
|
- `REPOSITORY_AVATAR_FALLBACK_IMAGE`: **/img/repo_default.png**: 默认仓库头像
|
||||||
|
|
||||||
## Attachment (`attachment`)
|
## Attachment (`attachment`)
|
||||||
|
|
||||||
- `ENABLED`: 是否允许用户上传附件。
|
- `ENABLED`: 是否允许用户上传附件。
|
||||||
- `PATH`: 附件存储路径
|
|
||||||
- `ALLOWED_TYPES`: 允许上传的附件类型。比如:`image/jpeg|image/png`,用 `*/*` 表示允许任何类型。
|
- `ALLOWED_TYPES`: 允许上传的附件类型。比如:`image/jpeg|image/png`,用 `*/*` 表示允许任何类型。
|
||||||
- `MAX_SIZE`: 附件最大限制,单位 MB,比如: `4`。
|
- `MAX_SIZE`: 附件最大限制,单位 MB,比如: `4`。
|
||||||
- `MAX_FILES`: 一次最多上传的附件数量,比如: `5`。
|
- `MAX_FILES`: 一次最多上传的附件数量,比如: `5`。
|
||||||
|
- `STORAGE_TYPE`: **local**: 附件存储类型,`local` 将存储到本地文件夹, `minio` 将存储到 s3 兼容的对象存储服务中。
|
||||||
|
- `PATH`: **data/attachments**: 附件存储路径,仅当 `STORAGE_TYPE` 为 `local` 时有效。
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio 终端,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID ,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the attachments,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio enabled ssl,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
|
||||||
关于 `ALLOWED_TYPES`, 在 (*)unix 系统中可以使用`file -I <filename>` 来快速获得对应的 `MIME type`。
|
关于 `ALLOWED_TYPES`, 在 (*)unix 系统中可以使用`file -I <filename>` 来快速获得对应的 `MIME type`。
|
||||||
|
|
||||||
@@ -225,7 +252,7 @@ test01.xls: application/vnd.ms-excel; charset=binary
|
|||||||
- `RUN_AT_START`: 是否启动时自动运行仓库统计。
|
- `RUN_AT_START`: 是否启动时自动运行仓库统计。
|
||||||
- `SCHEDULE`: 仓库统计时的Cron 语法,比如:`@every 24h`.
|
- `SCHEDULE`: 仓库统计时的Cron 语法,比如:`@every 24h`.
|
||||||
|
|
||||||
### Cron - Update Migration Poster ID (`cron.update_migration_post_id`)
|
### Cron - Update Migration Poster ID (`cron.update_migration_poster_id`)
|
||||||
|
|
||||||
- `SCHEDULE`: **@every 24h** : 每次同步的间隔时间。此任务总是在启动时自动进行。
|
- `SCHEDULE`: **@every 24h** : 每次同步的间隔时间。此任务总是在启动时自动进行。
|
||||||
|
|
||||||
@@ -287,6 +314,55 @@ IS_INPUT_FILE = false
|
|||||||
- `MAX_ATTEMPTS`: **3**: 在迁移过程中的 http/https 请求重试次数。
|
- `MAX_ATTEMPTS`: **3**: 在迁移过程中的 http/https 请求重试次数。
|
||||||
- `RETRY_BACKOFF`: **3**: 等待下一次重试的时间,单位秒。
|
- `RETRY_BACKOFF`: **3**: 等待下一次重试的时间,单位秒。
|
||||||
|
|
||||||
|
## LFS (`lfs`)
|
||||||
|
|
||||||
|
LFS 的存储配置。 如果 `STORAGE_TYPE` 为空,则此配置将从 `[storage]` 继承。如果不为 `local` 或者 `minio` 而为 `xxx`, 则从 `[storage.xxx]` 继承。当继承时, `PATH` 默认为 `data/lfs`,`MINIO_BASE_PATH` 默认为 `lfs/`。
|
||||||
|
|
||||||
|
- `STORAGE_TYPE`: **local**: LFS 的存储类型,`local` 将存储到磁盘,`minio` 将存储到 s3 兼容的对象服务。
|
||||||
|
- `SERVE_DIRECT`: **false**: 允许直接重定向到存储系统。当前,仅 Minio/S3 是支持的。
|
||||||
|
- `CONTENT_PATH`: 存放 lfs 命令上传的文件的地方,默认是 `data/lfs`。
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio 地址,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location ,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_BASE_PATH`: **lfs/**: Minio base path ,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio 是否启用 ssl ,仅当 `LFS_STORAGE_TYPE` 为 `minio` 时有效。
|
||||||
|
|
||||||
|
## Storage (`storage`)
|
||||||
|
|
||||||
|
Attachments, lfs, avatars and etc 的默认存储配置。
|
||||||
|
|
||||||
|
- `STORAGE_TYPE`: **local**: 附件存储类型,`local` 将存储到本地文件夹, `minio` 将存储到 s3 兼容的对象存储服务中。
|
||||||
|
- `SERVE_DIRECT`: **false**: 允许直接重定向到存储系统。当前,仅 Minio/S3 是支持的。
|
||||||
|
- `MINIO_ENDPOINT`: **localhost:9000**: Minio 终端,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_ACCESS_KEY_ID`: Minio accessKeyID ,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_SECRET_ACCESS_KEY`: Minio secretAccessKey,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the attachments,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
- `MINIO_USE_SSL`: **false**: Minio enabled ssl,仅当 `STORAGE_TYPE` 是 `minio` 时有效。
|
||||||
|
|
||||||
|
你也可以自定义一个存储的名字如下:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[storage.my_minio]
|
||||||
|
STORAGE_TYPE = minio
|
||||||
|
; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_ENDPOINT = localhost:9000
|
||||||
|
; Minio accessKeyID to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_ACCESS_KEY_ID =
|
||||||
|
; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_SECRET_ACCESS_KEY =
|
||||||
|
; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_BUCKET = gitea
|
||||||
|
; Minio location to create bucket only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_LOCATION = us-east-1
|
||||||
|
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
|
||||||
|
MINIO_USE_SSL = false
|
||||||
|
```
|
||||||
|
|
||||||
|
然后你在 `[attachment]`, `[lfs]` 等中可以把这个名字用作 `STORAGE_TYPE` 的值。
|
||||||
|
|
||||||
## Other (`other`)
|
## Other (`other`)
|
||||||
|
|
||||||
- `SHOW_FOOTER_BRANDING`: 为真则在页面底部显示Gitea的字样。
|
- `SHOW_FOOTER_BRANDING`: 为真则在页面底部显示Gitea的字样。
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Again `gitea help` will allow you review this variable and you can override it u
|
|||||||
`--config` option on the `gitea` binary.
|
`--config` option on the `gitea` binary.
|
||||||
|
|
||||||
- [Quick Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
- [Quick Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
||||||
- [Complete List](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
- [Complete List](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
|
|
||||||
If the `CustomPath` folder can't be found despite checking `gitea help`, check the `GITEA_CUSTOM`
|
If the `CustomPath` folder can't be found despite checking `gitea help`, check the `GITEA_CUSTOM`
|
||||||
environment variable; this can be used to override the default path to something else.
|
environment variable; this can be used to override the default path to something else.
|
||||||
@@ -108,50 +108,11 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
|
|||||||
- `body_outer_post.tmpl`, before the bottom `<footer>` element.
|
- `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.
|
- `footer.tmpl`, right before the end of the `<body>` tag, a good place for additional Javascript.
|
||||||
|
|
||||||
#### Example: Mermaid.js
|
|
||||||
|
|
||||||
If you would like to add [mermaid.js](https://mermaid-js.github.io/mermaid) support to Gitea's markdown you simply add:
|
|
||||||
|
|
||||||
```html
|
|
||||||
{{if .RequireHighlightJS}}
|
|
||||||
<script src="https://unpkg.com/mermaid@8.4.5/dist/mermaid.min.js"></script>
|
|
||||||
<!-- or wherever you have placed it -->
|
|
||||||
<script>mermaid.init(".language-mermaid")</script>
|
|
||||||
{{end}}
|
|
||||||
```
|
|
||||||
|
|
||||||
to `custom/footer.tmpl`. You then can add blocks
|
|
||||||
like below to your markdown:
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
stateDiagram
|
|
||||||
[*] --> Active
|
|
||||||
|
|
||||||
state Active {
|
|
||||||
[*] --> NumLockOff
|
|
||||||
NumLockOff --> NumLockOn : EvNumLockPressed
|
|
||||||
NumLockOn --> NumLockOff : EvNumLockPressed
|
|
||||||
--
|
|
||||||
[*] --> CapsLockOff
|
|
||||||
CapsLockOff --> CapsLockOn : EvCapsLockPressed
|
|
||||||
CapsLockOn --> CapsLockOff : EvCapsLockPressed
|
|
||||||
--
|
|
||||||
[*] --> ScrollLockOff
|
|
||||||
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
|
|
||||||
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to use Mermaid.js outside of markdown, e.g. in other templates or HTML files,
|
|
||||||
you would need to remove `{{if .RequireHighlightJS}}` and `{{end}}`.
|
|
||||||
|
|
||||||
Mermaid will detect and use tags with `class="language-mermaid"`.
|
|
||||||
|
|
||||||
#### Example: PlantUML
|
#### Example: PlantUML
|
||||||
|
|
||||||
You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server.
|
You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server.
|
||||||
The data is encoded and sent to the PlantUML server which generates the picture. There is an online
|
The data is encoded and sent to the PlantUML server which generates the picture. There is an online
|
||||||
demo server at http://www.plantuml.com/plantuml, but if you (or your users) have sensitive data you
|
demo server at http://www.plantuml.com/plantuml, but if you (or your users) have sensitive data you
|
||||||
can set up your own [PlantUML server](https://plantuml.com/server) instead. To set up PlantUML rendering,
|
can set up your own [PlantUML server](https://plantuml.com/server) instead. To set up PlantUML rendering,
|
||||||
copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highlight and put them in your
|
copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highlight and put them in your
|
||||||
`custom/public` folder. Then add the following to `custom/footer.tmpl`:
|
`custom/public` folder. Then add the following to `custom/footer.tmpl`:
|
||||||
@@ -173,13 +134,96 @@ You can then add blocks like the following to your markdown:
|
|||||||
```plantuml
|
```plantuml
|
||||||
Alice -> Bob: Authentication Request
|
Alice -> Bob: Authentication Request
|
||||||
Bob --> Alice: Authentication Response
|
Bob --> Alice: Authentication Response
|
||||||
|
|
||||||
Alice -> Bob: Another authentication Request
|
Alice -> Bob: Another authentication Request
|
||||||
Alice <-- Bob: Another authentication Response
|
Alice <-- Bob: Another authentication Response
|
||||||
```
|
```
|
||||||
|
|
||||||
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
|
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
|
||||||
|
|
||||||
|
#### Example: STL Preview
|
||||||
|
|
||||||
|
You can display STL file directly in Gitea by adding:
|
||||||
|
```html
|
||||||
|
<script>
|
||||||
|
function lS(src){
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
let s = document.createElement('script')
|
||||||
|
s.src = src
|
||||||
|
s.addEventListener('load', () => {
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
document.body.appendChild(s)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if($('.view-raw>a[href$=".stl" i]').length){
|
||||||
|
$('body').append('<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">');
|
||||||
|
Promise.all([lS("/Madeleine.js/src/lib/stats.js"),lS("/Madeleine.js/src/lib/detector.js"), lS("/Madeleine.js/src/lib/three.min.js"), lS("/Madeleine.js/src/Madeleine.js")]).then(function() {
|
||||||
|
$('.view-raw').attr('id', 'view-raw').attr('style', 'padding: 0;margin-bottom: -10px;');
|
||||||
|
new Madeleine({
|
||||||
|
target: 'view-raw',
|
||||||
|
data: $('.view-raw>a[href$=".stl" i]').attr('href'),
|
||||||
|
path: '/Madeleine.js/src'
|
||||||
|
});
|
||||||
|
$('.view-raw>a[href$=".stl"]').remove()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
to the file `templates/custom/footer.tmpl`
|
||||||
|
|
||||||
|
You also need to download the content of the library [Madeleine.js](https://jinjunho.github.io/Madeleine.js/) and place it under `custom/public/` folder.
|
||||||
|
|
||||||
|
You should end-up with a folder structucture similar to:
|
||||||
|
```
|
||||||
|
custom/templates
|
||||||
|
-- custom
|
||||||
|
`-- footer.tmpl
|
||||||
|
custom/public
|
||||||
|
-- Madeleine.js
|
||||||
|
|-- LICENSE
|
||||||
|
|-- README.md
|
||||||
|
|-- css
|
||||||
|
| |-- pygment_trac.css
|
||||||
|
| `-- stylesheet.css
|
||||||
|
|-- examples
|
||||||
|
| |-- ajax.html
|
||||||
|
| |-- index.html
|
||||||
|
| `-- upload.html
|
||||||
|
|-- images
|
||||||
|
| |-- bg_hr.png
|
||||||
|
| |-- blacktocat.png
|
||||||
|
| |-- icon_download.png
|
||||||
|
| `-- sprite_download.png
|
||||||
|
|-- models
|
||||||
|
| |-- dino2.stl
|
||||||
|
| |-- ducati.stl
|
||||||
|
| |-- gallardo.stl
|
||||||
|
| |-- lamp.stl
|
||||||
|
| |-- octocat.stl
|
||||||
|
| |-- skull.stl
|
||||||
|
| `-- treefrog.stl
|
||||||
|
`-- src
|
||||||
|
|-- Madeleine.js
|
||||||
|
|-- css
|
||||||
|
| `-- Madeleine.css
|
||||||
|
|-- icons
|
||||||
|
| |-- logo.png
|
||||||
|
| |-- madeleine.eot
|
||||||
|
| |-- madeleine.svg
|
||||||
|
| |-- madeleine.ttf
|
||||||
|
| `-- madeleine.woff
|
||||||
|
`-- lib
|
||||||
|
|-- MadeleineConverter.js
|
||||||
|
|-- MadeleineLoader.js
|
||||||
|
|-- detector.js
|
||||||
|
|-- stats.js
|
||||||
|
`-- three.min.js
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart gitea and open a STL file on your gitea instance.
|
||||||
|
|
||||||
## Customizing Gitea mails
|
## Customizing Gitea mails
|
||||||
|
|
||||||
The `custom/templates/mail` folder allows changing the body of every mail of Gitea.
|
The `custom/templates/mail` folder allows changing the body of every mail of Gitea.
|
||||||
@@ -235,6 +279,9 @@ Locales may change between versions, so keeping track of your customized locales
|
|||||||
|
|
||||||
To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `custom/options/readme`
|
To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `custom/options/readme`
|
||||||
|
|
||||||
|
**NOTE:** readme templates support **variable expansion**.
|
||||||
|
currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.SSH}`, `{CloneURL.HTTPS}` and `{OwnerName}`
|
||||||
|
|
||||||
### Reactions
|
### Reactions
|
||||||
|
|
||||||
To change reaction emoji's you can set allowed reactions at app.ini
|
To change reaction emoji's you can set allowed reactions at app.ini
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
|
|||||||
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:
|
`custom/conf/app.ini` 当中。在发行版中可能会以 `/etc/gitea/` 的形式为 `custom` 设置一个符号链接,查看配置详情请移步:
|
||||||
|
|
||||||
- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
- [快速备忘单](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
||||||
- [完整配置清单](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
- [完整配置清单](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
|
|
||||||
如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
|
如果您在 binary 同目录下无法找到 `custom` 文件夹,请检查您的 `GITEA_CUSTOM`
|
||||||
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。
|
环境变量配置, 因为它可能被配置到了其他地方(可能被一些启动脚本设置指定了目录)。
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ FROM gitea/gitea:{{< version >}}
|
|||||||
COPY custom/app.ini /data/gitea/conf/app.ini
|
COPY custom/app.ini /data/gitea/conf/app.ini
|
||||||
[...]
|
[...]
|
||||||
|
|
||||||
RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng python-dev py-pip python3-dev py3-pip py3-zmq
|
RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-dev python-dev py-pip python3-dev py3-pip py3-pyzmq
|
||||||
# install any other package you need for your external renderers
|
# install any other package you need for your external renderers
|
||||||
|
|
||||||
RUN pip3 install --upgrade pip
|
RUN pip3 install --upgrade pip
|
||||||
RUN pip3 install -U setuptools
|
RUN pip3 install -U setuptools
|
||||||
RUN pip3 install jupyter matplotlib docutils
|
RUN pip3 install jupyter docutils
|
||||||
# add above any other python package you may need to install
|
# add above any other python package you may need to install
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ add one `[markup.XXXXX]` section per external renderer on your custom `app.ini`:
|
|||||||
[markup.asciidoc]
|
[markup.asciidoc]
|
||||||
ENABLED = true
|
ENABLED = true
|
||||||
FILE_EXTENSIONS = .adoc,.asciidoc
|
FILE_EXTENSIONS = .adoc,.asciidoc
|
||||||
RENDER_COMMAND = "asciidoctor -e -a leveloffset=-1 --out-file=- -"
|
RENDER_COMMAND = "asciidoctor -s -a showtitle --out-file=- -"
|
||||||
; Input is not a standard input but a file
|
; Input is not a standard input but a file
|
||||||
IS_INPUT_FILE = false
|
IS_INPUT_FILE = false
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ IS_INPUT_FILE = false
|
|||||||
If your external markup relies on additional classes and attributes on the generated HTML elements, you might need to enable custom sanitizer policies. Gitea uses the [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) package as our HTML sanitizier. The example below will support [KaTeX](https://katex.org/) output from [`pandoc`](https://pandoc.org/).
|
If your external markup relies on additional classes and attributes on the generated HTML elements, you might need to enable custom sanitizer policies. Gitea uses the [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) package as our HTML sanitizier. The example below will support [KaTeX](https://katex.org/) output from [`pandoc`](https://pandoc.org/).
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[markup.sanitizer]
|
[markup.sanitizer.TeX]
|
||||||
; Pandoc renders TeX segments as <span>s with the "math" class, optionally
|
; Pandoc renders TeX segments as <span>s with the "math" class, optionally
|
||||||
; with "inline" or "display" classes depending on context.
|
; with "inline" or "display" classes depending on context.
|
||||||
ELEMENT = span
|
ELEMENT = span
|
||||||
@@ -86,6 +86,11 @@ FILE_EXTENSIONS = .md,.markdown
|
|||||||
RENDER_COMMAND = pandoc -f markdown -t html --katex
|
RENDER_COMMAND = pandoc -f markdown -t html --katex
|
||||||
```
|
```
|
||||||
|
|
||||||
You may redefine `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` multiple times; each time all three are defined is a single policy entry. All three must be defined, but `REGEXP` may be blank to allow unconditional whitelisting of that attribute.
|
You must define `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` in each section.
|
||||||
|
|
||||||
|
To define multiple entries, add a unique alphanumeric suffix (e.g., `[markup.sanitizer.1]` and `[markup.sanitizer.something]`).
|
||||||
|
|
||||||
Once your configuration changes have been made, restart Gitea to have changes take effect.
|
Once your configuration changes have been made, restart Gitea to have changes take effect.
|
||||||
|
|
||||||
|
**Note**: Prior to Gitea 1.12 there was a single `markup.sanitiser` section with keys that were redefined for multiple rules, however,
|
||||||
|
there were significant problems with this method of configuration necessitating configuration through multiple sections.
|
||||||
|
|||||||
@@ -15,13 +15,10 @@ menu:
|
|||||||
|
|
||||||
# Hacking on Gitea
|
# Hacking on Gitea
|
||||||
|
|
||||||
## Installing go and setting the GOPATH
|
## Installing go
|
||||||
|
|
||||||
You should [install go](https://golang.org/doc/install) and set up your go
|
You should [install go](https://golang.org/doc/install) and set up your go
|
||||||
environment correctly. In particular, it is recommended to set the `$GOPATH`
|
environment correctly.
|
||||||
environment variable and to add the go bin directory or directories
|
|
||||||
`${GOPATH//://bin:}/bin` to the `$PATH`. See the Go wiki entry for
|
|
||||||
[GOPATH](https://github.com/golang/go/wiki/GOPATH).
|
|
||||||
|
|
||||||
Next, [install Node.js with npm](https://nodejs.org/en/download/) which is
|
Next, [install Node.js with npm](https://nodejs.org/en/download/) which is
|
||||||
required to build the JavaScript and CSS files. The minimum supported Node.js
|
required to build the JavaScript and CSS files. The minimum supported Node.js
|
||||||
@@ -91,12 +88,19 @@ The simplest recommended way to build from source is:
|
|||||||
TAGS="bindata sqlite sqlite_unlock_notify" make build
|
TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||||
```
|
```
|
||||||
|
|
||||||
However, there are a number of additional make tasks you should be aware of.
|
The `build` target will execute both `frontend` and `backend` sub-targets. If the `bindata` tag is present, the frontend files will be compiled into the binary. It is recommended to leave out the tag when doing frontend development so that changes will be reflected.
|
||||||
These are documented below but you can look at our
|
|
||||||
[`Makefile`](https://github.com/go-gitea/gitea/blob/master/Makefile) for more,
|
See `make help` for all available `make` targets. Also see [`.drone.yml`](https://github.com/go-gitea/gitea/blob/master/.drone.yml) to see how our continuous integration works.
|
||||||
and look at our
|
|
||||||
[`.drone.yml`](https://github.com/go-gitea/gitea/blob/master/.drone.yml) to see
|
## Building continuously
|
||||||
how our continuous integration works.
|
|
||||||
|
To run and continously rebuild when source files change:
|
||||||
|
|
||||||
|
````bash
|
||||||
|
make watch
|
||||||
|
````
|
||||||
|
|
||||||
|
On macOS, watching all backend source files may hit the default open files limit which can be increased via `ulimit -n 12288` for the current shell or in your shell startup file for all future shells.
|
||||||
|
|
||||||
### Formatting, code analysis and spell check
|
### Formatting, code analysis and spell check
|
||||||
|
|
||||||
@@ -128,18 +132,27 @@ make revive vet misspell-check
|
|||||||
|
|
||||||
### Working on JS and CSS
|
### Working on JS and CSS
|
||||||
|
|
||||||
Edit files in `web_src` and run the linter and build the files in `public`:
|
Either use the `watch-frontend` target mentioned above or just build once:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make webpack
|
make build && ./gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: When working on frontend code, it is advisable to set `USE_SERVICE_WORKER` to `false` in `app.ini` which will prevent undesirable caching of frontend assets.
|
Before committing, make sure the linters pass:
|
||||||
|
|
||||||
### Building Images
|
```bash
|
||||||
|
make lint-frontend
|
||||||
|
```
|
||||||
|
|
||||||
To build the images, ImageMagick, `inkscape` and `zopflipng` binaries must be available in
|
Note: When working on frontend code, set `USE_SERVICE_WORKER` to `false` in `app.ini` to prevent undesirable caching of frontend assets.
|
||||||
your `PATH` to run `make generate-images`.
|
|
||||||
|
### Building and adding SVGs
|
||||||
|
|
||||||
|
SVG icons are built using the `make svg` target which compiles the icon sources defined in `build/generate-svg.js` into the output directory `public/img/svg`. Custom icons can be added in the `web_src/svg` directory.
|
||||||
|
|
||||||
|
### Building the Logo
|
||||||
|
|
||||||
|
The PNG versions of the logo are built from a single SVG source file `assets/logo.svg` using the `make generate-images` target. To run it, Node.js and npm must be available. The same process can also be used to generate a custom logo PNGs from a SVG source file. It's possible to remove parts of the SVG logo for the favicon build by adding a `detail-remove` class to the SVG nodes to be removed.
|
||||||
|
|
||||||
### Updating the API
|
### Updating the API
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,10 @@ Calls to `log.Info`, `log.Debug`, `log.Error` etc. from the `code.gitea.io/gitea
|
|||||||
You can configure the outputs of this logger by setting the `MODE`
|
You can configure the outputs of this logger by setting the `MODE`
|
||||||
value in the `[log]` section of the configuration.
|
value in the `[log]` section of the configuration.
|
||||||
|
|
||||||
Each output sublogger is configured in a separate `[log.sublogger]`
|
Each output sublogger is configured in a separate `[log.sublogger.default]`
|
||||||
section, but there are certain default values. These will not be inherited from the `[log]` section:
|
which inherits from the sublogger `[log.sublogger]` section and from the
|
||||||
|
generic `[log]` section, but there are certain default values. These will
|
||||||
|
not be inherited from the `[log]` section:
|
||||||
|
|
||||||
* `FLAGS` is `stdflags` (Equal to
|
* `FLAGS` is `stdflags` (Equal to
|
||||||
`date,time,medfile,shortfuncname,levelinitial`)
|
`date,time,medfile,shortfuncname,levelinitial`)
|
||||||
@@ -70,6 +72,9 @@ section which you can configure the outputs of by setting the `MACARON`
|
|||||||
value in the `[log]` section of the configuration. `MACARON` defaults
|
value in the `[log]` section of the configuration. `MACARON` defaults
|
||||||
to `file` if unset.
|
to `file` if unset.
|
||||||
|
|
||||||
|
Please note, the macaron logger will log at `INFO` level, setting the
|
||||||
|
`LEVEL` of this logger to `WARN` or above will result in no macaron logs.
|
||||||
|
|
||||||
Each output sublogger for this logger is configured in
|
Each output sublogger for this logger is configured in
|
||||||
`[log.sublogger.macaron]` sections. There are certain default values
|
`[log.sublogger.macaron]` sections. There are certain default values
|
||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
@@ -98,6 +103,9 @@ Router logs the same data as the Macaron log but has slightly different
|
|||||||
coloring. It logs at the `Info` level by default, but this can be
|
coloring. It logs at the `Info` level by default, but this can be
|
||||||
changed if desired by setting the `ROUTER_LOG_LEVEL` value.
|
changed if desired by setting the `ROUTER_LOG_LEVEL` value.
|
||||||
|
|
||||||
|
Please note, setting the `LEVEL` of this logger to a level above
|
||||||
|
`ROUTER_LOG_LEVEL` will result in no router logs.
|
||||||
|
|
||||||
Each output sublogger for this logger is configured in
|
Each output sublogger for this logger is configured in
|
||||||
`[log.sublogger.router]` sections. There are certain default values
|
`[log.sublogger.router]` sections. There are certain default values
|
||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
@@ -136,6 +144,9 @@ which will not be inherited from the `[log]` or relevant
|
|||||||
If desired the format of the Access logger can be changed by changing
|
If desired the format of the Access logger can be changed by changing
|
||||||
the value of the `ACCESS_LOG_TEMPLATE`.
|
the value of the `ACCESS_LOG_TEMPLATE`.
|
||||||
|
|
||||||
|
Please note, the access logger will log at `INFO` level, setting the
|
||||||
|
`LEVEL` of this logger to `WARN` or above will result in no access logs.
|
||||||
|
|
||||||
NB: You can redirect the access logger to send its events to the Gitea
|
NB: You can redirect the access logger to send its events to the Gitea
|
||||||
log using the value: `ACCESS = ,`
|
log using the value: `ACCESS = ,`
|
||||||
|
|
||||||
@@ -279,9 +290,48 @@ messages. However, you could perhaps set this logger to work on `FATAL`.
|
|||||||
* `RECEIVERS`: Email addresses to send to.
|
* `RECEIVERS`: Email addresses to send to.
|
||||||
* `SUBJECT`: **Diagnostic message from Gitea**
|
* `SUBJECT`: **Diagnostic message from Gitea**
|
||||||
|
|
||||||
## Default Configuration
|
## Debugging problems
|
||||||
|
|
||||||
The default empty configuration is equivalent to:
|
When submitting logs in Gitea issues it is often helpful to submit
|
||||||
|
merged logs obtained by either by redirecting the console log to a file or
|
||||||
|
copying and pasting it. To that end it is recommended to set your logging to:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
LOG_SQL = false ; SQL logs are rarely helpful unless we specifically ask for them
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
[log]
|
||||||
|
MODE = console
|
||||||
|
LEVEL = debug ; please set the level to debug when we are debugging a problem
|
||||||
|
REDIRECT_MACARON_LOG = true
|
||||||
|
MACARON = console
|
||||||
|
ROUTER = console
|
||||||
|
COLORIZE = false ; this can be true if you can strip out the ansi coloring
|
||||||
|
```
|
||||||
|
|
||||||
|
Sometimes it will be helpful get some specific `TRACE` level logging retricted
|
||||||
|
to messages that match a specific `EXPRESSION`. Adjusting the `MODE` in the
|
||||||
|
`[log]` section to `MODE = console,traceconsole` to add a new logger output
|
||||||
|
`traceconsole` and then adding its corresponding section would be helpful:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[log.traceconsole] ; traceconsole here is just a name
|
||||||
|
MODE = console ; this is the output that the traceconsole writes to
|
||||||
|
LEVEL = trace
|
||||||
|
EXPRESSION = ; putting a string here will restrict this logger to logging only those messages that match this expression
|
||||||
|
```
|
||||||
|
|
||||||
|
(It's worth noting that log messages that match the expression at or above debug
|
||||||
|
level will get logged twice so don't worry about that.)
|
||||||
|
|
||||||
|
`STACKTRACE_LEVEL` should generally be left unconfigured (and hence kept at
|
||||||
|
`none`). There are only very specific occasions when it useful.
|
||||||
|
|
||||||
|
## Empty Configuration
|
||||||
|
|
||||||
|
The empty configuration is equivalent to:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[log]
|
[log]
|
||||||
@@ -305,6 +355,28 @@ COLORIZE = true # Or false if your windows terminal cannot color
|
|||||||
|
|
||||||
This is equivalent to sending all logs to the console, with default go log being sent to the console log too.
|
This is equivalent to sending all logs to the console, with default go log being sent to the console log too.
|
||||||
|
|
||||||
|
## Releasing-and-Reopening, Pausing and Resuming logging
|
||||||
|
|
||||||
|
If you are running on Unix you may wish to release-and-reopen logs in order to use `logrotate` or other tools.
|
||||||
|
It is possible force gitea to release and reopen it's logging files and connections by sending `SIGUSR1` to the
|
||||||
|
running process, or running `gitea manager logging release-and-reopen`.
|
||||||
|
|
||||||
|
Alternatively, you may wish to pause and resume logging - this can be accomplished through the use of the
|
||||||
|
`gitea manager logging pause` and `gitea manager logging resume` commands. Please note that whilst logging
|
||||||
|
is paused log events below INFO level will not be stored and only a limited number of events will be stored.
|
||||||
|
Logging may block, albeit temporarily, slowing gitea considerably whilst paused - therefore it is
|
||||||
|
recommended that pausing only done for a very short period of time.
|
||||||
|
|
||||||
|
## Adding and removing logging whilst Gitea is running
|
||||||
|
|
||||||
|
It is possible to add and remove logging whilst Gitea is running using the `gitea manager logging add` and `remove` subcommands.
|
||||||
|
This functionality can only adjust running log systems and cannot be used to start the access, macaron or router loggers if they
|
||||||
|
were not already initialised. If you wish to start these systems you are advised to adjust the app.ini and (gracefully) restart
|
||||||
|
the Gitea service.
|
||||||
|
|
||||||
|
The main intention of these commands is to easily add a temporary logger to investigate problems on running systems where a restart
|
||||||
|
may cause the issue to disappear.
|
||||||
|
|
||||||
## Log colorization
|
## Log colorization
|
||||||
|
|
||||||
Logs to the console will be colorized by default when not running on
|
Logs to the console will be colorized by default when not running on
|
||||||
@@ -388,3 +460,14 @@ func newNewoneLogService() {
|
|||||||
|
|
||||||
You should then add `newOneLogService` to `NewServices()` in
|
You should then add `newOneLogService` to `NewServices()` in
|
||||||
`modules/setting/setting.go`
|
`modules/setting/setting.go`
|
||||||
|
|
||||||
|
## Using `logrotate` instead of built-in log rotation
|
||||||
|
|
||||||
|
Gitea includes built-in log rotation, which should be enough for most deployments. However, if you instead want to use the `logrotate` utility:
|
||||||
|
|
||||||
|
- Disable built-in log rotation by setting `LOG_ROTATE` to `false` in your `app.ini`.
|
||||||
|
- Install `logrotate`.
|
||||||
|
- Configure `logrotate` to match your deployment requirements, see `man 8 logrotate` for configuration syntax details. In the `postrotate/endscript` block send Gitea a `USR1` signal via `kill -USR1` or `kill -10`, or run `gitea manager logging release-and-reopen` (with the appropriate environment). Ensure that your configurations apply to all files emitted by Gitea loggers as described in the above sections.
|
||||||
|
- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations.
|
||||||
|
|
||||||
|
The next `logrotate` jobs will include your configurations, so no restart is needed. You can also immediately reload `logrotate` with `logrotate /etc/logrotate.conf --force`.
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ menu:
|
|||||||
|
|
||||||
The new migration features were introduced in Gitea 1.9.0. It defines two interfaces to support migrating
|
The new migration features were introduced in Gitea 1.9.0. It defines two interfaces to support migrating
|
||||||
repositories data from other git host platforms to gitea or, in the future migrating gitea data to other
|
repositories data from other git host platforms to gitea or, in the future migrating gitea data to other
|
||||||
git host platforms. Currently, only the migrations from github via APIv3 to Gitea is implemented.
|
git host platforms. Currently, migrations from Github, Gitlab and Gitea to Gitea is implemented.
|
||||||
|
|
||||||
First of all, Gitea defines some standard objects in packages `modules/migrations/base`. They are
|
First of all, Gitea defines some standard objects in packages `modules/migrations/base`. They are
|
||||||
`Repository`, `Milestone`, `Release`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`.
|
`Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`.
|
||||||
|
|
||||||
## Downloader Interfaces
|
## Downloader Interfaces
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ create a Downloader.
|
|||||||
|
|
||||||
```Go
|
```Go
|
||||||
type Downloader interface {
|
type Downloader interface {
|
||||||
|
GetAsset(relTag string, relID, id int64) (io.ReadCloser, error)
|
||||||
SetContext(context.Context)
|
SetContext(context.Context)
|
||||||
GetRepoInfo() (*Repository, error)
|
GetRepoInfo() (*Repository, error)
|
||||||
GetTopics() ([]string, error)
|
GetTopics() ([]string, error)
|
||||||
@@ -41,15 +42,15 @@ type Downloader interface {
|
|||||||
GetLabels() ([]*Label, error)
|
GetLabels() ([]*Label, error)
|
||||||
GetIssues(page, perPage int) ([]*Issue, bool, error)
|
GetIssues(page, perPage int) ([]*Issue, bool, error)
|
||||||
GetComments(issueNumber int64) ([]*Comment, error)
|
GetComments(issueNumber int64) ([]*Comment, error)
|
||||||
GetPullRequests(page, perPage int) ([]*PullRequest, error)
|
GetPullRequests(page, perPage int) ([]*PullRequest, bool, error)
|
||||||
GetReviews(pullRequestNumber int64) ([]*Review, error)
|
GetReviews(pullRequestNumber int64) ([]*Review, error)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```Go
|
```Go
|
||||||
type DownloaderFactory interface {
|
type DownloaderFactory interface {
|
||||||
Match(opts MigrateOptions) (bool, error)
|
New(ctx context.Context, opts MigrateOptions) (Downloader, error)
|
||||||
New(opts MigrateOptions) (Downloader, error)
|
GitServiceType() structs.GitServiceType
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ type Uploader interface {
|
|||||||
CreateRepo(repo *Repository, opts MigrateOptions) error
|
CreateRepo(repo *Repository, opts MigrateOptions) error
|
||||||
CreateTopics(topic ...string) error
|
CreateTopics(topic ...string) error
|
||||||
CreateMilestones(milestones ...*Milestone) error
|
CreateMilestones(milestones ...*Milestone) error
|
||||||
CreateReleases(releases ...*Release) error
|
CreateReleases(downloader Downloader, releases ...*Release) error
|
||||||
SyncTags() error
|
SyncTags() error
|
||||||
CreateLabels(labels ...*Label) error
|
CreateLabels(labels ...*Label) error
|
||||||
CreateIssues(issues ...*Issue) error
|
CreateIssues(issues ...*Issue) error
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Instead, check out [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/bra
|
|||||||
|
|
||||||
Check our [CI/CD page]({{< relref "doc/advanced/ci-cd.en-us.md" >}})
|
Check our [CI/CD page]({{< relref "doc/advanced/ci-cd.en-us.md" >}})
|
||||||
|
|
||||||
### Internationalization
|
### Internationalization
|
||||||
- [Weblate](https://docs.weblate.org/en/latest/admin/continuous.html#gitea-setup)
|
- [Weblate](https://docs.weblate.org/en/latest/admin/continuous.html#gitea-setup)
|
||||||
|
|
||||||
### Migrating
|
### Migrating
|
||||||
@@ -32,11 +32,12 @@ Check our [CI/CD page]({{< relref "doc/advanced/ci-cd.en-us.md" >}})
|
|||||||
|
|
||||||
|
|
||||||
### Mobile
|
### Mobile
|
||||||
- [GitNex for Android](https://gitlab.com/mmarif4u/gitnex)
|
- [GitNex for Android](https://codeberg.org/gitnex/GitNex)
|
||||||
|
- [GitTouch for Android and iOS](https://github.com/git-touch/git-touch)
|
||||||
|
|
||||||
### Editor Extensions
|
### Editor Extensions
|
||||||
- [Gitea Extension for Visual Studio](https://github.com/maikebing/Gitea.VisualStudio)
|
- [Gitea Extension for Visual Studio](https://github.com/maikebing/Gitea.VisualStudio)
|
||||||
- Download from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=MysticBoy.GiteaExtensionforVisualStudio)
|
- Download from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=MysticBoy.GiteaExtensionforVisualStudio)
|
||||||
|
|
||||||
### Project Management
|
### Project Management
|
||||||
- [YouTrack by JetBrains](https://blog.jetbrains.com/youtrack/2019/12/whats-new-in-youtrack-2019-3/)
|
- [YouTrack by JetBrains](https://blog.jetbrains.com/youtrack/2019/12/whats-new-in-youtrack-2019-3/)
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ menu:
|
|||||||
identifier: "authentication"
|
identifier: "authentication"
|
||||||
---
|
---
|
||||||
|
|
||||||
---
|
|
||||||
name: Authentication
|
|
||||||
---
|
|
||||||
|
|
||||||
# Authentication
|
# Authentication
|
||||||
|
|
||||||
## LDAP (Lightweight Directory Access Protocol)
|
## LDAP (Lightweight Directory Access Protocol)
|
||||||
@@ -100,7 +96,7 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
the LDAP server. The default period is every 24 hours but that can be
|
the LDAP server. The default period is every 24 hours but that can be
|
||||||
changed in the app.ini file. See the *cron.sync_external_users* section in
|
changed in the app.ini file. See the *cron.sync_external_users* section in
|
||||||
the [sample
|
the [sample
|
||||||
app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
for detailed comments about that section. The *User Search Base* and *User
|
for detailed comments about that section. The *User Search Base* and *User
|
||||||
Filter* settings described above will limit which users can use Gitea and
|
Filter* settings described above will limit which users can use Gitea and
|
||||||
which users will be synchronized. When initially run the task will create
|
which users will be synchronized. When initially run the task will create
|
||||||
@@ -242,9 +238,9 @@ Before activating SSPI single sign-on authentication (SSO) you have to prepare y
|
|||||||
|
|
||||||
- Sign in to a client computer in the same domain with any domain user (client computer, different from the server running `gitea.exe`)
|
- Sign in to a client computer in the same domain with any domain user (client computer, different from the server running `gitea.exe`)
|
||||||
|
|
||||||
- If you are using Chrome, Edge or Internet Explorer, add the URL of the web app to the Local intranet sites (`Internet Options -> Security -> Local intranet -> Sites`)
|
- If you are using Chrome or Edge, add the URL of the web app to the Local intranet sites (`Internet Options -> Security -> Local intranet -> Sites`)
|
||||||
|
|
||||||
- Start Chrome, Edge or Internet Explorer and navigate to the FQDN URL of gitea (eg. `http://host.domain.local:3000`)
|
- Start Chrome or Edge and navigate to the FQDN URL of gitea (eg. `http://host.domain.local:3000`)
|
||||||
|
|
||||||
- Click the `Sign In` button on the dashboard and choose SSPI to be automatically logged in with the same user that is currently logged on to the computer
|
- Click the `Sign In` button on the dashboard and choose SSPI to be automatically logged in with the same user that is currently logged on to the computer
|
||||||
|
|
||||||
|
|||||||
@@ -79,25 +79,25 @@ _Symbols used in table:_
|
|||||||
| Labels | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Labels | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Time tracking | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Time tracking | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Multiple assignees for issues | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
| Multiple assignees for issues | ✓ | ✘ | ✓ | ✘ | ✓ | ✘ | ✘ |
|
||||||
| Related issues | ✘ | ✘ | ⁄ | ✘ | ✓ | ✘ | ✘ |
|
| Related issues | ✘ | ✘ | ⁄ | [✓](https://docs.gitlab.com/ce/user/project/issues/related_issues.html) | ✓ | ✘ | ✘ |
|
||||||
| Confidential issues | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
| Confidential issues | [✘](https://github.com/go-gitea/gitea/issues/3217) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Comment reactions | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Comment reactions | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Lock Discussion | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Lock Discussion | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Batch issue handling | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Batch issue handling | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Issue Boards | [✘](https://github.com/go-gitea/gitea/issues/3476) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
| Issue Boards (Kanban) | [✓](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Create new branches from issues | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
| Create new branches from issues | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Issue search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
| Issue search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||||
| Global issue search | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
| Global issue search | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||||
| Issue dependency | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
| Issue dependency | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||||
| Create issue via email | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✘ | ✓ | ✓ | ✘ |
|
| Create issue via email | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✘ | ✓ | ✓ | ✘ |
|
||||||
| Service Desk | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | ✘ | ✓ | ✘ | ✘ |
|
| Service Desk | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ |
|
||||||
|
|
||||||
#### Pull/Merge requests
|
#### Pull/Merge requests
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
||||||
| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Squash merging | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
| Squash merging | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ |
|
||||||
| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
||||||
| Pull/Merge request inline comments | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Pull/Merge request inline comments | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Pull/Merge request approval | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ |
|
| Pull/Merge request approval | ✓ | ✘ | ⁄ | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
|||||||
@@ -15,4 +15,17 @@ menu:
|
|||||||
|
|
||||||
# Localization
|
# Localization
|
||||||
|
|
||||||
## TBD
|
Gitea's localization happens through our [Crowdin project](https://crowdin.com/project/gitea).
|
||||||
|
|
||||||
|
For changes to an **English** translation, a pull request can be made that changes the appropriate key in
|
||||||
|
the [english locale](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini).
|
||||||
|
|
||||||
|
For changes to a **non-English** translation, refer to the Crowdin project above.
|
||||||
|
|
||||||
|
## Supported Languages
|
||||||
|
|
||||||
|
Any language listed in the above Crowdin project will be supported as long as 25% or more has been translated.
|
||||||
|
|
||||||
|
After a translation has been accepted, it will be reflected in the main repository after the next Crowdin sync, which is generally after any PR is merged.
|
||||||
|
At the time of writing, this means that a changed translation may not appear until the following Gitea release.
|
||||||
|
If you use a bleeding edge build, it should appear as soon as you update after the change is synced.
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ Also see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}})
|
|||||||
* [How can I enable password reset](#how-can-i-enable-password-reset)
|
* [How can I enable password reset](#how-can-i-enable-password-reset)
|
||||||
* [How can a user's password be changed](#how-can-a-user-s-password-be-changed)
|
* [How can a user's password be changed](#how-can-a-user-s-password-be-changed)
|
||||||
* [Why is my markdown broken](#why-is-my-markdown-broken)
|
* [Why is my markdown broken](#why-is-my-markdown-broken)
|
||||||
|
* [Errors during upgrade on MySQL: Error 1118: Row size too large.](#upgrade-errors-with-mysql)
|
||||||
|
* [Why are emoji broken on MySQL](#why-are-emoji-broken-on-mysql)
|
||||||
|
|
||||||
## Difference between 1.x and 1.x.x downloads
|
## Difference between 1.x and 1.x.x downloads
|
||||||
Version 1.7.x will be used for this example.
|
Version 1.7.x will be used for this example.
|
||||||
@@ -161,7 +162,7 @@ At some point, a customer or third party needs access to a specific repo and onl
|
|||||||
|
|
||||||
### Enable Fail2ban
|
### Enable Fail2ban
|
||||||
|
|
||||||
Use [Fail2Ban]({{ relref "doc/usage/fail2ban-setup.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns
|
Use [Fail2Ban]({{< relref "doc/usage/fail2ban-setup.en-us.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns
|
||||||
|
|
||||||
## How to add/use custom themes
|
## How to add/use custom themes
|
||||||
Gitea supports two official themes right now, `gitea` and `arc-green` (`light` and `dark` respectively)
|
Gitea supports two official themes right now, `gitea` and `arc-green` (`light` and `dark` respectively)
|
||||||
@@ -308,3 +309,30 @@ There is no setting for password resets. It is enabled when a [mail service]({{<
|
|||||||
In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant.
|
In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant.
|
||||||
If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax.
|
If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax.
|
||||||
If it is the latter, _usually_ there is a compliant alternative listed in the spec.
|
If it is the latter, _usually_ there is a compliant alternative listed in the spec.
|
||||||
|
|
||||||
|
## Upgrade errors with MySQL
|
||||||
|
|
||||||
|
If you are receiving errors on upgrade of Gitea using MySQL that read:
|
||||||
|
|
||||||
|
> `ORM engine initialization failed: migrate: do migrate: Error: 1118: Row size too large...`
|
||||||
|
|
||||||
|
Please run `gitea convert` or run `ALTER TABLE table_name ROW_FORMAT=dynamic;` for each table in the database.
|
||||||
|
|
||||||
|
The underlying problem is that the space allocated for indices by the default row format
|
||||||
|
is too small. Gitea requires that the `ROWFORMAT` for its tables is `DYNAMIC`.
|
||||||
|
|
||||||
|
If you are receiving an error line containing `Error 1071: Specified key was too long; max key length is 1000 bytes...`
|
||||||
|
then you are attempting to run Gitea on tables which use the ISAM engine. While this may have worked by chance in previous versions of Gitea, it has never been officially supported and
|
||||||
|
you must use InnoDB. You should run `ALTER TABLE table_name ENGINE=InnoDB;` for each table in the database.
|
||||||
|
|
||||||
|
## Why Are Emoji Broken On MySQL
|
||||||
|
|
||||||
|
Unfortunately MySQL's `utf8` charset does not completely allow all possible UTF-8 characters, in particular Emoji.
|
||||||
|
They created a new charset and collation called `utf8mb4` that allows for emoji to be stored but tables which use
|
||||||
|
the `utf8` charset, and connections which use the `utf8` charset will not use this.
|
||||||
|
|
||||||
|
Please run `gitea convert`, or run `ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
|
||||||
|
for the database_name and run `ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
|
||||||
|
for each table in the database.
|
||||||
|
|
||||||
|
You will also need to change the app.ini database charset to `CHARSET=utf8mb4`.
|
||||||
|
|||||||
@@ -21,7 +21,12 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
## MySQL
|
## MySQL
|
||||||
|
|
||||||
1. On database instance, login to database console as root:
|
1. For remote database setup, you will need to make MySQL listen to your IP address. Edit `bind-address` option on `/etc/mysql/my.cnf` on database instance to:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
bind-address = 203.0.113.3
|
||||||
|
```
|
||||||
|
2. On database instance, login to database console as root:
|
||||||
|
|
||||||
```
|
```
|
||||||
mysql -u root -p
|
mysql -u root -p
|
||||||
@@ -29,7 +34,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Enter the password as prompted.
|
Enter the password as prompted.
|
||||||
|
|
||||||
2. Create database user which will be used by Gitea, authenticated by password. This example uses `'gitea'` as password. Please use a secure password for your instance.
|
3. Create database user which will be used by Gitea, authenticated by password. This example uses `'gitea'` as password. Please use a secure password for your instance.
|
||||||
|
|
||||||
For local database:
|
For local database:
|
||||||
|
|
||||||
@@ -49,7 +54,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Replace username and password above as appropriate.
|
Replace username and password above as appropriate.
|
||||||
|
|
||||||
3. Create database with UTF-8 charset and collation. Make sure to use `utf8mb4` charset instead of `utf8` as the former supports all Unicode characters (including emojis) beyond *Basic Multilingual Plane*. Also, collation chosen depending on your expected content. When in doubt, use either `unicode_ci` or `general_ci`.
|
4. Create database with UTF-8 charset and collation. Make sure to use `utf8mb4` charset instead of `utf8` as the former supports all Unicode characters (including emojis) beyond *Basic Multilingual Plane*. Also, collation chosen depending on your expected content. When in doubt, use either `unicode_ci` or `general_ci`.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||||
@@ -57,7 +62,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Replace database name as appropriate.
|
Replace database name as appropriate.
|
||||||
|
|
||||||
4. Grant all privileges on the database to database user created above.
|
5. Grant all privileges on the database to database user created above.
|
||||||
|
|
||||||
For local database:
|
For local database:
|
||||||
|
|
||||||
@@ -73,9 +78,9 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Quit from database console by `exit`.
|
6. Quit from database console by `exit`.
|
||||||
|
|
||||||
6. On your Gitea server, test connection to the database:
|
7. On your Gitea server, test connection to the database:
|
||||||
|
|
||||||
```
|
```
|
||||||
mysql -u gitea -h 203.0.113.3 -p giteadb
|
mysql -u gitea -h 203.0.113.3 -p giteadb
|
||||||
@@ -87,7 +92,13 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
## PostgreSQL
|
## PostgreSQL
|
||||||
|
|
||||||
1. PostgreSQL uses `md5` challenge-response encryption scheme for password authentication by default. Nowadays this scheme is not considered secure anymore. Use SCRAM-SHA-256 scheme instead by editing the `postgresql.conf` configuration file on the database server to:
|
1. For remote database setup, configure PostgreSQL on database instance to listen to your IP address by editing `listen_addresses` on `postgresql.conf` to:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
listen_addresses = 'localhost, 203.0.113.3'
|
||||||
|
```
|
||||||
|
|
||||||
|
2. PostgreSQL uses `md5` challenge-response encryption scheme for password authentication by default. Nowadays this scheme is not considered secure anymore. Use SCRAM-SHA-256 scheme instead by editing the `postgresql.conf` configuration file on the database server to:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
password_encryption = scram-sha-256
|
password_encryption = scram-sha-256
|
||||||
@@ -95,13 +106,13 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Restart PostgreSQL to apply the setting.
|
Restart PostgreSQL to apply the setting.
|
||||||
|
|
||||||
2. On the database server, login to the database console as superuser:
|
3. On the database server, login to the database console as superuser:
|
||||||
|
|
||||||
```
|
```
|
||||||
su -c "psql" - postgres
|
su -c "psql" - postgres
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Create database user (role in PostgreSQL terms) with login privilege and password. Please use a secure, strong password instead of `'gitea'` below:
|
4. Create database user (role in PostgreSQL terms) with login privilege and password. Please use a secure, strong password instead of `'gitea'` below:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea';
|
CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea';
|
||||||
@@ -109,7 +120,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Replace username and password as appropriate.
|
Replace username and password as appropriate.
|
||||||
|
|
||||||
4. Create database with UTF-8 charset and owned by the database user created earlier. Any `libc` collations can be specified with `LC_COLLATE` and `LC_CTYPE` parameter, depending on expected content:
|
5. Create database with UTF-8 charset and owned by the database user created earlier. Any `libc` collations can be specified with `LC_COLLATE` and `LC_CTYPE` parameter, depending on expected content:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
|
CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
|
||||||
@@ -117,7 +128,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Replace database name as appropriate.
|
Replace database name as appropriate.
|
||||||
|
|
||||||
5. Allow the database user to access the database created above by adding the following authentication rule to `pg_hba.conf`.
|
6. Allow the database user to access the database created above by adding the following authentication rule to `pg_hba.conf`.
|
||||||
|
|
||||||
For local database:
|
For local database:
|
||||||
|
|
||||||
@@ -137,7 +148,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Restart PostgreSQL to apply new authentication rules.
|
Restart PostgreSQL to apply new authentication rules.
|
||||||
|
|
||||||
6. On your Gitea server, test connection to the database.
|
7. On your Gitea server, test connection to the database.
|
||||||
|
|
||||||
For local database:
|
For local database:
|
||||||
|
|
||||||
@@ -154,3 +165,136 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
where `gitea` is database user, `giteadb` is database name, and `203.0.113.3` is IP address of your database instance.
|
where `gitea` is database user, `giteadb` is database name, and `203.0.113.3` is IP address of your database instance.
|
||||||
|
|
||||||
You should be prompted to enter password for the database user, and connected to the database.
|
You should be prompted to enter password for the database user, and connected to the database.
|
||||||
|
|
||||||
|
## Database Connection over TLS
|
||||||
|
|
||||||
|
If the communication between Gitea and your database instance is performed through a private network, or if Gitea and the database are running on the same server, this section can be omitted since the security between Gitea and the database instance is not critically exposed. If instead the database instance is on a public network, use TLS to encrypt the connection to the database, as it is possible for third-parties to intercept the traffic data.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- You need two valid TLS certificates, one for the database instance (database server) and one for the Gitea instance (database client). Both certificates must be signed by a trusted CA.
|
||||||
|
- The database certificate must contain `TLS Web Server Authentication` in the `X509v3 Extended Key Usage` extension attribute, while the client certificate needs `TLS Web Client Authentication` in the corresponding attribute.
|
||||||
|
- On the database server certificate, one of `Subject Alternative Name` or `Common Name` entries must be the fully-qualified domain name (FQDN) of the database instance (e.g. `db.example.com`). On the database client certificate, one of the entries mentioned above must contain the database username that Gitea will be using to connect.
|
||||||
|
- You need domain name mappings of both Gitea and database servers to their respective IP addresses. Either set up DNS records for them or add local mappings to `/etc/hosts` (`%WINDIR%\System32\drivers\etc\hosts` in Windows) on each system. This allows the database connections to be performed by domain name instead of IP address. See documentation of your system for details.
|
||||||
|
|
||||||
|
### PostgreSQL
|
||||||
|
|
||||||
|
The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both database client and server authenticate each other by sending their respective certificates to their respective opposite for validation. In other words, the server verifies client certificate, and the client verifies server certificate.
|
||||||
|
|
||||||
|
1. On the server with the database instance, place the following credentials:
|
||||||
|
|
||||||
|
- `/path/to/postgresql.crt`: Database instance certificate
|
||||||
|
- `/path/to/postgresql.key`: Database instance private key
|
||||||
|
- `/path/to/root.crt`: CA certificate chain to validate client certificates
|
||||||
|
|
||||||
|
2. Add following options to `postgresql.conf`:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
ssl = on
|
||||||
|
ssl_ca_file = '/path/to/root.crt'
|
||||||
|
ssl_cert_file = '/path/to/postgresql.crt'
|
||||||
|
ssl_key_file = '/path/to/postgresql.key'
|
||||||
|
ssl_min_protocol_version = 'TLSv1.2'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Adjust credentials ownership and permission, as required by PostgreSQL:
|
||||||
|
|
||||||
|
```
|
||||||
|
chown postgres:postgres /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key
|
||||||
|
chmod 0600 /path/to/root.crt /path/to/postgresql.crt /path/to/postgresql.key
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Edit `pg_hba.conf` rule to only allow Gitea database user to connect over SSL, and to require client certificate verification.
|
||||||
|
|
||||||
|
For PostgreSQL 12:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=verify-full
|
||||||
|
```
|
||||||
|
|
||||||
|
For PostgreSQL 11 and earlier:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
hostssl giteadb gitea 192.0.2.10/32 scram-sha-256 clientcert=1
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace database name, user, and IP address of Gitea instance as appropriate.
|
||||||
|
|
||||||
|
5. Restart PostgreSQL to apply configurations above.
|
||||||
|
|
||||||
|
6. On the server running the Gitea instance, place the following credentials under the home directory of the user who runs Gitea (e.g. `git`):
|
||||||
|
|
||||||
|
- `~/.postgresql/postgresql.crt`: Database client certificate
|
||||||
|
- `~/.postgresql/postgresql.key`: Database client private key
|
||||||
|
- `~/.postgresql/root.crt`: CA certificate chain to validate server certificate
|
||||||
|
|
||||||
|
Note: Those file names above are hardcoded in PostgreSQL and it is not possible to change them.
|
||||||
|
|
||||||
|
7. Adjust credentials, ownership and permission as required:
|
||||||
|
|
||||||
|
```
|
||||||
|
chown git:git ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt
|
||||||
|
chown 0600 ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
8. Test the connection to the database:
|
||||||
|
|
||||||
|
```
|
||||||
|
psql "postgres://gitea@example.db/giteadb?sslmode=verify-full"
|
||||||
|
```
|
||||||
|
|
||||||
|
You should be prompted to enter password for the database user, and then be connected to the database.
|
||||||
|
|
||||||
|
|
||||||
|
### MySQL
|
||||||
|
|
||||||
|
While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details.
|
||||||
|
|
||||||
|
In one-way TLS, the database client verifies the certificate sent from server during the connection handshake, and the server assumes that the connected client is legitimate, since client certificate verification doesn't take place.
|
||||||
|
|
||||||
|
|
||||||
|
1. On the database instance, place the following credentials:
|
||||||
|
|
||||||
|
- `/path/to/mysql.crt`: Database instance certificate
|
||||||
|
- `/path/to/mysql.key`: Database instance key
|
||||||
|
- `/path/to/ca.crt`: CA certificate chain. This file isn't used on one-way TLS, but is used to validate client certificates on two-way TLS.
|
||||||
|
|
||||||
|
2. Add following options to `my.cnf`:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[mysqld]
|
||||||
|
ssl-ca = /path/to/ca.crt
|
||||||
|
ssl-cert = /path/to/mysql.crt
|
||||||
|
ssl-key = /path/to/mysql.key
|
||||||
|
tls-version = TLSv1.2,TLSv1.3
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Adjust credentials ownership and permission:
|
||||||
|
|
||||||
|
```
|
||||||
|
chown mysql:mysql /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key
|
||||||
|
chmod 0600 /path/to/ca.crt /path/to/mysql.crt /path/to/mysql.key
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Restart MySQL to apply the setting.
|
||||||
|
|
||||||
|
5. The database user for Gitea may have been created earlier, but it would authenticate only against the IP addresses of the server running Gitea. To authenticate against its domain name, recreate the user, and this time also set it to require TLS for connecting to the database:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
DROP USER 'gitea'@'192.0.2.10';
|
||||||
|
CREATE USER 'gitea'@'example.gitea' IDENTIFIED BY 'gitea' REQUIRE SSL;
|
||||||
|
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'example.gitea';
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace database user name, password, and Gitea instance domain as appropriate.
|
||||||
|
|
||||||
|
6. Make sure that the CA certificate chain required to validate the database server certificate is on the system certificate store of both the database and Gitea servers. Consult your system documentation for instructions on adding a CA certificate to the certificate store.
|
||||||
|
|
||||||
|
7. On the server running Gitea, test connection to the database:
|
||||||
|
|
||||||
|
```
|
||||||
|
mysql -u gitea -h example.db -p --ssl
|
||||||
|
```
|
||||||
|
|
||||||
|
You should be connected to the database.
|
||||||
|
|||||||
@@ -26,22 +26,13 @@ chmod +x gitea
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Verify GPG signature
|
## Verify GPG signature
|
||||||
Gitea signs all binaries with a [GPG key](https://pgp.mit.edu/pks/lookup?op=vindex&fingerprint=on&search=0x2D9AE806EC1592E2) to prevent against unwanted modification of binaries. To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the gpg command line tool.
|
Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teabot%40gitea.io) to prevent against unwanted modification of binaries. To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the gpg command line tool.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
gpg --keyserver pgp.mit.edu --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
|
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
|
||||||
gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-amd64
|
gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-amd64
|
||||||
```
|
```
|
||||||
|
|
||||||
## Test
|
|
||||||
|
|
||||||
After getting a binary, it can be tested with `./gitea web` or moved to a permanent
|
|
||||||
location. When launched manually, Gitea can be killed using `Ctrl+C`.
|
|
||||||
|
|
||||||
```
|
|
||||||
./gitea web
|
|
||||||
```
|
|
||||||
|
|
||||||
## Recommended server configuration
|
## Recommended server configuration
|
||||||
|
|
||||||
**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/advanced/specific-variables.en-us.md" >}}) as well!
|
**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/advanced/specific-variables.en-us.md" >}}) as well!
|
||||||
@@ -122,6 +113,18 @@ It is recommended you do a [backup]({{< relref "doc/usage/backup-and-restore.en-
|
|||||||
If you have carried out the installation steps as described above, the binary should
|
If you have carried out the installation steps as described above, the binary should
|
||||||
have the generic name `gitea`. Do not change this, i.e. to include the version number.
|
have the generic name `gitea`. Do not change this, i.e. to include the version number.
|
||||||
|
|
||||||
|
### 1. Restarting gitea with systemd (recommended)
|
||||||
|
|
||||||
|
As explained before, we recommend to use systemd as service manager. In this case ```systemctl restart gitea``` should be enough.
|
||||||
|
|
||||||
|
### 2. Restarting gitea without systemd
|
||||||
|
|
||||||
|
To restart your gitea instance, we recommend to use SIGHUP signal. If you know your gitea PID use ```kill -1 $GITEA_PID``` otherwise you can use ```killall -1 gitea``` or ```pkill -1 gitea```
|
||||||
|
|
||||||
|
To gracefully stop the gitea instance, a simple ```kill $GITEA_PID``` or ```killall gitea``` is enough.
|
||||||
|
|
||||||
|
**NOTE:** We don't recommend to use SIGKILL signal (know also as `-9`), you may be forcefully stopping some of Gitea internal tasks and it will not gracefully stop (tasks in queues, indexers processes, etc.)
|
||||||
|
|
||||||
See below for troubleshooting instructions to repair broken repositories after
|
See below for troubleshooting instructions to repair broken repositories after
|
||||||
an update of your Gitea version.
|
an update of your Gitea version.
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,26 @@ Please follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}
|
|||||||
|
|
||||||
Should the packages get updated and fixed, we will provide up-to-date installation instructions here.
|
Should the packages get updated and fixed, we will provide up-to-date installation instructions here.
|
||||||
|
|
||||||
|
## Alpine Linux
|
||||||
|
|
||||||
|
Alpine Linux has gitea in its community repository. It follows the latest stable version.
|
||||||
|
for more information look at https://pkgs.alpinelinux.org/packages?name=gitea&branch=edge.
|
||||||
|
|
||||||
|
install as usual:
|
||||||
|
```sh
|
||||||
|
apk add gitea
|
||||||
|
```
|
||||||
|
config is found in **/etc/gitea/app.ini**
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
There are no published packages for Windows. This page will change when packages are published,
|
There is a [Gitea](https://chocolatey.org/packages/gitea) package for Windows by [Chocolatey](https://chocolatey.org/).
|
||||||
in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/). In the meantime
|
|
||||||
the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide.
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
choco install gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
Or follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide.
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/).
|
Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/).
|
||||||
@@ -38,7 +52,7 @@ Following the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) gu
|
|||||||
but is not supported. To install Gitea via `brew`:
|
but is not supported. To install Gitea via `brew`:
|
||||||
|
|
||||||
```
|
```
|
||||||
brew tap go-gitea/gitea
|
brew tap gitea/tap https://gitea.com/gitea/homebrew-gitea
|
||||||
brew install gitea
|
brew install gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -67,13 +81,19 @@ To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it w
|
|||||||
|
|
||||||
## Cloudron
|
## Cloudron
|
||||||
|
|
||||||
Gitea is available as a 1-click install on [Cloudron](https://cloudron.io). For those unaware,
|
Gitea is available as a 1-click install on [Cloudron](https://cloudron.io).
|
||||||
Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure.
|
Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure.
|
||||||
|
|
||||||
[](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
|
[](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
|
||||||
|
|
||||||
The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app).
|
The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app).
|
||||||
|
|
||||||
There is a [demo instance](https://my-demo.cloudron.me) (username: cloudron password: cloudron) where
|
There is a [demo instance](https://my.demo.cloudron.io) (username: cloudron password: cloudron) where
|
||||||
you can experiment with running Gitea.
|
you can experiment with running Gitea.
|
||||||
|
|
||||||
|
## Third-party
|
||||||
|
|
||||||
|
Various other third-party packages of Gitea exist.
|
||||||
|
To see a curated list, head over to [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages).
|
||||||
|
|
||||||
|
Do you know of an existing package that isn't on the list? Send in a PR to get it added!
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ menu:
|
|||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你冶可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令:
|
macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令:
|
||||||
|
|
||||||
```
|
```
|
||||||
brew tap go-gitea/gitea
|
brew tap go-gitea/gitea
|
||||||
|
|||||||
@@ -21,7 +21,13 @@ menu:
|
|||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
目前尚未發佈任何 Windows 套件,如果我們發佈了,會直接更新此網頁。我們計畫使用 `MSI`,或 [Chocolatey](https://chocolatey.org/) 來製作套件。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
|
在 Windows 作業系統你可以透過 [Chocolatey](https://chocolatey.org/) 套件管理器安裝 [Gitea](https://chocolatey.org/packages/gitea) 套件:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
choco install gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
也可以參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
|
||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
|
|||||||
@@ -98,8 +98,10 @@ Depending on requirements, the following build tags can be included.
|
|||||||
be used to authenticate local users or extend authentication to methods
|
be used to authenticate local users or extend authentication to methods
|
||||||
available to PAM.
|
available to PAM.
|
||||||
|
|
||||||
Bundling assets into the binary using the `bindata` build tag can make
|
Bundling assets into the binary using the `bindata` build tag is recommended for
|
||||||
development and testing easier, but is not ideal for a production deployment.
|
production deployments. It is possible to serve the static assets directly via a reverse proxy,
|
||||||
|
but in most cases it is not necessary, and assets should still be bundled in the binary.
|
||||||
|
You may want to exclude bindata while developing/testing Gitea.
|
||||||
To include assets, add the `bindata` tag:
|
To include assets, add the `bindata` tag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -135,13 +137,13 @@ launched manually from command line, it can be killed by pressing `Ctrl + C`.
|
|||||||
./gitea web
|
./gitea web
|
||||||
```
|
```
|
||||||
|
|
||||||
## Changing the default CustomPath, CustomConf and AppWorkPath
|
## Changing default paths
|
||||||
|
|
||||||
Gitea will search for a number of things from the `CustomPath`. By default this is
|
Gitea will search for a number of things from the `CustomPath`. By default this is
|
||||||
the `custom/` directory in the current working directory when running Gitea. It will also
|
the `custom/` directory in the current working directory when running Gitea. It will also
|
||||||
look for its configuration file `CustomConf` in `$CustomPath/conf/app.ini`, and will use the
|
look for its configuration file `CustomConf` in `$CustomPath/conf/app.ini`, and will use the
|
||||||
current working directory as the relative base path `AppWorkPath` for a number configurable
|
current working directory as the relative base path `AppWorkPath` for a number configurable
|
||||||
values.
|
values. Finally the static files will be served from `StaticRootPath` which defaults to the `AppWorkPath`.
|
||||||
|
|
||||||
These values, although useful when developing, may conflict with downstream users preferences.
|
These values, although useful when developing, may conflict with downstream users preferences.
|
||||||
|
|
||||||
@@ -152,8 +154,30 @@ using the `LDFLAGS` environment variable for `make`. The appropriate settings ar
|
|||||||
* To set the `CustomPath` use `LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""`
|
* To set the `CustomPath` use `LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""`
|
||||||
* For `CustomConf` you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
|
* For `CustomConf` you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
|
||||||
* For `AppWorkPath` you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
|
* For `AppWorkPath` you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
|
||||||
|
* For `StaticRootPath` you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
|
||||||
|
* To change the default PID file location use `-X \"code.gitea.io/gitea/modules/setting.PIDFile=/run/gitea.pid\"`
|
||||||
|
|
||||||
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
|
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
|
||||||
with the appropriate `TAGS` as above.
|
with the appropriate `TAGS` as above.
|
||||||
|
|
||||||
Running `gitea help` will allow you to review what the computed settings will be for your `gitea`.
|
Running `gitea help` will allow you to review what the computed settings will be for your `gitea`.
|
||||||
|
|
||||||
|
## Cross Build
|
||||||
|
|
||||||
|
The `go` compiler toolchain supports cross-compiling to different architecture targets that are supported by the toolchain. See [`GOOS` and `GOARCH` environment variable](https://golang.org/doc/install/source#environment) for the list of supported targets. Cross compilation is helpful if you want to build Gitea for less-powerful systems (such as Raspberry Pi).
|
||||||
|
|
||||||
|
To cross build Gitea with build tags (`TAGS`), you also need a C cross compiler which targets the same architecture as selected by the `GOOS` and `GOARCH` variables. For example, to cross build for Linux ARM64 (`GOOS=linux` and `GOARCH=arm64`), you need the `aarch64-unknown-linux-gnu-gcc` cross compiler. This is required because Gitea build tags uses `cgo`'s foreign-function interface (FFI).
|
||||||
|
|
||||||
|
Cross-build Gitea for Linux ARM64, without any tags:
|
||||||
|
|
||||||
|
```
|
||||||
|
GOOS=linux GOARCH=arm64 make build
|
||||||
|
```
|
||||||
|
|
||||||
|
Cross-build Gitea for Linux ARM64, with recommended build tags:
|
||||||
|
|
||||||
|
```
|
||||||
|
CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `CC`, `GOOS`, and `GOARCH` as appropriate for your architecture target.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
date: "2016-12-01T16:00:00+02:00"
|
date: "2020-03-19T19:27:00+02:00"
|
||||||
title: "Installation with Docker"
|
title: "Installation with Docker"
|
||||||
slug: "install-with-docker"
|
slug: "install-with-docker"
|
||||||
weight: 10
|
weight: 10
|
||||||
@@ -34,7 +34,7 @@ Also be aware that the tag `:latest` will install the current development versio
|
|||||||
For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`.
|
For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "2"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -43,6 +43,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- USER_UID=1000
|
- USER_UID=1000
|
||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
@@ -65,7 +66,7 @@ the port section. It's common to just change the host port and keep the ports wi
|
|||||||
the container like they are.
|
the container like they are.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
version: "2"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -74,6 +75,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- USER_UID=1000
|
- USER_UID=1000
|
||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
@@ -97,7 +99,7 @@ To start Gitea in combination with a MySQL database, apply these changes to the
|
|||||||
`docker-compose.yml` file created above.
|
`docker-compose.yml` file created above.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
version: "2"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -106,6 +108,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- USER_UID=1000
|
- USER_UID=1000
|
||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
@@ -147,7 +150,7 @@ To start Gitea in combination with a PostgreSQL database, apply these changes to
|
|||||||
the `docker-compose.yml` file created above.
|
the `docker-compose.yml` file created above.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
version: "2"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -156,6 +159,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- USER_UID=1000
|
- USER_UID=1000
|
||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
@@ -198,7 +202,7 @@ create the required volume. You don't need to worry about permissions with
|
|||||||
named volumes; Docker will deal with that automatically.
|
named volumes; Docker will deal with that automatically.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
version: "2"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
@@ -211,6 +215,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
@@ -253,7 +258,8 @@ You can configure some of Gitea's settings via environment variables:
|
|||||||
|
|
||||||
* `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
|
* `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
|
||||||
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
|
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
|
||||||
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
|
* `DOMAIN`: **localhost**: Domain name of this server, used for the displayed http clone URL in Gitea's UI.
|
||||||
|
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed ssh clone URL in Gitea's UI. If the install page is enabled, SSH Domain Server takes DOMAIN value in the form (which overwrite this setting on save).
|
||||||
* `SSH_PORT`: **22**: SSH port displayed in clone URL.
|
* `SSH_PORT`: **22**: SSH port displayed in clone URL.
|
||||||
* `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
|
* `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
|
||||||
* `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
|
* `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
|
||||||
@@ -305,9 +311,12 @@ UID/GID as the container values `USER_UID`/`USER_GID`. You should also create th
|
|||||||
`/var/lib/gitea` on the host, owned by the `git` user and mounted in the container, e.g.
|
`/var/lib/gitea` on the host, owned by the `git` user and mounted in the container, e.g.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- USER_UID=1000
|
- USER_UID=1000
|
||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
@@ -340,7 +349,9 @@ Your `git` user needs to have an SSH key generated:
|
|||||||
sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key"
|
sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key"
|
||||||
```
|
```
|
||||||
|
|
||||||
Still on the host, symlink the container `.ssh/authorized_keys` file to your git user `.ssh/authorized_keys`.
|
Now, proceed with one of the points given below:
|
||||||
|
|
||||||
|
- symlink the container `.ssh/authorized_keys` file to your git user `.ssh/authorized_keys`.
|
||||||
This can be done on the host as the `/var/lib/gitea` directory is mounted inside the container under `/data`:
|
This can be done on the host as the `/var/lib/gitea` directory is mounted inside the container under `/data`:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -353,6 +364,23 @@ Then echo the `git` user SSH key into the authorized_keys file so the host can t
|
|||||||
echo "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty $(cat /home/git/.ssh/id_rsa.pub)" >> /var/lib/gitea/git/.ssh/authorized_keys
|
echo "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty $(cat /home/git/.ssh/id_rsa.pub)" >> /var/lib/gitea/git/.ssh/authorized_keys
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Lastly, Gitea makes `authorized_keys` backups by default. This could be a problem
|
||||||
|
as the symbolic link made to `authorized_keys` previously could end up pointing
|
||||||
|
to an old backup. To resolve this, please put the following into your Gitea
|
||||||
|
config:
|
||||||
|
|
||||||
|
```
|
||||||
|
[ssh]
|
||||||
|
SSH_BACKUP_AUTHORIZED_KEYS=false
|
||||||
|
```
|
||||||
|
|
||||||
|
- mount your `.ssh` directory directly into the container i.e. add the
|
||||||
|
following to the `volumes` section of your Docker container config:
|
||||||
|
|
||||||
|
```
|
||||||
|
- /home/git/.ssh/:/data/git/.ssh/
|
||||||
|
```
|
||||||
|
|
||||||
Now you should be able to use Git over SSH to your container without disrupting SSH access to the host.
|
Now you should be able to use Git over SSH to your container without disrupting SSH access to the host.
|
||||||
|
|
||||||
Please note: SSH container passthrough will work only if using opensshd in container, and will not work if
|
Please note: SSH container passthrough will work only if using opensshd in container, and will not work if
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ mv custom/conf/app.ini /etc/gitea/conf/app.ini # or mv app.ini /etc/gitea/conf/a
|
|||||||
unzip gitea-repo.zip
|
unzip gitea-repo.zip
|
||||||
mv gitea-repo/* /var/lib/gitea/repositories/
|
mv gitea-repo/* /var/lib/gitea/repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
||||||
mysql -u$USER -p$PASS $DATABASE <gitea-db.sql
|
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||||
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||||
service gitea restart
|
service gitea restart
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ mv custom/conf/app.ini /etc/gitea/conf/app.ini
|
|||||||
unzip gitea-repo.zip
|
unzip gitea-repo.zip
|
||||||
mv gitea-repo/* /var/lib/gitea/repositories/
|
mv gitea-repo/* /var/lib/gitea/repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
||||||
mysql -u$USER -p$PASS $DATABASE <gitea-db.sql
|
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||||
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||||
service gitea restart
|
service gitea restart
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ Starts the server:
|
|||||||
- Examples:
|
- Examples:
|
||||||
- `gitea web`
|
- `gitea web`
|
||||||
- `gitea web --port 80`
|
- `gitea web --port 80`
|
||||||
- `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid`
|
- `gitea web --config /etc/gitea.ini --pid /some/custom/gitea.pid`
|
||||||
- Notes:
|
- Notes:
|
||||||
- Gitea should not be run as root. To bind to a port below 1024, you can use setcap on
|
- Gitea should not be run as root. To bind to a port below 1024, you can use setcap on
|
||||||
Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be
|
Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be
|
||||||
@@ -318,3 +318,115 @@ var checklist = []check{
|
|||||||
```
|
```
|
||||||
|
|
||||||
This function will receive a command line context and return a list of details about the problems or error.
|
This function will receive a command line context and return a list of details about the problems or error.
|
||||||
|
|
||||||
|
##### doctor recreate-table
|
||||||
|
|
||||||
|
Sometimes when there are migrations the old columns and default values may be left
|
||||||
|
unchanged in the database schema. This may lead to warning such as:
|
||||||
|
|
||||||
|
```
|
||||||
|
2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0
|
||||||
|
```
|
||||||
|
|
||||||
|
You can cause Gitea to recreate these tables and copy the old data into the new table
|
||||||
|
with the defaults set appropriately by using:
|
||||||
|
|
||||||
|
```
|
||||||
|
gitea doctor recreate-table user
|
||||||
|
```
|
||||||
|
|
||||||
|
You can ask gitea to recreate multiple tables using:
|
||||||
|
|
||||||
|
```
|
||||||
|
gitea doctor recreate-table table1 table2 ...
|
||||||
|
```
|
||||||
|
|
||||||
|
And if you would like Gitea to recreate all tables simply call:
|
||||||
|
|
||||||
|
```
|
||||||
|
gitea doctor recreate-table
|
||||||
|
```
|
||||||
|
|
||||||
|
It is highly recommended to back-up your database before running these commands.
|
||||||
|
|
||||||
|
#### manager
|
||||||
|
|
||||||
|
Manage running server operations:
|
||||||
|
|
||||||
|
- Commands:
|
||||||
|
- `shutdown`: Gracefully shutdown the running process
|
||||||
|
- `restart`: Gracefully restart the running process - (not implemented for windows servers)
|
||||||
|
- `flush-queues`: Flush queues in the running process
|
||||||
|
- Options:
|
||||||
|
- `--timeout value`: Timeout for the flushing process (default: 1m0s)
|
||||||
|
- `--non-blocking`: Set to true to not wait for flush to complete before returning
|
||||||
|
- `logging`: Adjust logging commands
|
||||||
|
- Commands:
|
||||||
|
- `pause`: Pause logging
|
||||||
|
- Notes:
|
||||||
|
- The logging level will be raised to INFO temporarily if it is below this level.
|
||||||
|
- Gitea will buffer logs up to a certain point and will drop them after that point.
|
||||||
|
- `resume`: Resume logging
|
||||||
|
- `release-and-reopen`: Cause Gitea to release and re-open files and connections used for logging (Equivalent to sending SIGUSR1 to Gitea.)
|
||||||
|
- `remove name`: Remove the named logger
|
||||||
|
- Options:
|
||||||
|
- `--group group`, `-g group`: Set the group to remove the sublogger from. (defaults to `default`)
|
||||||
|
- `add`: Add a logger
|
||||||
|
- Commands:
|
||||||
|
- `console`: Add a console logger
|
||||||
|
- Options:
|
||||||
|
- `--group value`, `-g value`: Group to add logger to - will default to "default"
|
||||||
|
- `--name value`, `-n value`: Name of the new logger - will default to mode
|
||||||
|
- `--level value`, `-l value`: Logging level for the new logger
|
||||||
|
- `--stacktrace-level value`, `-L value`: Stacktrace logging level
|
||||||
|
- `--flags value`, `-F value`: Flags for the logger
|
||||||
|
- `--expression value`, `-e value`: Matching expression for the logger
|
||||||
|
- `--prefix value`, `-p value`: Prefix for the logger
|
||||||
|
- `--color`: Use color in the logs
|
||||||
|
- `--stderr`: Output console logs to stderr - only relevant for console
|
||||||
|
- `file`: Add a file logger
|
||||||
|
- Options:
|
||||||
|
- `--group value`, `-g value`: Group to add logger to - will default to "default"
|
||||||
|
- `--name value`, `-n value`: Name of the new logger - will default to mode
|
||||||
|
- `--level value`, `-l value`: Logging level for the new logger
|
||||||
|
- `--stacktrace-level value`, `-L value`: Stacktrace logging level
|
||||||
|
- `--flags value`, `-F value`: Flags for the logger
|
||||||
|
- `--expression value`, `-e value`: Matching expression for the logger
|
||||||
|
- `--prefix value`, `-p value`: Prefix for the logger
|
||||||
|
- `--color`: Use color in the logs
|
||||||
|
- `--filename value`, `-f value`: Filename for the logger -
|
||||||
|
- `--rotate`, `-r`: Rotate logs
|
||||||
|
- `--max-size value`, `-s value`: Maximum size in bytes before rotation
|
||||||
|
- `--daily`, `-d`: Rotate logs daily
|
||||||
|
- `--max-days value`, `-D value`: Maximum number of daily logs to keep
|
||||||
|
- `--compress`, `-z`: Compress rotated logs
|
||||||
|
- `--compression-level value`, `-Z value`: Compression level to use
|
||||||
|
- `conn`: Add a network connection logger
|
||||||
|
- Options:
|
||||||
|
- `--group value`, `-g value`: Group to add logger to - will default to "default"
|
||||||
|
- `--name value`, `-n value`: Name of the new logger - will default to mode
|
||||||
|
- `--level value`, `-l value`: Logging level for the new logger
|
||||||
|
- `--stacktrace-level value`, `-L value`: Stacktrace logging level
|
||||||
|
- `--flags value`, `-F value`: Flags for the logger
|
||||||
|
- `--expression value`, `-e value`: Matching expression for the logger
|
||||||
|
- `--prefix value`, `-p value`: Prefix for the logger
|
||||||
|
- `--color`: Use color in the logs
|
||||||
|
- `--reconnect-on-message`, `-R`: Reconnect to host for every message
|
||||||
|
- `--reconnect`, `-r`: Reconnect to host when connection is dropped
|
||||||
|
- `--protocol value`, `-P value`: Set protocol to use: tcp, unix, or udp (defaults to tcp)
|
||||||
|
- `--address value`, `-a value`: Host address and port to connect to (defaults to :7020)
|
||||||
|
- `smtp`: Add an SMTP logger
|
||||||
|
- Options:
|
||||||
|
- `--group value`, `-g value`: Group to add logger to - will default to "default"
|
||||||
|
- `--name value`, `-n value`: Name of the new logger - will default to mode
|
||||||
|
- `--level value`, `-l value`: Logging level for the new logger
|
||||||
|
- `--stacktrace-level value`, `-L value`: Stacktrace logging level
|
||||||
|
- `--flags value`, `-F value`: Flags for the logger
|
||||||
|
- `--expression value`, `-e value`: Matching expression for the logger
|
||||||
|
- `--prefix value`, `-p value`: Prefix for the logger
|
||||||
|
- `--color`: Use color in the logs
|
||||||
|
- `--username value`, `-u value`: Mail server username
|
||||||
|
- `--password value`, `-P value`: Mail server password
|
||||||
|
- `--host value`, `-H value`: Mail server host (defaults to: 127.0.0.1:25)
|
||||||
|
- `--send-to value`, `-s value`: Email address(es) to send to
|
||||||
|
- `--subject value`, `-S value`: Subject header of sent emails
|
||||||
|
|||||||
@@ -15,19 +15,55 @@ menu:
|
|||||||
|
|
||||||
# Email setup
|
# Email setup
|
||||||
|
|
||||||
- To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section:
|
To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section:
|
||||||
|
|
||||||
|
## Sendmail version
|
||||||
|
Use the operating system’s sendmail command instead of SMTP. This is common on Linux servers.
|
||||||
|
Note: For use in the official Gitea Docker image, please configure with the SMTP version.
|
||||||
```ini
|
```ini
|
||||||
[mailer]
|
[mailer]
|
||||||
ENABLED = true
|
ENABLED = true
|
||||||
HOST = mail.mydomain.com:587
|
FROM = gitea@mydomain.com
|
||||||
FROM = gitea@mydomain.com
|
MAILER_TYPE = sendmail
|
||||||
USER = gitea@mydomain.com
|
SENDMAIL_PATH = /usr/sbin/sendmail
|
||||||
PASSWD = `password`
|
```
|
||||||
|
|
||||||
|
## SMTP version
|
||||||
|
```ini
|
||||||
|
[mailer]
|
||||||
|
ENABLED = true
|
||||||
|
FROM = gitea@mydomain.com
|
||||||
|
MAILER_TYPE = smtp
|
||||||
|
HOST = mail.mydomain.com:587
|
||||||
|
IS_TLS_ENABLED = true
|
||||||
|
USER = gitea@mydomain.com
|
||||||
|
PASSWD = `password`
|
||||||
```
|
```
|
||||||
|
|
||||||
- Restart Gitea for the configuration changes to take effect.
|
- Restart Gitea for the configuration changes to take effect.
|
||||||
|
|
||||||
- To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
|
- To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
|
||||||
|
|
||||||
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
|
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
|
||||||
|
|
||||||
|
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
|
||||||
|
- Via the server supporting TLS through STARTTLS - usually provided on port 587. (Also known as Opportunistic TLS.)
|
||||||
|
- SMTPS connection (SMTP over transport layer security) via the default port 465.
|
||||||
|
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
|
||||||
|
- This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
|
||||||
|
|
||||||
|
### Gmail
|
||||||
|
|
||||||
|
The following configuration should work with GMail's SMTP server:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[mailer]
|
||||||
|
ENABLED = true
|
||||||
|
HOST = smtp.gmail.com:465
|
||||||
|
FROM = example@gmail.com
|
||||||
|
USER = example@gmail.com
|
||||||
|
PASSWD = ***
|
||||||
|
MAILER_TYPE = smtp
|
||||||
|
IS_TLS_ENABLED = true
|
||||||
|
HELO_HOSTNAME = example.com
|
||||||
|
```
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ HTTP_PORT = 3000
|
|||||||
CERT_FILE = cert.pem
|
CERT_FILE = cert.pem
|
||||||
KEY_FILE = key.pem
|
KEY_FILE = key.pem
|
||||||
```
|
```
|
||||||
|
Note that if your certificate is signed by a third party certificate authority (i.e. not self-signed), then cert.pem should contain the certificate chain. The server certificate must be the first entry in cert.pem, followed by the intermediaries in order (if any). The root certificate does not have to be included because the connecting client must already have it in order to estalbish the trust relationship.
|
||||||
To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
|
To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
|
||||||
|
|
||||||
### Setting up HTTP redirection
|
### Setting up HTTP redirection
|
||||||
|
|||||||
@@ -41,4 +41,39 @@ Possible file names for PR templates:
|
|||||||
* .github/pull_request_template.md
|
* .github/pull_request_template.md
|
||||||
|
|
||||||
|
|
||||||
Additionally, the New Issue page URL can be suffixed with `?body=Issue+Text` and the form will be populated with that string. This string will be used instead of the template if there is one.
|
Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one.
|
||||||
|
|
||||||
|
# Issue Template Directory
|
||||||
|
|
||||||
|
Alternatively, users can create multiple issue templates inside a special directory and allow users to choose one that more specifically
|
||||||
|
addresses their problem.
|
||||||
|
|
||||||
|
Possible directory names for issue templates:
|
||||||
|
|
||||||
|
* ISSUE_TEMPLATE
|
||||||
|
* issue_template
|
||||||
|
* .gitea/ISSUE_TEMPLATE
|
||||||
|
* .gitea/issue_template
|
||||||
|
* .github/ISSUE_TEMPLATE
|
||||||
|
* .github/issue_template
|
||||||
|
* .gitlab/ISSUE_TEMPLATE
|
||||||
|
* .gitlab/issue_template
|
||||||
|
|
||||||
|
Inside the directory can be multiple issue templates with the form
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
-----
|
||||||
|
name: "Template Name"
|
||||||
|
about: "This template is for testing!"
|
||||||
|
title: "[TEST] "
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
- "help needed"
|
||||||
|
-----
|
||||||
|
This is the template!
|
||||||
|
```
|
||||||
|
|
||||||
|
In the above example, when a user is presented with the list of issues they can submit, this would show as `Template Name` with the description
|
||||||
|
`This template is for testing!`. When submitting an issue with the above example, the issue title would be pre-populated with
|
||||||
|
`[TEST] ` while the issue body would be pre-populated with `This is the template!`. The issue would also be assigned two labels,
|
||||||
|
`bug` and `help needed`.
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ Example:
|
|||||||
This is also valid for teams and organizations:
|
This is also valid for teams and organizations:
|
||||||
|
|
||||||
> [@Documenters](#), we need to plan for this.
|
> [@Documenters](#), we need to plan for this.
|
||||||
|
|
||||||
> [@CoolCompanyInc](#), this issue concerns us all!
|
> [@CoolCompanyInc](#), this issue concerns us all!
|
||||||
|
|
||||||
Teams will receive mail notifications when appropriate, but whole organizations won't.
|
Teams will receive mail notifications when appropriate, but whole organizations won't.
|
||||||
@@ -123,6 +122,33 @@ The default _keywords_ are:
|
|||||||
* **Closing**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved
|
* **Closing**: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved
|
||||||
* **Reopening**: reopen, reopens, reopened
|
* **Reopening**: reopen, reopens, reopened
|
||||||
|
|
||||||
|
## Time tracking in Pull Requests and Commit Messages
|
||||||
|
|
||||||
|
When commit or merging of pull request results in automatic closing of issue
|
||||||
|
it is possible to also add spent time resolving this issue through commit message.
|
||||||
|
|
||||||
|
To specify spent time on resolving issue you need to specify time in format
|
||||||
|
`@<number><time-unit>` after issue number. In one commit message you can specify
|
||||||
|
multiple fixed issues and spent time for each of them.
|
||||||
|
|
||||||
|
Supported time units (`<time-unit>`):
|
||||||
|
|
||||||
|
* `m` - minutes
|
||||||
|
* `h` - hours
|
||||||
|
* `d` - days (equals to 8 hours)
|
||||||
|
* `w` - weeks (equals to 5 days)
|
||||||
|
* `mo` - months (equals to 4 weeks)
|
||||||
|
|
||||||
|
Numbers to specify time (`<number>`) can be also decimal numbers, ex. `@1.5h` would
|
||||||
|
result in one and half hours. Multiple time units can be combined, ex. `@1h10m` would
|
||||||
|
mean 1 hour and 10 minutes.
|
||||||
|
|
||||||
|
Example of commit message:
|
||||||
|
|
||||||
|
> Fixed #123 spent @1h, refs #102, fixes #124 @1.5h
|
||||||
|
|
||||||
|
This would result in 1 hour added to issue #123 and 1 and half hours added to issue #124.
|
||||||
|
|
||||||
## External Trackers
|
## External Trackers
|
||||||
|
|
||||||
Gitea supports the use of external issue trackers, and references to issues
|
Gitea supports the use of external issue trackers, and references to issues
|
||||||
@@ -132,7 +158,6 @@ the pull requests hosted in Gitea. To address this, Gitea allows the use of
|
|||||||
the `!` marker to identify pull requests. For example:
|
the `!` marker to identify pull requests. For example:
|
||||||
|
|
||||||
> This is issue [#1234](#), and links to the external tracker.
|
> This is issue [#1234](#), and links to the external tracker.
|
||||||
|
|
||||||
> This is pull request [!1234](#), and links to a pull request in Gitea.
|
> This is pull request [!1234](#), and links to a pull request in Gitea.
|
||||||
|
|
||||||
The `!` and `#` can be used interchangeably for issues and pull request _except_
|
The `!` and `#` can be used interchangeably for issues and pull request _except_
|
||||||
|
|||||||
31
docs/content/doc/usage/push-options.en-us.md
Normal file
31
docs/content/doc/usage/push-options.en-us.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
date: "2020-07-06T16:00:00+02:00"
|
||||||
|
title: "Usage: Push Options"
|
||||||
|
slug: "push-options"
|
||||||
|
weight: 15
|
||||||
|
toc: true
|
||||||
|
draft: false
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "usage"
|
||||||
|
name: "Push Options"
|
||||||
|
weight: 15
|
||||||
|
identifier: "push-options"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Push Options
|
||||||
|
|
||||||
|
In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
|
||||||
|
were added.
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Options
|
||||||
|
|
||||||
|
- `repo.private` (true|false) - Change the repository's visibility.
|
||||||
|
This is particularly useful when combined with push-to-create.
|
||||||
|
- `repo.template` (true|false) - Change whether the repository is a template.
|
||||||
|
|
||||||
|
Example of changing a repository's visibility to public:
|
||||||
|
```shell
|
||||||
|
git push -o repo.private=false -u origin master
|
||||||
|
```
|
||||||
@@ -55,7 +55,7 @@ Nginx is optimized for serving static content, while the proxying of large respo
|
|||||||
(see https://serverfault.com/q/587386).
|
(see https://serverfault.com/q/587386).
|
||||||
|
|
||||||
Download a snapshot of the Gitea source repository to `/path/to/gitea/`.
|
Download a snapshot of the Gitea source repository to `/path/to/gitea/`.
|
||||||
After this, run `make webpack` in the repository directory to generate the static resources. We are only interested in the `public/` directory for this task, so you can delete the rest.
|
After this, run `make frontend` in the repository directory to generate the static resources. We are only interested in the `public/` directory for this task, so you can delete the rest.
|
||||||
(You will need to have [Node with npm](https://nodejs.org/en/download/) and `make` installed to generate the static resources)
|
(You will need to have [Node with npm](https://nodejs.org/en/download/) and `make` installed to generate the static resources)
|
||||||
|
|
||||||
Depending on the scale of your user base, you might want to split the traffic to two distinct servers,
|
Depending on the scale of your user base, you might want to split the traffic to two distinct servers,
|
||||||
@@ -159,7 +159,15 @@ If you want Caddy to serve your Gitea instance, you can add the following server
|
|||||||
|
|
||||||
```
|
```
|
||||||
git.example.com {
|
git.example.com {
|
||||||
proxy / http://localhost:3000
|
reverse_proxy localhost:3000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you still use Caddy v1, use:
|
||||||
|
|
||||||
|
```
|
||||||
|
git.example.com {
|
||||||
|
proxy / localhost:3000
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -169,8 +177,75 @@ In case you already have a site, and you want Gitea to share the domain name, yo
|
|||||||
|
|
||||||
```
|
```
|
||||||
git.example.com {
|
git.example.com {
|
||||||
proxy /git/ http://localhost:3000 # Note: Trailing Slash after /git/
|
route /git/* {
|
||||||
|
uri strip_prefix /git
|
||||||
|
reverse_proxy localhost:3000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Or, for Caddy v1:
|
||||||
|
|
||||||
|
```
|
||||||
|
git.example.com {
|
||||||
|
proxy /git/ localhost:3000
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration.
|
Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration.
|
||||||
|
|
||||||
|
## Using IIS as a reverse proxy
|
||||||
|
|
||||||
|
If you wish to run Gitea with IIS. You will need to setup IIS with URL Rewrite as reverse proxy.
|
||||||
|
|
||||||
|
1. Setup an empty website in IIS, named let's say, `Gitea Proxy`.
|
||||||
|
2. Follow the first two steps in [Microsoft's Technical Community Guide to Setup IIS with URL Rewrite](https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222#M343). That is:
|
||||||
|
- Install Application Request Routing (ARR for short) either by using the Microsoft Web Platform Installer 5.1 (WebPI) or downloading the extension from [IIS.net]( https://www.iis.net/downloads/microsoft/application-request-routing)
|
||||||
|
- Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console called URL Rewrite.
|
||||||
|
- Open the IIS Manager Console and click on the `Gitea Proxy` Website from the tree view on the left. Select and double click the URL Rewrite Icon from the middle pane to load the URL Rewrite interface.
|
||||||
|
- Choose the `Add Rule` action from the right pane of the management console and select the `Reverse Proxy Rule` from the `Inbound and Outbound Rules` category.
|
||||||
|
- In the Inbound Rules section, set the server name to be the host that Gitea is running on with its port. e.g. if you are running Gitea on the localhost with port 3000, the following should work: `127.0.0.1:3000`
|
||||||
|
- Enable SSL Offloading
|
||||||
|
- In the Outbound Rules, ensure `Rewrite the domain names of the links in HTTP response` is set and set the `From:` field as above and the `To:` to your external hostname, say: `git.example.com`
|
||||||
|
- Now edit the `web.config` for your website to match the following: (changing `127.0.0.1:3000` and `git.example.com` as appropriate)
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<rewrite>
|
||||||
|
<rules>
|
||||||
|
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
|
||||||
|
<match url="(.*)" />
|
||||||
|
<action type="Rewrite" url="http://127.0.0.1:3000/{R:1}" />
|
||||||
|
<serverVariables>
|
||||||
|
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="HTTP_ACCEPT_ENCODING" />
|
||||||
|
<set name="HTTP_ACCEPT_ENCODING" value="" />
|
||||||
|
</serverVariables>
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
<outboundRules>
|
||||||
|
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
|
||||||
|
<!-- set the pattern correctly here - if you only want to accept http or https -->
|
||||||
|
<!-- change the pattern and the action value as appropriate -->
|
||||||
|
<match filterByTags="A, Form, Img" pattern="^http(s)?://127.0.0.1:3000/(.*)" />
|
||||||
|
<action type="Rewrite" value="http{R:1}://git.example.com/{R:2}" />
|
||||||
|
</rule>
|
||||||
|
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
|
||||||
|
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
|
||||||
|
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
|
||||||
|
</rule>
|
||||||
|
<preConditions>
|
||||||
|
<preCondition name="ResponseIsHtml1">
|
||||||
|
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
|
||||||
|
</preCondition>
|
||||||
|
<preCondition name="NeedsRestoringAcceptEncoding">
|
||||||
|
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
|
||||||
|
</preCondition>
|
||||||
|
</preConditions>
|
||||||
|
</outboundRules>
|
||||||
|
</rewrite>
|
||||||
|
<urlCompression doDynamicCompression="true" />
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
||||||
|
```
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
|
|||||||
- MSSQL
|
- MSSQL
|
||||||
- TiDB (experimental, not recommended)
|
- TiDB (experimental, not recommended)
|
||||||
- Configuration file
|
- Configuration file
|
||||||
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
- Admin panel
|
- Admin panel
|
||||||
- Statistics
|
- Statistics
|
||||||
- Actions
|
- Actions
|
||||||
@@ -128,6 +128,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
|
|||||||
- Environment variables
|
- Environment variables
|
||||||
- Command line options
|
- Command line options
|
||||||
- Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/master/options/locale))
|
- Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/master/options/locale))
|
||||||
|
- [Mermaid](https://mermaidjs.github.io/) Diagram support
|
||||||
- Mail service
|
- Mail service
|
||||||
- Notifications
|
- Notifications
|
||||||
- Registration confirmation
|
- Registration confirmation
|
||||||
@@ -261,7 +262,8 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
|
|||||||
|
|
||||||
## Browser Support
|
## Browser Support
|
||||||
|
|
||||||
- Please see [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) for specific versions of supported browsers.
|
- Last 2 versions of Chrome, Firefox, Safari, Edge (EdgeHTML) and Edge (Chromium)
|
||||||
|
- Firefox ESR
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
@@ -274,9 +276,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
|
|||||||
* [DropzoneJS](http://www.dropzonejs.com/)
|
* [DropzoneJS](http://www.dropzonejs.com/)
|
||||||
* [Highlight](https://highlightjs.org/)
|
* [Highlight](https://highlightjs.org/)
|
||||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
||||||
* [Emojify](https://github.com/Ranks/emojify.js)
|
|
||||||
* [CodeMirror](https://codemirror.net/)
|
* [CodeMirror](https://codemirror.net/)
|
||||||
* [jQuery Date Time Picker](https://github.com/xdan/datetimepicker)
|
|
||||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
||||||
* Database drivers:
|
* Database drivers:
|
||||||
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
|
|||||||
- MSSQL
|
- MSSQL
|
||||||
- [TiDB](https://github.com/pingcap/tidb) (expérimental)
|
- [TiDB](https://github.com/pingcap/tidb) (expérimental)
|
||||||
- Fichier de configuration
|
- Fichier de configuration
|
||||||
- Voir [ici](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample)
|
- Voir [ici](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
- Panel d'administration
|
- Panel d'administration
|
||||||
- Statistiques
|
- Statistiques
|
||||||
- Actions
|
- Actions
|
||||||
@@ -263,9 +263,7 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
|
|||||||
* [DropzoneJS](http://www.dropzonejs.com/)
|
* [DropzoneJS](http://www.dropzonejs.com/)
|
||||||
* [Highlight](https://highlightjs.org/)
|
* [Highlight](https://highlightjs.org/)
|
||||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
||||||
* [Emojify](https://github.com/Ranks/emojify.js)
|
|
||||||
* [CodeMirror](https://codemirror.net/)
|
* [CodeMirror](https://codemirror.net/)
|
||||||
* [jQuery Date Time Picker](https://github.com/xdan/datetimepicker)
|
|
||||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
||||||
* Connecteurs de base de données :
|
* Connecteurs de base de données :
|
||||||
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||||
|
|||||||
@@ -56,9 +56,7 @@ Gitea的首要目标是创建一个极易安装,运行非常快速,安装和
|
|||||||
* [DropzoneJS](http://www.dropzonejs.com/)
|
* [DropzoneJS](http://www.dropzonejs.com/)
|
||||||
* [Highlight](https://highlightjs.org/)
|
* [Highlight](https://highlightjs.org/)
|
||||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
||||||
* [Emojify](https://github.com/Ranks/emojify.js)
|
|
||||||
* [CodeMirror](https://codemirror.net/)
|
* [CodeMirror](https://codemirror.net/)
|
||||||
* [jQuery Date Time Picker](https://github.com/xdan/datetimepicker)
|
|
||||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
||||||
* 数据库驱动:
|
* 数据库驱动:
|
||||||
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||||
|
|||||||
@@ -56,9 +56,7 @@ Gitea 的首要目標是建立一個容易安裝,運行快速,安装和使
|
|||||||
* [DropzoneJS](http://www.dropzonejs.com/)
|
* [DropzoneJS](http://www.dropzonejs.com/)
|
||||||
* [Highlight](https://highlightjs.org/)
|
* [Highlight](https://highlightjs.org/)
|
||||||
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
* [Clipboard](https://zenorocha.github.io/clipboard.js/)
|
||||||
* [Emojify](https://github.com/Ranks/emojify.js)
|
|
||||||
* [CodeMirror](https://codemirror.net/)
|
* [CodeMirror](https://codemirror.net/)
|
||||||
* [jQuery Date Time Picker](https://github.com/xdan/datetimepicker)
|
|
||||||
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
* [jQuery MiniColors](https://github.com/claviska/jquery-minicolors)
|
||||||
* 資料庫:
|
* 資料庫:
|
||||||
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
* [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
|
||||||
|
|||||||
128
go.mod
128
go.mod
@@ -1,120 +1,126 @@
|
|||||||
module code.gitea.io/gitea
|
module code.gitea.io/gitea
|
||||||
|
|
||||||
go 1.13
|
go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.45.0 // indirect
|
code.gitea.io/gitea-vet v0.2.1
|
||||||
gitea.com/lunny/levelqueue v0.2.0
|
code.gitea.io/sdk/gitea v0.13.1
|
||||||
|
gitea.com/lunny/levelqueue v0.3.0
|
||||||
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b
|
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b
|
||||||
gitea.com/macaron/cache v0.0.0-20190822004001-a6e7fee4ee76
|
gitea.com/macaron/cache v0.0.0-20190822004001-a6e7fee4ee76
|
||||||
gitea.com/macaron/captcha v0.0.0-20190822015246-daa973478bae
|
gitea.com/macaron/captcha v0.0.0-20190822015246-daa973478bae
|
||||||
gitea.com/macaron/cors v0.0.0-20190826180238-95aec09ea8b4
|
gitea.com/macaron/cors v0.0.0-20190826180238-95aec09ea8b4
|
||||||
gitea.com/macaron/csrf v0.0.0-20190822024205-3dc5a4474439
|
gitea.com/macaron/csrf v0.0.0-20190822024205-3dc5a4474439
|
||||||
gitea.com/macaron/gzip v0.0.0-20191118041502-506895b47aae
|
gitea.com/macaron/gzip v0.0.0-20200827120000-efa5e8477cf5
|
||||||
gitea.com/macaron/i18n v0.0.0-20190822004228-474e714e2223
|
gitea.com/macaron/i18n v0.0.0-20200910171939-7bbf54aa4c76
|
||||||
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a
|
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a
|
||||||
gitea.com/macaron/macaron v1.4.0
|
gitea.com/macaron/macaron v1.5.0
|
||||||
gitea.com/macaron/session v0.0.0-20191207215012-613cebf0674d
|
gitea.com/macaron/session v0.0.0-20200902202411-e3a87877db6e
|
||||||
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7
|
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7
|
||||||
github.com/PuerkitoBio/goquery v1.5.0
|
github.com/PuerkitoBio/goquery v1.5.1
|
||||||
github.com/RoaringBitmap/roaring v0.4.21 // indirect
|
github.com/alecthomas/chroma v0.8.0
|
||||||
github.com/bgentry/speakeasy v0.1.0 // indirect
|
github.com/blevesearch/bleve v1.0.10
|
||||||
github.com/blevesearch/bleve v0.8.1
|
|
||||||
github.com/blevesearch/blevex v0.0.0-20180227211930-4b158bb555a3 // indirect
|
|
||||||
github.com/blevesearch/go-porterstemmer v1.0.2 // indirect
|
|
||||||
github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect
|
|
||||||
github.com/boombuler/barcode v0.0.0-20161226211916-fe0f26ff6d26 // indirect
|
|
||||||
github.com/couchbase/gomemcached v0.0.0-20191004160342-7b5da2ec40b2 // indirect
|
github.com/couchbase/gomemcached v0.0.0-20191004160342-7b5da2ec40b2 // indirect
|
||||||
github.com/couchbase/vellum v0.0.0-20190829182332-ef2e028c01fd // indirect
|
|
||||||
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d // indirect
|
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d // indirect
|
||||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||||
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 // indirect
|
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 // indirect
|
||||||
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73
|
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
|
||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
||||||
|
github.com/dlclark/regexp2 v1.2.1 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1
|
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1
|
||||||
github.com/emirpasic/gods v1.12.0
|
github.com/emirpasic/gods v1.12.0
|
||||||
github.com/etcd-io/bbolt v1.3.3 // indirect
|
|
||||||
github.com/ethantkoenig/rupture v0.0.0-20180203182544-0a76f03a811a
|
github.com/ethantkoenig/rupture v0.0.0-20180203182544-0a76f03a811a
|
||||||
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect
|
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect
|
||||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
||||||
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
|
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
|
||||||
github.com/gliderlabs/ssh v0.2.2
|
github.com/gliderlabs/ssh v0.2.2
|
||||||
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a // indirect
|
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a // indirect
|
||||||
github.com/go-openapi/jsonreference v0.19.3 // indirect
|
github.com/go-enry/go-enry/v2 v2.5.2
|
||||||
github.com/go-redis/redis v6.15.2+incompatible
|
github.com/go-git/go-billy/v5 v5.0.0
|
||||||
github.com/go-sql-driver/mysql v1.4.1
|
github.com/go-git/go-git/v5 v5.1.0
|
||||||
github.com/go-swagger/go-swagger v0.21.0
|
github.com/go-redis/redis/v7 v7.4.0
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0
|
||||||
|
github.com/go-swagger/go-swagger v0.25.0
|
||||||
|
github.com/go-testfixtures/testfixtures/v3 v3.4.0
|
||||||
github.com/gobwas/glob v0.2.3
|
github.com/gobwas/glob v0.2.3
|
||||||
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
|
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
|
||||||
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
|
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
|
||||||
github.com/google/go-github/v24 v24.0.1
|
github.com/google/go-github/v32 v32.1.0
|
||||||
|
github.com/google/uuid v1.1.1
|
||||||
github.com/gorilla/context v1.1.1
|
github.com/gorilla/context v1.1.1
|
||||||
|
github.com/hashicorp/go-retryablehttp v0.6.7 // indirect
|
||||||
|
github.com/hashicorp/go-version v1.2.1
|
||||||
github.com/huandu/xstrings v1.3.0
|
github.com/huandu/xstrings v1.3.0
|
||||||
github.com/issue9/assert v1.3.2 // indirect
|
github.com/issue9/assert v1.3.2 // indirect
|
||||||
github.com/issue9/identicon v0.0.0-20160320065130-d36b54562f4c
|
github.com/issue9/identicon v1.0.1
|
||||||
github.com/jaytaylor/html2text v0.0.0-20160923191438-8fb95d837f7d
|
github.com/jaytaylor/html2text v0.0.0-20160923191438-8fb95d837f7d
|
||||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||||
github.com/joho/godotenv v1.3.0 // indirect
|
|
||||||
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
|
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
|
||||||
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
|
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
|
||||||
github.com/klauspost/compress v1.10.2
|
github.com/klauspost/compress v1.10.11
|
||||||
github.com/lafriks/xormstore v1.3.2
|
github.com/lafriks/xormstore v1.3.2
|
||||||
github.com/lib/pq v1.2.0
|
github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
|
||||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
|
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
|
||||||
github.com/mailru/easyjson v0.7.0 // indirect
|
|
||||||
github.com/markbates/goth v1.61.2
|
github.com/markbates/goth v1.61.2
|
||||||
github.com/mattn/go-isatty v0.0.7
|
github.com/mattn/go-colorable v0.1.7 // indirect
|
||||||
github.com/mattn/go-oci8 v0.0.0-20190320171441-14ba190cf52d // indirect
|
github.com/mattn/go-isatty v0.0.12
|
||||||
github.com/mattn/go-sqlite3 v1.11.0
|
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||||
github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75
|
github.com/mattn/go-sqlite3 v1.14.0
|
||||||
github.com/microcosm-cc/bluemonday v0.0.0-20161012083705-f77f16ffc87a
|
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81
|
||||||
|
github.com/mgechev/revive v1.0.3-0.20200921231451-246eac737dc7
|
||||||
|
github.com/mholt/archiver/v3 v3.3.0
|
||||||
|
github.com/microcosm-cc/bluemonday v1.0.3-0.20191119130333-0a75d7616912
|
||||||
|
github.com/minio/minio-go/v7 v7.0.4
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0
|
||||||
github.com/msteinert/pam v0.0.0-20151204160544-02ccfbfaf0cc
|
github.com/msteinert/pam v0.0.0-20151204160544-02ccfbfaf0cc
|
||||||
github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||||
github.com/niklasfasching/go-org v0.1.9
|
github.com/niklasfasching/go-org v1.3.2
|
||||||
github.com/oliamb/cutter v0.2.2
|
github.com/oliamb/cutter v0.2.2
|
||||||
github.com/olivere/elastic/v7 v7.0.9
|
github.com/olivere/elastic/v7 v7.0.9
|
||||||
github.com/pkg/errors v0.8.1
|
github.com/pelletier/go-toml v1.8.1
|
||||||
github.com/pquerna/otp v0.0.0-20160912161815-54653902c20e
|
github.com/pkg/errors v0.9.1
|
||||||
|
github.com/pquerna/otp v1.2.0
|
||||||
github.com/prometheus/client_golang v1.1.0
|
github.com/prometheus/client_golang v1.1.0
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
|
|
||||||
github.com/prometheus/procfs v0.0.4 // indirect
|
github.com/prometheus/procfs v0.0.4 // indirect
|
||||||
github.com/quasoft/websspi v1.0.0
|
github.com/quasoft/websspi v1.0.0
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/sergi/go-diff v1.1.0
|
||||||
github.com/sergi/go-diff v1.0.0
|
|
||||||
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
|
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
|
||||||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
|
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
|
||||||
github.com/src-d/enry/v2 v2.1.0
|
github.com/stretchr/testify v1.6.1
|
||||||
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
|
github.com/syndtr/goleveldb v1.0.0
|
||||||
github.com/stretchr/testify v1.4.0
|
|
||||||
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
|
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
|
||||||
|
github.com/tinylib/msgp v1.1.2 // indirect
|
||||||
github.com/tstranex/u2f v1.0.0
|
github.com/tstranex/u2f v1.0.0
|
||||||
github.com/unknwon/cae v1.0.0
|
|
||||||
github.com/unknwon/com v1.0.1
|
github.com/unknwon/com v1.0.1
|
||||||
github.com/unknwon/i18n v0.0.0-20190805065654-5c6446a380b6
|
github.com/unknwon/i18n v0.0.0-20200823051745-09abd91c7f2c
|
||||||
github.com/unknwon/paginater v0.0.0-20151104151617-7748a72e0141
|
github.com/unknwon/paginater v0.0.0-20151104151617-7748a72e0141
|
||||||
github.com/urfave/cli v1.20.0
|
github.com/urfave/cli v1.20.0
|
||||||
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
|
github.com/xanzy/go-gitlab v0.37.0
|
||||||
github.com/yuin/goldmark v1.1.25
|
github.com/yohcop/openid-go v1.0.0
|
||||||
go.etcd.io/bbolt v1.3.3 // indirect
|
github.com/yuin/goldmark v1.2.1
|
||||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d
|
github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691
|
||||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa
|
github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
go.jolheiser.com/hcaptcha v0.0.4
|
||||||
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c
|
go.jolheiser.com/pwn v0.0.3
|
||||||
golang.org/x/text v0.3.2
|
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
|
||||||
golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935 // indirect
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||||
|
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff
|
||||||
|
golang.org/x/text v0.3.3
|
||||||
|
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
|
||||||
|
golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||||
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
|
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
|
||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
||||||
gopkg.in/ini.v1 v1.52.0
|
gopkg.in/ini.v1 v1.61.0
|
||||||
gopkg.in/ldap.v3 v3.0.2
|
gopkg.in/ldap.v3 v3.0.2
|
||||||
gopkg.in/src-d/go-billy.v4 v4.3.2
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
gopkg.in/src-d/go-git.v4 v4.13.1
|
|
||||||
gopkg.in/testfixtures.v2 v2.5.0
|
|
||||||
mvdan.cc/xurls/v2 v2.1.0
|
mvdan.cc/xurls/v2 v2.1.0
|
||||||
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
|
||||||
xorm.io/builder v0.3.6
|
xorm.io/builder v0.3.7
|
||||||
xorm.io/core v0.7.3
|
xorm.io/xorm v1.0.5
|
||||||
xorm.io/xorm v0.8.2-0.20200120024500-c37aff9b3a4a
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.2.3
|
||||||
|
|||||||
@@ -70,3 +70,25 @@ For other databases(replace MSSQL to MYSQL, MYSQL8, PGSQL):
|
|||||||
```
|
```
|
||||||
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
|
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Setting timeouts for declaring long-tests and long-flushes
|
||||||
|
|
||||||
|
We appreciate that some testing machines may not be very powerful and
|
||||||
|
the default timeouts for declaring a slow test or a slow clean-up flush
|
||||||
|
may not be appropriate.
|
||||||
|
|
||||||
|
You can either:
|
||||||
|
|
||||||
|
* Within the test ini file set the following section:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[integration-tests]
|
||||||
|
SLOW_TEST = 10s ; 10s is the default value
|
||||||
|
SLOW_FLUSH = 5S ; 5s is the default value
|
||||||
|
```
|
||||||
|
|
||||||
|
* Set the following environment variables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
GITEA_SLOW_TEST_TIME="10s" GITEA_SLOW_FLUSH_TIME="5s" make test-sqlite
|
||||||
|
```
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) {
|
|||||||
token := getTokenForLoggedInUser(t, session)
|
token := getTokenForLoggedInUser(t, session)
|
||||||
urlStr := fmt.Sprintf("/api/v1/admin/users/%s/keys?token=%s", keyOwner.Name, token)
|
urlStr := fmt.Sprintf("/api/v1/admin/users/%s/keys?token=%s", keyOwner.Name, token)
|
||||||
req := NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
req := NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
||||||
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDAu7tvIvX6ZHrRXuZNfkR3XLHSsuCK9Zn3X58lxBcQzuo5xZgB6vRwwm/QtJuF+zZPtY5hsQILBLmF+BZ5WpKZp1jBeSjH2G7lxet9kbcH+kIVj0tPFEoyKI9wvWqIwC4prx/WVk2wLTJjzBAhyNxfEq7C9CeiX9pQEbEqJfkKCQ== nocomment\n",
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC4cn+iXnA4KvcQYSV88vGn0Yi91vG47t1P7okprVmhNTkipNRIHWr6WdCO4VDr/cvsRkuVJAsLO2enwjGWWueOO6BodiBgyAOZ/5t5nJNMCNuLGT5UIo/RI1b0WRQwxEZTRjt6mFNw6lH14wRd8ulsr9toSWBPMOGWoYs1PDeDL0JuTjL+tr1SZi/EyxCngpYszKdXllJEHyI79KQgeD0Vt3pTrkbNVTOEcCNqZePSVmUH8X8Vhugz3bnE0/iE9Pb5fkWO9c4AnM1FgI/8Bvp27Fw2ShryIXuR6kKvUqhVMTuOSDHwu6A8jLE5Owt3GAYugDpDYuwTVNGrHLXKpPzrGGPE/jPmaLCMZcsdkec95dYeU3zKODEm8UQZFhmJmDeWVJ36nGrGZHL4J5aTTaeFUJmmXDaJYiJ+K2/ioKgXqnXvltu0A9R8/LGy4nrTJRr4JMLuJFoUXvGm1gXQ70w2LSpk6yl71RNC0hCtsBe8BP8IhYCM0EP5jh7eCMQZNvM= nocomment\n",
|
||||||
"title": "test-key",
|
"title": "test-key",
|
||||||
})
|
})
|
||||||
resp := session.MakeRequest(t, req, http.StatusCreated)
|
resp := session.MakeRequest(t, req, http.StatusCreated)
|
||||||
@@ -64,7 +64,7 @@ func TestAPIAdminDeleteUnauthorizedKey(t *testing.T) {
|
|||||||
token := getTokenForLoggedInUser(t, session)
|
token := getTokenForLoggedInUser(t, session)
|
||||||
urlStr := fmt.Sprintf("/api/v1/admin/users/%s/keys?token=%s", adminUsername, token)
|
urlStr := fmt.Sprintf("/api/v1/admin/users/%s/keys?token=%s", adminUsername, token)
|
||||||
req := NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
req := NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
||||||
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDAu7tvIvX6ZHrRXuZNfkR3XLHSsuCK9Zn3X58lxBcQzuo5xZgB6vRwwm/QtJuF+zZPtY5hsQILBLmF+BZ5WpKZp1jBeSjH2G7lxet9kbcH+kIVj0tPFEoyKI9wvWqIwC4prx/WVk2wLTJjzBAhyNxfEq7C9CeiX9pQEbEqJfkKCQ== nocomment\n",
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC4cn+iXnA4KvcQYSV88vGn0Yi91vG47t1P7okprVmhNTkipNRIHWr6WdCO4VDr/cvsRkuVJAsLO2enwjGWWueOO6BodiBgyAOZ/5t5nJNMCNuLGT5UIo/RI1b0WRQwxEZTRjt6mFNw6lH14wRd8ulsr9toSWBPMOGWoYs1PDeDL0JuTjL+tr1SZi/EyxCngpYszKdXllJEHyI79KQgeD0Vt3pTrkbNVTOEcCNqZePSVmUH8X8Vhugz3bnE0/iE9Pb5fkWO9c4AnM1FgI/8Bvp27Fw2ShryIXuR6kKvUqhVMTuOSDHwu6A8jLE5Owt3GAYugDpDYuwTVNGrHLXKpPzrGGPE/jPmaLCMZcsdkec95dYeU3zKODEm8UQZFhmJmDeWVJ36nGrGZHL4J5aTTaeFUJmmXDaJYiJ+K2/ioKgXqnXvltu0A9R8/LGy4nrTJRr4JMLuJFoUXvGm1gXQ70w2LSpk6yl71RNC0hCtsBe8BP8IhYCM0EP5jh7eCMQZNvM= nocomment\n",
|
||||||
"title": "test-key",
|
"title": "test-key",
|
||||||
})
|
})
|
||||||
resp := session.MakeRequest(t, req, http.StatusCreated)
|
resp := session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package integrations
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
@@ -14,8 +15,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func testAPIGetBranch(t *testing.T, branchName string, exists bool) {
|
func testAPIGetBranch(t *testing.T, branchName string, exists bool) {
|
||||||
defer prepareTestEnv(t)()
|
|
||||||
|
|
||||||
session := loginUser(t, "user2")
|
session := loginUser(t, "user2")
|
||||||
token := getTokenForLoggedInUser(t, session)
|
token := getTokenForLoggedInUser(t, session)
|
||||||
req := NewRequestf(t, "GET", "/api/v1/repos/user2/repo1/branches/%s?token=%s", branchName, token)
|
req := NewRequestf(t, "GET", "/api/v1/repos/user2/repo1/branches/%s?token=%s", branchName, token)
|
||||||
@@ -28,6 +27,8 @@ func testAPIGetBranch(t *testing.T, branchName string, exists bool) {
|
|||||||
var branch api.Branch
|
var branch api.Branch
|
||||||
DecodeJSON(t, resp, &branch)
|
DecodeJSON(t, resp, &branch)
|
||||||
assert.EqualValues(t, branchName, branch.Name)
|
assert.EqualValues(t, branchName, branch.Name)
|
||||||
|
assert.True(t, branch.UserCanPush)
|
||||||
|
assert.True(t, branch.UserCanMerge)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAPIGetBranchProtection(t *testing.T, branchName string, expectedHTTPStatus int) {
|
func testAPIGetBranchProtection(t *testing.T, branchName string, expectedHTTPStatus int) {
|
||||||
@@ -78,7 +79,15 @@ func testAPIDeleteBranchProtection(t *testing.T, branchName string, expectedHTTP
|
|||||||
session.MakeRequest(t, req, expectedHTTPStatus)
|
session.MakeRequest(t, req, expectedHTTPStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testAPIDeleteBranch(t *testing.T, branchName string, expectedHTTPStatus int) {
|
||||||
|
session := loginUser(t, "user2")
|
||||||
|
token := getTokenForLoggedInUser(t, session)
|
||||||
|
req := NewRequestf(t, "DELETE", "/api/v1/repos/user2/repo1/branches/%s?token=%s", branchName, token)
|
||||||
|
session.MakeRequest(t, req, expectedHTTPStatus)
|
||||||
|
}
|
||||||
|
|
||||||
func TestAPIGetBranch(t *testing.T) {
|
func TestAPIGetBranch(t *testing.T) {
|
||||||
|
defer prepareTestEnv(t)()
|
||||||
for _, test := range []struct {
|
for _, test := range []struct {
|
||||||
BranchName string
|
BranchName string
|
||||||
Exists bool
|
Exists bool
|
||||||
@@ -92,6 +101,72 @@ func TestAPIGetBranch(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAPICreateBranch(t *testing.T) {
|
||||||
|
onGiteaRun(t, testAPICreateBranches)
|
||||||
|
}
|
||||||
|
|
||||||
|
func testAPICreateBranches(t *testing.T, giteaURL *url.URL) {
|
||||||
|
|
||||||
|
username := "user2"
|
||||||
|
ctx := NewAPITestContext(t, username, "my-noo-repo")
|
||||||
|
giteaURL.Path = ctx.GitPath()
|
||||||
|
|
||||||
|
t.Run("CreateRepo", doAPICreateRepository(ctx, false))
|
||||||
|
tests := []struct {
|
||||||
|
OldBranch string
|
||||||
|
NewBranch string
|
||||||
|
ExpectedHTTPStatus int
|
||||||
|
}{
|
||||||
|
// Creating branch from default branch
|
||||||
|
{
|
||||||
|
OldBranch: "",
|
||||||
|
NewBranch: "new_branch_from_default_branch",
|
||||||
|
ExpectedHTTPStatus: http.StatusCreated,
|
||||||
|
},
|
||||||
|
// Creating branch from master
|
||||||
|
{
|
||||||
|
OldBranch: "master",
|
||||||
|
NewBranch: "new_branch_from_master_1",
|
||||||
|
ExpectedHTTPStatus: http.StatusCreated,
|
||||||
|
},
|
||||||
|
// Trying to create from master but already exists
|
||||||
|
{
|
||||||
|
OldBranch: "master",
|
||||||
|
NewBranch: "new_branch_from_master_1",
|
||||||
|
ExpectedHTTPStatus: http.StatusConflict,
|
||||||
|
},
|
||||||
|
// Trying to create from other branch (not default branch)
|
||||||
|
{
|
||||||
|
OldBranch: "new_branch_from_master_1",
|
||||||
|
NewBranch: "branch_2",
|
||||||
|
ExpectedHTTPStatus: http.StatusCreated,
|
||||||
|
},
|
||||||
|
// Trying to create from a branch which does not exist
|
||||||
|
{
|
||||||
|
OldBranch: "does_not_exist",
|
||||||
|
NewBranch: "new_branch_from_non_existent",
|
||||||
|
ExpectedHTTPStatus: http.StatusNotFound,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, test := range tests {
|
||||||
|
defer resetFixtures(t)
|
||||||
|
session := ctx.Session
|
||||||
|
token := getTokenForLoggedInUser(t, session)
|
||||||
|
req := NewRequestWithJSON(t, "POST", "/api/v1/repos/user2/my-noo-repo/branches?token="+token, &api.CreateBranchRepoOption{
|
||||||
|
BranchName: test.NewBranch,
|
||||||
|
OldBranchName: test.OldBranch,
|
||||||
|
})
|
||||||
|
resp := session.MakeRequest(t, req, test.ExpectedHTTPStatus)
|
||||||
|
|
||||||
|
var branch api.Branch
|
||||||
|
DecodeJSON(t, resp, &branch)
|
||||||
|
|
||||||
|
if test.ExpectedHTTPStatus == http.StatusCreated {
|
||||||
|
assert.EqualValues(t, test.NewBranch, branch.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestAPIBranchProtection(t *testing.T) {
|
func TestAPIBranchProtection(t *testing.T) {
|
||||||
defer prepareTestEnv(t)()
|
defer prepareTestEnv(t)()
|
||||||
|
|
||||||
@@ -104,10 +179,17 @@ func TestAPIBranchProtection(t *testing.T) {
|
|||||||
// Can only create once
|
// Can only create once
|
||||||
testAPICreateBranchProtection(t, "master", http.StatusForbidden)
|
testAPICreateBranchProtection(t, "master", http.StatusForbidden)
|
||||||
|
|
||||||
|
// Can't delete a protected branch
|
||||||
|
testAPIDeleteBranch(t, "master", http.StatusForbidden)
|
||||||
|
|
||||||
testAPIGetBranchProtection(t, "master", http.StatusOK)
|
testAPIGetBranchProtection(t, "master", http.StatusOK)
|
||||||
testAPIEditBranchProtection(t, "master", &api.BranchProtection{
|
testAPIEditBranchProtection(t, "master", &api.BranchProtection{
|
||||||
EnablePush: true,
|
EnablePush: true,
|
||||||
}, http.StatusOK)
|
}, http.StatusOK)
|
||||||
|
|
||||||
testAPIDeleteBranchProtection(t, "master", http.StatusNoContent)
|
testAPIDeleteBranchProtection(t, "master", http.StatusNoContent)
|
||||||
|
|
||||||
|
// Test branch deletion
|
||||||
|
testAPIDeleteBranch(t, "master", http.StatusForbidden)
|
||||||
|
testAPIDeleteBranch(t, "branch2", http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func TestGPGKeys(t *testing.T) {
|
|||||||
results: []int{http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized},
|
results: []int{http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized, http.StatusUnauthorized},
|
||||||
},
|
},
|
||||||
{name: "LoggedAsUser2", makeRequest: session.MakeRequest, token: token,
|
{name: "LoggedAsUser2", makeRequest: session.MakeRequest, token: token,
|
||||||
results: []int{http.StatusOK, http.StatusOK, http.StatusNotFound, http.StatusNoContent, http.StatusInternalServerError, http.StatusInternalServerError, http.StatusCreated, http.StatusCreated}},
|
results: []int{http.StatusOK, http.StatusOK, http.StatusNotFound, http.StatusNoContent, http.StatusUnprocessableEntity, http.StatusNotFound, http.StatusCreated, http.StatusCreated}},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tt {
|
for _, tc := range tt {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ func doAPICreateRepository(ctx APITestContext, empty bool, callback ...func(*tes
|
|||||||
Description: "Temporary repo",
|
Description: "Temporary repo",
|
||||||
Name: ctx.Reponame,
|
Name: ctx.Reponame,
|
||||||
Private: true,
|
Private: true,
|
||||||
|
Template: true,
|
||||||
Gitignores: "",
|
Gitignores: "",
|
||||||
License: "WTFPL",
|
License: "WTFPL",
|
||||||
Readme: "Default",
|
Readme: "Default",
|
||||||
@@ -266,3 +267,86 @@ func doAPICreateFile(ctx APITestContext, treepath string, options *api.CreateFil
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func doAPICreateOrganization(ctx APITestContext, options *api.CreateOrgOption, callback ...func(*testing.T, api.Organization)) func(t *testing.T) {
|
||||||
|
return func(t *testing.T) {
|
||||||
|
url := fmt.Sprintf("/api/v1/orgs?token=%s", ctx.Token)
|
||||||
|
|
||||||
|
req := NewRequestWithJSON(t, "POST", url, &options)
|
||||||
|
if ctx.ExpectedCode != 0 {
|
||||||
|
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp := ctx.Session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
|
||||||
|
var contents api.Organization
|
||||||
|
DecodeJSON(t, resp, &contents)
|
||||||
|
if len(callback) > 0 {
|
||||||
|
callback[0](t, contents)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func doAPICreateOrganizationRepository(ctx APITestContext, orgName string, options *api.CreateRepoOption, callback ...func(*testing.T, api.Repository)) func(t *testing.T) {
|
||||||
|
return func(t *testing.T) {
|
||||||
|
url := fmt.Sprintf("/api/v1/orgs/%s/repos?token=%s", orgName, ctx.Token)
|
||||||
|
|
||||||
|
req := NewRequestWithJSON(t, "POST", url, &options)
|
||||||
|
if ctx.ExpectedCode != 0 {
|
||||||
|
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp := ctx.Session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
|
||||||
|
var contents api.Repository
|
||||||
|
DecodeJSON(t, resp, &contents)
|
||||||
|
if len(callback) > 0 {
|
||||||
|
callback[0](t, contents)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func doAPICreateOrganizationTeam(ctx APITestContext, orgName string, options *api.CreateTeamOption, callback ...func(*testing.T, api.Team)) func(t *testing.T) {
|
||||||
|
return func(t *testing.T) {
|
||||||
|
url := fmt.Sprintf("/api/v1/orgs/%s/teams?token=%s", orgName, ctx.Token)
|
||||||
|
|
||||||
|
req := NewRequestWithJSON(t, "POST", url, &options)
|
||||||
|
if ctx.ExpectedCode != 0 {
|
||||||
|
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp := ctx.Session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
|
||||||
|
var contents api.Team
|
||||||
|
DecodeJSON(t, resp, &contents)
|
||||||
|
if len(callback) > 0 {
|
||||||
|
callback[0](t, contents)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func doAPIAddUserToOrganizationTeam(ctx APITestContext, teamID int64, username string) func(t *testing.T) {
|
||||||
|
return func(t *testing.T) {
|
||||||
|
url := fmt.Sprintf("/api/v1/teams/%d/members/%s?token=%s", teamID, username, ctx.Token)
|
||||||
|
|
||||||
|
req := NewRequest(t, "PUT", url)
|
||||||
|
if ctx.ExpectedCode != 0 {
|
||||||
|
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.Session.MakeRequest(t, req, http.StatusNoContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func doAPIAddRepoToOrganizationTeam(ctx APITestContext, teamID int64, orgName, repoName string) func(t *testing.T) {
|
||||||
|
return func(t *testing.T) {
|
||||||
|
url := fmt.Sprintf("/api/v1/teams/%d/repos/%s/%s?token=%s", teamID, orgName, repoName, ctx.Token)
|
||||||
|
|
||||||
|
req := NewRequest(t, "PUT", url)
|
||||||
|
if ctx.ExpectedCode != 0 {
|
||||||
|
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.Session.MakeRequest(t, req, http.StatusNoContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -134,3 +134,74 @@ func TestAPIReplaceIssueLabels(t *testing.T) {
|
|||||||
models.AssertCount(t, &models.IssueLabel{IssueID: issue.ID}, 1)
|
models.AssertCount(t, &models.IssueLabel{IssueID: issue.ID}, 1)
|
||||||
models.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: issue.ID, LabelID: label.ID})
|
models.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: issue.ID, LabelID: label.ID})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAPIModifyOrgLabels(t *testing.T) {
|
||||||
|
assert.NoError(t, models.LoadFixtures())
|
||||||
|
|
||||||
|
repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 3}).(*models.Repository)
|
||||||
|
owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
|
||||||
|
user := "user1"
|
||||||
|
session := loginUser(t, user)
|
||||||
|
token := getTokenForLoggedInUser(t, session)
|
||||||
|
urlStr := fmt.Sprintf("/api/v1/orgs/%s/labels?token=%s", owner.Name, token)
|
||||||
|
|
||||||
|
// CreateLabel
|
||||||
|
req := NewRequestWithJSON(t, "POST", urlStr, &api.CreateLabelOption{
|
||||||
|
Name: "TestL 1",
|
||||||
|
Color: "abcdef",
|
||||||
|
Description: "test label",
|
||||||
|
})
|
||||||
|
resp := session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
apiLabel := new(api.Label)
|
||||||
|
DecodeJSON(t, resp, &apiLabel)
|
||||||
|
dbLabel := models.AssertExistsAndLoadBean(t, &models.Label{ID: apiLabel.ID, OrgID: owner.ID}).(*models.Label)
|
||||||
|
assert.EqualValues(t, dbLabel.Name, apiLabel.Name)
|
||||||
|
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
|
||||||
|
|
||||||
|
req = NewRequestWithJSON(t, "POST", urlStr, &api.CreateLabelOption{
|
||||||
|
Name: "TestL 2",
|
||||||
|
Color: "#123456",
|
||||||
|
Description: "jet another test label",
|
||||||
|
})
|
||||||
|
session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
req = NewRequestWithJSON(t, "POST", urlStr, &api.CreateLabelOption{
|
||||||
|
Name: "WrongTestL",
|
||||||
|
Color: "#12345g",
|
||||||
|
})
|
||||||
|
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||||
|
|
||||||
|
//ListLabels
|
||||||
|
req = NewRequest(t, "GET", urlStr)
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
var apiLabels []*api.Label
|
||||||
|
DecodeJSON(t, resp, &apiLabels)
|
||||||
|
assert.Len(t, apiLabels, 4)
|
||||||
|
|
||||||
|
//GetLabel
|
||||||
|
singleURLStr := fmt.Sprintf("/api/v1/orgs/%s/labels/%d?token=%s", owner.Name, dbLabel.ID, token)
|
||||||
|
req = NewRequest(t, "GET", singleURLStr)
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
DecodeJSON(t, resp, &apiLabel)
|
||||||
|
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
|
||||||
|
|
||||||
|
//EditLabel
|
||||||
|
newName := "LabelNewName"
|
||||||
|
newColor := "09876a"
|
||||||
|
newColorWrong := "09g76a"
|
||||||
|
req = NewRequestWithJSON(t, "PATCH", singleURLStr, &api.EditLabelOption{
|
||||||
|
Name: &newName,
|
||||||
|
Color: &newColor,
|
||||||
|
})
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
DecodeJSON(t, resp, &apiLabel)
|
||||||
|
assert.EqualValues(t, newColor, apiLabel.Color)
|
||||||
|
req = NewRequestWithJSON(t, "PATCH", singleURLStr, &api.EditLabelOption{
|
||||||
|
Color: &newColorWrong,
|
||||||
|
})
|
||||||
|
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||||
|
|
||||||
|
//DeleteLabel
|
||||||
|
req = NewRequest(t, "DELETE", singleURLStr)
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusNoContent)
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -44,4 +44,34 @@ func TestAPIIssuesMilestone(t *testing.T) {
|
|||||||
var apiMilestone2 structs.Milestone
|
var apiMilestone2 structs.Milestone
|
||||||
DecodeJSON(t, resp, &apiMilestone2)
|
DecodeJSON(t, resp, &apiMilestone2)
|
||||||
assert.EqualValues(t, "closed", apiMilestone2.State)
|
assert.EqualValues(t, "closed", apiMilestone2.State)
|
||||||
|
|
||||||
|
req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/milestones?token=%s", owner.Name, repo.Name, token), structs.CreateMilestoneOption{
|
||||||
|
Title: "wow",
|
||||||
|
Description: "closed one",
|
||||||
|
State: "closed",
|
||||||
|
})
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusCreated)
|
||||||
|
DecodeJSON(t, resp, &apiMilestone)
|
||||||
|
assert.Equal(t, "wow", apiMilestone.Title)
|
||||||
|
assert.Equal(t, structs.StateClosed, apiMilestone.State)
|
||||||
|
|
||||||
|
var apiMilestones []structs.Milestone
|
||||||
|
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/milestones?state=%s&token=%s", owner.Name, repo.Name, "all", token))
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
DecodeJSON(t, resp, &apiMilestones)
|
||||||
|
assert.Len(t, apiMilestones, 4)
|
||||||
|
|
||||||
|
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%s?token=%s", owner.Name, repo.Name, apiMilestones[2].Title, token))
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
DecodeJSON(t, resp, &apiMilestone)
|
||||||
|
assert.EqualValues(t, apiMilestones[2], apiMilestone)
|
||||||
|
|
||||||
|
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/milestones?state=%s&name=%s&token=%s", owner.Name, repo.Name, "all", "milestone2", token))
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
DecodeJSON(t, resp, &apiMilestones)
|
||||||
|
assert.Len(t, apiMilestones, 1)
|
||||||
|
assert.Equal(t, int64(2), apiMilestones[0].ID)
|
||||||
|
|
||||||
|
req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%d?token=%s", owner.Name, repo.Name, apiMilestone.ID, token))
|
||||||
|
resp = session.MakeRequest(t, req, http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user