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
|
||||
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"
|
||||
|
@ -3,9 +3,7 @@ reserved_domains:
|
||||
- "^admin\\..*"
|
||||
- "^internal\\..*"
|
||||
|
||||
subdomains:
|
||||
- name: sitiriotv
|
||||
target: justin.morlana.space
|
||||
subdomains: []
|
||||
# - name: "example"
|
||||
# target: "example.com"
|
||||
# proxy: true
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user