Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6a6f4cd0c | |||
|
|
30db21f4af | ||
|
|
a169999ff1 | ||
|
|
8b175557dc | ||
| 5e31f00b77 | |||
| 8f89423994 | |||
|
|
f92cb1f134 | ||
|
|
a385b0540d |
19
.dockerignore
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
target
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
docker-compose.prod.yml
|
||||||
|
Makefile
|
||||||
|
Caddyfile
|
||||||
|
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
*.sqlite
|
||||||
|
*.sqlite-*
|
||||||
|
|
||||||
|
uploads
|
||||||
|
*report.html
|
||||||
26
.env.production.example
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
CONTAINER_NAME=universal-web
|
||||||
|
REVERSE_PROXY_NETWORK=
|
||||||
|
UPLOADS_VOLUME_NAME=universal_web_uploads
|
||||||
|
|
||||||
|
APP_HOST=https://gitara.farmeris.sk
|
||||||
|
PORT=5150
|
||||||
|
SERVER_BINDING=0.0.0.0
|
||||||
|
|
||||||
|
DATABASE_URL=
|
||||||
|
JWT_SECRET=
|
||||||
|
|
||||||
|
ADMIN_EMAIL=
|
||||||
|
ADMIN_PASSWORD=
|
||||||
|
ADMIN_NAME=Admin
|
||||||
|
UPLOADS_ROOT=data/uploads
|
||||||
|
|
||||||
|
LOG_LEVEL=info
|
||||||
|
LOG_FORMAT=compact
|
||||||
|
|
||||||
|
MAILER_STUB=true
|
||||||
|
SMTP_ENABLE=false
|
||||||
|
SMTP_HOST=localhost
|
||||||
|
SMTP_PORT=1025
|
||||||
|
SMTP_SECURE=false
|
||||||
|
SMTP_USER=
|
||||||
|
SMTP_PASSWORD=
|
||||||
2
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
**/config/local.yaml
|
**/config/local.yaml
|
||||||
**/config/*.local.yaml
|
**/config/*.local.yaml
|
||||||
**/config/production.yaml
|
|
||||||
|
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
@@ -22,3 +21,4 @@ target/
|
|||||||
.env.production
|
.env.production
|
||||||
uploads/
|
uploads/
|
||||||
*.report.html
|
*.report.html
|
||||||
|
favicon_io.zip
|
||||||
|
|||||||
14
Caddyfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
gitara.farmeris.sk {
|
||||||
|
encode gzip
|
||||||
|
|
||||||
|
@static path /static/*
|
||||||
|
header @static Cache-Control "public, max-age=2592000"
|
||||||
|
|
||||||
|
rewrite /favicon.ico /static/favicon/favicon.ico
|
||||||
|
|
||||||
|
reverse_proxy gitara-web:5150
|
||||||
|
}
|
||||||
|
|
||||||
|
www.gitara.farmeris.sk {
|
||||||
|
redir https://gitara.farmeris.sk{uri} permanent
|
||||||
|
}
|
||||||
60
Cargo.lock
generated
@@ -1523,6 +1523,36 @@ dependencies = [
|
|||||||
"wasip3",
|
"wasip3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gitara_web"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"async-trait",
|
||||||
|
"axum",
|
||||||
|
"axum-extra",
|
||||||
|
"bytes",
|
||||||
|
"chrono",
|
||||||
|
"dotenvy",
|
||||||
|
"fluent-templates",
|
||||||
|
"include_dir",
|
||||||
|
"insta",
|
||||||
|
"loco-rs",
|
||||||
|
"migration",
|
||||||
|
"regex",
|
||||||
|
"rstest",
|
||||||
|
"sea-orm",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serial_test",
|
||||||
|
"time",
|
||||||
|
"tokio",
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
|
"unic-langid",
|
||||||
|
"uuid",
|
||||||
|
"validator",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glob"
|
name = "glob"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
@@ -5052,36 +5082,6 @@ version = "0.2.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "universal_web"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"async-trait",
|
|
||||||
"axum",
|
|
||||||
"axum-extra",
|
|
||||||
"bytes",
|
|
||||||
"chrono",
|
|
||||||
"dotenvy",
|
|
||||||
"fluent-templates",
|
|
||||||
"include_dir",
|
|
||||||
"insta",
|
|
||||||
"loco-rs",
|
|
||||||
"migration",
|
|
||||||
"regex",
|
|
||||||
"rstest",
|
|
||||||
"sea-orm",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"serial_test",
|
|
||||||
"time",
|
|
||||||
"tokio",
|
|
||||||
"tracing",
|
|
||||||
"tracing-subscriber",
|
|
||||||
"unic-langid",
|
|
||||||
"uuid",
|
|
||||||
"validator",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsafe-libyaml"
|
name = "unsafe-libyaml"
|
||||||
version = "0.2.11"
|
version = "0.2.11"
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "universal_web"
|
name = "gitara_web"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
default-run = "universal_web-cli"
|
default-run = "gitara_web-cli"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ axum-extra = { version = "0.10", features = ["form"] }
|
|||||||
bytes = { version = "1" }
|
bytes = { version = "1" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "universal_web-cli"
|
name = "gitara_web-cli"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/main.rs"
|
||||||
required-features = []
|
required-features = []
|
||||||
|
|
||||||
|
|||||||
25
Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
FROM rust:1-slim-bookworm AS builder
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR /usr/src
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cargo build --release --bin gitara_web-cli
|
||||||
|
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ca-certificates curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /usr/app
|
||||||
|
|
||||||
|
COPY --from=builder /usr/src/assets assets
|
||||||
|
COPY --from=builder /usr/src/config config
|
||||||
|
COPY --from=builder /usr/src/target/release/gitara_web-cli gitara_web-cli
|
||||||
|
|
||||||
|
ENV LOCO_ENV=production
|
||||||
|
EXPOSE 5150
|
||||||
|
ENTRYPOINT ["/usr/app/gitara_web-cli"]
|
||||||
|
CMD ["start"]
|
||||||
20
Makefile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
COMPOSE = docker compose -f docker-compose.prod.yml --env-file .env.production
|
||||||
|
|
||||||
|
.PHONY: up down restart logs build ps
|
||||||
|
|
||||||
|
up:
|
||||||
|
$(COMPOSE) up -d --build
|
||||||
|
|
||||||
|
down:
|
||||||
|
$(COMPOSE) down
|
||||||
|
|
||||||
|
restart: down up
|
||||||
|
|
||||||
|
logs:
|
||||||
|
$(COMPOSE) logs -f --tail=100
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(COMPOSE) build --no-cache
|
||||||
|
|
||||||
|
ps:
|
||||||
|
$(COMPOSE) ps
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
brand = Universal Web
|
brand = My guitar
|
||||||
hello-world = Hello world!
|
hello-world = Hello world!
|
||||||
meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place.
|
meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place.
|
||||||
nav-home = Home
|
nav-home = Home
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
brand = Universal Web
|
brand = My guitar
|
||||||
hello-world = Hello world!
|
hello-world = Hello world!
|
||||||
meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place.
|
meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place.
|
||||||
nav-home = Home
|
nav-home = Home
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
brand = Universal Web
|
brand = Moja gitara
|
||||||
hello-world = Ahoj svet!
|
hello-world = Ahoj svet!
|
||||||
meta-description = Osobná stránka gitaristu. Novinky, blog, albumy a skladby na jednom mieste.
|
meta-description = Osobná stránka gitaristu. Novinky, blog, albumy a skladby na jednom mieste.
|
||||||
nav-home = Domov
|
nav-home = Domov
|
||||||
|
|||||||
@@ -95,10 +95,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* === 3. Terminal look & feel ================================ */
|
/* === 3. Terminal look & feel ================================ */
|
||||||
|
/* Root font-size drives every rem in this file and in app.css.
|
||||||
|
* Bump this to scale the whole UI; drop to shrink. */
|
||||||
|
html { font-size: 19px; }
|
||||||
body {
|
body {
|
||||||
font-family: "JetBrains Mono", "Cascadia Code", "Fira Code",
|
font-family: "JetBrains Mono", "Cascadia Code", "Fira Code",
|
||||||
ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
|
ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
|
||||||
font-size: 15px;
|
font-size: 1rem;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +145,7 @@ body {
|
|||||||
.t-green { color: oklch(var(--su)); }
|
.t-green { color: oklch(var(--su)); }
|
||||||
.t-yellow { color: oklch(var(--wa)); }
|
.t-yellow { color: oklch(var(--wa)); }
|
||||||
.t-red { color: oklch(var(--er)); }
|
.t-red { color: oklch(var(--er)); }
|
||||||
.t-dim { color: oklch(var(--bc) / 0.5); }
|
.t-dim { color: oklch(var(--bc) / 0.75); }
|
||||||
|
|
||||||
/* --- window titlebar (the header) -------------------------- */
|
/* --- window titlebar (the header) -------------------------- */
|
||||||
.term-titlebar {
|
.term-titlebar {
|
||||||
@@ -230,7 +233,7 @@ body {
|
|||||||
line-height: 1.15;
|
line-height: 1.15;
|
||||||
color: oklch(var(--p));
|
color: oklch(var(--p));
|
||||||
}
|
}
|
||||||
.term-sub { margin-top: 0.2rem; font-size: 0.85rem; color: oklch(var(--bc) / 0.55); }
|
.term-sub { margin-top: 0.2rem; font-size: 0.85rem; color: oklch(var(--bc) / 0.8); }
|
||||||
.term-cmd-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
|
.term-cmd-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
|
||||||
|
|
||||||
/* --- responsive card grid ---------------------------------- */
|
/* --- responsive card grid ---------------------------------- */
|
||||||
@@ -529,13 +532,36 @@ body {
|
|||||||
.uw-queue-remove:hover { color: oklch(var(--er)); border-color: oklch(var(--er)); }
|
.uw-queue-remove:hover { color: oklch(var(--er)); border-color: oklch(var(--er)); }
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
/* Two-row layout: [title][prev][next][queue][close] on top,
|
||||||
|
* full-width <audio> scrubber underneath. */
|
||||||
.uw-player-tag { display: none; }
|
.uw-player-tag { display: none; }
|
||||||
.uw-player-title { max-width: 7rem; font-size: 0.95rem; }
|
.uw-player-inner {
|
||||||
.uw-player-inner { padding: 0.75rem 0.95rem; gap: 0.6rem; }
|
flex-wrap: wrap;
|
||||||
.uw-playing body { padding-bottom: 5.75rem; }
|
padding: 0.6rem 0.75rem;
|
||||||
.uw-player-btn { min-width: 2.4rem; height: 2.4rem; padding: 0 0.4rem; font-size: 0.95rem; }
|
gap: 0.4rem;
|
||||||
.uw-player-close { width: 2.4rem; height: 2.4rem; }
|
row-gap: 0.5rem;
|
||||||
#uw-audio { height: 2.7rem; min-width: 7rem; }
|
}
|
||||||
|
.uw-player-title {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: none;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
.uw-player-btn {
|
||||||
|
min-width: 2.2rem;
|
||||||
|
height: 2.2rem;
|
||||||
|
padding: 0 0.35rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
.uw-player-close { width: 2.2rem; height: 2.2rem; font-size: 0.95rem; }
|
||||||
|
#uw-audio {
|
||||||
|
order: 99;
|
||||||
|
flex: 1 1 100%;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
height: 2.4rem;
|
||||||
|
}
|
||||||
|
.uw-playing body { padding-bottom: 8.25rem; }
|
||||||
.uw-queue-head, .uw-queue-item { padding-left: 0.95rem; padding-right: 0.95rem; }
|
.uw-queue-head, .uw-queue-item { padding-left: 0.95rem; padding-right: 0.95rem; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
assets/static/favicon/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
assets/static/favicon/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
assets/static/favicon/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
assets/static/favicon/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
assets/static/favicon/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/static/favicon/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
1
assets/static/favicon/site.webmanifest
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"name":"","short_name":"","icons":[{"src":"/static/favicon/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/static/favicon/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
||||||
1
assets/static/vendor/htmx/htmx-1.9.12.min.js
vendored
Normal file
@@ -4,6 +4,12 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{% block title %}{{ t(key="admin-title", lang=lang | default(value='sk')) }}{% endblock title %}</title>
|
<title>{% block title %}{{ t(key="admin-title", lang=lang | default(value='sk')) }}{% endblock title %}</title>
|
||||||
|
<meta name="description" content="{% block meta_description %}{{ t(key="meta-description", lang=lang | default(value='sk')) }}{% endblock meta_description %}">
|
||||||
|
<link rel="icon" type="image/x-icon" href="/static/favicon/favicon.ico">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon/favicon-16x16.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">
|
||||||
|
<link rel="manifest" href="/static/favicon/site.webmanifest">
|
||||||
<script>
|
<script>
|
||||||
function applyTheme(t) {
|
function applyTheme(t) {
|
||||||
var dark = t === 'dark'
|
var dark = t === 'dark'
|
||||||
@@ -36,10 +42,10 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<link href="/static/css/app.css" rel="stylesheet" type="text/css">
|
<link href="/static/css/app.css?v=2026-05-20b" rel="stylesheet" type="text/css">
|
||||||
{% block head %}{% endblock head %}
|
{% block head %}{% endblock head %}
|
||||||
<link href="/static/css/theme.css" rel="stylesheet" type="text/css">
|
<link href="/static/css/theme.css?v=2026-05-20b" rel="stylesheet" type="text/css">
|
||||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
<script src="/static/vendor/htmx/htmx-1.9.12.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.nav-menu { flex-direction: row; }
|
.nav-menu { flex-direction: row; }
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{% block title %}{{ t(key="brand", lang=lang | default(value='sk')) }}{% endblock title %}</title>
|
<title>{% block title %}{{ t(key="brand", lang=lang | default(value='sk')) }}{% endblock title %}</title>
|
||||||
|
<meta name="description" content="{% block meta_description %}{{ t(key="meta-description", lang=lang | default(value='sk')) }}{% endblock meta_description %}">
|
||||||
|
<link rel="icon" type="image/x-icon" href="/static/favicon/favicon.ico">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon/favicon-16x16.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">
|
||||||
|
<link rel="manifest" href="/static/favicon/site.webmanifest">
|
||||||
<script>
|
<script>
|
||||||
function applyTheme(t) {
|
function applyTheme(t) {
|
||||||
var dark = t === 'dark'
|
var dark = t === 'dark'
|
||||||
@@ -220,9 +226,9 @@
|
|||||||
if (e.target.closest('#uw-close')) { uwClear(); return; }
|
if (e.target.closest('#uw-close')) { uwClear(); return; }
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<link href="/static/css/app.css" rel="stylesheet" type="text/css">
|
<link href="/static/css/app.css?v=2026-05-20b" rel="stylesheet" type="text/css">
|
||||||
<link href="/static/css/theme.css" rel="stylesheet" type="text/css">
|
<link href="/static/css/theme.css?v=2026-05-20b" rel="stylesheet" type="text/css">
|
||||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
<script src="/static/vendor/htmx/htmx-1.9.12.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.nav-menu { flex-direction: row; }
|
.nav-menu { flex-direction: row; }
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ mailer:
|
|||||||
# Database Configuration
|
# Database Configuration
|
||||||
database:
|
database:
|
||||||
# Database connection URI
|
# Database connection URI
|
||||||
uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/universal_web_development") }}
|
uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/gitara_web_development") }}
|
||||||
# When enabled, the sql query will be logged.
|
# When enabled, the sql query will be logged.
|
||||||
enable_logging: false
|
enable_logging: false
|
||||||
# Set the timeout duration when acquiring a connection.
|
# Set the timeout duration when acquiring a connection.
|
||||||
|
|||||||
57
config/production.yaml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
logger:
|
||||||
|
enable: true
|
||||||
|
pretty_backtrace: false
|
||||||
|
level: "{{ get_env(name="LOG_LEVEL", default="info") }}"
|
||||||
|
format: "{{ get_env(name="LOG_FORMAT", default="compact") }}"
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: {{ get_env(name="PORT", default="5150") }}
|
||||||
|
binding: "{{ get_env(name="SERVER_BINDING", default="0.0.0.0") }}"
|
||||||
|
host: "{{ get_env(name="APP_HOST") }}"
|
||||||
|
middlewares:
|
||||||
|
static:
|
||||||
|
enable: true
|
||||||
|
must_exist: true
|
||||||
|
precompressed: false
|
||||||
|
folder:
|
||||||
|
uri: "/static"
|
||||||
|
path: "assets/static"
|
||||||
|
fallback: "assets/static/404.html"
|
||||||
|
|
||||||
|
workers:
|
||||||
|
mode: "{{ get_env(name="WORKER_MODE", default="BackgroundAsync") }}"
|
||||||
|
|
||||||
|
mailer:
|
||||||
|
stub: {{ get_env(name="MAILER_STUB", default="true") }}
|
||||||
|
smtp:
|
||||||
|
enable: {{ get_env(name="SMTP_ENABLE", default="false") }}
|
||||||
|
host: "{{ get_env(name="SMTP_HOST", default="localhost") }}"
|
||||||
|
port: {{ get_env(name="SMTP_PORT", default="1025") }}
|
||||||
|
secure: {{ get_env(name="SMTP_SECURE", default="false") }}
|
||||||
|
auth:
|
||||||
|
user: "{{ get_env(name="SMTP_USER", default="") }}"
|
||||||
|
password: "{{ get_env(name="SMTP_PASSWORD", default="") }}"
|
||||||
|
|
||||||
|
database:
|
||||||
|
uri: "{{ get_env(name="DATABASE_URL") }}"
|
||||||
|
enable_logging: {{ get_env(name="DB_ENABLE_LOGGING", default="false") }}
|
||||||
|
connect_timeout: {{ get_env(name="DB_CONNECT_TIMEOUT", default="500") }}
|
||||||
|
idle_timeout: {{ get_env(name="DB_IDLE_TIMEOUT", default="500") }}
|
||||||
|
min_connections: {{ get_env(name="DB_MIN_CONNECTIONS", default="1") }}
|
||||||
|
max_connections: {{ get_env(name="DB_MAX_CONNECTIONS", default="5") }}
|
||||||
|
auto_migrate: {{ get_env(name="DB_AUTO_MIGRATE", default="true") }}
|
||||||
|
dangerously_truncate: false
|
||||||
|
dangerously_recreate: false
|
||||||
|
|
||||||
|
auth:
|
||||||
|
jwt:
|
||||||
|
location:
|
||||||
|
- from: Cookie
|
||||||
|
name: auth_token
|
||||||
|
- from: Bearer
|
||||||
|
secret: "{{ get_env(name="JWT_SECRET") }}"
|
||||||
|
expiration: {{ get_env(name="JWT_EXPIRATION", default="604800") }}
|
||||||
|
|
||||||
|
settings:
|
||||||
|
admin_email: "{{ get_env(name="ADMIN_EMAIL", default="") }}"
|
||||||
|
uploads_root: "{{ get_env(name="UPLOADS_ROOT", default="data/uploads") }}"
|
||||||
@@ -68,7 +68,7 @@ mailer:
|
|||||||
# Database Configuration
|
# Database Configuration
|
||||||
database:
|
database:
|
||||||
# Database connection URI
|
# Database connection URI
|
||||||
uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/universal_web_test") }}
|
uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/gitara_web_test") }}
|
||||||
# When enabled, the sql query will be logged.
|
# When enabled, the sql query will be logged.
|
||||||
enable_logging: false
|
enable_logging: false
|
||||||
# Set the timeout duration when acquiring a connection.
|
# Set the timeout duration when acquiring a connection.
|
||||||
|
|||||||
30
docker-compose.prod.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
services:
|
||||||
|
gitara-web:
|
||||||
|
container_name: gitara-web
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
env_file:
|
||||||
|
- .env.production
|
||||||
|
volumes:
|
||||||
|
- gitara_web_data:/usr/app/data
|
||||||
|
networks:
|
||||||
|
- gitara-net
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -fsS http://localhost:5150/_ping"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
start_period: 20s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gitara-net:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
gitara_web_data:
|
||||||
|
external: true
|
||||||
|
name: gitara_web_data
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use loco_rs::{cli::playground, prelude::*};
|
use loco_rs::{cli::playground, prelude::*};
|
||||||
use universal_web::app::App;
|
use gitara_web::app::App;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> loco_rs::Result<()> {
|
async fn main() -> loco_rs::Result<()> {
|
||||||
|
|||||||
BIN
favicon/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
favicon/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
favicon/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
favicon/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
favicon/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
favicon/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
1
favicon/site.webmanifest
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
use loco_rs::cli;
|
use loco_rs::cli;
|
||||||
use migration::Migrator;
|
use migration::Migrator;
|
||||||
use universal_web::app::App;
|
use gitara_web::app::App;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> loco_rs::Result<()> {
|
async fn main() -> loco_rs::Result<()> {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use insta::assert_debug_snapshot;
|
|||||||
use loco_rs::testing::prelude::*;
|
use loco_rs::testing::prelude::*;
|
||||||
use sea_orm::{ActiveModelTrait, ActiveValue, IntoActiveModel};
|
use sea_orm::{ActiveModelTrait, ActiveValue, IntoActiveModel};
|
||||||
use serial_test::serial;
|
use serial_test::serial;
|
||||||
use universal_web::{
|
use gitara_web::{
|
||||||
app::App,
|
app::App,
|
||||||
models::users::{self, Model, RegisterParams},
|
models::users::{self, Model, RegisterParams},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use insta::{assert_debug_snapshot, with_settings};
|
|||||||
use loco_rs::testing::prelude::*;
|
use loco_rs::testing::prelude::*;
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
use serial_test::serial;
|
use serial_test::serial;
|
||||||
use universal_web::{app::App, models::users};
|
use gitara_web::{app::App, models::users};
|
||||||
|
|
||||||
use super::prepare_data;
|
use super::prepare_data;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use axum::http::{HeaderName, HeaderValue};
|
use axum::http::{HeaderName, HeaderValue};
|
||||||
use loco_rs::{app::AppContext, TestServer};
|
use loco_rs::{app::AppContext, TestServer};
|
||||||
use universal_web::{models::users, views::auth::LoginResponse};
|
use gitara_web::{models::users, views::auth::LoginResponse};
|
||||||
|
|
||||||
const USER_EMAIL: &str = "test@loco.com";
|
const USER_EMAIL: &str = "test@loco.com";
|
||||||
const USER_PASSWORD: &str = "1234";
|
const USER_PASSWORD: &str = "1234";
|
||||||
|
|||||||