1
0
forked from clan/clan-core

Merge pull request 'gitea_action: Add docs.clan.lol auto deploy' (#1311) from Qubasa-autodeploy into main

This commit is contained in:
clan-bot 2024-05-04 11:34:28 +00:00
commit 9e65cf2b5b
4 changed files with 25 additions and 4 deletions

View File

@ -10,3 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: nix run .#impure-checks
deploy-docs:
runs-on: nix
steps:
- uses: actions/checkout@v3
- run: nix run .#deploy-docs
env:
SSH_HOMEPAGE_KEY: ${{ secrets.SSH_HOMEPAGE_KEY }}

View File

@ -4,10 +4,11 @@
nodes.machine =
{ self, config, ... }:
{
environment.etc."privkey.age".source = ./key.age;
imports = [ (self.nixosModules.clanCore) ];
environment.etc."secret".source = config.sops.secrets.secret.path;
environment.etc."group-secret".source = config.sops.secrets.group-secret.path;
sops.age.keyFile = ./key.age;
sops.age.keyFile = "/etc/privkey.age";
clanCore.clanDir = "${./.}";
clanCore.machineName = "machine";

View File

@ -8,7 +8,7 @@
}:
writeShellScriptBin "deploy-docs" ''
set -eux -o pipefail
set -eu -o pipefail
export PATH="${
lib.makeBinPath [
coreutils
@ -17,6 +17,12 @@ writeShellScriptBin "deploy-docs" ''
]
}"
#########################################
# #
# DO NOT PRINT THE SSH KEY TO THE LOGS #
# #
#########################################
set +x
if [ -n "''${SSH_HOMEPAGE_KEY:-}" ]; then
echo "$SSH_HOMEPAGE_KEY" > ./ssh_key
chmod 600 ./ssh_key
@ -24,6 +30,13 @@ writeShellScriptBin "deploy-docs" ''
else
sshExtraArgs=
fi
set -x
###########################
# #
# END OF DANGER ZONE #
# #
###########################
rsync \
-e "ssh -o StrictHostKeyChecking=no $sshExtraArgs" \

View File

@ -22,7 +22,7 @@ def pair(pin: str) -> str:
user_and_pass = base64.b64encode(b"sunshine:sunshine").decode("ascii")
headers = {
"Content-Type": "application/json",
"Authorization": "Basic %s" % user_and_pass,
"Authorization": f"Basic {user_and_pass}",
}
# Define the parameters
@ -47,7 +47,7 @@ def restart() -> None:
user_and_pass = base64.b64encode(b"sunshine:sunshine").decode("ascii")
headers = {
"Content-Type": "application/json",
"Authorization": "Basic %s" % user_and_pass,
"Authorization": f"Basic {user_and_pass}",
}
# Define the parameters