improve testenv

This commit is contained in:
LordMZTE 2021-07-31 23:50:52 +02:00
parent c6f398887b
commit 95b9212e83
5 changed files with 25 additions and 0 deletions

BIN
testenv/cdn/0/uff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

8
testenv/debug_run.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
export DBURL="mysql://jensmemes:snens@127.0.0.1:3306/jensmemes"
export CDNURL="http://127.0.0.1:8082"
export LISTEN="127.0.0.1:8081"
export RUST_BACKTRACE=1
cargo run

View file

@ -9,8 +9,17 @@ services:
MARIADB_USER: jensmemes
MARIADB_PASSWORD: snens
MARIADB_DATABASE: jensmemes
volumes:
- "./mariadb_init:/docker-entrypoint-initdb.d"
adminer:
image: adminer
ports:
- 8080:8080
cdn:
image: caddy
ports:
- "8082:80"
volumes:
- "./cdn:/usr/share/caddy"

View file

@ -0,0 +1,4 @@
CREATE TABLE IF NOT EXISTS categories (num INT UNIQUE NOT NULL , id varchar(255) NOT NULL , name TEXT, PRIMARY KEY (id));
CREATE TABLE IF NOT EXISTS users (id varchar(255) NOT NULL, name TEXT, authsource JSON, PRIMARY KEY (id));
CREATE TABLE IF NOT EXISTS memes (id INT NOT NULL AUTO_INCREMENT, filename varchar(255) NOT NULL, user varchar(255) NOT NULL, category varchar(255), timestamp DATETIME, ip varchar(255), PRIMARY KEY (id), FOREIGN KEY (category) REFERENCES categories(id), FOREIGN KEY (user) REFERENCES users(id));
CREATE TABLE IF NOT EXISTS token (uid varchar(255) UNIQUE NOT NULL, token varchar(255), FOREIGN KEY (uid) REFERENCES users(id));

View file

@ -0,0 +1,4 @@
INSERT INTO users (id, name, authsource) VALUES (0, 'alec', '{"name": "test authsource"}');
INSERT INTO categories (num, id, name) VALUES (0, 'uff', 'janz viele ueffen!');
INSERT INTO memes (id, filename, user, category, timestamp, ip) VALUES (0, 'uff.png', 0, 'uff', '2021-07-31', '127.0.0.1');
INSERT INTO token (uid, token) VALUES (0, '42069');