Fixing some jekyll things and removing old subdomains
Some checks failed
Deploy Jekyll site to Pages / build (push) Waiting to run
Update Cloudflare DNS / update-dns (push) Has been cancelled

This commit is contained in:
Florian Weber 2025-03-03 00:02:09 +01:00
parent e0f579c12b
commit 2ae6488249
3 changed files with 27 additions and 7 deletions

View File

@ -1,9 +1,22 @@
title: Morlana - Pages
description: >-
Free Subdomains provided by Morlana
baseurl: "/"
url: "https://morlana.page"
show_downloads: false
remote_theme: pages-themes/midnight@v0.2.0
plugins:
- jekyll-remote-theme
defaults:
- scope:
path: "README.md"
values:
layout: "default"
title: "Morlana.page Documentation"
include:
- "README.md"

View File

@ -3,9 +3,7 @@ reserved_domains:
- "^admin\\..*"
- "^internal\\..*"
subdomains:
- name: sitiriotv
target: justin.morlana.space
subdomains: []
# - name: "example"
# target: "example.com"
# proxy: true

View File

@ -29,13 +29,22 @@ def get_existing_records():
def update_cloudflare():
data = load_domains()
reserved_patterns = data.get("reserved_domains", [])
subdomains = data.get("subdomains", [])
subdomains = {f"{sub['name']}.morlana.page": sub for sub in data.get("subdomains", [])}
existing_records = get_existing_records()
for subdomain in subdomains:
full_domain = f"{subdomain['name']}.morlana.page"
# Entferne Einträge, die nicht mehr in domains.yaml stehen
for existing_domain in existing_records:
if existing_domain.endswith(".morlana.page") and existing_domain not in subdomains:
record_id = existing_records[existing_domain]["id"]
response = requests.delete(f"{CLOUDFLARE_API_URL}/{record_id}", headers=HEADERS)
if response.status_code == 200:
print(f"Successfully removed {existing_domain}")
else:
print(f"Failed to remove {existing_domain}: {response.text}")
# Neue Einträge hinzufügen oder bestehende aktualisieren
for full_domain, subdomain in subdomains.items():
if is_reserved(full_domain, reserved_patterns):
print(f"Skipping reserved domain: {full_domain}")
continue