Commit initial : infrastructure Ansible pour homeserver
- Playbooks Ansible avec rôles (common, cockpit, docker, services) - 30+ stacks Docker Compose avec reverse proxy Traefik - Ansible Vault pour gestion secrets - Intégration CrowdSec pour détection intrusions - Versions images Docker fixées pour reproductibilité
This commit is contained in:
commit
fd01ea59ee
125 changed files with 4768 additions and 0 deletions
7
stacks/glance/rss-builder/Dockerfile
Normal file
7
stacks/glance/rss-builder/Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
FROM python:3.11-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY generate_rss.py .
|
||||
|
||||
CMD ["python3", "generate_rss.py"]
|
||||
37
stacks/glance/rss-builder/generate_rss.py
Normal file
37
stacks/glance/rss-builder/generate_rss.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env python3
|
||||
import re
|
||||
from datetime import datetime
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
rss_path = "/rss/index.xml"
|
||||
md_path = "/updates/updates.md"
|
||||
|
||||
with open(md_path, "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
entries = re.findall(r"## (\d{4}-\d{2}-\d{2}) - (.+?)\n(.+?)(?=\n## |\Z)", content, re.DOTALL)
|
||||
|
||||
rss_items = ""
|
||||
for date_str, title, description in entries:
|
||||
pubdate = datetime.strptime(date_str, "%Y-%m-%d").strftime("%a, %d %b %Y 12:00:00 GMT")
|
||||
rss_items += f""" <item>
|
||||
<title>{escape(title.strip())}</title>
|
||||
<link>http://rss/index.xml#{escape(title.strip().replace(" ", "-").lower())}</link>
|
||||
<pubDate>{pubdate}</pubDate>
|
||||
<description>{escape(description.strip())}</description>
|
||||
</item>\n"""
|
||||
|
||||
rss = f"""<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>Updates serveur</title>
|
||||
<link>http://rss/index.xml</link>
|
||||
<description>Changelog des services Tellserv</description>
|
||||
{rss_items}</channel>
|
||||
</rss>
|
||||
"""
|
||||
|
||||
with open(rss_path, "w", encoding="utf-8") as f:
|
||||
f.write(rss)
|
||||
|
||||
print("Flux RSS généré.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue