mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-26 10:36:23 -07:00
Update versions for v4 release
This commit is contained in:
parent
0cde8e562b
commit
1f7e75417e
14 changed files with 27 additions and 27 deletions
2
build.py
2
build.py
|
@ -38,7 +38,7 @@ release_files = (
|
|||
"README.md",
|
||||
)
|
||||
|
||||
GOCHAN_VERSION = "3.11.0"
|
||||
GOCHAN_VERSION = "4.0"
|
||||
DATABASE_VERSION = "4" # stored in DBNAME.DBPREFIXdatabase_version
|
||||
|
||||
PATH_NOTHING = -1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gochan.js",
|
||||
"version": "3.11.0",
|
||||
"version": "4.0.0",
|
||||
"description": "",
|
||||
"main": "./ts/main.ts",
|
||||
"private": true,
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -51,7 +51,7 @@ type webRootTest struct {
|
|||
}
|
||||
|
||||
func TestWebPath(t *testing.T) {
|
||||
InitConfig("3.10.1")
|
||||
InitConfig("4.0.0")
|
||||
testCases := []webRootTest{
|
||||
{
|
||||
webRoot: "/",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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\)`,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -196,7 +196,7 @@ var (
|
|||
`Your ban was placed on Mon,January 01,0001 12:00:00 AM and will expire on <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 <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>`,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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"/> <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>] []</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",
|
||||
|
@ -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"/> <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>] []</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>`,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
versionStr = "3.10.0"
|
||||
versionStr = "4.0.0"
|
||||
bbcodeMsgPreRender = `[b]Bold[/b]
|
||||
[i]Italics[/i]
|
||||
[u]Underline[/u]
|
||||
|
|
|
@ -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: `<!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{
|
||||
|
@ -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>`,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue