Commit Graph

327 Commits

Author SHA1 Message Date
Frank ae4ccbe416 I am not sure if this is doing right 2026-01-18 22:26:15 +01:00
Frank e85a317394 deploymen is crashing on backup 2026-01-18 22:14:37 +01:00
Frank 0da2ad556d update and bugfix deployment 2026-01-18 21:47:05 +01:00
Frank 114a3e38b0 fixed problems in deploy app and deployment package 2026-01-18 00:54:32 +01:00
Frank 483dd4c72b created a README for deployment
I hope at makes me remember the right steps
2026-01-17 23:11:51 +01:00
Frank d4341a4730 removed the Git_Commit from system information output
it is not easyly to manage since both backend and frontend are running in compiled packages  in production and we have no git repository underneath
2026-01-17 08:07:26 +01:00
Frank 36c619dbb6 changed string Bamort to BaMoRT 2026-01-17 07:35:18 +01:00
Frank 7731aa4125 check again if all goals are met 2026-01-17 00:15:10 +01:00
Frank 33f80be1ca added additional integration tests 2026-01-16 23:41:57 +01:00
Frank 2a2f951ae6 feat: Complete Phase 6 - Testing & Documentation
Implemented comprehensive testing and documentation for deployment system:

Testing:
- Created integration_test.go with 7 test scenarios
- Tests cover: fresh installation, updates, rollback, concurrent migrations
- Tests validate version tracking and compatibility checks

Documentation:
- DEPLOYMENT_RUNBOOK.md: Complete deployment procedures with checklists
- ROLLBACK_GUIDE.md: Rollback procedures for all scenarios with time estimates
- TROUBLESHOOTING.md: Common issues and solutions with diagnostic commands
- VERSION_COMPATIBILITY.md: Version matrix and upgrade paths

Deployment Scripts:
- deploy-dev.sh: Development deployment automation
- deploy-staging.sh: Staging deployment with backup creation
- deploy-production.sh: Production deployment with migrations and validation

All scripts follow KISS principle and include:
- Pre-deployment validation
- Automatic backup creation
- Database migration execution
- Master data import (when package provided)
- Health checks and rollback on failure
- Comprehensive logging

Phase 6 complete. Ready for production deployment testing.

Refs: #DEPLOYMENT_IMPLEMENTATION_PLAN Phase 6
2026-01-16 23:28:35 +01:00
Frank caec3293ab feat: implement Phase 4 - API Health Endpoint
- Add system package with health check and version endpoints
- Implement GET /api/system/health (public, no auth required)
- Implement GET /api/system/version (public, no auth required)
- Health endpoint returns version compatibility and migration status
- Version endpoint returns detailed backend and database version info
- Add comprehensive test suite (6 tests, all passing)
- Register public routes in cmd/main.go
- Fix maintenance handler to use pointers for migration structs

Health endpoint response includes:
- Backend version and required DB version
- Current DB version and compatibility status
- Pending migrations count
- Timestamp

Ready for Phase 5: Frontend Warning Banner integration
2026-01-16 22:44:48 +01:00
Frank 0438307700 Phase 3 added deployment strutures migration to migrateAllStructures 2026-01-16 16:44:57 +01:00
Frank 4b8113aada fixed indention 2026-01-16 16:25:09 +01:00
Frank 1d9475c25f feat: Phase 3 - CLI Deployment Tool
Implements command-line interface for deployment operations with
colored output and comprehensive documentation.

Components Added:
- cmd/deploy/main.go: CLI tool implementation (140 lines)
  * Command routing for version/status/help
  * ANSI color-coded output
  * Database connectivity
  * Version compatibility checking

- cmd/deploy/README.md: Complete CLI documentation
  * Building instructions
  * Command reference with examples
  * Usage patterns (new setup, upgrades, master data sync)
  * Environment variables
  * CI/CD integration examples (GitLab, Docker)
  * Troubleshooting guide

- deployment/PHASE_3_COMPLETE.md: Implementation summary

Commands Implemented:
- version: Show backend and required DB versions
- status: Display database version, compatibility, pending migrations
- help: Show usage information

Features:
- Color-coded output (Green: success, Red: error, Yellow: warning, Cyan: headers)
- Database connection via database.ConnectDatabase()
- Version compatibility checking with detailed reason
- Pending migrations detection
- Exit codes (0: success, 1: error)

Integration:
- Uses config.GetVersion() for backend version
- Uses version.CheckCompatibility() for version checks
- Uses migrations.NewMigrationRunner() for migration info
- Compatible with existing database connection system

Build & Test:
✓ go build -o deploy cmd/deploy/main.go
✓ ./deploy version - shows version info
✓ ./deploy help - displays command list
✓ ./deploy status - checks database status

Dependencies:
- golang.org/x/term v0.39.0 (secure password input, ready for future commands)
- golang.org/x/sys v0.40.0 (upgraded)

Documentation:
- Comprehensive README with examples
- CI/CD integration patterns
- Docker deployment guide
- Troubleshooting section

Next: Phase 4 - API Endpoints for UI integration
2026-01-16 16:23:30 +01:00
Frank 33633f1d46 feat: Phase 2 - Master Data Versioning & Fresh Installation
Implements master data versioning system with backward compatibility
transformers and fresh installation orchestrator.

Components Added:
- deployment/masterdata/: Versioned export/import with transformers
  * export.go: ExportData structure (v1.0) with JSON I/O
  * transformers.go: ImportTransformer registry for version migrations
  * sync.go: MasterDataSync orchestrator with dependency-ordered imports
  * Tests: 8 tests covering export, transform, and sync operations

