wedding-website

command module
v0.0.0-...-a46d881 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 7 Imported by: 0

README

Wedding Website

Simple static website powered by Go for our wedding

Install

  • Docker
  • Go
  • SASS
  • Minify tool - docker pull tdewolff/minify
  • Pull down Bulma styles - cd sass/ && git clone git@github.com:jgthms/bulma.git

Dev Reference

  • Pull down Go dependencies with go mod vendor
  • Build Docker images:
    • docker build -t registry.digitalocean.com/harp-do-registry/wedding-website .
    • docker build --build-arg PASS=REDACTED -t wedding-website-db ./mysql/
  • Run docker images:
    • docker run -p 8080:8081 -it \
        --env EMAILPASSWORD=REDACTED \
        --env DBHOST=host.docker.internal \
        --env DBUSER=root \
        --env DBPASSWORD=REDACTED \
        --env DBPORT=3306 \
        --env DEV=1 \
        --env WEBUSER=admin \
        --env WEBPASS=REDACTED \
        --env RECAPTCHASEC=REDACTED \
        --env CSRFSEC=REDACTED registry.digitalocean.com/harp-do-registry/wedding-website
      
    • docker run --detach --name=wedding-website-db --publish 3306:3306 wedding-website-db
  • Push to DigitalOcean: docker login registry.digitalocean.com && docker push registry.digitalocean.com/harp-do-registry/wedding-website:latest

Commands for running builds by hand:

  • SASS Build:
    • sass sass/style.scss sass/main.css
  • Minify JS and CSS:
    • docker run -i tdewolff/minify minify --type=css < sass/main.css > web/static/css/main.min.css 2>&1
    • docker run -i tdewolff/minify minify --type=js < js/main.js > web/static/js/main.min.js 2>&1

Required Environment Variables

  • EMAILPASSWORD - App password for email account. Needs to be setup via Google and GMail.
  • DBHOST - Hostname of database.
  • DBUSER - Username to connect to the database with.
  • DBPASSWORD - Password to connect to the database with.
  • DBPORT - Port to connect to database on.
  • WEBUSER - Admin username for web basic auth requests.
  • WEBPASS - Admin password for web basic auth requests.
  • RECAPTCHASEC - Recaptcha server-side verification secret. Needs to be setup via Google.
  • CSRFSEC - Secret key for generating CSRF tokens. Should be a random, improbable to guess 32-byte long string.

Acknowledgements

  • Flower asset purchased via Flower Moxie and Corjl

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL