FreedomBox/Tips and Tricks

From Wiki
< FreedomBox
Revision as of 23:53, 17 September 2018 by Joseph (talk | contribs) (→‎MediaWiki: Add installation instructions for the VisualEditor extension)

Tips and Tricks

Software

  • Matrix Synapse works for voice and video calls over LAN. It seems to be P2P.
  • Use Syncthing with Orgzly/Emacs for writing lists.
  • Use Boostnote with Syncthing for note-taking and lists if Orgzly seems too weird. Boostnote has Github-flavored markdown.
  • Use Privoxy for ad-blocking on all the Android devices on the Wi-Fi by setting it as a proxy.

MediaWiki

  • Use MediaWiki for taking notes as I'm doing right now and as a personal knowledge base.
  • Since MediaWiki on FreedomBox doesn't have the Visual Editor extension yet, use Wikipedia's Sandbox to write your content in the Visual Editor, and after you're done, switch back to source code editing mode. You can then cut and paste the content into your MediaWiki instance.
  • If you want to use an Indic language in your MediaWiki installation, you will need the extension UniversalLanguageSelector
Manually install the VisualEditor extension

The following instructions assume you're using the Debian package for MediaWiki 1.30

  1. Install the Debian packages php-curl and dirmngr
  2. Follow the setup instructions given for Debian in the Parsoid Setup page.
  3. Make this change for MediaWiki 1.30 (and remove it after upgrade to 1.31)
  4. The url in /etc/mediawiki/parsoid/config.yaml should be http://localhost/mediawiki/api.php
  5. Restart parsoid service by running systemctl restart parsoid
  6. Download and install VIsualEditor extension for MediaWiki 1.30
  7. Add the following lines in your /etc/mediaWiki/LocalSettings.php file
# VisualEditor config
wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable'] = 1;

$wgVirtualRestConfig['modules']['parsoid'] = array(
  // URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
  'url' => 'http://localhost:8142',
  // Parsoid "domain" (string, optional) - MediaWiki >= 1.26
  'domain' => 'localhost',
  // Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
  'prefix' => 'localhost',
  // Forward cookies in the case of private wikis (string or false, optional)
  'forwardCookies' => false,
  // request timeout in seconds (integer or null, optional)
  'timeout' => null,
  // Parsoid HTTP proxy (string or null, optional)
  'HTTPProxy' => null,
  // whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
  'restbaseCompat' => null,
);

Tiny Tiny RSS

  • Tiny Tiny RSS web UI is unpalatable for people used to things like Medium, but the official Android app is really good.
  • Follow medium blogs using Tiny Tiny RSS without having to create an account.
  • Follow activity feed from GitLab sites (e.g. Debian Salsa) using TT-RSS.
  • Backup Tiny Tiny RSS feeds list (the opml file) to a Syncthing folder.
  • Add feed subscriptions to Tiny Tiny RSS from Firefox.

Other use cases

  • Public file sharing from FreedomBox
    FreedomBox comes with the Apache userdir module enabled by default. You can create a directory for your user called public_html in your user's home directory and place your files there. See my publicly shared files at https://njoseph.me/~joseph/
  • Personal website for each user
    Every user on a FreedomBox gets the option to host a website by default.
    Steps:
 1. SSH into your FreedomBox
 2. Create a directory called ~/public_html
 3. Place the files of your website in the above directory

Your website will be available on the path ~username on your FreedomBox, e.g. https://familyname.host/~username

Hardware

  • Make sure the device is getting adequate power supply (e.g. 2 Amp for a Raspberry Pi) or the performance will suffer.
  • Your microSD card's speed impacts performance of your FreedomBox more than anything else. Make sure to buy something fast enough (UHS 1 or more).
  • microSD cards are unreliable in general. Make sure to keep a dd backup of the entire SD card to another computer frequently.

Raspberry Pi 3 Wi-Fi Access Point

Raspberry Pi 3 comes with a built-in Broadcom Wi-Fi module. The firmware for this is non-free and must be installed manually on FreedomBox.

Run the commands in the following steps on the FreedomBox using ssh.

  1. A file must be added to the firmware directory first.
cd /lib/firmware/brcm/
wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/54bab3d6a6d43239c71d26464e6e10e5067ffea7/brcm80211/brcm/brcmfmac43430-sdio.txt
  1. Make sure that non-free is enabled in /etc/apt/sources.list
  2. Install the package firmware-brcm80211
  3. reboot or run rmmod brcmfmac && modprobe brcmfmac

After this, if you run the 'ip addr' command, you should see a new 'wlan0' interface come up.

Go to Plinth -> Networks -> Add WiFi, select device, give any name, set ssid, set infrastructure mode, ipv4 shared mode and set access point password. Then activate connection to get Wi-Fi access point from FreedomBox.

Unsupported Software

NextCloud

NextCloud is a Google Drive replacement that

  • can update itself
  • can play a lot of multimedia formats and display epub files
  • has a simple project-tracking tool similar to Trello
  • can be a personal content server with streaming capabilities
  • can be used as a CalDAV/WebDAV server (contacts and calendar sync)
  • can store your bookmarks
  • has cool mobile apps

Development and Debugging

start from scratch

vagrant destroy -f; vagrant box remove freedombox/plinth-dev; vagrant up; vagrant provision


To uninstall diaspora

apt remove --purge diaspora diaspora-common && echo "delete from plinth_module where name='diaspora';" | sqlite3 /var/lib/plinth/plinth.sqlite3


To run in debug mode (doesn't work for files under actions/ folder)

rm /etc/plinth/plinth.config cd /vagrant systemctl stop plinth ./run --debug


To open a file in emacs as root@vagrant

mkdir /root/.ssh 
cp /home/vagrant/.ssh/authorized_keys /root/.ssh


Run only one test

./setup.py test -s plinth.modules.sso.tests.test_auth_pubtkt_util.TestAuthPubTKTUtil.test_create_key_pair


Vagrant box download for plinth-dev

wget -O ~/FreedomBox/plinth-dev.box https://app.vagrantup.com/freedombox/boxes/plinth-dev/versions/<version>/providers/virtualbox.box


To use the local box instead of downloading from repo

vagrant box add --name freedombox/plinth-dev <box name>


Turning off mac address randomization in Network Manager

Add this line to all files in /etc/NetworkManager/system-connections under wifi or ethernet or whatever.

mac-address-randomization=0


Login into ttrss Postgresql database

sudo -n -u postgres /bin/bash postgres
psql -d ttrss -U ttrss -h localhost