Merge branch 'stretch' of https://github.com/bashrc/freedombone
This commit is contained in:
commit
e79f2c9390
|
@ -203,6 +203,7 @@ function install_apps_selected {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
app_index=$((app_index+1))
|
app_index=$((app_index+1))
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# if no apps to be installed then don't do anything
|
# if no apps to be installed then don't do anything
|
||||||
|
|
|
@ -30,6 +30,7 @@ VARIANTS="full full-vim writer"
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
MINIMUM_RAM_MB=2000
|
||||||
|
|
||||||
ETHERPAD_DOMAIN_NAME=
|
ETHERPAD_DOMAIN_NAME=
|
||||||
ETHERPAD_CODE=
|
ETHERPAD_CODE=
|
||||||
|
|
|
@ -30,6 +30,7 @@ VARIANTS='full full-vim social'
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
|
||||||
GNUSOCIAL_DOMAIN_NAME=
|
GNUSOCIAL_DOMAIN_NAME=
|
||||||
GNUSOCIAL_CODE=
|
GNUSOCIAL_CODE=
|
||||||
|
@ -581,6 +582,7 @@ function remove_gnusocial {
|
||||||
fi
|
fi
|
||||||
kill_pid=$(pgrep "/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/queuedaemon.php" | head -n 1)
|
kill_pid=$(pgrep "/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/queuedaemon.php" | head -n 1)
|
||||||
kill -9 "$kill_pid"
|
kill -9 "$kill_pid"
|
||||||
|
pkill "$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/queuedaemon.php"
|
||||||
|
|
||||||
if [ -d "/var/www/$GNUSOCIAL_DOMAIN_NAME" ]; then
|
if [ -d "/var/www/$GNUSOCIAL_DOMAIN_NAME" ]; then
|
||||||
rm -rf "/var/www/$GNUSOCIAL_DOMAIN_NAME"
|
rm -rf "/var/www/$GNUSOCIAL_DOMAIN_NAME"
|
||||||
|
@ -911,8 +913,8 @@ function install_gnusocial_main {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_gnusocial {
|
function install_gnusocial {
|
||||||
if [ ! "$ONION_ONLY" ]; then
|
if [[ "$ONION_ONLY" != 'no' ]]; then
|
||||||
ONION_ONLY='no'
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_gnusocial_main
|
install_gnusocial_main
|
||||||
|
@ -935,9 +937,12 @@ function install_gnusocial {
|
||||||
sed -i 's|"theme":.*|"theme": "base16-apathy.css",|g' "/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/static/config.json"
|
sed -i 's|"theme":.*|"theme": "base16-apathy.css",|g' "/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/static/config.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# unleash the daemons!
|
# this has to be run as root initially, otherwise database tables
|
||||||
|
# don't get created
|
||||||
cd "/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs" || exit 236482684
|
cd "/var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs" || exit 236482684
|
||||||
php scripts/checkschema.php
|
php scripts/checkschema.php
|
||||||
|
sh scripts/startdaemons.sh
|
||||||
|
|
||||||
/etc/cron.hourly/gnusocial-daemons
|
/etc/cron.hourly/gnusocial-daemons
|
||||||
|
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
|
@ -30,6 +30,7 @@ VARIANTS='full full-vim social'
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
|
||||||
HUBZILLA_DOMAIN_NAME=
|
HUBZILLA_DOMAIN_NAME=
|
||||||
HUBZILLA_CODE=
|
HUBZILLA_CODE=
|
||||||
|
|
|
@ -32,6 +32,7 @@ VARIANTS=""
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=0
|
SHOW_ON_ABOUT=0
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
|
||||||
VIDEOBRIDGE_PORT=5347
|
VIDEOBRIDGE_PORT=5347
|
||||||
JITSI_ONION_PORT=8102
|
JITSI_ONION_PORT=8102
|
||||||
|
|
|
@ -36,6 +36,8 @@ VARIANTS='full full-vim chat'
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
MINIMUM_RAM_MB=1500
|
||||||
|
|
||||||
MATRIX_DOMAIN_NAME=
|
MATRIX_DOMAIN_NAME=
|
||||||
MATRIX_CODE=
|
MATRIX_CODE=
|
||||||
|
|
|
@ -30,6 +30,7 @@ VARIANTS='full full-vim media'
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
|
||||||
POSTACTIV_DOMAIN_NAME=
|
POSTACTIV_DOMAIN_NAME=
|
||||||
POSTACTIV_CODE=
|
POSTACTIV_CODE=
|
||||||
|
@ -595,6 +596,7 @@ function remove_postactiv {
|
||||||
fi
|
fi
|
||||||
kill_pid=$(pgrep "/var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/queuedaemon.php" | head -n 1)
|
kill_pid=$(pgrep "/var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/queuedaemon.php" | head -n 1)
|
||||||
kill -9 "$kill_pid"
|
kill -9 "$kill_pid"
|
||||||
|
pkill "$POSTACTIV_DOMAIN_NAME/htdocs/scripts/queuedaemon.php"
|
||||||
|
|
||||||
if [ -d "/var/www/$POSTACTIV_DOMAIN_NAME" ]; then
|
if [ -d "/var/www/$POSTACTIV_DOMAIN_NAME" ]; then
|
||||||
rm -rf "/var/www/$POSTACTIV_DOMAIN_NAME"
|
rm -rf "/var/www/$POSTACTIV_DOMAIN_NAME"
|
||||||
|
@ -926,8 +928,8 @@ function install_postactiv_main {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_postactiv {
|
function install_postactiv {
|
||||||
if [ ! "$ONION_ONLY" ]; then
|
if [[ "$ONION_ONLY" != 'no' ]]; then
|
||||||
ONION_ONLY='no'
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_postactiv_main
|
install_postactiv_main
|
||||||
|
@ -952,7 +954,12 @@ function install_postactiv {
|
||||||
|
|
||||||
expire_gnusocial_posts "$POSTACTIV_DOMAIN_NAME" "postactiv" "$POSTACTIV_EXPIRE_MONTHS"
|
expire_gnusocial_posts "$POSTACTIV_DOMAIN_NAME" "postactiv" "$POSTACTIV_EXPIRE_MONTHS"
|
||||||
|
|
||||||
# unleash the daemons!
|
# this has to be run as root initially, otherwise database tables
|
||||||
|
# don't get created
|
||||||
|
cd "/var/www/$POSTACTIV_DOMAIN_NAME/htdocs" || exit 3658254254
|
||||||
|
sh scripts/startdaemons.sh
|
||||||
|
php scripts/checkschema.php
|
||||||
|
|
||||||
/etc/cron.hourly/postactiv-daemons
|
/etc/cron.hourly/postactiv-daemons
|
||||||
|
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
|
@ -30,6 +30,7 @@ VARIANTS='full full-vim chat'
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
NOT_ON_ONION=1
|
||||||
|
|
||||||
RIOT_VERSION='0.13.3'
|
RIOT_VERSION='0.13.3'
|
||||||
RIOT_FILENAME="riot-v${RIOT_VERSION}"
|
RIOT_FILENAME="riot-v${RIOT_VERSION}"
|
||||||
|
|
|
@ -272,6 +272,39 @@ function get_apps_installed_names {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function app_not_on_onion_only {
|
||||||
|
app_name="$1"
|
||||||
|
|
||||||
|
read_config_param ONION_ONLY
|
||||||
|
|
||||||
|
if [[ "$ONION_ONLY" != 'no' ]]; then
|
||||||
|
if grep -q "NOT_ON_ONION=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
|
||||||
|
echo "0"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function enough_ram_for_app {
|
||||||
|
app_name="$1"
|
||||||
|
|
||||||
|
if ! grep -q "MINIMUM_RAM_MB=" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
|
||||||
|
echo "0"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
minimum_ram_MB=$(grep "MINIMUM_RAM_MB=" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}" | head -n 1 | awk -F '=' '{print $2}')
|
||||||
|
minimum_ram_bytes=$((minimum_ram_MB * 1024))
|
||||||
|
|
||||||
|
ram_available=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||||
|
if [ "$ram_available" -lt "$minimum_ram_bytes" ]; then
|
||||||
|
echo "1"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "0"
|
||||||
|
}
|
||||||
|
|
||||||
# detects what apps are available
|
# detects what apps are available
|
||||||
function detect_apps {
|
function detect_apps {
|
||||||
FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*"
|
FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*"
|
||||||
|
@ -285,12 +318,15 @@ function detect_apps {
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
function_check get_apps_installed
|
function_check get_apps_installed
|
||||||
|
@ -318,6 +354,8 @@ function detect_installable_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
|
if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
variants_list=$(app_variants "$filename")
|
variants_list=$(app_variants "$filename")
|
||||||
|
@ -331,6 +369,8 @@ function detect_installable_apps {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,6 +390,8 @@ function detect_installed_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
|
if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
|
@ -360,6 +402,8 @@ function detect_installed_apps {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +429,8 @@ function choose_apps_for_variant {
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
if grep -q "VARIANTS=" "${filename}"; then
|
if grep -q "VARIANTS=" "${filename}"; then
|
||||||
|
@ -408,6 +453,8 @@ function choose_apps_for_variant {
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
function_check get_apps_installed
|
function_check get_apps_installed
|
||||||
|
|
Loading…
Reference in New Issue