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.

210 lines
9.6 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {{template "base/head" .}}
  2. <div id="body" class="container">
  3. <form action="/install" method="post" class="form-horizontal card" id="install-card">
  4. {{.CsrfTokenHtml}}
  5. <h3>Install Steps For First-time Run</h3>
  6. <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
  7. <p class="help-block text-center">Gogs requires MySQL or PostgreSQL, SQLite3 only available for official binary version</p>
  8. <div class="form-group">
  9. <label class="col-md-3 control-label">Database Type: </label>
  10. <div class="col-md-8">
  11. <select name="database" id="install-database" class="form-control">
  12. <option value="mysql">MySQL</option>
  13. <option value="pgsql">PostgreSQL</option>
  14. <option value="sqlite">SQLite3</option>
  15. </select>
  16. </div>
  17. </div>
  18. <div class="server-sql">
  19. <div class="form-group">
  20. <label class="col-md-3 control-label">Host: </label>
  21. <div class="col-md-8">
  22. <input name="host" class="form-control" placeholder="Type database server host" value="{{.host}}">
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="col-md-3 control-label">User: </label>
  27. <div class="col-md-8">
  28. <input name="user" class="form-control" placeholder="Type database username" value="{{.user}}">
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="col-md-3 control-label">Password: </label>
  33. <div class="col-md-8">
  34. <input name="passwd" type="password" class="form-control" placeholder="Type database password" value="{{.passwd}}">
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-md-3 control-label">Database Name: </label>
  39. <div class="col-md-8">
  40. <input name="database_name" type="text" class="form-control" placeholder="Type mysql database name" value="{{.database_name}}">
  41. <p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
  42. </div>
  43. </div>
  44. <div class="form-group pgsql-setting hide">
  45. <label class="col-md-3 control-label">SSL Mode: </label>
  46. <div class="col-md-8">
  47. <select name="ssl_mode" class="form-control">
  48. <option value="disable">Disable</option>
  49. <option value="require">Require</option>
  50. <option value="verify-full">Verify Full</option>
  51. </select>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="sqlite-setting hide">
  56. <div class="form-group">
  57. <label class="col-md-3 control-label">Path: </label>
  58. <div class="col-md-8">
  59. <input name="database_path" class="form-control" placeholder="Type sqlite3 file path" value="{{.database_path}}">
  60. <p class="help-block">The file path of SQLite3 database.</p>
  61. </div>
  62. </div>
  63. </div>
  64. <hr/>
  65. <p class="help-block text-center">General Settings of Gogs</p>
  66. <div class="form-group">
  67. <label class="col-md-3 control-label">Repository Path: </label>
  68. <div class="col-md-8">
  69. <input name="repo_path" type="text" class="form-control" placeholder="Type your repository directory" value="{{.repo_path}}" required="required">
  70. <p class="help-block">The git copy of each repository is saved in this directory.</p>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="col-md-3 control-label">Run User: </label>
  75. <div class="col-md-8">
  76. <input name="run_user" type="text" class="form-control" placeholder="Type system user name" value="{{.run_user}}" required="required">
  77. <p class="help-block">The user has access to visit and run Gogs.</p>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="col-md-3 control-label">Domain: </label>
  82. <div class="col-md-8">
  83. <input name="domain" type="text" class="form-control" placeholder="Type your domain name" value="{{.domain}}" required="required">
  84. <p class="help-block">This affects SSH clone URL.</p>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label class="col-md-3 control-label">App URL: </label>
  89. <div class="col-md-8">
  90. <input name="app_url" type="text" class="form-control" placeholder="Type app root URL" value="{{.app_url}}" required="required">
  91. <p class="help-block">This affects HTTP/HTTPS clone URL and somewhere in e-mail.</p>
  92. </div>
  93. </div>
  94. <hr/>
  95. <p class="help-block text-center">Admin Account Settings</p>
  96. <div class="form-group">
  97. <label class="col-md-3 control-label">Username: </label>
  98. <div class="col-md-8">
  99. <input name="admin_name" type="text" class="form-control" placeholder="Type admin user name" value="{{.admin_name}}" required="required">
  100. </div>
  101. </div>
  102. <div class="form-group {{if .Err_AdminPasswd}}has-error has-feedback{{end}}">
  103. <label class="col-md-3 control-label">Password: </label>
  104. <div class="col-md-8">
  105. <input name="admin_pwd" type="password" class="form-control" placeholder="Type admin user password" value="{{.admin_pwd}}" required="required">
  106. </div>
  107. </div>
  108. <div class="form-group {{if .Err_AdminEmail}}has-error has-feedback{{end}}">
  109. <label class="col-md-3 control-label">E-mail: </label>
  110. <div class="col-md-8">
  111. <input name="admin_email" type="text" class="form-control" placeholder="Type admin user e-mail" value="{{.admin_email}}" required="required">
  112. </div>
  113. </div>
  114. <hr/>
  115. <div class="form-group text-center">
  116. <button class="btn btn-danger btn-lg">Install Gogs</button>
  117. <button class="btn btn-default btn-sm" type="button" data-toggle="modal" data-target="#advance-options-modal">
  118. Advanced Options
  119. </button>
  120. </div>
  121. <div class="modal fade" id="advance-options-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  122. <div class="modal-dialog">
  123. <div class="modal-content">
  124. <div class="modal-header"><h4 class="modal-title">Advanced Options</h4></div>
  125. <div class="modal-body">
  126. <p class="help-block text-center">Email Service Settings</p>
  127. <div class="form-group">
  128. <label class="col-md-3 control-label">SMTP Host: </label>
  129. <div class="col-md-8">
  130. <input name="smtp_host" type="text" class="form-control" placeholder="Type SMTP host address" value="{{.smtp_host}}">
  131. </div>
  132. </div>
  133. <div class="form-group">
  134. <label class="col-md-3 control-label">Email: </label>
  135. <div class="col-md-8">
  136. <input name="mailer_user" type="text" class="form-control" placeholder="Type SMTP user e-mail address" value="{{.mailer_user}}">
  137. </div>
  138. </div>
  139. <div class="form-group">
  140. <label class="col-md-3 control-label">Password: </label>
  141. <div class="col-md-8">
  142. <input name="mailer_pwd" type="password" class="form-control" placeholder="Type SMTP user password" value="{{.mailer_pwd}}">
  143. </div>
  144. </div>
  145. <hr/>
  146. <p class="text-center help-block">Notification Settings</p>
  147. <div class="form-group">
  148. <div class="col-md-offset-3 col-md-7">
  149. <div class="checkbox">
  150. <label>
  151. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  152. <strong>Enable Register Confirmation</strong>
  153. </label>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="form-group">
  158. <div class="col-md-offset-3 col-md-7">
  159. <div class="checkbox">
  160. <label>
  161. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  162. <strong>Enable Mail Notification</strong>
  163. </label>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="modal-footer">
  169. <button type="button" class="btn btn-success" data-dismiss="modal">Confirm</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </form>
  175. </div>
  176. {{template "base/footer" .}}