From dc50db57f6fbb68411b8f7a35b19b80f9cca58bd Mon Sep 17 00:00:00 2001 From: jon r Date: Tue, 24 Sep 2024 21:35:48 +0200 Subject: [PATCH] reify READMEs into documentation --- content/_index.md | 24 ++++++- content/about.md | 15 +++++ content/contributing.md | 46 +++++++++++++ content/docs/applications.md | 10 --- content/docs/installation.md | 10 --- content/docs/system-modules.md | 10 --- content/installation/_index.md | 22 +++++++ content/installation/cloud.md | 37 +++++++++++ content/installation/hetzner.md | 77 ++++++++++++++++++++++ content/installation/linux.md | 112 ++++++++++++++++++++++++++++++++ content/modules/_index.md | 18 +++++ content/modules/applications.md | 42 ++++++++++++ content/modules/system.md | 31 +++++++++ content/support.md | 17 +++++ 14 files changed, 440 insertions(+), 31 deletions(-) create mode 100644 content/about.md create mode 100644 content/contributing.md delete mode 100644 content/docs/applications.md delete mode 100644 content/docs/installation.md delete mode 100644 content/docs/system-modules.md create mode 100644 content/installation/_index.md create mode 100644 content/installation/cloud.md create mode 100644 content/installation/hetzner.md create mode 100644 content/installation/linux.md create mode 100644 content/modules/_index.md create mode 100644 content/modules/applications.md create mode 100644 content/modules/system.md create mode 100644 content/support.md diff --git a/content/_index.md b/content/_index.md index b373b01..930445b 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1 +1,23 @@ -# compose.libre.sh +# `libre.sh` *Compose Edition* + +[![Backers on Open Collective](https://opencollective.com/libresh/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/libresh/sponsors/badge.svg)](#sponsors) + +> An ecosystem to ease free software hosting \o/ + +## What is `libre.sh`? + +[`libre.sh`](https://libre.sh/), Compose Edition, is a little framework to host Docker Compose in systemd. It is simple, modular and puts convention over configuration. + +This is aimed at hosters to manage a large amount of web applications and a quantity of domain names. + +It is currently installed at three different hosters in production. + +When installed, use it to: + +- buy a domain name +- configure DNS +- configure email (with dkim, dmarc, autoconfig) +- install and start a web application on that domain (WordPress, Nextcloud, Matomo...) +- provision a TLS certificate on that domain + +Amazing, right? diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..355f3a8 --- /dev/null +++ b/content/about.md @@ -0,0 +1,15 @@ +--- +weight: 100 +--- + +# About + +[libre.sh](https://libre.sh/) is an ecosystem of libre hosting platforms for community infrastructure. + +## Other projects + +Simplifying web application hosting has always been a goal for a lot of other projects, here is some project that share goals with libre.sh + + - Yunohost https://yunohost.org + - Sandstorm https://sandstorm.io/ + - Cloudron https://git.cloudron.io/cloudron/box diff --git a/content/contributing.md b/content/contributing.md new file mode 100644 index 0000000..9206ac8 --- /dev/null +++ b/content/contributing.md @@ -0,0 +1,46 @@ +--- +title: 'Contributing' +weight: 90 +--- + +# Contributing + +If you have any issue (something not working, missing doc), please do report an issue here! Thanks + +This system is used in production at [IndieHosters](https://indiehosters.net/) so it is maintained. If you use it, please tell us, and we'll be really happy to update this README! + +You can help us by: + - starring this project + - sending us a thanks email + - reporting bugs + - writing documentation/blog on how you got up and running in 5mins + - writing more documentation + - sending us cake :) We loove cake! + +## Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. + + + +## Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/libresh#backer)] + + + + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/libresh#sponsor)] + + + + + + + + + + + diff --git a/content/docs/applications.md b/content/docs/applications.md deleted file mode 100644 index e793d25..0000000 --- a/content/docs/applications.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Applications" -weight: 1 -# bookFlatSection: false -# bookToc: true -# bookHidden: false -# bookCollapseSection: false -# bookComments: false -# bookSearchExclude: false ---- diff --git a/content/docs/installation.md b/content/docs/installation.md deleted file mode 100644 index 0a1e491..0000000 --- a/content/docs/installation.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Installation" -weight: 1 -# bookFlatSection: false -# bookToc: true -# bookHidden: false -# bookCollapseSection: false -# bookComments: false -# bookSearchExclude: false ---- diff --git a/content/docs/system-modules.md b/content/docs/system-modules.md deleted file mode 100644 index c1e18ef..0000000 --- a/content/docs/system-modules.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "System Modules" -weight: 1 -# bookFlatSection: false -# bookToc: true -# bookHidden: false -# bookCollapseSection: false -# bookComments: false -# bookSearchExclude: false ---- diff --git a/content/installation/_index.md b/content/installation/_index.md new file mode 100644 index 0000000..0b4d609 --- /dev/null +++ b/content/installation/_index.md @@ -0,0 +1,22 @@ +--- +title: "Installation" +weight: 10 +# bookFlatSection: false +# bookToc: true +# bookHidden: false +# bookCollapseSection: false +# bookComments: false +# bookSearchExclude: false +--- + +# Installation + +To install it, follow the instructions for one of these options: + +- [Cloud](./cloud) +- [Hetzner](./hetzner) +- [Linux](./linux) + +Alternatively, you can run our installer script: + + wget https://lab.libreho.st/libre.sh/compose.libre.sh/raw/master/install.linux.sh -O - | bash diff --git a/content/installation/cloud.md b/content/installation/cloud.md new file mode 100644 index 0000000..5428cfd --- /dev/null +++ b/content/installation/cloud.md @@ -0,0 +1,37 @@ +# Instructions to install libre.sh + +Recommendation + +- you'd need API key on Namecheap (if you want to automatically buy and configure domain name) + +## Installation + +These instructions depend a bit on your cloud provider. + +### [Digital Ocean](https://m.do.co/c/1b468ce0671f) + + 1. Install [doctl](https://github.com/digitalocean/doctl/) + 2. Issue the following command: + +``` +doctl compute droplet create libre.sh --user-data-file ./user_data --wait --ssh-keys $KEY_ID --size 1gb --region lon1 --image coreos-stable +``` + +### Provider with user_data support + +If you use a cloud provider that support `user_data`, like [Scaleway](http://scaleway.com/), just use [this user_data](https://raw.githubusercontent.com/indiehosters/libre.sh/master/user_data). + +### Hetzner + +You can also buy a baremetal at [Hetzner](https://serverboerse.de/index.php?country=EN) as they are the cheapest options around. Follow these [instructions](hetzner) in this case. + +### Provider without user_data support + +Use boot a live cd, and issue that command: + +``` +wget https://raw.github.com/coreos/init/master/bin/coreos-install +bash coreos-install -d /dev/sda -c user_data +``` + +And voila, your first libre.sh node is ready! diff --git a/content/installation/hetzner.md b/content/installation/hetzner.md new file mode 100644 index 0000000..4394d25 --- /dev/null +++ b/content/installation/hetzner.md @@ -0,0 +1,77 @@ +# Instructions to install libre.sh + +Recommendation + +- ssd on /dev/sda +- hdd on /dev/sdb +- hdd on /dev/sdc +- API key on Namecheap (if you want to automatically buy domain name) + +## Installation + +First, you need a server. +We recommend [Hetzner](https://serverboerse.de/index.php?country=EN) as they are the cheapest options around. +You can filter servers with ssd. + +These instructions can also work on any VM/VPS/Hardware. + +### The system + +``` +IP= + +ssh -o "StrictHostKeyChecking no" root@$IP + +hostname= +ssh_public_key="" + +fdisk -l #find your ssd + +# Setup raid +cat > /etc/mdadm.conf << EOF +MAILADDR dev@null.org +EOF +mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdb /dev/sdc +mkfs.ext4 /dev/md0 + +cat > cloud-config.tmp << EOF +#cloud-config + +hostname: "$hostname" +ssh_authorized_keys: + - $ssh_public_key +EOF + +apt-get install gawk +wget https://raw.github.com/coreos/init/master/bin/coreos-install +bash coreos-install -d /dev/sda -c cloud-config.tmp + +reboot +``` + +``` +ssh core@$IP + +#configure mdmonitor. + +sudo su - + +mdadm --examine --scan > /etc/mdadm.conf +vim /etc/mdadm.conf +#ADD your mail +MAILADDR xxx@xxx.org + +# Start service +systemctl start mdmonitor.service + +cat > /etc/systemd/system/data.mount << EOF +[Mount] +What=/dev/md0 +Where=/data +Type=ext4 +EOF + +wget https://raw.githubusercontent.com/indiehosters/libre.sh/master/user_data -O /var/lib/coreos-install/user_data + +coreos-cloudinit /var/lib/coreos-install/user_data +``` diff --git a/content/installation/linux.md b/content/installation/linux.md new file mode 100644 index 0000000..26533bd --- /dev/null +++ b/content/installation/linux.md @@ -0,0 +1,112 @@ +# Instructions to install libre.sh on linux with Systemd + +Recommendation + +- Systemd distro (ubuntu server 18.04.3 or debian 9 ) + +## Installation +Where basicly reproduce what the user_data do for us. + +as root + +### configure sshd (Optional) +Don't forget to create the user core and adding your ssh key before +You could also remove AllowUsers core or/and change the username. + +``` +cat > /etc/ssh/sshd_config < /etc/sysctl.d/libresh.conf < /sys/kernel/mm/transparent_hugepage/enabled +``` + +### define Localhost (should not be needed but... ) + +``` +cat > /etc/hosts < /etc/environment < /opt/bin/docker-compose &&\ +chmod +x /opt/bin/docker-compose +``` +### Libre.sh + +``` +git clone https://lab.libreho.st/libre.sh/compose.libre.sh /libre.sh &&\ +mkdir -p /{data,system} &&\ +mkdir -p /data/trash &&\ +cp /libre.sh/unit-files/* /etc/systemd/system && systemctl daemon-reload &&\ +systemctl enable web-net.service &&\ +systemctl start web-net.service &&\ +mkdir -p /opt/bin &&\ +cp /libre.sh/utils/* /opt/bin/ +``` + +### add path + +``` +cat > /etc/profile.d/libre.sh <