Configuration

Jakon configuration is primarily managed through a standard Java .properties file. The framework uses reflection to map these properties to internal settings.


Configuration Loading


The ConfigurationInitializer is responsible for loading the configuration.



  • Default File: By default, Jakon looks for jakon_config.properties in the root directory of the application.

  • Loading Mechanism:

    1. The framework reads the properties file into a map.

    2. It identifies classes annotated with @Configuration (like Settings).

    3. For each field annotated with @ConfigurationValue(name = "...", ...), it looks for a matching key in the properties map.

    4. If a property is missing:

      • It uses the defaultValue specified in the annotation if available.

      • If no default is provided and required = true, the application will throw an IllegalStateException and fail to start.



    5. Values are injected directly into fields or via setter methods if they follow the setFieldName(String) convention.




Example jakon_config.properties


templateDir=templates/my_theme
staticDir=static
outputDir=out/
port=8080
hostname=localhost
databaseConnPath=jdbc:sqlite:my_database.sqlite



Configuration Options


Below is a detailed list of configuration options defined in Settings.scala.


General Configuration






























































NameTypeRequiredDefault ValueDescription
templateDirStringYestemplates/baconDirectory where template files are stored.
staticDirStringYesstaticDirectory for static assets (images, CSS, JS).
outputDirStringYesout/Directory where generated static files are placed.
packageStringYes-Semicolon-separated list of packages to scan for Jakon objects.
deployModeEnumYesDEVELDeployment mode: DEVEL or PRODUCTION.
deployTypeStringYescz.kamenitxan.jakon.core.deploy.DummyDeployClass name of the deployment handler.
onlyRenderBooleanYesfalseIf true, the application only renders templates without starting the server.

Server Configuration









































NameTypeRequiredDefault ValueDescription
hostnameStringYes-The hostname of the application.
portIntYes4567The port on which the server listens.
loginPathStringYes/loginThe path to the login page.
initRoutesBooleanYestrueWhether to automatically initialize routes.

Database Configuration

Jakon detects the database type (MYSQL or SQLITE) based on the connection string prefix.










































NameTypeRequiredDefault ValueDescription
databaseDriverStringYesorg.sqlite.JDBCJDBC driver class name.
databaseConnPathStringYesjdbc:sqlite:jakonTest.sqliteJDBC connection string.
databaseUserStringNo""Database username.
databasePassStringNo""Database password.

Localization



























NameTypeRequiredDefault ValueDescription
defaultLocaleLocaleYesen_USThe default locale (e.g., en_US, cs_CZ).
supportedLocalesSeq[Locale]Noen_USComma-separated list of supported locales.

Email Configuration (MAIL.)



















































































NameTypeRequiredDefault ValueDescription
MAIL.enabledBooleanYestrueEnable or disable email functionality.
MAIL.hostStringNo-SMTP server host.
MAIL.portStringNo25SMTP server port.
MAIL.usernameStringNo-Username for SMTP authentication.
MAIL.passwordStringNo-Password for SMTP authentication.
MAIL.authStringNo-SMTP authentication method.
MAIL.tlsBooleanNofalseEnable STARTTLS.
MAIL.sslBooleanNofalseEnable SSL.
MAIL.force_bccStringNo-BCC address for all outgoing mail.
emailValidator.checkDnsBooleanNotrueCheck DNS record when validating email addresses.

Security and Integrations


































NameTypeRequiredDefault ValueDescription
encryptionSecretStringYesreallyRandomStinSecret key used for internal encryption.
HCAPTCHA.siteKeyStringNo-hCaptcha Site Key.
HCAPTCHA.secretStringNo-hCaptcha Secret Key.