Sanitize codebase, reorganize docs, and add missing deploy files

Remove dead code identified in docs/SANITIZATION-REVIEW.md:
- app/blueprints/content_old.py and app/blueprints/playlist.py
- app/models/group.py, app/utils/nginx_config_reader.py
- orphaned templates (content_list, edit_content, upload_content,
  player_page) and the related group/Template references

Result: 6 blueprints, 82 routes, no dead modules or orphan templates.

Add files that deploy.sh and docker-entrypoint.sh already require but
which were never tracked:
- https_manager.py       (referenced by deploy.sh, migrate_network.sh,
                          docker-entrypoint.sh)
- Caddyfile.example      (seeded by deploy.sh; its absence aborts deploy)

Relocate generated Graphify artifacts from graphify-out/ to
docs/graphify-out/ (110 files, no content change) and archive the
superseded docs under docs/.

Ignore hygiene:
- ignore ad-hoc .env backups (.env.bak*) — they contain live secrets
- keep the pre-sanitization snapshots (docs/legacy code/,
  docs/old_code_documentation/) on disk but out of the repo

Fix .env.example: drop a duplicated config block, genericize the
hardcoded host IP, and document HOSTNAME_INTERNAL.
This commit is contained in:
2026-09-11 12:18:34 +03:00
parent 1c5186463a
commit 46602f1933
226 changed files with 3999 additions and 15737 deletions
+82 -2
View File
@@ -42,6 +42,24 @@
{% endif %}
</div>
<!-- Live build progress (updated by polling below) -->
<div class="card" id="build-progress" style="display: none;">
<h2>Build progress</h2>
<p id="build-progress-text" style="margin: 0;">
<span class="badge badge-warning" id="build-progress-badge">⏳ Running</span>
<span id="build-progress-step"></span>
</p>
<p id="build-progress-message" style="color: #6c757d; margin-top: 8px;"></p>
<div style="margin-top: 10px;">
<button type="button" class="btn btn-secondary" onclick="window.location.reload()">
🔄 Refresh page
</button>
</div>
<p style="color: #6c757d; font-size: 13px; margin-top: 10px;">
The clone takes a couple of minutes. You can leave this page and come back.
</p>
</div>
<form method="POST" action="{{ url_for('admin.build_player_action') }}">
<!-- Repository -->
<div class="card">
@@ -114,10 +132,12 @@
<div class="card">
<h2>3. Build</h2>
<div class="card-actions" style="display: flex; gap: 10px; flex-wrap: wrap;">
<button type="submit" name="action" value="build_and_config" class="btn btn-primary">
<button type="submit" name="action" value="build_and_config"
class="btn btn-primary" id="btn-build-all">
⬇️ Build files &amp; write config
</button>
<button type="submit" name="action" value="build_files" class="btn btn-secondary">
<button type="submit" name="action" value="build_files"
class="btn btn-secondary" id="btn-build-files">
Build files only
</button>
<button type="submit" name="action" value="save_config" class="btn btn-secondary">
@@ -127,4 +147,64 @@
</div>
</form>
</div>
<script>
// Poll the build status so the admin sees live progress instead of a request
// that appears to hang (the clone takes ~1-2 minutes).
(function () {
const statusUrl = "{{ url_for('admin.build_player_status') }}";
const panel = document.getElementById('build-progress');
const badge = document.getElementById('build-progress-badge');
const step = document.getElementById('build-progress-step');
const message = document.getElementById('build-progress-message');
const bAll = document.getElementById('btn-build-all');
const bFiles = document.getElementById('btn-build-files');
let sawRunning = false;
function render(s) {
const state = s.state || 'idle';
if (state === 'running') {
sawRunning = true;
panel.style.display = 'block';
badge.className = 'badge badge-warning';
badge.textContent = '⏳ Running';
step.textContent = s.step || '';
message.textContent = '';
if (bAll) { bAll.disabled = true; bAll.textContent = '⏳ Building…'; }
if (bFiles) { bFiles.disabled = true; }
return;
}
// Reached a terminal state.
if (state === 'success' || state === 'error') {
panel.style.display = 'block';
if (state === 'success') {
badge.className = 'badge badge-success';
badge.textContent = '✅ Build complete';
} else {
badge.className = 'badge badge-danger';
badge.textContent = '❌ Build failed';
}
step.textContent = '';
message.textContent = s.message || '';
if (sawRunning) {
// Reload once so the staged-version panel reflects the new build.
setTimeout(function () { window.location.reload(); }, 1500);
}
}
}
function poll() {
fetch(statusUrl, { headers: { 'Accept': 'application/json' }, cache: 'no-store' })
.then(function (r) { return r.ok ? r.json() : null; })
.then(function (s) { if (s) render(s); })
.catch(function () { /* transient — keep polling */ });
}
poll();
setInterval(poll, 3000);
})();
</script>
{% endblock %}