class Marten::Conf::GlobalSettings
- Marten::Conf::GlobalSettings
- Reference
- Object
Overview
Defines the global settings of a Marten web application.
Defined in:
marten/conf/global_settings.crmarten/conf/global_settings/assets.cr
marten/conf/global_settings/csrf.cr
marten/conf/global_settings/database.cr
marten/conf/global_settings/i18n.cr
marten/conf/global_settings/media_files.cr
marten/conf/global_settings/sessions.cr
marten/conf/global_settings/strict_stransport_security.cr
marten/conf/global_settings/templates.cr
Constructors
Instance Method Summary
-
#allowed_hosts : Array(String)
Returns the explicit list of allowed hosts for the application.
-
#allowed_hosts=(allowed_hosts : Array(String))
Allows to set the explicit list of allowed hosts for the application.
-
#assets
Provides access to assets settings.
-
#csrf
Provides access to request forgery protection settings.
-
#database(id = DB::Connection::DEFAULT_CONNECTION_NAME, &)
Allows to configure a specific database connection for the application.
-
#databases : Array(Marten::Conf::GlobalSettings::Database)
Returns the application database configurations.
-
#debug : Bool
Returns a boolean indicating whether the application runs in debug mode.
-
#debug=(debug : Bool)
Allows to activate or deactive debug mode.
-
#handler400 : Marten::Handlers::Base.class
Returns the configured handler class that should generate responses for Bad Request responses (HTTP 400).
-
#handler400=(handler400 : ::Marten::Handlers::Base.class)
Allows to set the handler class that should generate responses for Bad Request responses (HTTP 400).
-
#handler403 : Marten::Handlers::Base.class
Returns the configured handler class that should generate responses for Permission Denied responses (HTTP 403).
-
#handler403=(handler403 : ::Marten::Handlers::Base.class)
Allows to set the handler class that should generate responses for Permission Denied responses (HTTP 403).
-
#handler404 : Marten::Handlers::Base.class
Returns the configured handler class that should generate responses for Not Found responses (HTTP 404).
-
#handler404=(handler404 : ::Marten::Handlers::Base.class)
Allows to set the handler class that should generate responses for Not Found responses (HTTP 404).
-
#handler500 : Marten::Handlers::Base.class
Returns the configured handler class that should generate responses for Internal Error responses (HTTP 500).
-
#handler500=(handler500 : ::Marten::Handlers::Base.class)
Allows to set the handler class that should generate responses for Internal Error responses (HTTP 500).
-
#host : String
Returns the host the HTTP server running the application will be listening on.
-
#host=(host : String)
Allows to set the host the HTTP server running the application will be listening on.
-
#i18n
Provides access to internationalization settings.
-
#installed_apps : Array(Marten::Apps::Config.class)
Returns the third-party applications used by the project.
-
#installed_apps=(v)
Allows to define the third-party applications used by the project.
-
#log_backend : Log::Backend
Returns the log backend used by the application.
-
#log_backend=(log_backend : ::Log::Backend)
Allows to set the log backend used by the application.
-
#log_level : Log::Severity
The default log level used by the application.
-
#log_level=(log_level : ::Log::Severity)
Allows to set the default log level that will be used by the application (defaults to info).
-
#media_files
Provides access to media files settings.
-
#middleware : Array(Marten::Middleware.class)
Returns the list of middlewares used by the application.
-
#middleware=(v)
Allows to define the list of middlewares used by the application.
-
#port : Int32
Returns the port the HTTP server running the application will be listening on.
-
#port=(port : Int32)
Allows to set the port the HTTP server running the application will be listening on.
-
#port_reuse : Bool
Returns a boolean indicating whether multiple processes can bind to the same HTTP server port.
-
#port_reuse=(port_reuse : Bool)
Allows to indicate whether multiple processes can bind to the same HTTP server port.
-
#request_max_parameters : Int32?
Returns the maximum number of allowed parameters per request (such as GET or POST parameters).
-
#request_max_parameters=(request_max_parameters : Int32 | Nil)
Allows to set the maximum number of allowed parameters per request (such as GET or POST parameters).
-
#secret_key : String
Returns the secret key of the application.
-
#secret_key=(secret_key : String)
Allows to set the secret key of the application.
-
#sessions
Provides access to sessions settings.
-
#strict_transport_security
Provides access to strict transport security settings.
-
#templates
Provides access to templates settings.
-
#time_zone : Time::Location
Returns the default time zone used by the application when it comes to display date times.
-
#time_zone=(time_zone : Time::Location)
Allows to set the default time zone used by the application when it comes to display date times.
-
#use_x_forwarded_host : Bool
Returns a boolean indicating whether the X-Forwarded-Host header is used to look for the host.
-
#use_x_forwarded_host=(use_x_forwarded_host : Bool)
Allows to set whether the X-Forwarded-Host header is used to look for the host.
-
#use_x_forwarded_port : Bool
Returns a boolean indicating if the X-Forwarded-Port header is used to determine the port of a request.
-
#use_x_forwarded_port=(use_x_forwarded_port : Bool)
Allows to set whether the X-Forwarded-Port header is used to determine the port of a request.
-
#use_x_forwarded_proto : Bool
Returns a boolean indicating if the X-Forwarded-Proto header is used to determine whether a request is secure.
-
#use_x_forwarded_proto=(use_x_forwarded_proto : Bool)
Allows to set whether the X-Forwarded-Proto header should be used to determine whether a request is secure.
-
#x_frame_options : String
Returns the value to use for the X-Frame-Options header when the associated middleware is used.
-
#x_frame_options=(x_frame_options : String | Symbol)
Allows to set the value to use for the X-Frame-Options header when the associated middleware is used.
Constructor Detail
Instance Method Detail
Allows to set the explicit list of allowed hosts for the application.
The application has to be explictely configured to serve a list of allowed hosts. This is to mitigate HTTP Host header attacks.
Allows to configure a specific database connection for the application.
Returns the application database configurations.
Returns the configured handler class that should generate responses for Bad Request responses (HTTP 400).
Allows to set the handler class that should generate responses for Bad Request responses (HTTP 400).
Returns the configured handler class that should generate responses for Permission Denied responses (HTTP 403).
Allows to set the handler class that should generate responses for Permission Denied responses (HTTP 403).
Returns the configured handler class that should generate responses for Not Found responses (HTTP 404).
Allows to set the handler class that should generate responses for Not Found responses (HTTP 404).
Returns the configured handler class that should generate responses for Internal Error responses (HTTP 500).
Allows to set the handler class that should generate responses for Internal Error responses (HTTP 500).
Allows to set the host the HTTP server running the application will be listening on.
Returns the third-party applications used by the project.
Allows to set the log backend used by the application.
Allows to set the default log level that will be used by the application (defaults to info).
Returns the list of middlewares used by the application.
Allows to set the port the HTTP server running the application will be listening on.
Returns a boolean indicating whether multiple processes can bind to the same HTTP server port.
Allows to indicate whether multiple processes can bind to the same HTTP server port.
Returns the maximum number of allowed parameters per request (such as GET or POST parameters).
Allows to set the maximum number of allowed parameters per request (such as GET or POST parameters).
This maximum limit is used to prevent large requests that could be used in the context of DOS attacks. Setting
this value to nil
will disable this behaviour.
Allows to set the secret key of the application.
The secret key will be used provide cryptographic signing. It should be unique and unpredictable.
Returns the default time zone used by the application when it comes to display date times.
Allows to set the default time zone used by the application when it comes to display date times.
Returns a boolean indicating whether the X-Forwarded-Host header is used to look for the host.
Allows to set whether the X-Forwarded-Host header is used to look for the host.
Returns a boolean indicating if the X-Forwarded-Port header is used to determine the port of a request.
Allows to set whether the X-Forwarded-Port header is used to determine the port of a request.
Returns a boolean indicating if the X-Forwarded-Proto header is used to determine whether a request is secure.
Allows to set whether the X-Forwarded-Proto header should be used to determine whether a request is secure.
Returns the value to use for the X-Frame-Options header when the associated middleware is used.
The value of this setting will be used by the Marten::Middleware::XFrameOptions
middleware when inserting the
X-Frame-Options header in HTTP responses.
Allows to set the value to use for the X-Frame-Options header when the associated middleware is used.
This value will be used by the Marten::Middleware::XFrameOptions
middleware when inserting the
X-Frame-Options header in HTTP responses.