Skip to content

Commit

Permalink
feat: add http.cat
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsgirao committed Jan 23, 2025
1 parent c67c1f2 commit 1b95971
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
23 changes: 11 additions & 12 deletions hosts/saxton/caddy.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ config, hostSecretsDir, ... }:
{
config,
hostSecretsDir,
pkgs,
...
}:

let
inherit (config.rg) domain;
Expand Down Expand Up @@ -123,6 +128,11 @@ in
hide .git
}
}
handle_errors {
root * ${pkgs.mypkgs.http-cat}
rewrite * /{err.status_code}.jpg
file_server
}
'';
};
"http://idstest.${domain}" = {
Expand All @@ -131,16 +141,5 @@ in
respond "uid=0(root) gid=0(root) groups=0(root)"
'';
};
"e.${domain}" = {
useACMEHost = "${domain}";
extraConfig = ''
encode zstd gzip
root * ${siteDir}/main/html/evil
respond /.git* 404
file_server {
hide .git
}
'';
};
};
}
1 change: 1 addition & 0 deletions packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rec {

#Packages defined in this repo.
fakepkg = pkgs.callPackage ./fakepkg { };
http-cat = pkgs.callPackage ./http-cat { };

flatpak-xdg-utils = pkgs.callPackage ./flatpak-xdg-utils { };

Expand Down
17 changes: 17 additions & 0 deletions packages/http-cat/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
runCommand,
fetchFromGitHub,
}:
let
src = fetchFromGitHub {
owner = "httpcats";
repo = "http.cat";
rev = "59271bec6d16afee554691b1bad092d68a8bf7ae";
hash = "sha256-2PRLV0/hpEXeuz4HcmSpvLj33SAaVV/+8rsF+XFFRtU=";
};
in

runCommand "http-cat" { } ''
mkdir $out
cp -r ${src}/public/images/. $out/
''

0 comments on commit 1b95971

Please sign in to comment.