Browse Source

Consolidate install functions

stockholm
Bob Mottram 5 years ago
parent
commit
5fb34df806
  1. 13
      src/freedombone-app-blog
  2. 8
      src/freedombone-app-email
  3. 1213
      src/freedombone-app-gnusocial
  4. 15
      src/freedombone-app-irc
  5. 14
      src/freedombone-app-rss
  6. 17
      src/freedombone-app-sip
  7. 13
      src/freedombone-app-xmpp
  8. 15
      src/freedombone-app-zeronet
  9. 4
      src/freedombone-utils-final
  10. 25
      src/freedombone-utils-setup

13
src/freedombone-app-blog

@ -63,15 +63,6 @@ function remove_blog {
sed -i '/Blog .*/d' $COMPLETION_FILE
}
function mark_blog_domain {
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
if ! grep -q "Blog domain:" $COMPLETION_FILE; then
echo "Blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
fi
}
function get_blog_admin_password {
if [ -f /home/$MY_USERNAME/README ]; then
if grep -q "Your blog password is" /home/$MY_USERNAME/README; then
@ -364,6 +355,10 @@ function install_blog {
function_check add_ddns_domain
add_ddns_domain $FULLBLOG_DOMAIN_NAME
if ! grep -q "Blog domain:" $COMPLETION_FILE; then
echo "Blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
fi
echo 'install_blog' >> $COMPLETION_FILE
}

8
src/freedombone-app-email

@ -652,8 +652,8 @@ function import_email {
function_check backup_to_friends_servers
backup_to_friends_servers
function_check intrusion_detection
intrusion_detection
function_check install_tripwire
install_tripwire
function_check split_gpg_key_into_fragments
split_gpg_key_into_fragments
@ -685,8 +685,8 @@ function import_email {
function_check backup_to_friends_servers
backup_to_friends_servers
function_check intrusion_detection
intrusion_detection
function_check install_tripwire
install_tripwire
function_check split_gpg_key_into_fragments
split_gpg_key_into_fragments

1213
src/freedombone-app-gnusocial

File diff suppressed because it is too large

15
src/freedombone-app-irc

@ -82,11 +82,11 @@ function configure_firewall_for_irc {
echo 'configure_firewall_for_irc' >> $COMPLETION_FILE
}
function install_irc {
function install_irc_server {
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" $COMPLETION_FILE; then
if grep -Fxq "install_irc_server" $COMPLETION_FILE; then
return
fi
apt-get -y install ngircd
@ -200,7 +200,7 @@ function install_irc {
function_check configure_firewall_for_irc
configure_firewall_for_irc
echo 'install_irc' >> $COMPLETION_FILE
echo 'install_irc_server' >> $COMPLETION_FILE
}
function install_irc_client {
@ -284,4 +284,13 @@ function install_irc_client {
echo 'install_irc_client' >> $COMPLETION_FILE
}
function install_irc {
if grep -Fxq "install_irc" $COMPLETION_FILE; then
return
fi
install_irc_server
install_irc_client
echo 'install_irc' >> $COMPLETION_FILE
}
# NOTE: deliberately no exit 0

14
src/freedombone-app-rss

@ -41,7 +41,7 @@ RSS_READER_GNUSOCIAL_REPO="https://github.com/bashrc/ttrss-gnusocial"
RSS_READER_GNUSOCIAL_COMMIT='8b92b8f5db7b0d12459c7bd86a50f48815efe642'
function backup_rss {
echo ''
echo ''
}
function remove_rss {
@ -80,7 +80,7 @@ function rss_modifications {
chmod a+x $RSS_READER_PATH
}
function install_rss {
function install_rss_main {
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 {
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" $COMPLETION_FILE; then
if grep -Fxq "install_rss_main" $COMPLETION_FILE; then
return
fi
@ -334,7 +334,7 @@ function install_rss {
chmod 600 /home/$MY_USERNAME/README
fi
echo 'install_rss' >> $COMPLETION_FILE
echo 'install_rss_main' >> $COMPLETION_FILE
}
function install_rss_gnusocial {
@ -442,4 +442,10 @@ function install_rss_mobile_reader {
echo 'install_rss_mobile_reader' >> $COMPLETION_FILE
}
function install_rss {
install_rss_main
install_rss_gnusocial
install_rss_mobile_reader
}
# NOTE: deliberately no exit 0

17
src/freedombone-app-sip

@ -36,7 +36,7 @@ VOIP_TURN_TLS_PORT=5349
VOIP_TURN_NONCE=
function backup_sip {
echo ''
echo ''
}
function remove_sip {
@ -159,11 +159,11 @@ function update_sipwitch_daemon {
systemctl start sipwitch
}
function install_sip {
function install_sip_main {
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" ]]; then
return
fi
if grep -Fxq "install_sip" $COMPLETION_FILE; then
if grep -Fxq "install_sip_main" $COMPLETION_FILE; then
return
fi
@ -246,7 +246,7 @@ function install_sip {
function_check configure_firewall_for_sip4
configure_firewall_for_sip4
echo 'install_sip' >> $COMPLETION_FILE
echo 'install_sip_main' >> $COMPLETION_FILE
}
function install_sip_turn {
@ -393,4 +393,13 @@ function install_sip_turn {
echo 'install_sip_turn' >> $COMPLETION_FILE
}
function install_sip {
if grep -Fxq "install_sip" $COMPLETION_FILE; then
return
fi
install_sip_main
update_sipwitch_daemon
echo 'install_sip' >> $COMPLETION_FILE
}}
# NOTE: deliberately no exit 0

13
src/freedombone-app-xmpp

@ -36,7 +36,7 @@ XMPP_CIPHERS='"EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+
XMPP_ECC_CURVE='"secp384r1"'
function backup_xmpp {
echo ''
echo ''
}
function configure_firewall_for_xmpp {
@ -157,14 +157,14 @@ function remove_xmpp {
sed '/XMPP /d' $COMPLETION_FILE
}
function install_xmpp {
function install_xmpp_main {
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
update_prosody_modules
if grep -Fxq "install_xmpp" $COMPLETION_FILE; then
if grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then
return
fi
apt-get -y install lua-sec lua-bitop
@ -334,7 +334,7 @@ function install_xmpp {
function_check configure_firewall_for_xmpp
configure_firewall_for_xmpp
echo 'install_xmpp' >> $COMPLETION_FILE
echo 'install_xmpp_main' >> $COMPLETION_FILE
}
function install_xmpp_client {
@ -407,4 +407,9 @@ function install_xmpp_client {
echo 'install_xmpp_client' >> $COMPLETION_FILE
}
function install_xmpp {
install_xmpp_main
install_xmpp_client
}
# NOTE: deliberately no exit 0

15
src/freedombone-app-zeronet

@ -46,7 +46,7 @@ ZERONET_ID_REPO="https://github.com/HelloZeroNet/ZeroID"
ZERONET_ID_COMMIT='ccf14fdc96fa9cdb2ddd8a7ab283a8e17a4f234b'
function backup_zeronet {
echo ''
echo ''
}
function remove_zeronet_blog {
@ -435,7 +435,7 @@ function install_zeronet_forum {
echo 'install_zeronet_forum' >> $COMPLETION_FILE
}
function install_zeronet {
function install_zeronet_main {
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
return
fi
@ -444,7 +444,7 @@ function install_zeronet {
function_check set_repo_commit
set_repo_commit $MESH_INSTALL_DIR/zeronet "ZeroNet commit" "$ZERONET_COMMIT" $ZERONET_REPO
if grep -Fxq "install_zeronet" $COMPLETION_FILE; then
if grep -Fxq "install_zeronet_main" $COMPLETION_FILE; then
return
fi
@ -455,7 +455,14 @@ function install_zeronet {
function_check configure_firewall_for_zeronet
configure_firewall_for_zeronet
echo 'install_zeronet' >> $COMPLETION_FILE
echo 'install_zeronet_main' >> $COMPLETION_FILE
}
function install_zeronet {
install_zeronet_main
install_zeronet_blog
install_zeronet_mail
install_zeronet_forum
}
# NOTE: deliberately no exit 0

4
src/freedombone-utils-final

@ -70,8 +70,8 @@ function install_final {
}
function setup_final {
function_check intrusion_detection
intrusion_detection
function_check install_tripwire
install_tripwire
function_check install_final
install_final

25
src/freedombone-utils-setup

@ -288,6 +288,7 @@ function setup_utils {
create_avahi_onion_domains
#install_atheros_wifi
route_outgoing_traffic_through_tor
upgrade_golang
}
function setup_mesh {
@ -326,43 +327,23 @@ function setup_web {
function setup_apps {
install_zeronet
install_zeronet_blog
install_zeronet_mail
install_zeronet_forum
install_syncthing
upgrade_golang
install_gogs
install_xmpp
install_xmpp_client
install_tox_node
install_tox_client
tox_avahi
install_irc_server
install_irc_client
install_tox
install_irc
install_mumble
install_sip
update_sipwitch_daemon
install_wiki
install_sip_turn
install_blog
mark_blog_domain
install_gnusocial
expire_gnu_social_posts
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
#install_mediagoblin
#install_ipfs
repair_databases_script
backup_to_friends_servers
}
# NOTE: deliberately no exit 0

Loading…
Cancel
Save