You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.tmpl 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. {{template "base/head" .}}
  2. <div class="page-content install">
  3. <div class="ui middle very relaxed page grid">
  4. <div class="sixteen wide center aligned centered column">
  5. <h3 class="ui top attached header">
  6. {{.i18n.Tr "install.title"}}
  7. </h3>
  8. <div class="ui attached segment">
  9. {{template "base/alert" .}}
  10. <p>{{.i18n.Tr "install.docker_helper" "https://docs.gitea.io/en-us/install-with-docker/" | Safe}}</p>
  11. <form class="ui form" action="{{AppSubUrl}}/" method="post">
  12. <!-- Database Settings -->
  13. <h4 class="ui dividing header">{{.i18n.Tr "install.db_title"}}</h4>
  14. <p>{{.i18n.Tr "install.requite_db_desc"}}</p>
  15. <div class="inline required field {{if .Err_DbType}}error{{end}}">
  16. <label>{{.i18n.Tr "install.db_type"}}</label>
  17. <div class="ui selection database type dropdown">
  18. <input type="hidden" id="db_type" name="db_type" value="{{.CurDbOption}}">
  19. <div class="text">{{.CurDbOption}}</div>
  20. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  21. <div class="menu">
  22. {{range .DbOptions}}
  23. <div class="item" data-value="{{.}}">{{.}}</div>
  24. {{end}}
  25. </div>
  26. </div>
  27. </div>
  28. <div id="sql_settings" class="{{if or (eq .CurDbOption "SQLite3")}}hide{{end}}">
  29. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  30. <label for="db_host">{{.i18n.Tr "install.host"}}</label>
  31. <input id="db_host" name="db_host" value="{{.db_host}}">
  32. </div>
  33. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  34. <label for="db_user">{{.i18n.Tr "install.user"}}</label>
  35. <input id="db_user" name="db_user" value="{{.db_user}}">
  36. </div>
  37. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  38. <label for="db_passwd">{{.i18n.Tr "install.password"}}</label>
  39. <input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}">
  40. </div>
  41. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  42. <label for="db_name">{{.i18n.Tr "install.db_name"}}</label>
  43. <input id="db_name" name="db_name" value="{{.db_name}}">
  44. <span class="help">{{.i18n.Tr "install.db_helper"}}</span>
  45. </div>
  46. </div>
  47. <div id="pgsql_settings" class="{{if not (eq .CurDbOption "PostgreSQL")}}hide{{end}}">
  48. <div class="inline required field">
  49. <label>{{.i18n.Tr "install.ssl_mode"}}</label>
  50. <div class="ui selection database type dropdown">
  51. <input type="hidden" name="ssl_mode" value="{{if .ssl_mode}}{{.ssl_mode}}{{else}}disable{{end}}">
  52. <div class="default text">disable</div>
  53. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  54. <div class="menu">
  55. <div class="item" data-value="disable">Disable</div>
  56. <div class="item" data-value="require">Require</div>
  57. <div class="item" data-value="verify-full">Verify Full</div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="inline field {{if .Err_DbSetting}}error{{end}}">
  62. <label for="db_schema">{{.i18n.Tr "install.db_schema"}}</label>
  63. <input id="db_schema" name="db_schema" value="{{.db_schema}}">
  64. <span class="help">{{.i18n.Tr "install.db_schema_helper"}}</span>
  65. </div>
  66. </div>
  67. <div id="mysql_settings" class="{{if not (eq .CurDbOption "MySQL")}}hide{{end}}">
  68. <div class="inline required field">
  69. <label>{{.i18n.Tr "install.charset"}}</label>
  70. <div class="ui selection database type dropdown">
  71. <input type="hidden" name="charset" value="{{if .charset}}{{.charset}}{{else}}utf8mb4{{end}}">
  72. <div class="default text">utf8mb4</div>
  73. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  74. <div class="menu">
  75. <div class="item" data-value="utf8mb4">utf8mb4</div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div id="sqlite_settings" class="{{if not (or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB"))}}hide{{end}}">
  81. <div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
  82. <label for="db_path">{{.i18n.Tr "install.path"}}</label>
  83. <input id="db_path" name="db_path" value="{{.db_path}}">
  84. <span class="help">{{.i18n.Tr "install.sqlite_helper" | Safe}}</span>
  85. </div>
  86. </div>
  87. <!-- General Settings -->
  88. <h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
  89. <div class="inline required field {{if .Err_AppName}}error{{end}}">
  90. <label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
  91. <input id="app_name" name="app_name" value="{{.app_name}}" required>
  92. <span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
  93. </div>
  94. <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
  95. <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  96. <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
  97. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  98. </div>
  99. <div class="inline field {{if .Err_LFSRootPath}}error{{end}}">
  100. <label for="lfs_root_path">{{.i18n.Tr "install.lfs_path"}}</label>
  101. <input id="lfs_root_path" name="lfs_root_path" value="{{.lfs_root_path}}">
  102. <span class="help">{{.i18n.Tr "install.lfs_path_helper"}}</span>
  103. </div>
  104. <div class="inline required field {{if .Err_RunUser}}error{{end}}">
  105. <label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  106. <input id="run_user" name="run_user" value="{{.run_user}}" required>
  107. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  108. </div>
  109. <div class="inline required field">
  110. <label for="domain">{{.i18n.Tr "install.domain"}}</label>
  111. <input id="domain" name="domain" value="{{.domain}}" placeholder="e.g. try.gitea.io" required>
  112. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  113. </div>
  114. <div class="inline field">
  115. <label for="ssh_port">{{.i18n.Tr "install.ssh_port"}}</label>
  116. <input id="ssh_port" name="ssh_port" value="{{.ssh_port}}">
  117. <span class="help">{{.i18n.Tr "install.ssh_port_helper"}}</span>
  118. </div>
  119. <div class="inline required field">
  120. <label for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  121. <input id="http_port" name="http_port" value="{{.http_port}}" required>
  122. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  123. </div>
  124. <div class="inline required field">
  125. <label for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  126. <input id="app_url" name="app_url" value="{{.app_url}}" placeholder="e.g. https://try.gitea.io" required>
  127. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  128. </div>
  129. <div class="inline required field">
  130. <label for="log_root_path">{{.i18n.Tr "install.log_root_path"}}</label>
  131. <input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
  132. <span class="help">{{.i18n.Tr "install.log_root_path_helper"}}</span>
  133. </div>
  134. <!-- Optional Settings -->
  135. <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4>
  136. <!-- Email -->
  137. <details class="optional field">
  138. <summary class="title py-3{{if .Err_SMTP}} text red{{end}}">
  139. {{.i18n.Tr "install.email_title"}}
  140. </summary>
  141. <div class="inline field">
  142. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  143. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  144. </div>
  145. <div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
  146. <label for="smtp_from">{{.i18n.Tr "install.smtp_from"}}</label>
  147. <input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
  148. <span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
  149. </div>
  150. <div class="inline field {{if .Err_SMTPUser}}error{{end}}">
  151. <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
  152. <input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
  153. </div>
  154. <div class="inline field">
  155. <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
  156. <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
  157. </div>
  158. <div class="inline field">
  159. <div class="ui checkbox">
  160. <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label>
  161. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  162. </div>
  163. </div>
  164. <div class="inline field">
  165. <div class="ui checkbox">
  166. <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label>
  167. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  168. </div>
  169. </div>
  170. </details>
  171. <!-- Server and other services -->
  172. <details class="optional field">
  173. <summary class="title py-3{{if .Err_Services}} text red{{end}}">
  174. {{.i18n.Tr "install.server_service_title"}}
  175. </summary>
  176. <div class="inline field">
  177. <div class="ui checkbox" id="offline-mode">
  178. <label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
  179. <input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
  180. </div>
  181. </div>
  182. <div class="inline field">
  183. <div class="ui checkbox" id="disable-gravatar">
  184. <label class="poping up" data-content="{{.i18n.Tr "install.disable_gravatar_popup"}}"><strong>{{.i18n.Tr "install.disable_gravatar"}}</strong></label>
  185. <input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
  186. </div>
  187. </div>
  188. <div class="inline field">
  189. <div class="ui checkbox" id="federated-avatar-lookup">
  190. <label class="poping up" data-content="{{.i18n.Tr "install.federated_avatar_lookup_popup"}}"><strong>{{.i18n.Tr "install.federated_avatar_lookup"}}</strong></label>
  191. <input name="enable_federated_avatar" type="checkbox" {{if .enable_federated_avatar}}checked{{end}}>
  192. </div>
  193. </div>
  194. <div class="inline field">
  195. <div class="ui checkbox" id="enable-openid-signin">
  196. <label class="poping up" data-content="{{.i18n.Tr "install.openid_signin_popup"}}"><strong>{{.i18n.Tr "install.openid_signin"}}</strong></label>
  197. <input name="enable_open_id_sign_in" type="checkbox" {{if .enable_open_id_sign_in}}checked{{end}}>
  198. </div>
  199. </div>
  200. <div class="inline field">
  201. <div class="ui checkbox" id="disable-registration">
  202. <label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>
  203. <input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
  204. </div>
  205. </div>
  206. <div class="inline field">
  207. <div class="ui checkbox" id="allow-only-external-registration">
  208. <label class="poping up" data-content="{{.i18n.Tr "install.allow_only_external_registration_popup"}}"><strong>{{.i18n.Tr "install.allow_only_external_registration_popup"}}</strong></label>
  209. <input name="allow_only_external_registration" type="checkbox" {{if .allow_only_external_registration}}checked{{end}}>
  210. </div>
  211. </div>
  212. <div class="inline field">
  213. <div class="ui checkbox" id="enable-openid-signup">
  214. <label class="poping up" data-content="{{.i18n.Tr "install.openid_signup_popup"}}"><strong>{{.i18n.Tr "install.openid_signup"}}</strong></label>
  215. <input name="enable_open_id_sign_up" type="checkbox" {{if .enable_open_id_sign_up}}checked{{end}}>
  216. </div>
  217. </div>
  218. <div class="inline field">
  219. <div class="ui checkbox" id="enable-captcha">
  220. <label class="poping up" data-content="{{.i18n.Tr "install.enable_captcha_popup"}}"><strong>{{.i18n.Tr "install.enable_captcha"}}</strong></label>
  221. <input name="enable_captcha" type="checkbox" {{if .enable_captcha}}checked{{end}}>
  222. </div>
  223. </div>
  224. <div class="inline field">
  225. <div class="ui checkbox">
  226. <label class="poping up" data-content="{{.i18n.Tr "install.require_sign_in_view_popup"}}"><strong>{{.i18n.Tr "install.require_sign_in_view"}}</strong></label>
  227. <input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
  228. </div>
  229. </div>
  230. <div class="inline field">
  231. <div class="ui checkbox">
  232. <label class="poping up" data-content="{{.i18n.Tr "install.default_keep_email_private_popup"}}"><strong>{{.i18n.Tr "install.default_keep_email_private"}}</strong></label>
  233. <input name="default_keep_email_private" type="checkbox" {{if .default_keep_email_private}}checked{{end}}>
  234. </div>
  235. </div>
  236. <div class="inline field">
  237. <div class="ui checkbox">
  238. <label class="poping up" data-content="{{.i18n.Tr "install.default_allow_create_organization_popup"}}"><strong>{{.i18n.Tr "install.default_allow_create_organization"}}</strong></label>
  239. <input name="default_allow_create_organization" type="checkbox" {{if .default_allow_create_organization}}checked{{end}}>
  240. </div>
  241. </div>
  242. <div class="inline field">
  243. <div class="ui checkbox">
  244. <label class="poping up" data-content="{{.i18n.Tr "install.default_enable_timetracking_popup"}}"><strong>{{.i18n.Tr "install.default_enable_timetracking"}}</strong></label>
  245. <input name="default_enable_timetracking" type="checkbox" {{if .default_enable_timetracking}}checked{{end}}>
  246. </div>
  247. </div>
  248. <div class="inline field">
  249. <label for="no_reply_address">{{.i18n.Tr "install.no_reply_address"}}</label>
  250. <input id="_no_reply_address" name="no_reply_address" value="{{.no_reply_address}}">
  251. <span class="help">{{.i18n.Tr "install.no_reply_address_helper"}}</span>
  252. </div>
  253. <div class="inline field">
  254. <label for="password_algorithm">{{.i18n.Tr "install.password_algorithm"}}</label>
  255. <div class="ui selection dropdown">
  256. <input id="password_algorithm" type="hidden" name="password_algorithm" value="{{.password_algorithm}}">
  257. <div class="text">{{.password_algorithm}}</div>
  258. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  259. <div class="menu">
  260. {{range .PasswordHashAlgorithms}}
  261. <div class="item" data-value="{{.}}">{{.}}</div>
  262. {{end}}
  263. </div>
  264. </div>
  265. <span class="help">{{.i18n.Tr "install.password_algorithm_helper"}}</span>
  266. </div>
  267. </details>
  268. <!-- Admin -->
  269. <details class="optional field">
  270. <summary class="title py-3{{if .Err_Admin}} text red{{end}}">
  271. {{.i18n.Tr "install.admin_title"}}
  272. </summary>
  273. <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p>
  274. <div class="inline field {{if .Err_AdminName}}error{{end}}">
  275. <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  276. <input id="admin_name" name="admin_name" value="{{.admin_name}}">
  277. </div>
  278. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  279. <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  280. <input id="admin_passwd" name="admin_passwd" type="password" autocomplete="new-password" value="{{.admin_passwd}}">
  281. </div>
  282. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  283. <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  284. <input id="admin_confirm_passwd" name="admin_confirm_passwd" autocomplete="new-password" type="password" value="{{.admin_confirm_passwd}}">
  285. </div>
  286. <div class="inline field {{if .Err_AdminEmail}}error{{end}}">
  287. <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  288. <input id="admin_email" name="admin_email" type="email" value="{{.admin_email}}">
  289. </div>
  290. </details>
  291. <div class="ui divider"></div>
  292. <div class="inline field">
  293. <label></label>
  294. <button class="ui primary button">{{.i18n.Tr "install.install_btn_confirm"}}</button>
  295. </div>
  296. </form>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. <img style="display: none" src="{{AssetUrlPrefix}}/img/loading.png"/>
  302. {{template "base/footer" .}}