Remove hardcoded variants
This commit is contained in:
parent
acd8a706d8
commit
16123cb9d7
|
@ -259,7 +259,7 @@ function parse_args {
|
|||
exit 1
|
||||
fi
|
||||
if [ ! "$DEFAULT_DOMAIN_NAME" ]; then
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "mesh"* ]]; then
|
||||
echo 'No default domain specified'
|
||||
show_help
|
||||
exit 2
|
||||
|
@ -270,7 +270,7 @@ function parse_args {
|
|||
show_help
|
||||
exit 3
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "mesh"* ]]; then
|
||||
if [[ $ONION_ONLY == "no" ]]; then
|
||||
if [ ! $DDNS_USERNAME ]; then
|
||||
echo $'Please provide the username for your dynamic DNS provider with the --ddnsuser option'
|
||||
|
@ -282,12 +282,14 @@ function parse_args {
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! $SYSTEM_TYPE ]; then
|
||||
SYSTEM_TYPE=$VARIANT_FULL
|
||||
SYSTEM_TYPE=$'full'
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE != $VARIANT_WRITER && $SYSTEM_TYPE != $VARIANT_CLOUD && $SYSTEM_TYPE != $VARIANT_CHAT && $SYSTEM_TYPE != $VARIANT_MAILBOX && $SYSTEM_TYPE != $VARIANT_NONMAILBOX && $SYSTEM_TYPE != $VARIANT_SOCIAL && $SYSTEM_TYPE != $VARIANT_MEDIA && $SYSTEM_TYPE != $VARIANT_DEVELOPER && $SYSTEM_TYPE != $VARIANT_MESH && $SYSTEM_TYPE != $VARIANT_FULL ]]; then
|
||||
|
||||
if [[ $(is_valid_variant) == "0" ]]; then
|
||||
echo $"'$SYSTEM_TYPE' is an unrecognised ${PROJECT_NAME} variant."
|
||||
exit 30
|
||||
exit 367245
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ function install_dlna_main {
|
|||
echo "media_dir=V,$USB_MOUNT/Videos" >> /etc/minidlna.conf
|
||||
fi
|
||||
sed -i 's/#root_container=./root_container=B/g' /etc/minidlna.conf
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "mesh"* ]]; then
|
||||
sed -i 's/#network_interface=/network_interface=eth0/g' /etc/minidlna.conf
|
||||
else
|
||||
sed -i 's/#network_interface=/network_interface=$WIFI_INTERFACE/g' /etc/minidlna.conf
|
||||
|
|
|
@ -295,9 +295,6 @@ function install_irc_server {
|
|||
fi
|
||||
|
||||
DEFAULTDOMAIN=${DEFAULT_DOMAIN_NAME}
|
||||
if [[ ${SYSTEM_TYPE} == "$VARIANT_MESH" ]]; then
|
||||
DEFAULTDOMAIN="${DEFAULT_DOMAIN_NAME}.local"
|
||||
fi
|
||||
|
||||
# create a login password if needed
|
||||
if [ ! ${IRC_PASSWORD} ]; then
|
||||
|
@ -340,10 +337,6 @@ function install_irc_server {
|
|||
if [ ${IRC_PASSWORD} ]; then
|
||||
sed -i "0,/RE/s/Password =.*/Password =$IRC_PASSWORD/" /etc/ngircd/ngircd.conf
|
||||
fi
|
||||
# If we are on a mesh then DNS is not available
|
||||
if [[ ${SYSTEM_TYPE} == "$VARIANT_MESH" ]]; then
|
||||
sed -i "s/;DNS =.*/DNS = no/g" /etc/ngircd/ngircd.conf
|
||||
fi
|
||||
# upgrade a cypher
|
||||
sed -i 's|SECURE128|SECURE256|g' /etc/ngircd/ngircd.conf
|
||||
mkdir /var/run/ircd
|
||||
|
|
|
@ -236,7 +236,7 @@ function install_mumble {
|
|||
|
||||
sed -i "s|welcometext=.*|welcometext=\"<br />Welcome to $DEFAULT_DOMAIN_NAME <b>mumble</b>.<br />Chat freely!<br />\"|g" /etc/mumble-server.ini
|
||||
|
||||
if [[ $MUMBLE_SERVER_PASSWORD && $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
if [[ $MUMBLE_SERVER_PASSWORD ]]; then
|
||||
sed -i "s|serverpassword=.*|serverpassword=$MUMBLE_SERVER_PASSWORD|g" /etc/mumble-server.ini
|
||||
fi
|
||||
|
||||
|
@ -272,9 +272,7 @@ function install_mumble {
|
|||
echo '=============' >> /home/$MY_USERNAME/README
|
||||
echo $"Mumble onion domain:$MUMBLE_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
|
||||
echo $'Mumble server username: mumble-server' >> /home/$MY_USERNAME/README
|
||||
if [[ $SYSTEM_TYPE != "VARIANT_MESH" ]]; then
|
||||
echo $"Mumble server password: $MUMBLE_SERVER_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'To connect to the Mumble server use your username and the server password shown above.' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
|
|
|
@ -117,9 +117,6 @@ function remove_searx {
|
|||
|
||||
function install_searx {
|
||||
# Note: currently socks5 outgoing proxies to other search engines does not work
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
return
|
||||
fi
|
||||
if [ ! -d /etc/nginx ]; then
|
||||
echo $'Webserver is not installed'
|
||||
exit 62429
|
||||
|
|
|
@ -336,7 +336,7 @@ function tox_avahi {
|
|||
fi
|
||||
make install
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
toxavahi
|
||||
|
||||
# publish regularly
|
||||
|
|
|
@ -83,9 +83,6 @@ function backup_email {
|
|||
}
|
||||
|
||||
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
|
||||
fi
|
||||
if grep -Fxq "configure_firewall_for_email" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
|
@ -114,7 +111,7 @@ function encrypt_incoming_email {
|
|||
# encrypts incoming mail using your GPG public key
|
||||
# so even if an attacker gains access to the data at rest they still need
|
||||
# to know your GPG key password to be able to read anything
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -163,7 +160,7 @@ function encrypt_outgoing_email {
|
|||
# encrypts outgoing mail using your GPG public key
|
||||
# so even if an attacker gains access to the data at rest they still need
|
||||
# to know your GPG key password to be able to read sent mail
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "encrypt_outgoing_email" $COMPLETION_FILE; then
|
||||
|
@ -210,7 +207,7 @@ function encrypt_outgoing_email {
|
|||
}
|
||||
|
||||
function encrypt_all_email {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if [[ $GPG_ENCRYPT_STORED_EMAIL != "yes" ]]; then
|
||||
|
@ -252,7 +249,7 @@ function encrypt_all_email {
|
|||
}
|
||||
|
||||
function email_client {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "email_client" $COMPLETION_FILE; then
|
||||
|
@ -406,7 +403,7 @@ function email_client {
|
|||
}
|
||||
|
||||
function email_archiving {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -469,7 +466,7 @@ function email_from_address {
|
|||
}
|
||||
|
||||
function create_public_mailing_list {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "create_public_mailing_list" $COMPLETION_FILE; then
|
||||
|
@ -566,7 +563,7 @@ function create_public_mailing_list {
|
|||
}
|
||||
|
||||
function create_private_mailing_list {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
# This installation doesn't work, results in ruby errors
|
||||
|
@ -638,7 +635,7 @@ function split_gpg_key_into_fragments {
|
|||
}
|
||||
|
||||
function import_email {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
EMAIL_COMPLETE_MSG=$"
|
||||
|
@ -648,7 +645,7 @@ function import_email {
|
|||
25, 587, 465, 993 and 2222 to the ${PROJECT_NAME}
|
||||
"
|
||||
if grep -Fxq "import_email" $COMPLETION_FILE; then
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mail"* ]]; then
|
||||
function_check backup_to_friends_servers
|
||||
backup_to_friends_servers
|
||||
|
||||
|
@ -681,7 +678,7 @@ function import_email {
|
|||
fi
|
||||
fi
|
||||
echo 'import_email' >> $COMPLETION_FILE
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mail"* ]]; then
|
||||
function_check backup_to_friends_servers
|
||||
backup_to_friends_servers
|
||||
|
||||
|
@ -710,7 +707,7 @@ function remove_email {
|
|||
}
|
||||
|
||||
function install_email {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "install_email" $COMPLETION_FILE; then
|
||||
|
@ -940,7 +937,7 @@ function install_email {
|
|||
}
|
||||
|
||||
function create_procmail {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "create_procmail" $COMPLETION_FILE; then
|
||||
|
@ -983,7 +980,7 @@ function handle_admin_emails {
|
|||
}
|
||||
|
||||
function spam_filtering {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "spam_filtering" $COMPLETION_FILE; then
|
||||
|
@ -1144,7 +1141,7 @@ function spam_filtering {
|
|||
}
|
||||
|
||||
function configure_imap {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "configure_imap" $COMPLETION_FILE; then
|
||||
|
@ -1230,7 +1227,7 @@ function configure_imap {
|
|||
}
|
||||
|
||||
function configure_imap_client_certs {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "configure_imap_client_certs" $COMPLETION_FILE; then
|
||||
|
@ -1312,7 +1309,7 @@ function configure_imap_client_certs {
|
|||
}
|
||||
|
||||
function create_gpg_subkey {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "create_gpg_subkey" $COMPLETION_FILE; then
|
||||
|
@ -1380,7 +1377,7 @@ function gpg_pubkey_from_email {
|
|||
}
|
||||
|
||||
function configure_gpg {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [ ! -d /etc/exim4 ]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "configure_gpg" $COMPLETION_FILE; then
|
||||
|
|
|
@ -52,9 +52,6 @@ function install_tripwire {
|
|||
if grep -Fxq "install_tripwire" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
return
|
||||
fi
|
||||
apt-get -y install tripwire
|
||||
apt-get -y autoremove
|
||||
cd /etc/tripwire
|
||||
|
|
|
@ -48,20 +48,6 @@ MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-u
|
|||
# file containing new password
|
||||
IMAGE_PASSWORD_FILE=/root/login.txt
|
||||
|
||||
# Different system variants which may be specified within
|
||||
# the SYSTEM_TYPE option
|
||||
VARIANT_FULL="full"
|
||||
VARIANT_WRITER="writer"
|
||||
VARIANT_CLOUD="cloud"
|
||||
VARIANT_CHAT="chat"
|
||||
VARIANT_MAILBOX="mailbox"
|
||||
VARIANT_NONMAILBOX="nonmailbox"
|
||||
VARIANT_SOCIAL="social"
|
||||
VARIANT_MEDIA="media"
|
||||
VARIANT_DEVELOPER="developer"
|
||||
VARIANT_MESH="mesh"
|
||||
VARIANT_MESH_USER="mesh-user"
|
||||
|
||||
MY_USERNAME=
|
||||
DEFAULT_DOMAIN_NAME=
|
||||
DEFAULT_DOMAIN_CODE=
|
||||
|
@ -291,7 +277,7 @@ function choose_static_ip {
|
|||
}
|
||||
|
||||
function choose_dynamic_dns {
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" && $ONION_ONLY == "no" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "mesh"* && $ONION_ONLY == "no" ]]; then
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
|
@ -731,9 +717,6 @@ function choose_username {
|
|||
MY_USERNAME=$(ls /home)
|
||||
else
|
||||
# select one from a number of users
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then
|
||||
MY_USERNAME=$DEFAULT_DOMAIN_NAME
|
||||
else
|
||||
select_user
|
||||
if [ ! $SELECTED_USERNAME ]; then
|
||||
echo $'No username selected'
|
||||
|
@ -742,7 +725,6 @@ function choose_username {
|
|||
MY_USERNAME="$SELECTED_USERNAME"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! $MY_USERNAME ]; then
|
||||
echo $'No user account was selected'
|
||||
|
|
|
@ -104,7 +104,7 @@ function create_freedns_updater {
|
|||
if [[ $DDNS_PROVIDER != "default@freedns.afraid.org" ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ function configure_firewall_ping {
|
|||
return
|
||||
fi
|
||||
# Only allow ping for mesh installs
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
||||
|
@ -225,7 +225,7 @@ function configure_internet_protocol {
|
|||
if grep -Fxq "configure_internet_protocol" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
sed -i "s/#net.ipv4.tcp_syncookies=1/net.ipv4.tcp_syncookies=1/g" /etc/sysctl.conf
|
||||
|
|
|
@ -193,10 +193,6 @@ function mesh_upgrade_golang {
|
|||
}
|
||||
|
||||
function upgrade_golang {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if grep -Fxq "upgrade_golang:$GO_VERSION" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
|
|
|
@ -66,15 +66,6 @@ function show_help {
|
|||
echo $' --ns2 Second DNS nameserver'
|
||||
echo $' --repo Debian repository'
|
||||
echo ''
|
||||
echo $'system types'
|
||||
echo '------------'
|
||||
echo $'This can either be blank if you wish to install the full system,'
|
||||
echo $"or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD',"
|
||||
echo $"'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'"
|
||||
echo $"or '$VARIANT_MESH'."
|
||||
echo ''
|
||||
echo $"If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint."
|
||||
echo ''
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
function interactive_configuration_remote_backups {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [ ! -f /usr/local/bin/${PROJECT_NAME}-remote ]; then
|
||||
|
@ -92,7 +92,7 @@ function interactive_configuration {
|
|||
exit 73594
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
FRIENDS_SERVERS_LIST=/home/$MY_USERNAME/backup.list
|
||||
|
||||
dialog --title $"Encrypted backup to other servers" \
|
||||
|
|
|
@ -44,41 +44,7 @@ function change_login_message {
|
|||
echo "|--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-. " >> /etc/motd
|
||||
echo "| | (.-' (.-' ( | ( )| | | | )( )| | (.-' " >> /etc/motd
|
||||
echo "' ' --' --' -' - -' ' ' -' -' -' ' - --'" >> /etc/motd
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" ]]; then
|
||||
echo $' M A I L B O X E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" ]]; then
|
||||
echo $' S O C I A L E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
|
||||
echo $' C H A T E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" ]]; then
|
||||
echo $' C L O U D E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" ]]; then
|
||||
echo $' W R I T E R E D I T I O N ' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MEDIA" ]]; then
|
||||
echo $' M E D I A E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_DEVELOPER" ]]; then
|
||||
echo $' D E V E L O P E R E D I T I O N' >> /etc/motd
|
||||
fi
|
||||
|
||||
echo '' >> /etc/motd
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
echo $' Freedom in the Cloud' >> /etc/motd
|
||||
else
|
||||
echo $' Freedom in the Mesh' >> /etc/motd
|
||||
fi
|
||||
echo '' >> /etc/motd
|
||||
echo 'change_login_message' >> $COMPLETION_FILE
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ function set_default_onion_domains {
|
|||
}
|
||||
|
||||
function create_avahi_onion_domains {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [ ! -d /etc/avahi/services ]; then
|
||||
|
@ -159,7 +159,7 @@ function create_avahi_onion_domains {
|
|||
}
|
||||
|
||||
function allow_ssh_to_onion_address {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [ ! -d /home/$MY_USERNAME/.ssh ]; then
|
||||
|
@ -176,7 +176,7 @@ function allow_ssh_to_onion_address {
|
|||
}
|
||||
|
||||
function enable_ssh_via_onion {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "enable_ssh_via_onion" $COMPLETION_FILE; then
|
||||
|
@ -206,7 +206,7 @@ function configure_ssh_onion {
|
|||
if grep -Fxq "configure_ssh_onion" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -222,7 +222,7 @@ function configure_ssh_onion {
|
|||
}
|
||||
|
||||
function install_tor {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh*" ]]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "install_tor" $COMPLETION_FILE; then
|
||||
|
@ -237,7 +237,7 @@ function install_tor {
|
|||
}
|
||||
|
||||
function resolve_dns_via_tor {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "resolve_dns_via_tor" $COMPLETION_FILE; then
|
||||
|
|
|
@ -110,6 +110,20 @@ function available_system_variants {
|
|||
done
|
||||
}
|
||||
|
||||
function is_valid_variant {
|
||||
sys_type="$1"
|
||||
available_variants_list=()
|
||||
available_system_variants
|
||||
|
||||
for variant_str in "${available_variants_list[@]}"
|
||||
do
|
||||
if [[ "$sys_type" == "$variant_str" ]]; then
|
||||
return "1"
|
||||
fi
|
||||
done
|
||||
return "0"
|
||||
}
|
||||
|
||||
# mark a given app as having been removed so that it doesn't get reinstalled on updates
|
||||
function remove_app {
|
||||
app_name=$1
|
||||
|
|
|
@ -32,23 +32,10 @@ if [ ! $PROJECT_NAME ]; then
|
|||
PROJECT_NAME='freedombone'
|
||||
fi
|
||||
|
||||
# Different system variants which may be specified within
|
||||
# the SYSTEM_TYPE option
|
||||
VARIANT_FULL="full"
|
||||
VARIANT_WRITER="writer"
|
||||
VARIANT_CLOUD="cloud"
|
||||
VARIANT_CHAT="chat"
|
||||
VARIANT_MAILBOX="mailbox"
|
||||
VARIANT_NONMAILBOX="nonmailbox"
|
||||
VARIANT_SOCIAL="social"
|
||||
VARIANT_MEDIA="media"
|
||||
VARIANT_DEVELOPER="developer"
|
||||
VARIANT_MESH="mesh"
|
||||
|
||||
DEFAULT_DOMAIN_NAME=
|
||||
DEFAULT_DOMAIN_CODE=
|
||||
MY_USERNAME=
|
||||
SYSTEM_TYPE=$VARIANT_FULL
|
||||
SYSTEM_TYPE="full"
|
||||
|
||||
# An optional configuration file which overrides some of these variables
|
||||
CONFIGURATION_FILE="${PROJECT_NAME}.cfg"
|
||||
|
@ -121,7 +108,6 @@ function search_for_attached_usb_drive {
|
|||
mkdir $USB_MOUNT
|
||||
mount $USB_DRIVE $USB_MOUNT
|
||||
fi
|
||||
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
|
||||
if [ -d $USB_MOUNT/Maildir ]; then
|
||||
echo $'Maildir found on USB drive'
|
||||
IMPORT_MAILDIR=$USB_MOUNT/Maildir
|
||||
|
@ -151,7 +137,7 @@ function search_for_attached_usb_drive {
|
|||
echo $'GPG public key found on USB drive'
|
||||
MY_GPG_PUBLIC_KEY=$USB_MOUNT/public_key.gpg
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d $USB_MOUNT/prosody ]; then
|
||||
if [ ! -d $XMPP_DIRECTORY ]; then
|
||||
mkdir $XMPP_DIRECTORY
|
||||
|
|
|
@ -51,7 +51,7 @@ function check_date {
|
|||
|
||||
function time_synchronisation {
|
||||
# mesh peers typically don't sync over the internet
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -79,7 +79,7 @@ function time_synchronisation {
|
|||
|
||||
function time_synchronisation_tlsdate {
|
||||
# mesh peers typically don't sync over the internet
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ function install_web_server_access_control {
|
|||
}
|
||||
|
||||
function install_dynamicdns {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ $ONION_ONLY != "no" ]]; then
|
||||
|
@ -439,9 +439,6 @@ function install_web_server {
|
|||
mesh_web_server
|
||||
return
|
||||
fi
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# update to the next commit
|
||||
function_check set_repo_commit
|
||||
|
|
|
@ -40,7 +40,7 @@ WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg
|
|||
ATHEROS_WIFI_REPO="https://github.com/qca/open-ath9k-htc-firmware.git"
|
||||
|
||||
function setup_wifi {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [ ! $WIFI_SSID ]; then
|
||||
|
|
Loading…
Reference in New Issue