From bba00f87fd5460e394fc20252732647e301a67ff Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:18:09 +0200 Subject: video over uucp --- hel.nix | 12 +++++++++--- hel/recv-media.nix | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 hel/recv-media.nix diff --git a/hel.nix b/hel.nix index 74441e27..b9628a65 100644 --- a/hel.nix +++ b/hel.nix @@ -107,8 +107,8 @@ nodeName = "hel"; remoteNodes = ["isaac" "ymir"]; # legacy name for odin sshUser = { - openssh.authorizedKeys.keys = [ ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgtDHA7oDIaRwggGGznNaKZF68rFTziqefSCn1t9ZKe uucp@odin'' - ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFH1QWdgoC03nzW5GBuCl2pqASHeIXIYtE9IInHdaKcO uucp@ymir'' + openssh.authorizedKeys.keys = [ ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFH1QWdgoC03nzW5GBuCl2pqASHeIXIYtE9IInHdaKcO uucp@ymir'' + ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJhACtnt9+3j2ev4QVA2QBlPtblPnu7yol2njgfMlHtC uucp@odin'' ]; }; sshConfig = '' @@ -119,8 +119,14 @@ Hostname ymir.niflheim.yggdrasil IdentityFile ~/.ssh/ymir ''; - commandPath = []; + commandPath = [ "${pkgs.callPackage ./hel/recv-media.nix {}}/bin" ]; defaultCommands = []; + protocols = { + isaac = "g"; + }; + commands = { + isaac = ["recv-media"]; + }; }; }; diff --git a/hel/recv-media.nix b/hel/recv-media.nix new file mode 100644 index 00000000..f85598f4 --- /dev/null +++ b/hel/recv-media.nix @@ -0,0 +1,22 @@ +{ stdenv, coreutils, ffmpeg-full writeScriptBin }: + +writeScriptBin "recv-media" '' + #!${stdenv.shell} + + PATH=${ffmpeg-full}/bin:${coreutils}/bin + + dir=/var/media + + file="''${dir}/.$(basename "$1")" + file2="''${dir}/.copy.$(basename "$1")" + nFile="''${dir}/$(basename "$1")" + cat > "''${file}" + if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1