Configuring your server
This component allows you to view and edit your server’s configuration settings. You 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 when email slots are sending emails, etc. Below is a screenshot of the component.
Notice, 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.
What configuration sections your particular server has obviously depends upon which apps, and/or modules you’ve installed, and which settings these modules depends upon - However, below is a list of the common “system configuration settings” Magic relies upon out of the box, and what these configuration settings implies.
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.
These are your database connection strings. Magic supports 3 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 value. 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”, or “mssql” -
Implying MySQL, PostgreSQL or SQL Server.
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
ldap- If you’re using LDAP authentication, this setting is your LDAP domain
auto-auth- If you’re using LDAP authentication combined with “automatic authentication” then this will be the name of the slot responsible for returning your username
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
This section allows you to override the service to use for your cache. The default implementation implies using a memory based cache, but you can also use NoSQL cache services, and/or roll your own.
root-folder setting in this section allows you to change where Magic will store your dynamic files.
This allows you to for instance have some folder on disc where all your dynamic files are stored, as
an alternative to the default value, which is inside your Magic server’s “files” folder. The other
parts of this configuration settings implies the following.
IFileServiceimplementation to use
IFolderServiceimplementation to use
IStreamServiceimplementation to use
To understand the 3 settings above, realise that Magic supports “virtual file and folder systems”, through for instance storing files and folders in Scylla or Cassandra, allowing you to virtually resolve files from alternative storages besides your physical file system.
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.
This setting allows you to change which base URL Magic should use as its Bazar.