### ๐ DB management at startup
- [X] **If the database is empty**
- - [ ] Import initial YAML
+ - [ ] Import initial JSON
- [X] Populate the database
- [X] **If the database exists**
- - [ ] Ignore YAML **unless the repository file has changed**
- - [ ] If YAML has changed โ update the DB
+ - [ ] Ignore JSON **unless the repository file has changed**
+ - [ ] If JSON has changed โ update the DB
---
### ๐ ๏ธ Updates made by the Webapp
- [X] Apply changes to the database
-- [ ] Regenerate YAML from the DB
+- [X] Regenerate JSON from the DB
- [ ] Perform **commit + push** on Git
- [ ] Regenerate **from scratch**:
- [ ] **BIND (DNS)** configuration
---
-### ๐ YAML โ DB Periodic Consistency
-
-- [ ] Calculate YAML **expected checksum**
-- [ ] Compare with **actual checksum**
-- [ ] Determine which element has changed
-
-#### Synchronization rules
-- [ ] YAML changed โ update DB
-- [ ] DB changed โ regenerate YAML
-
----
-
## ๐งฉ Configuration Generation
### ๐งช BIND (DNS)
- [ ] Syntax validation (`named-checkconf`, `named-checkzone`)
- [ ] Rollback management in case of errors
- [ ] Update external DNS
- - [ ] Dedicated file
+ - [X] Dedicated file
- [ ] OVH
- [ ] Cloudflare
### ๐ง Backup & Recovery
- [X] Backup generation
+- [X] Backup restore
+- [ ] Backup/Restore from web
- [ ] Periodic backup of SQLite DB
- [ ] Remote Git repository backup
- [ ] Backup of generated configurations
# ================================
# Create DB if needed
# ================================
-def docker_create_db(logger):
+def create_db(logger):
# Reset database if requested
if settings.DB_RESET and os.path.exists(settings.DB_FILE):
logger.info("Removing existing database: %s", settings.DB_FILE)
print_welcome(logger)
# Create or update database
- docker_create_db(logger)
+ create_db(logger)
#os.makedirs(DATA_DIR, exist_ok=True)
#os.makedirs(BIND_DIR, exist_ok=True)