feat(neovim): remove nvf, add bashls.
This commit is contained in:
parent
1d217e3c92
commit
65dcdaeee5
3 changed files with 51 additions and 287 deletions
23
modules/servers/odin/upfast-cleaner.sh
Executable file
23
modules/servers/odin/upfast-cleaner.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
instance="$*"
|
||||
|
||||
files=$(curl -s "$instance"/files/)
|
||||
|
||||
# Check for keygens on server
|
||||
if echo "$files" | grep -i "keygen" >> /dev/null; then
|
||||
for file in $(echo "$files" | grep -i "keygen"); do
|
||||
echo "Deleting file $file"
|
||||
curl -X DELETE "$instance/files/$file"
|
||||
done
|
||||
fi
|
||||
|
||||
# Delete common php payloads
|
||||
if echo "$files" | grep -i ".php" >> /dev/null; then
|
||||
for file in $(echo "$files" | grep -i ".php"); do
|
||||
if curl -s "$instance/files/$file" | grep -i "base64_decode" >> /dev/null; then
|
||||
echo "Found payload, deleting file $file"
|
||||
curl -X DELETE "$instance/files/$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
@ -38,6 +38,31 @@
|
|||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
|
||||
systemd.services.upfast-cleaner = {
|
||||
description = "Script to automatically delete common types of payloads/keygens.";
|
||||
|
||||
requires = ["upfast.service"];
|
||||
after = ["upfast.service"];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "upfast";
|
||||
Group = "upfast";
|
||||
WorkingDirectory = "/var/lib/upfast";
|
||||
};
|
||||
|
||||
script = "${./upfast-cleaner.sh} 'http://localhost:8383'";
|
||||
};
|
||||
|
||||
systemd.timers.upfast-cleaner = {
|
||||
enable = true;
|
||||
timerConfig = {
|
||||
OnBootSec = "1m";
|
||||
OnUnitActiveSec = "1m";
|
||||
};
|
||||
wantedBy = ["timers.target"];
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.upfast.loadBalancer.servers = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue