Archived
chore(repo): move current KarlDNS source to Gitea
Preserve the GitHub history and the newer deployed source from ct_134_karldns. Exclude runtime data, credentials, AppleDouble files and local backup copies. Make Gitea the canonical source for documentation, package metadata and project links.
This commit is contained in:
1 parent
4ecc8eb874
commit
5c46b47937
21 files changed
+1301
-593
No files matched your search
+13
-4
@@ -126,15 +126,19 @@ esac
|
||||
"user",
|
||||
"--no-cron",
|
||||
"--no-run",
|
||||
"--base-url",
|
||||
"https://karldns.test",
|
||||
env={
|
||||
"HOME": str(home_dir),
|
||||
"PATH": f"{bin_dir}{os.pathsep}{os.environ['PATH']}",
|
||||
"KARLDNS_BASE_URL": "https://karldns.test",
|
||||
"KARLDNS_RAW_BASE_URL": "https://raw.karldns.test",
|
||||
|
||||
},
|
||||
)
|
||||
|
||||
log = log_file.read_text(encoding="utf-8")
|
||||
assert log.count("Content-Type: application/x-www-form-urlencoded") == 2
|
||||
assert "https://karldns.test/karldns-update.sh" in log
|
||||
assert "/api/v1/hostnames" in log
|
||||
assert "/api/v1/router/register/karl_manage_secret_12345678901234567890" in log
|
||||
assert "KarlDNS: registering hostname" in result.stdout
|
||||
@@ -238,15 +242,20 @@ cp "$1" {crontab_file}
|
||||
assert not (home_dir / ".cache" / "karldns").exists()
|
||||
|
||||
|
||||
def test_hosted_script_routes_redirect_to_github(tmp_path: Path) -> None:
|
||||
def test_hosted_script_routes_serve_bundled_scripts(tmp_path: Path) -> None:
|
||||
app = make_app(DdnsSettings(database_path=tmp_path / "ddns.sqlite3", admin_password="admin"))
|
||||
client = TestClient(app)
|
||||
|
||||
assert client.get("/docs").text.count("Content-Type: application/x-www-form-urlencoded") >= 3
|
||||
|
||||
for path, target in {
|
||||
"/install.sh": "install-linux.sh",
|
||||
"/uninstall.sh": "uninstall-linux.sh",
|
||||
"/karldns-update.sh": "karldns-update.sh",
|
||||
}.items():
|
||||
response = client.get(path, follow_redirects=False)
|
||||
assert response.status_code == 302
|
||||
assert response.headers["location"].endswith(f"/scripts/{target}")
|
||||
assert response.status_code == 200
|
||||
assert response.content == (ROOT / "scripts" / target).read_bytes()
|
||||
assert response.headers["content-type"].startswith("text/plain")
|
||||
assert response.headers["cache-control"] == "no-cache"
|
||||
assert "location" not in response.headers
|
||||
Reference in new issue
Block a user