diff --git a/TODO.md b/TODO.md index 2cd3527..bcdd76e 100644 --- a/TODO.md +++ b/TODO.md @@ -6,7 +6,7 @@ * Config UI in frontend? * Polish frontend UI **A LOT** * ✅ Version checks for consistency between client/server -* Have 3 runtimes: +* ✅ Have 3 runtimes: * ✅ Crystal + Kemal * ✅ Python + Flask * ✅ Nodejs + Express diff --git a/config/Caddyfile b/config/Caddyfile index 7b91244..066f9fc 100644 --- a/config/Caddyfile +++ b/config/Caddyfile @@ -18,11 +18,5 @@ http://*:8888 { handle_path /admin/* { reverse_proxy /* http://127.0.0.1:3000 } - handle_path /faaso/exp/* { - reverse_proxy /* http://faaso-exp-6ne49v:3000 { - health_uri /ping - fail_duration 30s - } - } - -} \ No newline at end of file + import funkos +} diff --git a/src/daemon/proxy.cr b/src/daemon/proxy.cr index cbb3d6f..f801eab 100644 --- a/src/daemon/proxy.cr +++ b/src/daemon/proxy.cr @@ -4,7 +4,7 @@ require "inotify" require "kemal" module Proxy - CADDY_CONFIG_PATH = "config/Caddyfile" + CADDY_CONFIG_PATH = "config/funkos" @@current_config = File.read(CADDY_CONFIG_PATH) @@watcher = Inotify.watch(CADDY_CONFIG_PATH) do |_| @@ -28,29 +28,8 @@ module Proxy def self.update_proxy_config docker_api = Docr::API.new(Docr::Client.new) containers = docker_api.containers.list(all: true) - config = <<-CONFIG -{ - http_port 8888 - https_port 8887 - local_certs -} - -http://*:8888 { - forward_auth /admin/* http://127.0.0.1:3000 { - uri /auth - copy_headers { - Authorization - } - } - - handle_path /admin/terminal/* { - reverse_proxy /* http://127.0.0.1:7681 - } - handle_path /admin/* { - reverse_proxy /* http://127.0.0.1:3000 - } -CONFIG + config = "" funkos = Funko::Funko.from_docker funkos.each do |funko| next if funko.name == "proxy" @@ -68,7 +47,6 @@ CONFIG } ) end - config += "\n}" if @@current_config != config Log.info { "Updating proxy config" } diff --git a/src/daemon/terminal.cr b/src/daemon/terminal.cr index 2094124..61ea17b 100644 --- a/src/daemon/terminal.cr +++ b/src/daemon/terminal.cr @@ -4,7 +4,7 @@ module Terminal @@terminal_process : Process | Nil = nil def start_terminal(_args = ["sh"], readonly = true) - args = ["-p", "7681", "-c", "admin:admin", "-o"] + args = ["-p", "7681", "-o"] args += ["-W"] unless readonly args += _args # We have a process there, kill it