diff --git a/doc/EN/armbian.org b/doc/EN/armbian.org new file mode 100644 index 00000000..13f04789 --- /dev/null +++ b/doc/EN/armbian.org @@ -0,0 +1,92 @@ +#+TITLE: +#+AUTHOR: Bob Mottram +#+EMAIL: bob@freedombone.net +#+KEYWORDS: freedombox, debian, armbian +#+DESCRIPTION: Installing Freedombone on Armbian +#+OPTIONS: ^:nil toc:nil +#+HTML_HEAD: + +#+BEGIN_CENTER +[[file:images/logo.png]] +#+END_CENTER + + +#+begin_export html +

Installing on Armbian

+#+end_export + +If you have a single board ARM computer which isn't one of the supported ones then you can probably still install Freedombone onto it if it has a [[https://www.armbian.com/download/][Debian Stretch Armbian image]] available for it. + +Download the Armbian image for your board. It must be version 9 (Stretch), otherwise it won't work. Extract the image from its archive, then copy it to a microSD card: + +#+begin_src bash +sudo dd if=[Armbian .img file] of=/dev/sdX +#+end_src + +Where */dev/sdX* is the path for the microSD drive on your system. + +When that's done use a tool such as *Gparted* to resize the partition on the microSD card to fill up any remaining available space. + +Insert the microSD drive into your ARM board, connect it to your internet router with an ethernet cable and plug in the power. + +The board should then show up somewhere on your local network. You can log into your internet router to see what devices are connected and obtain the local IP address for the board that way, or use a network scanning tool. + +Once you know the local IP address of your ARM board then you can log into it with: + +#+begin_src bash +ssh root@[local IP address] +#+end_src + +Using the default Armbian password of *1234*. You should see the Armbian welcome message and will be asked to change the password, then create a new user account. + +#+BEGIN_CENTER +[[file:images/armbian_setup.jpg]] +#+END_CENTER + +When the user account is created type *exit* to leave the ssh session then log back in with your new user account. + +#+begin_src bash +ssh myusername@[local IP address] +#+end_src + +Become the root user: + +#+begin_src bash +sudo su +#+end_src + +Then clone the Freedombone repository and checkout the stretch development branch. + +#+begin_src bash +git clone https://github.com/bashrc/freedombone +cd freedombone +git checkout stretch +#+end_src + +Install the Freedombone commands: + +#+begin_src bash +make install +#+end_src + +And now you can begin installing the Freedombone system. There are two ways of doing this. If you already own a domain name which you want to use then run: + +#+begin_src bash +freedombone menuconfig +#+end_src + +Alternatively, if you don't own a domain name, don't have administrator access to your internet router or if you want to be able to access your sites only via onion addresses then run: + +#+begin_src bash +freedombone menuconfig-onion +#+end_src + +You will then be taken through a few questions and the system will install. Afterwards you'll be able to log into your system with: + +#+begin_src bash +ssh myusername@freedombone.local -p 2222 +#+end_src + +Then select *Administrator options*. If you chose the first install option using a domain name then go to *Show Firewall* and make sure that the ports shown are forwarded from your internet router to your ARM board. + +You can then [[./apps.html][add or remove apps]] as needed. diff --git a/doc/EN/index.org b/doc/EN/index.org index 85c63e48..3329726a 100644 --- a/doc/EN/index.org +++ b/doc/EN/index.org @@ -31,6 +31,8 @@ And here's how [[./beaglebone.html][on a Beaglebone Black]]. Or you can install [[./debianinstall.html][onto an existing Debian system]]. +If you have a single board ARM computer which isn't one of the officially supported ones, such as Raspberry Pi, then you may still be able to install [[./armbian.html][Freedombone with Armbian]]. + Want to make a community mesh network which doesn't depend upon the internet? The [[./mesh.html][Freedombone Mesh]] is a wireless solution for autonomous communication that can be rapidly deployed in temporary, emergency or post-disaster situations where internet access is unavailable or compromised. After installation it's possible that you might want some advice on how to run your system and set up apps to work nicely with it. diff --git a/img/armbian_setup.jpg b/img/armbian_setup.jpg new file mode 100644 index 00000000..d251430a Binary files /dev/null and b/img/armbian_setup.jpg differ diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 2d51c5ed..08fd5244 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -903,7 +903,7 @@ function install_gnusocial { # Currently Pleroma won't install on ARM systems # because it uses node-sass which doesn't support ARM - if [[ "$(arch)" == "arm"* ]]; then + if [[ "$(arch)" == "arm"* || "$(arch)" == "aarch"* ]]; then echo -m $'WARNING: Pleroma currently does not support ARM ' echo $'architecture, so it will not be installed' else diff --git a/src/freedombone-app-mediagoblin b/src/freedombone-app-mediagoblin index a6431adf..50524645 100755 --- a/src/freedombone-app-mediagoblin +++ b/src/freedombone-app-mediagoblin @@ -295,10 +295,12 @@ function install_mediagoblin { function_check install_nodejs install_nodejs mediagoblin - apt-get install -yq python python-dev python-lxml python-imaging python-virtualenv + apt-get install -yq python python-dev python-lxml python-imaging python-virtualenv python-setuptools apt-get install -yq automake perl sqlite python-paste python-pastedeploy python-pastescript apt-get install -yq python3 python3-dev libpython3-dev python3-lxml python3-pil groupadd mediagoblin + apt-get install -yq python-service-identity python-ndg-httpsclient + useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g www-data mediagoblin usermod --append -G mediagoblin mediagoblin mkdir -p /var/lib/mediagoblin diff --git a/src/freedombone-app-postactiv b/src/freedombone-app-postactiv index 57c06889..86bb8736 100755 --- a/src/freedombone-app-postactiv +++ b/src/freedombone-app-postactiv @@ -921,7 +921,7 @@ function install_postactiv { # Currently Pleroma won't install on ARM systems # because it uses node-sass which doesn't support ARM - if [[ "$(arch)" == "arm"* ]]; then + if [[ "$(arch)" == "arm"* || "$(arch)" == "aarch"* ]]; then echo -m $'WARNING: Pleroma currently does not support ARM ' echo $'architecture, so it will not be installed' else diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index b90a9c75..af878d3c 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -828,7 +828,8 @@ function install_searx { apt-get -yq install python-pip libyaml-dev python-werkzeug python-babel python-lxml apt-get -yq install git build-essential libxslt-dev python-dev python-virtualenv zlib1g-dev uwsgi uwsgi-plugin-python imagemagick - apt-get -yq install apache2-utils + apt-get -yq install apache2-utils python-setuptools + apt-get -yq install python-service-identity python-ndg-httpsclient apt-get -yq remove --purge apache2-bin* if [ -d /etc/apache2 ]; then diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index ede2d653..6b96a779 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -29,15 +29,12 @@ # along with this program. If not, see . # Qvitter upstream: https://git.gnu.io/h2p/Qvitter" -QVITTER_THEME_REPO="https://git.postactiv.com/bob/Qvitter" -QVITTER_THEME_COMMIT='b5791cf935a6391c492cefa1ffa50cc3cea44c12' +QVITTER_THEME_REPO="https://github.com/bashrc/Qvitter" +QVITTER_THEME_COMMIT='c6f09bda4e45be4290cf7409fa5efb4420538032' PLEROMA_REPO="https://gitgud.io/lambadalambda/pleroma-fe" PLEROMA_COMMIT='cbe652f2d94d81fa54a37378b7ff014c4391ca5e' -ARMADILLO_REPO="https://git.postactiv.com/maiya/Armadillo" -ARMADILLO_COMMIT='ec3938a678f373156c4cbf37926c9a5ab68222c4' - SHARINGS_REPO="http://git.lasindias.club/bashrc/Sharings" SHARINGS_COMMIT='d5c6c7f855d9afff9086c09ea706f38c859bc0d4' SHARINGS_THEME_REPO="http://git.lasindias.club/manuel/SharingsTheme" @@ -163,62 +160,6 @@ function pleroma_set_background_image_from_url { echo "0" } -function armadillo_set_background_image_from_url { - domain_name="$1" - url="$2" - - if [ ${#domain_name} -eq 0 ]; then - echo "1" - return - fi - - ext= - if [ ${#url} -gt 0 ]; then - if [[ "$url" == *".jpeg" || "$url" == *".jpg" ]]; then - ext="jpg" - fi - if [[ "$url" == *".png" ]]; then - ext="png" - fi - if [[ "$url" == *".gif" ]]; then - ext="gif" - fi - fi - - if [ ${#ext} -gt 0 ]; then - cd /var/www/${domain_name}/htdocs - - # remove any existing image - if [ -f bg_custom.${ext} ]; then - rm bg_custom.${ext} - fi - - # get the new image - wget "$url" -O bg_custom.${ext} - if [ ! -f bg_custom.${ext} ]; then - echo "$url" - echo $'Custom background image for armadillo could not be downloaded' - echo "1" - return - fi - - if [ -d /var/www/${domain_name}/htdocs/armadillo ]; then - cd /var/www/${domain_name}/htdocs/armadillo - cp ../bg_custom.${ext} media/img/bg_custom.${ext} - sed -i "s|\"background\":.*|\"background\": \"armadillo/media/img/background.jpeg\"," config.json - fi - - qvitter_update_background ${domain_name} ${ext} - - rm bg_custom.${ext} - else - echo "2" - return - fi - - echo "0" -} - function install_qvitter { domain_name=$1 app_name=$2 @@ -260,6 +201,11 @@ function install_qvitter { git_clone $QVITTER_THEME_REPO Qvitter fi + if [ ! -d /var/www/${domain_name}/htdocs/local/plugins/Qvitter ]; then + echo $'Qvitter repo was not installed' + exit 835638 + fi + cd /var/www/${domain_name}/htdocs/local/plugins/Qvitter git checkout $QVITTER_THEME_COMMIT -b $QVITTER_THEME_COMMIT @@ -329,48 +275,6 @@ function install_gnusocial_default_background { fi } -function install_armadillo_front_end { - app_name="$1" - armadillo_domain="$2" - background_url="$3" - - if [ ! -d $INSTALL_DIR/armadillo ]; then - function_check git_clone - git_clone $ARMADILLO_REPO $INSTALL_DIR/armadillo - if [ ! -d $INSTALL_DIR/armadillo ]; then - echo $'Unable to clone armadillo repo' - exit 35722 - fi - fi - - cd $INSTALL_DIR/armadillo - git checkout $ARMADILLO_COMMIT -b $ARMADILLO_COMMIT - set_completion_param "${app_name} armadillo commit" "$ARMADILLO_COMMIT" - - cp armadillo/config.json.example armadillo/config.json - if [[ $ONION_ONLY == 'no' ]]; then - sed -i "s|\"server\".*|\"server\": \"https://${armadillo_domain}\",|g" armadillo/config.json - else - sed -i "s|\"server\".*|\"server\": \"http://${armadillo_domain}\",|g" armadillo/config.json - fi - owner='@'"$MY_USERNAME@${armadillo_domain}"'' - sed -i "s|\"owner\".*|\"owner\": \"$owner\",|g" armadillo/config.json - cp -r $INSTALL_DIR/armadillo/armadillo /var/www/${armadillo_domain}/htdocs/ - cp $INSTALL_DIR/armadillo/armadillo.html /var/www/${armadillo_domain}/htdocs/index.html - cp $INSTALL_DIR/armadillo/dash.html /var/www/${armadillo_domain}/htdocs/dash.html - - armadillo_set_background_image_from_url "$armadillo_domain" "$background_url" - - nginx_site=/etc/nginx/sites-available/${armadillo_domain} - sed -i 's|index index.php;|index index.html;|g' $nginx_site - - if [ -f /var/www/${armadillo_domain}/htdocs/index.php ]; then - mv /var/www/${armadillo_domain}/htdocs/index.php /var/www/${armadillo_domain}/htdocs/index_qvitter.php - fi - sed -i 's|index.php|index_qvitter.php|g' $nginx_site - - chown -R www-data:www-data /var/www/${armadillo_domain}/htdocs -} function install_pleroma_front_end { app_name="$1" @@ -489,27 +393,6 @@ function upgrade_pleroma { fi } -function upgrade_armadillo { - domain_name="$1" - app_name="$2" - background_url="$3" - - if [ -d $INSTALL_DIR/armadillo ]; then - set_repo_commit $INSTALL_DIR/armadillo "${app_name} armadillo commit" "$ARMADILLO_COMMIT" $ARMADILLO_REPO - cd $INSTALL_DIR/armadillo - - if [ -f $INSTALL_DIR/armadillo/armadillo/config.json ]; then - rm $INSTALL_DIR/armadillo/armadillo/config.json - fi - cp -r $INSTALL_DIR/armadillo/armadillo /var/www/${armadillo_domain}/htdocs/ - cp $INSTALL_DIR/armadillo/armadillo.html /var/www/${armadillo_domain}/htdocs/index.html - cp $INSTALL_DIR/armadillo/dash.html /var/www/${armadillo_domain}/htdocs/dash.html - chown -R www-data:www-data /var/www/${domain_name}/htdocs - else - install_armadillo_front_end "${app_name}" "${domain_name}" "${background_url}" - fi -} - function gnusocial_hourly_script { gnusocial_type=$1 domain_name=$2 @@ -900,42 +783,6 @@ function gnusocial_use_pleroma { systemctl restart nginx } -function gnusocial_use_armadillo { - database_name=$1 - - domain_name=$(get_completion_param "$database_name domain") - - if [ ! -d /var/www/$domain_name/htdocs/armadillo ]; then - return - fi - - if [ -f /var/www/$domain_name/htdocs/index.php ]; then - mv /var/www/$domain_name/htdocs/index.php /var/www/$domain_name/htdocs/index_qvitter.php - fi - - if [ -f /etc/nginx/sites-available/$domain_name ]; then - sed -i 's|index.php|index_qvitter.php|g' /etc/nginx/sites-available/$domain_name - sed -i 's|index index_qvitter.php|index index.html|g' /etc/nginx/sites-available/$domain_name - fi - - if grep -q "//addPlugin('Qvitter')" /var/www/$domain_name/htdocs/config.php; then - sed -i "s|//addPlugin('Qvitter')|addPlugin('Qvitter')|g" /var/www/$domain_name/htdocs/config.php - fi - if grep -q "// addPlugin('Qvitter')" /var/www/$domain_name/htdocs/config.php; then - sed -i "s|// addPlugin('Qvitter')|addPlugin('Qvitter')|g" /var/www/$domain_name/htdocs/config.php - fi - - if [ -f $INSTALL_DIR/armadillo/armadillo/config.json ]; then - rm $INSTALL_DIR/armadillo/armadillo/config.json - fi - cp -r $INSTALL_DIR/armadillo/armadillo/* /var/www/${domain_name}/htdocs/armadillo - cp $INSTALL_DIR/armadillo/armadillo.html /var/www/${domain_name}/htdocs/index.html - cp $INSTALL_DIR/armadillo/dash.html /var/www/${domain_name}/htdocs/dash.html - chown -R www-data:www-data /var/www/${domain_name}/htdocs - - systemctl restart nginx -} - function install_gnusocial_plugin_sharings { domain_name=$1 social_app_name=$2 diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index 545e9269..e715ead9 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -61,8 +61,12 @@ function get_npm_arch { } function mesh_install_nodejs { - chroot "$rootdir" apt-get -yq install g++ m4 libtool automake nodejs curl - chroot "$rootdir" apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev + mesh_install_nodejs_prefix= + if [ $rootdir ]; then + mesh_install_nodejs_prefix="chroot $rootdir" + fi + $mesh_install_nodejs_prefix apt-get -yq install g++ m4 libtool automake nodejs curl + $mesh_install_nodejs_prefix apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev if [ ! -f ${rootdir}/usr/bin/nodejs ]; then echo $'nodejs was not installed' @@ -83,9 +87,9 @@ function mesh_install_nodejs { echo $'Unable to download npm installer' exit 8793636 fi - chroot "$rootdir" chmod +x /root/npm_install.sh + $mesh_install_nodejs_prefix chmod +x /root/npm_install.sh sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh - chroot "$rootdir" /root/npm_install.sh + $mesh_install_nodejs_prefix /root/npm_install.sh if [ ! -f $rootdir/usr/bin/npm ]; then echo $'npm was not installed' @@ -95,8 +99,8 @@ function mesh_install_nodejs { # update from the old debian nodejs version get_npm_arch - chroot "$rootdir" npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save - chroot "$rootdir" n --arch $N_ARCH ${NODEJS_VERSION} + $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save + $mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION} cp $rootdir/root/npm $rootdir/usr/bin/npm } diff --git a/src/freedombone-utils-passwords b/src/freedombone-utils-passwords index a2980691..7e63b9e0 100755 --- a/src/freedombone-utils-passwords +++ b/src/freedombone-utils-passwords @@ -51,7 +51,7 @@ function enforce_good_passwords { } function create_password { - openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${1} ; echo '' + openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${1} ; echo -n '' } # NOTE: deliberately no exit 0 diff --git a/website/EN/armbian.html b/website/EN/armbian.html new file mode 100644 index 00000000..eef7bab2 --- /dev/null +++ b/website/EN/armbian.html @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+

