diff --git a/.env b/.env index e0b336d..5a0f453 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ PUBLIC_GITEA_BASE=https://gitea.archicratie.trans-hands.synology.me -PUBLIC_GITEA_OWNER=archicratia -PUBLIC_GITEA_REPO=archicratie-web +PUBLIC_GITEA_OWNER=Archicratia +PUBLIC_GITEA_REPO=archicratie-edition diff --git a/.gitignore b/.gitignore index 4d59341..926b6d0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ dist/ /_release_out/ .DS_Store ._* + +# local backups +Dockerfile.bak.* +public/favicon_io.zip diff --git a/Dockerfile b/Dockerfile index 2c47e20..54e94d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ENV npm_config_update_notifier=false \ npm_config_progress=false # (Optionnel mais propre) git + certificats -RUN --network=host apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update \ +RUN apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update \ && apt-get install -y --no-install-recommends ca-certificates git \ && rm -rf /var/lib/apt/lists/* @@ -36,4 +36,6 @@ RUN npm run build FROM nginx:1.27-alpine AS runtime COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist/ /usr/share/nginx/html/ +RUN find /usr/share/nginx/html -type d -exec chmod 755 {} \; \ + && find /usr/share/nginx/html -type f -exec chmod 644 {} \; EXPOSE 80 diff --git a/nginx.conf b/nginx.conf index e1e2df1..d857cd7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,6 +9,18 @@ server { add_header X-Frame-Options SAMEORIGIN always; add_header Referrer-Policy strict-origin-when-cross-origin always; + location = /favicon.ico { + try_files /favicon.ico =404; + access_log off; + log_not_found off; + } + + location = /favicon.svg { + try_files /favicon.svg =404; + access_log off; + log_not_found off; + } + # Assets statiques (cache long) location ~* \.(?:css|js|mjs|json|png|jpg|jpeg|gif|svg|webp|ico|woff2?|ttf|eot|wasm)$ { try_files $uri =404; diff --git a/public/about.txt b/public/about.txt new file mode 100755 index 0000000..f90ec40 --- /dev/null +++ b/public/about.txt @@ -0,0 +1,6 @@ +This favicon was generated using the following font: + +- Font Title: Leckerli One +- Font Author: undefined +- Font Source: https://fonts.gstatic.com/s/leckerlione/v21/V8mCoQH8VCsNttEnxnGQ-1itLZxcBtItFw.ttf +- Font License: undefined) diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100755 index 0000000..c3fec1b Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100755 index 0000000..e624401 Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100755 index 0000000..cc62da3 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100755 index 0000000..d4431cb Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100755 index 0000000..ac4cc48 Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100755 index 0000000..8e9167e Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100755 index 0000000..45dc8a2 --- /dev/null +++ b/public/site.webmanifest @@ -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"} \ No newline at end of file diff --git a/src/components/ProposeModal.astro b/src/components/ProposeModal.astro index 3a3d2c9..0bbbef0 100644 --- a/src/components/ProposeModal.astro +++ b/src/components/ProposeModal.astro @@ -160,15 +160,8 @@ } }; - // ✅ Ouvre EN NOUVEL ONGLET sans jamais remplacer l’onglet courant + // ✅ Ouvre EN NOUVEL ONGLET : stratégie unique (anchor click) => jamais 2 onglets const openInNewTab = (url) => { - // 1) tente window.open - try { - const w = window.open(url, "_blank", "noopener,noreferrer"); - if (w) return true; - } catch {} - - // 2) fallback "anchor click" (souvent mieux toléré) try { const a = document.createElement("a"); a.href = url; @@ -181,7 +174,7 @@ return true; } catch {} - // 3) dernier recours: on ne quitte PAS la page + // dernier recours window.prompt("Popup bloquée. Copiez ce lien pour ouvrir le ticket :", url); return false; }; @@ -200,7 +193,7 @@ if (!a) return; e.preventDefault(); - e.stopPropagation(); + e.stopImmediatePropagation(); const rawUrl = a.dataset.url || a.getAttribute("href") || ""; if (!rawUrl || rawUrl === "#") return; @@ -210,10 +203,8 @@ try { const u = new URL(rawUrl); - // Option B.1 : copie presse-papier du texte complet (si dispo) if (full) { try { await navigator.clipboard.writeText(full); } catch {} - // Option B.2 : upgrade du body (si l'URL reste raisonnable) tryUpgradeBodyWithFull(u, full); } @@ -221,7 +212,7 @@ } catch { openInNewTab(rawUrl); } - }); + }, { capture: true }); // Step 1: type dlg.addEventListener("click", (e) => { diff --git a/src/layouts/EditionLayout.astro b/src/layouts/EditionLayout.astro index 7d97cb8..4001165 100644 --- a/src/layouts/EditionLayout.astro +++ b/src/layouts/EditionLayout.astro @@ -497,27 +497,17 @@ const GITEA_REPO = import.meta.env.PUBLIC_GITEA_REPO ?? ""; const excerpt = raw.length > 420 ? (raw.slice(0, 420) + "…") : raw; const issueUrl = buildIssueURL(p.id, raw, excerpt); + + // Lien fallback (si JS casse totalement) propose.href = issueUrl; - // 🔥 indispensables pour réactiver ProposeModal (les 2 filtres) + // ✅ Marqueurs pour ProposeModal (interception 2 étapes) propose.dataset.propose = "1"; propose.dataset.url = issueUrl; - - // optionnel mais top : permet à ProposeModal de copier le texte complet propose.dataset.full = raw; - // ✅ CRUCIAL : permet à ProposeModal d’intercepter le clic (2 étapes) - propose.setAttribute("data-propose", "1"); - propose.setAttribute("data-url", issueUrl); - - // ✅ Bonus : ProposeModal peut copier/upgrade avec le texte complet si dispo - // (tu peux commenter si tu veux éviter de stocker le texte en attribut) - propose.setAttribute("data-full", raw); - - // ✅ Fallback si JS casse : on ouvre quand même le lien (idéalement en nouvel onglet) - propose.href = issueUrl; - propose.target = "_blank"; - propose.rel = "noopener noreferrer"; + // ❌ PAS de target=_blank ici + // ❌ PAS de rel noopener ici row.appendChild(propose); }