add selfhosting tutorials

This commit is contained in:
oxeo0 2025-05-06 19:51:39 +02:00
parent 95c33c8b41
commit cc3824e6a2
1900 changed files with 32727 additions and 0 deletions

126
lainsafe/index.md Normal file
View file

@ -0,0 +1,126 @@
# CGI Lainsafe Setup
![](logo.png)
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
![](1.png)
verify it is pointing to your server's ip:
![](2.png)
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
![](3.png)
once that's done, configure nginx:
wget https://blog.nowhere.moe/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:
![](4.png)
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:
![](7.png)
Then just upload a file, and it will give you the link to it:
![](8.png) ![](9.png)
And that's it! just do ALT+leftarrow to return to the homepage. Obviously this was meant to be very minimalistic by the [author](https://github.com/qorg11/) 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:
![](10.png)