module DoorCtrl
Defined in:
app.cr:6app.cr:104
config.cr
constants.cr
models/door_state.cr
Constant Summary
-
COOKIE_SESSION_KEY =
ENV["COOKIE_SESSION_KEY"]? || "_spider_gazelle_" -
COOKIE_SESSION_SECRET =
ENV["COOKIE_SESSION_SECRET"]? || TOTP_SECRET -
DEFAULT_HOST =
ENV["SG_SERVER_HOST"]? || "127.0.0.1" -
DEFAULT_PORT =
(ENV["SG_SERVER_PORT"]? || 3000).to_i -
DEFAULT_PROCESS_COUNT =
(ENV["SG_PROCESS_COUNT"]? || 1).to_i -
ENVIRONMENT =
ENV["SG_ENV"]? || "development" -
IO_CHIP_PATH =
Path[ENV["IO_CHIP_PATH"]? || "/dev/gpiochip0"] -
IS_PRODUCTION =
ENVIRONMENT == "production" -
Log =
::Log.for(NAME) -
LOG_BACKEND =
ActionController.default_backend -
NAME =
"Ladies-First" -
RELAY_DOOR_CLOSE_LINE =
(ENV["RELAY_DOOR_CLOSE_LINE"]? || "22").to_i -
RELAY_DOOR_OPEN_LINE =
(ENV["RELAY_DOOR_OPEN_LINE"]? || "5").to_i -
STATIC_FILE_PATH =
ENV["PUBLIC_WWW_PATH"]? || "./www" -
TOTP_SECRET =
ENV["TOTP_SECRET"]? || TOTP.generate_base32_secret -
security
-
VERSION =
"1.0.0"
Class Method Summary
-
.register_severity_switch_signals : Nil
Registers callbacks for USR1 signal
- .running_in_production?
-
.trace? : Bool
flag to indicate if we're outputting trace logs
Class Method Detail
def self.register_severity_switch_signals : Nil
#
Registers callbacks for USR1 signal
USR1
toggles :trace for all Log instances
namespaces's Logs to :info if production is true,
otherwise it is set to :debug.
Log's not registered under namespaces are toggled to default
Usage
$ kill -USR1 ${the_application_pid}