added the database version number (will be important later) and revamped the About page a bit, to include the database version number
This commit is contained in:
+12
-8
@@ -28,14 +28,18 @@ func SetupDb() (func(), error) {
|
|||||||
db, err := sqlx.Connect(config.GlobalComputedConfig.DatabaseDriver, config.GlobalComputedConfig.DatabaseDSN)
|
db, err := sqlx.Connect(config.GlobalComputedConfig.DatabaseDriver, config.GlobalComputedConfig.DatabaseDSN)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
amdb = db
|
amdb = db
|
||||||
setupAdCache()
|
g, err := AmGlobals(context.Background())
|
||||||
setupUserCache()
|
if err == nil {
|
||||||
setupContactsCache()
|
setupAdCache()
|
||||||
setupCommunityCache()
|
setupUserCache()
|
||||||
setupServicesCache()
|
setupContactsCache()
|
||||||
setupConferenceCache()
|
setupCommunityCache()
|
||||||
exitfns = append(exitfns, setupAuditWriter())
|
setupServicesCache()
|
||||||
exitfns = append(exitfns, setupIPBanSweep())
|
setupConferenceCache()
|
||||||
|
exitfns = append(exitfns, setupAuditWriter())
|
||||||
|
exitfns = append(exitfns, setupIPBanSweep())
|
||||||
|
log.Infof("SetupDb(): database version %s", g.Version)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return func() {
|
return func() {
|
||||||
slices.Reverse(exitfns)
|
slices.Reverse(exitfns)
|
||||||
|
|||||||
+11
-8
@@ -20,14 +20,15 @@ import (
|
|||||||
// Globals contains the global data.
|
// Globals contains the global data.
|
||||||
type Globals struct {
|
type Globals struct {
|
||||||
Mutex sync.Mutex
|
Mutex sync.Mutex
|
||||||
PostsPerPage int32 `db:"posts_per_page"`
|
Version string `db:"version"`
|
||||||
OldPostsAtTop int32 `db:"old_posts_at_top"`
|
PostsPerPage int32 `db:"posts_per_page"`
|
||||||
MaxSearchPage int32 `db:"max_search_page"`
|
OldPostsAtTop int32 `db:"old_posts_at_top"`
|
||||||
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
|
MaxSearchPage int32 `db:"max_search_page"`
|
||||||
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
|
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
|
||||||
FrontPagePosts int32 `db:"fp_posts"`
|
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
|
||||||
NumAuditPage int32 `db:"num_audit_page"`
|
FrontPagePosts int32 `db:"fp_posts"`
|
||||||
CommunityCreateLevel int32 `db:"comm_create_lvl"`
|
NumAuditPage int32 `db:"num_audit_page"`
|
||||||
|
CommunityCreateLevel int32 `db:"comm_create_lvl"`
|
||||||
flags *util.OptionSet
|
flags *util.OptionSet
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ var globalPropMutex sync.Mutex
|
|||||||
// Clone clones the entire global state.
|
// Clone clones the entire global state.
|
||||||
func (g *Globals) Clone() *Globals {
|
func (g *Globals) Clone() *Globals {
|
||||||
rc := &Globals{
|
rc := &Globals{
|
||||||
|
Version: g.Version,
|
||||||
PostsPerPage: g.PostsPerPage,
|
PostsPerPage: g.PostsPerPage,
|
||||||
OldPostsAtTop: g.OldPostsAtTop,
|
OldPostsAtTop: g.OldPostsAtTop,
|
||||||
MaxSearchPage: g.MaxSearchPage,
|
MaxSearchPage: g.MaxSearchPage,
|
||||||
@@ -126,6 +128,7 @@ func AmReplaceGlobals(ctx context.Context, ng *Globals) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
ng.Version = theGlobals.Version
|
||||||
ng.flags = nil
|
ng.flags = nil
|
||||||
theGlobals = ng
|
theGlobals = ng
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
# likely to edit "on the fly." Stuff that can only be updated with a shutdown should go
|
# likely to edit "on the fly." Stuff that can only be updated with a shutdown should go
|
||||||
# in the XML config file. This table has ONLY ONE ROW!
|
# in the XML config file. This table has ONLY ONE ROW!
|
||||||
CREATE TABLE globals (
|
CREATE TABLE globals (
|
||||||
|
version CHAR(10) NOT NULL,
|
||||||
posts_per_page INT NOT NULL,
|
posts_per_page INT NOT NULL,
|
||||||
old_posts_at_top INT NOT NULL,
|
old_posts_at_top INT NOT NULL,
|
||||||
max_search_page INT NOT NULL,
|
max_search_page INT NOT NULL,
|
||||||
@@ -833,9 +834,9 @@ INSERT INTO adverts (imagepath) VALUES
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Initialize the system globals table.
|
# Initialize the system globals table.
|
||||||
INSERT INTO globals (posts_per_page, old_posts_at_top, max_search_page, max_comm_mbr_page, max_conf_mbr_page,
|
INSERT INTO globals (version, posts_per_page, old_posts_at_top, max_search_page, max_comm_mbr_page, max_conf_mbr_page,
|
||||||
fp_posts, num_audit_page, comm_create_lvl)
|
fp_posts, num_audit_page, comm_create_lvl)
|
||||||
VALUES (20, 2, 20, 50, 50, 10, 100, 1000);
|
VALUES ('2026030501', 20, 2, 20, 50, 50, 10, 100, 1000);
|
||||||
|
|
||||||
# Initialize the global properies table.
|
# Initialize the global properies table.
|
||||||
INSERT INTO propglobal (ndx, data)
|
INSERT INTO propglobal (ndx, data)
|
||||||
|
|||||||
+3
-2
@@ -25,6 +25,7 @@ USE amsterdam;
|
|||||||
# likely to edit "on the fly." Stuff that can only be updated with a shutdown should go
|
# likely to edit "on the fly." Stuff that can only be updated with a shutdown should go
|
||||||
# in the XML config file. This table has ONLY ONE ROW!
|
# in the XML config file. This table has ONLY ONE ROW!
|
||||||
CREATE TABLE globals (
|
CREATE TABLE globals (
|
||||||
|
version CHAR(10) NOT NULL,
|
||||||
posts_per_page INT NOT NULL,
|
posts_per_page INT NOT NULL,
|
||||||
old_posts_at_top INT NOT NULL,
|
old_posts_at_top INT NOT NULL,
|
||||||
max_search_page INT NOT NULL,
|
max_search_page INT NOT NULL,
|
||||||
@@ -851,9 +852,9 @@ INSERT INTO adverts (imagepath) VALUES
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Initialize the system globals table.
|
# Initialize the system globals table.
|
||||||
INSERT INTO globals (posts_per_page, old_posts_at_top, max_search_page, max_comm_mbr_page, max_conf_mbr_page,
|
INSERT INTO globals (version, posts_per_page, old_posts_at_top, max_search_page, max_comm_mbr_page, max_conf_mbr_page,
|
||||||
fp_posts, num_audit_page, comm_create_lvl)
|
fp_posts, num_audit_page, comm_create_lvl)
|
||||||
VALUES (20, 2, 20, 50, 50, 10, 100, 1000);
|
VALUES ('2026030501', 20, 2, 20, 50, 50, 10, 100, 1000);
|
||||||
|
|
||||||
# Initialize the global properies table.
|
# Initialize the global properies table.
|
||||||
INSERT INTO propglobal (ndx, data)
|
INSERT INTO propglobal (ndx, data)
|
||||||
|
|||||||
@@ -49,3 +49,7 @@ ALTER TABLE ipban ADD INDEX by_mask (mask_hi, mask_lo);
|
|||||||
ALTER TABLE users MODIFY COLUMN email_confnum INT DEFAULT 0;
|
ALTER TABLE users MODIFY COLUMN email_confnum INT DEFAULT 0;
|
||||||
|
|
||||||
DROP TABLE refaudit;
|
DROP TABLE refaudit;
|
||||||
|
|
||||||
|
ALTER TABLE globals ADD COLUMN version CHAR(10) FIRST;
|
||||||
|
UPDATE globals SET version = '2026030501';
|
||||||
|
ALTER TABLE globals MODIFY COLUMN version CHAR(10) NOT NULL;
|
||||||
|
|||||||
@@ -240,6 +240,13 @@ func TopPage(ctxt ui.AmContext) (string, any) {
|
|||||||
* Data as a parameter for the command string.
|
* Data as a parameter for the command string.
|
||||||
*/
|
*/
|
||||||
func AboutPage(ctxt ui.AmContext) (string, any) {
|
func AboutPage(ctxt ui.AmContext) (string, any) {
|
||||||
|
// Set the database version.
|
||||||
|
g, err := database.AmGlobals(ctxt.Ctx())
|
||||||
|
if err != nil {
|
||||||
|
return "error", err
|
||||||
|
}
|
||||||
|
ctxt.VarMap().Set("dbVersion", g.Version)
|
||||||
|
|
||||||
// Set the page title.
|
// Set the page title.
|
||||||
ctxt.SetFrameTitle("About Amsterdam")
|
ctxt.SetFrameTitle("About Amsterdam")
|
||||||
return "framed", "about.jet"
|
return "framed", "about.jet"
|
||||||
|
|||||||
+9
-17
@@ -10,23 +10,19 @@
|
|||||||
<div class="flex-1 p-4">
|
<div class="flex-1 p-4">
|
||||||
<!-- Amsterdam Logo -->
|
<!-- Amsterdam Logo -->
|
||||||
<div class="text-center mb-6">
|
<div class="text-center mb-6">
|
||||||
<img src="/img/builtin/AmsterdamLogo.png"
|
<img src="/img/builtin/AmsterdamLogo.png" alt="Amsterdam Web Communities System" class="w-96 h-88 mx-auto">
|
||||||
alt="Amsterdam Web Communities System"
|
|
||||||
class="w-96 h-88 mx-auto">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Version and Copyright -->
|
<!-- Version and Copyright -->
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<h3 class="text-lg font-bold mb-2">Amsterdam Web Communities System Release {{ AmsterdamVersion }}</h3>
|
<h1 class="text-2xl font-bold mb-2">Amsterdam Web Communities System Release {{ AmsterdamVersion }} - Database Version {{ dbVersion }}</h1>
|
||||||
<p class="text-sm text-black mb-4">
|
<p class="text-base text-black mb-4">
|
||||||
Copyright © {{ AmsterdamCopyright }} <a href="https://erbosoft.com/">Erbosoft Metaverse Design Solutions</a>,
|
Copyright © {{ AmsterdamCopyright }} <a href="https://erbosoft.com/">Erbosoft Metaverse Design Solutions</a>,
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
</p>
|
</p>
|
||||||
<p class="text-sm text-black">
|
<p class="text-base text-black">
|
||||||
This software is subject to the
|
This software is subject to the
|
||||||
<a href="https://www.mozilla.org/en-US/MPL/2.0/"
|
<a href="https://www.mozilla.org/en-US/MPL/2.0/" target="_blank" class="text-blue-700 hover:text-blue-900">Mozilla Public License Version 2.0</a>.
|
||||||
target="_blank"
|
|
||||||
class="text-blue-700 hover:text-blue-900">Mozilla Public License Version 2.0</a>.
|
|
||||||
It is distributed on an "AS IS" basis, <strong>without warranty of any kind</strong>, either express or implied.
|
It is distributed on an "AS IS" basis, <strong>without warranty of any kind</strong>, either express or implied.
|
||||||
See the License for the specific language governing rights and limitations under the License.
|
See the License for the specific language governing rights and limitations under the License.
|
||||||
</p>
|
</p>
|
||||||
@@ -34,8 +30,8 @@
|
|||||||
|
|
||||||
<!-- Project Team -->
|
<!-- Project Team -->
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<h3 class="text-lg font-bold mb-4">The Amsterdam Project Team</h3>
|
<h3 class="text-xl font-bold mb-4">The Amsterdam Project Team</h3>
|
||||||
<dl class="text-sm text-black space-y-3">
|
<dl class="text-base text-black space-y-3">
|
||||||
<div>
|
<div>
|
||||||
<dt class="font-bold">Amy Gale Ruth Bowersox</dt>
|
<dt class="font-bold">Amy Gale Ruth Bowersox</dt>
|
||||||
<dd class="ml-4">Code wrangler, system guru, and administrator in general</dd>
|
<dd class="ml-4">Code wrangler, system guru, and administrator in general</dd>
|
||||||
@@ -45,7 +41,7 @@
|
|||||||
|
|
||||||
<!-- Thanks Section -->
|
<!-- Thanks Section -->
|
||||||
<div class="text-center mb-6">
|
<div class="text-center mb-6">
|
||||||
<p class="text-sm text-black italic">
|
<p class="text-base text-black italic">
|
||||||
Thanks to: Howard, who thought it up; Andre, who rescued it the first time; the Electric Minds community, who rescued it again;
|
Thanks to: Howard, who thought it up; Andre, who rescued it the first time; the Electric Minds community, who rescued it again;
|
||||||
and Nicole, without whom none of this would have been possible.
|
and Nicole, without whom none of this would have been possible.
|
||||||
</p>
|
</p>
|
||||||
@@ -53,11 +49,7 @@
|
|||||||
|
|
||||||
<!-- Erbosoft Logo -->
|
<!-- Erbosoft Logo -->
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<a href="https://erbosoft.com/">
|
<a href="https://erbosoft.com/"><img src="/img/builtin/Erbosoft-logo.png" alt="Erbosoft Metaverse Design Solutions" class="w-72 h-25 mx-auto"></a>
|
||||||
<img src="/img/builtin/Erbosoft-logo.png"
|
|
||||||
alt="Erbosoft Metaverse Design Solutions"
|
|
||||||
class="w-72 h-25 mx-auto">
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user