Merge with remote repository and apply database cleanup

- Merged remote history with local workspace changes
- Removed obsolete database initialization scripts (init_database.py, init_db.py, init_mariadb.py, test_sql.py)
- Added new comprehensive database initialization script (initialize_database.py)
- Added documentation (DATABASE_GUIDE.md, CLEANUP_SUMMARY.md)
- Updated init_defaults.py comment
- Added GitHub connection helper script
This commit is contained in:
RobbStarkAustria
2025-10-10 15:28:04 +00:00
3 changed files with 174 additions and 1 deletions

100
.gitignore vendored Normal file
View File

@@ -0,0 +1,100 @@
# OS/Editor
.DS_Store
Thumbs.db
.vscode/
.idea/
# Python
__pycache__/
*.pyc
.pytest_cache/
# Node
node_modules/
dashboard/node_modules/
dashboard/.vite/
# Env files (never commit secrets)
.env
.env.local
# Docker
*.log
# Python-related
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.pdb
*.egg-info/
*.eggs/
*.env
.env
# Byte-compiled / optimized / DLL files
*.pyc
*.pyo
*.pyd
# Virtual environments
venv/
env/
.venv/
.env/
# Logs and databases
*.log
*.sqlite3
*.db
# Docker-related
*.pid
*.tar
docker-compose.override.yml
docker-compose.override.*.yml
docker-compose.override.*.yaml
# Node.js-related
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Dash and Flask cache
*.cache
*.pytest_cache/
instance/
*.mypy_cache/
*.hypothesis/
*.coverage
.coverage.*
# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*.bak
*.tmp
# OS-generated files
.DS_Store
Thumbs.db
desktop.ini
# Devcontainer-related
.devcontainer/
received_screenshots/
mosquitto/
alte/
screenshots/
media/
dashboard/manitine_test.py
dashboard/pages/test.py
.gitignore
dashboard/sidebar_test.py
dashboard/assets/responsive-sidebar.css
certs/
sync.ffs_db
.pnpm-store/

73
connect_to_github.sh Executable file
View File

@@ -0,0 +1,73 @@
#!/bin/bash
# Script to connect this workspace to your existing GitHub repository
echo "🔗 Connecting workspace to GitHub repository..."
echo "================================================="
# Check if repository name is provided
if [ -z "$1" ]; then
echo "❌ Error: Repository name required"
echo ""
echo "Usage: $0 <repository-name>"
echo ""
echo "Examples:"
echo " $0 infoscreen_2025"
echo " $0 infoscreen-2025"
echo " $0 infoscreen_server_2025"
echo ""
echo "Your GitHub username appears to be: robbstarkaustria"
exit 1
fi
REPO_NAME="$1"
GITHUB_USER="robbstarkaustria"
REPO_URL="https://github.com/${GITHUB_USER}/${REPO_NAME}.git"
echo "Repository: ${REPO_URL}"
echo ""
# Add the remote origin
echo "🔄 Adding remote origin..."
git remote add origin "$REPO_URL"
if [ $? -eq 0 ]; then
echo "✅ Remote origin added successfully"
else
echo "⚠️ Remote might already exist, removing and re-adding..."
git remote remove origin 2>/dev/null
git remote add origin "$REPO_URL"
fi
# Show current remotes
echo ""
echo "📋 Current remotes:"
git remote -v
echo ""
echo "🔄 Fetching from remote repository..."
git fetch origin
echo ""
echo "🔄 Setting upstream and pushing..."
git branch --set-upstream-to=origin/main main
# Try to push (might require authentication)
echo ""
echo "🚀 Pushing to GitHub..."
echo "Note: You may need to authenticate with GitHub"
git push -u origin main
if [ $? -eq 0 ]; then
echo ""
echo "🎉 Successfully connected and pushed to GitHub!"
echo "Repository URL: https://github.com/${GITHUB_USER}/${REPO_NAME}"
else
echo ""
echo "⚠️ Push failed. This might be because:"
echo "1. You need to authenticate with GitHub"
echo "2. The repository doesn't exist"
echo "3. You don't have push permissions"
echo ""
echo "Try running: git push -u origin main"
echo "Or use GitHub CLI: gh auth login"
fi

View File

@@ -23,7 +23,7 @@ with engine.connect() as conn:
# Admin-Benutzer anlegen, falls nicht vorhanden
admin_user = os.getenv("DEFAULT_ADMIN_USERNAME", "infoscreen_admin")
admin_pw = os.getenv("DEFAULT_ADMIN_PASSWORD", "Info_screen_admin25!")
# Passwort hashen mit bcrypt
# Passwort hashen mit bcrypt
hashed_pw = bcrypt.hashpw(admin_pw.encode(
'utf-8'), bcrypt.gensalt()).decode('utf-8')
# Prüfen, ob User existiert