Fixing some jekyll things and removing old subdomains
This commit is contained in:
parent
e0f579c12b
commit
2ae6488249
13
_config.yml
13
_config.yml
@ -1,9 +1,22 @@
|
|||||||
title: Morlana - Pages
|
title: Morlana - Pages
|
||||||
description: >-
|
description: >-
|
||||||
Free Subdomains provided by Morlana
|
Free Subdomains provided by Morlana
|
||||||
|
|
||||||
baseurl: "/"
|
baseurl: "/"
|
||||||
url: "https://morlana.page"
|
url: "https://morlana.page"
|
||||||
|
|
||||||
show_downloads: false
|
show_downloads: false
|
||||||
|
|
||||||
remote_theme: pages-themes/midnight@v0.2.0
|
remote_theme: pages-themes/midnight@v0.2.0
|
||||||
plugins:
|
plugins:
|
||||||
- jekyll-remote-theme
|
- jekyll-remote-theme
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
- scope:
|
||||||
|
path: "README.md"
|
||||||
|
values:
|
||||||
|
layout: "default"
|
||||||
|
title: "Morlana.page Documentation"
|
||||||
|
|
||||||
|
include:
|
||||||
|
- "README.md"
|
||||||
|
@ -3,9 +3,7 @@ reserved_domains:
|
|||||||
- "^admin\\..*"
|
- "^admin\\..*"
|
||||||
- "^internal\\..*"
|
- "^internal\\..*"
|
||||||
|
|
||||||
subdomains:
|
subdomains: []
|
||||||
- name: sitiriotv
|
|
||||||
target: justin.morlana.space
|
|
||||||
# - name: "example"
|
# - name: "example"
|
||||||
# target: "example.com"
|
# target: "example.com"
|
||||||
# proxy: true
|
# proxy: true
|
||||||
|
@ -29,13 +29,22 @@ def get_existing_records():
|
|||||||
def update_cloudflare():
|
def update_cloudflare():
|
||||||
data = load_domains()
|
data = load_domains()
|
||||||
reserved_patterns = data.get("reserved_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()
|
existing_records = get_existing_records()
|
||||||
|
|
||||||
for subdomain in subdomains:
|
# Entferne Einträge, die nicht mehr in domains.yaml stehen
|
||||||
full_domain = f"{subdomain['name']}.morlana.page"
|
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):
|
if is_reserved(full_domain, reserved_patterns):
|
||||||
print(f"Skipping reserved domain: {full_domain}")
|
print(f"Skipping reserved domain: {full_domain}")
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user