Skip to content

Olivetin

Description⚓︎

OliveTin gives safe and simple access to predefined shell commands from a web interface.

Bare Metal⚓︎

Basic info⚓︎

Basic info with official links

config.yaml⚓︎

YAML
---
# There is a built-in micro proxy that will host the webui and REST API all on 
# one port (this is called the "Single HTTP Frontend") and means you just need 
# one open port in the container/firewalls/etc. 
#
# Listen on all addresses available, port 1337
listenAddressSingleHTTPFrontend: 0.0.0.0:1337

# Choose from INFO (default), WARN and DEBUG
logLevel: "INFO"

# Actions (buttons) to show up on the WebUI:
actions:

- title: Restart Computers
  icon: "⟲"
  shell: ssh "{{ computers }}" 'sudo reboot'
  arguments:
    - name: computers
      choices:
        - title: Acer
          value: [email protected]

        - title: Main PC
          value: [email protected]

        - title: Pi4
          value: [email protected]

        - title: Pi Zero
          value: [email protected]

- title: Poweroff Computers
  icon: "⏻"
  shell: ssh "{{ computers }}" 'sudo poweroff'
  arguments:
    - name: computers
      choices:
        - title: Acer
          value: [email protected]

        - title: Main PC
          value: [email protected]

        - title: Pi4
          value: [email protected]

        - title: Pi Zero
          value: [email protected]

- title: Boot Computers
  icon: "🥾"
  shell: wakeonlan "{{ computers }}"
  arguments:
    - name: computers
      choices:
        - title: Acer
          value: fc:45:96:e7:cf:08

        - title: Main PC
          value: 18:c0:4d:39:0c:ff

- title: Monitor Functions
  icon: "🖵"
  shell: ssh [email protected] 'xset -display :0 dpms force "{{ function }}"'
  arguments:
    - name: function
      choices:
        - title: Turn Monitor On
          value: "on"

        - title: Turn Monitor Off
          value: "off"

- title: Restart AdGuard
  shell: systemctl restart AdGuardHome.service
  icon: "⌂"
  timeout: 5

- title: Restart Olivetin
  shell: systemctl restart OliveTin
  icon: "🫒"
  timeout: 5

Setup⚓︎

Prerequisite⚓︎

SSH setup⚓︎

  • Copy ssh directory to root user's home direrctory

    Bash
    sudo cp -r /home/$USER/.ssh /root/.ssh
    

  • Switch to root user

    Bash
    sudo su
    

  • Fix the permissions

    Bash
    chmod 700 /root/.ssh
    chmod 600 /root/.ssh/authorized_keys
    

  • SSH into all the machines once

    Copy paste from config.yaml

  • Make some commands passwordless with sudo visudo

    Paste before the last line
    ALL ALL=NOPASSWD: /sbin/poweroff,/sbin/reboot,/sbin/shutdown
    

Wake on LAN⚓︎

Warning

Ticked options are to be run on clients and unticked on server
Refer to Arch Wiki for more information on WoL Arch Wiki for WoL

  • Install wakeonlan package

    Bash
    sudo apt install wakeonlan -y
    

  • Enable wakeonlan function at firmware level on clients

  • Find interface name

    Here enp1s0 is primary NIC
    1
    2
    3
    4
    5
    6
    7
    8
    9
    ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
    2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
        link/ether fc:55:55:55:55:55 brd ff:ff:ff:ff:ff:ff
        inet 192.168.29.11/24 metric 100 brd 192.168.29.255 scope global dynamic enp1s0
          valid_lft 47171sec preferred_lft 47171sec
    

  • Create systemd-service for WoL

    sudoedit /etc/systemd/system/[email protected]
    [Unit]
    Description=Wake-on-LAN for %i
    Requires=network.target
    After=network.target
    
    [Service]
    ExecStart=/usr/sbin/ethtool -s %i wol g
    Type=oneshot
    
    [Install]
    WantedBy=multi-user.target
    

  • Enable WoL service

    Bash
    sudo systemctl enable wol@interface --now
    

  • Reboot twice

  • Check WoL status

    Wake-on: g means WoL is enabled
    sudo ethtool enp1s0 | grep Wake-on
    

Installation⚓︎

Warning

For some reason, setup didn't go well when doing all this via root user so I'm running these as general user
This guide is written with a Pi-Zero ,running Raspbian, in mind

  • Download relevant package from Github

    Deb packge for Armv6
    wget -O OliveTin.deb https://github.com/OliveTin/OliveTin/releases/download/2022-04-07/OliveTin_2022-04-07_linux_armv6.deb
    

  • Make the pkg executable

    Bash
    sudo chmod +x OliveTin.deb
    

  • Install the package:

    Bash
    sudo dpkg -i OliveTin.​deb
    

  • Make a backup copy of default config

    Bash
    sudo mv /etc/OliveTin/config.yaml /etc/OliveTin/BAK.config.yaml
    

  • Copy modified config file

    Bash
    sudo cp /home/$USER/GitIt/SyncFiles/configBak/olivetin/config.yaml /etc/OliveTin/config.yaml
    

  • Start and enable OliveTin service

    Bash
    sudo systemctl enable OliveTin.service --now
    

  • Check service status

    Bash
    sudo systemctl status OliveTin.service
    

Tip

Mount /etc/OliveTin via ssh to edit config file

Bash
sshfs [email protected]:/etc/OliveTin Bench/OliveTin