本站源代码
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.

306 lines
15KB

  1. {{template "base/head" .}}
  2. <div class="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}}/install" method="post">
  12. <!-- Dtabase 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. <i class="dropdown icon"></i>
  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. <i class="dropdown icon"></i>
  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>
  62. <div id="mysql_settings" class="{{if not (eq .CurDbOption "MySQL")}}hide{{end}}">
  63. <div class="inline required field">
  64. <label>{{.i18n.Tr "install.charset"}}</label>
  65. <div class="ui selection database type dropdown">
  66. <input type="hidden" name="charset" value="{{if .charset}}{{.charset}}{{else}}utf8{{end}}">
  67. <div class="default text">utf8</div>
  68. <i class="dropdown icon"></i>
  69. <div class="menu">
  70. <div class="item" data-value="utf8">utf8</div>
  71. <div class="item" data-value="utf8mb4">utf8mb4</div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div id="sqlite_settings" class="{{if not (or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB"))}}hide{{end}}">
  77. <div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
  78. <label for="db_path">{{.i18n.Tr "install.path"}}</label>
  79. <input id="db_path" name="db_path" value="{{.db_path}}">
  80. <span class="help">{{.i18n.Tr "install.sqlite_helper" | Safe}}</span>
  81. </div>
  82. </div>
  83. <!-- General Settings -->
  84. <h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
  85. <div class="inline required field {{if .Err_AppName}}error{{end}}">
  86. <label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
  87. <input id="app_name" name="app_name" value="{{.app_name}}" required>
  88. <span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
  89. </div>
  90. <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
  91. <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  92. <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
  93. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  94. </div>
  95. <div class="inline field {{if .Err_LFSRootPath}}error{{end}}">
  96. <label for="lfs_root_path">{{.i18n.Tr "install.lfs_path"}}</label>
  97. <input id="lfs_root_path" name="lfs_root_path" value="{{.lfs_root_path}}">
  98. <span class="help">{{.i18n.Tr "install.lfs_path_helper"}}</span>
  99. </div>
  100. <div class="inline required field {{if .Err_RunUser}}error{{end}}">
  101. <label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  102. <input id="run_user" name="run_user" value="{{.run_user}}" required>
  103. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  104. </div>
  105. <div class="inline required field">
  106. <label for="domain">{{.i18n.Tr "install.domain"}}</label>
  107. <input id="domain" name="domain" value="{{.domain}}" placeholder="e.g. try.gitea.io" required>
  108. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  109. </div>
  110. <div class="inline field">
  111. <label for="ssh_port">{{.i18n.Tr "install.ssh_port"}}</label>
  112. <input id="ssh_port" name="ssh_port" value="{{.ssh_port}}">
  113. <span class="help">{{.i18n.Tr "install.ssh_port_helper"}}</span>
  114. </div>
  115. <div class="inline required field">
  116. <label for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  117. <input id="http_port" name="http_port" value="{{.http_port}}" required>
  118. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  119. </div>
  120. <div class="inline required field">
  121. <label for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  122. <input id="app_url" name="app_url" value="{{.app_url}}" placeholder="e.g. https://try.gitea.io" required>
  123. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  124. </div>
  125. <div class="inline required field">
  126. <label for="log_root_path">{{.i18n.Tr "install.log_root_path"}}</label>
  127. <input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
  128. <span class="help">{{.i18n.Tr "install.log_root_path_helper"}}</span>
  129. </div>
  130. <!-- Optional Settings -->
  131. <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4>
  132. <!-- Email -->
  133. <div class="ui accordion optional field">
  134. <div class="title {{if .Err_SMTP}}text red{{end}}">
  135. <i class="icon dropdown"></i>
  136. {{.i18n.Tr "install.email_title"}}
  137. </div>
  138. <div class="content">
  139. <div class="inline field">
  140. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  141. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  142. </div>
  143. <div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
  144. <label for="smtp_from">{{.i18n.Tr "install.smtp_from"}}</label>
  145. <input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
  146. <span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
  147. </div>
  148. <div class="inline field {{if .Err_SMTPUser}}error{{end}}">
  149. <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
  150. <input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
  151. </div>
  152. <div class="inline field">
  153. <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
  154. <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
  155. </div>
  156. <div class="inline field">
  157. <div class="ui checkbox">
  158. <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label>
  159. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  160. </div>
  161. </div>
  162. <div class="inline field">
  163. <div class="ui checkbox">
  164. <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label>
  165. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <!-- Server and other services -->
  171. <div class="ui accordion optional field">
  172. <div class="title {{if .Err_Services}}text red{{end}}">
  173. <i class="icon dropdown"></i>
  174. {{.i18n.Tr "install.server_service_title"}}
  175. </div>
  176. <div class="content">
  177. <div class="inline field">
  178. <div class="ui checkbox" id="offline-mode">
  179. <label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
  180. <input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
  181. </div>
  182. </div>
  183. <div class="inline field">
  184. <div class="ui checkbox" id="disable-gravatar">
  185. <label class="poping up" data-content="{{.i18n.Tr "install.disable_gravatar_popup"}}"><strong>{{.i18n.Tr "install.disable_gravatar"}}</strong></label>
  186. <input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
  187. </div>
  188. </div>
  189. <div class="inline field">
  190. <div class="ui checkbox" id="federated-avatar-lookup">
  191. <label class="poping up" data-content="{{.i18n.Tr "install.federated_avatar_lookup_popup"}}"><strong>{{.i18n.Tr "install.federated_avatar_lookup"}}</strong></label>
  192. <input name="enable_federated_avatar" type="checkbox" {{if .enable_federated_avatar}}checked{{end}}>
  193. </div>
  194. </div>
  195. <div class="inline field">
  196. <div class="ui checkbox" id="enable-openid-signin">
  197. <label class="poping up" data-content="{{.i18n.Tr "install.openid_signin_popup"}}"><strong>{{.i18n.Tr "install.openid_signin"}}</strong></label>
  198. <input name="enable_open_id_sign_in" type="checkbox" {{if .enable_open_id_sign_in}}checked{{end}}>
  199. </div>
  200. </div>
  201. <div class="inline field">
  202. <div class="ui checkbox" id="disable-registration">
  203. <label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>
  204. <input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
  205. </div>
  206. </div>
  207. <div class="inline field">
  208. <div class="ui checkbox" id="allow-only-external-registration">
  209. <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>
  210. <input name="allow_only_external_registration" type="checkbox" {{if .allow_only_external_registration}}checked{{end}}>
  211. </div>
  212. </div>
  213. <div class="inline field">
  214. <div class="ui checkbox" id="enable-openid-signup">
  215. <label class="poping up" data-content="{{.i18n.Tr "install.openid_signup_popup"}}"><strong>{{.i18n.Tr "install.openid_signup"}}</strong></label>
  216. <input name="enable_open_id_sign_up" type="checkbox" {{if .enable_open_id_sign_up}}checked{{end}}>
  217. </div>
  218. </div>
  219. <div class="inline field">
  220. <div class="ui checkbox" id="enable-captcha">
  221. <label class="poping up" data-content="{{.i18n.Tr "install.enable_captcha_popup"}}"><strong>{{.i18n.Tr "install.enable_captcha"}}</strong></label>
  222. <input name="enable_captcha" type="checkbox" {{if .enable_captcha}}checked{{end}}>
  223. </div>
  224. </div>
  225. <div class="inline field">
  226. <div class="ui checkbox">
  227. <label class="poping up" data-content="{{.i18n.Tr "install.require_sign_in_view_popup"}}"><strong>{{.i18n.Tr "install.require_sign_in_view"}}</strong></label>
  228. <input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
  229. </div>
  230. </div>
  231. <div class="inline field">
  232. <div class="ui checkbox">
  233. <label class="poping up" data-content="{{.i18n.Tr "install.default_keep_email_private_popup"}}"><strong>{{.i18n.Tr "install.default_keep_email_private"}}</strong></label>
  234. <input name="default_keep_email_private" type="checkbox" {{if .default_keep_email_private}}checked{{end}}>
  235. </div>
  236. </div>
  237. <div class="inline field">
  238. <div class="ui checkbox">
  239. <label class="poping up" data-content="{{.i18n.Tr "install.default_allow_create_organization_popup"}}"><strong>{{.i18n.Tr "install.default_allow_create_organization"}}</strong></label>
  240. <input name="default_allow_create_organization" type="checkbox" {{if .default_allow_create_organization}}checked{{end}}>
  241. </div>
  242. </div>
  243. <div class="inline field">
  244. <div class="ui checkbox">
  245. <label class="poping up" data-content="{{.i18n.Tr "install.default_enable_timetracking_popup"}}"><strong>{{.i18n.Tr "install.default_enable_timetracking"}}</strong></label>
  246. <input name="default_enable_timetracking" type="checkbox" {{if .default_enable_timetracking}}checked{{end}}>
  247. </div>
  248. </div>
  249. <div class="inline field">
  250. <label for="no_reply_address">{{.i18n.Tr "install.no_reply_address"}}</label>
  251. <input id="_no_reply_address" name="no_reply_address" value="{{.no_reply_address}}">
  252. <span class="help">{{.i18n.Tr "install.no_reply_address_helper"}}</span>
  253. </div>
  254. </div>
  255. </div>
  256. <!-- Admin -->
  257. <div class="ui accordion optional field">
  258. <div class="title {{if .Err_Admin}}text red{{end}}">
  259. <i class="icon dropdown"></i>
  260. {{.i18n.Tr "install.admin_title"}}
  261. </div>
  262. <div class="content">
  263. <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p>
  264. <div class="inline field {{if .Err_AdminName}}error{{end}}">
  265. <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  266. <input id="admin_name" name="admin_name" value="{{.admin_name}}">
  267. </div>
  268. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  269. <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  270. <input id="admin_passwd" name="admin_passwd" type="password" value="{{.admin_passwd}}">
  271. </div>
  272. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  273. <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  274. <input id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" value="{{.admin_confirm_passwd}}">
  275. </div>
  276. <div class="inline field {{if .Err_AdminEmail}}error{{end}}">
  277. <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  278. <input id="admin_email" name="admin_email" type="email" value="{{.admin_email}}">
  279. </div>
  280. </div>
  281. </div>
  282. <div class="ui divider"></div>
  283. <div class="inline field">
  284. <label></label>
  285. <button class="ui primary button">{{.i18n.Tr "install.install_btn_confirm"}}</button>
  286. </div>
  287. </form>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. {{template "base/footer" .}}
上海开阖软件有限公司 沪ICP备12045867号-1