Compare commits

..

No commits in common. "824c94bebce22c6c23ec5d773b23db8e0f495835" and "de46e9864b954b8fdece73a0dcaa048dd7d527f7" have entirely different histories.

10 changed files with 13 additions and 32 deletions

View File

@ -6,7 +6,7 @@
* Config UI in frontend?
* Support tokens besides basic auth
* Polish frontend UI **A LOT**
* Version checks for consistency between client/server
* Version checks for consistency between client/server
* Have 3 runtimes:
* ✅ Crystal + Kemal
* ✅ Python + Flask
@ -24,7 +24,7 @@
* Multi-container docker logs [faaso logs -f FUNKO]
* Direct error and above to stderr, others to stdout, while
keeping logging level configurable
* Fix proxy reload / Make it reload on file changes
* Fix proxy reload / Make it reload on file changes
# Things to do but not before release

View File

@ -15,4 +15,12 @@ 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
}
}
}

View File

@ -34,4 +34,4 @@ dependencies:
github: petoem/inotify.cr
scripts:
postinstall: cat .rucksack >> bin/faaso
postinstall: cat .rucksack >> bin/faaso

View File

@ -17,7 +17,6 @@ module Faaso
Log.info { "Building function... #{funko.name} in #{tmp_dir}" }
funko.build tmp_dir
else # Running against a server
Faaso.check_version
# Create a tarball for the funko
buf = IO::Memory.new
Compress::Gzip::Writer.open(buf) do |gzip|

View File

@ -27,7 +27,6 @@ module Faaso
end
def remote(options, name, scale) : Int32
Faaso.check_version
if !scale
Crest.get(
"#{FAASO_SERVER}funkos/#{name}/scale/", \

View File

@ -13,7 +13,6 @@ module Faaso
end
def remote(options, funko, name, secret) : Int32
Faaso.check_version
if options["--add"]
Crest.post(
"#{FAASO_SERVER}secrets/",

View File

@ -26,7 +26,6 @@ module Faaso
end
def remote(options, name) : Int32
Faaso.check_version
Crest.get(
"#{FAASO_SERVER}funkos/#{name}/status/", \
user: "admin", password: "admin") do |response|

View File

@ -8,16 +8,8 @@ require "docr"
require "kemal"
require "uuid"
macro version
"{{ `grep version shard.yml | cut -d: -f2` }}".strip()
end
get "/" do |env|
env.redirect "/index.html"
end
get "/version" do
"#{version}"
end
Kemal.run

View File

@ -28,18 +28,9 @@ module Faaso
))
rescue ex : Docr::Errors::DockerAPIError
raise ex if ex.status_code != 409 # Network already exists
end
# Compare version with server's
def self.check_version
server_version = Crest.get(
"#{FAASO_SERVER}version/", \
user: "admin", password: "admin").body
local_version = "#{version}"
if server_version != local_version
Log.warn { "Server is version #{server_version} and client is #{local_version}" }
end
module Commands
end
end

View File

@ -3,10 +3,6 @@ require "colorize"
require "docopt"
require "rucksack"
macro version
"{{ `grep version shard.yml | cut -d: -f2` }}".strip()
end
struct LogFormat < Log::StaticFormatter
@@colors = {
"FATAL" => :red,
@ -86,8 +82,6 @@ when .fetch("secret", false)
status = Faaso::Commands::Secret.new.run(ans, ans["FUNKO"].as(String), ans["SECRET"].as(String))
when .fetch("status", false)
status = Faaso::Commands::Status.new.run(ans, ans["FUNKO"].as(String))
when .fetch("version", false)
Log.info { "#{version}" }
end
exit(status)