Compare commits

..

No commits in common. '36738c0d4ddbc80815981ef83a06bfc115dc1aef' and '093955127e2ff17dbf6ecc83ec74a125795a48d2' have entirely different histories.

4
.gitignore vendored

@ -15,8 +15,6 @@ backend/repo/
# autoconf products # autoconf products
**/Makefile **/Makefile
nginx/yacswa.conf
configure.scan configure.scan
config.log config.log
config.status config.status
autom4te.cache/

@ -1,37 +1,22 @@
.PHONY: all back front install up down clean .PHONY: all back front install
all: back front all: back front
back: back:
@echo "Building backend..." cd backend && ${MAKE}
@cd backend && ${MAKE}
front: front:
@echo "Building frontend..." cd frontend && ${MAKE}
@cd frontend && ${MAKE}
@public_dir@: @public_dir@:
@echo "Installing frontend assets..." cd frontend && ${MAKE} install
@cd frontend && sudo ${MAKE} install
@nginx_dir@sites_available/@nginx_config@: nginx/yacswa.conf @nginx_config@: m4/environment.m4 nginx/yacswa.conf.m4
@echo "Installing nginx config..." m4 m4/environment.m4 nginx/yacswa.conf.m4 > @nginx_config@
@mkdir -p @nginx_dir@sites_available
@cp nginx/yacswa.conf @nginx_dir@sites_available/@nginx_config@
install: @public_dir@ @nginx_dir@sites_available/@nginx_config@ install: @public_dir@ @nginx_config@
up: install @nginx_dir@sites_enabled/@nginx_config@ up: install
@cd backend && ${MAKE} up sudo $(LN_S) /etc/nginx/sites_available/yacswa.conf /etc/nginx/sites_enabled/
cd backend && ${MAKE} up
@nginx_dir@sites_enabled/@nginx_config@:
@sudo mkdir -p @nginx_dir@sites_enabled
@sudo @LN_S@ @nginx_dir@sites_available/@nginx_config@ @nginx_dir@sites_enabled/
down:
@sudo rm -f @nginx_dir@sites_enabled/@nginx_config@
@cd backend && ${MAKE} down
clean:
@cd frontend && make clean

@ -6,16 +6,15 @@ all: deps
deps: tk csv deps: tk csv
tk: tk:
@cd deps/guile-toolkit && ${MAKE} && sudo ${MAKE} install cd deps/guile-toolkit && ${MAKE} && sudo ${MAKE} install
csv: csv:
@cd deps/guile-csv && ${MAKE} && sudo ${MAKE} install cd deps/guile-csv && ${MAKE} && sudo ${MAKE} install
up: .backend.lock up: deps .backend.lock
.backend.lock: main.scm .backend.lock: main.scm
@@GUILE@ ./main.scm > yacswa-backend.log & export PID=$$!; echo $${PID} > .backend.lock @nohup $(GUILE) ./main.scm > yacswa-backend.log & export PID=$$! & echo "Server spawned with PID $${PID}"; echo $${PID} > .backend.lock; unset PID
@echo "Server spawned with PID $${PID}" && echo $${PID} > .backend.lock && unset PID
down: down:
@export PID=`cat .backend.lock` && kill -15 $${PID} && rm .backend.lock && echo "Server on PID $${PID} down."; unset PID @export PID=`cat .backend.lock`; kill -15 $${PID}; rm .backend.lock; echo "Server on PID $${PID} down."; unset PID

@ -1 +1 @@
Subproject commit 21938812546c90e39d3b353c1c99acb36467fd3e Subproject commit 0d1e98c17262ba7c85b2427cdca54ebe401200e9

@ -122,21 +122,21 @@
(sleep (sec/mins 9)))) (sleep (sec/mins 9))))
(loop))) (loop)))
;; As the git repository is no longer updated there is no need to #! As the git repository is no longer updated there is no need to
;; establish a job loop or populate the statistics tables asynchronously establish a job loop or populate the statistics tables asynchronously
;;(begin-thread (with-mutex %json-lock (begin-thread (with-mutex %json-lock
;; (git:fetch) (git:fetch)
;; (set! mcron-locked (mutex-owner %json-lock)) (set! mcron-locked (mutex-owner %json-lock))
;; (process-stats! $stat-tree) (process-stats! $stat-tree)
;; (calculate-strings!)) (calculate-strings!))
;; (sleep (next-timestamp)) (sleep (next-timestamp))
;; (job-loop)) (job-loop))
;;(sleep 1) (sleep 1)
;;(while (mutex-locked? %json-lock) (while (mutex-locked? %json-lock)
;; (sleep 1)) (sleep 1))
!#
; Functional parts of the asynchronous code above ; Functional parts of the asynchronous code above
(git:fetch) (git:fetch)

