Compare commits

..

5 Commits

Author SHA1 Message Date
Noah Masur
488b5d61fd switch ssh wait with a script 2024-03-24 15:34:12 -04:00
Noah Masur
6b5892eb1d make identity wait a finite amount 2024-03-24 15:15:07 -04:00
Noah Masur
c3be92dcaf fix: s3 cp failing in github actions 2024-03-24 15:06:50 -04:00
Noah Masur
64bee30b17 fixes to cloudflare dyndns and ssh 2024-03-24 15:04:40 -04:00
Noah Masur
568fdc7491 temp: skip wait for identity 2024-03-24 14:55:17 -04:00
5 changed files with 33 additions and 26 deletions

View File

@ -7,6 +7,7 @@ env:
CLOUDFLARE_R2_ENDPOINT: "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_KEY }}
AWS_DEFAULT_REGION: auto
AWS_ENDPOINT_URL_S3: "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
TF_VAR_vultr_api_key: ${{ secrets.VULTR_API_KEY }}
@ -106,13 +107,17 @@ jobs:
if: inputs.action == 'create'
id: host
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: terraform output host_ip
run: terraform output -raw host_ip
- name: Wait on SSH
uses: iFaxity/wait-on-action@v1.1.0
with:
resource: tcp ${{ steps.host.outputs.stdout }}:22
interval: 5000
if: inputs.action == 'create'
run: |
for i in $(seq 1 15); do
if $(nc -z -w 3 ${{ steps.host.outputs.stdout }} 22); then
exit 0
fi
sleep 10
done
- name: Write Identity Keys to Files
if: inputs.action == 'create'
@ -122,4 +127,6 @@ jobs:
- name: Copy Identity File to Host
if: inputs.action == 'create'
run: scp -i deploy_ed25519 arrow_ed25519 noah@${{ steps.host.outputs.stdout }}:~/.ssh/id_ed25519
run: |
ssh noah@${{ steps.host.outputs.stdout }} 'mkdir -pv .ssh'
scp -i deploy_ed25519 arrow_ed25519 noah@${{ steps.host.outputs.stdout }}:~/.ssh/id_ed25519

View File

@ -1,6 +1,6 @@
{ config, pkgs, ... }: {
{ config, pkgs, lib, ... }: {
config = {
config = lib.mkIf config.physical {
services.xserver = {

View File

@ -60,7 +60,7 @@ in {
dns = {
provider = {
name = "cloudflare";
api_token = "{env.CF_API_TOKEN}";
api_token = "{env.CLOUDFLARE_API_TOKEN}";
};
resolvers = [ "1.1.1.1" ];
};

View File

@ -6,12 +6,12 @@
wantedBy = [ "multi-user.target" ];
serviceConfig = { Type = "oneshot"; };
script = ''
while true; do
for i in $(seq 1 10); do
if [ -f ${config.identityFile} ]; then
echo "Identity file found."
exit 0
fi
sleep 5
sleep 6
done
'';
};

View File

@ -1,17 +1,17 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE1nSGFPdyBlNHNi
VzUvTDdmdndvOUpyMUlvdG5vSGNmdG9yWklPQlFFNVY5RzdabTMwCnh4YXdmY1d4
dXVzYUhnaXVNam1pb0cxNWowZUQ0WUprczExeDMzQ3dPWEEKLT4gc3NoLWVkMjU1
MTkgWXlTVU1RIGJkN3FTSzFFR1ROVTl5UWhqRndnM25DRlVIRHEzUlhZcjNCSUxt
dVlvMEUKVmVFWUlML3FPaW04enl6d1R2c1dJaXpNQVhKV0R5aHFDbUlleldRTnNB
WQotPiBzc2gtZWQyNTUxOSBuanZYNUEgY0dGbTM2b01VdnlDMTVtck1mSmNybG41
aUE0eHlNUytQcjJBQjhWREpXVQpndHFtb0h0N0pucGN4dnJjbER4c3hPVFBER3V1
ZENwQkUzbmRFVnpjeGpvCi0+IHNzaC1lZDI1NTE5IENxSU9VQSBIOFdxWThKSnpy
T0xQN3Q1djlsV3VwcEdPaDIyZ21uclQ1bWo3T1VXQVF3ClhkQkNqSG5nOTBVcUNF
MFhZU1AwQzJCd05IZm5lVmp6cGU2VXlpTlFheEUKLT4gc3NoLWVkMjU1MTkgejFP
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