Minecraft world download flow
This commit is contained in:
@@ -4,4 +4,10 @@
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-25.11
|
||||
|
||||
java -Xmx8192M -Xms6144M -jar minecraft_server.jar nogui
|
||||
|
||||
read -rp "Pack and publish world? [y/N] " answer
|
||||
if [[ "$answer" =~ ^[Yy]$ ]]; then
|
||||
/home/h3lp/mineserver/packworld.sh
|
||||
fi
|
||||
|
||||
read -rp "Press Enter to continue..."
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash --pure
|
||||
#! nix-shell -p gnutar xz
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-25.11
|
||||
|
||||
set -e
|
||||
|
||||
WORLD=/home/h3lp/mineserver/world
|
||||
OUTPUT=/var/www/hostedfiles/world.tar.xz
|
||||
TMP=$(mktemp)
|
||||
|
||||
tar -cJf "$TMP" -C "$WORLD" .
|
||||
mv "$TMP" "$OUTPUT"
|
||||
|
||||
echo "Done: $OUTPUT"
|
||||
@@ -127,6 +127,7 @@
|
||||
curl
|
||||
unzip
|
||||
xz
|
||||
nginx
|
||||
];
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
@@ -218,4 +219,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."_" = {
|
||||
root = "/var/www/hostedfiles";
|
||||
locations."/" = {
|
||||
extraConfig = "autoindex on;";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/www/hostedfiles 0755 h3lp h3lp -"
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user