Ech0 - 00 / 00 / 00

CGI Lainsafe Setup

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

Initial setup

First install the dependencies:


apt update -y
apt install socat libcgi-pm-perl nginx curl fcgiwrap -y

Install acme.sh


wget -O -  https://get.acme.sh | sh
source ~/.bashrc

get a domain name, you can use duckdns.org

verify it is pointing to your server's ip:

Then get your free letsencrypt certificate using acme.sh:


systemctl stop nginx 
acme.sh --issue --standalone -d ech2.duckdns.org -k 4096
systemctl start nginx 

once that's done, configure nginx:


wget https://ech1.github.io/blog/servers/lainsafe/lainsafe.conf -O /etc/nginx/conf.d/lainsafe.conf
nano /etc/nginx/conf.d/lainsafe.conf

In nano, make sure you edit the configuration to match your domain name:

At the bottom you can change the maximum file upload size, by default it is 100mb. Once you're done, hit CTRL+S to save and CTRL+X to exit nano.

next we reload nginx and install lainsafe files:


nginx -s reload
mkdir /var/www/lainsafe/

cd /var/www/lainsafe/
mkdir .cgi
mkdir files

wget https://raw.githubusercontent.com/qorg11/lainsafe/master/http/index.cgi
wget https://raw.githubusercontent.com/qorg11/lainsafe/master/http/upload.cgi

chmod +x index.cgi
chmod +x upload.cgi


chown -R www-data: /var/www/lainsafe/

And from here just browse to your website:

Then just upload a file, and it will give you the link to it:

And that's it! just do ALT+leftarrow to return to the homepage. Obviously this was meant to be very minimalistic by the author so i'll leave it to you as to how you customise the page with css and more.

Uploading Files with Lainsafecli



From Arch Linux: (AUR)

[ 192.168.100.1/24 ] [ /dev/pts/2 ] [~]
→ yay -S lainsafecli

From Debian:

echo "deb http://repo.qorg11.net/debian stable main" >> /etc/apt/sources.list
wget http://repo.qorg11.net/repo.key -q -O - | sudo apt-key add
sudo apt updates
sudo apt install lainsafecli

Syntax:


[ 192.168.100.1/24 ] [ /dev/pts/2 ] [~]
→ lainsafecli --help
lainsafecli, a command line interface for lainsafe.
USAGE: lainsafecli [--tor | --i2p] [--server] FILE

if --server not given, https://lainsafe.duckdns.org is used.
--tor and --i2p are unavailable, flag are ignored


You can use lainsafecli with your own server like so:

3



My Bunker

Some Address 67120,
Duttlenheim, France.

About Ech0

This cute theme was created to showcase your work in a simple way. Use it wisely.