- deployment/install/: Fresh installation system
  * installer.go: NewInstallation orchestrator with 4-step process
  * createDatabaseSchema(): GORM AutoMigrate integration
  * initializeVersionTracking(): Version table setup
  * importMasterData(): Delegates to gsmaster functions
  * createAdmin(): Admin user creation with MD5 hashing
  * Tests: 7 tests covering installation flow and validation

Features:
- Export versioning (CurrentExportVersion = "1.0")
- Backward compatibility via transformer chain
- Dry-run capability for safe testing
- Dependency-ordered master data imports
- Admin user creation with role assignment

Integration:
- Uses models.MigrateStructure() for database-agnostic schema
- Delegates to gsmaster.ImportSources/Skills/Equipment/etc.
- Compatible with existing user authentication (MD5 hashing)

Testing:
 38 tests passing across all deployment packages
 backup: 6 tests
 install: 7 tests
 masterdata: 8 tests
 migrations: 11 tests
 version: 6 tests

Documentation:
- PHASE_2_COMPLETE.md: Comprehensive summary and API examples

Ready for Phase 3: CLI Deployment Tool
2026-01-16 16:03:34 +01:00
Frank ccf0e9b3f2 feat: implement Phase 1 deployment system foundation
- Version tracking with RequiredDBVersion constant
- Migration framework with GORM-based database-agnostic migrations
- Backup service with JSON export and retention policy
- schema_version and migration_history tables
- Full test coverage: 23 unit tests, all passing
- Works on SQLite (dev/test) and MariaDB (production)

Components:
- backend/deployment/version/ (version management)
- backend/deployment/migrations/ (migration runner)
- backend/deployment/backup/ (backup service)

See PHASE_1_COMPLETE.md for details.
2026-01-16 15:40:33 +01:00
Frank fc18212f43 Bump backend to 0.1.37, frontend to 0.1.29 2026-01-15 06:39:55 +01:00
Frank c18be276d1 Bump backend to 0.1.36, frontend to 0.1.28 2026-01-14 22:25:55 +01:00
Frank 15662d845a added MiscLookup to the export import 2026-01-14 22:14:23 +01:00
Frank f4691a7947 remove sqlite DB Backup 2026-01-14 22:03:15 +01:00
Frank 43227ec423 Bugfixes GetMiscLookupByKey 2026-01-14 21:58:37 +01:00
Frank c0a4b656d4 created GetMiscLookupByKey
for values we do not want hard coded but that are not worth its own struct
2026-01-14 21:13:25 +01:00
Frank 7775170634 moved some basic value lists to database 2026-01-14 18:52:29 +01:00
Frank 73ebe6f00d Bugfix
some fields (Gender, SocialClass, Herkunft, ResistenzKoerper, ResistenzGeist, Abwehr, Zaubern, Raufen) from the character generation process where not tranfered to the saved character
2026-01-14 16:48:32 +01:00
Frank c9aec1df03 Profile and Logout moved into a user menu 2026-01-14 16:14:42 +01:00
Frank 4e58a3b4bc added language setting to the users profile 2026-01-14 15:35:51 +01:00
Frank 4972816c75 Added new pages 2026-01-13 23:34:35 +01:00
Frank 469cdfcc90 changed modal dialogs
and images on landingpage
2026-01-13 23:11:57 +01:00
Frank 96ea032dcc Learn costs for creation where taken from the wrong source 2026-01-12 20:32:58 +01:00
Frank fa285c1d2b Learn costs for creation where taken from the wrong source 2026-01-12 17:11:17 +01:00
Frank 8e030ee6c9 Learn costs for creation where taken from the wrong source 2026-01-12 17:11:06 +01:00
Frank 6cd9681fc3 Lerning points where not fetched with correct params 2026-01-12 16:36:35 +01:00
Frank 0b57fbc618 added export functions for newly created tables 2026-01-12 16:36:35 +01:00
Frank 5e7acb8099 renamed tables for a name more matching the purpose 2026-01-12 16:36:35 +01:00
Frank f83faad432 move classmapping to DB
LearningPointsData transfered to DataBase
2026-01-12 16:36:35 +01:00
Frank 1a7d8af65c Weaponskill Categories test fixing 2026-01-12 16:36:35 +01:00
Frank 529d6e2b2b Handle Weaponskill Categories like Skill categories.
got categories from wrong source
fix some tests
2026-01-12 16:36:35 +01:00
Frank 310952c2d1 got categories from wrong source 2026-01-12 16:36:35 +01:00
Frank f30c8a00a9 category is taken from the link table learning_weaponskill_category_difficulties 2026-01-12 16:36:35 +01:00
Frank 183ad58066 category is taken from the link table learning_weaponskill_category_difficulties 2026-01-12 16:36:35 +01:00
Frank 2d85ad1e8b category is taken from the link table learning_skill_category_difficulties 2026-01-12 16:36:35 +01:00
Frank 5dad43d734 category is taken from the link table learning_skill_category_difficulties 2026-01-12 16:36:35 +01:00
Frank d436ce8d0d removed Placeholder from skill database
fixed tests in gsmaster
2026-01-12 16:36:35 +01:00
Frank 447eef560e integrated export_import_additional.go in export_import.go 2026-01-12 16:36:35 +01:00
Frank 8c52d3ac74 Change to PolyForm Noncommercial License 1.0.0 2026-01-07 15:39:07 +01:00
Frank 9411d1af33 refactored for less code duplication 2026-01-05 09:56:12 +01:00
Frank 24f3f4c090 Export and Import of Game system master data 2026-01-05 09:29:31 +01:00
Frank 2dcb4e00fa Export and Import of Game system master data 2026-01-04 23:06:40 +01:00
Frank 9dcd8121f1 Skill editieren un neu erstellen 2026-01-04 17:49:25 +01:00
Frank fcf785081c Skill editieren un neu erstellen 2026-01-04 17:49:04 +01:00