logo.png +

+
+
+ + +

Installing on Armbian

+ +

+If you have a single board ARM computer which isn't one of the supported ones then you can probably still install Freedombone onto it if it has a Debian Stretch Armbian image available for it. +

+ +

+Download the Armbian image for your board. It must be version 9 (Stretch), otherwise it won't work. Extract the image from its archive, then copy it to a microSD card: +

+ +
+
sudo dd if=[Armbian .img file] of=/dev/sdX
+
+
+ +

+Where /dev/sdX is the path for the microSD drive on your system. +

+ +

+When that's done use a tool such as Gparted to resize the partition on the microSD card to fill up any remaining available space. +

+ +

+Insert the microSD drive into your ARM board, connect it to your internet router with an ethernet cable and plug in the power. +

+ +

+The board should then show up somewhere on your local network. You can log into your internet router to see what devices are connected and obtain the local IP address for the board that way, or use a network scanning tool. +

+ +

+Once you know the local IP address of your ARM board then you can log into it with: +

+ +
+
ssh root@[local IP address]
+
+
+ +

+Using the default Armbian password of 1234. You should see the Armbian welcome message and will be asked to change the password, then create a new user account. +

+ +
+ +
+

armbian_setup.jpg +

+
+
+ +

+When the user account is created type exit to leave the ssh session then log back in with your new user account. +

