~jamesaorson/reformer

Finish basic auth backend. Need frontend now.
passwordless: Set foundation for passwordless auth
Add passswordless auth issue

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~jamesaorson/reformer
read/write
git@git.sr.ht:~jamesaorson/reformer

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

#reformer.fyi

#Pipeline Status

  • Build (amd64) Build status
  • Tests Test status
  • Mirror Git mirror status

#Dev Videos

#Architecture

This site runs on two ports in the production container, but one in local development.

Locally, the site is at http://localhost:8080

In a container, http://localhost:80 is the nginx entrypoint. If nginx is broken, use http://localhost:8080 to go directly to the running cfrr.

#Setup

To setup a system, root access is often required. So, if using sudo:

sudo make setup

And if not:

make setup

#Development

#Live Reload (Preferred way)

  1. Say you open Emacs
  2. Open the project
  3. Change src/reformer/routing.scm:router to the following, to simulate a bug
(define (router request request-body)
  (log-request request)
  (let ((path (uri->string (request-uri request))))
    (cond
      ((string=? "/feed" path)
        (set! visits (+ visits 1))
        (home:index visits))
      ((string=? "/" path)
        (set! visits (+ visits 1))
        (feed:index))
      ((string=? "/about" path)
        (set! visits (+ visits 1))
        (about:index))
      (else
        (not-found request)))))
  1. Run M-x compile and execute make -k run-with-repl
  2. Run M-x geiser-connect, default host, port 1689
  3. Go to http://localhost:8080 and notice the incorrect pages. Wrong route for root page
  4. Change the routing function back to what it was.
(define (router request request-body)
  (log-request request)
  (let ((path (uri->string (request-uri request))))
    (cond
      ((string=? "/" path)
        (set! visits (+ visits 1))
        (home:index visits))
      ((string=? "/feed" path)
        (set! visits (+ visits 1))
        (feed:index))
      ((string=? "/about" path)
        (set! visits (+ visits 1))
        (about:index))
      (else
        (not-found request))))) ;; Run C-x C-e on this form
  1. Reload the router form with C-x C-e
  2. Refresh the browser and witness the live change Correct routes

#Locally

#Without a load balancer and reverse proxy
make run
#With a load balancer and reverse proxy

After that, you should be able to use

make lb run

#Containerized

make container-build container-run

or using bash magic

make container-{build,run}

make container-run will live load the relevant application code from your git repo into the container, via a volume, allowing for live reloads.