From 1f7e75417e192712035efe39d3e7a3a985ad87ba Mon Sep 17 00:00:00 2001 From: Eggbertx Date: Sun, 13 Oct 2024 23:18:29 -0700 Subject: [PATCH] Update versions for v4 release --- build.py | 2 +- frontend/package.json | 2 +- html/error/404.html | 2 +- html/error/500.html | 2 +- html/error/502.html | 2 +- pkg/config/config_test.go | 2 +- pkg/config/preload_test.go | 2 +- pkg/gcsql/provisioning_test.go | 2 +- pkg/gcsql/setup_test.go | 6 +++--- pkg/gctemplates/funcs_test.go | 6 +++--- pkg/gctemplates/templatetests/templatecases_test.go | 12 ++++++------ pkg/gctemplates/templatetests/templates_test.go | 2 +- pkg/posting/formatting_test.go | 2 +- pkg/server/serverutil/minifier_test.go | 10 +++++----- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/build.py b/build.py index c7fdc0ea..7ff22257 100755 --- a/build.py +++ b/build.py @@ -38,7 +38,7 @@ "README.md", ) -GOCHAN_VERSION = "3.11.0" +GOCHAN_VERSION = "4.0" DATABASE_VERSION = "4" # stored in DBNAME.DBPREFIXdatabase_version PATH_NOTHING = -1 diff --git a/frontend/package.json b/frontend/package.json index 35f6d57c..89c7d61e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "gochan.js", - "version": "3.11.0", + "version": "4.0.0", "description": "", "main": "./ts/main.ts", "private": true, diff --git a/html/error/404.html b/html/error/404.html index d5dc32b8..92b26746 100755 --- a/html/error/404.html +++ b/html/error/404.html @@ -7,6 +7,6 @@

404: File not found

lol 404

The requested file could not be found on this server.

-
Site powered by Gochan v3.11.0 +
Site powered by Gochan v4.0 \ No newline at end of file diff --git a/html/error/500.html b/html/error/500.html index a7c85f4a..e8734222 100755 --- a/html/error/500.html +++ b/html/error/500.html @@ -7,6 +7,6 @@

Error 500: Internal Server error

server burning

The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The system administrator will try to fix things as soon they get around to it, whenever that is. Hopefully soon.

-
Site powered by Gochan v3.11.0 +
Site powered by Gochan v4.0 \ No newline at end of file diff --git a/html/error/502.html b/html/error/502.html index 6ea80530..95c84093 100644 --- a/html/error/502.html +++ b/html/error/502.html @@ -7,6 +7,6 @@

Error 502: Bad gateway

server burning

The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The system administrator will try to fix things as soon they get around to it, whenever that is. Hopefully soon.

