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.

Configuring Magic

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.

Frontend configuration

The 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.

SMTP configuration

The 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.

Database configuration

The magic:databases section allows you to configure your database connection strings. Magic supports 4 relational database types, these are as follows.

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.

Logging configuration

The 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.

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 logging here.

Sockets configuration

The 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 value to null or remove the section entirely.

Plugins configuration

The bazar setting allows you to change which base URL Magic should use as its repository for its plugins component.