summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/external/default.nix2
-rw-r--r--krebs/3modules/external/mic92.nix29
-rw-r--r--krebs/3modules/lass/default.nix3
-rw-r--r--krebs/5pkgs/override/default.nix3
-rw-r--r--krebs/5pkgs/simple/cyberlocker-tools/default.nix23
-rw-r--r--krebs/5pkgs/simple/htgen-cyberlocker/default.nix29
-rw-r--r--krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker76
-rw-r--r--krebs/nixpkgs-unstable.json8
-rw-r--r--krebs/nixpkgs.json8
9 files changed, 170 insertions, 11 deletions
diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix
index 75be58326..29c0d34f0 100644
--- a/krebs/3modules/external/default.nix
+++ b/krebs/3modules/external/default.nix
@@ -639,7 +639,7 @@ in {
nets = {
retiolum = {
ip4.addr = "10.243.13.12";
- aliases = [ "catalonia.r" ];
+ aliases = [ "catalonia.r" "aleph.r" ];
tinc.pubkey = ''
-----BEGIN RSA PUBLIC KEY-----
MIICCgKCAgEAug+nej8/spuRHdzcfBYAuzUVoiq4YufmJqXSshvgf4aqjeVEt91Y
diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index bbefb8ed8..3ef693290 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -334,6 +334,26 @@ in {
'';
};
};
+ yasmin = {
+ owner = config.krebs.users.mic92;
+ nets.retiolum = {
+ ip4.addr = "10.243.29.197";
+ aliases = [
+ "yasmin.r"
+ ];
+ tinc.pubkey = ''
+ -----BEGIN RSA PUBLIC KEY-----
+ MIIBCgKCAQEAnQ6HGgUPVQbDIsLZAawZu4vK9yHF02aDrIWU9SdzpAddhM8yqWeC
+ f55W6zyjZuoQ2w4UNthDl6gjQM6A9B+nEMRNz3Rnhp57Lyi0a6HZHF2Eok9vJBiu
+ IRbVUxPpPKOGE09w0m5cLOfDfaZVdAT+80lQYoaasDr2VlRJNa2/arzaq847/SVg
+ vaf4gOmE+iIK+4ZDHqLcTn1WD6jy+aMChZU/zI31vZ8vM4oPuGh1xbcB3wKP3Vf3
+ OTqpGN86CdrdBahJkzNJzIXYsPsRaZ2+8dWTH9gJjI0z+yywQQCrrh9K/oJtDUHF
+ BwmNc150BoSLqwduSWLtBonCa9p2/y/TDQIDAQAB
+ -----END RSA PUBLIC KEY-----
+ Ed25519PublicKey = ZQt/OcrDlQZvtJyMEFcS6FKjtumBA9gBWr7VqGdbJBP
+ '';
+ };
+ };
martha = {
owner = config.krebs.users.mic92;
nets = rec {
@@ -389,6 +409,7 @@ in {
nCShp7V+MSmz4DnLK1HLksLVLmGyZmouGsLjYUnEa414EI6NJF3bfEO2ZRGaswyR
/vW066YCTe7wi+YrvrMDgkdbyfn/ecMTn2iXsTb4k9/fuO0+hsqL+isCAwEAAQ==
-----END RSA PUBLIC KEY-----
+ Ed25519PublicKey = 1wPa2cmQ4FUFw9289d0KdG1DcDuMNIYMWzIUnVVHu2P
'';
};
};
@@ -426,11 +447,12 @@ in {
owner = config.krebs.users.mic92;
nets = rec {
internet = {
- ip4.addr = "131.159.38.191";
- ip6.addr = "2a09:80c0:38::191";
+ ip4.addr = "131.159.102.1";
+ ip6.addr = "2a09:80c0:102::1";
aliases = [ "bill.i" ];
};
retiolum = {
+ via = internet;
addrs = [
config.krebs.hosts.bill.nets.retiolum.ip4.addr
config.krebs.hosts.bill.nets.retiolum.ip6.addr
@@ -465,6 +487,7 @@ in {
aliases = [ "nardole.i" ];
};
retiolum = {
+ via = internet;
addrs = [
config.krebs.hosts.nardole.nets.retiolum.ip4.addr
config.krebs.hosts.nardole.nets.retiolum.ip6.addr
@@ -618,6 +641,7 @@ in {
FK5qRrQFMRFB8KGV+n3+cx3XCM2q0ZPTNf06N+Usx6vTKLASa/4GaTcbBx+9Dndm
mFVWq9JjLa8e65tojzj8PhmgxqaNCf8aKwIDAQAB
-----END RSA PUBLIC KEY-----
+ Ed25519PublicKey = oRGc9V9G9GFsY1bZIaJamoDEAZU2kphlpxXOMBxI2GN
'';
};
};
@@ -640,6 +664,7 @@ in {
jb+EGlT/vq3+oGNFJ7Shy/VsR5GLDoZ5KCsT45DM87lOjGB7m+bOdizZQtWmJtC/
/btEPWJPAD9lIY2iGtPrmeMWDNTW9c0iCwIDAQAB
-----END RSA PUBLIC KEY-----
+ Ed25519PublicKey = dzjT09UeUGJCbUFrBo+FtbnXrsxFQnmqmJw7tjpJQJL
'';
};
};
diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix
index cb68cff18..b19e2e6fc 100644
--- a/krebs/3modules/lass/default.nix
+++ b/krebs/3modules/lass/default.nix
@@ -21,6 +21,7 @@ in {
"krebsco.de" = ''
cache IN A ${nets.internet.ip4.addr}
p IN A ${nets.internet.ip4.addr}
+ c IN A ${nets.internet.ip4.addr}
paste IN A ${nets.internet.ip4.addr}
prism IN A ${nets.internet.ip4.addr}
'';
@@ -65,7 +66,9 @@ in {
"prism.r"
"cache.prism.r"
"cgit.prism.r"
+ "flix.r"
"paste.r"
+ "c.r"
"p.r"
"search.r"
];
diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix
index 4cb6a1cb4..c2149ae55 100644
--- a/krebs/5pkgs/override/default.nix
+++ b/krebs/5pkgs/override/default.nix
@@ -18,6 +18,9 @@ self: super: {
"0.9.0" = [
./flameshot/flameshot_imgur_0.9.0.patch
];
+ "0.10.1" = [
+ ./flameshot/flameshot_imgur_0.9.0.patch
+ ];
}.${old.version};
});
diff --git a/krebs/5pkgs/simple/cyberlocker-tools/default.nix b/krebs/5pkgs/simple/cyberlocker-tools/default.nix
new file mode 100644
index 000000000..6e6563fb1
--- /dev/null
+++ b/krebs/5pkgs/simple/cyberlocker-tools/default.nix
@@ -0,0 +1,23 @@
+{ pkgs }:
+pkgs.symlinkJoin {
+ name = "cyberlocker-tools";
+ paths = [
+ (pkgs.writers.writeDashBin "cput" ''
+ set -efu
+ path=''${1:-$(hostname)}
+ path=$(echo "/$path" | sed -E 's:/+:/:')
+ url=http://c.r$path
+
+ ${pkgs.curl}/bin/curl -fSs --data-binary @- "$url"
+ echo "$url"
+ '')
+ (pkgs.writers.writeDashBin "cdel" ''
+ set -efu
+ path=$1
+ path=$(echo "/$path" | sed -E 's:/+:/:')
+ url=http://c.r$path
+
+ ${pkgs.curl}/bin/curl -f -X DELETE "$url"
+ '')
+ ];
+}
diff --git a/krebs/5pkgs/simple/htgen-cyberlocker/default.nix b/krebs/5pkgs/simple/htgen-cyberlocker/default.nix
new file mode 100644
index 000000000..515ea3cf9
--- /dev/null
+++ b/krebs/5pkgs/simple/htgen-cyberlocker/default.nix
@@ -0,0 +1,29 @@
+with import <stockholm/lib>;
+{ pkgs, stdenv }:
+stdenv.mkDerivation rec {
+ pname = "htgen-cyberlocker";
+ version = "1.0.0";
+
+ src = ./src;
+
+ buildPhase = ''
+ (
+ exec > htgen-cyberlocker
+ echo PATH=${makeBinPath [
+ pkgs.coreutils
+ pkgs.file
+ pkgs.findutils
+ pkgs.gnugrep
+ pkgs.jq
+ pkgs.nix
+ pkgs.utillinux
+ ]}
+ echo STATEDIR=${shell.escape "\${STATEDIR-$HOME}"}
+ cat $src/htgen-cyberlocker
+ )
+ '';
+
+ installPhase = ''
+ install -D htgen-cyberlocker $out/bin/htgen-cyberlocker
+ '';
+}
diff --git a/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker b/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker
new file mode 100644
index 000000000..ab9c4e8e3
--- /dev/null
+++ b/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker
@@ -0,0 +1,76 @@
+delete_response() {
+ jq -n -r \
+ --arg server "$Server" \
+ '
+ [ "HTTP/1.1 204 OK\r"
+ , "Connection: close\r"
+ , "Server: \($server)\r"
+ , "\r"
+ ][]
+ '
+}
+
+file_response() {(
+ type=$(file -ib "$1")
+ size=$(wc -c < "$1")
+ jq -n -r \
+ --arg type "$type" \
+ --arg size "$size" \
+ --arg server "$Server" \
+ '
+ [ "HTTP/1.1 200 OK\r"
+ , "Connection: close\r"
+ , "Content-Length: \($size)\r"
+ , "Content-Type: \($type)\r"
+ , "Server: \($server)\r"
+ , "\r"
+ ][]
+ '
+ cat "$1"
+)}
+
+read_uri() {
+ jq -cn --arg uri "$1" '
+ $uri |
+ capture("^((?<scheme>[^:]*):)?(//(?<authority>[^/]*))?(?<path>[^?#]*)([?](?<query>[^#]*))?([#](?<fragment>.*))?$") |
+ . + {
+ query: (.query | if . != null then
+ split("&") |
+ map(split("=") | {key:.[0],value:.[1]}) |
+ from_entries
+ else . end)
+ }
+ '
+}
+
+uri=$(read_uri "$Request_URI")
+path=$(jq -nr --argjson uri "$uri" '$uri.path')
+
+case "$Method $path" in
+ 'POST /'*|'PUT /'*)
+ content=$(mktemp -t htgen.$$.content.XXXXXXXX)
+ trap "rm $content >&2" EXIT
+
+ head -c $req_content_length > $content
+
+ item=$STATEDIR/items/$(echo "$path" | jq -rR @uri)
+
+ mkdir -v -p $STATEDIR/items >&2
+ cp -v $content $item >&2
+ exit
+ ;;
+ 'GET /'*)
+ item=$STATEDIR/items/$(echo "$path" | jq -rR @uri)
+ if [ -e "$item" ]; then
+ file_response "$item"
+ exit
+ fi
+ ;;
+ 'DELETE /'*)
+ item=$STATEDIR/items/$(echo "$path" | jq -rR @uri)
+ if [ -e "$item" ]; then
+ rm "$item"
+ delete_response
+ exit
+ fi
+esac
diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json
index 967f0b426..d0d3cd82d 100644
--- a/krebs/nixpkgs-unstable.json
+++ b/krebs/nixpkgs-unstable.json
@@ -1,9 +1,9 @@
{
"url": "https://github.com/NixOS/nixpkgs",
- "rev": "dd14e5d78e90a2ccd6007e569820de9b4861a6c2",
- "date": "2021-07-24T08:14:16-04:00",
- "path": "/nix/store/0z5nrrjzmjcicjhhdrqb9vgm56zxysk3-nixpkgs",
- "sha256": "1zmhwx1qqgl1wrrb9mjkck508887rldrnragvximhd7jrh1ya3fb",
+ "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512",
+ "date": "2021-08-29T22:49:37+08:00",
+ "path": "/nix/store/vg29bg0awqam80djwz68ym0awvasrw6i-nixpkgs",
+ "sha256": "1s29nc3ppsjdq8kgbh8pc26xislkv01yph58xv2vjklkvsmz5pzm",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json
index 5086b8af3..92ce9aa90 100644
--- a/krebs/nixpkgs.json
+++ b/krebs/nixpkgs.json
@@ -1,9 +1,9 @@
{
"url": "https://github.com/NixOS/nixpkgs",
- "rev": "91903ceb294dbe63a696759bfba3d23ee667f2dc",
- "date": "2021-07-26T09:21:28+02:00",
- "path": "/nix/store/2v649741xdh1crybi2dm879bl60zrkhf-nixpkgs",
- "sha256": "1hmpwi27r4q0lnspg7ylfzxakwz2fhl3r07vjvq5yalcdqwiain3",
+ "rev": "74d017edb6717ad76d38edc02ad3210d4ad66b96",
+ "date": "2021-08-27T16:58:49+02:00",
+ "path": "/nix/store/82jg1p0rlf7mkryjpdn0z6b95q4i9lnq-nixpkgs",
+ "sha256": "0wvz41izp4djzzr0a6x54hcm3xjr51nlj8vqghfgyrjpk8plyk4s",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false