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
'2021-02-20 02:58:35 +0100'>2021-02-20Bump dependenciessaltycrys 2021-02-17Skip duration multiply by playback rate138138138 Fast Forward/Backward like YouTube. The skip duration is multiplied by playback rate. 2021-02-14Enable the Hebrew translation since it's now translated at more than 80%TheFrenchGhosty 2021-02-14Enable the Indonesian translation since it's now translated at more than 80%TheFrenchGhosty 2021-02-14Update Indonesian translationReza Almanda 2021-02-14Update Finnish translationRiku Viitanen 2021-02-14Update README.mdgripped Ubuntu / Debian instructions installing an old version of Crystal. 2021-02-11Update Hebrew translationJohn Johnson 2021-02-10Update Hebrew translationOmer I.S 2021-02-10Add Hebrew translation (#1753)Omer I.S * Add Hebrew translation * Update he.json * Update he.json * Update he.json * Update he.json * Update he.json * Update he.json * Update he.json * Update he.json Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> 2021-02-10Update Finnish translationRiku Viitanen