Go to file
Jeremy Dormitzer 0f70f43090 Add nginx ssl termination server
Squashed commit of the following:

commit 8371367d54
Author: Jeremy Dormitzer <jeremy.dormitzer@gmail.com>
Date:   Tue Mar 8 11:56:39 2022 -0500

    Ensure that nginx restarts after cert renewal

commit f2ef1ba9f2
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Tue Oct 5 21:16:44 2021 -0400

    Put syncthing behind nginx

commit 6c10b1bb97
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Tue Oct 5 17:45:53 2021 -0400

    Put wallabag behind nginx proxy

commit dd29785d86
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 17:30:46 2021 -0400

    Put gitea behind the nginx proxy

commit 2d82c0ad54
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 13:36:37 2021 -0400

    Add terraform outputs and spin up nginx droplet

commit 322449a194
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 13:29:59 2021 -0400

    Finish packer build for nginx proxy

commit aec886064a
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 09:28:06 2021 -0400

    [WIP] Add actual server values to nginx conf

commit 2c645d94c6
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 09:06:02 2021 -0400

    [WIP] Use terraform to generate nginx conf file

commit 61ebc3d7af
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Mon Oct 4 09:04:56 2021 -0400

    Ignore all tmp directories

commit e3feb6d3f7
Author: Jeremy Dormitzer <jeremydormitzer@lola.com>
Date:   Sun Oct 3 12:32:42 2021 -0400

    [WIP] Begin adding packer config for centralized ssl termination
2022-03-08 11:57:45 -05:00
bin Move tf-init.sh to bin directory 2020-12-04 14:15:35 -05:00
mgmt Add nginx ssl termination server 2022-03-08 11:57:45 -05:00
prod Add nginx ssl termination server 2022-03-08 11:57:45 -05:00
terraform-modules/packer_droplet Add "terraform" tag to terraform-created DO resources 2021-01-22 11:42:39 -05:00
.dir-locals.el Add dir-locals 2021-10-03 12:31:53 -04:00
.envrc Switch to .env.local files instead of using pass directly in direnv 2021-01-25 10:20:18 -05:00
.gitignore Add nginx ssl termination server 2022-03-08 11:57:45 -05:00
README.md Move tf-init.sh to bin directory 2020-12-04 14:15:35 -05:00

My personal infrastructure-as-code

This repository contains the configuration files and scripts to support the infrastructure I use for personal projects.

Terraform environment variables and config

Terraform state is stored in a DigitalOcean Spaces bucket. In order to access the bucket, the Terraform backend configuration needs the access_key and secret_key variables set. These variables are the DigitalOcean Spaces access key and secret key, respectively, which are generated from the DigitalOcean Spaces UI. I'm passing them to Terraform via the -backend-config terraform init option and pulling their values from my password manager. This operation is encapsulated in the bin/tf-init.sh script.

The Terraform scripts also require some environment variables set:

export TF_VAR_do_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export TF_VAR_spaces_access_id=xxxxxxxxxxxxxxxxxxxx
export TF_VAR_spaces_secret_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The do_token is the DigitalOcean API token, generated from the DigitalOcean API console UI, and the spaces_access_id and spaces_secret_key are the same Spaces configuration values as above. I'm setting these variables via direnv with a .envrc file at the repository root.