Introduce Daymark public edition with isolated deployment configuration

This commit is contained in:
Dario P. committed 2026-10-25 00:24:42 +02:00
commit b27435ca57
19 files changed
+22664

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="72" fill="#1a1b26"/>
<path d="M112 96h288v320H112z" fill="#24283b" stroke="#7aa2f7" stroke-width="18"/>
<path d="M164 164h184M164 224h184M164 284h128" stroke="#c0caf5" stroke-width="18" stroke-linecap="square"/>
<path d="M318 348h48" stroke="#9ece6a" stroke-width="18"/>
</svg>

After

Width:  |  Height:  |  Size: 384 B

+28
View File
@@ -0,0 +1,28 @@
{
"name": "Daymark",
"short_name": "Daymark",
"description": "Private self-hosted notes, diary entries, and media.",
"start_url": "/",
"scope": "/",
"display": "standalone",
"background_color": "#1a1b26",
"theme_color": "#1a1b26",
"icons": [
{
"src": "/field-log-icon.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any maskable"
}
],
"shortcuts": [
{ "name": "New entry", "short_name": "New", "url": "/?new=1" },
{ "name": "Gallery", "short_name": "Gallery", "url": "/?view=gallery" },
{ "name": "Map", "short_name": "Map", "url": "/?view=map" }
],
"share_target": {
"action": "/?share=1",
"method": "GET",
"params": { "title": "title", "text": "text", "url": "url" }
}
}
+39
View File
@@ -0,0 +1,39 @@
const CACHE = "field-log-shell-v1";
const SHELL = ["/", "/manifest.webmanifest", "/field-log-icon.svg"];
self.addEventListener("install", (event) => {
event.waitUntil(caches.open(CACHE).then((cache) => cache.addAll(SHELL)));
self.skipWaiting();
});
self.addEventListener("activate", (event) => {
event.waitUntil(
caches
.keys()
.then((keys) =>
Promise.all(
keys.filter((key) => key !== CACHE).map((key) => caches.delete(key)),
),
),
);
self.clients.claim();
});
self.addEventListener("fetch", (event) => {
const request = event.request;
if (
request.method !== "GET" ||
new URL(request.url).pathname.startsWith("/api/")
)
return;
event.respondWith(
fetch(request)
.then((response) => {
if (response.ok)
caches
.open(CACHE)
.then((cache) => cache.put(request, response.clone()));
return response;
})
.catch(() =>
caches.match(request).then((cached) => cached || caches.match("/")),
),
);
});