Coder Social home page Coder Social logo

digitalocean-1-click's Introduction

Ghost

Prereqs

Build Automation with Packer

Packer is a tool for creating images from a single source configuration. Using this Packer template reduces the entire process of creating, configuring, validating, and snapshotting a build Droplet to a single command:

make build

The Packer build command can also be run manually.

packer build ghost-image.json

Usage

To run the Packer build that this template uses by default, you'll need to install Packer and create a DigitalOcean personal access token and set it to the DIGITALOCEAN_API_TOKEN environment variable. Running packer build ghost-image.json without any other modifications will create a build Droplet configured with Ghost, clean and verify it, then power it down and snapshot it.

⚠️ The image validation script in scripts/999-img_check.sh is copied from the top-level scripts directory in this repository. The top-level location is the script's canonical source, so make sure you're using the latest version from there.

To start adapting this configuration for your own image, you can customize some variables in ghost-image.json:

  • do_api_token defines the DO API Token used to create resources via DigitalOcean's API. By default it is set to the value of the DIGITALOCEAN_API_TOKEN environment variable.
  • image_name defines the name of the resulting snapshot, which by default is ghost-snapshot- with a UNIX timestamp appended.
  • node_version defines the apt repo to use to install Node JS (eg. node_16.x, node_18.x etc)

You can also modify these variables at runtime by using the -var flag.

Configuration Details

By using Packer's DigitalOcean Builder to integrate with the DigitalOcean API, this configuration fully automates Ghost image creation.

This configuration uses Packer's file provisioner to upload complete directories to the Droplet. The contents of files/var/ will be uploaded to /var/. Likewise, the contents of files/etc/ will be uploaded to /etc/. One important thing to note about the file provisioner, from Packer's docs:

The destination directory must already exist. If you need to create it, use a shell provisioner just prior to the file provisioner in order to create the directory. If the destination directory does not exist, the file provisioner may succeed, but it will have undefined results.

This configuration also uses Packer's shell provisioner to run scripts from the /scripts directory and update installed APT packages using an inline task.

After making changes to the configuration, packer validate command.

make validate

Learn more about using Packer in the official Packer documentation.

Copyright & License

Copyright (c) 2013-2023 Andrew Starr-Bochicchio & Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.

digitalocean-1-click's People

Contributors

daniellockyer avatar johnonolan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

digitalocean-1-click's Issues

Outdated Ubuntu 20.04 reference in scripts/020-application_tag.sh

First off, thank you so much for Ghost and this repo. 👻❤️

In scripts/020-application_tag.sh L13:

distro_release=20.04

I see on How to install Ghost on Ubuntu 22.04 is supported, but have not been able to get a working install following that guide after upgrading Node on my initial install using the DO 1-click and another from scratch after that went sideways to help me debug. Thankfully, on Mastodon @royalfig pointed me to this repo that answers many of my questions the docs did not. One question that still lingers: is there is a reason the image still uses 20.04 instead of 22.04?

I am weighing another round of trying to set up an install from scratch so I can fully understand everything the scripts in this repo do, and want to equip myself for success. So if there is a reason to stay on 20.04, great, sold. If not, I just got bit hard by one EOL so would rather postpone major upgrades as long as possible and start with 22.04. @daniellockyer thoughts?

Mismatch between lets encrypt folder location and nginx config

The one-click droplet install currently results in lets encrypt certificates at /etc/letsencrypt/domainname_ecc, but Ghost configures Nginx to look for them at /etc/letsencrypt/domainname. This causes Nginx to not start, resulting in a 'failed install' for new users.

Moving the certificate folder to /etc/letsencrypt/domainname manually allows Nginx to start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.