summaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.postgres.sh
blob: 8f987201eeddac8d1fe28c63f593f0b9e92f6859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash

CMD="$@"
if [ ! -f /var/lib/postgresql/data/setupFinished ]; then
    echo "### first run - setting up invidious database"
    /usr/local/bin/docker-entrypoint.sh postgres &
    sleep 10
    until runuser -l postgres -c 'pg_isready' 2>/dev/null; do
        >&2 echo "### Postgres is unavailable - waiting"
        sleep 5
    done
    >&2 echo "### importing table schemas"
    su postgres -c 'createdb invidious'
    su postgres -c 'psql -c "CREATE USER kemal WITH PASSWORD '"'kemal'"'"'
    su postgres -c 'psql invidious < config/sql/channels.sql'
    su postgres -c 'psql invidious < config/sql/videos.sql'
    su postgres -c 'psql invidious < config/sql/channel_videos.sql'
    su postgres -c 'psql invidious < config/sql/users.sql'
    su postgres -c 'psql invidious < config/sql/session_ids.sql'
    su postgres -c 'psql invidious < config/sql/nonces.sql'
    touch /var/lib/postgresql/data/setupFinished
    echo "### invidious database setup finished"
    exit
fi

echo "running postgres /usr/local/bin/docker-entrypoint.sh $CMD"
exec /usr/local/bin/docker-entrypoint.sh $CMD
gsubject'>Closes #111 - Adds ability to customise random instance poolsv1.1.43SimonBrazell 2020-11-08Fixes #119 - Change zh-CN to zh_CN.SimonBrazell 2020-11-07Update README.mdKunio Some suggestions, added FreeTube, updated invidious links, added permissions. 2020-11-05Update Russian translationTotalCaesar659 2020-11-04Update store listing templatesSimonBrazell 2020-11-04Update Bibliogram linksbopol Bibliogram has moved to source hut (for a while now) 2020-11-04Remove duplicate entry in instagramReservedPaths arraySimonBrazell 2020-11-04Remove "https://yewtu.be" from random instance listSimonBrazell 2020-11-04Ignore embedded videos for FreeTube redirectsSimonBrazell 2020-11-04Fixes #99 - Bibliogram, handle /igtv/, /tv/ and /reel/v1.1.42SimonBrazell 2020-11-04Fixes #104 - /remove-twitter-sw.js stopping Twitter redirectsSimonBrazell 2020-11-04Closes #113 - Added support for FreeTubeSimonBrazell 2020-11-04Clean up invidious random instance listSimonBrazell 2020-10-23Rename _locales/store.md to _locales/pl/store.mdAustin Huang