feat: rebrand + favicon pack

This commit is contained in:
ae 2025-04-22 21:30:21 +03:00
parent 6da8421b2e
commit 96df52ed81
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E
23 changed files with 76 additions and 63 deletions

View File

@ -1,7 +1,7 @@
services: services:
notatest-psql: qnote-psql:
image: postgres:16-alpine image: postgres:16-alpine
container_name: notatest-psql container_name: qnote-psql
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
@ -10,30 +10,30 @@ services:
retries: 5 retries: 5
timeout: 5s timeout: 5s
volumes: volumes:
- notatest-data:/var/lib/postgresql/data - qnote-data:/var/lib/postgresql/data
networks: networks:
- notatest - qnote
environment: environment:
POSTGRES_USER: ${PG_USER:-notatest} POSTGRES_USER: ${PG_USER:-qnote}
POSTGRES_PASSWORD: ${PG_PASS:?db password required} POSTGRES_PASSWORD: ${PG_PASS:?db password required}
POSTGRES_DB: ${PG_DB:-notatest} POSTGRES_DB: ${PG_DB:-qnote}
notatest-server: qnote-server:
container_name: notatest-server container_name: qnote-server
build: build:
context: ${PWD}/server context: ${PWD}/server
dockerfile: ${PWD}/server/Dockerfile dockerfile: ${PWD}/server/Dockerfile
image: notatest-server:latest image: qnote-server:latest
networks: networks:
- notatest - qnote
ports: ports:
- 8080:8080 # ! - 8080:8080 # !
depends_on: depends_on:
notatest-psql: qnote-psql:
condition: service_healthy condition: service_healthy
environment: environment:
JWT_SECRET: ${JWT_SECRET:?jwt secret required} JWT_SECRET: ${JWT_SECRET:?jwt secret required}
DB_URL: postgres://${PG_USER:-notatest}:${PG_PASS:?db password required}@notatest-psql/${PG_DB:-notatest}?sslmode=disable DB_URL: postgres://${PG_USER:-qnote}:${PG_PASS:?db password required}@qnote-psql/${PG_DB:-qnote}?sslmode=disable
CSRF_SECRET: ${CSRF_SECRET:?csrf secret required} CSRF_SECRET: ${CSRF_SECRET:?csrf secret required}
ADMIN_USERNAME: ${ADMIN_USERNAME:?init admin username required} ADMIN_USERNAME: ${ADMIN_USERNAME:?init admin username required}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?init admin password required} ADMIN_PASSWORD: ${ADMIN_PASSWORD:?init admin password required}
@ -43,10 +43,10 @@ services:
FRONTEND_URL: http://localhost:5173 FRONTEND_URL: http://localhost:5173
networks: networks:
notatest: qnote:
external: false external: false
name: notatest name: qnote
volumes: volumes:
notatest-data: qnote-data:
name: notatest-data name: qnote-data

View File

@ -1,7 +1,7 @@
services: services:
notatest-psql: qnote-psql:
image: postgres:16-alpine image: postgres:16-alpine
container_name: notatest-psql container_name: qnote-psql
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
@ -12,26 +12,26 @@ services:
volumes: volumes:
- ${PWD}/data:/var/lib/postgresql/data - ${PWD}/data:/var/lib/postgresql/data
networks: networks:
- notatest - qnote
environment: environment:
POSTGRES_USER: ${PG_USER:-notatest} POSTGRES_USER: ${PG_USER:-qnote}
POSTGRES_PASSWORD: ${PG_PASS:?db password required} POSTGRES_PASSWORD: ${PG_PASS:?db password required}
POSTGRES_DB: ${PG_DB:-notatest} POSTGRES_DB: ${PG_DB:-qnote}
notatest-server: qnote-server:
container_name: notatest-server container_name: qnote-server
build: build:
context: ${PWD}/server context: ${PWD}/server
dockerfile: ${PWD}/server/Dockerfile dockerfile: ${PWD}/server/Dockerfile
image: notatest-server:latest image: qnote-server:latest
networks: networks:
- notatest - qnote
depends_on: depends_on:
notatest-psql: qnote-psql:
condition: service_healthy condition: service_healthy
environment: environment:
JWT_SECRET: ${JWT_SECRET:?jwt secret required} JWT_SECRET: ${JWT_SECRET:?jwt secret required}
DB_URL: postgres://${PG_USER:-notatest}:${PG_PASS:?db password required}@notatest-psql/${PG_DB:-notatest}?sslmode=disable DB_URL: postgres://${PG_USER:-qnote}:${PG_PASS:?db password required}@qnote-psql/${PG_DB:-qnote}?sslmode=disable
CSRF_SECRET: ${CSRF_SECRET:?csrf secret required} CSRF_SECRET: ${CSRF_SECRET:?csrf secret required}
ADMIN_USERNAME: ${ADMIN_USERNAME:?init admin username required} ADMIN_USERNAME: ${ADMIN_USERNAME:?init admin username required}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?init admin password required} ADMIN_PASSWORD: ${ADMIN_PASSWORD:?init admin password required}
@ -40,25 +40,25 @@ services:
DOMAIN: ${DOMAIN:-localhost} DOMAIN: ${DOMAIN:-localhost}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000} FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
notatest-web: qnote-web:
container_name: notatest-web container_name: qnote-web
build: build:
context: ${PWD}/web context: ${PWD}/web
dockerfile: ${PWD}/web/Dockerfile dockerfile: ${PWD}/web/Dockerfile
image: notatest-web:latest image: qnote-web:latest
networks: networks:
- notatest - qnote
# Add potential reverse proxy's local network here # Add potential reverse proxy's local network here
ports: ports:
- 3000:80 # Container port defined in nginx.conf (bound to 3000 for dev.) - 3000:80 # Container port defined in nginx.conf (bound to 3000 for dev.)
depends_on: depends_on:
- notatest-server - qnote-server
environment: environment:
VITE_VIEW_COOKIE_PATH: ${VITE_VIEW_COOKIE_PATH:-/} VITE_VIEW_COOKIE_PATH: ${VITE_VIEW_COOKIE_PATH:-/}
VITE_VIEW_COOKIE_DOMAIN: ${DOMAIN:-localhost} VITE_VIEW_COOKIE_DOMAIN: ${DOMAIN:-localhost}
VITE_COOKIE_SAME_SITE: ${VITE_COOKIE_SAME_SITE:-strict} VITE_COOKIE_SAME_SITE: ${VITE_COOKIE_SAME_SITE:-strict}
networks: networks:
notatest: qnote:
external: false external: false
name: notatest name: qnote

