Ubuntu 24.04 LTS, nearest region
2 GB RAM / 1 AMD CPU / 50 GB NVMe
Adapted from caddy systemd Service Unit
The provided file should work with systemd version 219 or later. It might work with earlier versions.
The easiest way to check your systemd version is to run systemctl --version.
We will assume the following:
| // No Security | |
| { | |
| "rules": { | |
| ".read": true, | |
| ".write": true | |
| } | |
| } |
| # maximum capability of system | |
| user@ubuntu:~$ cat /proc/sys/fs/file-max | |
| 708444 | |
| # available limit | |
| user@ubuntu:~$ ulimit -n | |
| 1024 | |
| # To increase the available limit to say 200000 | |
| user@ubuntu:~$ sudo vim /etc/sysctl.conf |
| CREATE TABLE accounts( | |
| id serial PRIMARY KEY, | |
| name VARCHAR(256) NOT NULL | |
| ); | |
| CREATE TABLE entries( | |
| id serial PRIMARY KEY, | |
| description VARCHAR(1024) NOT NULL, | |
| amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
| -- Every entry is a credit to one account... |
| # Kernel sysctl configuration file for Linux | |
| # | |
| # Version 1.12 - 2015-09-30 | |
| # Michiel Klaver - IT Professional | |
| # http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant | |
| # | |
| # This file should be saved as /etc/sysctl.conf and can be activated using the command: | |
| # sysctl -e -p /etc/sysctl.conf | |
| # | |
| # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details. |
| frontend www-http | |
| bind :80 | |
| bind *:443 ssl crt /etc/haproxy/certs no-sslv3 | |
| capture request header X-Forwarded-For len 50 | |
| acl is_cf req.hdr(cf-connecting-ip) -m found | |
| http-request set-header X-Client-IP %[src] if !is_cf | |
| http-request set-header X-Client-IP %[hdr(cf-connecting-ip)] if is_cf |
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| /* CSS */ | |
| #CloudFlare | |
| set_real_ip_from 103.21.244.0/22; | |
| set_real_ip_from 103.22.200.0/22; | |
| set_real_ip_from 103.31.4.0/22; | |
| set_real_ip_from 104.16.0.0/12; | |
| set_real_ip_from 108.162.192.0/18; | |
| set_real_ip_from 141.101.64.0/18; | |
| set_real_ip_from 162.158.0.0/15; | |
| set_real_ip_from 172.64.0.0/13; | |
| set_real_ip_from 173.245.48.0/20; |
| # YOU MAY WANT TO CHECK THIS OUT: https://github.com/douglasmiranda/ddpt/blob/master/{{cookiecutter.django_project_name}}/{{cookiecutter.django_project_name}}/config/local.py | |
| # If you don't do this you will have to add the host IP in INTERNAL_IPS = ('127.0.0.1',) | |
| # And it will change, then you will have to change INTERNAL_IPS again. | |
| def show_toolbar(request): | |
| if request.is_ajax(): | |
| return False | |
| return True |