Compare commits

...

10 commits

Author SHA1 Message Date
08c563b398 alpine-ify 2024-10-13 20:46:54 -04:00
049866de88 Randomize port (part 2) 2024-10-13 00:25:27 -04:00
9b8cf7eb57 fix alivechecker 2024-08-04 00:34:02 -04:00
c3b3dc9ea8 move log4j config (part 1) 2024-06-14 11:33:39 -04:00
be26cd6a5d edit server script 2024-06-14 11:33:16 -04:00
e5b600de1d fix 2024-06-14 00:54:44 -04:00
3256647585 patch log4shell 2024-06-14 00:50:13 -04:00
6e15159ca6 moar ram 2024-06-14 00:14:43 -04:00
4a0e206f09 update stuff 2024-06-13 23:51:04 -04:00
14adfefa61 update the iptables config 2024-06-13 23:42:25 -04:00
5 changed files with 16 additions and 23 deletions

View file

@ -2,7 +2,7 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
# Start the Minecraft server after an OS reboot
@reboot su kaboom -c '~/framework/script/init.sh'
@reboot su infinite -c '~/framework/script/init.sh'
# Reset and reboot the server every 24 hours (0 0 * * * / at 00:00)
0 0 * * * su kaboom -c '~/framework/script/reset.sh && ~/framework/script/init.sh'
0 0 * * * su infinite -c '~/framework/script/reset.sh && ~/framework/script/init.sh'

View file

@ -1,11 +1,9 @@
# IPv4
iptables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 192.168.1.0-192.168.100.100
iptables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 192.168.1.0-192.168.100.100
iptables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset
iptables-save > /etc/iptables/rules.v4
iptables -t nat -A INPUT -p tcp --dport 27801 -j SNAT --to-source 192.168.1.0-192.168.100.100
iptables -A INPUT -p tcp --syn --dport 27801 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset
iptables-save > /etc/iptables/rules-save
# IPv6
ip6tables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 2001:db8::1-2001:db8::6464
ip6tables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 2001:db8::1-2001:db8::6464
ip6tables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset
ip6tables-save > /etc/iptables/rules.v6
ip6tables -t nat -A INPUT -p tcp --dport 27801 -j SNAT --to-source 2001:db8::1-2001:db8::6464
ip6tables -A INPUT -p tcp --syn --dport 27801 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset
ip6tables-save > /etc/iptables/rules6-save

View file

@ -10,7 +10,7 @@ while true; do
# If the server doesn't respond to ping, kill it
if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 25565 | wc -m)" -eq 0 ]; then
if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 27801 | wc -m)" -eq 0 ]; then
pkill -9 java
echo $(date) >> ~/kill.log
else

View file

@ -7,10 +7,10 @@
# checker in the background
cd ~/
rm kaboom schematics
rm infinite schematics
while true; do
dtach -n kaboom ~/framework/script/server.sh > /dev/null 2>&1
dtach -n schematics ~/framework/script/schematics.sh > /dev/null 2>&1
dtach -n infinite ~/framework/script/server.sh > /dev/null 2>&1
# dtach -n schematics ~/framework/script/schematics.sh > /dev/null 2>&1
sleep 5
done &

View file

@ -23,18 +23,12 @@ while true; do
# Make certain files and folders read-only
mkdir debug/ dumps/ plugins/update/
chmod -R 500 debug/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/update/
chmod 500 plugins/
chmod 400 bukkit.yml
chmod 400 commands.yml
mkdir debug/ dumps/
chmod -R 500 debug/ dumps/
chmod 500 mods/
chmod 400 eula.txt
chmod 400 paper.yml
chmod 400 permissions.yml
chmod 400 server-icon.png
chmod 400 server.properties
chmod 400 spigot.yml
chmod 400 wepif.yml
# Start alive checker
@ -73,6 +67,7 @@ while true; do
-DIReallyKnowWhatIAmDoingISwear \
-Dusing.aikars.flags=https://mcflags.emc.gs \
-Daikars.new.flags=true \
-Dlog4j.configurationFile=log4j2_112-116.xml \
-jar server.jar nogui
# Stop alive checker (will be started again on the next run)