Files
boc/iom/scripts/deploy_postgres.sh
T
Bernt bae705aa97 ARCHITECTURE: NFC roadmap, edge AI, audit logging
- Add NFC ePassport roadmap (ICAO 9303, eIDAS)
- Add TensorFlow.js edge face detection (BlazeFace)
- Add structured audit logger (GDPR-compliant)
- Risk scoring support

Part of KYC Apple Native UX v1.1.0
2026-06-29 16:24:48 +00:00

50 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "=== Deploying PostgreSQL + PostGIS ==="
# Check if PostgreSQL is installed
if ! command -v psql &> /dev/null; then
echo "Installing PostgreSQL..."
sudo -n dnf install -y postgresql15 postgresql15-server postgresql15-contrib
sudo -n postgresql-setup --initdb
fi
# Install PostGIS
if ! rpm -q postgis33_15 &> /dev/null; then
echo "Installing PostGIS..."
sudo -n dnf install -y postgis33_15
fi
# Start PostgreSQL
sudo -n systemctl enable postgresql
sudo -n systemctl start postgresql
# Create database and user
sudo -n -u postgres psql << 'EOF'
-- Create user
CREATE USER iom WITH PASSWORD 'iom_password' SUPERUSER;
-- Create database
CREATE DATABASE iom OWNER iom;
-- Enable PostGIS
\c iom
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
-- Grant permissions
GRANT ALL PRIVILEGES ON DATABASE iom TO iom;
GRANT ALL ON SCHEMA public TO iom;
-- Create tables
\i /home/bernt/.openclaw/workspace/iom/database/schema.sql
EOF
echo "=== PostgreSQL Deployed ==="
echo "Database: iom"
echo "User: iom"
echo "PostGIS: Enabled"
echo ""
echo "Connection: psql -h localhost -U iom -d iom"