forked from switnet/quick-jibri-installer
Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
Luis Guzmán | 1638096ba7 | |
Luis Guzmán | 998ca69ddf | |
Luis Guzmán | 9a5364b2c6 | |
Luis Guzmán | a290c636ba | |
Luis Guzmán | 67442f6133 | |
Luis Guzmán | 2a58bdd8a6 | |
Luis Guzmán | b8b15b4e9c | |
Luis Guzmán | aec2d9898c | |
Luis Guzmán | f557e3cc2f | |
Luis Guzmán | a7a9768b6f | |
Luis Guzmán | cda665246e |
|
@ -119,4 +119,4 @@ Feel free to use our `test-jibri-env.sh` tool to find some details on your curre
|
||||||
|
|
||||||
Please note: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
Please note: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
||||||
|
|
||||||
SwITNet Ltd © - 2023, https://switnet.net/
|
SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Jibri Node Aggregator
|
# Jibri Node Aggregator
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
### 0_LAST EDITION TIME STAMP ###
|
### 0_LAST EDITION TIME STAMP ###
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# JVB2 Node Aggregator
|
# JVB2 Node Aggregator
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
### 0_LAST EDITION TIME STAMP ###
|
### 0_LAST EDITION TIME STAMP ###
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Etherpad Installer for Jitsi Meet
|
# Etherpad Installer for Jitsi Meet
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
#
|
#
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ echo '
|
||||||
########################################################################
|
########################################################################
|
||||||
by Software, IT & Networks Ltd
|
by Software, IT & Networks Ltd
|
||||||
'
|
'
|
||||||
|
FORGE_REPO="https://forge.switnet.net/switnet/quick-jibri-installer"
|
||||||
check_apt_policy() {
|
check_apt_policy() {
|
||||||
apt-cache policy 2>/dev/null| awk "/$1/{print \$3}" | awk -F '/' 'NR==1{print$2}'
|
apt-cache policy 2>/dev/null| awk "/$1/{print \$3}" | awk -F '/' 'NR==1{print$2}'
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,16 @@ if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")"
|
||||||
apt-get -yq2 install "$1"
|
apt-get -yq2 install "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
# Test for matches
|
||||||
|
test_match() {
|
||||||
|
if grep -q "$1" "$2" ; then
|
||||||
|
echo "$(basename "$2") - OK..."
|
||||||
|
else
|
||||||
|
echo "$(basename "$2"), FAIL..."
|
||||||
|
echo "Please report this to $FORGE_REPO"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
||||||
MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js"
|
MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js"
|
||||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
|
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
|
||||||
|
@ -50,6 +60,7 @@ ETHERPAD_DB_USER="dockerpad"
|
||||||
ETHERPAD_DB_NAME="etherpad"
|
ETHERPAD_DB_NAME="etherpad"
|
||||||
ETHERPAD_DB_PASS="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1)"
|
ETHERPAD_DB_PASS="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1)"
|
||||||
DOCKER_CE_REPO="$(check_apt_policy docker)"
|
DOCKER_CE_REPO="$(check_apt_policy docker)"
|
||||||
|
WS_CONF_MATCH1="# ensure all static content can always be found first"
|
||||||
|
|
||||||
echo "Add Docker repo"
|
echo "Add Docker repo"
|
||||||
if [ "$DOCKER_CE_REPO" = "stable" ]; then
|
if [ "$DOCKER_CE_REPO" = "stable" ]; then
|
||||||
|
@ -105,14 +116,14 @@ if [ "$(grep -c etherpad "$WS_CONF")" != 0 ]; then
|
||||||
echo "> Webserver seems configured, skipping..."
|
echo "> Webserver seems configured, skipping..."
|
||||||
elif [ -f "$WS_CONF" ]; then
|
elif [ -f "$WS_CONF" ]; then
|
||||||
echo "> Setting up webserver configuration file..."
|
echo "> Setting up webserver configuration file..."
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ #Etherpad block" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ #Etherpad block" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ location \^\~\ \/etherpad\/ {" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ location \^\~\ \/etherpad\/ {" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ \ \ \ \ proxy_pass http:\/\/localhost:9001\/;" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ \ \ \ \ proxy_pass http:\/\/localhost:9001\/;" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ \ \ \ \ proxy_set_header X-Forwarded-For \$remote_addr;" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ \ \ \ \ proxy_set_header X-Forwarded-For \$remote_addr;" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ \ \ \ \ proxy_buffering off;" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ \ \ \ \ proxy_buffering off;" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ }" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \ \ \ \ }" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \\\n" "$WS_CONF"
|
sed -i "/$WS_CONF_MATCH1/i \\\n" "$WS_CONF"
|
||||||
else
|
else
|
||||||
echo "> No etherpad config done to server file, please report to:
|
echo "> No etherpad config done to server file, please report to:
|
||||||
-> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
-> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Based on:
|
# Based on:
|
||||||
# - https://community.jitsi.org/t/118883
|
# - https://community.jitsi.org/t/118883
|
||||||
#
|
#
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
# Reset
|
# Reset
|
||||||
|
|
|
@ -0,0 +1,177 @@
|
||||||
|
# Nextcloud 28 nginx - configuration
|
||||||
|
upstream php-handler {
|
||||||
|
#server 127.0.0.1:9000;
|
||||||
|
server unix:/run/php/php_PHPVER-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
|
||||||
|
map $arg_v $asset_immutable {
|
||||||
|
"" "";
|
||||||
|
default "immutable";
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name _NC_DOMAIN;
|
||||||
|
# enforce https
|
||||||
|
return 301 https://\$server_name\$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen _NC_NGINX_SSL_PORT ssl http2;
|
||||||
|
listen [::]:_NC_NGINX_SSL_PORT ssl http2;
|
||||||
|
server_name _NC_DOMAIN;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
|
root _NC_PATH/;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/_NC_DOMAIN/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/_NC_DOMAIN/privkey.pem;
|
||||||
|
|
||||||
|
# Prevent nginx HTTP Server Detection
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
# HSTS settings
|
||||||
|
# WARNING: Only add the preload option once you read about
|
||||||
|
# the consequences in https://hstspreload.org/. This option
|
||||||
|
# will add the domain to a hardcoded list that is shipped
|
||||||
|
# in all major browsers and getting removed from this list
|
||||||
|
# could take several months.
|
||||||
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
|
||||||
|
|
||||||
|
# set max upload size and increase upload timeout:
|
||||||
|
client_max_body_size 512M;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
fastcgi_buffers 64 4K;
|
||||||
|
|
||||||
|
# Enable gzip but do not remove ETag headers
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_comp_level 4;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
||||||
|
gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
||||||
|
|
||||||
|
# Pagespeed is not supported by Nextcloud, so if your server is built
|
||||||
|
# with the `ngx_pagespeed` module, uncomment this line to disable it.
|
||||||
|
#pagespeed off;
|
||||||
|
|
||||||
|
# The settings allows you to optimize the HTTP2 bandwidth.
|
||||||
|
# See https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/
|
||||||
|
# for tuning hints
|
||||||
|
client_body_buffer_size 512k;
|
||||||
|
|
||||||
|
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
||||||
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Specify how to handle directories -- specifying `/index.php$request_uri`
|
||||||
|
# here as the fallback means that Nginx always exhibits the desired behaviour
|
||||||
|
# when a client requests a path that corresponds to a directory that exists
|
||||||
|
# on the server. In particular, if that directory contains an index.php file,
|
||||||
|
# that file is correctly served; if it doesn't, then the request is passed to
|
||||||
|
# the front-end controller. This consistent behaviour means that we don't need
|
||||||
|
# to specify custom rules for certain paths (e.g. images and other assets,
|
||||||
|
# `/updater`, `/ocs-provider`), and thus
|
||||||
|
# `try_files $uri $uri/ /index.php$request_uri`
|
||||||
|
# always provides the desired behaviour.
|
||||||
|
index index.php index.html /index.php$request_uri;
|
||||||
|
|
||||||
|
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
|
||||||
|
location = / {
|
||||||
|
if ( $http_user_agent ~ ^DavClnt ) {
|
||||||
|
return 302 /remote.php/webdav/$is_args$args;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /robots.txt {
|
||||||
|
allow all;
|
||||||
|
log_not_found off;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Make a regex exception for `/.well-known` so that clients can still
|
||||||
|
# access it despite the existence of the regex rule
|
||||||
|
# `location ~ /(\.|autotest|...)` which would otherwise handle requests
|
||||||
|
# for `/.well-known`.
|
||||||
|
location ^~ /.well-known {
|
||||||
|
# The rules in this block are an adaptation of the rules
|
||||||
|
# in `.htaccess` that concern `/.well-known`.
|
||||||
|
|
||||||
|
location = /.well-known/carddav { return 301 /remote.php/dav/; }
|
||||||
|
location = /.well-known/caldav { return 301 /remote.php/dav/; }
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
|
||||||
|
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
|
||||||
|
|
||||||
|
# Let Nextcloud's API for `/.well-known` URIs handle all other
|
||||||
|
# requests by passing them to the front-end controller.
|
||||||
|
return 301 /index.php$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Rules borrowed from `.htaccess` to hide certain paths from clients
|
||||||
|
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
|
||||||
|
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
|
||||||
|
|
||||||
|
# Ensure this block, which passes PHP files to the PHP process, is above the blocks
|
||||||
|
# which handle static assets (as seen below). If this block is not declared first,
|
||||||
|
# then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`
|
||||||
|
# to the URI, resulting in a HTTP 500 error response.
|
||||||
|
location ~ \.php(?:$|/) {
|
||||||
|
# Required for legacy support
|
||||||
|
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
|
||||||
|
|
||||||
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
|
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $path_info;
|
||||||
|
fastcgi_param HTTPS on;
|
||||||
|
|
||||||
|
fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
|
||||||
|
fastcgi_param front_controller_active true; # Enable pretty urls
|
||||||
|
fastcgi_pass php-handler;
|
||||||
|
|
||||||
|
fastcgi_intercept_errors on;
|
||||||
|
fastcgi_request_buffering off;
|
||||||
|
|
||||||
|
fastcgi_max_temp_file_size 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Serve static files
|
||||||
|
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
add_header Cache-Control "public, max-age=15778463, $asset_immutable";
|
||||||
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
|
||||||
|
location ~ \.wasm$ {
|
||||||
|
default_type application/wasm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.woff2?$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||||
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
}
|
||||||
|
|
||||||
|
# Rule borrowed from `.htaccess`
|
||||||
|
location /remote {
|
||||||
|
return 301 /remote.php$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php$request_uri;
|
||||||
|
}
|
||||||
|
}
|
37
grafana.sh
37
grafana.sh
|
@ -8,7 +8,7 @@
|
||||||
# by "mephisto"
|
# by "mephisto"
|
||||||
#
|
#
|
||||||
# Igor Kerstges © - 2021
|
# Igor Kerstges © - 2021
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
#
|
#
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
|
@ -43,11 +43,21 @@ systemctl enable "$1"
|
||||||
systemctl restart "$1"
|
systemctl restart "$1"
|
||||||
systemctl status "$1"
|
systemctl status "$1"
|
||||||
}
|
}
|
||||||
|
test_match() {
|
||||||
|
if grep -q "$1" "$2" ; then
|
||||||
|
echo "$(basename "$2") - OK..."
|
||||||
|
else
|
||||||
|
echo "$(basename "$2"), FAIL..."
|
||||||
|
echo "Please report this to https://forge.switnet.net/switnet/quick-jibri-installer"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
MAIN_TEL="/etc/telegraf/telegraf.conf"
|
MAIN_TEL="/etc/telegraf/telegraf.conf"
|
||||||
TEL_JIT="/etc/telegraf/telegraf.d/jitsi.conf"
|
TEL_JIT="/etc/telegraf/telegraf.d/jitsi.conf"
|
||||||
GRAFANA_INI="/etc/grafana/grafana.ini"
|
GRAFANA_INI="/etc/grafana/grafana.ini"
|
||||||
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
||||||
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
|
WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf"
|
||||||
|
WS_MATCH1="# ensure all static content can always be found first"
|
||||||
GRAFANA_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)"
|
GRAFANA_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)"
|
||||||
|
|
||||||
# Min requirements
|
# Min requirements
|
||||||
|
@ -57,11 +67,17 @@ apt-get install -y gnupg2 \
|
||||||
wget \
|
wget \
|
||||||
jq
|
jq
|
||||||
|
|
||||||
|
# Make sure we can rely on the match strings.
|
||||||
|
printf "> Testing match strings on config files.\n"
|
||||||
|
test_match "$WS_MATCH1" "$WS_CONF"
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
# Setup InfluxDB Packages
|
# Setup InfluxDB Packages
|
||||||
"
|
"
|
||||||
curl -s https://repos.influxdata.com/influxdata-archive.key > /etc/apt/trusted.gpg.d/influxdata-archive.key
|
curl -s https://repos.influxdata.com/influxdata-archive.key > \
|
||||||
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.key] https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
|
/etc/apt/trusted.gpg.d/influxdata-archive.key
|
||||||
|
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.key] https://repos.influxdata.com/debian buster stable" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/influxdb.list
|
||||||
apt-get update && apt-get install influxdb -y
|
apt-get update && apt-get install influxdb -y
|
||||||
run_service influxdb
|
run_service influxdb
|
||||||
|
|
||||||
|
@ -70,7 +86,8 @@ echo "
|
||||||
"
|
"
|
||||||
curl -s https://apt.grafana.com/gpg-full.key | \
|
curl -s https://apt.grafana.com/gpg-full.key | \
|
||||||
gpg --dearmor | tee /etc/apt/trusted.gpg.d/grafana-full-key.gpg >/dev/null
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/grafana-full-key.gpg >/dev/null
|
||||||
add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
|
echo "deb https://packages.grafana.com/oss/deb stable main" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/grafana_com_oss_deb.list
|
||||||
apt-get update && apt-get install grafana -y
|
apt-get update && apt-get install grafana -y
|
||||||
run_service grafana-server
|
run_service grafana-server
|
||||||
|
|
||||||
|
@ -138,11 +155,13 @@ echo '
|
||||||
# extra options to pass to the JVB daemon
|
# extra options to pass to the JVB daemon
|
||||||
JVB_OPTS="--apis=rest,xmpp"' >> /etc/jitsi/videobridge/config
|
JVB_OPTS="--apis=rest,xmpp"' >> /etc/jitsi/videobridge/config
|
||||||
sed -i "s|TRANSPORT=muc|TRANSPORT=muc,colibri|" /etc/jitsi/videobridge/sip-communicator.properties
|
sed -i "s|TRANSPORT=muc|TRANSPORT=muc,colibri|" /etc/jitsi/videobridge/sip-communicator.properties
|
||||||
|
# Enable videobridge REST API
|
||||||
|
hocon -f /etc/jitsi/videobridge/jvb.conf set videobridge.apis.rest.enabled true
|
||||||
systemctl restart jitsi-videobridge2
|
systemctl restart jitsi-videobridge2
|
||||||
|
|
||||||
echo -e "\n# Setup Grafana nginx domain\n"
|
echo -e "\n# Setup Grafana nginx domain\n"
|
||||||
sed -i "s|;protocol =.*|protocol = http|" $GRAFANA_INI
|
sed -i "s|;protocol =.*|protocol = http|" $GRAFANA_INI
|
||||||
sed -i "s|;http_addr =.*|http_addr = localhost|" $GRAFANA_INI
|
sed -i "s|;http_addr =.*|http_addr = 127.0.0.1|" $GRAFANA_INI
|
||||||
sed -i "s|;http_port =.*|http_port = 3000|" $GRAFANA_INI
|
sed -i "s|;http_port =.*|http_port = 3000|" $GRAFANA_INI
|
||||||
sed -i "s|;domain =.*|domain = $DOMAIN|" $GRAFANA_INI
|
sed -i "s|;domain =.*|domain = $DOMAIN|" $GRAFANA_INI
|
||||||
sed -i "s|;enforce_domain =.*|enforce_domain = false|" $GRAFANA_INI
|
sed -i "s|;enforce_domain =.*|enforce_domain = false|" $GRAFANA_INI
|
||||||
|
@ -160,10 +179,10 @@ while [ $secs -gt 0 ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f "$WS_CONF" ]; then
|
if [ -f "$WS_CONF" ]; then
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ location \~ \^\/(grafana\/|grafana\/login) {" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ location \~ \^\/(grafana\/|grafana\/login) {" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ \ \ \ \ proxy_pass http:\/\/localhost:3000;" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ \ \ proxy_pass http:\/\/localhost:3000;" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \ \ \ \ }" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ }" "$WS_CONF"
|
||||||
sed -i "/# ensure all static content can always be found first/i \\\n" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \\\n" "$WS_CONF"
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
else
|
else
|
||||||
echo "No app configuration done to server file, please report to:
|
echo "No app configuration done to server file, please report to:
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="0.00026458237mm"
|
||||||
|
height="0.00037725855mm"
|
||||||
|
viewBox="0 0 0.00026458237 0.00037725855"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
|
||||||
|
sodipodi:docname="watermark2.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:zoom="32.776423"
|
||||||
|
inkscape:cx="3.8442267"
|
||||||
|
inkscape:cy="9.4732729"
|
||||||
|
inkscape:window-width="1918"
|
||||||
|
inkscape:window-height="1008"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="layer1" />
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<g
|
||||||
|
inkscape:label="Capa 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-73.084889,-67.205357)">
|
||||||
|
<rect
|
||||||
|
style="fill:#8080ff;stroke:#ffffff;stroke-width:1"
|
||||||
|
id="rect1"
|
||||||
|
width="0"
|
||||||
|
height="0"
|
||||||
|
x="75.899414"
|
||||||
|
y="71.763123" />
|
||||||
|
<rect
|
||||||
|
style="fill:#8080ff;stroke:#ffffff;stroke-width:0.000112676;stroke-dasharray:none"
|
||||||
|
id="rect2"
|
||||||
|
width="0.00015190637"
|
||||||
|
height="0.00026458254"
|
||||||
|
x="73.084946"
|
||||||
|
y="67.205414" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Jitsi Meet recurring upgrader and customization keeper
|
# Jitsi Meet recurring upgrader and customization keeper
|
||||||
# for Debian/*buntu binaries.
|
# for Debian/*buntu binaries.
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
@ -42,7 +42,9 @@ apt_repo="/etc/apt/sources.list.d"
|
||||||
ENABLE_BLESSM="TBD"
|
ENABLE_BLESSM="TBD"
|
||||||
G_CHROME=$(apt-cache madison google-chrome-stable|awk '{print$3}'|cut -d. -f1-3)
|
G_CHROME=$(apt-cache madison google-chrome-stable|awk '{print$3}'|cut -d. -f1-3)
|
||||||
CHROMELAB_URL="https://googlechromelabs.github.io/chrome-for-testing"
|
CHROMELAB_URL="https://googlechromelabs.github.io/chrome-for-testing"
|
||||||
CHD_LTST_DWNL=$(curl -s $CHROMELAB_URL/known-good-versions-with-downloads.json | jq -r ".versions[].downloads.chromedriver | select(. != null) | .[].url" | grep linux64 | grep "$G_CHROME" | tail -1)
|
CHD_LTST_DWNL=$(curl -s $CHROMELAB_URL/known-good-versions-with-downloads.json | \
|
||||||
|
jq -r ".versions[].downloads.chromedriver | select(. != null) | .[].url" | \
|
||||||
|
grep linux64 | grep "$G_CHROME" | tail -1)
|
||||||
CHD_LTST=$(awk -F '/' '{print$7}' <<< "$CHD_LTST_DWNL")
|
CHD_LTST=$(awk -F '/' '{print$7}' <<< "$CHD_LTST_DWNL")
|
||||||
CHD_LTST_2D="$(cut -d "." -f 1,2 <<< "$CHD_LTST")"
|
CHD_LTST_2D="$(cut -d "." -f 1,2 <<< "$CHD_LTST")"
|
||||||
CHDB="$(whereis chromedriver | awk '{print$2}')"
|
CHDB="$(whereis chromedriver | awk '{print$2}')"
|
||||||
|
@ -123,6 +125,7 @@ update_nodejs_repo() {
|
||||||
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||||
apt-get install -q2 --only-upgrade <<< printf "${nodejs_package[@]}"
|
apt-get install -q2 --only-upgrade <<< printf "${nodejs_package[@]}"
|
||||||
}
|
}
|
||||||
|
check_latest_gc() {
|
||||||
printwc "${Purple}" "Checking for Google Chrome\n"
|
printwc "${Purple}" "Checking for Google Chrome\n"
|
||||||
if [ -f /usr/bin/google-chrome ]; then
|
if [ -f /usr/bin/google-chrome ]; then
|
||||||
GOOGL_VER_2D="$(/usr/bin/google-chrome --version|awk '{printf "%.1f\n", $NF}')"
|
GOOGL_VER_2D="$(/usr/bin/google-chrome --version|awk '{printf "%.1f\n", $NF}')"
|
||||||
|
@ -130,8 +133,11 @@ else
|
||||||
printwc "${Yellow}" " -> Seems there is no Google Chrome installed\n"
|
printwc "${Yellow}" " -> Seems there is no Google Chrome installed\n"
|
||||||
IS_GLG_CHRM="no"
|
IS_GLG_CHRM="no"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
check_latest_gc
|
||||||
upgrade_cd() {
|
upgrade_cd() {
|
||||||
if [ -n "$GOOGL_VER_2D" ]; then
|
if [ -n "$GOOGL_VER_2D" ]; then
|
||||||
|
check_latest_gc
|
||||||
if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" ; then
|
if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" ; then
|
||||||
echo "Upgrading Chromedriver to Google Chromes version"
|
echo "Upgrading Chromedriver to Google Chromes version"
|
||||||
wget -q "$CHD_LTST_DWNL" \
|
wget -q "$CHD_LTST_DWNL" \
|
||||||
|
@ -259,6 +265,10 @@ printwc "${Purple}" "========== Enable $NC_DOMAIN for sync client ==========\n"
|
||||||
echo "$NC_DOMAIN seems to be on place, skipping..."
|
echo "$NC_DOMAIN seems to be on place, skipping..."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Final check & upgrade call.
|
||||||
|
check_lst_cd
|
||||||
|
|
||||||
if [ "$JIBRI_NODE" = "yes" ]; then
|
if [ "$JIBRI_NODE" = "yes" ]; then
|
||||||
restart_jibri
|
restart_jibri
|
||||||
else
|
else
|
||||||
|
|
36
jm-bm.sh
36
jm-bm.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Jitsi Meet brandless mode
|
# Jitsi Meet brandless mode
|
||||||
# for Debian/*buntu binaries.
|
# for Debian/*buntu binaries.
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
@ -27,6 +27,7 @@ BUNDLE_JS="/usr/share/jitsi-meet/libs/app.bundle.min.js"
|
||||||
#
|
#
|
||||||
JM_IMG_PATH="/usr/share/jitsi-meet/images"
|
JM_IMG_PATH="/usr/share/jitsi-meet/images"
|
||||||
WTM2_PATH="$JM_IMG_PATH/watermark2.png"
|
WTM2_PATH="$JM_IMG_PATH/watermark2.png"
|
||||||
|
WTM2_SVG_PATH="$JM_IMG_PATH/watermark2.png"
|
||||||
FICON_PATH="$JM_IMG_PATH/favicon2.ico"
|
FICON_PATH="$JM_IMG_PATH/favicon2.ico"
|
||||||
REC_ICON_PATH="$JM_IMG_PATH/gnome_record.png"
|
REC_ICON_PATH="$JM_IMG_PATH/gnome_record.png"
|
||||||
#
|
#
|
||||||
|
@ -36,29 +37,30 @@ PART_USER="Participant"
|
||||||
LOCAL_USER="me"
|
LOCAL_USER="me"
|
||||||
#
|
#
|
||||||
#SEC_ROOM="TBD"
|
#SEC_ROOM="TBD"
|
||||||
|
copy_if_not_there() {
|
||||||
|
if [ ! -f "$1" ]; then
|
||||||
|
cp images/"$(echo $1|xargs basename)" "$1"
|
||||||
|
else
|
||||||
|
echo "$(echo $1|xargs basename) file exists, skipping copying..."
|
||||||
|
fi
|
||||||
|
}
|
||||||
echo '
|
echo '
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
# Applying Brandless mode
|
# Applying Brandless mode
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
'
|
'
|
||||||
|
|
||||||
#Watermark
|
#Watermark
|
||||||
if [ ! -f "$WTM2_PATH" ]; then
|
copy_if_not_there "$WTM2_PATH"
|
||||||
cp images/watermark2.png "$WTM2_PATH"
|
|
||||||
else
|
#Watermark svg
|
||||||
echo "watermark2 file exists, skipping copying..."
|
copy_if_not_there "$WTM2_SVG_PATH"
|
||||||
fi
|
|
||||||
#Favicon
|
#Favicon
|
||||||
if [ ! -f "$FICON_PATH" ]; then
|
copy_if_not_there "$FICON_PATH"
|
||||||
cp images/favicon2.ico "$FICON_PATH"
|
|
||||||
else
|
|
||||||
echo "favicon2 file exists, skipping copying..."
|
|
||||||
fi
|
|
||||||
#Local recording icon
|
#Local recording icon
|
||||||
if [ ! -f "$REC_ICON_PATH" ];then
|
copy_if_not_there "$REC_ICON_PATH"
|
||||||
cp images/gnome_record.png "$REC_ICON_PATH"
|
|
||||||
else
|
|
||||||
echo "recording icon exists, skipping copying..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Custom / Remove icons
|
#Custom / Remove icons
|
||||||
sed -i "s|watermark.png|watermark2.png|g" "$CSS_FILE"
|
sed -i "s|watermark.png|watermark2.png|g" "$CSS_FILE"
|
||||||
|
@ -70,6 +72,8 @@ sed -i "s|icon-cloud.png|gnome_record.png|g" "$BUNDLE_JS"
|
||||||
if ! grep -q ".leftwatermark{display:none" "$CSS_FILE" ; then
|
if ! grep -q ".leftwatermark{display:none" "$CSS_FILE" ; then
|
||||||
sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" "$CSS_FILE"
|
sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" "$CSS_FILE"
|
||||||
fi
|
fi
|
||||||
|
#Replace App logo
|
||||||
|
sed -i "s|// defaultLogoUrl: .*| defaultLogoUrl: 'images/watermark2.svg',|" "$MEET_CONF"
|
||||||
|
|
||||||
#Customize room title
|
#Customize room title
|
||||||
sed -i "s|Jitsi Meet|$APP_NAME|g" "$TITLE_FILE"
|
sed -i "s|Jitsi Meet|$APP_NAME|g" "$TITLE_FILE"
|
||||||
|
|
312
jra_nextcloud.sh
312
jra_nextcloud.sh
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# JRA (Jibri Recordings Access) via Nextcloud
|
# JRA (Jibri Recordings Access) via Nextcloud
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
@ -14,7 +14,7 @@ done
|
||||||
|
|
||||||
#DEBUG
|
#DEBUG
|
||||||
if [ "$MODE" = "debug" ]; then
|
if [ "$MODE" = "debug" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ "$(id -u)" = 0 ]; then
|
if ! [ "$(id -u)" = 0 ]; then
|
||||||
|
@ -42,14 +42,9 @@ apt-get update -q2
|
||||||
# Manually add prerequisites.
|
# Manually add prerequisites.
|
||||||
apt-get install -y curl letsencrypt nginx
|
apt-get install -y curl letsencrypt nginx
|
||||||
|
|
||||||
DISTRO_RELEASE="$(lsb_release -sc)"
|
MIN_PHP="8.2"
|
||||||
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
||||||
PHP_REPO="$(apt-cache policy | awk '/http/&&/php/{print$2}' | awk -F "/" 'NR==1{print$5}')"
|
|
||||||
PHPVER="$(apt-cache madison php|grep -v ppa|awk -F'[:+]' 'NR==1{print $2}')"
|
|
||||||
PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')"
|
PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')"
|
||||||
PHP_FPM_DIR="/etc/php/$PHPVER/fpm"
|
|
||||||
PHP_INI="$PHP_FPM_DIR/php.ini"
|
|
||||||
PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf"
|
|
||||||
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/"$DOMAIN".conf | awk '{print$2}')"
|
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/"$DOMAIN".conf | awk '{print$2}')"
|
||||||
[ -z "$NC_NGINX_SSL_PORT" ] && NC_NGINX_SSL_PORT="443"
|
[ -z "$NC_NGINX_SSL_PORT" ] && NC_NGINX_SSL_PORT="443"
|
||||||
NC_REPO="https://download.nextcloud.com/server/releases"
|
NC_REPO="https://download.nextcloud.com/server/releases"
|
||||||
|
@ -64,31 +59,11 @@ DIR_RECORD="$(awk -F '"' '/RECORDING/{print$2}' /home/jibri/finalize_recording
|
||||||
REDIS_CONF="/etc/redis/redis.conf"
|
REDIS_CONF="/etc/redis/redis.conf"
|
||||||
JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
||||||
[ -f "$JITSI_MEET_PROXY" ] && PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1)
|
[ -f "$JITSI_MEET_PROXY" ] && PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1)
|
||||||
PUBLIC_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
|
PUBLIC_IP="$(dig -4 +short myip.opendns.com @resolver1.opendns.com)"
|
||||||
ISO3166_CODE=TBD
|
ISO3166_CODE=TBD
|
||||||
NL="$(printf '\n ')"
|
NL="$(printf '\n ')"
|
||||||
TMP_GPG_REPO="$(mktemp -d)"
|
|
||||||
|
|
||||||
add_gpg_keyring() {
|
|
||||||
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1"
|
|
||||||
apt-key export "$1" | gpg --dearmour | tee "$TMP_GPG_REPO"/"$1".gpg >/dev/null
|
|
||||||
apt-key del "$1"
|
|
||||||
mv "$TMP_GPG_REPO"/"$1".gpg /etc/apt/trusted.gpg.d/
|
|
||||||
}
|
|
||||||
install_aval_package() {
|
|
||||||
for i in $1
|
|
||||||
do
|
|
||||||
if [ -z "$(apt-cache madison "$i" 2>/dev/null)" ]; then
|
|
||||||
echo " > Package $i not available on repo."
|
|
||||||
else
|
|
||||||
echo " > Add package $i to the install list"
|
|
||||||
packages="$packages $i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo "$packages"
|
|
||||||
apt-get -y install $packages
|
|
||||||
packages=""
|
|
||||||
}
|
|
||||||
exit_ifinstalled() {
|
exit_ifinstalled() {
|
||||||
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
||||||
echo " This instance already has $1 installed, exiting..."
|
echo " This instance already has $1 installed, exiting..."
|
||||||
|
@ -105,18 +80,6 @@ else
|
||||||
apt-get -yq2 install "$1"
|
apt-get -yq2 install "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
add_php() {
|
|
||||||
if [ "$PHP_REPO" = "php" ]; then
|
|
||||||
echo "PHP $PHPVER already installed"
|
|
||||||
apt-get -q2 update
|
|
||||||
apt-get -yq2 dist-upgrade
|
|
||||||
else
|
|
||||||
echo "# Adding Ondrej PHP $PHPVER PPA Repository"
|
|
||||||
add_gpg_keyring E5267A6C
|
|
||||||
echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php"$PHPVER".list
|
|
||||||
apt-get update -q2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
while [[ "$ANS_NCD" != "yes" ]]
|
while [[ "$ANS_NCD" != "yes" ]]
|
||||||
do
|
do
|
||||||
read -p "> Please set your domain (or subdomain) here for Nextcloud: (e.g.: cloud.domain.com)$NL" -r NC_DOMAIN
|
read -p "> Please set your domain (or subdomain) here for Nextcloud: (e.g.: cloud.domain.com)$NL" -r NC_DOMAIN
|
||||||
|
@ -132,9 +95,11 @@ do
|
||||||
echo " - Please try again."
|
echo " - Please try again."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
sleep .1
|
||||||
#Simple DNS test
|
#Simple DNS test
|
||||||
if [ "$PUBLIC_IP" = "$(dig -4 +short "$NC_DOMAIN"|awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then
|
if [ "$PUBLIC_IP" = "$(dig -4 +short "$NC_DOMAIN"|awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then
|
||||||
echo -e "Server public IP & DNS record for $NC_DOMAIN seems to match, continuing...\n\n"
|
echo -e "Server public IP & DNS record for $NC_DOMAIN seems to match, continuing...\n\n"
|
||||||
|
sleep .1
|
||||||
else
|
else
|
||||||
echo "Server public IP ($PUBLIC_IP) & DNS record for $NC_DOMAIN don't seem to match."
|
echo "Server public IP ($PUBLIC_IP) & DNS record for $NC_DOMAIN don't seem to match."
|
||||||
echo " > Please check your dns records are applied and updated, otherwise Nextcloud may fail."
|
echo " > Please check your dns records are applied and updated, otherwise Nextcloud may fail."
|
||||||
|
@ -146,7 +111,7 @@ else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
sleep .1
|
||||||
NC_NGINX_CONF="/etc/nginx/sites-available/$NC_DOMAIN.conf"
|
NC_NGINX_CONF="/etc/nginx/sites-available/$NC_DOMAIN.conf"
|
||||||
while [ -z "$NC_USER" ]
|
while [ -z "$NC_USER" ]
|
||||||
do
|
do
|
||||||
|
@ -155,6 +120,7 @@ do
|
||||||
echo " - This field is mandatory."
|
echo " - This field is mandatory."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
sleep .1
|
||||||
while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 8 ]
|
while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 8 ]
|
||||||
do
|
do
|
||||||
read -p "Nextcloud user password: " -r NC_PASS
|
read -p "Nextcloud user password: " -r NC_PASS
|
||||||
|
@ -162,6 +128,7 @@ do
|
||||||
echo -e " - This field is mandatory. \nPlease make sure it's at least 8 characters.\n"
|
echo -e " - This field is mandatory. \nPlease make sure it's at least 8 characters.\n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
sleep .1
|
||||||
#Enable HSTS
|
#Enable HSTS
|
||||||
while [ "$ENABLE_HSTS" != "yes" ] && [ "$ENABLE_HSTS" != "no" ]
|
while [ "$ENABLE_HSTS" != "yes" ] && [ "$ENABLE_HSTS" != "no" ]
|
||||||
do
|
do
|
||||||
|
@ -174,7 +141,7 @@ do
|
||||||
echo " - HSTS will be enabled."
|
echo " - HSTS will be enabled."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
sleep .1
|
||||||
echo -e "#Default country phone code\n
|
echo -e "#Default country phone code\n
|
||||||
> Starting at Nextcloud 21.x it's required to set a default country phone ISO 3166-1 alpha-2 code.\n
|
> Starting at Nextcloud 21.x it's required to set a default country phone ISO 3166-1 alpha-2 code.\n
|
||||||
>>> https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements <<<\n"
|
>>> https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements <<<\n"
|
||||||
|
@ -209,241 +176,39 @@ exit_ifinstalled postgresql-"$PSGVER"
|
||||||
# PostgresSQL
|
# PostgresSQL
|
||||||
install_ifnot postgresql-"$PSGVER"
|
install_ifnot postgresql-"$PSGVER"
|
||||||
|
|
||||||
# PHP 7.4 / 8.1
|
|
||||||
add_php
|
|
||||||
install_aval_package " \
|
|
||||||
imagemagick \
|
|
||||||
php$PHPVER-fpm \
|
|
||||||
php$PHPVER-bcmath \
|
|
||||||
php$PHPVER-bz2 \
|
|
||||||
php$PHPVER-curl \
|
|
||||||
php$PHPVER-gd \
|
|
||||||
php$PHPVER-gmp \
|
|
||||||
php$PHPVER-imagick \
|
|
||||||
php$PHPVER-intl \
|
|
||||||
php$PHPVER-json \
|
|
||||||
php$PHPVER-ldap \
|
|
||||||
php$PHPVER-mbstring \
|
|
||||||
php$PHPVER-pgsql \
|
|
||||||
php$PHPVER-redis \
|
|
||||||
php$PHPVER-soap \
|
|
||||||
php$PHPVER-xml \
|
|
||||||
php$PHPVER-xmlrpc \
|
|
||||||
php$PHPVER-zip \
|
|
||||||
redis-server \
|
|
||||||
unzip \
|
|
||||||
"
|
|
||||||
|
|
||||||
#System related
|
#--------------------------------------------------
|
||||||
install_ifnot smbclient
|
# Prepare PHP
|
||||||
sed -i "s|.*env\[HOSTNAME\].*|env\[HOSTNAME\] = \$HOSTNAME|" "$PHP_CONF"
|
#--------------------------------------------------
|
||||||
sed -i "s|.*env\[PATH\].*|env\[PATH\] = /usr/local/bin:/usr/bin:/bin|" "$PHP_CONF"
|
|
||||||
sed -i "s|.*env\[TMP\].*|env\[TMP\] = /tmp|" "$PHP_CONF"
|
|
||||||
sed -i "s|.*env\[TMPDIR\].*|env\[TMPDIR\] = /tmp|" "$PHP_CONF"
|
|
||||||
sed -i "s|.*env\[TEMP\].*|env\[TEMP\] = /tmp|" "$PHP_CONF"
|
|
||||||
sed -i "s|;clear_env = no|clear_env = no|" "$PHP_CONF"
|
|
||||||
|
|
||||||
echo "
|
if [ "$MODE" = "debug" ]; then
|
||||||
Tunning PHP.ini...
|
bash -x "$PWD"/tools/prepare_php.sh "$MIN_PHP"
|
||||||
"
|
else
|
||||||
# Change values in php.ini (increase max file size)
|
bash "$PWD"/tools/prepare_php.sh "$MIN_PHP"
|
||||||
# max_execution_time
|
fi
|
||||||
sed -i "s|max_execution_time =.*|max_execution_time = 3500|g" "$PHP_INI"
|
|
||||||
# max_input_time
|
|
||||||
sed -i "s|max_input_time =.*|max_input_time = 3600|g" "$PHP_INI"
|
|
||||||
# memory_limit
|
|
||||||
sed -i "s|memory_limit =.*|memory_limit = 512M|g" "$PHP_INI"
|
|
||||||
# post_max
|
|
||||||
sed -i "s|post_max_size =.*|post_max_size = 1025M|g" "$PHP_INI"
|
|
||||||
# upload_max
|
|
||||||
sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1024M|g" "$PHP_INI"
|
|
||||||
|
|
||||||
phpenmod opcache
|
|
||||||
{
|
|
||||||
|
|
||||||
echo "# OPcache settings for Nextcloud"
|
|
||||||
echo "opcache.enable=1"
|
|
||||||
echo "opcache.enable_cli=1"
|
|
||||||
echo "opcache.interned_strings_buffer=8"
|
|
||||||
echo "opcache.max_accelerated_files=10000"
|
|
||||||
echo "opcache.memory_consumption=256"
|
|
||||||
echo "opcache.save_comments=1"
|
|
||||||
echo "opcache.revalidate_freq=1"
|
|
||||||
echo "opcache.validate_timestamps=1"
|
|
||||||
} >> "$PHP_INI"
|
|
||||||
|
|
||||||
systemctl restart php"$PHPVER"-fpm.service
|
|
||||||
|
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
# Create DB user
|
# Create DB user
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
|
|
||||||
echo -e "\n---- Creating the PgSQL DB & User ----"
|
echo -e "\n---- Creating the PgSQL DB & User ----"
|
||||||
cd /tmp || return
|
|
||||||
sudo -u postgres psql <<DB
|
sudo -u postgres psql <<DB
|
||||||
CREATE DATABASE nextcloud_db;
|
CREATE DATABASE nextcloud_db;
|
||||||
CREATE USER ${NC_DB_USER} WITH ENCRYPTED PASSWORD '${NC_DB_PASSWD}';
|
CREATE USER ${NC_DB_USER} WITH ENCRYPTED PASSWORD '${NC_DB_PASSWD}';
|
||||||
GRANT ALL PRIVILEGES ON DATABASE ${NC_DB} TO ${NC_DB_USER};
|
GRANT ALL PRIVILEGES ON DATABASE ${NC_DB} TO ${NC_DB_USER};
|
||||||
DB
|
DB
|
||||||
echo "Done!
|
echo -e "\nDone!\n"
|
||||||
"
|
|
||||||
|
|
||||||
#nginx - configuration
|
# Add .mjs as a file extension for javascript
|
||||||
cat << NC_NGINX > "$NC_NGINX_CONF"
|
sed -i "/application\/javascript/s|js.*;|js mjs;|" /etc/nginx/mime.types
|
||||||
#nextcloud config
|
|
||||||
upstream php-handler {
|
|
||||||
#server 127.0.0.1:9000;
|
|
||||||
server unix:/run/php/php${PHPVER}-fpm.sock;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
# nginx conf setup.
|
||||||
listen 80;
|
cp files/nextcloud.conf "$NC_NGINX_CONF"
|
||||||
listen [::]:80;
|
sed -i "s|_PHPVER|$MIN_PHP|g" "$NC_NGINX_CONF"
|
||||||
server_name $NC_DOMAIN;
|
sed -i "s|_NC_DOMAIN|$NC_DOMAIN|g" "$NC_NGINX_CONF"
|
||||||
# enforce https
|
sed -i "s|_NC_NGINX_SSL_PORT|$NC_NGINX_SSL_PORT|g" "$NC_NGINX_CONF"
|
||||||
return 301 https://\$server_name\$request_uri;
|
sed -i "s|_NC_PATH|$NC_PATH|g" "$NC_NGINX_CONF"
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen $NC_NGINX_SSL_PORT ssl http2;
|
|
||||||
listen [::]:$NC_NGINX_SSL_PORT ssl http2;
|
|
||||||
server_name $NC_DOMAIN;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/$NC_DOMAIN/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/$NC_DOMAIN/privkey.pem;
|
|
||||||
|
|
||||||
# HSTS settings
|
|
||||||
# WARNING: Only add the preload option once you read about
|
|
||||||
# the consequences in https://hstspreload.org/. This option
|
|
||||||
# will add the domain to a hardcoded list that is shipped
|
|
||||||
# in all major browsers and getting removed from this list
|
|
||||||
# could take several months.
|
|
||||||
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
|
||||||
|
|
||||||
# Enable gzip but do not remove ETag headers
|
|
||||||
gzip on;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_comp_level 4;
|
|
||||||
gzip_min_length 256;
|
|
||||||
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
|
||||||
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
|
||||||
|
|
||||||
# Pagespeed is not supported by Nextcloud, so if your server is built
|
|
||||||
# with the \`ngx_pagespeed\` module, uncomment this line to disable it.
|
|
||||||
#pagespeed off;
|
|
||||||
|
|
||||||
# HTTP response headers borrowed from Nextcloud \`.htaccess\`
|
|
||||||
add_header Referrer-Policy "no-referrer" always;
|
|
||||||
add_header X-Content-Type-Options "nosniff" always;
|
|
||||||
add_header X-Download-Options "noopen" always;
|
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
||||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
|
||||||
add_header X-Robots-Tag "none" always;
|
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
|
||||||
|
|
||||||
# Remove X-Powered-By, which is an information leak
|
|
||||||
fastcgi_hide_header X-Powered-By;
|
|
||||||
|
|
||||||
# set max upload size
|
|
||||||
client_max_body_size 1024M;
|
|
||||||
fastcgi_buffers 64 4K;
|
|
||||||
|
|
||||||
# Path to the root of your installation
|
|
||||||
root $NC_PATH/;
|
|
||||||
|
|
||||||
# Specify how to handle directories -- specifying \`/index.php\$request_uri\`
|
|
||||||
# here as the fallback means that Nginx always exhibits the desired behaviour
|
|
||||||
# when a client requests a path that corresponds to a directory that exists
|
|
||||||
# on the server. In particular, if that directory contains an index.php file,
|
|
||||||
# that file is correctly served; if it doesn't, then the request is passed to
|
|
||||||
# the front-end controller. This consistent behaviour means that we don't need
|
|
||||||
# to specify custom rules for certain paths (e.g. images and other assets,
|
|
||||||
# \`/updater\`, \`/ocm-provider\`, \`/ocs-provider\`), and thus
|
|
||||||
# \`try_files \$uri \$uri/ /index.php\$request_uri\`
|
|
||||||
# always provides the desired behaviour.
|
|
||||||
index index.php index.html /index.php\$request_uri;
|
|
||||||
|
|
||||||
# Rule borrowed from \`.htaccess\` to handle Microsoft DAV clients
|
|
||||||
location = / {
|
|
||||||
if ( \$http_user_agent ~ ^DavClnt ) {
|
|
||||||
return 302 /remote.php/webdav/\$is_args\$args;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /robots.txt {
|
|
||||||
allow all;
|
|
||||||
log_not_found off;
|
|
||||||
access_log off;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make a regex exception for \`/.well-known\` so that clients can still
|
|
||||||
# access it despite the existence of the regex rule
|
|
||||||
# \`location ~ /(\.|autotest|...)\` which would otherwise handle requests
|
|
||||||
# for \`/.well-known\`.
|
|
||||||
location ^~ /.well-known {
|
|
||||||
# The rules in this block are an adaptation of the rules
|
|
||||||
# in \`.htaccess\` that concern \`/.well-known\`.
|
|
||||||
|
|
||||||
location = /.well-known/carddav { return 301 /remote.php/dav/; }
|
|
||||||
location = /.well-known/caldav { return 301 /remote.php/dav/; }
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge { try_files \$uri \$uri/ =404; }
|
|
||||||
location /.well-known/pki-validation { try_files \$uri \$uri/ =404; }
|
|
||||||
|
|
||||||
# Let Nextcloud's API for \`/.well-known\` URIs handle all other
|
|
||||||
# requests by passing them to the front-end controller.
|
|
||||||
return 301 /index.php\$request_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rules borrowed from \`.htaccess\` to hide certain paths from clients
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:\$|/) { return 404; }
|
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
|
|
||||||
|
|
||||||
# Ensure this block, which passes PHP files to the PHP process, is above the blocks
|
|
||||||
# which handle static assets (as seen below). If this block is not declared first,
|
|
||||||
# then Nginx will encounter an infinite rewriting loop when it prepends \`/index.php\`
|
|
||||||
# to the URI, resulting in a HTTP 500 error response.
|
|
||||||
location ~ \.php(?:\$|/) {
|
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)\$;
|
|
||||||
set \$path_info \$fastcgi_path_info;
|
|
||||||
|
|
||||||
try_files \$fastcgi_script_name =404;
|
|
||||||
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
|
||||||
fastcgi_param PATH_INFO \$path_info;
|
|
||||||
fastcgi_param HTTPS on;
|
|
||||||
|
|
||||||
fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
|
|
||||||
fastcgi_param front_controller_active true; # Enable pretty urls
|
|
||||||
fastcgi_pass php-handler;
|
|
||||||
|
|
||||||
fastcgi_intercept_errors on;
|
|
||||||
fastcgi_request_buffering off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.(?:css|js|svg|gif)\$ {
|
|
||||||
try_files \$uri /index.php\$request_uri;
|
|
||||||
expires 6M; # Cache-Control policy borrowed from \`.htaccess\`
|
|
||||||
access_log off; # Optional: Don't log access to assets
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.woff2?\$ {
|
|
||||||
try_files \$uri /index.php\$request_uri;
|
|
||||||
expires 7d; # Cache-Control policy borrowed from \`.htaccess\`
|
|
||||||
access_log off; # Optional: Don't log access to assets
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rule borrowed from \`.htaccess\`
|
|
||||||
location /remote {
|
|
||||||
return 301 /remote.php\$request_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files \$uri \$uri/ /index.php\$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NC_NGINX
|
|
||||||
systemctl stop nginx
|
systemctl stop nginx
|
||||||
letsencrypt certonly --standalone --renew-by-default --agree-tos -d "$NC_DOMAIN"
|
letsencrypt certonly --standalone --renew-by-default --agree-tos -d "$NC_DOMAIN"
|
||||||
if [ -f /etc/letsencrypt/live/"$NC_DOMAIN"/fullchain.pem ];then
|
if [ -f /etc/letsencrypt/live/"$NC_DOMAIN"/fullchain.pem ];then
|
||||||
|
@ -479,7 +244,7 @@ chown -R www-data:www-data "$NC_PATH"
|
||||||
chmod -R 755 "$NC_PATH"
|
chmod -R 755 "$NC_PATH"
|
||||||
|
|
||||||
echo -e "\nDatabase installation...\n"
|
echo -e "\nDatabase installation...\n"
|
||||||
sudo -u www-data php "$NC_PATH"/occ maintenance:install \
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ maintenance:install \
|
||||||
--database=pgsql \
|
--database=pgsql \
|
||||||
--database-name="$NC_DB" \
|
--database-name="$NC_DB" \
|
||||||
--database-user="$NC_DB_USER" \
|
--database-user="$NC_DB_USER" \
|
||||||
|
@ -494,7 +259,7 @@ sed -i "/simpleSignUpLink.shown/a \ \ \'knowledgebaseenabled\' => false," "$NC_C
|
||||||
sed -i "s|http://localhost|https://$NC_DOMAIN|" "$NC_CONFIG"
|
sed -i "s|http://localhost|https://$NC_DOMAIN|" "$NC_CONFIG"
|
||||||
|
|
||||||
echo -e "\nAdd crontab...\n"
|
echo -e "\nAdd crontab...\n"
|
||||||
crontab -u www-data -l | { cat; echo "*/5 * * * * php -f $NC_PATH/cron.php"; } | crontab -u www-data -
|
crontab -u www-data -l | { cat; echo "*/5 * * * * php$MIN_PHP -f $NC_PATH/cron.php"; } | crontab -u www-data -
|
||||||
|
|
||||||
echo -e "\nAdd memcache support...\n"
|
echo -e "\nAdd memcache support...\n"
|
||||||
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|g" "$REDIS_CONF"
|
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|g" "$REDIS_CONF"
|
||||||
|
@ -520,25 +285,24 @@ sed -i "/);/i \ \ )," "$NC_CONFIG"
|
||||||
echo -e "Done\n"
|
echo -e "Done\n"
|
||||||
|
|
||||||
echo -e "\nAddding & Setting up Files External App for Local storage...\n"
|
echo -e "\nAddding & Setting up Files External App for Local storage...\n"
|
||||||
sudo -u www-data php "$NC_PATH"/occ app:install files_external
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:install files_external
|
||||||
sudo -u www-data php "$NC_PATH"/occ app:enable files_external
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:enable files_external
|
||||||
sudo -u www-data php "$NC_PATH"/occ app:disable support
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:disable support
|
||||||
sudo -u www-data php "$NC_PATH"/occ files_external:import /tmp/jra-nc-app-ef.json
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ files_external:import /tmp/jra-nc-app-ef.json
|
||||||
|
|
||||||
usermod -a -G jibri www-data
|
usermod -a -G jibri www-data
|
||||||
chmod -R 770 "$DIR_RECORD"
|
chmod -R 770 "$DIR_RECORD"
|
||||||
chmod -R g+s "$DIR_RECORD"
|
chmod -R g+s "$DIR_RECORD"
|
||||||
|
|
||||||
echo -e "\nFixing possible missing tables...\n\n"
|
echo -e "\nFixing possible missing tables...\n\n"
|
||||||
echo "y"|sudo -u www-data php "$NC_PATH"/occ db:convert-filecache-bigint
|
echo "y"|sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:convert-filecache-bigint
|
||||||
sudo -u www-data php "$NC_PATH"/occ db:add-missing-indices
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:add-missing-indices
|
||||||
sudo -u www-data php "$NC_PATH"/occ db:add-missing-columns
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:add-missing-columns
|
||||||
|
|
||||||
echo -e "\nAdding trusted domain...\n"
|
echo -e "\nAdding trusted domain...\n"
|
||||||
sudo -u www-data php "$NC_PATH"/occ config:system:set trusted_domains 0 --value="$NC_DOMAIN"
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ config:system:set trusted_domains 0 --value="$NC_DOMAIN"
|
||||||
|
|
||||||
echo -e "\nSetting JRA domain on jitsi-updater.sh\n"
|
echo -e "\nSetting JRA domain on jitsi-updater.sh\n"
|
||||||
cd ~/quick-jibri-installer || return
|
|
||||||
sed -i "s|NC_DOMAIN=.*|NC_DOMAIN=\"$NC_DOMAIN\"|" jitsi-updater.sh
|
sed -i "s|NC_DOMAIN=.*|NC_DOMAIN=\"$NC_DOMAIN\"|" jitsi-updater.sh
|
||||||
|
|
||||||
echo -e "\nQuick Nextcloud installation complete!\n"
|
echo -e "\nQuick Nextcloud installation complete!\n"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Custom High Performance Jitsi conf
|
# Custom High Performance Jitsi conf
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Custom Selenium Grid-Node fro Jitsi Meet
|
# Custom Selenium Grid-Node fro Jitsi Meet
|
||||||
# Pandian © - https://community.jitsi.org/u/Pandian
|
# Pandian © - https://community.jitsi.org/u/Pandian
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# System-tune-up to remove system software restrictions on a huge load of connections.
|
# System-tune-up to remove system software restrictions on a huge load of connections.
|
||||||
# Be aware that hardware/infrastructure resources are the most common limiters.
|
# Be aware that hardware/infrastructure resources are the most common limiters.
|
||||||
#
|
#
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# JWT Mode Setup
|
# JWT Mode Setup
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Quick Jibri Installer - *buntu (LTS) based systems.
|
# Quick Jibri Installer - *buntu (LTS) based systems.
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
{
|
{
|
||||||
echo "Started at $(date +'%Y-%m-%d %H:%M:%S')" >> qj-installer.log
|
echo "Started at $(date +'%Y-%m-%d %H:%M:%S')" >> qj-installer.log
|
||||||
|
@ -131,6 +131,7 @@ add_prosody_repo() {
|
||||||
> /etc/apt/sources.list.d/prosody.list
|
> /etc/apt/sources.list.d/prosody.list
|
||||||
curl -s https://prosody.im/files/prosody-debian-packages.key \
|
curl -s https://prosody.im/files/prosody-debian-packages.key \
|
||||||
> "$PROSODY_GPG_KEY"
|
> "$PROSODY_GPG_KEY"
|
||||||
|
apt-get update -q2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
dpkg-compare() {
|
dpkg-compare() {
|
||||||
|
@ -317,6 +318,7 @@ else
|
||||||
> /etc/apt/sources.list.d/jitsi-stable.list
|
> /etc/apt/sources.list.d/jitsi-stable.list
|
||||||
curl -s https://download.jitsi.org/jitsi-key.gpg.key \
|
curl -s https://download.jitsi.org/jitsi-key.gpg.key \
|
||||||
> "$JITSI_GPG_KEY"
|
> "$JITSI_GPG_KEY"
|
||||||
|
apt-get update -q2
|
||||||
JITSI_REPO="stable"
|
JITSI_REPO="stable"
|
||||||
fi
|
fi
|
||||||
sleep .1
|
sleep .1
|
||||||
|
@ -452,7 +454,7 @@ else
|
||||||
| gpg --dearmor -o "$NODEJS_GPG_KEY"
|
| gpg --dearmor -o "$NODEJS_GPG_KEY"
|
||||||
echo "deb [signed-by=$NODEJS_GPG_KEY] https://deb.nodesource.com/node_$NODEJS_VER.x nodistro main" | \
|
echo "deb [signed-by=$NODEJS_GPG_KEY] https://deb.nodesource.com/node_$NODEJS_VER.x nodistro main" | \
|
||||||
tee /etc/apt/sources.list.d/nodesource.list
|
tee /etc/apt/sources.list.d/nodesource.list
|
||||||
apt-get update -yq2
|
apt-get update -q2
|
||||||
apt-get install -yq2 nodejs
|
apt-get install -yq2 nodejs
|
||||||
|
|
||||||
echo "Installing nodejs esprima package..."
|
echo "Installing nodejs esprima package..."
|
||||||
|
@ -565,18 +567,6 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sleep .1
|
sleep .1
|
||||||
#Language
|
|
||||||
echo "## Setting up Jitsi Meet language ##
|
|
||||||
You can define the language, for a complete list of the supported languages
|
|
||||||
|
|
||||||
See here:
|
|
||||||
https://github.com/jitsi/jitsi-meet/blob/master/lang/languages.json"
|
|
||||||
printf "Jitsi Meet web interface will be set to use such language.\n\n"
|
|
||||||
sleep .1
|
|
||||||
read -p "Please set your language (Press enter to default to 'en'):$NL" -r JB_LANG
|
|
||||||
sleep .1
|
|
||||||
printf "\nWe'll take a minute to localize some UI excerpts if you need.\n\n"
|
|
||||||
sleep .1
|
|
||||||
#Participant
|
#Participant
|
||||||
printf "> Do you want to translate 'Participant' to your own language?\n"
|
printf "> Do you want to translate 'Participant' to your own language?\n"
|
||||||
sleep .1
|
sleep .1
|
||||||
|
@ -874,18 +864,17 @@ sed -i "s|conference.$DOMAIN|internal.auth.$DOMAIN|" "$MEET_CONF"
|
||||||
sed -i "s|// recordingService:|recordingService:|" "$MEET_CONF"
|
sed -i "s|// recordingService:|recordingService:|" "$MEET_CONF"
|
||||||
sed -i "/recordingService/,/hideStorageWarning/s|// enabled: false,| enabled: true,|" "$MEET_CONF"
|
sed -i "/recordingService/,/hideStorageWarning/s|// enabled: false,| enabled: true,|" "$MEET_CONF"
|
||||||
sed -i "/hideStorageWarning: false/,/Local recording configuration/s|// },|},|" "$MEET_CONF"
|
sed -i "/hideStorageWarning: false/,/Local recording configuration/s|// },|},|" "$MEET_CONF"
|
||||||
sed -i "s|// liveStreamingEnabled: false,|liveStreamingEnabled: true,\\
|
sed -i "/fileRecordingsServiceEnabled: false,/a \\
|
||||||
\\
|
hiddenDomain: \'recorder.$DOMAIN\'," "$MEET_CONF"
|
||||||
hiddenDomain: \'recorder.$DOMAIN\',|" "$MEET_CONF"
|
|
||||||
|
|
||||||
#Setup main language
|
##Setup main language
|
||||||
if [ -z "$JB_LANG" ] || [ "$JB_LANG" = "en" ]; then
|
#if [ -z "$JB_LANG" ] || [ "$JB_LANG" = "en" ]; then
|
||||||
echo "Leaving English (en) as default language..."
|
#echo "Leaving English (en) as default language..."
|
||||||
sed -i "s|// defaultLanguage: 'en',|defaultLanguage: 'en',|" "$MEET_CONF"
|
#sed -i "s|// defaultLanguage: 'en',|defaultLanguage: 'en',|" "$MEET_CONF"
|
||||||
else
|
#else
|
||||||
echo "Changing default language to: $JB_LANG"
|
#echo "Changing default language to: $JB_LANG"
|
||||||
sed -i "s|// defaultLanguage: 'en',|defaultLanguage: \'$JB_LANG\',|" "$MEET_CONF"
|
#sed -i "s|// defaultLanguage: 'en',|defaultLanguage: \'$JB_LANG\',|" "$MEET_CONF"
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
# Recording directory
|
# Recording directory
|
||||||
if [ ! -d "$DIR_RECORD" ]; then
|
if [ ! -d "$DIR_RECORD" ]; then
|
||||||
|
@ -1195,9 +1184,11 @@ sed -i "s|// startAudioMuted: 10,|startAudioMuted: 1,|" "$MEET_CONF"
|
||||||
|
|
||||||
#Disable/enable welcome page
|
#Disable/enable welcome page
|
||||||
if [ "$ENABLE_WELCP" = "yes" ]; then
|
if [ "$ENABLE_WELCP" = "yes" ]; then
|
||||||
sed -i "s|.*enableWelcomePage:.*| enableWelcomePage: false,|" "$MEET_CONF"
|
sed -i "/ welcomePage: {/,/},/s|// ||" "$MEET_CONF"
|
||||||
|
sed -i "/ welcomePage: {/,/},/s|disabled: .*,|disabled: true,|" "$MEET_CONF"
|
||||||
elif [ "$ENABLE_WELCP" = "no" ]; then
|
elif [ "$ENABLE_WELCP" = "no" ]; then
|
||||||
sed -i "s|.*enableWelcomePage:.*| enableWelcomePage: true,|" "$MEET_CONF"
|
sed -i "/ welcomePage: {/,/},/s|// ||" "$MEET_CONF"
|
||||||
|
sed -i "/ welcomePage: {/,/},/s|disabled: .*,|disabled: false,|" "$MEET_CONF"
|
||||||
fi
|
fi
|
||||||
#Enable close page
|
#Enable close page
|
||||||
if [ "$ENABLE_CLOCP" = "yes" ]; then
|
if [ "$ENABLE_CLOCP" = "yes" ]; then
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Automated AWS generic kernel setup for jibri.
|
# Automated AWS generic kernel setup for jibri.
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Simple Fail2ban configuration
|
# Simple Fail2ban configuration
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Simple Jibri conf updater
|
# Simple Jibri conf updater
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Simple Jibri resolution enhancer
|
# Simple Jibri resolution enhancer
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -0,0 +1,138 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Automated PHP environment build for Nextcloud.
|
||||||
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
|
# GPLv3 or later.
|
||||||
|
|
||||||
|
PHPVER=$1
|
||||||
|
STABLE_PHP="$(apt-cache madison php|grep -v ppa|awk -F'[:+]' 'NR==1{print $2}')"
|
||||||
|
DISTRO_RELEASE="$(lsb_release -sc)"
|
||||||
|
PHP_REPO="$(apt-cache policy | awk '/http/&&/php/{print$2}' | awk -F "/" 'NR==1{print$5}')"
|
||||||
|
PHP_REPO_URL="http://ppa.launchpad.net/ondrej/php/ubuntu"
|
||||||
|
PHP_FPM_DIR="/etc/php/$PHPVER/fpm"
|
||||||
|
PHP_INI="$PHP_FPM_DIR/php.ini"
|
||||||
|
PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf"
|
||||||
|
TMP_GPG_REPO="$(mktemp -d)"
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 8.2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_ifnot() {
|
||||||
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
||||||
|
echo " $1 is installed, skipping..."
|
||||||
|
else
|
||||||
|
printf "\n---- Installing %s ----" "$1"
|
||||||
|
apt-get -yq2 install "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_aval_package() {
|
||||||
|
for i in $1
|
||||||
|
do
|
||||||
|
if [ -z "$(apt-cache madison "$i" 2>/dev/null)" ]; then
|
||||||
|
echo " > Package $i not available on repo."
|
||||||
|
else
|
||||||
|
echo " > Add package $i to the install list"
|
||||||
|
packages="$packages $i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "$packages"
|
||||||
|
apt-get -y install $packages #< don't quote.
|
||||||
|
packages=""
|
||||||
|
}
|
||||||
|
|
||||||
|
add_gpg_keyring() {
|
||||||
|
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1"
|
||||||
|
apt-key export "$1" | gpg --dearmour | tee "$TMP_GPG_REPO"/"$1".gpg >/dev/null
|
||||||
|
apt-key del "$1"
|
||||||
|
mv "$TMP_GPG_REPO"/"$1".gpg /etc/apt/trusted.gpg.d/
|
||||||
|
}
|
||||||
|
|
||||||
|
add_php_repo() {
|
||||||
|
if [ "$PHP_REPO" = "php" ]; then
|
||||||
|
echo "PHP $PHPVER already installed"
|
||||||
|
apt-get -q2 update
|
||||||
|
apt-get -yq2 dist-upgrade
|
||||||
|
else
|
||||||
|
echo "# Adding Ondrej PHP $PHPVER PPA Repository"
|
||||||
|
add_gpg_keyring E5267A6C
|
||||||
|
echo "deb [arch=amd64] $PHP_REPO_URL $DISTRO_RELEASE main" | \
|
||||||
|
tee /etc/apt/sources.list.d/php"$PHPVER".list
|
||||||
|
apt-get update -q2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_php_repo
|
||||||
|
|
||||||
|
install_aval_package " \
|
||||||
|
imagemagick \
|
||||||
|
php$PHPVER-fpm \
|
||||||
|
php$PHPVER-bcmath \
|
||||||
|
php$PHPVER-bz2 \
|
||||||
|
php$PHPVER-cli \
|
||||||
|
php$PHPVER-cgi \
|
||||||
|
php$PHPVER-curl \
|
||||||
|
php$PHPVER-gd \
|
||||||
|
php$PHPVER-gmp \
|
||||||
|
php$PHPVER-imagick \
|
||||||
|
php$PHPVER-intl \
|
||||||
|
php$PHPVER-json \
|
||||||
|
php$PHPVER-ldap \
|
||||||
|
php$PHPVER-mbstring \
|
||||||
|
php$PHPVER-pgsql \
|
||||||
|
php$PHPVER-redis \
|
||||||
|
php$PHPVER-soap \
|
||||||
|
php$PHPVER-xml \
|
||||||
|
php$PHPVER-xmlrpc \
|
||||||
|
php$PHPVER-zip \
|
||||||
|
redis-server \
|
||||||
|
unzip \
|
||||||
|
"
|
||||||
|
|
||||||
|
#System related
|
||||||
|
install_ifnot smbclient
|
||||||
|
sed -i "s|.*env\[HOSTNAME\].*|env\[HOSTNAME\] = \$HOSTNAME|" "$PHP_CONF"
|
||||||
|
sed -i "s|.*env\[PATH\].*|env\[PATH\] = /usr/local/bin:/usr/bin:/bin|" "$PHP_CONF"
|
||||||
|
sed -i "s|.*env\[TMP\].*|env\[TMP\] = /tmp|" "$PHP_CONF"
|
||||||
|
sed -i "s|.*env\[TMPDIR\].*|env\[TMPDIR\] = /tmp|" "$PHP_CONF"
|
||||||
|
sed -i "s|.*env\[TEMP\].*|env\[TEMP\] = /tmp|" "$PHP_CONF"
|
||||||
|
sed -i "s|;clear_env = no|clear_env = no|" "$PHP_CONF"
|
||||||
|
|
||||||
|
echo "
|
||||||
|
Tunning PHP.ini...
|
||||||
|
"
|
||||||
|
# Change values in php.ini (increase max file size)
|
||||||
|
# max_execution_time
|
||||||
|
sed -i "s|max_execution_time =.*|max_execution_time = 3500|g" "$PHP_INI"
|
||||||
|
# max_input_time
|
||||||
|
sed -i "s|max_input_time =.*|max_input_time = 3600|g" "$PHP_INI"
|
||||||
|
# memory_limit
|
||||||
|
sed -i "s|memory_limit =.*|memory_limit = 512M|g" "$PHP_INI"
|
||||||
|
# post_max
|
||||||
|
sed -i "s|post_max_size =.*|post_max_size = 1025M|g" "$PHP_INI"
|
||||||
|
# upload_max
|
||||||
|
sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1024M|g" "$PHP_INI"
|
||||||
|
|
||||||
|
phpenmod opcache
|
||||||
|
{
|
||||||
|
|
||||||
|
echo "# OPcache settings for Nextcloud"
|
||||||
|
echo "opcache.enable=1"
|
||||||
|
echo "opcache.enable_cli=1"
|
||||||
|
echo "opcache.interned_strings_buffer=8"
|
||||||
|
echo "opcache.max_accelerated_files=10000"
|
||||||
|
echo "opcache.memory_consumption=256"
|
||||||
|
echo "opcache.save_comments=1"
|
||||||
|
echo "opcache.revalidate_freq=1"
|
||||||
|
echo "opcache.validate_timestamps=1"
|
||||||
|
} >> "$PHP_INI"
|
||||||
|
|
||||||
|
update-alternatives --set php /usr/bin/php"$STABLE_PHP"
|
||||||
|
update-alternatives --set php-fpm.sock /run/php/php"$STABLE_PHP"-fpm.sock
|
||||||
|
update-alternatives --set php-cgi /usr/bin/php-cgi"$STABLE_PHP"
|
||||||
|
update-alternatives --set php-cgi-bin /usr/lib/cgi-bin/php"$STABLE_PHP"
|
||||||
|
update-alternatives --set phar /usr/bin/phar"$STABLE_PHP"
|
||||||
|
update-alternatives --set phar.phar /usr/bin/phar.phar"$STABLE_PHP"
|
||||||
|
|
||||||
|
systemctl restart php"$PHPVER"-fpm.service
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#Start over
|
#Start over
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GPLv3 or later.
|
# GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Simple Jibri Env tester
|
# Simple Jibri Env tester
|
||||||
# SwITNet Ltd © - 2023, https://switnet.net/
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
||||||
# GNU GPLv3 or later.
|
# GNU GPLv3 or later.
|
||||||
|
|
||||||
while getopts m: option
|
while getopts m: option
|
||||||
|
|
Loading…
Reference in New Issue