diff --git a/Project.toml b/Project.toml index d3ad8613..fe56e31c 100755 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GenieBuilder" uuid = "c9453c14-af8a-11ec-351d-c7c9a2035d70" authors = ["Adrian Salceanu"] -version = "0.16.46" +version = "0.16.47" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -24,7 +24,7 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" [compat] Dates = "1.6" -Genie = "5.23.8" +Genie = "5.24.0" GenieAutoReload = "2.2.2" GenieDevTools = "2.9.1" GeniePackageManager = "1.1.0" diff --git a/app/resources/applications/ApplicationsController.jl b/app/resources/applications/ApplicationsController.jl index f5d3033a..e449461b 100755 --- a/app/resources/applications/ApplicationsController.jl +++ b/app/resources/applications/ApplicationsController.jl @@ -15,6 +15,7 @@ using Dates using Scratch using ZipFile using TOML +using Logging import StippleUI import GeniePackageManager @@ -470,6 +471,8 @@ function start(app::Application) Pkg._auto_gc_enabled[] = false; Pkg.activate("."); + isfile("Manifest.toml") || Pkg.instantiate(); + using GenieFramework; using GenieFramework.Revise; @@ -972,6 +975,27 @@ function status() end +""" + settings() + +Returns the settings of the GenieBuilder server +""" +function settings() + logger_description = string(Logging.global_logger()) + m = match(r"IOStream\(\)", logger_description) + log_file = "" + if m !== nothing + log_file = m.captures[1] + end + + Dict( + :settings => Dict( + :logfile => log_file, + ) + ) |> json +end + + function download(app::Application) app_path = fullpath(app) endswith(app_path, "/") && (app_path = app_path[1:end-1]) diff --git a/config/initializers/logging.jl b/config/initializers/logging.jl index 575879eb..d3f1cfcb 100755 --- a/config/initializers/logging.jl +++ b/config/initializers/logging.jl @@ -1,3 +1,9 @@ import Genie -Genie.Logger.initialize_logging() \ No newline at end of file +log_path, log_name = if haskey(ENV, "GB_LOG_FILE") && ispath(dirname(ENV["GB_LOG_FILE"])) + (dirname(ENV["GB_LOG_FILE"]), basename(ENV["GB_LOG_FILE"])) +else + Genie.config.path_log, Genie.Logger.default_log_name() +end + +Genie.Logger.initialize_logging(; log_path, log_name) \ No newline at end of file diff --git a/routes.jl b/routes.jl index a82da139..2f711ed2 100755 --- a/routes.jl +++ b/routes.jl @@ -220,6 +220,11 @@ function register_routes() ApplicationsController.status() end + # returns the settings of the GenieBuilder server + route("$gb_route/settings") do + ApplicationsController.settings() + end + nothing end