View File

@ -2,5 +2,5 @@
# Delete all Docker artifacts (e.g. DB) from previous test runs # Delete all Docker artifacts (e.g. DB) from previous test runs
docker stop notatest-server notatest-psql && docker rm -f notatest-server notatest-psql docker stop qnote-server qnote-psql && docker rm -f qnote-server qnote-psql
docker volume rm -f notatest-data docker volume rm -f qnote-data

View File

@ -2,9 +2,9 @@
DEV_COMPOSE_FILE="docker-compose-dev-backend.yml" DEV_COMPOSE_FILE="docker-compose-dev-backend.yml"
[ "$( docker container inspect -f '{{.State.Status}}' notatest-psql )" = "running" ] || docker compose up notatest-psql -d [ "$( docker container inspect -f '{{.State.Status}}' qnote-psql )" = "running" ] || docker compose up qnote-psql -d
# Shutdown, rebuild, & restart # Shutdown, rebuild, & restart
docker compose stop notatest-server && docker compose rm -f notatest-server docker compose stop qnote-server && docker compose rm -f qnote-server
docker compose -f $DEV_COMPOSE_FILE build docker compose -f $DEV_COMPOSE_FILE build
docker compose -f $DEV_COMPOSE_FILE up notatest-server docker compose -f $DEV_COMPOSE_FILE up qnote-server

View File

@ -2,9 +2,9 @@
DEV_COMPOSE_FILE="docker-compose.yml" DEV_COMPOSE_FILE="docker-compose.yml"
[ "$( docker container inspect -f '{{.State.Status}}' notatest-psql )" = "running" ] || docker compose up notatest-psql -d [ "$( docker container inspect -f '{{.State.Status}}' qnote-psql )" = "running" ] || docker compose up qnote-psql -d
# Shutdown, rebuild, & restart # Shutdown, rebuild, & restart
docker compose stop notatest-server notatest-web && docker compose rm -f notatest-server notatest-web docker compose stop qnote-server qnote-web && docker compose rm -f qnote-server qnote-web
docker compose -f $DEV_COMPOSE_FILE build docker compose -f $DEV_COMPOSE_FILE build
docker compose -f $DEV_COMPOSE_FILE up notatest-server notatest-web docker compose -f $DEV_COMPOSE_FILE up qnote-server qnote-web

View File

@ -7,13 +7,13 @@ RUN go mod download
COPY . . COPY . .
# Optionally we could also strip debug symbols with `-ldflags '-s'` # Optionally we could also strip debug symbols with `-ldflags '-s'`
RUN CGO_ENABLED=0 GOOS=linux go build -o /notatest . RUN CGO_ENABLED=0 GOOS=linux go build -o /qnote .
# Final stage (optimized image size) # Final stage (optimized image size)
FROM alpine:latest FROM alpine:latest
WORKDIR /app WORKDIR /app
COPY --from=builder /notatest /app/notatest COPY --from=builder /qnote /app/qnote
EXPOSE 8080 EXPOSE 8080
CMD ["/app/notatest"] CMD ["/app/qnote"]

