From c9f6cb2aa7f6cfb225f590c3165246ca4ea3187d Mon Sep 17 00:00:00 2001 From: Brian O'Reilly Date: Sun, 7 Dec 2025 15:15:57 -0500 Subject: [PATCH] ... And then we ask: How did this *ever* work?? (It did. On my machine.) --- docker/docker-compose.yml | 4 ++-- docker/init-db.sql | 12 ++++++------ docker/stop.sh | 9 +++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c519e6c..faa681c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -32,7 +32,7 @@ services: - asteroid-network postgres: - image: postgres:16-alpine + image: postgres:17-alpine container_name: asteroid-postgres environment: - POSTGRES_DB=${ASTEROID_DB_NAME:-asteroid} @@ -42,7 +42,7 @@ services: - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data - - ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro + # - ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro restart: unless-stopped networks: - asteroid-network diff --git a/docker/init-db.sql b/docker/init-db.sql index 98d0185..c2a420f 100644 --- a/docker/init-db.sql +++ b/docker/init-db.sql @@ -82,14 +82,14 @@ CREATE INDEX idx_sessions_expires_at ON sessions(expires_at); -- Create default admin user (password: admin - CHANGE THIS!) -- Password hash for 'admin' using bcrypt -INSERT INTO users (username, email, password_hash, role, active) -VALUES ('admin', 'admin@asteroid.radio', '$2a$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYqYqYqYqYq', 'admin', true) -ON CONFLICT (username) DO NOTHING; +-- INSERT INTO users (username, email, password_hash, role, active) +-- VALUES ('admin', 'admin@asteroid.radio', '$2a$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYqYqYqYqYq', 'admin', true) +-- ON CONFLICT (username) DO NOTHING; -- Create a test listener user -INSERT INTO users (username, email, password_hash, role, active) -VALUES ('listener', 'listener@asteroid.radio', '$2a$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYqYqYqYqYq', 'listener', true) -ON CONFLICT (username) DO NOTHING; +-- INSERT INTO users (username, email, password_hash, role, active) +-- VALUES ('listener', 'listener@asteroid.radio', '$2a$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYqYqYqYqYq', 'listener', true) +-- ON CONFLICT (username) DO NOTHING; -- Grant necessary permissions GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO asteroid; diff --git a/docker/stop.sh b/docker/stop.sh index 1c0dcc4..f695a86 100755 --- a/docker/stop.sh +++ b/docker/stop.sh @@ -8,5 +8,14 @@ echo "🛑 Stopping Asteroid Radio Docker Services..." # Stop services docker compose down +# if we really need to clean everything and start fresh, run the +# following commands: + +# docker compose down postgres +# docker volume rm docker_postgres-data + +# TODO - apply a getopt interface to this script. + + echo "" echo "✅ Services stopped."