Patches - cat-box/aws-foundry-ssl GitHub Wiki

⚠️ Backup before applying patches

Patch Release Date Template Application
Rc.local to Systemd Service June 3rd, 2021 N/A
FoundryVTT Update June 3rd, 2021 ALL
Node.js v14.x (0.8.0 Compatibility Patch) March 23rd, 2021 v1-1 to v1-6
Certificate Renewal January 15th, 2021 v1-1 to v1-5

Rc.local to Systemd Service

This is a QoL patch and is entirely optional.

Deployments prior to Oct 23, 2020 initially used rc.local out of convenience but ideally, it shouldn't be used to run foundry. This fixes that.

Instructions

  1. SSH into the EC2 server. If you require instructions on how to do so, follow the SSH Access Instructions.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ wget https://raw.githubusercontent.com/cat-box/aws-foundry-ssl/master/patches/sytemd_service.sh
    $ chmod a+x systemd_service.sh
    $ ./systemd_service.sh
    $ rm systemd_service.sh
  3. Restart the EC2 instance and that's it!

FoundryVTT Update

Foundry 0.8.x onwards requires Node.js v14 and later. Although technically, this deployment shouldn't need a full reinstall, it doesn't always properly recognize when Node.js has been updated and I can't figure out why... So instead, I've gone the nuclear route. This script will perform a full reinstall automatically.

Requirements:

⚠️ Foundry 0.8 save data cannot be reverted into save data compatible with previous versions.
Please make sure to back up before you update.

I cannot help you if something happens after the update and you do not have a backup.

Foundry Download Link

This update will require a download link to the zip file for the version of foundry you are attempting to reinstall. Follow the instructions here to get your download link.

Instructions

  1. SSH into the EC2 server. If you require instructions on how to do so, follow the SSH Access Instructions.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ wget https://raw.githubusercontent.com/cat-box/aws-foundry-ssl/master/patches/foundry_update.sh
    $ chmod a+x foundry_update.sh
    $ ./foundry_update.sh [YOUR DOWNLOAD LINK HERE]
    $ rm foundry_update.sh
  3. Restart the EC2 instance if prompted in the terminal.

  4. Confirm that you are able to access and use FoundryVTT.

    I recommend stopping at this step and returning to finish after you've held a session or done some work in Foundry. The original Foundry installation is archived under /foundryold_[date and time of update] which will be deleted in the next step.

  5. Open a terminal to your server and type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ sudo rm -r /foundryold_[date and time of update]

    To find [date and time of update]: type the full command up to /foundryold_ and hit Tab.
    E.g. sudo rm -r /foundryold_ then I would hit Tab on my keyboard.
    The file name will then autocomplete.

Node.js v14.x (0.8.0 Compatibility Patch)

Deployments created prior to March 23rd, 2021 using templates v1-6 and earlier use node v12.x. Foundry VTT 0.8.6 release requires version 14.x of Node.js. Regardless of whether or not you are running 0.8.x, you can apply this patch. Make sure you create a backup of your world(s) before proceeding.

More Information:

Official Release Notes: Foundry VTT Version 0.8.0
Reddit Thread: TLDR Reddit Thread

Instructions

  1. SSH into the EC2 server. If you require instructions on how to do so, follow the SSH Access Instructions.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ wget https://raw.githubusercontent.com/cat-box/aws-foundry-ssl/master/patches/node_v14.sh
    $ chmod a+x node_v14.sh
    $ ./node_v14.sh
    $ rm node_v14.sh
    $ node -v
  3. The last command from the previous step will output the current version of Node.js. If it reads v14.x.x (x being their current stable release number), then you have successfully applied the update.

⚠️ Update all world(s) to the latest version ⚠️

I have noticed that Foundry VTT will frequently disconnect you from the server unless worlds are updated to the latest version. This will be especially apparent if you are using the integrated audio/video function. If you are experiencing this issue, consider restarting your server after ensuring all updates have been applied.

Reverting to Node.js v12.x

If you find that you are experiencing an unacceptable level of bugs, you can revert to Node.js v12.x. Please remember that v12.x is not supported in the 0.8.0 Foundry VTT release. Reverting to v12.x is only a temporary solution.

  1. SSH into the EC2 server.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.

    $ sudo su
    $ wget https://raw.githubusercontent.com/cat-box/aws-foundry-ssl/master/patches/node_v12.sh
    $ chmod a+x node_v12.sh
    $ ./node_v12.sh
    $ rm node_v12.sh
    $ node -v
  3. The last command from the previous step will output the current version of Node.js. If it reads v12.x.x (x being their current stable release number), then you have successfully reverted to v12.x

Certificate Renewal

Deployments created prior to Jan 15th, 2021 using templates v1-5 and earlier do not auto-renew SSL certificates due to a bug. This has been resolved in a patch which needs to be manually applied.

Instructions

  1. SSH into the EC2 server. If you require instructions on how to do so, follow the SSH Access Instructions.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ wget https://raw.githubusercontent.com/cat-box/aws-foundry-ssl/master/patches/certbot_cronjob.sh
    $ chmod a+x certbot_cronjob.sh
    $ ./certbot_cronjob.sh
    $ rm certbot_cronjob.sh
  3. Reboot your server or wait until 12PM UTC the next day for certificate auto-renewal.

Confirm auto-renewal

There are two methods to check the status of your certificate, via crt.sh or terminal.

Method 1: crt.sh

  1. Type in your domain (e.g. example.com).
  2. On auto-renewal success, the top entry's "Logged At" column will be dated close to the date of your patch application.

Method 2: terminal

  1. SSH into the EC2 server.

  2. When you have successfully opened a terminal to your server, type the commands after the $ sign below.
    Hit return/enter after each line.

    $ sudo su
    $ certbot certificates
  3. Check the "Expiry Date" line. An example output has been provided below.

    Found the following certs:
      Certificate Name: example.com
        Serial Number: [serial number here]
        Key Type: RSA
        Domains: foundry.example.com
        Expiry Date: 2021-04-16 12:00:00+00:00 (VALID: 89 days)
        Certificate Path: /etc/letsencrypt/live/foundry.example.com/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/foundry.example.com/privkey.pem
⚠️ **GitHub.com Fallback** ⚠️