initial commit
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
||||
|
||||
# Upstream servers
|
||||
upstream api {
|
||||
server 127.0.0.1:3000;
|
||||
}
|
||||
|
||||
upstream webdav {
|
||||
server 127.0.0.1:8080;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
# Welcome page at root
|
||||
location = / {
|
||||
root /app/welcome;
|
||||
try_files /welcome.html =404;
|
||||
}
|
||||
|
||||
# Redirect /stats to /stats/
|
||||
location = /stats {
|
||||
return 301 /stats/;
|
||||
}
|
||||
|
||||
# VFS Statistics dashboard (React SPA)
|
||||
location /stats/ {
|
||||
alias /app/ui/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /stats/index.html;
|
||||
}
|
||||
|
||||
# Static assets for stats dashboard
|
||||
location /assets/ {
|
||||
alias /app/ui/assets/;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# API routes
|
||||
location /api/ {
|
||||
proxy_pass http://api;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Health check (direct to API)
|
||||
location /health {
|
||||
proxy_pass http://api/health;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# WebDAV endpoint
|
||||
location /webdav {
|
||||
proxy_pass http://webdav/webdav;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Destination $http_destination;
|
||||
proxy_set_header Depth $http_depth;
|
||||
proxy_buffering off;
|
||||
client_max_body_size 0;
|
||||
|
||||
# WebDAV methods
|
||||
dav_methods PUT DELETE MKCOL COPY MOVE;
|
||||
|
||||
# Timeouts for large file operations
|
||||
proxy_connect_timeout 300;
|
||||
proxy_send_timeout 300;
|
||||
proxy_read_timeout 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# Wait for meta-fuse API to be ready before starting fuse-driver
|
||||
|
||||
API_URL="http://127.0.0.1:3000/api/fuse/health"
|
||||
MAX_WAIT=60
|
||||
WAIT_INTERVAL=2
|
||||
|
||||
echo "[start-fuse-driver] Waiting for meta-fuse API at $API_URL..."
|
||||
|
||||
waited=0
|
||||
while [ $waited -lt $MAX_WAIT ]; do
|
||||
if curl -sf "$API_URL" > /dev/null 2>&1; then
|
||||
echo "[start-fuse-driver] API is ready after ${waited}s"
|
||||
break
|
||||
fi
|
||||
sleep $WAIT_INTERVAL
|
||||
waited=$((waited + WAIT_INTERVAL))
|
||||
echo "[start-fuse-driver] Waiting... (${waited}s/${MAX_WAIT}s)"
|
||||
done
|
||||
|
||||
if [ $waited -ge $MAX_WAIT ]; then
|
||||
echo "[start-fuse-driver] ERROR: API not ready after ${MAX_WAIT}s, starting anyway..."
|
||||
fi
|
||||
|
||||
echo "[start-fuse-driver] Starting meta-fuse-driver..."
|
||||
exec /app/fuse-driver/meta-fuse-driver /mnt/virtual http://127.0.0.1:3000
|
||||
@@ -0,0 +1,75 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
loglevel=info
|
||||
|
||||
[program:meta-core]
|
||||
command=/usr/local/bin/meta-core
|
||||
priority=5
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
startsecs=3
|
||||
environment=
|
||||
META_CORE_PATH="/meta-core",
|
||||
FILES_PATH="/files",
|
||||
SERVICE_NAME="meta-fuse",
|
||||
SERVICE_VERSION="1.0.0",
|
||||
META_CORE_HTTP_PORT="9000",
|
||||
LEADER_ELECTION_ENABLED="false"
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g "daemon off;"
|
||||
priority=20
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/nginx.log
|
||||
stderr_logfile=/var/log/supervisor/nginx_error.log
|
||||
startsecs=2
|
||||
|
||||
[program:meta-fuse]
|
||||
command=/usr/bin/node /app/backend/dist/index.js
|
||||
directory=/app/backend
|
||||
priority=30
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
startsecs=5
|
||||
environment=
|
||||
NODE_ENV="production",
|
||||
REDIS_PREFIX="",
|
||||
API_HOST="0.0.0.0",
|
||||
API_PORT="3000"
|
||||
|
||||
[program:fuse-driver]
|
||||
command=/app/docker/start-fuse-driver.sh
|
||||
priority=40
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/fuse-driver.log
|
||||
stderr_logfile=/var/log/supervisor/fuse-driver_error.log
|
||||
startsecs=10
|
||||
startretries=3
|
||||
environment=
|
||||
RUST_LOG="info",
|
||||
PUID="1000",
|
||||
PGID="1000",
|
||||
FUSE_FILE_PERM="755",
|
||||
FUSE_DIR_PERM="755"
|
||||
|
||||
[program:wsgidav]
|
||||
command=/usr/local/bin/wsgidav --config /app/docker/wsgidav.yaml
|
||||
priority=50
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/wsgidav.log
|
||||
stderr_logfile=/var/log/supervisor/wsgidav_error.log
|
||||
startsecs=5
|
||||
@@ -0,0 +1,518 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>meta-fuse - Virtual Filesystem</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
color: #e0e0e0;
|
||||
min-height: 100vh;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3em;
|
||||
background: linear-gradient(135deg, #4ecdc4, #44a08d);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #a0a0a0;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
margin-top: 20px;
|
||||
padding: 12px 24px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 30px;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.status-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: #4ecdc4;
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #ff6b6b;
|
||||
animation: none;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
.description {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 16px;
|
||||
padding: 30px;
|
||||
margin-bottom: 40px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.description h2 {
|
||||
color: #4ecdc4;
|
||||
margin-bottom: 16px;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.description p {
|
||||
line-height: 1.8;
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.description ul {
|
||||
margin: 16px 0 0 24px;
|
||||
line-height: 2;
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.services {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 24px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.service-card {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16px;
|
||||
padding: 28px;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.service-card:hover {
|
||||
transform: translateY(-4px);
|
||||
border-color: #4ecdc4;
|
||||
box-shadow: 0 8px 30px rgba(78, 205, 196, 0.2);
|
||||
}
|
||||
|
||||
.service-card .icon {
|
||||
font-size: 2.5em;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.service-card h3 {
|
||||
color: #fff;
|
||||
font-size: 1.3em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.service-card p {
|
||||
color: #a0a0a0;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.service-url {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 0.9em;
|
||||
color: #4ecdc4;
|
||||
background: rgba(78, 205, 196, 0.1);
|
||||
padding: 6px 12px;
|
||||
border-radius: 6px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Collapsible Setup Section */
|
||||
.setup-section {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.setup-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
padding: 18px 24px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 12px;
|
||||
transition: all 0.3s ease;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.setup-header:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: rgba(78, 205, 196, 0.3);
|
||||
}
|
||||
|
||||
.setup-header h3 {
|
||||
color: #a0a0a0;
|
||||
font-size: 1.1em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
font-size: 1.2em;
|
||||
color: #606060;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.toggle-icon.open {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.setup-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease;
|
||||
}
|
||||
|
||||
.setup-content.open {
|
||||
max-height: 2000px;
|
||||
}
|
||||
|
||||
.setup-inner {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.info-section h4 {
|
||||
color: #4ecdc4;
|
||||
margin-bottom: 12px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.info-section p {
|
||||
color: #808080;
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 16px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.command {
|
||||
background: #0d1117;
|
||||
border-radius: 8px;
|
||||
padding: 14px 18px;
|
||||
margin-bottom: 10px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 0.9em;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.command:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.command strong {
|
||||
color: #4ecdc4;
|
||||
display: inline-block;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.command code {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
padding-top: 30px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
color: #606060;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* Services Navigation */
|
||||
.services-nav {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 12px;
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.services-nav-label {
|
||||
color: #888;
|
||||
font-size: 0.85rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.services-nav-items {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.service-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
color: #e8e8e8;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.service-link:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgba(78, 205, 196, 0.5);
|
||||
}
|
||||
.service-link.active {
|
||||
background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(68, 160, 141, 0.3));
|
||||
border-color: rgba(78, 205, 196, 0.5);
|
||||
}
|
||||
.service-link .service-icon {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.service-link .service-status {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #4ecdc4;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
.leader-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
padding: 0.4rem 0.8rem;
|
||||
background: rgba(78, 205, 196, 0.15);
|
||||
border: 1px solid rgba(78, 205, 196, 0.3);
|
||||
border-radius: 16px;
|
||||
font-size: 0.75rem;
|
||||
color: #4ecdc4;
|
||||
margin-left: auto;
|
||||
}
|
||||
.leader-badge-icon {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function toggleSetup() {
|
||||
const content = document.getElementById('setupContent');
|
||||
const icon = document.getElementById('toggleIcon');
|
||||
content.classList.toggle('open');
|
||||
icon.classList.toggle('open');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<!-- Services Navigation -->
|
||||
<nav class="services-nav" id="servicesNav" style="display: none;">
|
||||
<span class="services-nav-label">Services:</span>
|
||||
<div class="services-nav-items" id="servicesNavItems">
|
||||
<!-- Populated by JavaScript -->
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header>
|
||||
<h1>meta-fuse</h1>
|
||||
<p class="subtitle">Virtual Filesystem Service</p>
|
||||
<div class="status-bar">
|
||||
<div class="status-item">
|
||||
<div class="status-dot" id="statusDot"></div>
|
||||
<span id="statusText">Checking...</span>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="description">
|
||||
<h2>What is meta-fuse?</h2>
|
||||
<p>
|
||||
<strong>meta-fuse</strong> is a virtual filesystem that presents your media files
|
||||
in an organized structure based on metadata. It reads file information from the
|
||||
KV leader (via Redis) and creates a virtual view of your library without duplicating any files.
|
||||
</p>
|
||||
<ul>
|
||||
<li>Access files organized by title, year, series, etc.</li>
|
||||
<li>Mount via FUSE (native) or WebDAV (network drive)</li>
|
||||
<li>No file duplication - virtual paths point to real files</li>
|
||||
<li>Automatically updates when new files are processed</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<a href="/webdav" class="service-card">
|
||||
<div class="icon">📁</div>
|
||||
<h3>WebDAV Files</h3>
|
||||
<p>Browse and access your organized media library. Mount as a network drive on any device.</p>
|
||||
<span class="service-url">/webdav</span>
|
||||
</a>
|
||||
|
||||
<a href="/stats/" class="service-card">
|
||||
<div class="icon">📊</div>
|
||||
<h3>VFS Statistics</h3>
|
||||
<p>View file counts, directory structure, connection status, and refresh metadata.</p>
|
||||
<span class="service-url">/stats</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="setup-section">
|
||||
<div class="setup-header" onclick="toggleSetup()">
|
||||
<h3>⚙️ Setup & Configuration</h3>
|
||||
<span class="toggle-icon" id="toggleIcon">▼</span>
|
||||
</div>
|
||||
<div class="setup-content" id="setupContent">
|
||||
<div class="setup-inner">
|
||||
<div class="info-section">
|
||||
<h4>🗂️ FUSE Mount (Docker)</h4>
|
||||
<p>Mount the virtual filesystem directly from the container. Add this volume to your docker-compose.yml to access the organized files on your host:</p>
|
||||
<div class="command">
|
||||
<code>volumes:<br> - /path/on/host:/mnt/virtual:rw,shared</code>
|
||||
</div>
|
||||
<p style="margin-top: 12px; margin-bottom: 0;">The virtual filesystem is available inside the container at <code style="background: #0d1117; padding: 2px 6px; border-radius: 4px;">/mnt/virtual</code></p>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>🌐 WebDAV Network Drive</h4>
|
||||
<p>Mount the virtual filesystem as a network drive on any device:</p>
|
||||
<div class="command">
|
||||
<strong>Windows:</strong>
|
||||
<code>net use Z: http://<host>/webdav</code>
|
||||
</div>
|
||||
<div class="command">
|
||||
<strong>macOS:</strong>
|
||||
<code>Finder → Go → Connect to Server → http://<host>/webdav</code>
|
||||
</div>
|
||||
<div class="command">
|
||||
<strong>Linux:</strong>
|
||||
<code>sudo mount -t davfs http://<host>/webdav /mnt/vfs</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>Part of the <strong>MetaMesh</strong> project</p>
|
||||
<p>Discovers KV leader via shared volume and connects to Redis automatically</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function checkStatus() {
|
||||
const dot = document.getElementById('statusDot');
|
||||
const text = document.getElementById('statusText');
|
||||
|
||||
try {
|
||||
const res = await fetch('/health');
|
||||
const data = await res.json();
|
||||
|
||||
if (data.status === 'ok') {
|
||||
dot.classList.remove('disconnected');
|
||||
text.textContent = 'Connected to Redis';
|
||||
} else {
|
||||
dot.classList.add('disconnected');
|
||||
text.textContent = 'Disconnected';
|
||||
}
|
||||
} catch (e) {
|
||||
dot.classList.add('disconnected');
|
||||
text.textContent = 'Service unavailable';
|
||||
}
|
||||
}
|
||||
|
||||
// Service icons mapping
|
||||
const serviceIcons = {
|
||||
'meta-sort': '📁',
|
||||
'meta-fuse': '🗂️',
|
||||
'meta-stremio': '🎬',
|
||||
'meta-orbit': '🌐',
|
||||
'default': '📦'
|
||||
};
|
||||
|
||||
function formatServiceName(name) {
|
||||
return name.split('-').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ');
|
||||
}
|
||||
|
||||
async function fetchServices() {
|
||||
try {
|
||||
const res = await fetch('/api/services');
|
||||
const data = await res.json();
|
||||
|
||||
const navEl = document.getElementById('servicesNav');
|
||||
const itemsEl = document.getElementById('servicesNavItems');
|
||||
const leaderBadge = document.getElementById('leaderBadge');
|
||||
const leaderBadgeText = document.getElementById('leaderBadgeText');
|
||||
|
||||
if (data.services && data.services.length > 0) {
|
||||
const services = data.services.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
itemsEl.innerHTML = services.map(svc => {
|
||||
const icon = serviceIcons[svc.name] || serviceIcons.default;
|
||||
const isActive = svc.name === 'meta-fuse';
|
||||
const activeClass = isActive ? ' active' : '';
|
||||
const href = isActive ? '#' : svc.url;
|
||||
|
||||
return `
|
||||
<a href="${href}" class="service-link${activeClass}">
|
||||
<span class="service-icon">${icon}</span>
|
||||
<span>${formatServiceName(svc.name)}</span>
|
||||
<span class="service-status"></span>
|
||||
</a>
|
||||
`;
|
||||
}).join('');
|
||||
|
||||
navEl.style.display = 'flex';
|
||||
} else {
|
||||
navEl.style.display = 'none';
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch services:', e);
|
||||
document.getElementById('servicesNav').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
checkStatus();
|
||||
fetchServices();
|
||||
setInterval(checkStatus, 5000);
|
||||
setInterval(fetchServices, 30000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
# WsgiDAV Configuration for meta-fuse Virtual Filesystem
|
||||
|
||||
host: 0.0.0.0
|
||||
port: 8080
|
||||
|
||||
# Simple user authentication
|
||||
simple_dc:
|
||||
user_mapping:
|
||||
"/":
|
||||
metamesh:
|
||||
password: metamesh
|
||||
roles: ["editor"]
|
||||
"/webdav":
|
||||
metamesh:
|
||||
password: metamesh
|
||||
roles: ["editor"]
|
||||
|
||||
# Mount the virtual filesystem
|
||||
provider_mapping:
|
||||
"/webdav":
|
||||
root: /mnt/virtual
|
||||
readonly: true
|
||||
|
||||
# Logging
|
||||
verbose: 1
|
||||
logging:
|
||||
enable_loggers: []
|
||||
|
||||
# Server configuration
|
||||
server: cheroot
|
||||
server_args:
|
||||
numthreads: 10
|
||||
|
||||
# Authentication settings
|
||||
accept_basic: true
|
||||
accept_digest: false
|
||||
default_to_digest: false
|
||||
|
||||
# HTTP configuration
|
||||
add_header_MS_Author_Via: false
|
||||
|
||||
# Hotfixes for path encoding
|
||||
hotfixes:
|
||||
unquote_path_info: false
|
||||
|
||||
# Directory browsing
|
||||
dir_browser:
|
||||
enable: true
|
||||
response_trailer: ""
|
||||
davmount: false
|
||||
ms_sharepoint_support: false
|
||||
ms_sharepoint_urls: false
|
||||
Reference in New Issue
Block a user