~admicos/nginxpages

Push static web pages to your own server via Git and Nginx.
Misc. README changes
Add example shell wrapper
Fix created repositories

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~admicos/nginxpages
read/write
git@git.sr.ht:~admicos/nginxpages

You can also use your local clone with git send-email.

nginxpages

Deploy web pages via git to your own server.

While this specific project uses Docker (mainly for isolation), the concept can easily be adapted for bare metal systems. See the git and nginx folders for their respective configuration.

Container Setup

  • Clone this repository
  • Edit docker-compose.yml to fit your specific configuration. (docker-compose.override.yml might work for small changes)
  • docker-compose up -d

Security Warning

DO NOT, UNDER ANY CIRCUMSTANCES, EXPOSE THE git CONTAINER TO THE INTERNET WITH IT'S DEFAULT CONFIGURATION. IT'S INSECURE AND IS ONLY MEANT TO BE CONNECTED TO FROM A TRUSTED HOST. SEE THE FOLLOWING SECTION FOR INSTRUCTIONS ON HOW TO SET THAT UP.

Host Setup

  • Create a new user (depends on your distribution)
  • Set up SSH access for them
  • Use shell rc files OR change user's shell to a wrapper, to silently connect them to the git container.
    • An example shell wrapper is available in the wrap.sh file.

Usage

Git Shell

ssh git@[server] [command]

Custom Git Shell Commands

  • new-site <domain>
  • remove-site <domain>

Accessing The Repository

  • With a custom ssh port: git clone ssh://git@[server][:port]/~/sites/[domain]
  • With port 22: git clone git@[server]:sites/[domain]

There are no web interfaces for the repositories.

Notes

Using with static site generators

The recommended way to use nginxpages with static site generators is the following:

  • Create a SSH keypair with the only purpose of interacting with your sites.
  • Add the private key into your favourite CI/CD system as a secret.
  • Add the public key into your .ssh/authorized_keys file.
  • Set your CI up to push any updates via Git using the new keypair.

How to contribute

Patches, discussion and bug reports are accepted via emails to ~admicos/projects@lists.sr.ht. See git-send-email.io on resources on how to send patches via email.