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.

230 lines
12 KiB

  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. <form class="ui form" action="{{AppSubUrl}}/install" method="post">
  11. <!-- Dtabase Settings -->
  12. <h4 class="ui dividing header">{{.i18n.Tr "install.db_title"}}</h4>
  13. <p>{{.i18n.Tr "install.requite_db_desc"}}</p>
  14. <div class="inline required field {{if .Err_DbType}}error{{end}}">
  15. <label>{{.i18n.Tr "install.db_type"}}</label>
  16. <div class="ui selection database type dropdown">
  17. <input type="hidden" id="db_type" name="db_type" value="{{.CurDbOption}}">
  18. <div class="text">{{.CurDbOption}}</div>
  19. <i class="dropdown icon"></i>
  20. <div class="menu">
  21. {{range .DbOptions}}
  22. <div class="item" data-value="{{.}}">{{.}}</div>
  23. {{end}}
  24. </div>
  25. </div>
  26. </div>
  27. <div id="sql_settings" class="{{if or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB")}}hide{{end}}">
  28. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  29. <label for="db_host">{{.i18n.Tr "install.host"}}</label>
  30. <input id="db_host" name="db_host" value="{{.db_host}}">
  31. </div>
  32. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  33. <label for="db_user">{{.i18n.Tr "install.user"}}</label>
  34. <input id="db_user" name="db_user" value="{{.db_user}}">
  35. </div>
  36. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  37. <label for="db_passwd">{{.i18n.Tr "install.password"}}</label>
  38. <input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}">
  39. </div>
  40. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  41. <label for="db_name">{{.i18n.Tr "install.db_name"}}</label>
  42. <input id="db_name" name="db_name" value="{{.db_name}}">
  43. <span class="help">{{.i18n.Tr "install.db_helper"}}</span>
  44. </div>
  45. </div>
  46. <div id="pgsql_settings" class="{{if not (eq .CurDbOption "PostgreSQL")}}hide{{end}}">
  47. <div class="inline required field">
  48. <label>{{.i18n.Tr "install.ssl_mode"}}</label>
  49. <div class="ui selection database type dropdown">
  50. <input type="hidden" name="ssl_mode" value="{{if .ssl_mode}}{{.ssl_mode}}{{else}}disable{{end}}">
  51. <div class="default text">disable</div>
  52. <i class="dropdown icon"></i>
  53. <div class="menu">
  54. <div class="item" data-value="disable">Disable</div>
  55. <div class="item" data-value="require">Require</div>
  56. <div class="item" data-value="verify-full">Verify Full</div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div id="sqlite_settings" class="{{if not (or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB"))}}hide{{end}}">
  62. <div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
  63. <label for="db_path">{{.i18n.Tr "install.path"}}</label>
  64. <input id="db_path" name="db_path" value="{{.db_path}}">
  65. <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span>
  66. </div>
  67. </div>
  68. <!-- General Settings -->
  69. <h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
  70. <div class="inline required field {{if .Err_AppName}}error{{end}}">
  71. <label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
  72. <input id="app_name" name="app_name" value="{{.app_name}}" required>
  73. <span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
  74. </div>
  75. <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
  76. <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  77. <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
  78. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  79. </div>
  80. <div class="inline required field {{if .Err_RunUser}}error{{end}}">
  81. <label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  82. <input id="run_user" name="run_user" value="{{.run_user}}" required>
  83. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  84. </div>
  85. <div class="inline required field">
  86. <label for="domain">{{.i18n.Tr "install.domain"}}</label>
  87. <input id="domain" name="domain" value="{{.domain}}" placeholder="e.g. try.gogs.io" required>
  88. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  89. </div>
  90. <div class="inline required field">
  91. <label for="ssh_port">{{.i18n.Tr "install.ssh_port"}}</label>
  92. <input id="ssh_port" name="ssh_port" value="{{.ssh_port}}">
  93. <span class="help">{{.i18n.Tr "install.ssh_port_helper"}}</span>
  94. </div>
  95. <div class="inline required field">
  96. <label for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  97. <input id="http_port" name="http_port" value="{{.http_port}}" required>
  98. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  99. </div>
  100. <div class="inline required field">
  101. <label for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  102. <input id="app_url" name="app_url" value="{{.app_url}}" placeholder="e.g. https://try.gogs.io" required>
  103. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  104. </div>
  105. <!-- Optional Settings -->
  106. <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4>
  107. <!-- Email -->
  108. <div class="ui accordion optional field">
  109. <div class="title {{if .Err_SMTP}}text red{{end}}">
  110. <i class="icon dropdown"></i>
  111. {{.i18n.Tr "install.email_title"}}
  112. </div>
  113. <div class="content">
  114. <div class="inline field">
  115. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  116. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  117. </div>
  118. <div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
  119. <label for="smtp_from">{{.i18n.Tr "install.smtp_from"}}</label>
  120. <input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
  121. <span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
  122. </div>
  123. <div class="inline field {{if .Err_SMTPEmail}}error{{end}}">
  124. <label for="smtp_email">{{.i18n.Tr "install.mailer_user"}}</label>
  125. <input id="smtp_email" name="smtp_email" value="{{.smtp_email}}">
  126. </div>
  127. <div class="inline field">
  128. <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
  129. <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
  130. </div>
  131. <div class="inline field">
  132. <div class="ui checkbox">
  133. <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label>
  134. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  135. </div>
  136. </div>
  137. <div class="inline field">
  138. <div class="ui checkbox">
  139. <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label>
  140. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- Server and other services -->
  146. <div class="ui accordion optional field">
  147. <div class="title {{if .Err_Services}}text red{{end}}">
  148. <i class="icon dropdown"></i>
  149. {{.i18n.Tr "install.server_service_title"}}
  150. </div>
  151. <div class="content">
  152. <div class="inline field">
  153. <div class="ui checkbox" id="offline-mode">
  154. <label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
  155. <input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
  156. </div>
  157. </div>
  158. <div class="inline field">
  159. <div class="ui checkbox" id="disable-gravatar">
  160. <label class="poping up" data-content="{{.i18n.Tr "install.disable_gravatar_popup"}}"><strong>{{.i18n.Tr "install.disable_gravatar"}}</strong></label>
  161. <input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
  162. </div>
  163. </div>
  164. <div class="inline field">
  165. <div class="ui checkbox" id="disable-registration">
  166. <label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>
  167. <input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
  168. </div>
  169. </div>
  170. <div class="inline field">
  171. <div class="ui checkbox" id="enable-captcha">
  172. <label class="poping up" data-content="{{.i18n.Tr "install.enable_captcha_popup"}}"><strong>{{.i18n.Tr "install.enable_captcha"}}</strong></label>
  173. <input name="enable_captcha" type="checkbox" {{if .enable_captcha}}checked{{end}}>
  174. </div>
  175. </div>
  176. <div class="inline field">
  177. <div class="ui checkbox">
  178. <label class="poping up" data-content="{{.i18n.Tr "install.require_sign_in_view_popup"}}"><strong>{{.i18n.Tr "install.require_sign_in_view"}}</strong></label>
  179. <input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- Admin -->
  185. <div class="ui accordion optional field">
  186. <div class="title {{if .Err_Admin}}text red{{end}}">
  187. <i class="icon dropdown"></i>
  188. {{.i18n.Tr "install.admin_title"}}
  189. </div>
  190. <div class="content">
  191. <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p>
  192. <div class="inline field {{if .Err_AdminName}}error{{end}}">
  193. <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  194. <input id="admin_name" name="admin_name" value="{{.admin_name}}">
  195. </div>
  196. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  197. <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  198. <input id="admin_passwd" name="admin_passwd" type="password" value="{{.admin_passwd}}">
  199. </div>
  200. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  201. <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  202. <input id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" value="{{.admin_confirm_passwd}}">
  203. </div>
  204. <div class="inline field {{if .Err_AdminEmail}}error{{end}}">
  205. <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  206. <input id="admin_email" name="admin_email" value="{{.admin_email}}">
  207. </div>
  208. </div>
  209. </div>
  210. <div class="ui divider"></div>
  211. <div class="inline field">
  212. <label></label>
  213. <button class="ui primary button">{{.i18n.Tr "install.install_gogs"}}</button>
  214. </div>
  215. </form>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. {{template "base/footer" .}}