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/346/merge
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 ### 1.4.1
- Update the INSTALLATION.md (install instructions).
- Add a "Bypass DNSBL" account/role permission. - Add a "Bypass DNSBL" account/role permission.
- Add a "Bypass Anonymizer Restrictions" account/role permission. - Add a "Bypass Anonymizer Restrictions" account/role permission.
- Update dependencies. - Update dependencies.

@ -27,7 +27,7 @@
```bash ```bash
sudo apt update -y 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** **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): [MongoDB Installation](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/#install-mongodb-community-edition-on-debian):
```bash ```bash
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - 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/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list 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
sudo apt update -y hsudo apt install -y mongodb-org
sudo apt install -y mongodb-org
sudo systemctl enable --now mongod 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": For easy installation, use [node version manager](https://github.com/nvm-sh/nvm#installing-and-updating) "nvm":
```bash ```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" export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
@ -120,6 +119,10 @@ HiddenServicePort 80 unix:/var/run/nginx-tor.sock
EOF EOF
sudo systemctl restart tor sudo systemctl restart tor
until [ -f /var/lib/tor/jschan/hostname ]
do
sleep 1
done
sudo cat /var/lib/tor/jschan/hostname 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: 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 ```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 sudo bash configs/nginx/nginx.sh
``` ```

@ -279,17 +279,17 @@ if [ "$GEOIP" == "y" ]; then
echo "Downloading and installing geoip database for nginx..." echo "Downloading and installing geoip database for nginx..."
#download geoip data #download geoip data
cd /usr/share/GeoIP cd /usr/share/GeoIP
mv GeoIP.dat GeoIP.dat.bak 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
wget --retry-connrefused https://dl.miyuru.lk/geoip/dbip/country/dbip.dat.gz gunzip "/usr/share/GeoIP/dbip.mmdb.gz"
gunzip dbip.dat.gz
mv dbip.dat GeoIP.dat
chown www-data:www-data /usr/share/GeoIP/GeoIP.dat
#add goeip_country to /etc/nginx/nginx.conf, only if not already exists #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 if [ $? -eq 1 ]; then
sudo sed -i '/http {/a \ 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 fi
else else
echo "Geoip not installed, removing directives..." echo "Geoip not installed, removing directives..."

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

Loading…
Cancel
Save