Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

install.tmpl 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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") (eq .CurDbOption "TiDB")}}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="sqlite_settings" class="{{if not (or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB"))}}hide{{end}}">
  63. <div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
  64. <label for="db_path">{{.i18n.Tr "install.path"}}</label>
  65. <input id="db_path" name="db_path" value="{{.db_path}}">
  66. <span class="help">{{.i18n.Tr "install.sqlite_helper" | Safe}}</span>
  67. </div>
  68. </div>
  69. <!-- General Settings -->
  70. <h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
  71. <div class="inline required field {{if .Err_AppName}}error{{end}}">
  72. <label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
  73. <input id="app_name" name="app_name" value="{{.app_name}}" required>
  74. <span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
  75. </div>
  76. <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
  77. <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  78. <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
  79. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  80. </div>
  81. <div class="inline field {{if .Err_LFSRootPath}}error{{end}}">
  82. <label for="lfs_root_path">{{.i18n.Tr "install.lfs_path"}}</label>
  83. <input id="lfs_root_path" name="lfs_root_path" value="{{.lfs_root_path}}">
  84. <span class="help">{{.i18n.Tr "install.lfs_path_helper"}}</span>
  85. </div>
  86. <div class="inline required field {{if .Err_RunUser}}error{{end}}">
  87. <label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  88. <input id="run_user" name="run_user" value="{{.run_user}}" required>
  89. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  90. </div>
  91. <div class="inline required field">
  92. <label for="domain">{{.i18n.Tr "install.domain"}}</label>
  93. <input id="domain" name="domain" value="{{.domain}}" placeholder="e.g. try.gitea.io" required>
  94. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  95. </div>
  96. <div class="inline required field">
  97. <label for="ssh_port">{{.i18n.Tr "install.ssh_port"}}</label>
  98. <input id="ssh_port" name="ssh_port" value="{{.ssh_port}}">
  99. <span class="help">{{.i18n.Tr "install.ssh_port_helper"}}</span>
  100. </div>
  101. <div class="inline required field">
  102. <label for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  103. <input id="http_port" name="http_port" value="{{.http_port}}" required>
  104. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  105. </div>
  106. <div class="inline required field">
  107. <label for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  108. <input id="app_url" name="app_url" value="{{.app_url}}" placeholder="e.g. https://try.gitea.io" required>
  109. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  110. </div>
  111. <div class="inline required field">
  112. <label for="log_root_path">{{.i18n.Tr "install.log_root_path"}}</label>
  113. <input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
  114. <span class="help">{{.i18n.Tr "install.log_root_path_helper"}}</span>
  115. </div>
  116. <!-- Optional Settings -->
  117. <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4>
  118. <!-- Email -->
  119. <div class="ui accordion optional field">
  120. <div class="title {{if .Err_SMTP}}text red{{end}}">
  121. <i class="icon dropdown"></i>
  122. {{.i18n.Tr "install.email_title"}}
  123. </div>
  124. <div class="content">
  125. <div class="inline field">
  126. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  127. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  128. </div>
  129. <div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
  130. <label for="smtp_from">{{.i18n.Tr "install.smtp_from"}}</label>
  131. <input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
  132. <span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
  133. </div>
  134. <div class="inline field {{if .Err_SMTPUser}}error{{end}}">
  135. <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
  136. <input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
  137. </div>
  138. <div class="inline field">
  139. <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
  140. <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
  141. </div>
  142. <div class="inline field">
  143. <div class="ui checkbox">
  144. <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label>
  145. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  146. </div>
  147. </div>
  148. <div class="inline field">
  149. <div class="ui checkbox">
  150. <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label>
  151. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <!-- Server and other services -->
  157. <div class="ui accordion optional field">
  158. <div class="title {{if .Err_Services}}text red{{end}}">
  159. <i class="icon dropdown"></i>
  160. {{.i18n.Tr "install.server_service_title"}}
  161. </div>
  162. <div class="content">
  163. <div class="inline field">
  164. <div class="ui checkbox" id="offline-mode">
  165. <label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
  166. <input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
  167. </div>
  168. </div>
  169. <div class="inline field">
  170. <div class="ui checkbox" id="disable-gravatar">
  171. <label class="poping up" data-content="{{.i18n.Tr "install.disable_gravatar_popup"}}"><strong>{{.i18n.Tr "install.disable_gravatar"}}</strong></label>
  172. <input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
  173. </div>
  174. </div>
  175. <div class="inline field">
  176. <div class="ui checkbox" id="federated-avatar-lookup">
  177. <label class="poping up" data-content="{{.i18n.Tr "install.federated_avatar_lookup_popup"}}"><strong>{{.i18n.Tr "install.federated_avatar_lookup"}}</strong></label>
  178. <input name="enable_federated_avatar" type="checkbox" {{if .enable_federated_avatar}}checked{{end}}>
  179. </div>
  180. </div>
  181. <div class="inline field">
  182. <div class="ui checkbox" id="disable-registration">
  183. <label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>
  184. <input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
  185. </div>
  186. </div>
  187. <div class="inline field">
  188. <div class="ui checkbox" id="enable-captcha">
  189. <label class="poping up" data-content="{{.i18n.Tr "install.enable_captcha_popup"}}"><strong>{{.i18n.Tr "install.enable_captcha"}}</strong></label>
  190. <input name="enable_captcha" type="checkbox" {{if .enable_captcha}}checked{{end}}>
  191. </div>
  192. </div>
  193. <div class="inline field">
  194. <div class="ui checkbox">
  195. <label class="poping up" data-content="{{.i18n.Tr "install.require_sign_in_view_popup"}}"><strong>{{.i18n.Tr "install.require_sign_in_view"}}</strong></label>
  196. <input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
  197. </div>
  198. </div>
  199. <div class="inline field">
  200. <div class="ui checkbox">
  201. <label class="poping up" data-content="{{.i18n.Tr "install.default_keep_email_private_popup"}}"><strong>{{.i18n.Tr "install.default_keep_email_private"}}</strong></label>
  202. <input name="default_keep_email_private" type="checkbox" {{if .default_keep_email_private}}checked{{end}}>
  203. </div>
  204. </div>
  205. <div class="inline field">
  206. <label for="no_reply_address">{{.i18n.Tr "install.no_reply_address"}}</label>
  207. <input id="_no_reply_address" name="no_reply_address" value="{{.no_reply_address}}">
  208. <span class="help">{{.i18n.Tr "install.no_reply_address_helper"}}</span>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- Admin -->
  213. <div class="ui accordion optional field">
  214. <div class="title {{if .Err_Admin}}text red{{end}}">
  215. <i class="icon dropdown"></i>
  216. {{.i18n.Tr "install.admin_title"}}
  217. </div>
  218. <div class="content">
  219. <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p>
  220. <div class="inline field {{if .Err_AdminName}}error{{end}}">
  221. <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  222. <input id="admin_name" name="admin_name" value="{{.admin_name}}">
  223. </div>
  224. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  225. <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  226. <input id="admin_passwd" name="admin_passwd" type="password" value="{{.admin_passwd}}">
  227. </div>
  228. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  229. <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  230. <input id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" value="{{.admin_confirm_passwd}}">
  231. </div>
  232. <div class="inline field {{if .Err_AdminEmail}}error{{end}}">
  233. <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  234. <input id="admin_email" name="admin_email" type="email" value="{{.admin_email}}">
  235. </div>
  236. </div>
  237. </div>
  238. <div class="ui divider"></div>
  239. <div class="inline field">
  240. <label></label>
  241. <button class="ui primary button">{{.i18n.Tr "install.install_btn_confirm"}}</button>
  242. </div>
  243. </form>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. {{template "base/footer" .}}