App interface compliance

This commit is contained in:
Bob Mottram 2016-07-05 20:07:43 +01:00
parent 9eba0735ad
commit 7a7d4223b6
17 changed files with 188 additions and 151 deletions

View File

@ -288,7 +288,7 @@ if grep -q "install_sip" $COMPLETION_FILE; then
fi
fi
if grep -q "install_gnu_social" $COMPLETION_FILE; then
if grep -q "install_gnusocial" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
if [ -d /var/www/$MICROBLOG_DOMAIN_NAME ]; then
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs

View File

@ -49,12 +49,12 @@ function configure_firewall_for_dlna {
echo 'configure_firewall_for_dlna' >> $COMPLETION_FILE
}
function backup_dlna_server {
function backup_dlna {
echo ''
}
function remove_dlna_server {
if ! grep -Fxq "install_dlna_server" $COMPLETION_FILE; then
function remove_dlna {
if ! grep -Fxq "install_dlna" $COMPLETION_FILE; then
return
fi
service minidlna stop
@ -66,11 +66,11 @@ function remove_dlna_server {
iptables -D INPUT -p tcp --dport 8200 -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
sed -i '/install_dlna_server/d' $COMPLETION_FILE
sed -i '/install_dlna/d' $COMPLETION_FILE
}
function install_dlna_server {
if grep -Fxq "install_dlna_server" $COMPLETION_FILE; then
function install_dlna {
if grep -Fxq "install_dlna" $COMPLETION_FILE; then
return
fi
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
@ -121,7 +121,7 @@ function install_dlna_server {
function_check configure_firewall_for_dlna
configure_firewall_for_dlna
echo 'install_dlna_server' >> $COMPLETION_FILE
echo 'install_dlna' >> $COMPLETION_FILE
}
function script_for_attaching_usb_drive {

View File

@ -8,7 +8,7 @@
#
# Freedom in the Cloud
#
# Editor applications
# Emacs application
#
# License
# =======
@ -28,8 +28,21 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function install_editor {
if grep -Fxq "install_editor" $COMPLETION_FILE; then
function backup_emacs {
echo ''
}
function remove_emacs {
if ! grep -Fxq "install_emacs" $COMPLETION_FILE; then
return
fi
apt-get -y remove --purge emacs24
update-alternatives --set editor /usr/bin/nano
sed -i '/install_emacs/d' $COMPLETION_FILE
}
function install_emacs {
if grep -Fxq "install_emacs" $COMPLETION_FILE; then
return
fi
update-alternatives --set editor /usr/bin/emacs24
@ -107,7 +120,7 @@ function install_editor {
cp /home/$MY_USERNAME/.emacs /root/.emacs
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.emacs
echo 'install_editor' >> $COMPLETION_FILE
echo 'install_emacs' >> $COMPLETION_FILE
}
# NOTE: deliberately no exit 0

View File

@ -78,6 +78,10 @@ GPGIT_COMMIT='583dc76119f19420f8a33f606744faa7c8922738'
# refresh gpg keys every few hours
REFRESH_GPG_KEYS_HOURS=2
function backup_email {
echo ''
}
function configure_firewall_for_email {
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" ]]; then
return
@ -701,11 +705,15 @@ function import_email {
fi
}
function configure_email {
function remove_email {
echo ''
}
function install_email {
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
if grep -Fxq "configure_email" $COMPLETION_FILE; then
if grep -Fxq "install_email" $COMPLETION_FILE; then
return
fi
apt-get -y remove postfix
@ -928,7 +936,7 @@ function configure_email {
function_check configure_firewall_for_email
configure_firewall_for_email
echo 'configure_email' >> $COMPLETION_FILE
echo 'install_email' >> $COMPLETION_FILE
}
function create_procmail {
@ -1470,7 +1478,7 @@ function configure_gpg {
MY_GPG_PUBLIC_KEY=/tmp/public_key.gpg
su -c "gpg --output $MY_GPG_PUBLIC_KEY --armor --export $MY_GPG_PUBLIC_KEY_ID" - $MY_USERNAME
if grep -q "configure_email" $COMPLETION_FILE; then
if grep -q "install_email" $COMPLETION_FILE; then
if ! grep -q $"Change your GPG password" /home/$MY_USERNAME/README; then
echo '' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README

View File

@ -47,12 +47,12 @@ SHARINGS_COMMIT='d5c6c7f855d9afff9086c09ea706f38c859bc0d4'
SHARINGS_THEME_REPO="http://git.lasindias.club/manuel/SharingsTheme"
SHARINGS_THEME_COMMIT='7106c7ef03'
function backup_gnu_social {
function backup_gnusocial {
echo ''
}
function remove_gnu_social {
if ! grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
function remove_gnusocial {
if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
return
fi
nginx_dissite $MICROBLOG_DOMAIN_NAME
@ -66,11 +66,11 @@ function remove_gnu_social {
drop_database gnusocial
function_check remove_onion_service
remove_onion_service microblog ${MICROBLOG_ONION_PORT}
sed -i '/install_gnu_social/d' $COMPLETION_FILE
sed -i '/install_gnusocial/d' $COMPLETION_FILE
sed -i '/GNU Social /d' $COMPLETION_FILE
}
function install_gnu_social {
function install_gnusocial {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -96,7 +96,7 @@ function install_gnu_social {
echo 'fi' >> /etc/cron.hourly/gnusocial-daemons
chmod +x /etc/cron.hourly/gnusocial-daemons
if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
if grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
return
fi
@ -360,10 +360,10 @@ function install_gnu_social {
echo "GNU Social onion domain:${MICROBLOG_ONION_HOSTNAME}" >> $COMPLETION_FILE
echo "GNU Social domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
echo 'install_gnu_social' >> $COMPLETION_FILE
echo 'install_gnusocial' >> $COMPLETION_FILE
}
function install_gnu_social_plugin_sharings {
function install_gnusocial_plugin_sharings {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -377,7 +377,7 @@ function install_gnu_social_plugin_sharings {
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "GNU Social sharings plugin commit" "$SHARINGS_COMMIT" $SHARINGS_REPO
if grep -Fxq "install_gnu_social_plugin_sharings" $COMPLETION_FILE; then
if grep -Fxq "install_gnusocial_plugin_sharings" $COMPLETION_FILE; then
return
fi
@ -422,10 +422,10 @@ function install_gnu_social_plugin_sharings {
else
sed -i "s|GNU Social sharings plugin commit.*|GNU Social sharings plugin commit:$SHARINGS_COMMIT|g" $COMPLETION_FILE
fi
echo 'install_gnu_social_plugin_sharings' >> $COMPLETION_FILE
echo 'install_gnusocial_plugin_sharings' >> $COMPLETION_FILE
}
function install_gnu_social_plugin_sharings_theme {
function install_gnusocial_plugin_sharings_theme {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -439,7 +439,7 @@ function install_gnu_social_plugin_sharings_theme {
function_check set_repo_commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins "GNU Social sharings theme plugin commit" "$SHARINGS_THEME_COMMIT" $SHARINGS_THEME_REPO
if grep -Fxq "install_gnu_social_plugin_sharings_theme" $COMPLETION_FILE; then
if grep -Fxq "install_gnusocial_plugin_sharings_theme" $COMPLETION_FILE; then
return
fi
@ -472,7 +472,7 @@ function install_gnu_social_plugin_sharings_theme {
else
sed -i "s|GNU Social sharings plugin theme commit.*|GNU Social sharings plugin theme commit:$SHARINGS_THEME_COMMIT|g" $COMPLETION_FILE
fi
echo 'install_gnu_social_plugin_sharings_theme' >> $COMPLETION_FILE
echo 'install_gnusocial_plugin_sharings_theme' >> $COMPLETION_FILE
}
function expire_gnu_social_posts {
@ -533,7 +533,7 @@ function expire_gnu_social_posts {
fi
}
function install_gnu_social_theme {
function install_gnusocial_theme {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -549,7 +549,7 @@ function install_gnu_social_theme {
fi
fi
if grep -Fxq "install_gnu_social_theme" $COMPLETION_FILE; then
if grep -Fxq "install_gnusocial_theme" $COMPLETION_FILE; then
return
fi
@ -633,10 +633,10 @@ function install_gnu_social_theme {
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
echo 'install_gnu_social_theme' >> $COMPLETION_FILE
echo 'install_gnusocial_theme' >> $COMPLETION_FILE
}
function install_gnu_social_markdown {
function install_gnusocial_markdown {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -647,7 +647,7 @@ function install_gnu_social_markdown {
function_check set_repo_commit
set_repo_commit $MICROBLOG_PATH/local/plugins/Markdown "GNU Social Markdown commit" "$MICROBLOG_MARKDOWN_COMMIT" $MICROBLOG_MARKDOWN_REPO
if grep -Fxq "install_gnu_social_markdown" $COMPLETION_FILE; then
if grep -Fxq "install_gnusocial_markdown" $COMPLETION_FILE; then
return
fi
@ -678,7 +678,7 @@ function install_gnu_social_markdown {
chown -R www-data:www-data $MICROBLOG_PATH
echo 'install_gnu_social_markdown' >> $COMPLETION_FILE
echo 'install_gnusocial_markdown' >> $COMPLETION_FILE
}
# NOTE: deliberately there is no "exit 0"

View File

@ -34,16 +34,17 @@ IRC_ONION_PORT=6697
# An optional password to log into IRC. This applies to all users
IRC_PASSWORD=
function backup_irc_server {
echo ''
function backup_irc {
echo ''
}
function remove_irc_server {
if ! grep -Fxq "install_irc_server" $COMPLETION_FILE; then
function remove_irc {
if ! grep -Fxq "install_irc" $COMPLETION_FILE; then
return
fi
systemctl stop ngircd
apt-get -y remove --purge ngircd
apt-get -y remove --purge irssi
if [ -d /etc/ngircd ]; then
rm -rf /etc/ngircd
fi
@ -53,7 +54,7 @@ function remove_irc_server {
save_firewall_settings
function_check remove_onion_service
remove_onion_service irc ${IRC_ONION_PORT}
sed -i '/install_irc_server/d' $COMPLETION_FILE
sed -i '/install_irc/d' $COMPLETION_FILE
sed -i '/IRC /d' $COMPLETION_FILE
sed -i '/configure_firewall_for_irc/d' $COMPLETION_FILE
}
@ -81,11 +82,11 @@ function configure_firewall_for_irc {
echo 'configure_firewall_for_irc' >> $COMPLETION_FILE
}
function install_irc_server {
function install_irc {
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
if grep -Fxq "install_irc_server" $COMPLETION_FILE; then
if grep -Fxq "install_irc" $COMPLETION_FILE; then
return
fi
apt-get -y install ngircd
@ -199,7 +200,7 @@ function install_irc_server {
function_check configure_firewall_for_irc
configure_firewall_for_irc
echo 'install_irc_server' >> $COMPLETION_FILE
echo 'install_irc' >> $COMPLETION_FILE
}
function install_irc_client {

View File

@ -39,6 +39,10 @@ function backup_mediagoblin {
echo ''
}
function remove_mediagoblin {
echo ''
}
function install_mediagoblin {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return

View File

@ -40,12 +40,12 @@ RSS_READER_PATH=/etc/share/tt-rss
RSS_READER_GNUSOCIAL_REPO="https://github.com/bashrc/ttrss-gnusocial"
RSS_READER_GNUSOCIAL_COMMIT='8b92b8f5db7b0d12459c7bd86a50f48815efe642'
function backup_rss_reader {
function backup_rss {
echo ''
}
function remove_rss_reader {
if ! grep -Fxq "install_rss_reader" $COMPLETION_FILE; then
function remove_rss {
if ! grep -Fxq "install_rss" $COMPLETION_FILE; then
return
fi
nginx_dissite $RSS_READER_DOMAIN_NAME
@ -59,11 +59,11 @@ function remove_rss_reader {
fi
function_check drop_database
drop_database ttrss
sed -i '/install_rss_reader/d' $COMPLETION_FILE
sed -i '/install_rss/d' $COMPLETION_FILE
sed -i '/RSS /d' $COMPLETION_FILE
}
function rss_reader_modifications {
function rss_modifications {
# modify the rss reader to use a socks5 proxy rather than a http proxy
if [ ! -d $RSS_READER_PATH ]; then
return
@ -80,7 +80,7 @@ function rss_reader_modifications {
chmod a+x $RSS_READER_PATH
}
function install_rss_reader {
function install_rss {
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -89,7 +89,7 @@ function install_rss_reader {
function_check set_repo_commit
set_repo_commit $RSS_READER_PATH "RSS reader commit" "$RSS_READER_COMMIT" $RSS_READER_REPO
if grep -Fxq "install_rss_reader" $COMPLETION_FILE; then
if grep -Fxq "install_rss" $COMPLETION_FILE; then
return
fi
@ -120,8 +120,8 @@ function install_rss_reader {
function_check repair_databases_script
repair_databases_script
function_check get_mariadb_rss_reader_admin_password
get_mariadb_rss_reader_admin_password
function_check get_mariadb_rss_admin_password
get_mariadb_rss_admin_password
if [ ! $RSS_READER_ADMIN_PASSWORD ]; then
if [ -f $IMAGE_PASSWORD_FILE ]; then
RSS_READER_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
@ -286,8 +286,8 @@ function install_rss_reader {
function_check run_query
run_query ttrss "update ttrss_users set pwd_hash = 'SHA1:${RSS_READER_ADMIN_PASSWORD_HASH}', salt= '' WHERE login = 'admin';"
function_check rss_reader_modifications
rss_reader_modifications
function_check rss_modifications
rss_modifications
function_check configure_php
configure_php
@ -334,10 +334,10 @@ function install_rss_reader {
chmod 600 /home/$MY_USERNAME/README
fi
echo 'install_rss_reader' >> $COMPLETION_FILE
echo 'install_rss' >> $COMPLETION_FILE
}
function install_rss_reader_gnusocial {
function install_rss_gnusocial {
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
@ -356,7 +356,7 @@ function install_rss_reader_gnusocial {
set_repo_commit $RSS_READER_GNUSOCIAL_PATH "RSS reader gnusocial commit" "$RSS_READER_GNUSOCIAL_COMMIT" $RSS_READER_GNUSOCIAL_REPO
chown -R www-data:www-data $RSS_READER_GNUSOCIAL_PATH
if grep -Fxq "install_rss_reader_gnusocial" $COMPLETION_FILE; then
if grep -Fxq "install_rss_gnusocial" $COMPLETION_FILE; then
return
fi
@ -379,7 +379,7 @@ function install_rss_reader_gnusocial {
fi
chown -R www-data:www-data $RSS_READER_GNUSOCIAL_PATH
echo 'install_rss_reader_gnusocial' >> $COMPLETION_FILE
echo 'install_rss_gnusocial' >> $COMPLETION_FILE
}
function install_rss_mobile_reader {

View File

@ -8,7 +8,7 @@
#
# Freedom in the Cloud
#
# Search engine application
# Searx engine application
#
# License
# =======
@ -28,40 +28,40 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SEARCH_ENGINE_REPO="https://github.com/asciimoo/searx"
SEARCH_ENGINE_COMMIT='fee556c9904637051a9ba874ba7e71cd9f10789f'
SEARCH_ENGINE_PATH=/etc
SEARCH_ENGINE_ONION_PORT=8094
SEARCH_ENGINE_ONION_HOSTNAME=
SEARCH_ENGINE_LOGIN_TEXT=$"Search engine login"
SEARCH_ENGINE_PASSWORD=
SEARX_REPO="https://github.com/asciimoo/searx"
SEARX_COMMIT='fee556c9904637051a9ba874ba7e71cd9f10789f'
SEARX_PATH=/etc
SEARX_ONION_PORT=8094
SEARX_ONION_HOSTNAME=
SEARX_LOGIN_TEXT=$"Search engine login"
SEARX_PASSWORD=
function backup_search_engine {
echo ''
function backup_searx {
echo ''
}
function remove_search_engine {
if ! grep -Fxq "install_search_engine" $COMPLETION_FILE; then
function remove_searx {
if ! grep -Fxq "install_searx" $COMPLETION_FILE; then
return
fi
systemctl stop searx
systemctl disable searx
rm /etc/systemd/system/searx.service
function_check remove_onion_service
remove_onion_service searx ${SEARCH_ENGINE_ONION_PORT}
remove_onion_service searx ${SEARX_ONION_PORT}
userdel -r searx
nginx_dissite searx
if [ -f /etc/nginx/sites-available/searx ]; then
rm /etc/nginx/sites-available/searx
fi
if [ -d ${SEARCH_ENGINE_PATH}/searx ]; then
rm -rf ${SEARCH_ENGINE_PATH}/searx
if [ -d ${SEARX_PATH}/searx ]; then
rm -rf ${SEARX_PATH}/searx
fi
sed -i '/install_search_engine/d' $COMPLETION_FILE
sed -i '/install_searx/d' $COMPLETION_FILE
sed -i '/Search engine /d' $COMPLETION_FILE
}
function install_search_engine {
function install_searx {
# Note: currently socks5 outgoing proxies to other search engines does not work
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
@ -72,26 +72,26 @@ function install_search_engine {
fi
# update to a new commit if needed
set_repo_commit $SEARCH_ENGINE_PATH/searx "Search engine commit" "$SEARCH_ENGINE_COMMIT" $SEARCH_ENGINE_REPO
set_repo_commit $SEARX_PATH/searx "Search engine commit" "$SEARX_COMMIT" $SEARX_REPO
if grep "Search engine key" $COMPLETION_FILE; then
if [ -f ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml ]; then
if [ -f ${SEARX_PATH}/searx/searx/settings.yml ]; then
# note: this might change to a --tor option in a later version
if ! grep 'socks5://127.0.0.1:9050' ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml; then
echo 'outgoing: # communication with search engines' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' proxies:' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' http : socks5://127.0.0.1:9050' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' https: socks5://127.0.0.1:9050' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
if ! grep 'socks5://127.0.0.1:9050' ${SEARX_PATH}/searx/searx/settings.yml; then
echo 'outgoing: # communication with search engines' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' proxies:' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' http : socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' https: socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
fi
SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
SEARX_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings.yml
if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then
SEARCH_ENGINE_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\/' ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
SEARX_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings.yml
fi
fi
fi
if grep -Fxq "install_search_engine" $COMPLETION_FILE; then
if grep -Fxq "install_searx" $COMPLETION_FILE; then
return
fi
@ -130,31 +130,31 @@ function install_search_engine {
exit 63738
fi
if [ ! -d $SEARCH_ENGINE_PATH ]; then
mkdir -p $SEARCH_ENGINE_PATH
if [ ! -d $SEARX_PATH ]; then
mkdir -p $SEARX_PATH
fi
# clone the repo
cd $SEARCH_ENGINE_PATH
cd $SEARX_PATH
function_check git_clone
git_clone $SEARCH_ENGINE_REPO searx
git checkout $SEARCH_ENGINE_COMMIT -b $SEARCH_ENGINE_COMMIT
git_clone $SEARX_REPO searx
git checkout $SEARX_COMMIT -b $SEARX_COMMIT
if ! grep -q "Search engine commit" $COMPLETION_FILE; then
echo "Search engine commit:$SEARCH_ENGINE_COMMIT" >> $COMPLETION_FILE
echo "Search engine commit:$SEARX_COMMIT" >> $COMPLETION_FILE
else
sed -i "s/Search engine commit.*/Search engine commit:$SEARCH_ENGINE_COMMIT/g" $COMPLETION_FILE
sed -i "s/Search engine commit.*/Search engine commit:$SEARX_COMMIT/g" $COMPLETION_FILE
fi
# create an onion service
SEARCH_ENGINE_ONION_HOSTNAME=$(add_onion_service searx 80 ${SEARCH_ENGINE_ONION_PORT})
SEARX_ONION_HOSTNAME=$(add_onion_service searx 80 ${SEARX_ONION_PORT})
if ! grep "Search engine onion domain" $COMPLETION_FILE; then
echo "Search engine onion domain:${SEARCH_ENGINE_ONION_HOSTNAME}" >> $COMPLETION_FILE
echo "Search engine onion domain:${SEARX_ONION_HOSTNAME}" >> $COMPLETION_FILE
else
sed -i "s|Search engine onion domain.*|Search engine onion domain:${SEARCH_ENGINE_ONION_HOSTNAME}|g" $COMPLETION_FILE
sed -i "s|Search engine onion domain.*|Search engine onion domain:${SEARX_ONION_HOSTNAME}|g" $COMPLETION_FILE
fi
# an unprivileged user to run as
useradd -d ${SEARCH_ENGINE_PATH}/searx/ -s /bin/false searx
useradd -d ${SEARX_PATH}/searx/ -s /bin/false searx
adduser searx debian-tor
# daemon
@ -167,8 +167,8 @@ function install_search_engine {
echo 'Type=simple' >> /etc/systemd/system/searx.service
echo 'User=searx' >> /etc/systemd/system/searx.service
echo 'Group=searx' >> /etc/systemd/system/searx.service
echo "WorkingDirectory=${SEARCH_ENGINE_PATH}/searx" >> /etc/systemd/system/searx.service
echo "ExecStart=/usr/bin/python ${SEARCH_ENGINE_PATH}/searx/searx/webapp.py" >> /etc/systemd/system/searx.service
echo "WorkingDirectory=${SEARX_PATH}/searx" >> /etc/systemd/system/searx.service
echo "ExecStart=/usr/bin/python ${SEARX_PATH}/searx/searx/webapp.py" >> /etc/systemd/system/searx.service
echo 'Restart=always' >> /etc/systemd/system/searx.service
echo 'Environment="USER=searx"' >> /etc/systemd/system/searx.service
echo '' >> /etc/systemd/system/searx.service
@ -177,9 +177,9 @@ function install_search_engine {
# create a webserver file
echo 'server {' > /etc/nginx/sites-available/searx
echo " listen 127.0.0.1:${SEARCH_ENGINE_ONION_PORT} default_server;" >> /etc/nginx/sites-available/searx
echo " root ${SEARCH_ENGINE_PATH}/searx;" >> /etc/nginx/sites-available/searx
echo " server_name ${SEARCH_ENGINE_ONION_HOSTNAME};" >> /etc/nginx/sites-available/searx
echo " listen 127.0.0.1:${SEARX_ONION_PORT} default_server;" >> /etc/nginx/sites-available/searx
echo " root ${SEARX_PATH}/searx;" >> /etc/nginx/sites-available/searx
echo " server_name ${SEARX_ONION_HOSTNAME};" >> /etc/nginx/sites-available/searx
echo ' access_log off;' >> /etc/nginx/sites-available/searx
echo " error_log /var/log/searx_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/searx
echo '' >> /etc/nginx/sites-available/searx
@ -198,7 +198,7 @@ function install_search_engine {
echo ' proxy_set_header X-Forwarded-Proto $scheme;' >> /etc/nginx/sites-available/searx
echo ' proxy_redirect off;' >> /etc/nginx/sites-available/searx
echo " auth_basic \"${SEARCH_ENGINE_LOGIN_TEXT}\";" >> /etc/nginx/sites-available/searx
echo " auth_basic \"${SEARX_LOGIN_TEXT}\";" >> /etc/nginx/sites-available/searx
echo ' auth_basic_user_file /etc/nginx/.htpasswd;' >> /etc/nginx/sites-available/searx
echo ' }' >> /etc/nginx/sites-available/searx
echo '' >> /etc/nginx/sites-available/searx
@ -216,25 +216,25 @@ function install_search_engine {
# replace the secret key
if ! grep "Search engine key" $COMPLETION_FILE; then
SEARCH_ENGINE_SECRET_KEY="$(create_password 30)"
echo "Search engine key:${SEARCH_ENGINE_SECRET_KEY}" >> $COMPLETION_FILE
SEARX_SECRET_KEY="$(create_password 30)"
echo "Search engine key:${SEARX_SECRET_KEY}" >> $COMPLETION_FILE
else
SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
SEARX_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
fi
sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings_robot.yml
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\/' ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\/' ${SEARCH_ENGINE_PATH}/searx/searx/settings_robot.yml
sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings.yml
sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings_robot.yml
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings.yml
sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings_robot.yml
# note: this might change to a --tor option in a later version
if ! grep 'socks5://127.0.0.1:9050' ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml; then
echo 'outgoing: # communication with search engines' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' proxies:' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' http : socks5://127.0.0.1:9050' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
echo ' https: socks5://127.0.0.1:9050' >> ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
if ! grep 'socks5://127.0.0.1:9050' ${SEARX_PATH}/searx/searx/settings.yml; then
echo 'outgoing: # communication with search engines' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' proxies:' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' http : socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
echo ' https: socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
fi
chown -R searx:searx ${SEARCH_ENGINE_PATH}/searx
chown -R searx:searx ${SEARX_PATH}/searx
# enable the site
nginx_ensite searx
@ -249,25 +249,25 @@ function install_search_engine {
systemctl start searx.service
if ! grep -q "Your search engine password is" /home/$MY_USERNAME/README; then
if [ ${#SEARCH_ENGINE_PASSWORD} -lt 8 ]; then
if [ ${#SEARX_PASSWORD} -lt 8 ]; then
if [ -f $IMAGE_PASSWORD_FILE ]; then
SEARCH_ENGINE_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
SEARX_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
else
SEARCH_ENGINE_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
fi
fi
echo "$SEARCH_ENGINE_PASSWORD" | htpasswd -i -s -c /etc/nginx/.htpasswd $MY_USERNAME
echo "$SEARX_PASSWORD" | htpasswd -i -s -c /etc/nginx/.htpasswd $MY_USERNAME
echo '' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo $'Search Engine' >> /home/$MY_USERNAME/README
echo '=============' >> /home/$MY_USERNAME/README
echo $"Search engine onion domain: ${SEARCH_ENGINE_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
echo $"Your search engine password is: $SEARCH_ENGINE_PASSWORD" >> /home/$MY_USERNAME/README
echo $"Search engine onion domain: ${SEARX_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
echo $"Your search engine password is: $SEARX_PASSWORD" >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
fi
echo 'install_search_engine' >> $COMPLETION_FILE
echo 'install_searx' >> $COMPLETION_FILE
}
# NOTE: deliberately no exit 0

View File

@ -45,7 +45,7 @@ TOXIC_COMMIT='cf16849b374e484a33a4dffa3dfb937b59d537f2'
TOXIC_FILE=/usr/local/bin/toxic
function backup_tox {
echo ''
echo ''
}
function remove_tox_node {
@ -246,4 +246,15 @@ function install_tox_client {
echo 'install_tox_client' >> $COMPLETION_FILE
}
function install_tox {
if ! grep -Fxq "install_tox" $COMPLETION_FILE; then
return
fi
configure_firewall_for_tox
install_tox_node
tox_avahi
install_tox_client
echo 'install_tox' >> $COMPLETION_FILE
}
# NOTE: deliberately no exit 0

View File

@ -28,12 +28,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function backup_intrusion_detection {
function backup_tripwire {
echo ''
}
function remove_intrusion_detection {
if ! grep -Fxq "intrusion_detection" $COMPLETION_FILE; then
function remove_tripwire {
if ! grep -Fxq "tripwire" $COMPLETION_FILE; then
return
fi
apt-get -y remove --purge tripwire
@ -41,11 +41,11 @@ function remove_intrusion_detection {
rm -rf /etc/tripwire
fi
rm /usr/bin/reset-tripwire
sed -i '/intrusion_detection/d' $COMPLETION_FILE
sed -i '/tripwire/d' $COMPLETION_FILE
}
function intrusion_detection {
if grep -Fxq "intrusion_detection" $COMPLETION_FILE; then
function install_tripwire {
if grep -Fxq "install_tripwire" $COMPLETION_FILE; then
return
fi
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
@ -98,7 +98,7 @@ function intrusion_detection {
' | reset-tripwire
echo 'intrusion_detection' >> $COMPLETION_FILE
echo 'install_tripwire' >> $COMPLETION_FILE
}
# NOTE: deliberately no exit 0

View File

@ -28,15 +28,15 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function backup_vpn_tunnel {
function backup_vpn {
echo ''
}
function remove_vpn_tunnel {
function remove_vpn {
apt-get -y remove --purge fastd
}
function install_vpn_tunnel {
function install_vpn {
if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
echo 'deb http://repo.universe-factory.net/debian/ sid main' >> /etc/apt/sources.list
gpg --keyserver pgpkeys.mit.edu --recv-key 16EF3F64CB201D9C

View File

@ -313,7 +313,7 @@ function backup_tor {
fi
}
function backup_rss_reader {
function backup_rss {
if grep -q "RSS reader domain" $COMPLETION_FILE; then
RSS_READER_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "RSS reader domain" | awk -F ':' '{print $2}')
if [ -d /etc/share/tt-rss ]; then
@ -650,7 +650,7 @@ if [[ $TEST_MODE == "no" ]]; then
backup_letsencrypt
backup_tor
backup_gnusocial
backup_rss_reader
backup_rss
backup_hubzilla
backup_syncthing
backup_mediagoblin

View File

@ -851,7 +851,7 @@ function restore_gnu_social {
fi
}
function restore_rss_reader {
function restore_rss {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'ttrss' ]]; then
return
@ -1278,7 +1278,7 @@ restore_mailing_list
restore_xmpp
restore_gnu_social
restore_hubzilla
restore_rss_reader
restore_rss
restore_syncthing
restore_mediagoblin
restore_gogs

View File

@ -717,7 +717,7 @@ function restore_gnu_social {
fi
}
function restore_rss_reader {
function restore_rss {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'ttrss' ]]; then
return
@ -1118,7 +1118,7 @@ restore_mailing_list
restore_xmpp
restore_gnu_social
restore_hubzilla
restore_rss_reader
restore_rss
restore_syncthing
restore_mediagoblin
restore_gogs

View File

@ -143,7 +143,7 @@ function get_mariadb_webmail_admin_password {
fi
}
function get_mariadb_rss_reader_admin_password {
function get_mariadb_rss_admin_password {
if [ -f /home/$MY_USERNAME/README ]; then
if grep -q "RSS reader admin password" /home/$MY_USERNAME/README; then
RSS_READER_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "RSS reader admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')

View File

@ -298,7 +298,7 @@ function setup_mesh {
}
function setup_email {
configure_email
install_email
create_procmail
handle_admin_emails
spam_filtering
@ -346,19 +346,19 @@ function setup_apps {
install_sip_turn
install_blog
mark_blog_domain
install_gnu_social
install_gnusocial
expire_gnu_social_posts
install_gnu_social_theme
install_gnu_social_markdown
install_gnu_social_plugin_sharings
install_gnu_social_plugin_sharings_theme
install_rss_reader
install_rss_reader_gnusocial
install_gnusocial_theme
install_gnusocial_markdown
install_gnusocial_plugin_sharings
install_gnusocial_plugin_sharings_theme
install_rss
install_rss_gnusocial
install_rss_mobile_reader
install_hubzilla
#install_webmail
#install_search_engine
install_dlna_server
install_dlna
#install_mediagoblin
#install_ipfs
repair_databases_script