Update Registration and Provisioning via signal cli authored by about:privacy's avatar about:privacy
## Persistent Storage
0. Make sure you are using an up to date Tails OS, check out https://tails.boum.org/doc/upgrade/.
1. Create persistent storage, follow the steps on https://tails.boum.org/doc/persistent_storage/create/, skip to step 2 if you already have a persistent storage
2. Configure persistent storage with *[Additonal software](https://tails.boum.org/doc/persistent_storage/configure/#index12h2)* enabled and features according to your other needs (mail, pgp, additional software) follow the steps on https://tails.boum.org/doc/persistent_storage/configure/, skip to [Install signal-cli](#install-signal-cli) if you already have configured your persistent storage with *additional software* enabled.
3. In order to keep [signal-cli's storage](https://github.com/AsamK/signal-cli#storage) persistent, execute:
~~~
sed -i '$ a /home/amnesia/.local/share/signal-cli/ source=signal-cli' /live/persistence/TailsData_unlocked/persistence.conf
~~~
4. Shutdown Tails.
## Configuring additional APT repositories for signal-cli
1. Start your Tails unlocking your persistent storage and setup an administration password, follow section *Set up an administration password* at https://tails.boum.org/doc/first_steps/welcome_screen/administration_password/.
2. Choose Applications ▸ System Tools ▸ Terminal
3. Get root privileges with executing `sudo -i` use the password set in step 1.
4. Create an apt-sources.list.d folder in your Persistent Storage:
~~~
install -d -m 755 /live/persistence/TailsData_unlocked/apt-sources.list.d
~~~
5. We need to make the `apt-sources.list.d ` folder persistent, by executing:
~~~
sed -i '$ a /etc/apt/sources.list.d source=apt-sources.list.d,link' /live/persistence/TailsData_unlocked/persistence.conf
~~~
6. Now we add the [signal-cli debian repository](https://packaging.gitlab.io/signal-cli/installation/standalone/#repository) to a new file `/live/persistence/TailsData_unlocked/apt-sources.list.d/morph027-signal-cli.list` and set correct file ownership and permissions:
~~~
echo -e 'deb tor+https://packaging.gitlab.io/signal-cli signalcli main' | tee -a /live/persistence/TailsData_unlocked/apt-sources.list.d/morph027-signal-cli.list && chown root:root /live/persistence/TailsData_unlocked/apt-sources.list.d/morph027-signal-cli.list && chmod 644 /live/persistence/TailsData_unlocked/apt-sources.list.d/morph027-signal-cli.list
~~~
7. We need to download and add the signal-cli's repo signing key to apt:
~~~
torify curl -sL -o /home/amnesia/Persistent/morph027-signal-cli.asc https://packaging.gitlab.io/signal-cli/gpg.key && chown amnesia:amnesia /home/amnesia/Persistent/morph027-signal-cli.asc && cp /home/amnesia/Persistent/morph027-signal-cli.asc /etc/apt/trusted.gpg.d/
~~~
8. Create a script for adding the signing key to apt:
~~~
echo -e '#/bin/sh\ncp /home/amnesia/Persistent/morph027-signal-cli.asc /etc/apt/trusted.gpg.d/' | tee -a /home/amnesia/Persistent/apt-keys.sh && chown amnesia:amnesia /home/amnesia/Persistent/apt-keys.sh && chmod +x /home/amnesia/Persistent/apt-keys.sh
~~~
9. Shutdown Tails.
## Install signal-cli ## Install signal-cli
1. Start your Tails unlocking your persistent storage and setup an administration password, follow section *Set up an administration password* at https://tails.boum.org/doc/first_steps/welcome_screen/administration_password/.
2. Choose Applications ▸ System Tools ▸ Terminal
3. Run the script for adding signal-cli signing keys to apt: `Persistent/apt-keys.sh`
3. _Wait until additional software has been installed successfully_
4. Install signal-cli-jre with `sudo apt-get update && sudo apt-get install signal-cli-jre`
5. Make the installation persistent (*Install every time*) following step 3. at https://tails.boum.org/doc/persistent_storage/additional_software/#index4h2
## General use of signal-cli
1. Start your Tails unlocking your persistent storage
2. Run the script for adding signal-cli signing keys to apt: `Persistent/apt-keys.sh`
_Wait until additional software has been installed successfully_
3. Choose Applications ▸ System Tools ▸ Terminal
4. signal-cli-jre runs via Java runtime environment (jre). We need to tell jre to use torsocks' SOCKS proxy exporting the following value executing: `export JAVA_TOOL_OPTIONS="-Djava.net.preferIPv4Stack=true`
5. Start a shell with torsocks by executing: `torsocks --shell`
6. Now you can run any `signal-cli-jre` command, refer to [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) for help