fix docker

pull/138/head
Aevann 2023-03-05 19:23:15 +02:00
parent 9bfe7ad44b
commit 415311b6e1
4 changed files with 24 additions and 23 deletions

View File

@ -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

View File

@ -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
--

22
seed-users.sql 100644
View File

@ -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);

View File

@ -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