@ -8,10 +8,10 @@
;; : ;; :
;; Backchannel ;; Backchannel
#!
;;(define repl-sock (make-unix-domain-server-socket #:path "./bc")) (define repl-sock (make-unix-domain-server-socket #:path "./bc"))
;;(spawn-server repl-sock) (spawn-server repl-sock)
!#
;; endpoint helpers ;; endpoint helpers
(define (err: text) (scm->json-string `((error . ,text)))) (define (err: text) (scm->json-string `((error . ,text))))

6
configure vendored

@ -617,7 +617,6 @@ GUILD
GUILE GUILE
SET_MAKE SET_MAKE
nginx_config nginx_config
nginx_dir
public_dir public_dir
server_name server_name
target_alias target_alias
@ -1728,8 +1727,6 @@ server_name=yacswa.home
public_dir=/srv/yacswa.home public_dir=/srv/yacswa.home
nginx_dir=/etc/nginx/
nginx_config=yacswa.home.conf nginx_config=yacswa.home.conf
@ -1960,7 +1957,7 @@ fi
ac_config_files="$ac_config_files Makefile backend/Makefile frontend/Makefile nginx/yacswa.conf" ac_config_files="$ac_config_files Makefile backend/Makefile frontend/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -2666,7 +2663,6 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"backend/Makefile") CONFIG_FILES="$CONFIG_FILES backend/Makefile" ;; "backend/Makefile") CONFIG_FILES="$CONFIG_FILES backend/Makefile" ;;
"frontend/Makefile") CONFIG_FILES="$CONFIG_FILES frontend/Makefile" ;; "frontend/Makefile") CONFIG_FILES="$CONFIG_FILES frontend/Makefile" ;;
"nginx/yacswa.conf") CONFIG_FILES="$CONFIG_FILES nginx/yacswa.conf" ;;
*) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;;
esac esac

@ -7,7 +7,6 @@ AC_INIT([Yet Another Covid Statistics Web App], [1.0], [me@bradymcd.ca])
# Pull in environment variables # Pull in environment variables
AC_SUBST([server_name], [yacswa.home]) AC_SUBST([server_name], [yacswa.home])
AC_SUBST([public_dir], [/srv/yacswa.home]) AC_SUBST([public_dir], [/srv/yacswa.home])
AC_SUBST([nginx_dir], [/etc/nginx/])
AC_SUBST([nginx_config], [yacswa.home.conf]) AC_SUBST([nginx_config], [yacswa.home.conf])
# Checks for programs. # Checks for programs.
@ -25,6 +24,5 @@ AC_PROG_LN_S
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
backend/Makefile backend/Makefile
frontend/Makefile frontend/Makefile])
nginx/yacswa.conf])
AC_OUTPUT AC_OUTPUT

@ -1,19 +1,16 @@
.PHONY: all clean .PHONY: all
all: www/elm.js all: www/elm.js
www/elm.js: www/elm.js:
@ELM@ make src/Main.elm --output=www/elm.js $(ELM) make src/Main.elm --output=www/elm.js
install: www/elm.js @public_dir@ install: www/elm.js @public_dir@
@public_dir@: @public_dir@:
@mkdir -p @public_dir@ mkdir @public_dir@
@cp -r ./www/ @public_dir@ cp ./www/ @public_dir@
uninstall: uninstall:
rm -rf @public_dir@ rm -rf @public_dir@
clean:
rm -f www/elm.js

@ -5,7 +5,7 @@ server {
server_name @server_name@ www.@server_name@; server_name @server_name@ www.@server_name@;
root @public_dir@; root _PUBLIC_DIR_;
try_files $uri $uri/ /not_found; try_files $uri $uri/ /not_found;
location /json/pc { location /json/pc {
Loading…
Cancel
Save