Compare commits

..

2 Commits

4
.gitignore vendored

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

@ -1,22 +1,37 @@
.PHONY: all back front install
.PHONY: all back front install up down clean
all: back front
back:
cd backend && ${MAKE}
@echo "Building backend..."
@cd backend && ${MAKE}
front:
cd frontend && ${MAKE}
@echo "Building frontend..."
@cd frontend && ${MAKE}
@public_dir@:
cd frontend && ${MAKE} install
@echo "Installing frontend assets..."
@cd frontend && sudo ${MAKE} install
@nginx_config@: m4/environment.m4 nginx/yacswa.conf.m4
m4 m4/environment.m4 nginx/yacswa.conf.m4 > @nginx_config@
@nginx_dir@sites_available/@nginx_config@: nginx/yacswa.conf
@echo "Installing nginx config..."
@mkdir -p @nginx_dir@sites_available
@cp nginx/yacswa.conf @nginx_dir@sites_available/@nginx_config@
install: @public_dir@ @nginx_config@
install: @public_dir@ @nginx_dir@sites_available/@nginx_config@
up: install
sudo $(LN_S) /etc/nginx/sites_available/yacswa.conf /etc/nginx/sites_enabled/
cd backend && ${MAKE} up
up: install @nginx_dir@sites_enabled/@nginx_config@
@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,15 +6,16 @@ all: deps
deps: tk csv
tk:
cd deps/guile-toolkit && ${MAKE} && sudo ${MAKE} install
@cd deps/guile-toolkit && ${MAKE} && sudo ${MAKE} install
csv:
cd deps/guile-csv && ${MAKE} && sudo ${MAKE} install
@cd deps/guile-csv && ${MAKE} && sudo ${MAKE} install
up: deps .backend.lock
up: .backend.lock
.backend.lock: main.scm
@nohup $(GUILE) ./main.scm > yacswa-backend.log & export PID=$$! & echo "Server spawned with PID $${PID}"; echo $${PID} > .backend.lock; unset PID
@@GUILE@ ./main.scm > yacswa-backend.log & export PID=$$!; echo $${PID} > .backend.lock
@echo "Server spawned with PID $${PID}" && echo $${PID} > .backend.lock && unset PID
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 0d1e98c17262ba7c85b2427cdca54ebe401200e9
Subproject commit 21938812546c90e39d3b353c1c99acb36467fd3e

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

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

6
configure vendored

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

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

@ -1,16 +1,19 @@
.PHONY: all
.PHONY: all clean
all: 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@
@public_dir@:
mkdir @public_dir@
cp ./www/ @public_dir@
@mkdir -p @public_dir@
@cp -r ./www/ @public_dir@
uninstall:
rm -rf @public_dir@
clean:
rm -f www/elm.js

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