diff --git a/docker-compose.yml b/docker-compose.yml index b1698144a..10448dc27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ services: command: ["postgres", "-c", "log_statement=all"] volumes: - "./schema.sql:/docker-entrypoint-initdb.d/00-schema.sql" + - "./seed-users.sql:/docker-entrypoint-initdb.d/10-seed-users.sql" - "./seed-db.sql:/docker-entrypoint-initdb.d/10-seed-db.sql" environment: - POSTGRES_HOST_AUTH_METHOD=trust diff --git a/seed-db.sql b/seed-db.sql index 941036047..d5332f6d5 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1,26 +1,3 @@ -INSERT INTO public.users ( - username, passhash, created_utc, admin_level, over_18, is_activated, - original_username, defaultsorting, defaultsortingcomments, defaulttime, namecolor, titlecolor, theme, themecolor, - cardview, reddit, pronouns, verified, profileurl, highres, - marsify, last_viewed_post_notifs, last_viewed_log_notifs, last_viewed_reddit_notifs -) VALUES -('AutoJanny', '', extract(epoch from now()), 0, true, true, - 'AutoJanny', 'hot', 'top', 'day', 'ff66ac', 'ff66ac', 'dark', 'ff66ac', - false, 'old.reddit.com', 'clean/itup', 'Verified', '/i/pfps/1.webp', '/i/pfps/1.webp', - 0, 0, 0, 0), -('Snappy', '', extract(epoch from now()), 0, true, true, - 'Snappy', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'beep/boop', 'Verified', '/i/pfps/2.webp', '/i/pfps/2.webp', - 0, 0, 0, 0), -('longpostbot', '', extract(epoch from now()), 0, true, true, - 'longpostbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'tl/dr', 'Verified', '/i/pfps/3.webp', '/i/pfps/3.webp', - 0, 0, 0, 0), -('zozbot', '', extract(epoch from now()), 0, true, true, - 'zozbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'zoz/zle', 'Verified', '/i/pfps/4.webp', '/i/pfps/4.webp', - 0, 0, 0, 0); - -- -- PostgreSQL database dump -- diff --git a/seed-users.sql b/seed-users.sql new file mode 100644 index 000000000..15bac71d4 --- /dev/null +++ b/seed-users.sql @@ -0,0 +1,22 @@ +INSERT INTO public.users ( + username, passhash, created_utc, admin_level, over_18, is_activated, + original_username, defaultsorting, defaultsortingcomments, defaulttime, namecolor, titlecolor, theme, themecolor, + reddit, pronouns, verified, profileurl, highres, + marsify, last_viewed_post_notifs, last_viewed_log_notifs, last_viewed_reddit_notifs +) VALUES +('AutoJanny', '', extract(epoch from now()), 0, true, true, + 'AutoJanny', 'hot', 'top', 'day', 'ff66ac', 'ff66ac', 'dark', 'ff66ac', + 'old.reddit.com', 'clean/itup', 'Verified', '/i/pfps/1.webp', '/i/pfps/1.webp', + 0, 0, 0, 0), +('Snappy', '', extract(epoch from now()), 0, true, true, + 'Snappy', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', + 'old.reddit.com', 'beep/boop', 'Verified', '/i/pfps/2.webp', '/i/pfps/2.webp', + 0, 0, 0, 0), +('longpostbot', '', extract(epoch from now()), 0, true, true, + 'longpostbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', + 'old.reddit.com', 'tl/dr', 'Verified', '/i/pfps/3.webp', '/i/pfps/3.webp', + 0, 0, 0, 0), +('zozbot', '', extract(epoch from now()), 0, true, true, + 'zozbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', + 'old.reddit.com', 'zoz/zle', 'Verified', '/i/pfps/4.webp', '/i/pfps/4.webp', + 0, 0, 0, 0); diff --git a/ubuntu_setup.sh b/ubuntu_setup.sh index 0f7fbe9ae..c8f41085f 100644 --- a/ubuntu_setup.sh +++ b/ubuntu_setup.sh @@ -34,6 +34,7 @@ cp nginx-headers.conf /etc/nginx/includes/headers /etc/init.d/nginx reload psql -U postgres -f schema.sql postgres +psql -U postgres -f seed-users.sql postgres psql -U postgres -f seed-db.sql postgres pip3 install -r requirements.txt