Update INSTALLATION.md for updated mongodb, nvm.sh script, nginx installation method

Update nginx.sh config script to change how geoip is downloaded
Update ecosystem config to increase cores used by chan and build-worker
merge-requests/341/head
Thomas Lynch 5 months ago
parent 1d0b38ecf2
commit bde2f25a42
Signed by: fatchan
GPG Key ID: A7E5E8B7E11EE92D
  1. 1
      CHANGELOG.md
  2. 22
      INSTALLATION.md
  3. 16
      configs/nginx/nginx.sh
  4. 4
      ecosystem.config.js

@ -1,4 +1,5 @@
### 1.4.1
- Update the INSTALLATION.md (install instructions).
- Add a "Bypass DNSBL" account/role permission.
- Add a "Bypass Anonymizer Restrictions" account/role permission.
- Update dependencies.

@ -27,7 +27,7 @@
```bash
sudo apt update -y
sudo apt install curl wget gnupg nginx ffmpeg imagemagick graphicsmagick python3-certbot-nginx fontconfig fonts-dejavu -y
sudo apt install curl wget libgeoip-dev gnupg ffmpeg imagemagick graphicsmagick fontconfig fonts-dejavu -y
```
**3. Install MongoDB**
@ -40,10 +40,9 @@ Please ensure your hardware is supported before reporting issues. The complete p
[MongoDB Installation](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/#install-mongodb-community-edition-on-debian):
```bash
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian $(lsb_release -sc)/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update -y
sudo apt install -y mongodb-org
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian $(lsb_release -sc)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
hsudo apt install -y mongodb-org
sudo systemctl enable --now mongod
```
@ -94,7 +93,7 @@ sudo systemctl restart redis-server
For easy installation, use [node version manager](https://github.com/nvm-sh/nvm#installing-and-updating) "nvm":
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
@ -120,6 +119,10 @@ HiddenServicePort 80 unix:/var/run/nginx-tor.sock
EOF
sudo systemctl restart tor
until [ -f /var/lib/tor/jschan/hostname ]
do
sleep 1
done
sudo cat /var/lib/tor/jschan/hostname
```
@ -158,6 +161,13 @@ Note down the .loki and .onion address for the next step.
For standard installations, run `configs/nginx/nginx.sh`. This will prompt you for installation directory, domains, onion/lokinet, enable geoip, install a letsencrypt certificate with certbot and more:
```bash
wget https://raw.githubusercontent.com/fatchan/nginx-autoinstall/master/nginx-autoinstall.sh
chmod +x nginx-autoinstall.sh
sudo su
HEADLESS=y OPTION=1 NGINX_VER=STABLE SUBFILTER=y RTMP=y ./nginx-autoinstall.sh
echo "You can safely ignore that error about restarting nginx ^"
exit
rm nginx-autoinstall.sh
sudo bash configs/nginx/nginx.sh
```

@ -279,17 +279,17 @@ if [ "$GEOIP" == "y" ]; then
echo "Downloading and installing geoip database for nginx..."
#download geoip data
cd /usr/share/GeoIP
mv GeoIP.dat GeoIP.dat.bak
wget --retry-connrefused https://dl.miyuru.lk/geoip/dbip/country/dbip.dat.gz
gunzip dbip.dat.gz
mv dbip.dat GeoIP.dat
chown www-data:www-data /usr/share/GeoIP/GeoIP.dat
wget --retry-connrefused -qO- "https://download.db-ip.com/free/dbip-country-lite-`date +%Y-%m`.mmdb.gz" | tee "/usr/share/GeoIP/dbip.mmdb.gz" >/dev/null
gunzip "/usr/share/GeoIP/dbip.mmdb.gz"
#add goeip_country to /etc/nginx/nginx.conf, only if not already exists
grep -qF "geoip_country" /etc/nginx/nginx.conf
grep -qF "geoip2" /etc/nginx/nginx.conf
if [ $? -eq 1 ]; then
sudo sed -i '/http {/a \
geoip_country /usr/share/GeoIP/GeoIP.dat;' /etc/nginx/nginx.conf
geoip2 /usr/share/GeoIP/dbip.mmdb {\
auto_reload 5m;\
$geoip2_data_country_code default=unknown source=$remote_addr country iso_code;\
$geoip2_data_country_name country names en;\
}' /etc/nginx/nginx.conf
fi
else
echo "Geoip not installed, removing directives..."

@ -4,7 +4,7 @@ module.exports = {
apps : [{
name: 'build-worker',
script: 'worker.js',
instances: Math.floor(numCpus/2),
instances: Math.ceil(numCpus*0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',
@ -21,7 +21,7 @@ module.exports = {
}, {
name: 'chan',
script: 'server.js',
instances: Math.floor(numCpus/2),
instances: Math.ceil(numCpus*0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',

Loading…
Cancel
Save