feat: add import/ directory for user database and config files

- Created import/db/ for custom SQL files
- Created import/conf/ for configuration overrides
- Added comprehensive README with usage examples
- Created example files for NPCs and playerbots config
- Updated import-database-files.sh to support new directory
- Maintains backward compatibility with database-import/
- Includes .gitignore to prevent accidental commits of sensitive data
This commit is contained in:
uprightbass360
2025-11-17 02:33:27 -05:00
parent d3484a3aea
commit 2aadbcc2a1
5 changed files with 186 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Copy user database files or full backup archives from database-import/ to backup system
# Copy user database files or full backup archives from import/db/ or database-import/ to backup system
set -euo pipefail
# Source environment variables
@@ -9,7 +9,15 @@ if [ -f ".env" ]; then
set +a
fi
IMPORT_DIR="./database-import"
# Support both new (import/db) and legacy (database-import) directories
IMPORT_DIR_NEW="./import/db"
IMPORT_DIR_LEGACY="./database-import"
# Prefer new directory if it has files, otherwise fall back to legacy
IMPORT_DIR="$IMPORT_DIR_NEW"
if [ ! -d "$IMPORT_DIR" ] || [ -z "$(ls -A "$IMPORT_DIR" 2>/dev/null)" ]; then
IMPORT_DIR="$IMPORT_DIR_LEGACY"
fi
STORAGE_PATH="${STORAGE_PATH:-./storage}"
STORAGE_PATH_LOCAL="${STORAGE_PATH_LOCAL:-./local-storage}"
BACKUP_ROOT="${STORAGE_PATH}/backups"