-
Site powered by Gochan v3.11.0 +
Site powered by Gochan v4.0 \ No newline at end of file diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 71869c97..dadb7ff1 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -51,7 +51,7 @@ type webRootTest struct { } func TestWebPath(t *testing.T) { - InitConfig("3.10.1") + InitConfig("4.0.0") testCases := []webRootTest{ { webRoot: "/", diff --git a/pkg/config/preload_test.go b/pkg/config/preload_test.go index d8987a54..033613e2 100644 --- a/pkg/config/preload_test.go +++ b/pkg/config/preload_test.go @@ -29,7 +29,7 @@ func (tC *preloadTest) run(t *testing.T) { } func TestPreload(t *testing.T) { - InitConfig("3.10.1") + InitConfig("4.0.0") testCases := []preloadTest{ { desc: "access system critical config from lua", diff --git a/pkg/gcsql/provisioning_test.go b/pkg/gcsql/provisioning_test.go index 642bab52..c32d45f3 100644 --- a/pkg/gcsql/provisioning_test.go +++ b/pkg/gcsql/provisioning_test.go @@ -18,7 +18,7 @@ func TestProvision(t *testing.T) { if !assert.NoError(t, err) { return } - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") config.SetRandomSeed("test") for _, driver := range testingDBDrivers { diff --git a/pkg/gcsql/setup_test.go b/pkg/gcsql/setup_test.go index 150e2b21..2ecb059c 100644 --- a/pkg/gcsql/setup_test.go +++ b/pkg/gcsql/setup_test.go @@ -34,7 +34,7 @@ var ( `CREATE TABLE filter_boards\(\s*id BIGINT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*board_id BIGINT NOT NULL,\s*CONSTRAINT filter_boards_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_boards_board_id_fk\s*FOREIGN KEY\(board_id\)\s*REFERENCES boards\(id\)\s*ON DELETE CASCADE\s*\)`, `CREATE TABLE filter_conditions\(\s*id BIGINT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*match_mode SMALLINT NOT NULL,\s*search VARCHAR\(75\) NOT NULL,\s*field VARCHAR\(75\) NOT NULL,\s*CONSTRAINT filter_conditions_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_conditions_search_check CHECK \(search <> '' OR match_mode = 3\)\s*\)`, `CREATE TABLE filter_hits\(\s*id BIGINT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*post_data TEXT NOT NULL,\s*match_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\s*CONSTRAINT filter_hits_filter_id_fk\s*FOREIGN KEY\(filter_id\)\s*REFERENCES filters\(id\)\s*ON DELETE CASCADE\s*\)`, - `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 3\)`, + `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 4\)`, } testInitDBPostgresStatements = []string{ `CREATE TABLE database_version\(\s+component VARCHAR\(40\) NOT NULL PRIMARY KEY,\s+version INT NOT NULL \)`, @@ -59,7 +59,7 @@ var ( `CREATE TABLE filter_boards\(\s*id BIGSERIAL PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*board_id BIGINT NOT NULL,\s*CONSTRAINT filter_boards_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_boards_board_id_fk\s*FOREIGN KEY\(board_id\) REFERENCES boards\(id\)\s*ON DELETE CASCADE\s*\)`, `CREATE TABLE filter_conditions\(\s*id BIGSERIAL PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*match_mode SMALLINT NOT NULL,\s*search VARCHAR\(75\) NOT NULL,\s*field VARCHAR\(75\) NOT NULL,\s*CONSTRAINT filter_conditions_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_conditions_search_check CHECK \(search <> '' OR match_mode = 3\)\s*\)`, `CREATE TABLE filter_hits\(\s*id BIGSERIAL PRIMARY KEY,\s*filter_id BIGINT NOT NULL,\s*post_data TEXT NOT NULL,\s*match_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\s*CONSTRAINT filter_hits_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE\s*\)`, - `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 3\)`, + `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 4\)`, } testInitDBSQLite3Statements = []string{ `CREATE TABLE database_version\(\s+component VARCHAR\(40\) NOT NULL PRIMARY KEY,\s+version INT NOT NULL \)`, @@ -84,7 +84,7 @@ var ( `CREATE TABLE filter_boards\(\s*id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\s*filter_id BIGINT NOT NULL,\s*board_id BIGINT NOT NULL,\s*CONSTRAINT filter_boards_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_boards_board_id_fk\s*FOREIGN KEY\(board_id\) REFERENCES boards\(id\)\s*ON DELETE CASCADE\s*\)`, `CREATE TABLE filter_conditions\(\s*id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\s*filter_id BIGINT NOT NULL,\s*match_mode SMALLINT NOT NULL,\s*search VARCHAR\(75\) NOT NULL,\s*field VARCHAR\(75\) NOT NULL,\s*CONSTRAINT filter_conditions_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE,\s*CONSTRAINT filter_conditions_search_check CHECK \(search <> '' OR match_mode = 3\)\s*\)`, `CREATE TABLE filter_hits\(\s*id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\s*filter_id BIGINT NOT NULL,\s*post_data TEXT NOT NULL,\s*match_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\s*CONSTRAINT filter_hits_filter_id_fk\s*FOREIGN KEY\(filter_id\) REFERENCES filters\(id\)\s*ON DELETE CASCADE\s*\)`, - `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 3\)`, + `INSERT INTO database_version\(component, version\)\s+VALUES\('gochan', 4\)`, } ) diff --git a/pkg/gctemplates/funcs_test.go b/pkg/gctemplates/funcs_test.go index e594aeae..34647a55 100644 --- a/pkg/gctemplates/funcs_test.go +++ b/pkg/gctemplates/funcs_test.go @@ -181,7 +181,7 @@ func TestFormatFilesizeTmplFunc(t *testing.T) { } func TestFormatTimestampTmplFunc(t *testing.T) { - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") tmpl := template.Must(template.New("name").Funcs(funcMap).Parse("{{formatTimestamp .Time}}")) buf := bytes.NewBuffer(nil) @@ -474,7 +474,7 @@ func TestMapTmplFunc(t *testing.T) { } func TestWebPathDirTmplFunc(t *testing.T) { - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") testCases := []struct { desc string tmplStr string @@ -524,7 +524,7 @@ func TestWebPathDirTmplFunc(t *testing.T) { } func TestMakeLoopTmplFunc(t *testing.T) { - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") testCases := []struct { desc string tmplStr string diff --git a/pkg/gctemplates/templatetests/templatecases_test.go b/pkg/gctemplates/templatetests/templatecases_test.go index 587f0e35..47d0a02e 100644 --- a/pkg/gctemplates/templatetests/templatecases_test.go +++ b/pkg/gctemplates/templatetests/templatecases_test.go @@ -81,7 +81,7 @@ var ( `` + `
` + `
` + - ``, + ``, }, { desc: "unappealable permaban (banned forever)", @@ -120,7 +120,7 @@ var ( `
` + `` + `` + - ``, + ``, }, { desc: "appealable temporary ban", @@ -160,7 +160,7 @@ var ( `` + `
` + `
` + - ``, + ``, }, { desc: "unappealable temporary ban", @@ -196,7 +196,7 @@ var ( `Your ban was placed on Mon,January 01,0001 12:00:00 AM and will expire on Mon,January 01,0001 12:00:00 AM.
` + `Your IP address is192.168.56.1.

You may not appeal this ban.
` + `` + - ``, + ``, }, } @@ -213,7 +213,7 @@ var ( }, expectedOutput: boardPageHeaderBase + `

Report reason:
 
Scroll to top
[1]
[home] []
` + - ``, + ``, }, { desc: "base case, multi threads and pages", @@ -227,7 +227,7 @@ var ( }, expectedOutput: boardPageHeaderBase + `

Report reason:
 
Scroll to top
[1]
[home] []
` + - ``, + ``, }, } diff --git a/pkg/gctemplates/templatetests/templates_test.go b/pkg/gctemplates/templatetests/templates_test.go index 135ff4db..d8ce11c7 100644 --- a/pkg/gctemplates/templatetests/templates_test.go +++ b/pkg/gctemplates/templatetests/templates_test.go @@ -66,7 +66,7 @@ func runTemplateTestCases(t *testing.T, templateName string, testCases []templat if !assert.NoError(t, err) { return } - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") config.SetTestDBConfig("mysql", "localhost", "gochan", "gochan", "gochan", "") if !assert.NoError(t, gcsql.SetTestingDB("mysql", "gochan", "", db)) { return diff --git a/pkg/posting/formatting_test.go b/pkg/posting/formatting_test.go index 4c22a1a4..1d7d831a 100644 --- a/pkg/posting/formatting_test.go +++ b/pkg/posting/formatting_test.go @@ -8,7 +8,7 @@ import ( ) const ( - versionStr = "3.10.0" + versionStr = "4.0.0" bbcodeMsgPreRender = `[b]Bold[/b] [i]Italics[/i] [u]Underline[/u] diff --git a/pkg/server/serverutil/minifier_test.go b/pkg/server/serverutil/minifier_test.go index e6aedfeb..a3d9b587 100644 --- a/pkg/server/serverutil/minifier_test.go +++ b/pkg/server/serverutil/minifier_test.go @@ -82,7 +82,7 @@ func TestCanMinify(t *testing.T) { desc: "don't minify HTML or JS", }, } - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") siteCfg := config.GetSiteConfig() for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { @@ -153,7 +153,7 @@ func TestMinifyWriter(t *testing.T) { expectOutput: unminifiedJSON, }, } - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") siteCfg := config.GetSiteConfig() buf := new(bytes.Buffer) var err error @@ -212,7 +212,7 @@ func TestMinifyTemplate(t *testing.T) { return } config.SetTestTemplateDir("templates") - config.SetVersion("3.10.1") + config.SetVersion("4.0.0") tmplRefStringTests := []testCaseMinifyTemplate{ { @@ -254,7 +254,7 @@ func TestMinifyTemplate(t *testing.T) { mediaType: "text/html", isTmplRef: true, }, - expectWriterString: `Error

Error

Error


Site powered by Gochan 3.10.1
`, + expectWriterString: `Error

Error

Error


Site powered by Gochan 4.0
`, }, { testCaseCanMinify: testCaseCanMinify{ @@ -279,7 +279,7 @@ func TestMinifyTemplate(t *testing.T) {

Error

Error

-
Site powered by Gochan 3.10.1
+
Site powered by Gochan 4.0
`, },