Add cyberchef to gitea host and big rework on user
parent
71707b0357
commit
44f73eca54
@ -0,0 +1,35 @@
|
|||||||
|
{ pkgs ? import <nixpkgs> {}
|
||||||
|
, stdenv ? pkgs.stdenv
|
||||||
|
, lib ? pkgs.lib
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "cyberchef";
|
||||||
|
version = "10.4.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchzip {
|
||||||
|
url = "https://github.com/gchq/CyberChef/releases/download/v${version}/CyberChef_v${version}.zip";
|
||||||
|
sha256 = "sha256-BjdeOTVZUMitmInL/kE6a/aw/lH4YwKNWxdi0B51xzc=";
|
||||||
|
stripRoot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs.unzip
|
||||||
|
];
|
||||||
|
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r ${src}/* $out
|
||||||
|
cp -r $out/CyberChef_v${version}.html $out/index.html
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = " The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis";
|
||||||
|
homepage = "https://gchq.github.io/CyberChef";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ nyxkrage ];
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
virtualHosts."static" = {
|
||||||
|
default = true;
|
||||||
|
listen = [{
|
||||||
|
ssl = false;
|
||||||
|
port = 8000;
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
}];
|
||||||
|
root = pkgs.callPackage ../pkgs/cyberchef {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 8000 ];
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{ ...} : {
|
||||||
|
imports = [
|
||||||
|
./nginx.nix
|
||||||
|
./sshd.nix
|
||||||
|
];
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
virtualHosts."static" = {
|
||||||
|
default = true;
|
||||||
|
root = ./.
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{ config, ... }: {
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
permitRootLogin = "yes";
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = config.services.openssh.ports;
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue