middle of big leap

This commit is contained in:
godot 2024-07-26 01:17:34 +02:00
parent c9369a0c6c
commit f22545f896
2 changed files with 22 additions and 80 deletions

View File

@ -1,22 +1,23 @@
## The Plan
- [x] walkthruw
- [ ] prototype
- [x] prototype
- [ ] clean it
- [ ] script it
- [x] addons for Forge
## To DO!
- [ ] Firewall shinanigns
- [ ] Auto add plugins
- [ ] Proxmox admin acces in firewall
- [x] Auto add plugins
- [ ] Config of velocity.toml
- [ ] IP || Tailscale DNS + zapis
- [ ] plugins/ambassador/Ambassador.toml config
- [ ] IP
- [ ] Comments of what is doing what
- [ ] Tailscale
## To learn
- [ ] What content of start.sh means
- [x] What content of start.sh means
- [ ] Different types of forwarding
- [ ] SkinRestorer???
- [ ] DinMap
- [ ] Requred resources
- [ ] In their docs they have Tuning and Configuration pages
- [ ] In their docs they have Configuration pages

View File

@ -18,10 +18,12 @@ if [[ "$ansFirewallSetup" =~ ("N"|"n") ]]; then
elif [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z $ansFirewallSetup ]]; then
printf "Do you want to block non-LAN ssh connections? [Y/n/castom]: "
printf "Do you want to block non-VPN ssh connections? [Y/n/castom]: "
read sshBlockRange
### needs update from LAN to VPN
if [[ $sshBlockRange =~ ("n"|"N") ]]; then
printf "+ OK, working on next bit\n"
@ -30,7 +32,7 @@ elif [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z $ansFirewallSetup ]]; then
elif [[ $sshBlockRange =~ ("y"|"Y") || -z $sshBlockRange ]]; then
#Pipes all informations about ip interfaces
ipList=$(ip -o -4 a show scope global)
ipList=$(ip -o -4 a show tailscale0)
#Founds data in pattern
ipList=$(echo $ipList | grep -Eo "([0-9]*\.){3}[0-9]*/[0-9]*")
@ -51,56 +53,7 @@ elif [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z $ansFirewallSetup ]]; then
fi
fi
### RAM ### needs to update
printf "How much of RAM are you willing to allocate in GB (Max) [4G/?G]: \n"
read maxRam
printf "How little you want to let RAM go down to in GB (Min) [1G/?G]: \n"
read minRam
if [[ "$minRam" > "$maxRam" ]]; then
pritf "\n You allocated too low max ram or too much min ram. Manual intervention at the end will be needed\n"
echo "-Xmx?G # in place of ? put number of RAM you want to set ass maximum"
$maxRam="Error"
elif [[ "$maxRam" =~ ("G"|"M") ]]; then
printf "\n+ Allocating $maxRam as RAM maximum."
echo "-Xmx$maxRam" >> data/user_jvm_args.txt
elif [[ -z $maxRam ]]; then
$maxRam=4G
printf "\n+ Allocating $MaxRam as RAM maximum"
echo "-Xmx$maxRam" >> data/user_jvm_args.txt
elif [[ ! "$maxRam" =~ ("G"|"MB") ]]; then
printf "\n+ Allocating ${maxRam}G as RAM maximum"
echo "-Xmx${maxRam}G" >> data/user_jvm_args.txt
else
pritnf "\n \n!!! Sorry I have no idea what are you trying to do :/ Manual intervention will be needed at the end \n"
$maxRam="Error"
echo "-Xmx?G # in place of ? put number of RAM you want to set ass maximum"
fi
if [[ "$minRam" > "$maxRam" ]]; then
echo "-Xms?G # in place of ? put number of RAM you want to se ass minimum"
elif [[ "$minRam" =~ ("G"|"M") ]]; then
printf "\n+ Allocating $minRam as RAM minimum."
echo "-Xms$minRam" >> data/user_jvm_args.txt
elif [[ -z $minRam ]]; then
$minRam=1G
printf "\n+ Allocating $minRam as RAM minimum"
echo "-Xms$minRam" >> data/user_jvm_args.txt
elif [[ ! "$minRam" =~ ("G"|"MB") ]]; then
printf "Allocating ${minRam}G as RAM maximum"
echo "-Xms${minRam}G" >> data/user_jvm_args.txt
else
pritnf "\n!!! Sorry I have no idea what are you trying to do :/ Manual intervention will be needed at the end \n"
$minRam="Error"
echo "-Xms?G # in place of ? put number of RAM you want to set ass minimum"
fi
### Update ### need update
### Update ###
sleep 2
@ -163,9 +116,7 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #Allow continuing connections
iptables -A INPUT -p tcp --dport 22 --source $ipList -j ACCEPT #Allow ssh from set network
iptables -A INPUT -p tcp --dport 25565 -j ACCEPT #Allow MC port
iptables -A INPUT -p tcp --dport 25577 -j ACCEPT #Allow MC port
iptables -L ### Good place to paste a manual check to not lock yourself out
@ -190,27 +141,17 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
fi
fi
### Error handeling ### needs update
if [[ "$minRam" = "Error" || "$maxRam" = "Error" ]]; then
### Start service ### needs update
printf "\n Encountred some eror in Ram settings"
pritnf "\n Manual configuration needed"
printf "\n Open /opt/minecraft/user_jvm_args.txt in your favorite editor. File contains more instructions"
else
printf "Do you want to start server right now? [Y/n]: \n"
read startServer
if [[ "$startServer" =~ ("y"|"Y") || -z $startServer ]]; then
systemctl start mc-forge.serice
fi
systemctl enable mc-forge
printf "Do you want to start server right now? [Y/n]: \n"
read startServer
if [[ "$startServer" =~ ("y"|"Y") || -z $startServer ]]; then
systemctl start mc-forge.serice
fi
systemctl enable mc-forge
printf "\n+ Done, thanks for your time. It is goode idea to chack if everythink is alright by running:"
### needs update
printf "\nsystemctl status mc-forge"
printf "\nsu minecraft -s /bin/bash"
printf "\n+ it is good idea to have some fun with screen before trying to open minecraft conesole 'screen -r' while loged wia minecraft user"