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:
2026-03-05 22:02:26 -07:00
parent f5360772ca
commit 5f67d8ce16
7 changed files with 49 additions and 37 deletions
+12 -8
View File
@@ -28,14 +28,18 @@ func SetupDb() (func(), error) {
db, err := sqlx.Connect(config.GlobalComputedConfig.DatabaseDriver, config.GlobalComputedConfig.DatabaseDSN)
if err == nil {
amdb = db
setupAdCache()
setupUserCache()
setupContactsCache()
setupCommunityCache()
setupServicesCache()
setupConferenceCache()
exitfns = append(exitfns, setupAuditWriter())
exitfns = append(exitfns, setupIPBanSweep())
g, err := AmGlobals(context.Background())
if err == nil {
setupAdCache()
setupUserCache()
setupContactsCache()
setupCommunityCache()
setupServicesCache()
setupConferenceCache()
exitfns = append(exitfns, setupAuditWriter())
exitfns = append(exitfns, setupIPBanSweep())
log.Infof("SetupDb(): database version %s", g.Version)
}
}
return func() {
slices.Reverse(exitfns)
+11 -8
View File
@@ -20,14 +20,15 @@ import (
// Globals contains the global data.
type Globals struct {
Mutex sync.Mutex
PostsPerPage int32 `db:"posts_per_page"`
OldPostsAtTop int32 `db:"old_posts_at_top"`
MaxSearchPage int32 `db:"max_search_page"`
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
FrontPagePosts int32 `db:"fp_posts"`
NumAuditPage int32 `db:"num_audit_page"`
CommunityCreateLevel int32 `db:"comm_create_lvl"`
Version string `db:"version"`
PostsPerPage int32 `db:"posts_per_page"`
OldPostsAtTop int32 `db:"old_posts_at_top"`
MaxSearchPage int32 `db:"max_search_page"`
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
FrontPagePosts int32 `db:"fp_posts"`
NumAuditPage int32 `db:"num_audit_page"`
CommunityCreateLevel int32 `db:"comm_create_lvl"`
flags *util.OptionSet
}
@@ -63,6 +64,7 @@ var globalPropMutex sync.Mutex
// Clone clones the entire global state.
func (g *Globals) Clone() *Globals {
rc := &Globals{
Version: g.Version,
PostsPerPage: g.PostsPerPage,
OldPostsAtTop: g.OldPostsAtTop,
MaxSearchPage: g.MaxSearchPage,
@@ -126,6 +128,7 @@ func AmReplaceGlobals(ctx context.Context, ng *Globals) error {
if err != nil {
return err
}
ng.Version = theGlobals.Version
ng.flags = nil
theGlobals = ng
return nil
+3 -2
View File
@@ -17,6 +17,7 @@
# 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!
CREATE TABLE globals (
version CHAR(10) NOT NULL,
posts_per_page INT NOT NULL,
old_posts_at_top INT NOT NULL,
max_search_page INT NOT NULL,
@@ -833,9 +834,9 @@ INSERT INTO adverts (imagepath) VALUES
##############################################################################
# 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)
VALUES (20, 2, 20, 50, 50, 10, 100, 1000);
VALUES ('2026030501', 20, 2, 20, 50, 50, 10, 100, 1000);
# Initialize the global properies table.
INSERT INTO propglobal (ndx, data)
+3 -2
View File
@@ -25,6 +25,7 @@ USE amsterdam;
# 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!
CREATE TABLE globals (
version CHAR(10) NOT NULL,
posts_per_page INT NOT NULL,
old_posts_at_top INT NOT NULL,
max_search_page INT NOT NULL,
@@ -851,9 +852,9 @@ INSERT INTO adverts (imagepath) VALUES
##############################################################################
# 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)
VALUES (20, 2, 20, 50, 50, 10, 100, 1000);
VALUES ('2026030501', 20, 2, 20, 50, 50, 10, 100, 1000);
# Initialize the global properies table.
INSERT INTO propglobal (ndx, data)
+4
View File
@@ -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;
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;
+7
View File
@@ -240,6 +240,13 @@ func TopPage(ctxt ui.AmContext) (string, any) {
* Data as a parameter for the command string.
*/
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.
ctxt.SetFrameTitle("About Amsterdam")
return "framed", "about.jet"
+9 -17
View File
@@ -10,23 +10,19 @@
<div class="flex-1 p-4">
<!-- Amsterdam Logo -->
<div class="text-center mb-6">
<img src="/img/builtin/AmsterdamLogo.png"
alt="Amsterdam Web Communities System"
class="w-96 h-88 mx-auto">
<img src="/img/builtin/AmsterdamLogo.png" alt="Amsterdam Web Communities System" class="w-96 h-88 mx-auto">
</div>
<!-- Version and Copyright -->
<div class="mb-6">
<h3 class="text-lg font-bold mb-2">Amsterdam Web Communities System Release {{ AmsterdamVersion }}</h3>
<p class="text-sm text-black mb-4">
<h1 class="text-2xl font-bold mb-2">Amsterdam Web Communities System Release {{ AmsterdamVersion }} - Database Version {{ dbVersion }}</h1>
<p class="text-base text-black mb-4">
Copyright © {{ AmsterdamCopyright }} <a href="https://erbosoft.com/">Erbosoft Metaverse Design Solutions</a>,
All Rights Reserved.
</p>
<p class="text-sm text-black">
<p class="text-base text-black">
This software is subject to the
<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>.
<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>.
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.
</p>
@@ -34,8 +30,8 @@
<!-- Project Team -->
<div class="mb-6">
<h3 class="text-lg font-bold mb-4">The Amsterdam Project Team</h3>
<dl class="text-sm text-black space-y-3">
<h3 class="text-xl font-bold mb-4">The Amsterdam Project Team</h3>
<dl class="text-base text-black space-y-3">
<div>
<dt class="font-bold">Amy Gale Ruth Bowersox</dt>
<dd class="ml-4">Code wrangler, system guru, and administrator in general</dd>
@@ -45,7 +41,7 @@
<!-- Thanks Section -->
<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;
and Nicole, without whom none of this would have been possible.
</p>
@@ -53,11 +49,7 @@
<!-- Erbosoft Logo -->
<div class="text-center">
<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>
<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>
</div>
</div>
</div>