+ +
+
ssh myusername@[local IP address]
+
+
+ +

+Become the root user: +

+ +
+
sudo su
+
+
+ +

+Then clone the Freedombone repository and checkout the stretch development branch. +

+ +
+
git clone https://github.com/bashrc/freedombone
+cd freedombone
+git checkout stretch
+
+
+ +

+Install the Freedombone commands: +

+ +
+
make install
+
+
+ +

+And now you can begin installing the Freedombone system. There are two ways of doing this. If you already own a domain name which you want to use then run: +

+ +
+
freedombone menuconfig
+
+
+ +

+Alternatively, if you don't own a domain name, don't have administrator access to your internet router or if you want to be able to access your sites only via onion addresses then run: +

+ +
+
freedombone menuconfig-onion
+
+
+ +

+You will then be taken through a few questions and the system will install. Afterwards you'll be able to log into your system with: +

+ +
+
ssh myusername@freedombone.local -p 2222
+
+
+ +

+Then select Administrator options. If you chose the first install option using a domain name then go to Show Firewall and make sure that the ports shown are forwarded from your internet router to your ARM board. +

+ +

+You can then add or remove apps as needed. +

+
+
+ + + + +
+ + diff --git a/website/EN/index.html b/website/EN/index.html index 1606ef2f..6ddb1bfb 100644 --- a/website/EN/index.html +++ b/website/EN/index.html @@ -3,10 +3,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + - + on a Beaglebone Black. Or you can install onto an existing Debian system.

+

+If you have a single board ARM computer which isn't one of the officially supported ones, such as Raspberry Pi, then you may still be able to install Freedombone with Armbian. +

+

Want to make a community mesh network which doesn't depend upon the internet? The Freedombone Mesh is a wireless solution for autonomous communication that can be rapidly deployed in temporary, emergency or post-disaster situations where internet access is unavailable or compromised.