put db and static into data/

This commit is contained in:
Lera Elvoé 2025-05-22 23:20:15 +03:00
parent ddad153875
commit af20b626d5
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc
6 changed files with 9 additions and 8 deletions

6
.gitignore vendored
View File

@ -1,10 +1,10 @@
logs/ logs/
nginx.conf.compiled nginx.conf.compiled
db.*.sqlite
.vscode/ .vscode/
.local/ .local/
static/avatars/* data/static/avatars/*
!static/avatars/default.webp !data/static/avatars/default.webp
data/db/*
secrets.lua secrets.lua
.first_launch.* .first_launch.*

View File

@ -7,7 +7,7 @@ config({"development", "production"}, {
code_cache = "off", code_cache = "off",
num_workers = "1", num_workers = "1",
sqlite = { sqlite = {
database = "db.dev.sqlite" database = "data/db/db.dev.sqlite"
}, },
secret = "SUPER SECRET", secret = "SUPER SECRET",
session_name = "porom_session", session_name = "porom_session",
@ -20,7 +20,7 @@ config("production", {
}, },
secret = secrets.key, secret = secrets.key,
sqlite = { sqlite = {
database = "db.prod.sqlite" database = "data/db/db.prod.sqlite"
}, },
session_name = "porom_session_s" session_name = "porom_session_s"
}) })

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -26,15 +26,15 @@ http {
} }
location /static/ { location /static/ {
alias static/; alias data/static/;
} }
location /favicon.ico { location /favicon.ico {
alias static/favicon.ico; alias data/static/favicon.ico;
} }
location /avatars { location /avatars {
alias static/avatars; alias data/static/avatars;
expires 1y; expires 1y;
} }
} }

View File

@ -7,6 +7,7 @@ start() {
first_launch() { first_launch() {
echo "Setting up for the first time" echo "Setting up for the first time"
touch ".first_launch.$LAPIS_ENVIRONMENT" touch ".first_launch.$LAPIS_ENVIRONMENT"
mkdir -p data/db
luajit schema.lua luajit schema.lua
lapis migrate lapis migrate
luajit create_default_accounts.lua luajit create_default_accounts.lua