chore: snapshot current state before troubleshooting SSL/TLS issues
This commit is contained in:
1 parent
0281935169
commit
0c5a11f71f
21 files changed
+916
-29
No files matched your search
@@ -9,10 +9,14 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.excalidraw.rule=Host(`excalidraw.arch-services.mywire.org`) || Host(`excalidraw.localhost`)"
|
- "traefik.http.routers.excalidraw.rule=Host(`excalidraw.arch-services.mywire.org`)"
|
||||||
|
|
||||||
- "traefik.http.routers.excalidraw.entrypoints=websecure"
|
- "traefik.http.routers.excalidraw.entrypoints=websecure"
|
||||||
- "traefik.http.routers.excalidraw.tls.certresolver=myresolver"
|
- "traefik.http.routers.excalidraw.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.routers.excalidraw-red.rule=Host(`excalidraw.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.excalidraw-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.excalidraw-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.excalidraw-local.rule=Host(`excalidraw.localhost`)"
|
||||||
|
- "traefik.http.routers.excalidraw-local.entrypoints=web"
|
||||||
- "traefik.http.services.excalidraw.loadbalancer.server.port=80"
|
- "traefik.http.services.excalidraw.loadbalancer.server.port=80"
|
||||||
|
|
||||||
excalidraw-room:
|
excalidraw-room:
|
||||||
@@ -22,10 +26,14 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.excalidraw-room.rule=(Host(`excalidraw.arch-services.mywire.org`) || Host(`excalidraw.localhost`)) && PathPrefix(`/socket.io`)"
|
- "traefik.http.routers.excalidraw-room.rule=Host(`excalidraw.arch-services.mywire.org`) && PathPrefix(`/socket.io`)"
|
||||||
|
|
||||||
- "traefik.http.routers.excalidraw-room.entrypoints=websecure"
|
- "traefik.http.routers.excalidraw-room.entrypoints=websecure"
|
||||||
- "traefik.http.routers.excalidraw-room.tls.certresolver=myresolver"
|
- "traefik.http.routers.excalidraw-room.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.routers.excalidraw-room-red.rule=Host(`excalidraw.arch-services.mywire.org`) && PathPrefix(`/socket.io`)"
|
||||||
|
- "traefik.http.routers.excalidraw-room-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.excalidraw-room-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.excalidraw-room-local.rule=Host(`excalidraw.localhost`) && PathPrefix(`/socket.io`)"
|
||||||
|
- "traefik.http.routers.excalidraw-room-local.entrypoints=web"
|
||||||
- "traefik.http.services.excalidraw-room.loadbalancer.server.port=8080"
|
- "traefik.http.services.excalidraw-room.loadbalancer.server.port=8080"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -13,11 +13,15 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.gitea.rule=Host(`gitea.arch-services.mywire.org`) || Host(`gitea.localhost`)"
|
- "traefik.http.routers.gitea.rule=Host(`gitea.arch-services.mywire.org`)"
|
||||||
|
|
||||||
- "traefik.http.routers.gitea.entrypoints=websecure"
|
- "traefik.http.routers.gitea.entrypoints=websecure"
|
||||||
- "traefik.http.routers.gitea.tls.certresolver=myresolver"
|
- "traefik.http.routers.gitea.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.gitea.middlewares=authelia-auth@docker"
|
- "traefik.http.routers.gitea.middlewares=authelia-auth@docker"
|
||||||
|
- "traefik.http.routers.gitea-red.rule=Host(`gitea.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.gitea-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.gitea-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.gitea-local.rule=Host(`gitea.localhost`)"
|
||||||
|
- "traefik.http.routers.gitea-local.entrypoints=web"
|
||||||
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
.hp-kanban-board {
|
||||||
|
display: flex;
|
||||||
|
gap: 20px;
|
||||||
|
margin: 10px 0 30px 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-col {
|
||||||
|
flex: 1;
|
||||||
|
background: rgba(15, 23, 42, 0.4);
|
||||||
|
border: 1px solid rgba(51, 65, 85, 0.3);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 15px;
|
||||||
|
min-height: 220px;
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-col h3 {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: #94a3b8;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
font-weight: 800;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
min-height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card {
|
||||||
|
background: rgba(30, 41, 59, 0.8);
|
||||||
|
border: 1px solid rgba(51, 65, 85, 0.5);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
cursor: grab;
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card:hover {
|
||||||
|
border-color: #3b82f6;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
background: #1e293b;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card-title {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
color: #f8fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card-desc {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: #94a3b8;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card-links {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
border-top: 1px solid rgba(51, 65, 85, 0.3);
|
||||||
|
padding-top: 8px;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card-links a {
|
||||||
|
color: #60a5fa;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card-links a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hp-kanban-card.dragging {
|
||||||
|
opacity: 0.1;
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide the placeholder card that we use to spawn the section */
|
||||||
|
section h2[title="Learning Hub"] + ul,
|
||||||
|
section h2[title="Learning Hub"] + .grid {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
/**
|
||||||
|
* Learning Kanban Native Integration for Homepage
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getApiBase() {
|
||||||
|
const host = window.location.hostname;
|
||||||
|
if (host === 'localhost' || host.endsWith('.localhost')) {
|
||||||
|
return `http://learning.localhost`;
|
||||||
|
}
|
||||||
|
return `https://learning.arch-services.mywire.org`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const API_BASE = getApiBase();
|
||||||
|
|
||||||
|
async function fetchCourses() {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE}/api/courses`);
|
||||||
|
if (!response.ok) return [];
|
||||||
|
return await response.json();
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to fetch courses", e);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateCourseStatus(courseId, newStatus) {
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${API_BASE}/api/courses`);
|
||||||
|
const courses = await res.json();
|
||||||
|
const course = courses.find(c => c.id == courseId);
|
||||||
|
if (!course) return;
|
||||||
|
|
||||||
|
course.status = newStatus;
|
||||||
|
|
||||||
|
await fetch(`${API_BASE}/api/courses/${courseId}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(course)
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to update course", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createKanbanCard(course) {
|
||||||
|
return `
|
||||||
|
<div class="hp-kanban-card" draggable="true" data-id="${course.id}">
|
||||||
|
<div class="hp-kanban-card-title">${course.title}</div>
|
||||||
|
<div class="hp-kanban-card-desc">${course.description || ''}</div>
|
||||||
|
<div class="hp-kanban-card-links">
|
||||||
|
<a href="${course.main_link}" target="_blank">Hub ↗</a>
|
||||||
|
${course.last_link ? `<a href="${course.last_link}" target="_blank">Milestone ↗</a>` : ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function renderKanban() {
|
||||||
|
// Find the section by its title
|
||||||
|
const sections = document.querySelectorAll('section');
|
||||||
|
let container = null;
|
||||||
|
for (const section of sections) {
|
||||||
|
const h2 = section.querySelector('h2');
|
||||||
|
// Match the group name from services.yaml
|
||||||
|
if (h2 && h2.textContent.trim() === 'Learning Hub') {
|
||||||
|
container = section;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!container) return;
|
||||||
|
|
||||||
|
// Target the list area (usually follows the h2)
|
||||||
|
const listArea = container.querySelector('ul') || container.querySelector('.grid') || container.lastElementChild;
|
||||||
|
if (!listArea) return;
|
||||||
|
|
||||||
|
// Replace the entire list area with our board
|
||||||
|
listArea.outerHTML = `
|
||||||
|
<div class="hp-kanban-board">
|
||||||
|
<div class="hp-kanban-col" data-status="WIP">
|
||||||
|
<h3>🚀 In Progress</h3>
|
||||||
|
<div class="hp-kanban-list"></div>
|
||||||
|
</div>
|
||||||
|
<div class="hp-kanban-col" data-status="Planning">
|
||||||
|
<h3>📅 Planning</h3>
|
||||||
|
<div class="hp-kanban-list"></div>
|
||||||
|
</div>
|
||||||
|
<div class="hp-kanban-col" data-status="Archive">
|
||||||
|
<h3>📦 Archive</h3>
|
||||||
|
<div class="hp-kanban-list"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
const courses = await fetchCourses();
|
||||||
|
const board = container.querySelector('.hp-kanban-board');
|
||||||
|
|
||||||
|
courses.forEach(course => {
|
||||||
|
const col = board.querySelector(`.hp-kanban-col[data-status="${course.status}"] .hp-kanban-list`);
|
||||||
|
if (col) {
|
||||||
|
col.innerHTML += createKanbanCard(course);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add Drag & Drop Listeners
|
||||||
|
const cards = board.querySelectorAll('.hp-kanban-card');
|
||||||
|
cards.forEach(card => {
|
||||||
|
card.addEventListener('dragstart', (e) => {
|
||||||
|
e.dataTransfer.setData('text/plain', card.dataset.id);
|
||||||
|
card.classList.add('dragging');
|
||||||
|
});
|
||||||
|
card.addEventListener('dragend', () => card.classList.remove('dragging'));
|
||||||
|
});
|
||||||
|
|
||||||
|
const cols = board.querySelectorAll('.hp-kanban-col');
|
||||||
|
cols.forEach(col => {
|
||||||
|
col.addEventListener('dragover', (e) => e.preventDefault());
|
||||||
|
col.addEventListener('drop', async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const id = e.dataTransfer.getData('text/plain');
|
||||||
|
const status = col.dataset.status;
|
||||||
|
await updateCourseStatus(id, status);
|
||||||
|
renderKanban(); // Re-render
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initial detection and observer for React re-renders
|
||||||
|
let debounceTimer;
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
clearTimeout(debounceTimer);
|
||||||
|
debounceTimer = setTimeout(() => {
|
||||||
|
const target = document.querySelector('h2');
|
||||||
|
if (target && !document.querySelector('.hp-kanban-board')) {
|
||||||
|
renderKanban();
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
|
renderKanban();
|
||||||
@@ -52,3 +52,10 @@
|
|||||||
description: Diagramming Tool
|
description: Diagramming Tool
|
||||||
server: my-docker
|
server: my-docker
|
||||||
container: mermaid-live-editor
|
container: mermaid-live-editor
|
||||||
|
|
||||||
|
# # Kanban Board Anchor
|
||||||
|
# - Learning Hub:
|
||||||
|
# - Placeholder:
|
||||||
|
# icon: bookshelf.png
|
||||||
|
# href: #
|
||||||
|
# description: "This will be replaced by the Kanban board"
|
||||||
@@ -12,11 +12,25 @@ services:
|
|||||||
- socket-net
|
- socket-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.homepage.rule=Host(`arch-services.mywire.org`) || Host(`homepage.localhost`)"
|
# Public (HTTPS)
|
||||||
|
- "traefik.http.routers.homepage.rule=Host(`arch-services.mywire.org`)"
|
||||||
- "traefik.http.routers.homepage.entrypoints=websecure"
|
- "traefik.http.routers.homepage.entrypoints=websecure"
|
||||||
- "traefik.http.routers.homepage.tls.certresolver=myresolver"
|
- "traefik.http.routers.homepage.tls.certresolver=myresolver"
|
||||||
|
|
||||||
|
# Public (Redirect)
|
||||||
|
- "traefik.http.routers.homepage-red.rule=Host(`arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.homepage-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.homepage-red.middlewares=https-redirect@docker"
|
||||||
|
|
||||||
|
# Local (HTTP)
|
||||||
|
- "traefik.http.routers.homepage-local.rule=Host(`homepage.localhost`) || Host(`dashboard.localhost`) || Host(`localhost`)"
|
||||||
|
|
||||||
|
|
||||||
|
- "traefik.http.routers.homepage-local.entrypoints=web"
|
||||||
|
|
||||||
- "traefik.http.services.homepage.loadbalancer.server.port=3000"
|
- "traefik.http.services.homepage.loadbalancer.server.port=3000"
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy-net:
|
proxy-net:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
from sqlalchemy import create_engine
|
||||||
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
from sqlalchemy.orm import sessionmaker
|
||||||
|
|
||||||
|
SQLALCHEMY_DATABASE_URL = "sqlite:///./learning.db"
|
||||||
|
|
||||||
|
engine = create_engine(
|
||||||
|
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
||||||
|
)
|
||||||
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||||
|
|
||||||
|
Base = declarative_base()
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
from fastapi import FastAPI, Depends, HTTPException
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
from fastapi.responses import FileResponse
|
||||||
|
from sqlalchemy.orm import Session
|
||||||
|
from typing import List, Optional
|
||||||
|
from pydantic import BaseModel
|
||||||
|
import uvicorn
|
||||||
|
import os
|
||||||
|
|
||||||
|
from . import models, database
|
||||||
|
|
||||||
|
# Create tables
|
||||||
|
models.Base.metadata.create_all(bind=database.engine)
|
||||||
|
|
||||||
|
app = FastAPI(title="Learning Hub API")
|
||||||
|
|
||||||
|
app.add_middleware(
|
||||||
|
CORSMiddleware,
|
||||||
|
allow_origins=["*"],
|
||||||
|
allow_credentials=True,
|
||||||
|
allow_methods=["*"],
|
||||||
|
allow_headers=["*"],
|
||||||
|
)
|
||||||
|
|
||||||
|
# Dependency
|
||||||
|
def get_db():
|
||||||
|
db = database.SessionLocal()
|
||||||
|
try:
|
||||||
|
yield db
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
class CourseBase(BaseModel):
|
||||||
|
title: str
|
||||||
|
description: Optional[str] = None
|
||||||
|
main_link: str
|
||||||
|
last_link: Optional[str] = None
|
||||||
|
status: str = "Planning"
|
||||||
|
|
||||||
|
class CourseCreate(CourseBase):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Course(CourseBase):
|
||||||
|
id: int
|
||||||
|
class Config:
|
||||||
|
from_attributes = True
|
||||||
|
|
||||||
|
@app.get("/api/courses", response_model=List[Course])
|
||||||
|
def read_courses(db: Session = Depends(get_db)):
|
||||||
|
return db.query(models.Course).all()
|
||||||
|
|
||||||
|
@app.post("/api/courses", response_model=Course)
|
||||||
|
def create_course(course: CourseCreate, db: Session = Depends(get_db)):
|
||||||
|
db_course = models.Course(**course.dict())
|
||||||
|
db.add(db_course)
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_course)
|
||||||
|
return db_course
|
||||||
|
|
||||||
|
@app.put("/api/courses/{course_id}", response_model=Course)
|
||||||
|
def update_course(course_id: int, course: CourseCreate, db: Session = Depends(get_db)):
|
||||||
|
db_course = db.query(models.Course).filter(models.Course.id == course_id).first()
|
||||||
|
if not db_course:
|
||||||
|
raise HTTPException(status_code=404, detail="Course not found")
|
||||||
|
|
||||||
|
for key, value in course.dict().items():
|
||||||
|
setattr(db_course, key, value)
|
||||||
|
|
||||||
|
db.commit()
|
||||||
|
db.refresh(db_course)
|
||||||
|
return db_course
|
||||||
|
|
||||||
|
@app.delete("/api/courses/{course_id}")
|
||||||
|
def delete_course(course_id: int, db: Session = Depends(get_db)):
|
||||||
|
db_course = db.query(models.Course).filter(models.Course.id == course_id).first()
|
||||||
|
if not db_course:
|
||||||
|
raise HTTPException(status_code=404, detail="Course not found")
|
||||||
|
db.delete(db_course)
|
||||||
|
db.commit()
|
||||||
|
return {"message": "Course deleted"}
|
||||||
|
|
||||||
|
# Seed initial data if empty
|
||||||
|
@app.on_event("startup")
|
||||||
|
def startup_event():
|
||||||
|
db = database.SessionLocal()
|
||||||
|
if db.query(models.Course).count() == 0:
|
||||||
|
initial_courses = [
|
||||||
|
models.Course(
|
||||||
|
title="Desarrollo Backend con Python",
|
||||||
|
description="Platzi Learning Path",
|
||||||
|
main_link="https://platzi.com/mis-rutas/16609931/",
|
||||||
|
status="WIP"
|
||||||
|
),
|
||||||
|
models.Course(
|
||||||
|
title="Amazon Junior Software Developer",
|
||||||
|
description="Coursera Professional Certificate",
|
||||||
|
main_link="https://www.coursera.org/professional-certificates/amazon-junior-software-developer",
|
||||||
|
status="WIP"
|
||||||
|
),
|
||||||
|
models.Course(
|
||||||
|
title="Software Design and Architecture",
|
||||||
|
description="Coursera Specialization",
|
||||||
|
main_link="https://www.coursera.org/specializations/software-design-architecture",
|
||||||
|
status="WIP"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
db.add_all(initial_courses)
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
# Serves CSS/JS and index
|
||||||
|
app.mount("/", StaticFiles(directory="app/static", html=True), name="static")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
from sqlalchemy import Column, Integer, String
|
||||||
|
from .database import Base
|
||||||
|
|
||||||
|
class Course(Base):
|
||||||
|
__tablename__ = "courses"
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, index=True)
|
||||||
|
title = Column(String)
|
||||||
|
description = Column(String, nullable=True)
|
||||||
|
main_link = Column(String)
|
||||||
|
last_link = Column(String, nullable=True)
|
||||||
|
status = Column(String, default="Planning") # WIP, Planning, Archive
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Learning Kanban Board</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>🎓 Learning Hub</h1>
|
||||||
|
<button id="add-course-btn" onclick="showModal()">+ Add Course</button>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="kanban-board">
|
||||||
|
<div class="column" id="WIP" ondrop="drop(event)" ondragover="allowDrop(event)">
|
||||||
|
<h2>🚀 WIP</h2>
|
||||||
|
<div class="course-list" id="list-WIP"></div>
|
||||||
|
</div>
|
||||||
|
<div class="column" id="Planning" ondrop="drop(event)" ondragover="allowDrop(event)">
|
||||||
|
<h2>📅 Planning</h2>
|
||||||
|
<div class="course-list" id="list-Planning"></div>
|
||||||
|
</div>
|
||||||
|
<div class="column" id="Archive" ondrop="drop(event)" ondragover="allowDrop(event)">
|
||||||
|
<h2>📦 Archive</h2>
|
||||||
|
<div class="course-list" id="list-Archive"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal for adding/editing courses -->
|
||||||
|
<div id="course-modal" class="modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h2 id="modal-title">Add New Course</h2>
|
||||||
|
<form id="course-form">
|
||||||
|
<input type="hidden" id="course-id">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Title</label>
|
||||||
|
<input type="text" id="title" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Description</label>
|
||||||
|
<textarea id="description"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Main Link</label>
|
||||||
|
<input type="url" id="main_link" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Last Milestone Link</label>
|
||||||
|
<input type="url" id="last_link">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Status</label>
|
||||||
|
<select id="status">
|
||||||
|
<option value="WIP">WIP</option>
|
||||||
|
<option value="Planning">Planning</option>
|
||||||
|
<option value="Archive">Archive</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions">
|
||||||
|
<button type="button" onclick="closeModal()">Cancel</button>
|
||||||
|
<button type="submit" id="save-btn">Save</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
let courses = [];
|
||||||
|
|
||||||
|
async function fetchCourses() {
|
||||||
|
const response = await fetch('/api/courses');
|
||||||
|
courses = await response.json();
|
||||||
|
renderBoard();
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderBoard() {
|
||||||
|
const columns = ['WIP', 'Planning', 'Archive'];
|
||||||
|
columns.forEach(status => {
|
||||||
|
const list = document.getElementById(`list-${status}`);
|
||||||
|
list.innerHTML = '';
|
||||||
|
const filtered = courses.filter(c => c.status === status);
|
||||||
|
filtered.forEach(course => {
|
||||||
|
const card = createCard(course);
|
||||||
|
list.appendChild(card);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function createCard(course) {
|
||||||
|
const card = document.createElement('div');
|
||||||
|
card.className = 'course-card';
|
||||||
|
card.draggable = true;
|
||||||
|
card.id = `course-${course.id}`;
|
||||||
|
card.innerHTML = `
|
||||||
|
<div class="card-actions">
|
||||||
|
<button onclick="editCourse(${course.id})">✏️</button>
|
||||||
|
<button onclick="deleteCourse(${course.id})">🗑️</button>
|
||||||
|
</div>
|
||||||
|
<h3>${course.title}</h3>
|
||||||
|
<p>${course.description || ''}</p>
|
||||||
|
<div class="card-links">
|
||||||
|
<a href="${course.main_link}" target="_blank">Main</a>
|
||||||
|
${course.last_link ? `<a href="${course.last_link}" target="_blank">Milestone</a>` : ''}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
card.addEventListener('dragstart', (e) => {
|
||||||
|
e.dataTransfer.setData('text/plain', course.id);
|
||||||
|
card.classList.add('dragging');
|
||||||
|
});
|
||||||
|
|
||||||
|
card.addEventListener('dragend', () => {
|
||||||
|
card.classList.remove('dragging');
|
||||||
|
});
|
||||||
|
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
|
||||||
|
function allowDrop(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function drop(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const courseId = e.dataTransfer.getData('text/plain');
|
||||||
|
const newStatus = e.currentTarget.id; // The column ID
|
||||||
|
|
||||||
|
const course = courses.find(c => c.id == courseId);
|
||||||
|
if (course && course.status !== newStatus) {
|
||||||
|
course.status = newStatus;
|
||||||
|
await updateCourseOnServer(course);
|
||||||
|
renderBoard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateCourseOnServer(course) {
|
||||||
|
await fetch(`/api/courses/${course.id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(course)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteCourse(id) {
|
||||||
|
if (confirm('Are you sure?')) {
|
||||||
|
await fetch(`/api/courses/${id}`, { method: 'DELETE' });
|
||||||
|
await fetchCourses();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Modal Logic
|
||||||
|
const modal = document.getElementById('course-modal');
|
||||||
|
const form = document.getElementById('course-form');
|
||||||
|
|
||||||
|
function showModal(id = null) {
|
||||||
|
modal.style.display = 'block';
|
||||||
|
if (id) {
|
||||||
|
const course = courses.find(c => c.id == id);
|
||||||
|
document.getElementById('modal-title').innerText = 'Edit Course';
|
||||||
|
document.getElementById('course-id').value = course.id;
|
||||||
|
document.getElementById('title').value = course.title;
|
||||||
|
document.getElementById('description').value = course.description || '';
|
||||||
|
document.getElementById('main_link').value = course.main_link;
|
||||||
|
document.getElementById('last_link').value = course.last_link || '';
|
||||||
|
document.getElementById('status').value = course.status;
|
||||||
|
} else {
|
||||||
|
document.getElementById('modal-title').innerText = 'Add New Course';
|
||||||
|
form.reset();
|
||||||
|
document.getElementById('course-id').value = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeModal() {
|
||||||
|
modal.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
form.onsubmit = async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const id = document.getElementById('course-id').value;
|
||||||
|
const courseData = {
|
||||||
|
title: document.getElementById('title').value,
|
||||||
|
description: document.getElementById('description').value,
|
||||||
|
main_link: document.getElementById('main_link').value,
|
||||||
|
last_link: document.getElementById('last_link').value,
|
||||||
|
status: document.getElementById('status').value
|
||||||
|
};
|
||||||
|
|
||||||
|
if (id) {
|
||||||
|
await fetch(`/api/courses/${id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(courseData)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await fetch('/api/courses', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(courseData)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
closeModal();
|
||||||
|
await fetchCourses();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onclick = (e) => {
|
||||||
|
if (e.target == modal) closeModal();
|
||||||
|
};
|
||||||
|
|
||||||
|
function editCourse(id) {
|
||||||
|
showModal(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initial fetch
|
||||||
|
fetchCourses();
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
:root {
|
||||||
|
--bg: #f3f4f6;
|
||||||
|
--column-bg: #e5e7eb;
|
||||||
|
--card-bg: #ffffff;
|
||||||
|
--primary: #2563eb;
|
||||||
|
--text: #1f2937;
|
||||||
|
--border: #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, sans-serif;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 { margin: 0; }
|
||||||
|
|
||||||
|
#add-course-btn {
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kanban-board {
|
||||||
|
display: flex;
|
||||||
|
gap: 20px;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
background: var(--column-bg);
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 300px;
|
||||||
|
min-height: 500px;
|
||||||
|
padding: 15px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column h2 {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
color: #4b5563;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-list {
|
||||||
|
min-height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-card {
|
||||||
|
background: var(--card-bg);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 15px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
cursor: grab;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-card:hover {
|
||||||
|
border-color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-card.dragging {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-card h3 {
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-card p {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #6b7280;
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-links {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-links a {
|
||||||
|
color: var(--primary);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-actions button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: #9ca3af;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-actions button:hover {
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal Styles */
|
||||||
|
.modal {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 100;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: white;
|
||||||
|
margin: 10% auto;
|
||||||
|
padding: 2rem;
|
||||||
|
width: 400px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group input, .form-group textarea, .form-group select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button {
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
services:
|
||||||
|
learning-hub:
|
||||||
|
image: python:3.11-slim
|
||||||
|
container_name: learning-hub
|
||||||
|
working_dir: /app
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
command: >
|
||||||
|
sh -c "pip install fastapi uvicorn sqlalchemy && python -m app.main"
|
||||||
|
networks:
|
||||||
|
- proxy-net
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
# Public (HTTPS)
|
||||||
|
- "traefik.http.routers.learning.rule=Host(`learning.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.learning.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.learning.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.routers.learning.middlewares=authelia-auth@docker"
|
||||||
|
|
||||||
|
# Public (Redirect)
|
||||||
|
- "traefik.http.routers.learning-red.rule=Host(`learning.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.learning-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.learning-red.middlewares=https-redirect@docker"
|
||||||
|
|
||||||
|
# Local (HTTP)
|
||||||
|
- "traefik.http.routers.learning-local.rule=Host(`learning.localhost`)"
|
||||||
|
- "traefik.http.routers.learning-local.entrypoints=web"
|
||||||
|
|
||||||
|
- "traefik.http.services.learning.loadbalancer.server.port=8000"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy-net:
|
||||||
|
external: true
|
||||||
Binary file not shown.
@@ -7,10 +7,14 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.mermaid.rule=Host(`mermaid.arch-services.mywire.org`) || Host(`mermaid.localhost`)"
|
- "traefik.http.routers.mermaid.rule=Host(`mermaid.arch-services.mywire.org`)"
|
||||||
|
|
||||||
- "traefik.http.routers.mermaid.entrypoints=websecure"
|
- "traefik.http.routers.mermaid.entrypoints=websecure"
|
||||||
- "traefik.http.routers.mermaid.tls.certresolver=myresolver"
|
- "traefik.http.routers.mermaid.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.routers.mermaid-red.rule=Host(`mermaid.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.mermaid-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.mermaid-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.mermaid-local.rule=Host(`mermaid.localhost`)"
|
||||||
|
- "traefik.http.routers.mermaid-local.entrypoints=web"
|
||||||
- "traefik.http.services.mermaid.loadbalancer.server.port=8080"
|
- "traefik.http.services.mermaid.loadbalancer.server.port=8080"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -17,21 +17,40 @@ services:
|
|||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
# Router 1: API/Automation (Token-based)
|
# Router 1: API/Automation (Token-based)
|
||||||
- "traefik.http.routers.ollama-api.rule=(Host(`ollama.arch-services.mywire.org`) || Host(`ollama.localhost`)) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)"
|
- "traefik.http.routers.ollama-api.rule=Host(`ollama.arch-services.mywire.org`) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)"
|
||||||
- "traefik.http.routers.ollama-api.entrypoints=websecure"
|
- "traefik.http.routers.ollama-api.entrypoints=websecure"
|
||||||
- "traefik.http.routers.ollama-api.tls.certresolver=myresolver"
|
- "traefik.http.routers.ollama-api.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.ollama-api.priority=100"
|
- "traefik.http.routers.ollama-api.priority=100"
|
||||||
- "traefik.http.routers.ollama-api.service=ollama-svc"
|
- "traefik.http.routers.ollama-api.service=ollama-svc"
|
||||||
|
|
||||||
# Router 2: Browser/Standard (Authelia Protected)
|
- "traefik.http.routers.ollama-api-red.rule=Host(`ollama.arch-services.mywire.org`) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)"
|
||||||
- "traefik.http.routers.ollama-browser.rule=Host(`ollama.arch-services.mywire.org`) || Host(`ollama.localhost`)"
|
- "traefik.http.routers.ollama-api-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.ollama-api-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.ollama-api-red.priority=100"
|
||||||
|
|
||||||
|
- "traefik.http.routers.ollama-api-local.rule=Host(`ollama.localhost`) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)"
|
||||||
|
- "traefik.http.routers.ollama-api-local.entrypoints=web"
|
||||||
|
- "traefik.http.routers.ollama-api-local.priority=100"
|
||||||
|
- "traefik.http.routers.ollama-api-local.service=ollama-svc"
|
||||||
|
|
||||||
|
# Router 2: Browser/Standard (Authelia Protected)
|
||||||
|
- "traefik.http.routers.ollama-browser.rule=Host(`ollama.arch-services.mywire.org`)"
|
||||||
- "traefik.http.routers.ollama-browser.entrypoints=websecure"
|
- "traefik.http.routers.ollama-browser.entrypoints=websecure"
|
||||||
- "traefik.http.routers.ollama-browser.tls.certresolver=myresolver"
|
- "traefik.http.routers.ollama-browser.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.ollama-browser.middlewares=authelia-auth@docker"
|
- "traefik.http.routers.ollama-browser.middlewares=authelia-auth@docker"
|
||||||
- "traefik.http.routers.ollama-browser.priority=50"
|
- "traefik.http.routers.ollama-browser.priority=50"
|
||||||
- "traefik.http.routers.ollama-browser.service=ollama-svc"
|
- "traefik.http.routers.ollama-browser.service=ollama-svc"
|
||||||
|
|
||||||
|
- "traefik.http.routers.ollama-browser-red.rule=Host(`ollama.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.ollama-browser-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.ollama-browser-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.ollama-browser-red.priority=50"
|
||||||
|
|
||||||
|
- "traefik.http.routers.ollama-browser-local.rule=Host(`ollama.localhost`)"
|
||||||
|
- "traefik.http.routers.ollama-browser-local.entrypoints=web"
|
||||||
|
- "traefik.http.routers.ollama-browser-local.priority=50"
|
||||||
|
- "traefik.http.routers.ollama-browser-local.service=ollama-svc"
|
||||||
|
|
||||||
# Shared Service
|
# Shared Service
|
||||||
- "traefik.http.services.ollama-svc.loadbalancer.server.port=11434"
|
- "traefik.http.services.ollama-svc.loadbalancer.server.port=11434"
|
||||||
- "traefik.http.services.ollama-svc.loadbalancer.healthcheck.path=/api/tags"
|
- "traefik.http.services.ollama-svc.loadbalancer.healthcheck.path=/api/tags"
|
||||||
|
|||||||
@@ -69,12 +69,14 @@
|
|||||||
<div class="layer-box">
|
<div class="layer-box">
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>Service Discovery:</strong> <em>Homepage</em> dashboard provides a unified portal.</li>
|
<li><strong>Service Discovery:</strong> <em>Homepage</em> dashboard provides a unified portal.</li>
|
||||||
<li><strong>SSO Integration:</strong> Critical apps (Gitea, Dozzle) utilize Authelia Forward Auth.</li>
|
<li><strong>Learning Hub:</strong> A dedicated Kanban board (FastAPI + SQLite) for tracking courses and milestones.</li>
|
||||||
|
<li><strong>SSO Integration:</strong> Critical apps (Gitea, Dozzle, Learning) utilize Authelia Forward Auth.</li>
|
||||||
<li><strong>Isolation:</strong> Services have no direct host access and communicate over internal networks.</li>
|
<li><strong>Isolation:</strong> Services have no direct host access and communicate over internal networks.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section id="network">
|
<section id="network">
|
||||||
<h2>4. Networking Model</h2>
|
<h2>4. Networking Model</h2>
|
||||||
<p>Traffic flow is segmented to minimize the blast radius of a potential breach.</p>
|
<p>Traffic flow is segmented to minimize the blast radius of a potential breach.</p>
|
||||||
|
|||||||
@@ -9,15 +9,26 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.authelia.rule=Host(`auth.arch-services.mywire.org`) || Host(`auth.localhost`)"
|
# Public (HTTPS)
|
||||||
|
- "traefik.http.routers.authelia.rule=Host(`auth.arch-services.mywire.org`)"
|
||||||
- "traefik.http.routers.authelia.entrypoints=websecure"
|
- "traefik.http.routers.authelia.entrypoints=websecure"
|
||||||
- "traefik.http.routers.authelia.tls.certresolver=myresolver"
|
- "traefik.http.routers.authelia.tls.certresolver=myresolver"
|
||||||
# This label defines the middleware that other services will use
|
|
||||||
|
# Public (Redirect)
|
||||||
|
- "traefik.http.routers.authelia-red.rule=Host(`auth.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.authelia-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.authelia-red.middlewares=https-redirect@docker"
|
||||||
|
|
||||||
|
# Local (HTTP)
|
||||||
|
- "traefik.http.routers.authelia-local.rule=Host(`auth.localhost`)"
|
||||||
|
- "traefik.http.routers.authelia-local.entrypoints=web"
|
||||||
|
|
||||||
|
# Middleware definition (shared)
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.arch-services.mywire.org/"
|
- "traefik.http.middlewares.authelia-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.arch-services.mywire.org/"
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.trustForwardHeader=true"
|
- "traefik.http.middlewares.authelia-auth.forwardauth.trustForwardHeader=true"
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email"
|
- "traefik.http.middlewares.authelia-auth.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email"
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy-net:
|
proxy-net:
|
||||||
external: true
|
external: true
|
||||||
@@ -50,8 +50,6 @@ services:
|
|||||||
- "--providers.docker.endpoint=tcp://socket-proxy:2375"
|
- "--providers.docker.endpoint=tcp://socket-proxy:2375"
|
||||||
- "--providers.docker.exposedByDefault=false"
|
- "--providers.docker.exposedByDefault=false"
|
||||||
- "--entrypoints.web.address=:80"
|
- "--entrypoints.web.address=:80"
|
||||||
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
|
|
||||||
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
|
|
||||||
- "--entrypoints.websecure.address=:443"
|
- "--entrypoints.websecure.address=:443"
|
||||||
# SSL Setup
|
# SSL Setup
|
||||||
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
|
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
|
||||||
@@ -65,17 +63,29 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
# Authelia Middleware
|
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.arch-services.mywire.org/"
|
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.trustForwardHeader=true"
|
|
||||||
- "traefik.http.middlewares.authelia-auth.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email"
|
|
||||||
# Dashboard
|
|
||||||
- "traefik.http.routers.traefik-dash.rule=Host(`traefik.arch-services.mywire.org`) || Host(`traefik.localhost`)"
|
|
||||||
|
|
||||||
|
# Middleware: Redirect to HTTPS
|
||||||
|
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
||||||
|
|
||||||
|
# Dashboard - Public (HTTPS)
|
||||||
|
- "traefik.http.routers.traefik-dash.rule=Host(`traefik.arch-services.mywire.org`)"
|
||||||
- "traefik.http.routers.traefik-dash.entrypoints=websecure"
|
- "traefik.http.routers.traefik-dash.entrypoints=websecure"
|
||||||
- "traefik.http.routers.traefik-dash.tls.certresolver=myresolver"
|
- "traefik.http.routers.traefik-dash.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.traefik-dash.service=api@internal"
|
- "traefik.http.routers.traefik-dash.service=api@internal"
|
||||||
- "traefik.http.routers.traefik-dash.middlewares=authelia-auth"
|
- "traefik.http.routers.traefik-dash.middlewares=authelia-auth@docker"
|
||||||
|
|
||||||
|
# Dashboard - Public (Redirect)
|
||||||
|
- "traefik.http.routers.traefik-dash-red.rule=Host(`traefik.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.traefik-dash-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.traefik-dash-red.middlewares=https-redirect@docker"
|
||||||
|
|
||||||
|
# Dashboard - Local (HTTP)
|
||||||
|
- "traefik.http.routers.traefik-dash-local.rule=Host(`traefik.localhost`)"
|
||||||
|
- "traefik.http.routers.traefik-dash-local.entrypoints=web"
|
||||||
|
- "traefik.http.routers.traefik-dash-local.service=api@internal"
|
||||||
|
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
|
|||||||
@@ -10,11 +10,15 @@ services:
|
|||||||
- socket-net
|
- socket-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.logs.rule=Host(`logs.arch-services.mywire.org`) || Host(`logs.localhost`)"
|
- "traefik.http.routers.logs.rule=Host(`logs.arch-services.mywire.org`)"
|
||||||
|
|
||||||
- "traefik.http.routers.logs.entrypoints=websecure"
|
- "traefik.http.routers.logs.entrypoints=websecure"
|
||||||
- "traefik.http.routers.logs.tls.certresolver=myresolver"
|
- "traefik.http.routers.logs.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.logs.middlewares=authelia-auth@docker"
|
- "traefik.http.routers.logs.middlewares=authelia-auth@docker"
|
||||||
|
- "traefik.http.routers.logs-red.rule=Host(`logs.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.logs-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.logs-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.logs-local.rule=Host(`logs.localhost`)"
|
||||||
|
- "traefik.http.routers.logs-local.entrypoints=web"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy-net:
|
proxy-net:
|
||||||
|
|||||||
@@ -11,10 +11,14 @@ services:
|
|||||||
- proxy-net
|
- proxy-net
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.portainer.rule=Host(`portainer.arch-services.mywire.org`) || Host(`portainer.localhost`)"
|
- "traefik.http.routers.portainer.rule=Host(`portainer.arch-services.mywire.org`)"
|
||||||
|
|
||||||
- "traefik.http.routers.portainer.entrypoints=websecure"
|
- "traefik.http.routers.portainer.entrypoints=websecure"
|
||||||
- "traefik.http.routers.portainer.tls.certresolver=myresolver"
|
- "traefik.http.routers.portainer.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.routers.portainer-red.rule=Host(`portainer.arch-services.mywire.org`)"
|
||||||
|
- "traefik.http.routers.portainer-red.entrypoints=web"
|
||||||
|
- "traefik.http.routers.portainer-red.middlewares=https-redirect@docker"
|
||||||
|
- "traefik.http.routers.portainer-local.rule=Host(`portainer.localhost`)"
|
||||||
|
- "traefik.http.routers.portainer-local.entrypoints=web"
|
||||||
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
|
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in new issue
Block a user