Skip to content

Commit

Permalink
Update versions for v4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Eggbertx committed Oct 14, 2024
1 parent 0cde8e5 commit 1f7e754
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gochan.js",
"version": "3.11.0",
"version": "4.0.0",
"description": "",
"main": "./ts/main.ts",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion html/error/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<h1>404: File not found</h1>
<img src="/error/lol 404.gif" alt="lol 404">
<p>The requested file could not be found on this server.</p>
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.11.0
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v4.0
</body>
</html>
2 changes: 1 addition & 1 deletion html/error/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<h1>Error 500: Internal Server error</h1>
<img src="/error/server500.gif" alt="server burning">
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon they get around to it, whenever that is. Hopefully soon.</p>
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.11.0
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v4.0
</body>
</html>
2 changes: 1 addition & 1 deletion html/error/502.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<h1>Error 502: Bad gateway</h1>
<img src="/error/server500.gif" alt="server burning">
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon they get around to it, whenever that is. Hopefully soon.</p>
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.11.0
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v4.0
</body>
</html>
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type webRootTest struct {
}

func TestWebPath(t *testing.T) {
InitConfig("3.10.1")
InitConfig("4.0.0")
testCases := []webRootTest{
{
webRoot: "/",
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/preload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pkg/gcsql/provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/gcsql/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 \)`,
Expand All @@ -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 \)`,
Expand All @@ -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\)`,
}
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/gctemplates/funcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions pkg/gctemplates/templatetests/templatecases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var (
`<input type="hidden"name="board"value=""><input type="hidden"name="banid"value="0">` +
`<textarea rows="4"cols="48"name="appealmsg"id="postmsg"placeholder="Appeal message"></textarea><br />` +
`<input type="submit"name="doappeal"value="Submit"/><br/></form></div></div></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
{
desc: "unappealable permaban (banned forever)",
Expand Down Expand Up @@ -120,7 +120,7 @@ var (
`<img id="banpage-image"src="/permabanned.jpg"style="float:right; margin: 4px 8px 8px 4px"/><br/>` +
`<audio id="jack"preload="auto"autobuffer loop><source src="/static/hittheroad.ogg"/><source src="/static/hittheroad.wav"/><source src="/static/hittheroad.mp3"/></audio>` +
`<script type="text/javascript">document.getElementById("jack").play();</script></div></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
{
desc: "appealable temporary ban",
Expand Down Expand Up @@ -160,7 +160,7 @@ var (
`<input type="hidden"name="board"value=""><input type="hidden"name="banid"value="0">` +
`<textarea rows="4"cols="48"name="appealmsg"id="postmsg"placeholder="Appeal message"></textarea><br />` +
`<input type="submit"name="doappeal"value="Submit"/><br/></form></div></div></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
{
desc: "unappealable temporary ban",
Expand Down Expand Up @@ -196,7 +196,7 @@ var (
`Your ban was placed on Mon,January 01,0001 12:00:00 AM and will expire on&nbsp;<b>Mon,January 01,0001 12:00:00 AM</b>.<br />` +
`Your IP address is<b>192.168.56.1</b>.<br /><br/>You may&nbsp;<b>not</b> appeal this ban.<br />` +
`</div></div></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
}

Expand All @@ -213,7 +213,7 @@ var (
},
expectedOutput: boardPageHeaderBase +
`<form action="/util"method="POST"id="main-form"><div id="right-bottom-content"><div id="report-delbox"><input type="hidden"name="board"value="test"/><input type="hidden"name="boardid"value="1"/><label>[<input type="checkbox"name="fileonly"/>File only]</label> <input type="password" size="10" name="password" id="delete-password" /><input type="submit"name="delete_btn"value="Delete"onclick="return confirm('Are you sure you want to delete these posts?')"/><br/>Report reason:<input type="text"size="10"name="reason"id="reason"/><input type="submit"name="report_btn"value="Report"/><br/><input type="submit"name="edit_btn"value="Edit post"/>&nbsp;<input type="submit"name="move_btn"value="Move thread"/></div></div></form><div id="left-bottom-content"><a href="#">Scroll to top</a><br/><table id="pages"><tr><td>[<a href="/test/1.html">1</a>]</td></tr></table><span id="boardmenu-bottom">[<a href="/">home</a>]&nbsp;[]</span></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
{
desc: "base case, multi threads and pages",
Expand All @@ -227,7 +227,7 @@ var (
},
expectedOutput: boardPageHeaderBase +
`<form action="/util"method="POST"id="main-form"><div id="right-bottom-content"><div id="report-delbox"><input type="hidden"name="board"value="test"/><input type="hidden"name="boardid"value="1"/><label>[<input type="checkbox"name="fileonly"/>File only]</label> <input type="password" size="10" name="password" id="delete-password" /><input type="submit"name="delete_btn"value="Delete"onclick="return confirm('Are you sure you want to delete these posts?')"/><br/>Report reason:<input type="text"size="10"name="reason"id="reason"/><input type="submit"name="report_btn"value="Report"/><br/><input type="submit"name="edit_btn"value="Edit post"/>&nbsp;<input type="submit"name="move_btn"value="Move thread"/></div></div></form><div id="left-bottom-content"><a href="#">Scroll to top</a><br/><table id="pages"><tr><td>[<a href="/test/1.html">1</a>]</td></tr></table><span id="boardmenu-bottom">[<a href="/">home</a>]&nbsp;[]</span></div>` +
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 3.10.1</a><br /></div></div></body></html>`,
`<div id="footer">Powered by<a href="http://github.com/gochan-org/gochan/">Gochan 4.0</a><br /></div></div></body></html>`,
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/gctemplates/templatetests/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/posting/formatting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
versionStr = "3.10.0"
versionStr = "4.0.0"
bbcodeMsgPreRender = `[b]Bold[/b]
[i]Italics[/i]
[u]Underline[/u]
Expand Down
10 changes: 5 additions & 5 deletions pkg/server/serverutil/minifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{
{
Expand Down Expand Up @@ -254,7 +254,7 @@ func TestMinifyTemplate(t *testing.T) {
mediaType: "text/html",
isTmplRef: true,
},
expectWriterString: `<!doctype html><meta charset=utf-8><title>Error</title><h1>Error</h1><p>Error<hr><address>Site powered by Gochan 3.10.1</address>`,
expectWriterString: `<!doctype html><meta charset=utf-8><title>Error</title><h1>Error</h1><p>Error<hr><address>Site powered by Gochan 4.0</address>`,
},
{
testCaseCanMinify: testCaseCanMinify{
Expand All @@ -279,7 +279,7 @@ func TestMinifyTemplate(t *testing.T) {
<body>
<h1>Error</h1>
<p>Error</p>
<hr><address>Site powered by Gochan 3.10.1</address>
<hr><address>Site powered by Gochan 4.0</address>
</body>
</html>`,
},
Expand Down

0 comments on commit 1f7e754

Please sign in to comment.