mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-30 09:56:23 -07:00
refactor captcha handling, simplify HTML template testing with goquery
This commit is contained in:
parent
47afdd0ca8
commit
67bbb4125c
15 changed files with 145 additions and 112 deletions
|
@ -22,6 +22,16 @@ div.section-block {
|
|||
margin-right: 16px;
|
||||
}
|
||||
|
||||
div.front-intro-container {
|
||||
margin: 16px 64px 16px 64px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 500px) {
|
||||
div.front-intro-container {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
div#top-pane {
|
||||
text-align: center;
|
||||
margin-top: 32px;
|
||||
|
|
8
go.mod
8
go.mod
|
@ -8,6 +8,7 @@ require (
|
|||
github.com/CuberL/glua-async v0.0.0-20190614102843-43f22221106d
|
||||
github.com/Eggbertx/durationutil v1.0.0
|
||||
github.com/Eggbertx/geoip-legacy v1.1.0
|
||||
github.com/PuerkitoBio/goquery v1.10.2
|
||||
github.com/aquilax/tripcode v1.0.1
|
||||
github.com/cjoudrey/gluahttp v0.0.0-20201111170219-25003d9adfa9
|
||||
github.com/devedge/imagehash v0.0.0-20180324030135-7061aa3b4066
|
||||
|
@ -18,7 +19,7 @@ require (
|
|||
github.com/lib/pq v1.10.9
|
||||
github.com/mattn/go-sqlite3 v1.14.24
|
||||
github.com/oschwald/maxminddb-golang v1.13.1
|
||||
github.com/rs/zerolog v1.33.0
|
||||
github.com/rs/zerolog v1.34.0
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/tdewolff/minify v2.3.6+incompatible
|
||||
github.com/uptrace/bunrouter v1.0.22
|
||||
|
@ -31,6 +32,11 @@ require (
|
|||
layeh.com/gopher-luar v1.0.11
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2
|
||||
|
|
71
go.sum
71
go.sum
|
@ -9,6 +9,8 @@ github.com/Eggbertx/durationutil v1.0.0 h1:/DJo6z/9tac/1KTwa/RGjpg5Q8Rrnx3p5w4Ox
|
|||
github.com/Eggbertx/durationutil v1.0.0/go.mod h1:eOfcV0W5B4qoKsEtjhOYUTsTm6KnrWVkfgOmMTC4XnY=
|
||||
github.com/Eggbertx/geoip-legacy v1.1.0 h1:TBwvJln6UBlJ1n7XslhlWzw2pwPNU1UmdKl41AHODlw=
|
||||
github.com/Eggbertx/geoip-legacy v1.1.0/go.mod h1:oZq7nJGTv0mnScoQolQ7YXUA4hF0hydk+lKnYTCb0U0=
|
||||
github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
|
||||
github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU=
|
||||
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
|
@ -16,6 +18,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
|
|||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30=
|
||||
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
||||
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||
github.com/aquilax/tripcode v1.0.1 h1:kXYiTGOFr5sAgTyDM0fWi1S5rgccHsCMJ/gobw442Fs=
|
||||
github.com/aquilax/tripcode v1.0.1/go.mod h1:qxP2i52Y7+l2jw4vb6wOpS/ICtg4GieCD+Q48qUU15U=
|
||||
github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
|
||||
|
@ -70,6 +74,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
|||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/ip2location/ip2location-go/v9 v9.7.1 h1:eXu/DqS13QE0h1Yrc9oji+6/anLD9KDf6Ulf5GdIQs8=
|
||||
github.com/ip2location/ip2location-go/v9 v9.7.1/go.mod h1:MPLnsKxwQlvd2lBNcQCsLoyzJLDBFizuO67wXXdzoyI=
|
||||
|
@ -123,6 +128,7 @@ github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk
|
|||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
|
@ -143,9 +149,9 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
|
|||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
|
||||
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
||||
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
||||
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
|
||||
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
|
@ -169,6 +175,7 @@ github.com/uptrace/bunrouter v1.0.22/go.mod h1:O3jAcl+5qgnF+ejhgkmbceEk0E/mqaK+A
|
|||
github.com/vadv/gopher-lua-libs v0.5.0 h1:m0hhWia1A1U3PIRmtdHWBj88ogzuIjm6HUBmtUa0Tz4=
|
||||
github.com/vadv/gopher-lua-libs v0.5.0/go.mod h1:mlSOxmrjug7DwisiH7xBFnBellHobPbvAIhVeI/4SYY=
|
||||
github.com/yuin/gluamapper v0.0.0-20150323120927-d836955830e7/go.mod h1:bbMEM6aU1WDF1ErA5YJ0p91652pGv140gGw4Ww3RGp8=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
|
||||
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
|
||||
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
|
||||
|
@ -178,25 +185,51 @@ gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2
|
|||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
|
||||
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
|
@ -209,19 +242,51 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
|
|
|
@ -304,6 +304,15 @@ div.section-block div.section-body {
|
|||
margin-right: 16px;
|
||||
}
|
||||
|
||||
div.front-intro-container {
|
||||
margin: 16px 64px 16px 64px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 500px) {
|
||||
div.front-intro-container {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
div#top-pane {
|
||||
text-align: center;
|
||||
margin-top: 32px;
|
||||
|
|
|
@ -177,7 +177,7 @@ func BuildBoardPages(board *gcsql.Board, errEv *zerolog.Event) error {
|
|||
"currentPage": 1,
|
||||
"board": board,
|
||||
"boardConfig": boardConfig,
|
||||
"useCaptcha": captchaCfg.UseCaptcha(),
|
||||
"useCaptcha": captchaCfg != nil,
|
||||
"captcha": captchaCfg,
|
||||
}, boardPageFile, "text/html"); err != nil {
|
||||
errEv.Err(err).Caller().
|
||||
|
@ -251,7 +251,7 @@ func BuildBoardPages(board *gcsql.Board, errEv *zerolog.Event) error {
|
|||
"currentPage": catalog.currentPage,
|
||||
"board": board,
|
||||
"boardConfig": boardConfig,
|
||||
"useCaptcha": captchaCfg.UseCaptcha(),
|
||||
"useCaptcha": captchaCfg != nil,
|
||||
"captcha": captchaCfg,
|
||||
}
|
||||
if catalog.currentPage > 1 {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/gochan-org/gochan/pkg/config"
|
||||
"github.com/gochan-org/gochan/pkg/gcsql"
|
||||
_ "github.com/gochan-org/gochan/pkg/gcsql/initsql"
|
||||
|
@ -73,7 +74,7 @@ func TestBuildJS(t *testing.T) {
|
|||
assert.Equal(t, expectedUnminifiedJS, string(ba))
|
||||
}
|
||||
|
||||
func doFrontBuildingTest(t *testing.T, mock sqlmock.Sqlmock, expectOut string) {
|
||||
func doFrontBuildingTest(t *testing.T, mock sqlmock.Sqlmock) {
|
||||
serverutil.InitMinifier()
|
||||
|
||||
mock.ExpectPrepare(`SELECT\s*` +
|
||||
|
@ -118,31 +119,48 @@ func doFrontBuildingTest(t *testing.T, mock sqlmock.Sqlmock, expectOut string) {
|
|||
|
||||
err := BuildFrontPage()
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
t.FailNow()
|
||||
}
|
||||
assert.NoError(t, mock.ExpectationsWereMet())
|
||||
|
||||
frontFile, err := os.Open(path.Join(config.GetSystemCriticalConfig().DocumentRoot, "index.html"))
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
t.FailNow()
|
||||
}
|
||||
defer frontFile.Close()
|
||||
ba, err := io.ReadAll(frontFile)
|
||||
|
||||
doc, err := goquery.NewDocumentFromReader(frontFile)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
t.FailNow()
|
||||
}
|
||||
assert.Equal(t, expectOut, string(ba))
|
||||
boardsDiv := doc.Find("div#frontpage div.section-block:nth-of-type(2)")
|
||||
if !assert.Equal(t, 1, boardsDiv.Length()) {
|
||||
t.FailNow()
|
||||
}
|
||||
assert.Equal(t, "Boards", boardsDiv.Find("div.section-title-block").Text())
|
||||
sectionUl := boardsDiv.Find("div.section-body ul")
|
||||
if !assert.Equal(t, 1, sectionUl.Length()) {
|
||||
t.FailNow()
|
||||
}
|
||||
li := sectionUl.Find("li")
|
||||
assert.Equal(t, 3, li.Length())
|
||||
assert.Equal(t, "Main", li.Eq(0).Text())
|
||||
assert.Equal(t, "/test/ — Testing board", li.Eq(1).Text())
|
||||
assert.Equal(t, "/test2/ — Testing board 2", li.Eq(2).Text())
|
||||
assert.Equal(t, "/chan/test/", li.Eq(1).Find("a").AttrOr("href", ""))
|
||||
assert.Equal(t, "/chan/test2/", li.Eq(2).Find("a").AttrOr("href", ""))
|
||||
|
||||
assert.NoError(t, frontFile.Close())
|
||||
}
|
||||
|
||||
func TestBuildFrontPage(t *testing.T) {
|
||||
testRoot, err := testutil.GoToGochanRoot(t)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
for _, driver := range sql.Drivers() {
|
||||
if driver == "sqlmock" || t.Failed() {
|
||||
if driver == "sqlmock" {
|
||||
continue
|
||||
}
|
||||
t.Run(driver, func(t *testing.T) {
|
||||
|
@ -164,15 +182,15 @@ func TestBuildFrontPage(t *testing.T) {
|
|||
|
||||
mock, err := gcsql.SetupMockDB(driver)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
t.FailNow()
|
||||
}
|
||||
siteCfg := config.GetSiteConfig()
|
||||
siteCfg.MinifyHTML = true
|
||||
config.SetSiteConfig(siteCfg)
|
||||
doFrontBuildingTest(t, mock, expectedMinifiedFront)
|
||||
doFrontBuildingTest(t, mock)
|
||||
siteCfg.MinifyHTML = false
|
||||
config.SetSiteConfig(siteCfg)
|
||||
doFrontBuildingTest(t, mock, expectedUnminifiedFront)
|
||||
doFrontBuildingTest(t, mock)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,77 +7,4 @@ const defaultStyle = "test1.css";
|
|||
const webroot = "/chan";
|
||||
const serverTZ = 8;
|
||||
const fileTypes = [];`
|
||||
expectedMinifiedFront = `<!doctype html><html lang=en><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Gochan</title><link rel=stylesheet href=/chan/css/global.css><link id=theme rel=stylesheet href=/chan/css/test1.css><link rel="shortcut icon" href=/chan/favicon.png><script src=/chan/js/consts.js></script><script src=/chan/js/gochan.js defer></script><div id=topbar><div class=topbar-section><a href=/chan/ class=topbar-item>home</a></div><div class=topbar-section><a href=/chan/test/ class=topbar-item title="Testing board">/test/</a><a href=/chan/test2/ class=topbar-item title="Testing board 2">/test2/</a></div></div><div id=content><div id=top-pane><h1 id=site-title>Gochan</h1><span id=site-slogan></span></div><br><div id=frontpage><div class=section-block style="margin: 16px 64px 16px 64px;"><div class="section-body front-intro">Welcome to Gochan!</div></div><div class=section-block><div class=section-title-block><b>Boards</b></div><div class=section-body><ul style="float:left; list-style: none"><li style="text-align: center; font-weight: bold"><b><u>Main</u></b><li><a href=/chan/test/ title="Board for testing description">/test/</a> — Testing board<li><a href=/chan/test2/ title="Board for testing description 2">/test2/</a> — Testing board 2</ul></div></div><div class=section-block><div class=section-title-block><b>Recent Posts</b></div><div class=section-body><div id=recent-posts><div class=recent-post><a href=/chan/test/res/1.html#1 class=front-reply target=_blank><img src=/chan/test/thumb alt="post thumbnail"></a><br><br><a href=/chan/test/>/test/</a><hr>message_raw</div><div class=recent-post><a href=/chan/test/res/1.html#2 class=front-reply target=_blank><img src=/chan/test/thumb alt="post thumbnail"></a><br><br><a href=/chan/test/>/test/</a><hr>message_raw</div></div></div></div></div><footer>Powered by <a href=http://github.com/gochan-org/gochan/>Gochan 4.0.2</a><br></footer></div>`
|
||||
expectedUnminifiedFront = `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Gochan</title>
|
||||
<link rel="stylesheet" href="/chan/css/global.css" />
|
||||
<link id="theme" rel="stylesheet" href="/chan/css/test1.css" />
|
||||
<link rel="shortcut icon" href="/chan/favicon.png"><script type="text/javascript" src="/chan/js/consts.js"></script>
|
||||
<script type="text/javascript" src="/chan/js/gochan.js" defer></script></head>
|
||||
<body>
|
||||
<div id="topbar">
|
||||
<div class="topbar-section"><a href="/chan/" class="topbar-item">home</a></div><div class="topbar-section"><a href="/chan/test/" class="topbar-item" title="Testing board">/test/</a><a href="/chan/test2/" class="topbar-item" title="Testing board 2">/test2/</a></div></div>
|
||||
|
||||
<div id="content">
|
||||
<div id="top-pane">
|
||||
<h1 id="site-title">Gochan</h1>
|
||||
<span id="site-slogan"></span>
|
||||
</div><br />
|
||||
<div id="frontpage">
|
||||
<div class="section-block" style="margin: 16px 64px 16px 64px;">
|
||||
<div class="section-body front-intro">
|
||||
Welcome to Gochan!
|
||||
</div>
|
||||
</div>
|
||||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Boards</b></div>
|
||||
<div class="section-body">
|
||||
<ul style="float:left; list-style: none">
|
||||
<li style="text-align: center; font-weight: bold"><b><u>Main</u></b></li>
|
||||
|
||||
|
||||
<li><a href="/chan/test/" title="Board for testing description">/test/</a> — Testing board</li>
|
||||
|
||||
|
||||
|
||||
<li><a href="/chan/test2/" title="Board for testing description 2">/test2/</a> — Testing board 2</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Recent Posts</b></div>
|
||||
<div class="section-body">
|
||||
<div id="recent-posts">
|
||||
<div class="recent-post">
|
||||
<a href="/chan/test/res/1.html#1" class="front-reply" target="_blank"><img src="/chan/test/thumb" alt="post thumbnail"/></a><br />
|
||||
<br />
|
||||
<a href="/chan/test/">/test/</a><hr />
|
||||
message_raw
|
||||
</div>
|
||||
<div class="recent-post">
|
||||
<a href="/chan/test/res/1.html#2" class="front-reply" target="_blank"><img src="/chan/test/thumb" alt="post thumbnail"/></a><br />
|
||||
<br />
|
||||
<a href="/chan/test/">/test/</a><hr />
|
||||
message_raw
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
Powered by <a href="http://github.com/gochan-org/gochan/">Gochan 4.0.2</a><br />
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
`
|
||||
)
|
||||
|
|
|
@ -103,7 +103,7 @@ func BuildThreadPages(op *gcsql.Post) error {
|
|||
"posts": posts[1:],
|
||||
"op": posts[0],
|
||||
"thread": thread,
|
||||
"useCaptcha": captchaCfg.UseCaptcha() && !captchaCfg.OnlyNeededForThreads,
|
||||
"useCaptcha": captchaCfg != nil && !captchaCfg.OnlyNeededForThreads,
|
||||
"captcha": captchaCfg,
|
||||
}, threadPageFile, "text/html"); err != nil {
|
||||
errEv.Err(err).Caller().Send()
|
||||
|
|
|
@ -357,7 +357,7 @@ type SiteConfig struct {
|
|||
GeoIPOptions map[string]any
|
||||
|
||||
// Captcha options for spam prevention. Currently only hcaptcha is supported
|
||||
Captcha CaptchaConfig
|
||||
Captcha *CaptchaConfig
|
||||
|
||||
// FingerprintVideoThumbnails determines whether to use video thumbnails for image fingerprinting. If false, the video file will not be checked by fingerprinting filters
|
||||
// Default: false
|
||||
|
@ -392,10 +392,6 @@ type CaptchaConfig struct {
|
|||
AccountSecret string
|
||||
}
|
||||
|
||||
func (cc *CaptchaConfig) UseCaptcha() bool {
|
||||
return cc.SiteKey != "" && cc.AccountSecret != ""
|
||||
}
|
||||
|
||||
type BoardCooldowns struct {
|
||||
// NewThread is the number of seconds the user must wait before creating new threads.
|
||||
// Default: 30
|
||||
|
|
|
@ -91,7 +91,6 @@ func loadConfig(versionStr string, searchPaths ...string) (err error) {
|
|||
cfg.RandomSeed = "test"
|
||||
cfg.Version = ParseVersion(versionStr)
|
||||
cfg.SiteSlogan = "Gochan testing"
|
||||
cfg.Captcha.OnlyNeededForThreads = true
|
||||
cfg.Cooldowns = BoardCooldowns{0, 0, 0}
|
||||
cfg.BanColors = map[string]string{
|
||||
"admin": "#0000A0",
|
||||
|
|
|
@ -28,7 +28,8 @@ func TriggerEvent(trigger string, data ...any) (handled bool, err error, recover
|
|||
errEv := gcutil.LogError(nil).Caller(1)
|
||||
defer func() {
|
||||
if a := recover(); a != nil {
|
||||
errEv.Err(fmt.Errorf("%v", a)).
|
||||
errEv.Stack().
|
||||
Err(fmt.Errorf("%v", a)).
|
||||
Str("event", trigger).
|
||||
Msg("Recovered from panic while handling event")
|
||||
handled = true
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/pkgerrors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -92,6 +93,7 @@ func RunningInTerminal() bool {
|
|||
}
|
||||
|
||||
func init() {
|
||||
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
|
||||
// guarantee that the logger is always available, even before the configuration is loaded
|
||||
logger = zerolog.New(zerolog.NewConsoleWriter(func(w *zerolog.ConsoleWriter) {
|
||||
w.NoColor = !RunningInTerminal()
|
||||
|
|
|
@ -34,7 +34,7 @@ type CaptchaResult struct {
|
|||
func InitCaptcha() {
|
||||
var typeIsValid bool
|
||||
captchaCfg := config.GetSiteConfig().Captcha
|
||||
if !captchaCfg.UseCaptcha() {
|
||||
if captchaCfg == nil {
|
||||
return
|
||||
}
|
||||
for _, vType := range validCaptchaTypes {
|
||||
|
@ -52,7 +52,7 @@ func InitCaptcha() {
|
|||
// submitCaptchaResponse parses the incoming captcha form values, submits them, and returns the results
|
||||
func submitCaptchaResponse(request *http.Request) (bool, error) {
|
||||
captchaCfg := config.GetSiteConfig().Captcha
|
||||
if !captchaCfg.UseCaptcha() {
|
||||
if captchaCfg == nil {
|
||||
return true, nil // captcha isn't required, skip the test
|
||||
}
|
||||
threadid, _ := strconv.Atoi(request.PostFormValue("threadid"))
|
||||
|
@ -90,7 +90,7 @@ func submitCaptchaResponse(request *http.Request) (bool, error) {
|
|||
func ServeCaptcha(writer http.ResponseWriter, request *http.Request) {
|
||||
captchaCfg := config.GetSiteConfig().Captcha
|
||||
if request.Method == "GET" && request.FormValue("needcaptcha") != "" {
|
||||
fmt.Fprint(writer, captchaCfg.UseCaptcha())
|
||||
fmt.Fprint(writer, captchaCfg != nil)
|
||||
return
|
||||
}
|
||||
errEv := gcutil.LogError(nil).
|
||||
|
@ -99,7 +99,7 @@ func ServeCaptcha(writer http.ResponseWriter, request *http.Request) {
|
|||
errEv.Discard()
|
||||
}()
|
||||
wantsJSON := serverutil.IsRequestingJSON(request)
|
||||
if !captchaCfg.UseCaptcha() {
|
||||
if captchaCfg == nil {
|
||||
server.ServeError(writer, "This site is not set up to require a CAPTCHA test", wantsJSON, nil)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -4,23 +4,23 @@
|
|||
<span id="site-slogan">{{.siteConfig.SiteSlogan}}</span>
|
||||
</div><br />
|
||||
<div id="frontpage">
|
||||
<div class="section-block" style="margin: 16px 64px 16px 64px;">
|
||||
<div class="section-block front-intro-container">
|
||||
<div class="section-body front-intro">
|
||||
{{template "front_intro.html" .}}
|
||||
{{- template "front_intro.html" . -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Boards</b></div>
|
||||
<div class="section-title-block text-bold">Boards</div>
|
||||
<div class="section-body">
|
||||
{{- range $_, $section := .sections -}}
|
||||
{{if not $section.Hidden}}
|
||||
<ul style="float:left; list-style: none">
|
||||
<li style="text-align: center; font-weight: bold"><b><u>{{$section.Name}}</u></b></li>
|
||||
{{range $_, $board := $.boards}}
|
||||
{{if and (eq $board.SectionID $section.ID) (ne $board.Dir $.siteConfig.Modboard)}}
|
||||
<li class="text-bold text-underline text-center">{{$section.Name}}</li>
|
||||
{{range $_, $board := $.boards -}}
|
||||
{{- if and (eq $board.SectionID $section.ID) (ne $board.Dir $.siteConfig.Modboard) -}}
|
||||
<li><a href="{{webPathDir $board.Dir}}" title="{{$board.Description}}">/{{$board.Dir}}/</a> — {{$board.Title}}</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{- end -}}
|
||||
{{- end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
{{- if gt .siteConfig.MaxRecentPosts 0}}
|
||||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Recent Posts</b></div>
|
||||
<div class="section-title-block text-bold">Recent Posts</div>
|
||||
<div class="section-body">
|
||||
<div id="recent-posts">
|
||||
{{- range $i, $post := $.recentPosts}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
set -euo pipefail
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export GO_VERSION=1.22
|
||||
export GO_VERSION=1.23
|
||||
|
||||
if [ -z "$DBTYPE" ]; then
|
||||
echo "DBTYPE environment variable not set, must be 'mysql', 'postgresql', or 'sqlite3'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue