ready for test
This commit is contained in:
parent
f19452ddd3
commit
03b0ee5c7f
13
README.md
13
README.md
@ -1,19 +1,20 @@
|
|||||||
## The Plan
|
## The Plan
|
||||||
- [x] walkthruw
|
- [x] walkthruw
|
||||||
- [x] prototype
|
- [x] prototype
|
||||||
- [ ] clean it
|
- [*] clean it
|
||||||
- [ ] script it
|
- [*] script it
|
||||||
- [x] addons for Forge
|
- [x] addons for Forge
|
||||||
|
- [ ] test that bitch
|
||||||
|
|
||||||
## To DO!
|
## To DO!
|
||||||
- [*] Firewall shinanigns
|
- [*] Firewall shinanigns
|
||||||
- [*] Proxmox admin acces in firewall
|
- [*] Proxmox admin acces in firewall
|
||||||
- [x] Auto add plugins
|
- [x] Auto add plugins
|
||||||
- [*] SystemD service
|
- [*] SystemD service
|
||||||
- [ ] Config of velocity.toml
|
- [ *] Config of velocity.toml
|
||||||
- [ ] IP
|
- [*] IP
|
||||||
- [*] Tailscale
|
- [*] Tailscale
|
||||||
- [ ] Comments of what is doing what
|
- [*] Comments of what is doing what
|
||||||
|
|
||||||
## To learn
|
## To learn
|
||||||
- [x] What content of start.sh means
|
- [x] What content of start.sh means
|
||||||
@ -21,4 +22,4 @@
|
|||||||
- [ ] Different types of forwarding
|
- [ ] Different types of forwarding
|
||||||
- [ ] SkinRestorer???
|
- [ ] SkinRestorer???
|
||||||
- [ ] DinMap
|
- [ ] DinMap
|
||||||
- [ ] In their docs they have pages
|
- [*] In their docs they have pages
|
||||||
|
|||||||
@ -6,7 +6,7 @@ bind = "0.0.0.0:25577"
|
|||||||
|
|
||||||
# What should be the MOTD? This gets displayed when the player adds your server to
|
# What should be the MOTD? This gets displayed when the player adds your server to
|
||||||
# their server list. Only MiniMessage format is accepted.
|
# their server list. Only MiniMessage format is accepted.
|
||||||
motd = "<#09add3>A Velocity Server"
|
motd = "<#e609ab>0-life perfect server"
|
||||||
|
|
||||||
# What should we display for the maximum number of players? (Velocity does not support a cap
|
# What should we display for the maximum number of players? (Velocity does not support a cap
|
||||||
# on the number of players online.)
|
# on the number of players online.)
|
||||||
@ -72,7 +72,7 @@ enable-player-address-logging = true
|
|||||||
[servers]
|
[servers]
|
||||||
# Configure your servers here. Each key represents the server's name, and the value
|
# Configure your servers here. Each key represents the server's name, and the value
|
||||||
# represents the IP address of the server to connect to.
|
# represents the IP address of the server to connect to.
|
||||||
main = "192.168.0.119:25565"
|
main = "192.168.0.21:25565"
|
||||||
# factions = "127.0.0.1:30067"
|
# factions = "127.0.0.1:30067"
|
||||||
# minigames = "127.0.0.1:30068"
|
# minigames = "127.0.0.1:30068"
|
||||||
|
|
||||||
|
|||||||
37
script.sh
37
script.sh
@ -24,11 +24,11 @@ elif [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z $ansFirewallSetup ]]; then
|
|||||||
|
|
||||||
if [[ "$sshBlockRange" =~ ("n"|"N") ]]; then
|
if [[ "$sshBlockRange" =~ ("n"|"N") ]]; then
|
||||||
|
|
||||||
printf "If you want input your own IP range [N/range]\n"
|
printf "If you want, input your own IP range [N/range]\n"
|
||||||
read sshRange
|
read sshRange
|
||||||
|
|
||||||
if [[ "$sshRange" =~ ("n"|"N") || -z $sshRange ]]; then
|
if [[ "$sshRange" =~ ("n"|"N") || -z $sshRange ]]; then
|
||||||
printf "+ Making your SSH connections wide and open. Think about it. /n"
|
printf "+ Making your SSH connections wide and open. After we are done, do somethink with it. /n"
|
||||||
ipList="*"
|
ipList="*"
|
||||||
else
|
else
|
||||||
printf "+ Accepting SSH connections only on these ip's: $sshRange\n"
|
printf "+ Accepting SSH connections only on these ip's: $sshRange\n"
|
||||||
@ -42,8 +42,12 @@ fi
|
|||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
|
printf "+ Updating your base system\n"
|
||||||
|
|
||||||
apt update && apt upgrade -y
|
apt update && apt upgrade -y
|
||||||
|
|
||||||
|
printf "+ Installing depandencies \n"
|
||||||
|
|
||||||
apt install openjdk-17-jre-headless screen
|
apt install openjdk-17-jre-headless screen
|
||||||
|
|
||||||
|
|
||||||
@ -53,6 +57,7 @@ fi
|
|||||||
|
|
||||||
### User managment
|
### User managment
|
||||||
|
|
||||||
|
printf "+ creating group and user for proxy \n"
|
||||||
groupadd velocity
|
groupadd velocity
|
||||||
|
|
||||||
useradd --system --shell /usr/sbin/nologin --home /opt/velocity -g velocity velocity
|
useradd --system --shell /usr/sbin/nologin --home /opt/velocity -g velocity velocity
|
||||||
@ -60,6 +65,7 @@ useradd --system --shell /usr/sbin/nologin --home /opt/velocity -g velocity velo
|
|||||||
|
|
||||||
### File structure
|
### File structure
|
||||||
|
|
||||||
|
printf "+ creating file structure in /opt/velocity/ \n"
|
||||||
mkdir /opt/velocity
|
mkdir /opt/velocity
|
||||||
|
|
||||||
mv data/velocity*.jar start.sh /opt/velocity/
|
mv data/velocity*.jar start.sh /opt/velocity/
|
||||||
@ -74,17 +80,18 @@ mv data/forwarding.secret /opt/velocity/
|
|||||||
|
|
||||||
### Permisions
|
### Permisions
|
||||||
|
|
||||||
|
printf "+ handeling permisions \n"
|
||||||
chown -R velocity:velocity /opt/velocity/
|
chown -R velocity:velocity /opt/velocity/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### SystemD service ### needs update
|
### SystemD service
|
||||||
printf "+ Preparign systemD service\n"
|
printf "+ Preparign systemD service\n"
|
||||||
mv data/mc-forge.service /etc/systemd/system/
|
mv data/mc-velocity.service /etc/systemd/system/
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
### integration of Maxopoly's instructions on firewall ### needs update
|
### integration of Maxopoly's instructions on firewall
|
||||||
|
|
||||||
if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
||||||
|
|
||||||
@ -102,13 +109,13 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
|||||||
|
|
||||||
### Wide and open
|
### Wide and open
|
||||||
|
|
||||||
iiptables -A INPUT -p tcp --dport 22 j ACCEPT
|
iiptables -A INPUT -p tcp --dport 22 j ACCEPT # Allow wide and open ssh on port 22
|
||||||
|
|
||||||
elif [[! "$ipList" -z ]]; then
|
elif [[! "$ipList" -z ]]; then
|
||||||
|
|
||||||
### Manual IP range
|
### Manual IP range
|
||||||
|
|
||||||
iptables -A INPUT -p tcp --dport 22 --source $ipList -j ACCEPT
|
iptables -A INPUT -p tcp --dport 22 --source $ipList -j ACCEPT # Allow limited ssh port 22
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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
|
||||||
@ -134,7 +141,7 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### tailsclae install ###
|
### tailsclae install
|
||||||
|
|
||||||
printf "Do you want to install Tailscale now? [Y/n]: \n"
|
printf "Do you want to install Tailscale now? [Y/n]: \n"
|
||||||
read ansTail
|
read ansTail
|
||||||
@ -146,26 +153,24 @@ if [[ "$ansTail" =~ ("y"|"Y") || -z $ansTail ]]; then
|
|||||||
|
|
||||||
if [[ "$sshBlockRange" =~ ("y"|"Y") || -z $sshBlockRange ]]; then
|
if [[ "$sshBlockRange" =~ ("y"|"Y") || -z $sshBlockRange ]]; then
|
||||||
tailscale up --ssh
|
tailscale up --ssh
|
||||||
|
|
||||||
else
|
else
|
||||||
tailscale up
|
tailscale up
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
### Start service ### needs update
|
### Start service
|
||||||
|
|
||||||
printf "Do you want to start server right now? [Y/n]: \n"
|
printf "Do you want to start velocity proxy right now? [Y/n]: \n"
|
||||||
read startServer
|
read startServer
|
||||||
|
|
||||||
if [[ "$startServer" =~ ("y"|"Y") || -z $startServer ]]; then
|
if [[ "$startServer" =~ ("y"|"Y") || -z $startServer ]]; then
|
||||||
systemctl start mc-forge.serice
|
systemctl start mc-velocity.serice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl enable mc-forge
|
systemctl enable mc-velocity
|
||||||
|
|
||||||
### needs update
|
printf "\n Everythink is now set up. It is good idea to check these:"
|
||||||
printf "\nsystemctl status mc-forge"
|
printf "\n systemctl status mc-velocity"
|
||||||
printf "\n su velocity -s /bin/bash"
|
printf "\n su velocity -s /bin/bash"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user