initial commit

This commit is contained in:
2025-03-31 14:55:32 +02:00
commit 9decf702e3
27 changed files with 3235 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<!--
SPDX-FileCopyrightText: 2025 Max Mehl <https://mehl.mx>
SPDX-License-Identifier: GPL-3.0-only
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Home Stream</title>
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='pico.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
<script src="{{ url_for('static', filename='main.js') }}" crossorigin></script>
</head>
<body>
<main class="container">
<h1>{{ path or 'Overview' }}</h1>
{% if path %}
{% set parent = path.rsplit('/', 1)[0] if '/' in path else '' %}
<p><a href="{{ url_for('browse', subpath=parent) }}">⬅ One level up</a></p>
{% endif %}
{% block content %}
{% endblock %}
</main>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!--
SPDX-FileCopyrightText: 2025 Max Mehl <https://mehl.mx>
SPDX-License-Identifier: GPL-3.0-only
-->
{% extends "base.html" %}
{% block content %}
{% if folders %}
<h2>Folders</h2>
<ul>
{% for name, rel in folders %}
<li><a href="{{ url_for('browse', subpath=rel) }}">{{ name }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if files %}
<h2>Media Files</h2>
<ul class="files">
{% for name, rel in files %}
<li>
{{ name }} —
<a href="{{ url_for('download', filepath=rel) }}" target="_blank"><button>💾 Download</button></a>
<a href="{{ url_for('play', filepath=rel) }}"><button>🎬 Play in browser</button></a>
<button onclick="copyToClipboard('{{ request.url_root }}dl-token/{{ username }}/{{ stream_token }}/{{ rel }}', this)">
▶️ Copy Stream URL
</button>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,21 @@
<!--
SPDX-FileCopyrightText: 2025 Max Mehl <https://mehl.mx>
SPDX-License-Identifier: GPL-3.0-only
-->
{% extends "base.html" %}
{% block content %}
<h2>Login</h2>
{% if error %}
<p style="color: red">{{ error }}</p>
{% endif %}
<form method="post">
<label for="username">Username</label>
<input name="username" type="text" autofocus required>
<label for="password">Password</label>
<input name="password" type="password" required>
<button type="submit">Login</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,15 @@
<!--
SPDX-FileCopyrightText: 2025 Max Mehl <https://mehl.mx>
SPDX-License-Identifier: GPL-3.0-only
-->
{% extends "base.html" %}
{% block content %}
<h2>Player</h2>
<{{ mediatype }} controls autoplay preload>
<source src="{{ url_for('download', filepath=path) }}">
Your browser does not support the video tag.
</video>
{% endblock %}