from commia.prelude import * from commia.ssh import scp, ssh_args from commia.util import with_written run_check( [*ssh_args(), "sh", "-c", "cat > /usr/bin/cgit-about-filter.sh"], input=b"#!/bin/sh\nmd2html", # discard arguments ) run_check([*ssh_args(), "chmod", "+x", "/usr/bin/cgit-about-filter.sh"]) scp("cgit/public", "asylum:/etc/cgit/public") scp("cgit/private", "asylum:/etc/cgit/private") if Path("cgit/css").exists(): scp("cgit/css/style.css", "asylum:/usr/share/webapps/cgit/style.css") scp("cgit/css/scopes", "asylum:/usr/share/cgit-syntect/scopes") for sym, vis in [("🗝", "public"), ("⛯", "private")]: with_written( f"{sym}", lambda path: scp(path, f"asylum:/etc/cgit/{vis}-header.html"), ) run([*ssh_args(), "chmod", "+r", f"/etc/cgit/{vis}-header.html"])