static site #0

Supports: bionic eoan xenial
Add to new model

Description

The static-site charm installs and configured nginx for the hosting of static sites stored in remote Git repositories.
No PHP, Python, Ruby can be run server side. Files such as HTML, JavaScript and images will be served directly to users unprocessed.
Perfect for your blog generated by Jekyll, Hugo, Pelican or other static site generators.
Store the resulting pages in a Git repository, and use this charm to deploy and update the code the Juju way.


Static Site Charm

This is an extremely simple charm designed at hosting static sites
generated by tools like Jekyll, Pelican and Hugo (to name just a few).

It uses layer-git-deploy to handle checking out your site content from a
Git Repository, once the content is cloned to the deployed static-site
unit, nginx will be configured to serve that content.

After deploying this charm, simply set the repo option to a repository
using the git syntax used when cloning a remote repostiory, i.e.:

juju config static-site repo=https://github.com/username/website.git

If your website is stored on a private Git repository which requires
authentication, you can either add username and password to the clone
URI:

juju config static-site repo=https://user:pass@github.com/username/website.git

...or add a private key using the deploy-key option. This should
ideally be a GitHub or GitLab deploy key which can not write to the
repository, for security's sake. Where my-deploy-key.txt is a text
file containing the SSH private key used to access the git repo -

juju config static-site repo=git+ssh://git@github.com/username/website.git
juju config static-site deploy-key=$(cat my-deploy-key.txt)

Author

Initially written and used by James Hebden of the Alchemy Charmers group.


Configuration

commit-or-branch
(string) Commit or branch to update to
master
content-dir
(string) Folder under the checked out repo which contains web content
/
deploy-key
(string) A deploy key is an SSH key that is stored on the server and grants access to a repository.
external-uri
(string) The external URI of this site. Used to configure a related reverse proxy. Requires http:// or https:// to be provided, as this controls which frontend on the reverseproxy will be used (port 80 or 443 with TLS)
extra_packages
(string) Space separated list of extra deb packages to install.
install_keys
(string) List of signing keys for install_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
install_sources
(string) List of extra apt sources, per charm-helpers standard format (a yaml list of strings encoded as a string). Each source may be either a line that can be added directly to sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal Package Archives, or a distribution component to enable.
key-required
(boolean) This should be set to true to ensure that a deploy key is deployed if necessary
package_status
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
install
repo
(string) The repository to clone from, this is required