diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1ba2263 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,45 @@ +# Changelog + +All notable changes to LoBBS will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- Logo assets with logo.pxd and logo.webp files +- Walkthrough video link in README +- Admin user functionality - first registered user automatically becomes administrator + +### Changed +- Updated README with improved documentation, license information, and links + +## [1.1.0] - 2025-12-05 + +### Added +- MPM plugin compatibility + +### Fixed +- Direct messages now properly filter out broadcasts + +## [1.0.1] - 2025-12-05 + +### Changed +- Enhanced installation documentation with Mesh Forge method +- Updated installation instructions for MPM integration + +## [1.0.0] - 2025-11-28 + +### Added +- Initial release of LoBBS (LoDB Bulletin Board System) +- User registration and authentication +- Bulletin board messaging system +- Direct messaging between users +- Session management +- User directory and search functionality + +[Unreleased]: https://github.com/MeshEnvy/lobbs/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/MeshEnvy/lobbs/compare/v1.0.1...v1.1.0 +[1.0.1]: https://github.com/MeshEnvy/lobbs/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/MeshEnvy/lobbs/compare/c911244...v1.0.0 diff --git a/src/LoBBSDal.cpp b/src/LoBBSDal.cpp index 851578f..36780d3 100644 --- a/src/LoBBSDal.cpp +++ b/src/LoBBSDal.cpp @@ -138,19 +138,23 @@ bool LoBBSDal::createUser(const char *username, const char *password, uint32_t n // Calculate UUID first (username with host node ID as salt) lodb_uuid_t userUuid = usernameToUuid(username, hostNodeId); + // Check if this is the first user (no existing users) + bool isFirstUser = (db->count("users") == 0); + // Create user record meshtastic_LoBBSUser user = meshtastic_LoBBSUser_init_zero; strncpy(user.username, username, sizeof(user.username) - 1); user.uuid = userUuid; user.password_hash.size = 32; hashPassword(password, user.password_hash.bytes); + user.is_admin = isFirstUser; LoDbError err = db->insert("users", userUuid, &user); if (err != LODB_OK) { LOG_ERROR("Failed to create user: %s", username); return false; } - LOG_INFO("Created user: %s", username); + LOG_INFO("Created user: %s (admin: %s)", username, isFirstUser ? "yes" : "no"); // Log in the user (create session) return loginUser(username, nodeId); diff --git a/src/lobbs.proto b/src/lobbs.proto index 21ceaa3..2a9f2d7 100644 --- a/src/lobbs.proto +++ b/src/lobbs.proto @@ -22,6 +22,11 @@ message LoBBSUser { * User UUID - deterministic hash derived from username */ uint64 uuid = 3; + + /* + * Whether this user is an administrator + */ + bool is_admin = 4; } /*