Skip to content

Instantly share code, notes, and snippets.

@Otiel
Created August 8, 2018 16:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Otiel/a7d805989749d7388bda52e236e7f0ce to your computer and use it in GitHub Desktop.
Save Otiel/a7d805989749d7388bda52e236e7f0ce to your computer and use it in GitHub Desktop.
Install OpenSTF on Debian 9.5.0 (Stretch)

Installing OpenSTF on Debian 9.5.0 (Stretch)

/!\ All commands should be run with a "simple" user (not root!). nvm (Node Version Manager) must not be installed with root!

Setup

We are going to install nvm (and STF) under /home/<username>.

cd ~
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install --lts
sudo apt-get install -y libprotobuf-dev
sudo apt-get install -y libcurl3
wget http://samuelhughes.com/misc/bin/rethinkdb_2.3.6+stretch%7E0stretch_amd64.deb
sudo dpkg -i rethinkdb_2.3.6+stretch~0stretch_amd64.deb
rm rethinkdb_2.3.6+stretch~0stretch_amd64.deb
sudo apt-get install -y graphicsmagick
sudo apt-get install -y yasm
sudo apt-get install -y pkg-config
sudo apt-get install -y android-tools-adb
sudo apt-get install -y libczmq-dev libczmq4
sudo apt-get install -y build-essential
sudo apt-get install -y usbutils
npm install -g stf

Check that all components are OK

stf doctor

All components must be OK except Protobuf:

ERR/cli:doctor 2481 [*] ProtoBuf is not installed (protoc is missing)

Check that your Android device is seen by the OS and adb

Plug your Android device in a USB port.

lsusb
adb start-server
adb devices

Allow USB debugging on Android:

usb debugging

Accept RSA key exchange on Android:

rsa key exchange

Start services in command line mode to test

rethinkdb
stf local --public-ip <ip-address>

You should be able to access http://<ip-address>:7001 and see the STF login page. After login, you should be able to see and take control of your Android device.

Now clean the command-line-mode-test files as we'll setup the database in another repository during the service setup below:

rm -rf /home/<username>/rethinkdb_data

Install RethinkDB service

Reference: https://www.rethinkdb.com/docs/start-on-startup

sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance-stf.conf
sudo vi /etc/rethinkdb/instances.d/instance-stf.conf

Edit the file to change only this option:

bind=all

sudo service rethinkdb start
sudo service rethinkdb status

Install STF service

sudo vi /lib/systemd/system/sft.service

Create the file as follows. Make sure to check the paths (Node version, user name) and your IP address:

[Unit]
Description=OpenSTF
[Service]
User=<username>
Group=<group of user>
Environment="PATH=/home/<username>/.nvm/versions/node/v8.11.3/bin:$PATH"
ExecStart=/home/<username>/.nvm/versions/node/v8.11.3/bin/stf local --public-ip <ip-address>
[Install]
WantedBy=default.target

Start the service and enable it for auto-start:

sudo service stf start
sudo service stf status
sudo systemctl enable stf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment