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.

198 lines
8.7 KiB

  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 based on your choice</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">SQLite</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 mysql server ip or domain" value="localhost" required="required">
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="col-md-3 control-label">Port: </label>
  27. <div class="col-md-8">
  28. <input name="port" class="form-control" placeholder="Type mysql server port" value="3306" required="required">
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="col-md-3 control-label">User: </label>
  33. <div class="col-md-8">
  34. <input name="user" class="form-control" placeholder="Type mysql username" required="required">
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-md-3 control-label">Password: </label>
  39. <div class="col-md-8">
  40. <input name="passwd" type="password" class="form-control" placeholder="Type mysql password" required="required">
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-md-3 control-label">Database Name: </label>
  45. <div class="col-md-8">
  46. <input name="database" type="text" class="form-control" placeholder="Type mysql database name" value="gogs" required="required">
  47. <p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
  48. </div>
  49. </div>
  50. <div class="form-group pgsql-setting hide">
  51. <label class="col-md-3 control-label">SSL Mode: </label>
  52. <div class="col-md-8">
  53. <select name="ssl_mode" class="form-control">
  54. <option value="disable">Disable</option>
  55. <option value="require">Require</option>
  56. <option value="verify-full">Verify Full</option>
  57. </select>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="sqlite-setting hide">
  62. <div class="form-group">
  63. <label class="col-md-3 control-label">Path: </label>
  64. <div class="col-md-8">
  65. <input name="path" class="form-control" placeholder="Type sqlite file path" value="xxx/file.db">
  66. <p class="help-block">The file path of SQLite database.</p>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- <div class="form-group">
  71. <div class="col-md-8 col-md-offset-3">
  72. <button class="btn btn-sm btn-info">Test Connection</button>
  73. </div>
  74. </div> -->
  75. <hr/>
  76. <p class="help-block text-center">General Settings of Gogs</p>
  77. <div class="form-group">
  78. <label class="col-md-3 control-label">Repository Path: </label>
  79. <div class="col-md-8">
  80. <input name="repo-path" type="text" class="form-control" placeholder="Type your repository directory" value="/var/gogs/repostiory" required="required">
  81. <p class="help-block">The git copy of each repository is saved in this directory.</p>
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label class="col-md-3 control-label">Run User: </label>
  86. <div class="col-md-8">
  87. <input name="system-user" type="text" class="form-control" placeholder="Type mysql password" value="root" required="required">
  88. <p class="help-block">The user has access to visit and run Gogs.</p>
  89. </div>
  90. </div>
  91. <hr/>
  92. <p class="help-block text-center">Admin Account Settings</p>
  93. <div class="form-group">
  94. <label class="col-md-3 control-label">Username: </label>
  95. <div class="col-md-8">
  96. <input name="repo-path" type="text" class="form-control" placeholder="Type admin user name" value="admin" required="required">
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <label class="col-md-3 control-label">Password: </label>
  101. <div class="col-md-8">
  102. <input name="system-user" type="password" class="form-control" placeholder="Type admin user password" required="required">
  103. </div>
  104. </div>
  105. <hr/>
  106. <div class="form-group text-center">
  107. <button class="btn btn-danger btn-lg">Install Gogs</button>
  108. <button class="btn btn-default btn-sm" type="button" data-toggle="modal" data-target="#advance-options-modal">
  109. Advanced Options
  110. </button>
  111. </div>
  112. <div class="modal fade" id="advance-options-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  113. <div class="modal-dialog">
  114. <div class="modal-content">
  115. <div class="modal-header"><h4 class="modal-title">Advanced Options</h4></div>
  116. <div class="modal-body">
  117. <p class="help-block text-center">Email Service Settings</p>
  118. <div class="form-group">
  119. <label class="col-md-3 control-label">SMTP Host: </label>
  120. <div class="col-md-8">
  121. <input name="repo-path" type="text" class="form-control" placeholder="Type admin user name">
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <label class="col-md-3 control-label">Email: </label>
  126. <div class="col-md-8">
  127. <input name="repo-path" type="text" class="form-control" placeholder="Type admin user name">
  128. </div>
  129. </div>
  130. <div class="form-group">
  131. <label class="col-md-3 control-label">Password: </label>
  132. <div class="col-md-8">
  133. <input name="system-user" type="password" class="form-control" placeholder="Type admin user password">
  134. </div>
  135. </div>
  136. <hr/>
  137. <p class="text-center help-block">Notification Settings</p>
  138. <div class="form-group">
  139. <div class="col-md-offset-3 col-md-7">
  140. <div class="checkbox">
  141. <label>
  142. <input name="system-user" type="checkbox">
  143. <strong>Enable Register Confirmation</strong>
  144. </label>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="form-group">
  149. <div class="col-md-offset-3 col-md-7">
  150. <div class="checkbox">
  151. <label>
  152. <input name="system-user" type="checkbox">
  153. <strong>Enable Mail Notification</strong>
  154. </label>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="modal-footer">
  160. <button type="button" class="btn btn-success" data-dismiss="modal">Confirm</button>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </form>
  166. </div>
  167. {{template "base/footer" .}}