View File

@ -1,4 +1,4 @@
module git.umbrella.haus/ae/notatest module git.umbrella.haus/ae/qnote
go 1.24.1 go 1.24.1

View File

@ -12,7 +12,7 @@ import (
"strings" "strings"
"time" "time"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
"github.com/google/uuid" "github.com/google/uuid"
@ -26,8 +26,8 @@ const (
accessTokenDuration = 15 * time.Minute accessTokenDuration = 15 * time.Minute
refreshTokenDuration = 7 * 24 * time.Hour refreshTokenDuration = 7 * 24 * time.Hour
authCookieName = "notatest.refresh_token" authCookieName = "qnote.refresh_token"
viewCookieName = "notatest.expires_at" viewCookieName = "qnote.expires_at"
authCookiePath = "/api/auth/cookie" authCookiePath = "/api/auth/cookie"
viewCookiePath = "/" viewCookiePath = "/"
) )
@ -694,7 +694,7 @@ func getTokenFromHeader(r *http.Request) (string, error) {
// Parse the JWT token from the request's cookies (httpOnly cookie). // Parse the JWT token from the request's cookies (httpOnly cookie).
func getTokenFromCookie(r *http.Request) (string, error) { func getTokenFromCookie(r *http.Request) (string, error) {
cookie, err := r.Cookie("notatest.refresh_token") cookie, err := r.Cookie("qnote.refresh_token")
if err != nil { if err != nil {
return "", err return "", err
} }

View File

@ -5,7 +5,7 @@ import (
"net/http" "net/http"
"time" "time"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware" "github.com/go-chi/chi/v5/middleware"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"

View File

@ -9,7 +9,7 @@ import (
"testing" "testing"
"time" "time"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
"github.com/google/uuid" "github.com/google/uuid"
@ -110,7 +110,7 @@ func TestRequireRTMiddleware(t *testing.T) {
req := httptest.NewRequest("GET", "/", nil) req := httptest.NewRequest("GET", "/", nil)
if tc.token != "" { if tc.token != "" {
req.AddCookie(&http.Cookie{ req.AddCookie(&http.Cookie{
Name: "notatest.refresh_token", Name: "qnote.refresh_token",
Value: tc.token, Value: tc.token,
HttpOnly: true, HttpOnly: true,
}) })

View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -3,7 +3,7 @@ package service
import ( import (
"net/http" "net/http"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware" "github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/cors" "github.com/go-chi/cors"

View File

@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"os" "os"
"git.umbrella.haus/ae/notatest/internal/data" "git.umbrella.haus/ae/qnote/internal/data"
"git.umbrella.haus/ae/notatest/internal/service" "git.umbrella.haus/ae/qnote/internal/service"
"github.com/caarlos0/env/v10" "github.com/caarlos0/env/v10"
"github.com/golang-migrate/migrate/v4" "github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/postgres" _ "github.com/golang-migrate/migrate/v4/database/postgres"

View File

@ -26,7 +26,7 @@ server {
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml; gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
location /api { location /api {
proxy_pass http://notatest-server:8080; # Internal Docker DNS proxy_pass http://qnote-server:8080; # Internal Docker DNS
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

4
web/package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "sveltetest", "name": "qnote",
"version": "0.0.1", "version": "0.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "sveltetest", "name": "qnote",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"marked": "^15.0.7" "marked": "^15.0.7"

View File

@ -1,5 +1,5 @@
{ {
"name": "sveltetest", "name": "qnote",
"private": true, "private": true,
"version": "0.0.1", "version": "0.0.1",
"type": "module", "type": "module",

View File

@ -2,7 +2,11 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" type="image/png" href="%sveltekit.assets%/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/favicon.svg" />
<link rel="shortcut icon" href="%sveltekit.assets%/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="%sveltekit.assets%/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="qNote" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head% %sveltekit.head%
<script> <script>

View File

@ -118,7 +118,7 @@ class ApiClient {
constructor(baseUrl: string) { constructor(baseUrl: string) {
this.baseUrl = baseUrl this.baseUrl = baseUrl
this.viewCookieName = "notatest.expires_at" this.viewCookieName = "qnote.expires_at"
} }
private async handleRequest<T>( private async handleRequest<T>(

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

9
web/static/favicon.svg Normal file
View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="1365.3333" height="1365.3333"><svg version="1.1" id="SvgjsSvg1423" width="1365.3333" height="1365.3333" viewBox="0 0 1365.3333 1365.3333" sodipodi:docname="qnote-logo.svg" inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<defs id="SvgjsDefs1422"></defs>
<sodipodi:namedview id="SvgjsSodipodi:namedview1421" pagecolor="#ffffff" bordercolor="#000000" borderopacity="0.25" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" showgrid="false" inkscape:zoom="0.18804933" inkscape:cx="1659.1391" inkscape:cy="146.23823" inkscape:window-width="1720" inkscape:window-height="1372" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="0" inkscape:current-layer="g54"></sodipodi:namedview>
<g inkscape:groupmode="layer" inkscape:label="Image" id="SvgjsG1420">
<path style="fill:#4b66c4;stroke-width:2.30942" d="m 157.66009,1362.0616 c -9.00526,-1.7947 -21.9442,-5.3029 -28.7532,-7.7961 C 81.488681,1336.9029 30.975204,1290.9704 14.607804,1250.3322 1.9625423,1218.9354 2.6050325,1251.3729 3.2820266,678.535 L 3.9101942,147.00951 12.423657,124.52781 C 23.821731,94.428583 39.923559,70.940269 64.423873,48.673204 87.680215,27.536722 114.52816,13.299176 145.30637,5.780968 l 19.14252,-4.6759336 484.01218,0.080132 C 963.83092,1.2372526 1137.713,2.0519805 1147.5119,3.5232753 1213.916,13.49373 1270.7568,59.035973 1293.2583,120.29883 l 6.5406,17.80717 1.3987,104.50803 c 0.7693,57.47943 1.3424,276.34061 1.2736,486.35821 -0.115,348.99026 -0.4709,383.26876 -4.1421,398.33486 -4.8861,20.0508 -14.0783,38.7483 -30.2552,61.5409 -15.1617,21.3626 -15.7156,27.8021 -3.5609,41.4057 4.7524,5.3188 27.1808,28.2012 49.8406,50.8496 22.66,22.6485 43.0322,43.6557 45.2716,46.6827 9.8894,13.3674 0.8361,30.368 -18.8801,35.4532 -6.6632,1.7187 -177.6829,2.3742 -588.05369,2.2544 -498.85214,-0.1453 -580.91626,-0.619 -595.03132,-3.432 z m 890.35071,-130.7331 c 10.6139,-4.8021 5.2816,-11.316 -53.18795,-64.9742 -31.55959,-28.9627 -60.88167,-55.0587 -65.16022,-57.9911 l -7.77916,-5.3316 H 661.50115 c -163.16571,0 -265.20117,-0.8301 -273.28891,-2.2232 -34.45158,-5.9344 -74.18219,-34.3674 -90.20331,-64.5537 -15.8359,-29.837 -14.9531,-8.5276 -14.9531,-360.95308 0,-220.83193 0.80363,-323.60596 2.59406,-331.74727 8.9998,-40.92302 47.64272,-81.4288 89.98987,-94.328 13.50389,-4.11336 24.06027,-4.27743 275.2174,-4.27743 h 261.17489 l 17.55762,5.3429 c 42.8944,13.05313 76.54323,46.15349 87.66903,86.24011 3.3776,12.16948 3.796,48.80449 3.796,332.43502 0,280.36655 0.4378,319.60314 3.6349,325.77248 1.9993,3.8577 28.6858,30.83587 59.3035,59.95137 60.4447,57.4794 63.0963,59.1732 73.4653,46.9276 l 4.966,-5.8648 -0.023,-456.56486 -0.023,-456.56491 -5.8159,-11.60429 c -7.983,-15.92838 -23.9372,-30.17901 -40.0608,-35.78306 -13.0377,-4.53156 -16.2897,-4.56866 -464.62005,-5.29881 l -451.48937,-0.73533 -11.9805,5.1292 c -16.4189,7.0294 -33.74842,24.61445 -38.30576,38.87059 -3.15082,9.85625 -3.61105,73.23301 -3.70821,510.63997 -0.10783,485.0011 0.0192,499.6586 4.41748,508.8144 5.28277,10.998 24.70505,28.5752 37.94785,34.3428 8.612,3.7509 23.25458,4.102 217.69373,5.22 304.85528,1.7527 636.73143,1.292 641.55573,-0.8908 z m -172.56463,-265.78842 7.83268,-7.27684 V 675.95449 c 0,-298.87943 0.3457,-289.36633 -10.74931,-295.80309 -3.30655,-1.91828 -58.90921,-2.63787 -213.70708,-2.7657 -115.08074,-0.095 -212.82495,-0.13305 -217.20932,-0.0843 -5.53343,0.0614 -10.11389,2.07846 -14.97562,6.59486 l -7.00399,6.50643 v 285.19218 285.1922 l 6.18829,5.32762 c 3.40359,2.93034 8.52526,5.76151 11.38149,6.29172 2.85624,0.53004 100.86698,0.83938 217.80166,0.68713 l 212.60849,-0.27662 z" id="SvgjsPath1419"></path>
</g>
</svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
@media (prefers-color-scheme: dark) { :root { filter: none; } }
</style></svg>

After

Width:  |  Height:  |  Size: 4.1 KiB