middle of big leap
This commit is contained in:
parent
c9369a0c6c
commit
f22545f896
15
README.md
15
README.md
@ -1,22 +1,23 @@
|
|||||||
## The Plan
|
## The Plan
|
||||||
- [x] walkthruw
|
- [x] walkthruw
|
||||||
- [ ] prototype
|
- [x] prototype
|
||||||
- [ ] clean it
|
- [ ] clean it
|
||||||
- [ ] script it
|
- [ ] script it
|
||||||
- [x] addons for Forge
|
- [x] addons for Forge
|
||||||
|
|
||||||
## To DO!
|
## To DO!
|
||||||
- [ ] Firewall shinanigns
|
- [ ] Firewall shinanigns
|
||||||
- [ ] Auto add plugins
|
- [ ] Proxmox admin acces in firewall
|
||||||
|
- [x] Auto add plugins
|
||||||
- [ ] Config of velocity.toml
|
- [ ] Config of velocity.toml
|
||||||
- [ ] IP || Tailscale DNS + zapis
|
- [ ] IP
|
||||||
- [ ] plugins/ambassador/Ambassador.toml config
|
- [ ] Comments of what is doing what
|
||||||
|
- [ ] Tailscale
|
||||||
|
|
||||||
## To learn
|
## To learn
|
||||||
- [ ] What content of start.sh means
|
- [x] What content of start.sh means
|
||||||
- [ ] Different types of forwarding
|
- [ ] Different types of forwarding
|
||||||
- [ ] SkinRestorer???
|
- [ ] SkinRestorer???
|
||||||
- [ ] DinMap
|
- [ ] DinMap
|
||||||
- [ ] Requred resources
|
- [ ] Requred resources
|
||||||
- [ ] In their docs they have Tuning and Configuration pages
|
- [ ] In their docs they have Configuration pages
|
||||||
|
|||||||
75
script.sh
75
script.sh
@ -18,10 +18,12 @@ if [[ "$ansFirewallSetup" =~ ("N"|"n") ]]; then
|
|||||||
|
|
||||||
elif [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z $ansFirewallSetup ]]; 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
|
read sshBlockRange
|
||||||
|
|
||||||
|
|
||||||
|
### needs update from LAN to VPN
|
||||||
|
|
||||||
if [[ $sshBlockRange =~ ("n"|"N") ]]; then
|
if [[ $sshBlockRange =~ ("n"|"N") ]]; then
|
||||||
|
|
||||||
printf "+ OK, working on next bit\n"
|
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
|
elif [[ $sshBlockRange =~ ("y"|"Y") || -z $sshBlockRange ]]; then
|
||||||
|
|
||||||
#Pipes all informations about ip interfaces
|
#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
|
#Founds data in pattern
|
||||||
ipList=$(echo $ipList | grep -Eo "([0-9]*\.){3}[0-9]*/[0-9]*")
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### RAM ### needs to update
|
### 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
|
|
||||||
|
|
||||||
sleep 2
|
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 -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 25577 -j ACCEPT #Allow MC port
|
||||||
|
|
||||||
iptables -A INPUT -p tcp --dport 25565 -j ACCEPT #Allow MC port
|
|
||||||
|
|
||||||
iptables -L ### Good place to paste a manual check to not lock yourself out
|
iptables -L ### Good place to paste a manual check to not lock yourself out
|
||||||
|
|
||||||
@ -190,14 +141,7 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Error handeling ### needs update
|
### Start service ### needs update
|
||||||
if [[ "$minRam" = "Error" || "$maxRam" = "Error" ]]; then
|
|
||||||
|
|
||||||
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"
|
printf "Do you want to start server right now? [Y/n]: \n"
|
||||||
read startServer
|
read startServer
|
||||||
@ -208,9 +152,6 @@ else
|
|||||||
|
|
||||||
systemctl enable mc-forge
|
systemctl enable mc-forge
|
||||||
|
|
||||||
fi
|
### needs update
|
||||||
|
|
||||||
printf "\n+ Done, thanks for your time. It is goode idea to chack if everythink is alright by running:"
|
|
||||||
printf "\nsystemctl status mc-forge"
|
printf "\nsystemctl status mc-forge"
|
||||||
printf "\nsu minecraft -s /bin/bash"
|
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"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user