forked from beyond-all-reason/spads_config_bar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installation_steps.txt
128 lines (109 loc) · 4.47 KB
/
Installation_steps.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Set the name of the user who will be running spads et al
export SPADSUSERNAME="debian"
export ENGINEGITHUBPATH="https://github.com/beyond-all-reason/spring/releases/download/spring_bar_%7BBAR105%7D105.1.1-1544-g058c8ea/spring_bar_.BAR105.105.1.1-1544-g058c8ea_linux-64-minimal-portable.7z"
export ENGINEDIR="spring_bar_.BAR105.105.1.1-1544-g058c8ea_linux-64-minimal-portable"
adduser debian
usermod -aG sudo debian
apt-get install sudo
# - init 1 minutes
sudo apt-get -y install htop byobu mc p7zip g++ swig locate rclone git python3-dev cpanminus p7zip-full python3-distutils make sshpass libffi-platypus-perl libdbd-sqlite3-perl
#- Make the swap file: 1 minute
cd /var
sudo touch swap.img
sudo chmod 600 swap.img
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=4000
sudo mkswap /var/swap.img
sudo swapon /var/swap.img
sudo su -c "echo '/var/swap.img swap swap defaults 0 0' >> /etc/fstab"
sudo sysctl vm.swappiness=10
sudo su -c "echo 'vm.swappiness=10' >> /etc/sysctl.conf"
#- clone the updater 1 min
mkdir -p ~/spads/var/spring
mkdir -p ~/spads/var/plugins
mkdir -p ~/spads/etc
cd ~/spads
git clone https://github.com/beyond-all-reason/spads_config_bar.git
cd spads_config_bar/
python3 spads_config_bar_updater.py -s
# GRAB DESIRED ENGINE
python3 spads_config_bar_updater.py -u $ENGINEGITHUBPATH
# install SPADS
# HAVE PATH TO ENGINE READY ON CLIPBOARD
cd ~
sudo cpanm https://github.com/niner/inline-python-pm.git
mkdir spads
cd spads
wget http://planetspads.free.fr/spads/installer/spadsInstaller.tar
tar -xvf spadsInstaller.tar
./spadsInstaller.pl
# install spads with _all_ default settings
# official fails for some reason, it cant find spring install, you gotta manually do it, so run python3 spads_config_bar_updater.py -s -u [latest github release]
# and then relaunch
#- rclone config 3 mins
curl -sL https://raw.githubusercontent.com/wimpysworld/deb-get/main/deb-get | sudo -E bash -s install deb-get
deb-get update
deb-get install rclone
rclone config
#
# select new
# name: BYAR-maps
# storage type: 18 (drive)
# no client id
# no client secret
# access type: 2 (drive.readonly)
# service accoutn file: blank
# Edit advanced config: n
# Use auto config: n
# Use Browser?: N
# launch rclone config on machine with web browser
# copy
# Configure this as team drive: n
# yes this is ok: y
# q for quit
rclone sync --drive-shared-with-me BYAR-maps:BYAR-maps ~/spads/var/spring/data/maps/
# edit cluster launcher template
cp ~/spads/spads_config_bar/etc/spads_cluster_launcher.sh.template ~/spads/etc/spads_cluster_launcher.sh
chmod +x ~/spads/etc/spads_cluster_launcher.sh
nano ~/spads/etc/spads_cluster_launcher.sh
#get latest engine
python3 spads_config_bar_updater.py -c -u $ENGINEGITHUBPATH
#copy pr-dler to ~/spads
cp ~/spads/var/spring/$ENGINEDIR/pr-downloader ~/spads/
/home/$SPADSUSERNAME/spads/pr-downloader --filesystem-writepath /home/$SPADSUSERNAME/spads/var/spring/data byar:test
# Systemd services and timers:
cd ~/spads/spads_config_bar/
python3 spads_config_bar_updater.py -s
sudo cp *.service ~/spads
sudo cp *.timer ~/spads
cd ~/spads
for systemdfile in rclone-maps.service rclone-maps.timer pr-downloader.service pr-downloader.timer spads_config_updater.service spads_config_updater.timer; do sudo sed -i "s/ubuntu/$SPADSUSERNAME/g" $systemdfile; done
# copy them into services
sudo cp *.service /etc/systemd/system
sudo cp *.timer /etc/systemd/system
# enable servixes, about 10-15 mins on first start, cause rclone-maps is slow
sudo systemctl daemon-reload
sudo systemctl start rclone-maps.service
sudo systemctl start pr-downloader.service
sudo systemctl start spads_config_updater.service
sudo systemctl daemon-reload
sudo systemctl enable --now pr-downloader.timer
sudo systemctl enable --now rclone-maps.timer
sudo systemctl enable --now spads_config_updater.timer
sudo systemctl daemon-reload
#replay upload:
#add these to the users .bashrc as env vars
sudo nano ~/.bashrc
#copy these:
#export SFTP_PASSWORD="@CHANGEME"
#export SFTP_LOGIN="beherith"
# UPDATE SpringLobbyInterface
cd ~/spads/
ln -sf SpringLobbyInterface_0.42a.pm SpringLobbyInterface.pm
# start it, like 15 minutes first start :/
byobu
cd ~/spads/etc/
./spads_cluster_launcher.sh
# further things/ todo:
# - set up glances, start it from crontab as glances -w for quick view on port 61208
# - set up replay-deleter, which every week, should delete replays older than 1 month
# - set up log-rotator, which every week, should zip up logs, and delete the old ones (maybe use logrotate?)