diff --git a/bookwyrm/management/commands/populate_streams.py b/bookwyrm/management/commands/populate_streams.py index a04d7f5ad..0b09ea6cb 100644 --- a/bookwyrm/management/commands/populate_streams.py +++ b/bookwyrm/management/commands/populate_streams.py @@ -6,7 +6,7 @@ from bookwyrm import activitystreams, models def populate_streams(stream=None): """build all the streams for all the users""" streams = [stream] if stream else activitystreams.streams.keys() - print("Populations streams", streams) + print("Populating streams", streams) users = models.User.objects.filter( local=True, is_active=True, diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index f8acca28f..0a8e8328e 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -125,9 +125,9 @@ STREAMS = [ DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": env("POSTGRES_DB", "fedireads"), - "USER": env("POSTGRES_USER", "fedireads"), - "PASSWORD": env("POSTGRES_PASSWORD", "fedireads"), + "NAME": env("POSTGRES_DB", "bookwyrm"), + "USER": env("POSTGRES_USER", "bookwyrm"), + "PASSWORD": env("POSTGRES_PASSWORD", "bookwyrm"), "HOST": env("POSTGRES_HOST", ""), "PORT": env("PGPORT", 5432), }, diff --git a/postgres-docker/Dockerfile b/postgres-docker/Dockerfile index 48d6c2a5e..0ec1ba66b 100644 --- a/postgres-docker/Dockerfile +++ b/postgres-docker/Dockerfile @@ -5,7 +5,7 @@ RUN mkdir /backups COPY ./backup.sh /backups COPY ./weed.sh /backups COPY ./cronfile /etc/cron.d/cronfile -RUN apt-get update && apt-get -y install cron +RUN apt-get update && apt-get -y --no-install-recommends install cron RUN chmod 0644 /etc/cron.d/cronfile RUN crontab /etc/cron.d/cronfile RUN touch /var/log/cron.log diff --git a/postgres-docker/backup.sh b/postgres-docker/backup.sh index ab96b37e8..9b65ad876 100755 --- a/postgres-docker/backup.sh +++ b/postgres-docker/backup.sh @@ -1,3 +1,7 @@ #!/bin/bash -filename=backup__$(date +%F) -pg_dump -U fedireads > /backups/$filename.sql +if [ -z "$POSTGRES_DB" ]; then + echo "Database not specified, defaulting to bookwyrm" +fi +BACKUP_DB=${POSTGRES_DB:-bookwyrm} +filename=backup_${BACKUP_DB}_$(date +%F) +pg_dump -U $BACKUP_DB > /backups/$filename.sql