diff --git a/src/freedombone-app-babel b/src/freedombone-app-babel index 55b1e31ea584bb4631a3ddc9ce042e111195a751..6cc383c26797a4f2c5be1beac849f2b8210275c0 100755 --- a/src/freedombone-app-babel +++ b/src/freedombone-app-babel @@ -28,7 +28,8 @@ # 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/>. -# Babel mesh +VARIANTS='' + ENABLE_BABEL="no" BABEL_PORT=6696 diff --git a/src/freedombone-app-batman b/src/freedombone-app-batman index 01525f5e125dc3654f51b819fdc48f5ebe560ec8..d259c2d09c3751d3f04780470a919de5277d32e9 100755 --- a/src/freedombone-app-batman +++ b/src/freedombone-app-batman @@ -28,7 +28,8 @@ # 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/>. -# B.A.T.M.A.N settings +VARIANTS='mesh' + ENABLE_BATMAN="no" BATMAN_CELLID='any' diff --git a/src/freedombone-app-blog b/src/freedombone-app-blog index 671ec7cc39da2921b0083c73e6a9fbe28b97eb18..838ad2c8eddea826150d8416060c24a27fb85070 100755 --- a/src/freedombone-app-blog +++ b/src/freedombone-app-blog @@ -28,6 +28,8 @@ # 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/>. +VARIANTS="full writer" + FULLBLOG_DOMAIN_NAME= FULLBLOG_CODE= FULLBLOG_ONION_PORT=8086 diff --git a/src/freedombone-app-cjdns b/src/freedombone-app-cjdns index 35957ad788980db66b2100ce1a89297606d393a1..963b76dcfd0669a8b5c596586bce5cc79b971729 100755 --- a/src/freedombone-app-cjdns +++ b/src/freedombone-app-cjdns @@ -28,7 +28,8 @@ # 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/>. -# cjdns settings +VARIANTS='' + ENABLE_CJDNS="no" CJDNS_PRIVATE_KEY= CJDNS_PUBLIC_KEY= diff --git a/src/freedombone-app-dlna b/src/freedombone-app-dlna index 6744dd1b0d7f3d2abd9a1e42c0fa642dba15d9aa..f8f11f3354a733836e4d3037bfbdb31c11d7f5ce 100755 --- a/src/freedombone-app-dlna +++ b/src/freedombone-app-dlna @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full media' + function upgrade_dlna { echo '' } diff --git a/src/freedombone-app-emacs b/src/freedombone-app-emacs index f5861578d3d878325eb5721a307390a9907f2736..0dd52745a49478686b2cccdbc244cab157507f87 100755 --- a/src/freedombone-app-emacs +++ b/src/freedombone-app-emacs @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='all' + function upgrade_emacs { echo '' } diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index f47d972ce6e20998cc01dba2c41a0dd532b99341..df0fd016791647667f6d3d9694ce1d0a88082d72 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full media' + MICROBLOG_DOMAIN_NAME= MICROBLOG_CODE= MICROBLOG_ONION_PORT=8087 diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index f5d4c2f2021403a7f9ff7995cdd7f28d6559c50f..51cd808887114206af83222fb256ea1855a7ab8f 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full developer' + GIT_DOMAIN_NAME= GIT_CODE= GIT_ONION_PORT=8090 diff --git a/src/freedombone-app-hubzilla b/src/freedombone-app-hubzilla index 7cdd30d514ec45f5eb61a13efe20a5589e328579..afd06c442ad8910ebed497b428309001f0b5e8c6 100755 --- a/src/freedombone-app-hubzilla +++ b/src/freedombone-app-hubzilla @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full social' + HUBZILLA_DOMAIN_NAME= HUBZILLA_CODE= HUBZILLA_ONION_PORT=8085 diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index 8a0607d12b8a958e1e21d18ad40da223f837db74..690434b90be25dad0f32aa507fb69e4cade29974 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='mesh' + IPFS_GO_REPO="https://github.com/ipfs/go-ipfs" IPFS_COMMIT='20b06a4cbce8884f5b194da6e98cb11f2c77f166' IPFS_PORT=4001 diff --git a/src/freedombone-app-irc b/src/freedombone-app-irc index 526c26c0f74a62d5fd29a75827c01af892a4cc63..bd0494f9911ccac9fe65554b244d973a7c6c3da1 100755 --- a/src/freedombone-app-irc +++ b/src/freedombone-app-irc @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full chat' + IRC_PORT=6697 IRC_ONION_PORT=6697 diff --git a/src/freedombone-app-mediagoblin b/src/freedombone-app-mediagoblin index b5a8c89970ede8e6e819261c78415fc6faa000ff..dae87f5792203d354a14df9644329ac8357aae50 100755 --- a/src/freedombone-app-mediagoblin +++ b/src/freedombone-app-mediagoblin @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='' + MEDIAGOBLIN_DOMAIN_NAME= MEDIAGOBLIN_CODE= MEDIAGOBLIN_REPO="git://git.savannah.gnu.org/mediagoblin.git" diff --git a/src/freedombone-app-mumble b/src/freedombone-app-mumble index 6d80eda709469453f7ff9056760cda349a8fcbbe..971c4d4be638a553ec09e9a3132ddefb34208cac 100755 --- a/src/freedombone-app-mumble +++ b/src/freedombone-app-mumble @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full chat' + # Password used for VoIP server VOIP_SERVER_PASSWORD= # Port on which VoIP server listens diff --git a/src/freedombone-app-rss b/src/freedombone-app-rss index f9270286f46befd1766dbcb9f9f85bbf8da489d9..e238e04f2386ec000453b4186e96d2f6093dcf67 100755 --- a/src/freedombone-app-rss +++ b/src/freedombone-app-rss @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full writer' + RSS_READER_REPO="https://tt-rss.org/git/tt-rss.git" RSS_READER_COMMIT='9e84bab449f9ed55e02e60378b0af1521026f3b8' RSS_READER_ADMIN_PASSWORD= diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index cab470ebe5faf76233d4b0fe44107408d7cb1f40..0a7ff61b4462a11c3d51e0facfbc07629e7d968a 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='' + SEARX_REPO="https://github.com/asciimoo/searx" SEARX_COMMIT='fee556c9904637051a9ba874ba7e71cd9f10789f' SEARX_PATH=/etc diff --git a/src/freedombone-app-sip b/src/freedombone-app-sip index c46984cd5f3a36a34c4951b9f3843ce76b43c245..5eafbc42be883007bb34d5e9a3006d609222dbb1 100755 --- a/src/freedombone-app-sip +++ b/src/freedombone-app-sip @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full chat' + SIP_SERVER_PASSWORD= SIP_PORT=5060 SIP_TLS_PORT=5061 diff --git a/src/freedombone-app-syncthing b/src/freedombone-app-syncthing index 5e46cc2c4c1ec8b352ded1f3aaa5289f64a7154f..7a55226a5bc780a07dd9d9c46b23db2b21c8daf6 100755 --- a/src/freedombone-app-syncthing +++ b/src/freedombone-app-syncthing @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full cloud' + SYNCTHING_ID= SYNCTHING_CONFIG_PATH=/root/.config/syncthing SYNCTHING_CONFIG_FILE=$SYNCTHING_CONFIG_PATH/config.xml diff --git a/src/freedombone-app-tox b/src/freedombone-app-tox index 68b7625921cf6a97c09354fc9c8b4ed124cd79ef..66ed8137ef8cb45ac30bec8ba5a4db315d188bf3 100755 --- a/src/freedombone-app-tox +++ b/src/freedombone-app-tox @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full chat' + TOX_PORT=33445 TOXCORE_REPO="git://github.com/irungentoo/toxcore.git" TOXCORE_COMMIT='532629d486e3361c7d8d95b38293cc7d61dc4ee5' diff --git a/src/freedombone-app-vpn b/src/freedombone-app-vpn index 85bc234d0c96122c91e117aaba7cc6ebd4b573ae..37facbe9cac5e285b5e8de761c692af51b806b18 100755 --- a/src/freedombone-app-vpn +++ b/src/freedombone-app-vpn @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='' + function upgrade_vpn { echo '' } diff --git a/src/freedombone-app-webmail b/src/freedombone-app-webmail index cc1cdf358cb3b4847dae9ef203fb74c896c21afd..9efd0380fd65a434b7d4e8eb88ed5b47933f81f1 100755 --- a/src/freedombone-app-webmail +++ b/src/freedombone-app-webmail @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='' + WEBMAIL_REPO="https://github.com/roundcube/roundcubemail" WEBMAIL_COMMIT='78cf9c2e5cff2d78cd8beb647d60570f195a2a9c' WEBMAIL_ONION_HOSTNAME= diff --git a/src/freedombone-app-wiki b/src/freedombone-app-wiki index db2a119f57dbe03892e26a2b7f3a1f36828c71a3..93345481e396940c8ff8527f0361b01085e7b0de 100755 --- a/src/freedombone-app-wiki +++ b/src/freedombone-app-wiki @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full writer' + WIKI_DOMAIN_NAME= WIKI_ADMIN_PASSWORD= WIKI_TITLE="${PROJECT_NAME} Wiki" diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index 78374412b4682d6753e26858c94817e10b1d9e59..252dcd1453ddb9b602af5a867540ba8eee525ef1 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='full chat' + # Directory where XMPP settings are stored XMPP_DIRECTORY="/var/lib/prosody" XMPP_PASSWORD= diff --git a/src/freedombone-app-zeronet b/src/freedombone-app-zeronet index 4e1528c2d9fa0c72a84b11b3d45f92d10f0eb9fe..3f884f8a1a7a170618aa2063bd7b20c1e6ae0109 100755 --- a/src/freedombone-app-zeronet +++ b/src/freedombone-app-zeronet @@ -28,6 +28,8 @@ # 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/>. +VARIANTS='mesh' + ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git" ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad' ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog" diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index 53b57426ce0c4b4663ed66668b58a8e4e34e3ac2..3b6984895d90a1ded0aca5c064bb2645f702e394 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -82,6 +82,50 @@ function detect_apps { get_apps_installed } +# creates the APPS_AVAILABLE and APPS_CHOSEN arrays based on +# the given variant name +function choose_apps_for_variant { + variant_name="$1" + + FILES=$PROJECT_INSTALL_DIR/${PROJECT_NAME}-app-* + + APPS_AVAILABLE=() + APPS_CHOSEN=() + + # for all the app scripts + for filename in $FILES + do + app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}') + if [[ $(item_in_array ${app_name} ${APPS_AVAILABLE[@]}) != 0 ]]; then + APPS_AVAILABLE+=("${app_name}") + + if grep -q "VARIANTS=" ${filename}; then + variants_list=$(cat ${filename} | grep "VARIANTS=" | awk -F '=' '{print $2}' | awk -F "'" '{print $2}') + if [[ ${variants_list} == "$variant_name "* || ${variants_list} == *" $variant_name "* || ${variants_list} == *" $variant_name" ]]; then + APPS_CHOSEN+=("1") + else + APPS_CHOSEN+=("0") + fi + else + APPS_CHOSEN+=("0") + fi + + fi + done + get_apps_installed +} + +function list_chosen_apps { + app_index=0 + for a in "${APPS_AVAILABLE[@]}" + do + if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then + echo $"${a}" + fi + app_index=$[app_index+1] + done +} + function remove_apps { app_index=0 for a in "${APPS_AVAILABLE[@]}" diff --git a/src/freedombone-utils-setup b/src/freedombone-utils-setup index 0ca307611f43a844f2ae4d7cf44a4264c91aae52..2293b8177732fd3521b8c07e965a9692cd15c72a 100755 --- a/src/freedombone-utils-setup +++ b/src/freedombone-utils-setup @@ -319,10 +319,15 @@ function setup_web { } function setup_apps { - function_check detect_apps - detect_apps - - # TODO choose apps based upon variants + function_check choose_apps_for_variant + choose_apps_for_variant "$SYSTEM_TYPE" + + echo $"System variant: $SYSTEM_TYPE" + echo $'The following apps have been selected' + echo '' + function_check list_chosen_apps + list_chosen_apps + echo '' function_check install_apps install_apps