From 1d2b44a3bacd7dbfdb706ef26c3c67a817acb2e3 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Fri, 5 Jul 2024 15:58:33 -0300 Subject: [PATCH] make non-embedded runtimes work properly --- Caddyfile | 2 +- Makefile | 2 +- proxy.env | 2 +- runtimes/crystal/template/funko.yml.j2 | 2 +- src/commands/new.cr | 3 ++- src/main.cr | 5 +++++ src/runtime.cr | 5 ----- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Caddyfile b/Caddyfile index 082b626..29669d7 100644 --- a/Caddyfile +++ b/Caddyfile @@ -6,7 +6,7 @@ http://*:8888 { basicauth /admin/* { - admin {$HTTP_BASIC_AUTH_PASSWORD} + admin {$FAASO_PASSWORD} } handle_path /admin/terminal/* { diff --git a/Makefile b/Makefile index a80e737..8a726a6 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ build: shard.yml $(wildcard src/**/*) $(runtimes/**/*) proxy: build docker build . -t faaso-proxy start-proxy: - docker run --name faaso-proxy-one --rm --network=faaso-net --env-file=proxy.env -e FAASO_SECRET_PATH=${PWD}/secrets -v /var/run/docker.sock:/var/run/docker.sock -v secrets:/home/app/secrets -p 8888:8888 faaso-proxy + docker run --name faaso-proxy-one --rm --network=faaso-net --env-file=proxy.env -e FAASO_SECRET_PATH=${PWD}/secrets -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/secrets:/home/app/secrets -p 8888:8888 faaso-proxy .PHONY: build proxy-image start-proxy diff --git a/proxy.env b/proxy.env index 255caca..a5fb17e 100644 --- a/proxy.env +++ b/proxy.env @@ -1 +1 @@ -HTTP_BASIC_AUTH_PASSWORD=$2a$14$C35905PxPzICAZKc/O9jYOS7ipZNPBtrndja8Yu3bvs/UujckryHS +FAASO_PASSWORD=$2a$14$C35905PxPzICAZKc/O9jYOS7ipZNPBtrndja8Yu3bvs/UujckryHS diff --git a/runtimes/crystal/template/funko.yml.j2 b/runtimes/crystal/template/funko.yml.j2 index 367f4f6..0ab03ef 100644 --- a/runtimes/crystal/template/funko.yml.j2 +++ b/runtimes/crystal/template/funko.yml.j2 @@ -1,2 +1,2 @@ name: {{ name }} -runtime: crystal +runtime: {{ runtime }} diff --git a/src/commands/new.cr b/src/commands/new.cr index 36a4968..a5385ef 100644 --- a/src/commands/new.cr +++ b/src/commands/new.cr @@ -25,7 +25,8 @@ module Faaso template_base, template_files, folder, - {"name" => Path[folder].basename} + {"name" => Path[folder].basename, + "runtime" => runtime} ) 0 end diff --git a/src/main.cr b/src/main.cr index 3ae36d2..9a2b96d 100644 --- a/src/main.cr +++ b/src/main.cr @@ -85,3 +85,8 @@ when .fetch("status", false) end exit(status) + +# Embed runtimes in the faaso binary using rucksack +{% for name in `find ./runtimes -type f`.split('\n') %} + rucksack({{name}}) +{% end %} diff --git a/src/runtime.cr b/src/runtime.cr index a4b4b9a..c8ee299 100644 --- a/src/runtime.cr +++ b/src/runtime.cr @@ -91,8 +91,3 @@ module Runtime end end end - -# Embed runtimes in the binary using rucksack -{% for name in `find ./runtimes -type f`.split('\n') %} - rucksack({{name}}) -{% end %}