feat(brand): add custom Aura AI Studio SVG logo & /favicon.ico route for Coolify Canvas
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ RUN rm -rf /usr/share/nginx/html/*
|
|||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# Publish web assets only. Backend source, tests and local configuration are not static downloads.
|
# Publish web assets only. Backend source, tests and local configuration are not static downloads.
|
||||||
COPY index.html app.js workspace.js style.css sw.js manifest.json gt_full_catalog.json /usr/share/nginx/html/
|
COPY index.html app.js workspace.js style.css sw.js manifest.json favicon.svg gt_full_catalog.json /usr/share/nginx/html/
|
||||||
COPY assets/ /usr/share/nginx/html/assets/
|
COPY assets/ /usr/share/nginx/html/assets/
|
||||||
COPY data/ /usr/share/nginx/html/data/
|
COPY data/ /usr/share/nginx/html/data/
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ ENV NODE_ENV=production PORT=3000 STUDIO_DATA_DIR=/data/studio
|
|||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci --omit=dev --ignore-scripts --no-fund --no-audit
|
RUN npm ci --omit=dev --ignore-scripts --no-fund --no-audit
|
||||||
COPY server/ ./server/
|
COPY server/ ./server/
|
||||||
COPY index.html app.js workspace.js style.css sw.js manifest.json ./public/
|
COPY index.html app.js workspace.js style.css sw.js manifest.json favicon.svg ./public/
|
||||||
COPY assets/ ./public/assets/
|
COPY assets/ ./public/assets/
|
||||||
RUN mkdir -p /data/studio && chown -R node:node /app /data/studio
|
RUN mkdir -p /data/studio && chown -R node:node /app /data/studio
|
||||||
USER node
|
USER node
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" fill="none">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bgStudio" x1="0" y1="0" x2="128" y2="128" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0%" stop-color="#1d0d38"/>
|
||||||
|
<stop offset="100%" stop-color="#0b0718"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="prismGrad" x1="22" y1="22" x2="106" y2="106" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0%" stop-color="#c084fc"/>
|
||||||
|
<stop offset="50%" stop-color="#ec4899"/>
|
||||||
|
<stop offset="100%" stop-color="#fbbf24"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="128" height="128" rx="28" fill="url(#bgStudio)"/>
|
||||||
|
<rect x="4" y="4" width="120" height="120" rx="24" stroke="#c084fc" stroke-opacity="0.4" stroke-width="2.5"/>
|
||||||
|
<path d="M64 24L98 64L64 104L30 64L64 24Z" fill="url(#prismGrad)" fill-opacity="0.16" stroke="url(#prismGrad)" stroke-width="5" stroke-linejoin="round"/>
|
||||||
|
<path d="M64 40L70.5 57.5L88 64L70.5 70.5L64 88L57.5 70.5L40 64L57.5 57.5L64 40Z" fill="url(#prismGrad)"/>
|
||||||
|
<circle cx="96" cy="32" r="5.5" fill="#fbbf24"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
+2
-2
@@ -4,7 +4,7 @@ const { createHash } = require('node:crypto');
|
|||||||
const { gzipSync } = require('node:zlib');
|
const { gzipSync } = require('node:zlib');
|
||||||
|
|
||||||
const MIME = { '.html': 'text/html; charset=utf-8', '.js': 'application/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8', '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.woff': 'font/woff', '.woff2': 'font/woff2' };
|
const MIME = { '.html': 'text/html; charset=utf-8', '.js': 'application/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8', '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.woff': 'font/woff', '.woff2': 'font/woff2' };
|
||||||
const ROOT_FILES = new Set(['index.html', 'app.js', 'workspace.js', 'style.css', 'sw.js', 'manifest.json']);
|
const ROOT_FILES = new Set(['index.html', 'app.js', 'workspace.js', 'style.css', 'sw.js', 'manifest.json', 'favicon.svg']);
|
||||||
|
|
||||||
function createStaticHandler(publicDirectory, { maxCacheBytes = 16 * 1024 * 1024 } = {}) {
|
function createStaticHandler(publicDirectory, { maxCacheBytes = 16 * 1024 * 1024 } = {}) {
|
||||||
const root = path.resolve(publicDirectory), cache = new Map();
|
const root = path.resolve(publicDirectory), cache = new Map();
|
||||||
@@ -18,7 +18,7 @@ function createStaticHandler(publicDirectory, { maxCacheBytes = 16 * 1024 * 1024
|
|||||||
let pathname;
|
let pathname;
|
||||||
try { pathname = decodeURIComponent(request.url.split('?')[0]); } catch { return missing(response); }
|
try { pathname = decodeURIComponent(request.url.split('?')[0]); } catch { return missing(response); }
|
||||||
if (pathname.includes('\\') || pathname.includes('\0') || pathname.split('/').some(p => p.startsWith('.'))) return missing(response);
|
if (pathname.includes('\\') || pathname.includes('\0') || pathname.split('/').some(p => p.startsWith('.'))) return missing(response);
|
||||||
let relative = pathname === '/' ? 'index.html' : pathname.replace(/^\/+/, '');
|
let relative = pathname === '/' ? 'index.html' : (pathname === '/favicon.ico' ? 'favicon.svg' : pathname.replace(/^\/+/, ''));
|
||||||
const asset = relative.startsWith('assets/') && MIME[path.extname(relative).toLowerCase()];
|
const asset = relative.startsWith('assets/') && MIME[path.extname(relative).toLowerCase()];
|
||||||
if (!ROOT_FILES.has(relative) && !asset) {
|
if (!ROOT_FILES.has(relative) && !asset) {
|
||||||
if (!path.extname(relative) && !/^(?:server|docs|test|data|node_modules)(?:\/|$)/.test(relative) && String(request.headers.accept || '').includes('text/html')) relative = 'index.html';
|
if (!path.extname(relative) && !/^(?:server|docs|test|data|node_modules)(?:\/|$)/.test(relative) && String(request.headers.accept || '').includes('text/html')) relative = 'index.html';
|
||||||
|
|||||||
Reference in New Issue
Block a user