2025-05-16 14:19:52 -07:00
< form class = "install-container" method = "POST" action = "/install/{{.nextPage}}" >
2025-06-27 17:01:57 -07:00
{{- if eq "" .page -}}
2025-05-16 14:19:52 -07:00
< p > Welcome to the Gochan installer! This installer will help you configure Gochan, including setting the necessary directories and connecting to the SQL database, in preparation for running a fresh Gochan installation or migrating another imageboard database (if supported) to Gochan.< / p >
2025-06-27 17:01:57 -07:00
< p class = "text-bold" > This does not install files like templates (yet), or provision the database. It only creates a configuration file for gochan to use.< / p >
{{- else if eq .page "license" -}}
2025-05-16 14:19:52 -07:00
< p class = "text-center" > Gochan is licensed under the BSD 3-Clause License, shown below. By using Gochan, you agree to the terms of this license,< / p >
2025-06-27 17:01:57 -07:00
< textarea class = "center-margin-50" > {{.license}}< / textarea >
{{- else if eq .page "paths" -}}
2025-05-16 14:19:52 -07:00
< table >
< tr >
2025-06-27 17:01:57 -07:00
< th > Output gochan.json Path< / th >
< td > {{with .cfgPaths -}}
< select name = "configdir" required >
< option value = "" disabled selected > Select a directory< / option >
{{range . -}}
< option value = "{{.}}" > {{.}}< / option >
{{- end}}
< / select >
{{- else -}}
< input type = "hidden" name = "configdir" value = "gochan.json" / >
./gochan.json (current directory)
{{- end -}}< / td >
2025-05-16 14:19:52 -07:00
< / tr >
< tr >
< th > Templates Directory< / th >
2025-06-27 17:01:57 -07:00
< td > < input type = "text" name = "templatedir" class = "path" value = "{{.config.TemplateDir}}" / > < / td >
2025-05-16 14:19:52 -07:00
< / tr >
2025-05-19 21:41:30 -07:00
< tr >
< th > Document Root< / th >
2025-06-27 17:01:57 -07:00
< td > < input type = "text" name = "documentroot" class = "path" value = "{{.config.DocumentRoot}}" required / > < / td >
2025-05-19 21:41:30 -07:00
< / tr >
2025-05-16 14:19:52 -07:00
< tr >
< th > Log Directory< / th >
2025-06-27 17:01:57 -07:00
< td > < input type = "text" name = "logdir" class = "path" required / > < / td >
2025-05-16 14:19:52 -07:00
< / tr >
< tr >
< th > Web Root< / th >
2025-06-27 17:01:57 -07:00
< td > < input type = "text" name = "webroot" class = "path" value = "{{.config.WebRoot}}" required / > < / td >
2025-05-16 14:19:52 -07:00
< / tr >
< / table >
2025-06-27 17:01:57 -07:00
{{- else if eq .page "database" -}}
2025-05-16 14:19:52 -07:00
< table >
< tr >
< th > SQL Provider< / th >
< td > < select name = "dbtype" required >
< option value = "" disabled selected > Select a database< / option >
< option value = "mysql" > MySQL/MariaDB< / option >
< option value = "postgres" > PostgreSQL< / option >
< option value = "sqlite3" > SQLite< / option >
< / select > < / td >
< / tr >
< tr >
< th > Database Host< / th >
< td > < input type = "text" name = "dbhost" required / > < / td >
< / tr >
< tr >
< th > Database Name< / th >
< td > < input type = "text" name = "dbname" required / > < / td >
< / tr >
< tr >
< th > Database User< / th >
< td > < input type = "text" name = "dbuser" required / > < / td >
< / tr >
< tr >
< th > Database Password< / th >
< td > < input type = "password" name = "dbpass" / > < / td >
< / tr >
< tr >
< th > Database Prefix< / th >
< td > < input type = "text" name = "dbprefix" / > < / td >
< / tr >
2025-06-27 17:01:57 -07:00
< tr >
< th > Database Request Timeout (seconds)< / th >
< td > < input type = "number" name = "timeoutseconds" value = "{{.config.DBTimeoutSeconds}}" min = "1" required / > < / td >
< / tr >
< tr >
< th > Database Max Open Connections< / th >
< td > < input type = "number" name = "maxopenconns" value = "{{.config.DBMaxOpenConnections}}" min = "1" required / > < / td >
< / tr >
< tr >
< th > Max Idle Database Connections< / th >
< td > < input type = "number" name = "maxidleconns" value = "{{.config.DBMaxIdleConnections}}" min = "1" required / > < / td >
< / tr >
< tr >
< th > Max DB Connection Lifetime (minutes)< / th >
< td > < input type = "number" name = "connmaxlifetimemin" value = "{{.config.DBConnMaxLifetimeMin}}" min = "1" required / > < / td >
< / tr >
2025-05-16 14:19:52 -07:00
< / table >
2025-06-27 17:01:57 -07:00
{{- else if eq .page "dbtest" -}}
< p class = "text-center" > {{.testResult}}< / p >
{{- else if eq .page "staff" -}}
{{- with .alreadyCreated -}}
< p class = "text-center" > Administrator account already created. Click Next to go to miscellaneous settings (flags and < / p >
{{- else -}}
< p class = "text-center" > Enter a username and password for an administrator staff acount< / p >
< input type = "hidden" name = "newstaff" value = "yes" / >
< table >
< tr > < th > Username< / th > < td > < input type = "text" name = "username" > < / td > < / tr >
< tr > < th > Password< / th > < td > < input type = "password" name = "password" > < / td > < / tr >
< tr > < th > Confirm Password< / th > < td > < input type = "password" name = "confirmpassword" > < / td > < / tr >
< / table >
{{- end -}}
{{- else if eq .page "pre-save" -}}
< p > Initial configuration is complete. In the textbox below, you can see the JSON output that will be saved to {{.configPath}} on the server. After clicking Save, you can then edit it as needed. See config.md for more info< / p >
< textarea class = "center-margin-50" readonly > {{.configJSON}}< / textarea >
{{- else if eq .page "save" -}}
2025-07-10 12:39:17 -07:00
< p class = "text-center" > Gochan has been configured and provisioned successfully, a board has been created, and the installer server has exited. Now you can run gochan, log into the staff account you created < a href = "{{webPath `/manage`}}" > here< / a > , and create new boards as desired. Thank you for using Gochan!< / p >
2025-06-27 17:01:57 -07:00
< p class = "text-center" > If you experience any bugs, you can report them < a href = "https://github.com/gochan-org/gochan/issues" > here< / a > .< / p >
{{- else -}}
< p class = "text-center" > Invalid page< / p >
{{- end -}}
2025-07-10 12:39:17 -07:00
{{- if ne .nextPage "" -}}
< section class = "buttons" >
< input type = "submit" value = "{{.nextButton}}" / >
2025-07-19 19:33:18 -07:00
{{- if .skipButton -}}
< input type = "submit" name = "skip" value = "Skip" / >
{{- end -}}
2025-07-10 12:39:17 -07:00
< / section >
{{- end -}}
2025-05-16 14:19:52 -07:00
< / form >