The configuration component allows you to view and edit your server’s configuration settings. Your server’s configuration is basically your “appsettings.json” file, which is being used in all parts of the system to retrieve configuration settings, such as for instance SMTP settings when email slots are sending emails, etc.
You should be careful as you edit your server’s configuration settings, since this might result in that your server becomes erronously configured, resulting in that your system stops working - In addition to that if you edit your server’s configuration erronously, you might open up your server such that malicious adversaries gains access to your system. The configuration component have helper UI elements to help you configure things such as OpenAI and SMTP, giving you a graphical user interface to edit some of its most important parts.
magic:frontend:urls section allows you to explicitly specify CORS, implying frontend URLs that are
allowed to retrieve data from the backend. Its default setting implies all URLs are allowed to retrieve
data from your backend, but sometimes you need to explicitly specify one or more URLs here. You can do this
by adding a comma separated list of URLs in this setting.
magic:smtp section allows you to specify which SMTP server Magic should use for sending emails.
Some modules such as the registration module needs to be able to send emails to function optimally.
This section allows you to specify which SMTP server settings to use when sending emails. Most parts of
this section is self explanatory, but the
from section is the default from name and address to use,
which is only used if an email is sent without explicitly declaring who it originated from.
magic:databases section allows you to configure your database connection strings. Magic supports
4 relational database types, these are as follows.
mssql- SQL Server
You can use all of the above database types in your Magic server. However, to access your database
you need to provide Magic with one or more connection strings. Each of these section contains
a key/value pair where the key becomes the name of your connection string, and the value its actual
connection string. This section also has a
default setting, which is the default database
type to use if not specified by caller. This needs to be one of “mysql”, “pgsql”, “sqlite”, or “mssql” -
Implying MySQL, PostgreSQL, SQLite or SQL Server.
Authentication and authorisation configuration
This section allows you to override the default authentication and authorisation values for Magic. Its sub-sections implies the following.
secret- JWT secret used to generate a JWT signature
https-only- If true this implies JWT tokens will only be verified over an SSL/TLS connection
valid-minutes- Number of minutes before JWT token generated by Magic expires
authentication- Which slot Magic will use to authenticate username/password combinations
registration:allow- Turns on or off registrations. If this value is false, users cannot register in Magic
registration:confirm-email- Allows you to override where to send the “confirm email address” email, to instead of sending it to the user registering, sending it to for instance yourself, allowing for you to explicitly allow users to register in Magic
level parts of this section implies which logging level you want to use. Magic supports 5 legal values for
this setting, and these are as follows.
debug- Log everything
info- Log only from info level and down
error- Log only from error level and down
fatal- Log only fatal errors
off- Never log
This works similarly to log4net, and implies “minimum logging level”, where any log invocations from and above
your minimum level are logged, while the rest of your log invocations will be ignored. The default value of “debug”
implies that everything will be logged. Notice, you can also override which
service to use for actually
url setting here allows you to override which URL clients needs to use to negotiate a socket
channel with your server. You can also completely turn OFF web sockets entirely here, by changing the
null or remove the section entirely.
bazar setting allows you to change which base URL Magic should use as its repository for its plugins component.