From 0620d9a7265528ea7ba796f7922be1887c3857d0 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 7 May 2020 15:05:42 +0000 Subject: [PATCH] [DOCUMENTATION] Added install documentation --- DOCKER_INSTALL.md | 7 ---- DOCUMENTATION/install.md | 1 + INSTALL.md | 75 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 7 deletions(-) delete mode 100644 DOCKER_INSTALL.md create mode 120000 DOCUMENTATION/install.md create mode 100644 INSTALL.md diff --git a/DOCKER_INSTALL.md b/DOCKER_INSTALL.md deleted file mode 100644 index d19e35f7c7..0000000000 --- a/DOCKER_INSTALL.md +++ /dev/null @@ -1,7 +0,0 @@ - -Make sure to set the permissions of this folder to group and group 82, as that's what php-fpm uses - -# groupadd -g 82 www-data -# useradd -u 82 -g 82 -r -s /usr/bin/nologin www-data -# chown $USER:www-data social file public public/install.php public/index.php -# chmod -R g=wrx social file public public/install.php public/index.php \ No newline at end of file diff --git a/DOCUMENTATION/install.md b/DOCUMENTATION/install.md new file mode 120000 index 0000000000..71db8b4934 --- /dev/null +++ b/DOCUMENTATION/install.md @@ -0,0 +1 @@ +../INSTALL.md \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000000..16f3efc140 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,75 @@ +## GNU social + +GNU social is a federated social network. + +Installation can be done in multiple ways, but the simplest is using +`docker` and `docker-compose`. The compose file currently includes all +the necessary services for running the app. Running the database and +webserver outside of `docker` containers is currently not supported, +unless the app is installed without `docker`. + +## With docker + +### Requirements + +In order to host your GNU social instance, you'll need a domain, a +server with a constant IP and `docker` and `docker-compose` installed +on your system. + +Alternatively, for local hosting or development, behind a NAT, use a +dynamic DNS solutions. I recommend you go to +https://gnudip.datasystems24.net or another GnuDIP host and register. +Then clone https://notabug.org/someonewithpc/gnudip.git, inspect and +run the `./install.sh` script. This allows you to have a domain that +dynamically points to your IP address. + +### TLS/SSL + +Next, if you want to setup SSL (which you should in most cases, +exceptions being wanting to use the Thor network), you'll need a +certificate. There are multiple approaches to achieve this, among +which are using a proxy server capable of either proxying an HTTP +connection to HTTPS or an HTTPS connection to HTTPS, or creating a +certificate signed by Let's Encrypt. For the former, follow the +instructions of your proxy provider. + +If you're not using a proxy, you can use the +`bin/bootstrap_certificates` script to generate and install +certificates signed by Let's Encrypt. To do this, you should add the +server's IP (even if it's dynamic) as an `A` DNS record with your DNS +provider (normally, your domain registrar). The `A` record doesn't +need to be at the root of your domain, meaning it's name can be a +subdomain. Then, run the aforementioned script and fill in the +details; this requires `docker` and `docker-compose` and will create +the requested certificate. + +After doing the above, if you don't have a static IP, go to your DNS +manager, delete the `A` record you created in the previous step and +create a `CNAME` record pointing from the domain you want to use the +domain you registered with the GnuDIP host. + +### No TLS/SSL + +Edit the `docker-compose.yaml` file and comment the `certbot` service +to disable it. In the future, this will be handled by the +`bin/configure` script. + +### Configuration + +Run the `bin/configure` script and enter the information as asked. +This will generate all the required `.env` files used by +`docker-compose` to configure the application. + +### Installation/Running + +Simply run `docker-compose up` from the root of the project (the +folder where the `.git` folder is). In this form, the application can +be stopped by pressing `C-c` (`CTRL` + `C`); pressing it again will +force the containers to stop immediately. However, this form will show +you all logs, but in most cases, you won't want to see those all the +time. For that, run `docker-compose up -d` from the same directory; +The application can then be stopped with `docker-compose down`. + +## Without docker + +Coming soon (TM)