@weibaohui/dsh-git-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +43 -0
  2. package/client/bundle.js +2356 -0
  3. package/client/index.js +2342 -0
  4. package/cordis.patch.yml +11 -0
  5. package/package.json +70 -0
  6. package/server/dist/api/v1.js +2029 -0
  7. package/server/dist/authx/password.js +43 -0
  8. package/server/dist/authx/um.js +157 -0
  9. package/server/dist/conf.js +323 -0
  10. package/server/dist/context.js +701 -0
  11. package/server/dist/db/actions.js +202 -0
  12. package/server/dist/db/db.js +838 -0
  13. package/server/dist/dshapi.js +1416 -0
  14. package/server/dist/editorconfig.js +104 -0
  15. package/server/dist/gitx/git.js +580 -0
  16. package/server/dist/gitx/http.js +232 -0
  17. package/server/dist/gitx/paths.js +28 -0
  18. package/server/dist/gitx/service.js +251 -0
  19. package/server/dist/gosprintf.js +167 -0
  20. package/server/dist/hook.js +53 -0
  21. package/server/dist/index.js +112 -0
  22. package/server/dist/lfsx.js +265 -0
  23. package/server/dist/mailer.js +127 -0
  24. package/server/dist/markup.js +317 -0
  25. package/server/dist/metrics.js +18 -0
  26. package/server/dist/mirror.js +203 -0
  27. package/server/dist/multipart.js +33 -0
  28. package/server/dist/repox.js +99 -0
  29. package/server/dist/router.js +185 -0
  30. package/server/dist/serv.js +43 -0
  31. package/server/dist/server.js +382 -0
  32. package/server/dist/sshx/dispatch.js +160 -0
  33. package/server/dist/sshx/lfs-transfer.js +289 -0
  34. package/server/dist/sshx/server.js +107 -0
  35. package/server/dist/toolx.js +108 -0
  36. package/server/dist/twofactor.js +160 -0
  37. package/server/dist/webapi.js +377 -0
  38. package/server/dist/webhook.js +128 -0
  39. package/server/package.json +34 -0
  40. package/server/public/img/avatar_default.png +0 -0
  41. package/server/tsconfig.json +19 -0
  42. package/server/vendored-conf/app.ini +538 -0
  43. package/server/vendored-conf/gitignore/Actionscript +11 -0
  44. package/server/vendored-conf/gitignore/Ada +5 -0
  45. package/server/vendored-conf/gitignore/Agda +1 -0
  46. package/server/vendored-conf/gitignore/Android +32 -0
  47. package/server/vendored-conf/gitignore/Anjuta +3 -0
  48. package/server/vendored-conf/gitignore/AppEngine +2 -0
  49. package/server/vendored-conf/gitignore/AppceleratorTitanium +3 -0
  50. package/server/vendored-conf/gitignore/ArchLinuxPackages +13 -0
  51. package/server/vendored-conf/gitignore/Archives +27 -0
  52. package/server/vendored-conf/gitignore/Autotools +14 -0
  53. package/server/vendored-conf/gitignore/BricxCC +4 -0
  54. package/server/vendored-conf/gitignore/C +32 -0
  55. package/server/vendored-conf/gitignore/C Sharp +108 -0
  56. package/server/vendored-conf/gitignore/C++ +28 -0
  57. package/server/vendored-conf/gitignore/CFWheels +12 -0
  58. package/server/vendored-conf/gitignore/CMake +6 -0
  59. package/server/vendored-conf/gitignore/CUDA +6 -0
  60. package/server/vendored-conf/gitignore/CakePHP +13 -0
  61. package/server/vendored-conf/gitignore/ChefCookbook +9 -0
  62. package/server/vendored-conf/gitignore/Cloud9 +3 -0
  63. package/server/vendored-conf/gitignore/CodeIgniter +6 -0
  64. package/server/vendored-conf/gitignore/CodeKit +3 -0
  65. package/server/vendored-conf/gitignore/CommonLisp +3 -0
  66. package/server/vendored-conf/gitignore/Composer +6 -0
  67. package/server/vendored-conf/gitignore/Concrete5 +3 -0
  68. package/server/vendored-conf/gitignore/Coq +3 -0
  69. package/server/vendored-conf/gitignore/CraftCMS +3 -0
  70. package/server/vendored-conf/gitignore/DM +5 -0
  71. package/server/vendored-conf/gitignore/Dart +15 -0
  72. package/server/vendored-conf/gitignore/DartEditor +2 -0
  73. package/server/vendored-conf/gitignore/Delphi +57 -0
  74. package/server/vendored-conf/gitignore/Dreamweaver +3 -0
  75. package/server/vendored-conf/gitignore/Drupal +36 -0
  76. package/server/vendored-conf/gitignore/EPiServer +4 -0
  77. package/server/vendored-conf/gitignore/Eagle +36 -0
  78. package/server/vendored-conf/gitignore/Eclipse +39 -0
  79. package/server/vendored-conf/gitignore/EiffelStudio +2 -0
  80. package/server/vendored-conf/gitignore/Elisp +5 -0
  81. package/server/vendored-conf/gitignore/Elixir +4 -0
  82. package/server/vendored-conf/gitignore/Emacs +32 -0
  83. package/server/vendored-conf/gitignore/Ensime +4 -0
  84. package/server/vendored-conf/gitignore/Erlang +10 -0
  85. package/server/vendored-conf/gitignore/Espresso +1 -0
  86. package/server/vendored-conf/gitignore/ExpressionEngine +19 -0
  87. package/server/vendored-conf/gitignore/ExtJs +4 -0
  88. package/server/vendored-conf/gitignore/Fancy +2 -0
  89. package/server/vendored-conf/gitignore/Finale +13 -0
  90. package/server/vendored-conf/gitignore/FlexBuilder +3 -0
  91. package/server/vendored-conf/gitignore/ForceDotCom +4 -0
  92. package/server/vendored-conf/gitignore/FuelPHP +2 -0
  93. package/server/vendored-conf/gitignore/GWT +28 -0
  94. package/server/vendored-conf/gitignore/Gcov +5 -0
  95. package/server/vendored-conf/gitignore/GitBook +16 -0
  96. package/server/vendored-conf/gitignore/Go +24 -0
  97. package/server/vendored-conf/gitignore/Gradle +8 -0
  98. package/server/vendored-conf/gitignore/Grails +33 -0
  99. package/server/vendored-conf/gitignore/Haskell +16 -0
  100. package/server/vendored-conf/gitignore/IGORPro +5 -0
  101. package/server/vendored-conf/gitignore/IPythonNotebook +2 -0
  102. package/server/vendored-conf/gitignore/Idris +2 -0
  103. package/server/vendored-conf/gitignore/JDeveloper +13 -0
  104. package/server/vendored-conf/gitignore/Java +12 -0
  105. package/server/vendored-conf/gitignore/Jboss +19 -0
  106. package/server/vendored-conf/gitignore/Jekyll +3 -0
  107. package/server/vendored-conf/gitignore/JetBrains +46 -0
  108. package/server/vendored-conf/gitignore/Joomla +525 -0
  109. package/server/vendored-conf/gitignore/KDevelop4 +2 -0
  110. package/server/vendored-conf/gitignore/Kate +3 -0
  111. package/server/vendored-conf/gitignore/KiCAD +13 -0
  112. package/server/vendored-conf/gitignore/Kohana +2 -0
  113. package/server/vendored-conf/gitignore/LabVIEW +16 -0
  114. package/server/vendored-conf/gitignore/Laravel +4 -0
  115. package/server/vendored-conf/gitignore/Lazarus +30 -0
  116. package/server/vendored-conf/gitignore/Leiningen +12 -0
  117. package/server/vendored-conf/gitignore/LemonStand +21 -0
  118. package/server/vendored-conf/gitignore/LibreOffice +2 -0
  119. package/server/vendored-conf/gitignore/Lilypond +6 -0
  120. package/server/vendored-conf/gitignore/Linux +7 -0
  121. package/server/vendored-conf/gitignore/Lithium +2 -0
  122. package/server/vendored-conf/gitignore/Lua +41 -0
  123. package/server/vendored-conf/gitignore/LyX +4 -0
  124. package/server/vendored-conf/gitignore/Magento +126 -0
  125. package/server/vendored-conf/gitignore/Matlab +16 -0
  126. package/server/vendored-conf/gitignore/Maven +9 -0
  127. package/server/vendored-conf/gitignore/Mercurial +6 -0
  128. package/server/vendored-conf/gitignore/Mercury +13 -0
  129. package/server/vendored-conf/gitignore/MetaProgrammingSystem +16 -0
  130. package/server/vendored-conf/gitignore/MicrosoftOffice +10 -0
  131. package/server/vendored-conf/gitignore/ModelSim +23 -0
  132. package/server/vendored-conf/gitignore/Momentics +8 -0
  133. package/server/vendored-conf/gitignore/MonoDevelop +8 -0
  134. package/server/vendored-conf/gitignore/Nanoc +10 -0
  135. package/server/vendored-conf/gitignore/NetBeans +8 -0
  136. package/server/vendored-conf/gitignore/Nim +1 -0
  137. package/server/vendored-conf/gitignore/Ninja +2 -0
  138. package/server/vendored-conf/gitignore/Node +28 -0
  139. package/server/vendored-conf/gitignore/NotepadPP +2 -0
  140. package/server/vendored-conf/gitignore/OCaml +20 -0
  141. package/server/vendored-conf/gitignore/Objective-C +43 -0
  142. package/server/vendored-conf/gitignore/Opa +13 -0
  143. package/server/vendored-conf/gitignore/OpenCart +11 -0
  144. package/server/vendored-conf/gitignore/OracleForms +8 -0
  145. package/server/vendored-conf/gitignore/Packer +5 -0
  146. package/server/vendored-conf/gitignore/Perl +20 -0
  147. package/server/vendored-conf/gitignore/Phalcon +2 -0
  148. package/server/vendored-conf/gitignore/PhpStorm +63 -0
  149. package/server/vendored-conf/gitignore/PlayFramework +17 -0
  150. package/server/vendored-conf/gitignore/Plone +18 -0
  151. package/server/vendored-conf/gitignore/Prestashop +25 -0
  152. package/server/vendored-conf/gitignore/Processing +7 -0
  153. package/server/vendored-conf/gitignore/Python +58 -0
  154. package/server/vendored-conf/gitignore/Qooxdoo +5 -0
  155. package/server/vendored-conf/gitignore/Qt +34 -0
  156. package/server/vendored-conf/gitignore/R +16 -0
  157. package/server/vendored-conf/gitignore/ROS +47 -0
  158. package/server/vendored-conf/gitignore/Rails +35 -0
  159. package/server/vendored-conf/gitignore/Redcar +1 -0
  160. package/server/vendored-conf/gitignore/Redis +3 -0
  161. package/server/vendored-conf/gitignore/RhodesRhomobile +9 -0
  162. package/server/vendored-conf/gitignore/Ruby +36 -0
  163. package/server/vendored-conf/gitignore/Rust +11 -0
  164. package/server/vendored-conf/gitignore/SBT +9 -0
  165. package/server/vendored-conf/gitignore/SCons +2 -0
  166. package/server/vendored-conf/gitignore/SVN +1 -0
  167. package/server/vendored-conf/gitignore/Sass +2 -0
  168. package/server/vendored-conf/gitignore/Scala +17 -0
  169. package/server/vendored-conf/gitignore/Scrivener +7 -0
  170. package/server/vendored-conf/gitignore/Sdcc +8 -0
  171. package/server/vendored-conf/gitignore/SeamGen +26 -0
  172. package/server/vendored-conf/gitignore/SketchUp +1 -0
  173. package/server/vendored-conf/gitignore/SlickEdit +11 -0
  174. package/server/vendored-conf/gitignore/Stella +12 -0
  175. package/server/vendored-conf/gitignore/SublimeText +14 -0
  176. package/server/vendored-conf/gitignore/SugarCRM +25 -0
  177. package/server/vendored-conf/gitignore/Swift +43 -0
  178. package/server/vendored-conf/gitignore/Symfony +37 -0
  179. package/server/vendored-conf/gitignore/SymphonyCMS +6 -0
  180. package/server/vendored-conf/gitignore/SynopsysVCS +36 -0
  181. package/server/vendored-conf/gitignore/Tags +14 -0
  182. package/server/vendored-conf/gitignore/TeX +136 -0
  183. package/server/vendored-conf/gitignore/TextMate +3 -0
  184. package/server/vendored-conf/gitignore/Textpattern +11 -0
  185. package/server/vendored-conf/gitignore/TortoiseGit +2 -0
  186. package/server/vendored-conf/gitignore/TurboGears2 +20 -0
  187. package/server/vendored-conf/gitignore/Typo3 +20 -0
  188. package/server/vendored-conf/gitignore/Umbraco +17 -0
  189. package/server/vendored-conf/gitignore/Unity +21 -0
  190. package/server/vendored-conf/gitignore/UnrealEngine +76 -0
  191. package/server/vendored-conf/gitignore/VVVV +6 -0
  192. package/server/vendored-conf/gitignore/Vagrant +1 -0
  193. package/server/vendored-conf/gitignore/Vim +6 -0
  194. package/server/vendored-conf/gitignore/VirtualEnv +10 -0
  195. package/server/vendored-conf/gitignore/VisualStudio +217 -0
  196. package/server/vendored-conf/gitignore/VisualStudioCode +2 -0
  197. package/server/vendored-conf/gitignore/Waf +3 -0
  198. package/server/vendored-conf/gitignore/WebMethods +14 -0
  199. package/server/vendored-conf/gitignore/WebStorm +63 -0
  200. package/server/vendored-conf/gitignore/Windows +18 -0
  201. package/server/vendored-conf/gitignore/WordPress +18 -0
  202. package/server/vendored-conf/gitignore/Xcode +23 -0
  203. package/server/vendored-conf/gitignore/XilinxISE +57 -0
  204. package/server/vendored-conf/gitignore/Xojo +11 -0
  205. package/server/vendored-conf/gitignore/Yeoman +6 -0
  206. package/server/vendored-conf/gitignore/Yii +6 -0
  207. package/server/vendored-conf/gitignore/ZendFramework +20 -0
  208. package/server/vendored-conf/gitignore/Zephir +26 -0
  209. package/server/vendored-conf/gitignore/macOS +25 -0
  210. package/server/vendored-conf/label/Default +7 -0
  211. package/server/vendored-conf/license/Abstyles License +10 -0
  212. package/server/vendored-conf/license/Academic Free License v1.1 +22 -0
  213. package/server/vendored-conf/license/Academic Free License v1.2 +27 -0
  214. package/server/vendored-conf/license/Academic Free License v2.0 +43 -0
  215. package/server/vendored-conf/license/Academic Free License v2.1 +44 -0
  216. package/server/vendored-conf/license/Academic Free License v3.0 +42 -0
  217. package/server/vendored-conf/license/Affero General Public License v1.0 +84 -0
  218. package/server/vendored-conf/license/Apache License 1.0 +19 -0
  219. package/server/vendored-conf/license/Apache License 1.1 +20 -0
  220. package/server/vendored-conf/license/Apache License 2.0 +72 -0
  221. package/server/vendored-conf/license/Artistic License 1.0 +48 -0
  222. package/server/vendored-conf/license/Artistic License 2.0 +84 -0
  223. package/server/vendored-conf/license/BSD 2-clause License +8 -0
  224. package/server/vendored-conf/license/BSD 3-clause License +10 -0
  225. package/server/vendored-conf/license/BSD 4-clause License +13 -0
  226. package/server/vendored-conf/license/Creative Commons CC0 1.0 Universal +39 -0
  227. package/server/vendored-conf/license/Eclipse Public License 1.0 +72 -0
  228. package/server/vendored-conf/license/Educational Community License v1.0 +22 -0
  229. package/server/vendored-conf/license/Educational Community License v2.0 +97 -0
  230. package/server/vendored-conf/license/GNU Affero General Public License v3.0 +241 -0
  231. package/server/vendored-conf/license/GNU Free Documentation License v1.1 +118 -0
  232. package/server/vendored-conf/license/GNU Free Documentation License v1.2 +129 -0
  233. package/server/vendored-conf/license/GNU Free Documentation License v1.3 +148 -0
  234. package/server/vendored-conf/license/GNU General Public License v1.0 +99 -0
  235. package/server/vendored-conf/license/GNU General Public License v2.0 +116 -0
  236. package/server/vendored-conf/license/GNU General Public License v3.0 +231 -0
  237. package/server/vendored-conf/license/GNU Lesser General Public License v2.1 +174 -0
  238. package/server/vendored-conf/license/GNU Lesser General Public License v3.0 +70 -0
  239. package/server/vendored-conf/license/GNU Library General Public License v2.0 +173 -0
  240. package/server/vendored-conf/license/ISC license +6 -0
  241. package/server/vendored-conf/license/MIT License +8 -0
  242. package/server/vendored-conf/license/Mozilla Public License 1.0 +122 -0
  243. package/server/vendored-conf/license/Mozilla Public License 1.1 +142 -0
  244. package/server/vendored-conf/license/Mozilla Public License 2.0 +143 -0
  245. package/server/vendored-conf/readme/Default +3 -0
  246. package/src/dsh-host.js +168 -0
  247. package/src/index.js +682 -0
  248. package/src/runner.js +364 -0
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "ts-gogs",
3
+ "version": "0.1.0",
4
+ "description": "A faithful TypeScript port of Gogs (https://gogs.io) \u2014 API and web UI drop-in compatible.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "dev": "tsx src/index.ts",
9
+ "build": "tsc -p tsconfig.json",
10
+ "start": "node dist/index.js",
11
+ "check": "tsc --noEmit",
12
+ "test": "bash test/run-all.sh",
13
+ "test:api": "node test/api-test.mjs",
14
+ "test:git": "node test/git-test.mjs",
15
+ "test:ui": "node test/ui-test.mjs",
16
+ "test:drill": "node test/scenario-dev.mjs"
17
+ },
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "better-sqlite3": "^11.10.0",
21
+ "busboy": "^1.6.0",
22
+ "ini": "^5.0.0",
23
+ "marked": "^15.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/better-sqlite3": "^7.6.12",
27
+ "@types/busboy": "^1.5.4",
28
+ "@types/ini": "^4.1.1",
29
+ "@types/node": "^22.10.0",
30
+ "playwright-core": "^1.60.0",
31
+ "tsx": "^4.19.0",
32
+ "typescript": "^5.7.0"
33
+ }
34
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022"],
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+ "strict": true,
10
+ "noImplicitAny": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "resolveJsonModule": true,
15
+ "declaration": false,
16
+ "sourceMap": true
17
+ },
18
+ "include": ["src/**/*.ts"]
19
+ }
@@ -0,0 +1,538 @@
1
+ # !!! NEVER EVER MODIFY THIS FILE !!!
2
+ # !!! PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE !!!
3
+ # !!! IF YOU ARE PACKAGING PROVIDER, PLEASE MAKE OWN COPY OF IT !!!
4
+
5
+ ; The brand name of the application, can be your company or team name.
6
+ BRAND_NAME = Gogs
7
+ ; The system user who should be running the applications. It has no effect on Windows,
8
+ ; otherwise, it should match the value of $USER environment variable.
9
+ RUN_USER = git
10
+ ; The running mode of the application, can be either "dev", "prod" or "test".
11
+ RUN_MODE = dev
12
+
13
+ [server]
14
+ ; The public-facing URL for the application.
15
+ EXTERNAL_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
16
+ ; The public-facing domain name for the application.
17
+ DOMAIN = localhost
18
+ ; The protocol that is used to serve direct traffic to the application.
19
+ ; Currently supports "http", "https", "fcgi" and "unix".
20
+ PROTOCOL = http
21
+ ; The address to be listened by the application.
22
+ HTTP_ADDR = 0.0.0.0
23
+ ; The port number to be listened by the application.
24
+ HTTP_PORT = 3000
25
+ ; Generate steps:
26
+ ; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
27
+ ;
28
+ ; Or from a .pfx file exported from the Windows certificate store (do
29
+ ; not forget to export the private key):
30
+ ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
31
+ ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
32
+ CERT_FILE = custom/https/cert.pem
33
+ KEY_FILE = custom/https/key.pem
34
+ ; The minimum allowed TLS version, currently supports "TLS10", "TLS11", "TLS12", and "TLS13".
35
+ TLS_MIN_VERSION = TLS12
36
+ ; File permission when serve traffic via Unix domain socket.
37
+ UNIX_SOCKET_PERMISSION = 666
38
+ ; Local (DMZ) URL for workers (e.g. SSH update) accessing web service.
39
+ ; In most cases you do not need to change the default value.
40
+ ; Alter it only if your SSH server node is not the same as HTTP node.
41
+ LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
42
+
43
+ ; Whether to disable using CDN for static files regardless.
44
+ OFFLINE_MODE = false
45
+ ; Whether to disable logging in router.
46
+ DISABLE_ROUTER_LOG = true
47
+ ; Whether to enable application level GZIP compression.
48
+ ENABLE_GZIP = false
49
+
50
+ ; The path for storing application specific data.
51
+ APP_DATA_PATH = data
52
+ ; Whether to enable to load assets (i.e. "conf", "templates", "public") from disk instead of embedded bindata.
53
+ LOAD_ASSETS_FROM_DISK = false
54
+
55
+ ; The landing page URL for anonymous users, the value should not include
56
+ ; subpath that is handled by the reverse proxy.
57
+ LANDING_URL = /
58
+
59
+ ; Whether to disable SSH access to the application entirely.
60
+ DISABLE_SSH = false
61
+ ; The domain name to be exposed in SSH clone URL.
62
+ SSH_DOMAIN = %(DOMAIN)s
63
+ ; The port number to be exposed in SSH clone URL.
64
+ SSH_PORT = 22
65
+ ; The path of SSH root directory, default is "$HOME/.ssh".
66
+ SSH_ROOT_PATH =
67
+ ; The path to ssh-keygen, default is "ssh-keygen" and let shell find out which one to call.
68
+ SSH_KEYGEN_PATH = ssh-keygen
69
+ ; The directory to create temporary files when test a public key using ssh-keygen,
70
+ ; default is the system temporary directory.
71
+ SSH_KEY_TEST_PATH =
72
+ ; Whether to check minimum public key size with corresponding type.
73
+ MINIMUM_KEY_SIZE_CHECK = false
74
+ ; Whether to rewrite "~/.ssh/authorized_keys" file at start, ignored when use builtin SSH server.
75
+ REWRITE_AUTHORIZED_KEYS_AT_START = false
76
+ ; Whether to start a builtin SSH server.
77
+ START_SSH_SERVER = false
78
+ ; The network interface for builtin SSH server to listen on.
79
+ SSH_LISTEN_HOST = 0.0.0.0
80
+ ; The port number for builtin SSH server to listen on.
81
+ SSH_LISTEN_PORT = %(SSH_PORT)s
82
+ ; The list of accepted ciphers for connections to builtin SSH server.
83
+ SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
84
+ ; The list of accepted MACs for connections to builtin SSH server.
85
+ SSH_SERVER_MACS = hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1
86
+ ; The list of accepted key exchange algorithms for connections to builtin SSH server.
87
+ SSH_SERVER_ALGORITHMS = rsa, ecdsa, ed25519
88
+
89
+ ; Define allowed algorithms and their minimum key length (use -1 to disable a type).
90
+ [ssh.minimum_key_sizes]
91
+ ED25519 = 256
92
+ ECDSA = 256
93
+ RSA = 2048
94
+
95
+ [repository]
96
+ ; The root path for storing managed repositories, default is "~/gogs-repositories"
97
+ ROOT =
98
+ ; The script type server supports, sometimes could be "sh".
99
+ SCRIPT_TYPE = bash
100
+ ; Default ANSI charset for an unrecognized charset.
101
+ ANSI_CHARSET =
102
+ ; Whether to force every new repository to be private.
103
+ FORCE_PRIVATE = false
104
+ ; The global limit of number of repositories a user can create, -1 means no limit.
105
+ MAX_CREATION_LIMIT = -1
106
+ ; Preferred Licenses to place at the top of the list.
107
+ ; Name must match file name in "conf/license" or "custom/conf/license".
108
+ PREFERRED_LICENSES = Apache License 2.0, MIT License
109
+ ; Whether to disable Git interaction with repositories via HTTP/HTTPS protocol.
110
+ DISABLE_HTTP_GIT = false
111
+ ; Whether to enable ability to migrate repository by server local path.
112
+ ENABLE_LOCAL_PATH_MIGRATION = false
113
+ ; Whether to enable render mode for raw file. There are potential security risks.
114
+ ENABLE_RAW_FILE_RENDER_MODE = false
115
+ ; The maximum number of goroutines that can be run at the same time for a single
116
+ ; fetch request. Usually, the value depend of how many CPU (cores) you have. If
117
+ ; the value is non-positive, it matches the number of CPUs available to the application.
118
+ COMMITS_FETCH_CONCURRENCY = 0
119
+ ; Default branch name when creating new repositories.
120
+ DEFAULT_BRANCH = master
121
+
122
+ [repository.editor]
123
+ ; List of file extensions that should have line wraps in the CodeMirror editor.
124
+ ; Separate extensions with a comma.
125
+ LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd
126
+ ; Valid file modes that have a preview API associated with them, such as "/api/v1/markdown".
127
+ ; Separate values by commas. Preview tab in edit mode won't show if the file extension doesn't match.
128
+ PREVIEWABLE_FILE_MODES = markdown
129
+
130
+ [repository.upload]
131
+ ; Whether to enable repository file uploads.
132
+ ENABLED = true
133
+ ; The path to temporarily store uploads (content under this path gets wiped out on every start).
134
+ TEMP_PATH = data/tmp/uploads
135
+ ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
136
+ ALLOWED_TYPES =
137
+ ; The maximum size of each file in MB.
138
+ FILE_MAX_SIZE = 3
139
+ ; The maximum number of files per upload.
140
+ MAX_FILES = 5
141
+
142
+ [database]
143
+ ; The database backend, either "postgres", "mysql" or "sqlite3".
144
+ TYPE = postgres
145
+ HOST = 127.0.0.1:5432
146
+ NAME = gogs
147
+ USER = gogs
148
+ PASSWORD =
149
+ ; For "postgres" only
150
+ SCHEMA = public
151
+ ; For "postgres" only, either "disable", "require" or "verify-full".
152
+ SSL_MODE = disable
153
+ ; For "sqlite3" only, make sure to use absolute path.
154
+ PATH = data/gogs.db
155
+ ; The maximum open connections of the pool.
156
+ MAX_OPEN_CONNS = 30
157
+ ; The maximum idle connections of the pool.
158
+ MAX_IDLE_CONNS = 30
159
+
160
+ [security]
161
+ ; The secret used to encrypt cookie values, 2FA codes, and similar sensitive data.
162
+ ; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
163
+ SECRET_KEY = CHANGE-ME-OR-FAIL-TO-START
164
+ ; The number of days a sign-in session persists across browser restarts.
165
+ LOGIN_REMEMBER_DAYS = 7
166
+ ; Whether to set secure cookie.
167
+ COOKIE_SECURE = false
168
+ ; Whether to set cookie to indicate user login status.
169
+ ENABLE_LOGIN_STATUS_COOKIE = false
170
+ ; The cookie name to store user login status.
171
+ LOGIN_STATUS_COOKIE_NAME = login_status
172
+ ; A comma separated list of hostnames that are explicitly allowed to be accessed within the local network.
173
+ ; Use "*" to allow all hostnames.
174
+ LOCAL_NETWORK_ALLOWLIST =
175
+
176
+ [email]
177
+ ; Whether to enable the email service.
178
+ ENABLED = false
179
+ ; The prefix prepended to the subject line.
180
+ SUBJECT_PREFIX = `[%(BRAND_NAME)s] `
181
+ ; The SMTP server with its port, e.g. smtp.mailgun.org:587, smtp.gmail.com:587, smtp.qq.com:465
182
+ ; If the port ends is "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409.
183
+ ; If the server supports STARTTLS it will always be used.
184
+ HOST = smtp.mailgun.org:587
185
+ ; The email from address (RFC 5322). This can be just an email address, or the `"Name" <email@example.com>` format.
186
+ FROM = noreply@gogs.localhost
187
+ ; The login user.
188
+ USER = noreply@gogs.localhost
189
+ ; The login password.
190
+ PASSWORD =
191
+
192
+ ; The custom hostname for HELO operation, default is from system.
193
+ HELO_HOSTNAME =
194
+
195
+ ; Whether to skip verifying the certificate of the server. Only use this for self-signed certificates.
196
+ SKIP_VERIFY = false
197
+ ; Whether to use client certificates.
198
+ USE_CERTIFICATE = false
199
+ CERT_FILE = custom/email/cert.pem
200
+ KEY_FILE = custom/email/key.pem
201
+
202
+ ; Whether to use "text/plain" as content format.
203
+ USE_PLAIN_TEXT = false
204
+ ; Whether to attach a plaintext alternative to the MIME message while sending HTML emails.
205
+ ; It is used to support older mail clients and make spam filters happier.
206
+ ADD_PLAIN_TEXT_ALT = false
207
+
208
+ [auth]
209
+ ; The valid duration of activate code in minutes.
210
+ ACTIVATE_CODE_LIVES = 180
211
+ ; The valid duration of reset password code in minutes.
212
+ RESET_PASSWORD_CODE_LIVES = 180
213
+ ; Whether to require email confirmation for adding new email addresses.
214
+ ; Enable this option will also require user to confirm the email for registration.
215
+ REQUIRE_EMAIL_CONFIRMATION = false
216
+ ; Whether to disallow anonymous users visiting the site.
217
+ REQUIRE_SIGNIN_VIEW = false
218
+ ; Whether to disable self-registration. When disabled, accounts would have to be created by admins.
219
+ DISABLE_REGISTRATION = true
220
+ ; Whether to enable captcha validation for registration
221
+ ENABLE_REGISTRATION_CAPTCHA = true
222
+
223
+ ; Whether to enable reverse proxy authentication via HTTP header.
224
+ ENABLE_REVERSE_PROXY_AUTHENTICATION = false
225
+ ; Whether to automatically create new users for reverse proxy authentication.
226
+ ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
227
+ ; The HTTP header used as username for reverse proxy authentication.
228
+ REVERSE_PROXY_AUTHENTICATION_HEADER = X-WEBAUTH-USER
229
+ ; Lists the IPs or CIDR ranges whose requests are allowed to set the reverse
230
+ ; proxy authentication header.
231
+ TRUSTED_PROXY_IPS = 127.0.0.0/8,::1/128
232
+
233
+ [user]
234
+ ; Whether to enable email notifications for users.
235
+ ENABLE_EMAIL_NOTIFICATION = false
236
+
237
+ [session]
238
+ ; The session provider, either "memory", "file", or "redis".
239
+ PROVIDER = memory
240
+ ; The configuration for respective provider:
241
+ ; - memory: does not need any config yet
242
+ ; - file: session file path, e.g. `data/sessions`
243
+ ; - redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180,tls=true
244
+ PROVIDER_CONFIG = data/sessions
245
+ ; The cookie name to store the session identifier.
246
+ COOKIE_NAME = i_like_gogs
247
+ ; Whether to set cookie in HTTPS only.
248
+ COOKIE_SECURE = false
249
+ ; The GC interval in seconds for session data.
250
+ GC_INTERVAL = 3600
251
+ ; The maximum idle time in seconds before a session record is garbage-collected.
252
+ ; Set lower than `[security] LOGIN_REMEMBER_DAYS * 86400` to enforce a sliding
253
+ ; idle timeout. Otherwise the session lives for the full cookie lifetime.
254
+ MAX_LIFE_TIME = 604800
255
+
256
+ [cache]
257
+ ; The cache adapter, either "memory" or "redis".
258
+ ADAPTER = memory
259
+ ; For "memory" only, GC interval in seconds.
260
+ INTERVAL = 60
261
+ ; For "redis", connection host address:
262
+ ; - redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
263
+ HOST =
264
+
265
+ [http]
266
+ ; The value for "Access-Control-Allow-Origin" header, default is not to present.
267
+ ACCESS_CONTROL_ALLOW_ORIGIN =
268
+
269
+ [lfs]
270
+ ; The storage backend for uploading new objects.
271
+ STORAGE = local
272
+ ; The root path to store LFS objects on local file system.
273
+ OBJECTS_PATH = data/lfs-objects
274
+ ; The path to temporarily store LFS objects during upload verification.
275
+ OBJECTS_TEMP_PATH = data/tmp/lfs-objects
276
+
277
+ [attachment]
278
+ ; Whether to enabled upload attachments in general.
279
+ ENABLED = true
280
+ ; The path to store attachments on the file system.
281
+ PATH = data/attachments
282
+ ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
283
+ ALLOWED_TYPES = image/jpeg|image/png
284
+ ; The maximum size of each file in MB.
285
+ MAX_SIZE = 4
286
+ ; The maximum number of files per upload.
287
+ MAX_FILES = 5
288
+
289
+ [release.attachment]
290
+ ; Whether to enabled upload attachments for releases.
291
+ ENABLED = true
292
+ ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
293
+ ALLOWED_TYPES = */*
294
+ ; The maximum size of each file in MB.
295
+ MAX_SIZE = 32
296
+ ; The maximum number of files per upload.
297
+ MAX_FILES = 10
298
+
299
+ [time]
300
+ ; Specifies the format for fully outputed dates.
301
+ ; Values should be one of the following:
302
+ ; ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano.
303
+ ; For more information about the format see http://golang.org/pkg/time/#pkg-constants.
304
+ FORMAT = RFC1123
305
+
306
+ [picture]
307
+ ; The path to store user avatars on the file system.
308
+ AVATAR_UPLOAD_PATH = data/avatars
309
+ ; The path to store repository avatars on the file system.
310
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
311
+ ; Chinese users can use a custom avatar source, such as http://cn.gravatar.com/avatar/.
312
+ GRAVATAR_SOURCE = gravatar
313
+ ; Whether to disable Gravatar, this value will be forced to be true in offline mode.
314
+ DISABLE_GRAVATAR = false
315
+ ; Whether to enable federated avatar lookup uses DNS to discover avatar associated
316
+ ; with emails, see https://www.libravatar.org for details.
317
+ ; This value will be forced to be false in offline mode or when Gravatar is disabled.
318
+ ENABLE_FEDERATED_AVATAR = false
319
+
320
+ [markdown]
321
+ ; Whether to enable hard line break extension.
322
+ ENABLE_HARD_LINE_BREAK = false
323
+ ; The list of custom URL schemes that are allowed as links when rendering Markdown.
324
+ ; For example, "git" (for "git://") and "magnet" (for "magnet://").
325
+ CUSTOM_URL_SCHEMES =
326
+ ; The list of file extensions that should be rendered/edited as Markdown.
327
+ ; Separate extensions with a comma. To render files with no extension as markdown, just put a comma.
328
+ FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
329
+
330
+ [smartypants]
331
+ ; Whether to enable the Smartypants extension.
332
+ ENABLED = false
333
+ FRACTIONS = true
334
+ DASHES = true
335
+ LATEX_DASHES = true
336
+ ANGLED_QUOTES = true
337
+
338
+ [admin]
339
+ ; Whether to disable regular (non-admin) users to create organizations.
340
+ DISABLE_REGULAR_ORG_CREATION = false
341
+
342
+ [webhook]
343
+ ; The list of enabled types for users to use, can be "gogs", "slack", "discord", "dingtalk".
344
+ TYPES = gogs, slack, discord, dingtalk
345
+ ; Deliver timeout in seconds.
346
+ DELIVER_TIMEOUT = 15
347
+ ; Whether to allow insecure certification.
348
+ SKIP_TLS_VERIFY = false
349
+ ; The number of history information in each page.
350
+ PAGING_NUM = 10
351
+
352
+ ; General settings of loggers.
353
+ [log]
354
+ ; The root path for all log files, default is "log/" subdirectory.
355
+ ROOT_PATH =
356
+ ; Can be "console", "file", "slack" and "discord".
357
+ ; Use comma to separate multiple modes, e.g. "console, file"
358
+ MODE = console
359
+ ; Buffer length of channel, keep it as it is if you don't know what it is.
360
+ BUFFER_LEN = 100
361
+ ; Either "Trace", "Info", "Warn", "Error", "Fatal", default is "Trace"
362
+ LEVEL = Trace
363
+
364
+ ; For "console" mode only
365
+ [log.console]
366
+ ; Comment out to inherit
367
+ ; LEVEL =
368
+
369
+ ; For "file" mode only
370
+ [log.file]
371
+ ; Comment out to inherit
372
+ ; LEVEL =
373
+ ; Whether to enable automated log rotate (switch of following options).
374
+ LOG_ROTATE = true
375
+ ; Whether to segment log files daily.
376
+ DAILY_ROTATE = true
377
+ ; The maximum size shift of single file, default is 28 means 1 << 28 = 256MB.
378
+ MAX_SIZE_SHIFT = 28
379
+ ; The maximum number of lines of single file.
380
+ MAX_LINES = 1000000
381
+ ; The expired days of log file (delete after max days).
382
+ MAX_DAYS = 7
383
+
384
+ ; For "slack" mode only
385
+ [log.slack]
386
+ ; Comment out to inherit
387
+ ; LEVEL =
388
+ ; Webhook URL
389
+ URL =
390
+
391
+ [log.discord]
392
+ ; Comment out to inherit
393
+ ; LEVEL =
394
+ ; Webhook URL
395
+ URL =
396
+ ; The username to be displayed in notification.
397
+ USERNAME = %(BRAND_NAME)s
398
+
399
+ [log.xorm]
400
+ ; Enable file rotation
401
+ ROTATE = true
402
+ ; Rotate every day
403
+ ROTATE_DAILY = true
404
+ ; Rotate once file size excesses x MB
405
+ MAX_SIZE = 100
406
+ ; Maximum days to keep logger files
407
+ MAX_DAYS = 3
408
+
409
+ [log.gorm]
410
+ ; Whether to enable file rotation.
411
+ ROTATE = true
412
+ ; Whether to rotate file every day.
413
+ ROTATE_DAILY = true
414
+ ; The maximum file size in MB before next rotate.
415
+ MAX_SIZE = 100
416
+ ; The maximum days to keep files.
417
+ MAX_DAYS = 3
418
+
419
+ [cron]
420
+ ; Enable running cron tasks periodically.
421
+ ENABLED = true
422
+ ; Run cron tasks when Gogs starts.
423
+ RUN_AT_START = false
424
+
425
+ [cron.update_mirrors]
426
+ ; Defines how often the mirror syncer checks if any mirror needs to be synchronized (based on the mirror update interval).
427
+ SCHEDULE = @every 10m
428
+
429
+ ; Repository health check
430
+ [cron.repo_health_check]
431
+ SCHEDULE = @every 24h
432
+ TIMEOUT = 60s
433
+ ; Arguments for command 'git fsck', e.g. "--unreachable --tags"
434
+ ; see more on http://git-scm.com/docs/git-fsck/1.7.5
435
+ ARGS =
436
+
437
+ ; Check repository statistics
438
+ [cron.check_repo_stats]
439
+ RUN_AT_START = true
440
+ SCHEDULE = @every 24h
441
+
442
+ ; Cleanup repository archives
443
+ [cron.repo_archive_cleanup]
444
+ RUN_AT_START = false
445
+ SCHEDULE = @every 24h
446
+ ; Time duration to check if archive should be cleaned
447
+ OLDER_THAN = 24h
448
+
449
+ [git]
450
+ ; Disables highlight of added and removed changes
451
+ DISABLE_DIFF_HIGHLIGHT = false
452
+ ; Max number of files shown in diff view
453
+ MAX_GIT_DIFF_FILES = 100
454
+ ; Max number of lines allowed of a single file in diff view
455
+ MAX_GIT_DIFF_LINES = 1000
456
+ ; Max number of characters of a line allowed in diff view
457
+ MAX_GIT_DIFF_LINE_CHARACTERS = 2000
458
+ ; Arguments for command 'git gc', e.g. "--aggressive --auto"
459
+ ; see more on http://git-scm.com/docs/git-gc/1.7.5
460
+ GC_ARGS =
461
+
462
+ ; Operation timeout in seconds
463
+ [git.timeout]
464
+ MIGRATE = 600
465
+ MIRROR = 300
466
+ CLONE = 300
467
+ PULL = 300
468
+ DIFF = 60
469
+ GC = 60
470
+
471
+ [mirror]
472
+ ; Defines the default interval (in hours) until the next sync for a mirror (after a successful mirror sync).
473
+ ; It can be overridden individually for each mirror repository in the settings.
474
+ DEFAULT_INTERVAL = 8
475
+
476
+ [api]
477
+ ; Max number of items will response in a page
478
+ MAX_RESPONSE_ITEMS = 50
479
+
480
+ [ui]
481
+ ; Number of repositories that are showed in one explore page
482
+ EXPLORE_PAGING_NUM = 20
483
+ ; Number of issues that are showed in one page
484
+ ISSUE_PAGING_NUM = 10
485
+ ; Number of maximum commits showed in one activity feed
486
+ FEED_MAX_COMMIT_NUM = 5
487
+ ; Value of "theme-color" meta tag, used by Android >= 5.0
488
+ ; An invalid color like "none" or "disable" will have the default style
489
+ ; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
490
+ THEME_COLOR_META_TAG = `#ff5343`
491
+ ; Max size in bytes of files to be displayed (default is 8MB)
492
+ MAX_DISPLAY_FILE_SIZE = 8388608
493
+
494
+ [ui.admin]
495
+ ; Number of users that are showed in one page
496
+ USER_PAGING_NUM = 50
497
+ ; Number of repos that are showed in one page
498
+ REPO_PAGING_NUM = 50
499
+ ; Number of notices that are showed in one page
500
+ NOTICE_PAGING_NUM = 25
501
+ ; Number of organization that are showed in one page
502
+ ORG_PAGING_NUM = 50
503
+
504
+ [ui.user]
505
+ ; Number of repos that are showed in one page
506
+ REPO_PAGING_NUM = 15
507
+ ; Number of news feeds that are showed in one page
508
+ NEWS_FEED_PAGING_NUM = 20
509
+ ; Number of commits that are showed in one page
510
+ COMMITS_PAGING_NUM = 30
511
+
512
+ [prometheus]
513
+ ; Whether to enable Prometheus metrics.
514
+ ENABLED = true
515
+ ; Whether to enable HTTP Basic Authentication to protect metrics data.
516
+ ENABLE_BASIC_AUTH = false
517
+ ; The username for HTTP Basic Authentication.
518
+ BASIC_AUTH_USERNAME =
519
+ ; The password for HTTP Basic Authentication.
520
+ BASIC_AUTH_PASSWORD =
521
+
522
+ ; Extension mapping to highlight class
523
+ ; e.g. .toml=ini
524
+ [highlight.mapping]
525
+
526
+ [i18n]
527
+ LANGS = en-US,zh-CN
528
+ NAMES = English,简体中文
529
+
530
+ ; Used for jQuery DateTimePicker,
531
+ ; list of supported languages in https://xdsoft.net/jqplugins/datetimepicker/#lang
532
+ [i18n.datelang]
533
+ en-US = en
534
+ zh-CN = zh
535
+
536
+ [other]
537
+ ; Show time of template execution in the footer
538
+ SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
@@ -0,0 +1,11 @@
1
+ # Build and Release Folders
2
+ bin/
3
+ bin-debug/
4
+ bin-release/
5
+
6
+ # Other files and folders
7
+ .settings/
8
+
9
+ # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
10
+ # should NOT be excluded as they contain compiler settings and other important
11
+ # information for Eclipse / Flash Builder.
@@ -0,0 +1,5 @@
1
+ # Object file
2
+ *.o
3
+
4
+ # Ada Library Information
5
+ *.ali
@@ -0,0 +1 @@
1
+ *.agdai
@@ -0,0 +1,32 @@
1
+ # Built application files
2
+ *.apk
3
+ *.ap_
4
+
5
+ # Files for the Dalvik VM
6
+ *.dex
7
+
8
+ # Java class files
9
+ *.class
10
+
11
+ # Generated files
12
+ bin/
13
+ gen/
14
+
15
+ # Gradle files
16
+ .gradle/
17
+ build/
18
+
19
+ # Local configuration file (sdk path, etc)
20
+ local.properties
21
+
22
+ # Proguard folder generated by Eclipse
23
+ proguard/
24
+
25
+ # Log Files
26
+ *.log
27
+
28
+ # Android Studio Navigation editor temp files
29
+ .navigation/
30
+
31
+ # Android Studio captures folder
32
+ captures/
@@ -0,0 +1,3 @@
1
+ # Local configuration folder and symbol database
2
+ /.anjuta/
3
+ /.anjuta_sym_db.db
@@ -0,0 +1,2 @@
1
+ # Google App Engine generated folder
2
+ appengine-generated/
@@ -0,0 +1,3 @@
1
+ # Build folder and log file
2
+ build/
3
+ build.log
@@ -0,0 +1,13 @@
1
+ *.tar
2
+ *.tar.*
3
+ *.jar
4
+ *.exe
5
+ *.msi
6
+ *.zip
7
+ *.tgz
8
+ *.log
9
+ *.log.*
10
+ *.sig
11
+
12
+ pkg/
13
+ src/