Previous Page

nihilist - 02 / 11 / 2022

hatsh Setup

In this tutorial we're going to setup a instance, which is a web app that provides secure local file encryption in the browser.

Initial Setup

root@lainsafe:~# cd /var/www
root@lainsafe:/var/www# git clone
Cloning into ''...
remote: Enumerating objects: 2392, done.
remote: Counting objects: 100% (337/337), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 2392 (delta 273), reused 251 (delta 246), pack-reused 2055
Receiving objects: 100% (2392/2392), 3.88 MiB | 3.95 MiB/s, done.
Resolving deltas: 100% (1324/1324), done.

root@lainsafe:/var/www# cd
root@lainsafe:/var/www/ apt install npm -y

root@lainsafe:/var/www/ npm install

root@lainsafe:/var/www/ npm run build

root@lainsafe:/var/www/ ip a | grep inet
    inet scope host lo
    inet6 ::1/128 scope host
    inet brd scope global eth0
    inet6 fe80::709a:74ff:fec2:47af/64 scope link1

root@lainsafe:/var/www/ npm run start

> start
> next start -p 3991

ready - started server on, url: http://localhost:3991
info  - Loaded env from /var/www/	

From there we can encrypt files:

And we decrypt it like so:

Automation Setup

We want it to start automatically with a systemd service:

root@lainsafe:/var/www/ cat /etc/systemd/system/hatsh.service
[Unit] local file encryption

ExecStart=/usr/bin/npm run start


root@lainsafe:/var/www/ systemctl daemon-reload
root@lainsafe:/var/www/ systemctl enable --now hatsh
root@lainsafe:/var/www/ systemctl status hatsh
* hatsh.service - local file encryption
     Loaded: loaded (/etc/systemd/system/hatsh.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-11-02 19:10:20 UTC; 6s ago
   Main PID: 16508 (node)
      Tasks: 23 (limit: 115830)
     Memory: 106.5M
        CPU: 3.601s
     CGroup: /system.slice/hatsh.service
             |-16508 npm run start
             |-16520 sh -c next start -p 3991
             `-16521 node /var/www/ start -p 3991

Nov 02 19:10:20 lainsafe systemd[1]: Started local file encryption.
Nov 02 19:10:21 lainsafe npm[16508]: > start
Nov 02 19:10:21 lainsafe npm[16508]: > next start -p 3991
Nov 02 19:10:22 lainsafe npm[16521]: ready - started server on, url: http://localhost:3991
Nov 02 19:10:22 lainsafe npm[16521]: info  - Loaded env from /var/www/


Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8

Contact: (PGP)