|
|
|
|
@ -1,12 +1,45 @@
|
|
|
|
|
* Setup
|
|
|
|
|
** Dependencies
|
|
|
|
|
* Project Goal
|
|
|
|
|
|
|
|
|
|
To make deploying, managing, and updating self-hosted app instances
|
|
|
|
|
easy.
|
|
|
|
|
|
|
|
|
|
* Supported Services
|
|
|
|
|
|
|
|
|
|
Currently, only a limited set of external services can be used for
|
|
|
|
|
hosting, DNS, and backups. This can be easily extended later with
|
|
|
|
|
modifications to the Terraform config. As of now, you will need to
|
|
|
|
|
have accounts with these providers:
|
|
|
|
|
|
|
|
|
|
- DigitalOcean
|
|
|
|
|
- Cloudflare (and have DNS available for a domain)
|
|
|
|
|
- Backblaze B2
|
|
|
|
|
|
|
|
|
|
* Architecture
|
|
|
|
|
|
|
|
|
|
The software stack is composed of a "base" command line interface that
|
|
|
|
|
can be used to deploy and manage a single instance with a
|
|
|
|
|
multi-instance, multi-user webapp that invokes the "base" as
|
|
|
|
|
needed. The "base" can be run separately from the webapp. The webapp
|
|
|
|
|
automatically generates the configs the "base" needs to run.
|
|
|
|
|
|
|
|
|
|
** "Base" Terraform Layer
|
|
|
|
|
|
|
|
|
|
The project is designed so that if you want to just manage a single
|
|
|
|
|
instance without the complexity of running a webapp you can easily do
|
|
|
|
|
so. This is both so that individual users can take advantage of this
|
|
|
|
|
but also so that when developing the Terraform and Docker Compose
|
|
|
|
|
setup it can be done and tested without needing to deal with the web
|
|
|
|
|
app as well.
|
|
|
|
|
|
|
|
|
|
** Setup "Base" CLI Terraform For Deploying Individual Instance
|
|
|
|
|
*** Dependencies
|
|
|
|
|
- [[https://developer.hashicorp.com/terraform/install][terraform]]
|
|
|
|
|
- [[https://www.docker.com/][docker]]
|
|
|
|
|
- bash
|
|
|
|
|
|
|
|
|
|
** Services
|
|
|
|
|
*** Services
|
|
|
|
|
|
|
|
|
|
*** [[https://www.digitalocean.com/][DigitalOcean]]
|
|
|
|
|
**** [[https://www.digitalocean.com/][DigitalOcean]]
|
|
|
|
|
|
|
|
|
|
- Create a DigitalOcean account and sign in to it
|
|
|
|
|
|
|
|
|
|
@ -18,7 +51,7 @@
|
|
|
|
|
- set the "scope" to "Full Access"
|
|
|
|
|
- save the generated token for placing in production.tfvars -> do_token
|
|
|
|
|
|
|
|
|
|
*** [[https://www.cloudflare.com/][Cloudflare]]
|
|
|
|
|
**** [[https://www.cloudflare.com/][Cloudflare]]
|
|
|
|
|
|
|
|
|
|
- Create a CloudFlare account and sign into it
|
|
|
|
|
|
|
|
|
|
@ -40,7 +73,7 @@
|
|
|
|
|
|
|
|
|
|
These will be used later on in config/production.tfvars for cloudflare_zone_id and cloudflare_account_id
|
|
|
|
|
|
|
|
|
|
*** [[https://backblaze.com][Backblaze]]
|
|
|
|
|
**** [[https://backblaze.com][Backblaze]]
|
|
|
|
|
|
|
|
|
|
This is used automated for "off-site" backups / snapshots.
|
|
|
|
|
|
|
|
|
|
@ -67,35 +100,39 @@ This is used automated for "off-site" backups / snapshots.
|
|
|
|
|
- Click "Create new key"
|
|
|
|
|
- Copy/save the key for later use in config/apps.config BACKBLAZE_APPLICATION_KEY and the "keyID" for BACKBLAZE_KEY_ID
|
|
|
|
|
|
|
|
|
|
** Configuration
|
|
|
|
|
*** apps.config
|
|
|
|
|
*** Configuration
|
|
|
|
|
**** apps.config
|
|
|
|
|
|
|
|
|
|
- ~cp config/apps.config.tmpl config/apps.config~
|
|
|
|
|
|
|
|
|
|
- then edit ~config/apps.config~ and fill in all variables
|
|
|
|
|
|
|
|
|
|
*** production.tfvars
|
|
|
|
|
**** production.tfvars
|
|
|
|
|
|
|
|
|
|
- ~cp config/production.tfvars.tmpl config/production.tfvars~
|
|
|
|
|
|
|
|
|
|
- then edit ~config/production.tfvars~ and fill in all variables
|
|
|
|
|
|
|
|
|
|
*** ssh keys
|
|
|
|
|
**** ssh keys
|
|
|
|
|
|
|
|
|
|
- ~touch config/ssh-keys~
|
|
|
|
|
|
|
|
|
|
- if you want to add your ssh key(s) for debugging then paste the pub ID in to the file
|
|
|
|
|
|
|
|
|
|
*** initializing the "off-site" Restic backups
|
|
|
|
|
**** initializing the "off-site" Restic backups
|
|
|
|
|
|
|
|
|
|
- ~make restic-init~
|
|
|
|
|
|
|
|
|
|
* Deploy
|
|
|
|
|
*** Deploy
|
|
|
|
|
|
|
|
|
|
- ~make apply~
|
|
|
|
|
|
|
|
|
|
* You're done!
|
|
|
|
|
*** You're done!
|
|
|
|
|
|
|
|
|
|
It will take a few minutes to deploy the server, start it, and pull
|
|
|
|
|
all the docker images. But after that you should be able to visit your
|
|
|
|
|
site and the apps running on its subdomains!
|
|
|
|
|
|
|
|
|
|
** Webapp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|