1
1
Fork 0

Fix some inquisitor remote copy issues

This commit is contained in:
root 2022-01-07 16:25:16 -08:00
parent 8e3dbc9bd0
commit 0ee2c50a97
1 changed files with 14 additions and 2 deletions

View File

@ -5,14 +5,19 @@ let
inquisitorSource = pkgs.fetchFromGitHub { inquisitorSource = pkgs.fetchFromGitHub {
owner = "Jaculabilis"; owner = "Jaculabilis";
repo = "Inquisitor"; repo = "Inquisitor";
rev = "5d0c5b1ae33b06a2dd82befcbefd02ad03d742f3"; rev = "a6d961aba948d3a682dbde12dbaa8805eadbbd84";
sha256 = "02ldawycs6wf4y9d94y0f2mhsjfy7kp6j779bia7akyy4iihrib4"; sha256 = "10n6c5zvi27f92b7am0rrdizxz0mlp3rw1y1jyd44b57ykk7x6fr";
}; };
inquisitor = pkgs.callPackage inquisitorSource {}; inquisitor = pkgs.callPackage inquisitorSource {};
# Define the inquisitor data directory # Define the inquisitor data directory
inquisiDir = "/var/lib/inquisitor"; inquisiDir = "/var/lib/inquisitor";
# Define an scp helper for executing in cron jobs
scp-helper = pkgs.writeShellScriptBin "scp-helper" ''
${pkgs.openssh}/bin/scp -i ${inquisiDir}/inquisitor.key -oStrictHostKeyChecking=no "$@"
'';
# Define the inquisitor service user # Define the inquisitor service user
inquisitorUser = { inquisitorUser = {
name = "inquisitor"; name = "inquisitor";
@ -46,6 +51,12 @@ let
# Ensure the service owns the folders # Ensure the service owns the folders
chown -R ${inquisitorUser.name} ${inquisiDir} chown -R ${inquisitorUser.name} ${inquisiDir}
# Ensure the scp helper is present
if [ -f ${inquisiDir}/scp-helper ]; then
rm ${inquisiDir}/scp-helper
fi
ln -s -t ${inquisiDir} ${scp-helper}/bin/scp-helper
''; '';
# Create a run script for the server # Create a run script for the server
@ -54,6 +65,7 @@ let
${inquisitor}/bin/gunicorn \ ${inquisitor}/bin/gunicorn \
--bind=localhost:24133 \ --bind=localhost:24133 \
--workers=4 \ --workers=4 \
--timeout 120 \
--log-level debug \ --log-level debug \
"inquisitor.app:wsgi()" "inquisitor.app:wsgi()"
''; '';