seamist

Downloads
Note: This site is still under construction. Most of the content is present and correct but there are a few issues still to correct.

Configuration

SeaMist is configured using three main configuration files. Two are system-wide, one is site-specific.

config.json

This is a system-wide configuration file. Its location depends on the operating system.

  • Linux - /etc/seamist/config.json
  • Windows - %CommonAppData%\seamist\config.json
{
  "SeaMist": {
    "Paths": {
      "ContentRootPath": "/var/lib/seamist/sites"
    },
    "Content": {
      "CacheTimeoutMinutes": 5,
      "FileWatchDebounceMilliseconds": 1000
    },
    "Listeners": {
      "Public": "0.0.0.0:9149",
      "Private": "127.0.0.1:9142"
    }
  },
  "Logging": {
    "EnableFileLogging": true,
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}

You can change the default SeaMist site root by setting SeaMist:Paths:ContentRootPath, but it defaults to /var/lib/seamist/sites on Linux. There isn't currently a Windows installer, so this location is not configured for you.

CacheTimeoutMinutes affects the TTL of cached items using SeaMist's own internal cache.

FileWatchDebounceMilliseconds controls how long SeaMist waits after detecting a filesystem change in the ContentRootPath before it processes the change.

Values under Listeners control the two SeaMist HTTP API listeners. Public controls the API endpoints that deal with serving content, media and so on. Private refers to the administration API endpoints, which allows you to flush caches and so on. Do not expose the private endpoint to the public internet.

Under Logging, you can use EnableFileLogging to deterine if filesystem logging happens. On Linux, the log path is /var/log/seamist, and log files are rotated daily. Set the Deault LogLevel to one of Debug, Information, Warning, Error if you want to control the amount of information logged. For SeaMist 0.x, the intention is to keep this at Information by default to assist with debugging. After 1.x, this will likely be turned down to Warning.

api-keys.toml

This is a system-wide configuration file. Its location depends on the operating system.

  • Linux - /etc/seamist/api-keys.toml
  • Windows - %CommonAppData%\seamist\api-keys.toml

Note: It is unnecessary to edit this file manually, and doing so may break access to content served by SeaMist.

For the sake of completeness, this file is made up of one or more blocks like the following, each one defining an API key for accessing SeaMist.

[[Keys]]
KeyHash = "<hashed key>"
Name = "site-name"
Scopes = ["content:read", "fragments:read", "media:read", "search:read", "data:read"]
Sites = ["site1", "site2"]
Expiry = 2027-06-18T02:09:11Z

KeyHash stores the hash of the original key (so if you lose a hash, you must regenerate it).

Name is a friendly identifier.

Scopes is any of the following:

  • content:read - read and query content
  • fragmnets:read - read fragments (only applies to direct API calls, not embedding in another smx file)
  • media:read - read media
  • data:read - read data
  • search:read - search content
  • metadata:read - read information about the configured site(s)
  • metadata:write - write site metadata (API only exposed on the admin port)
  • routes:read - read route configuration information

Sites refers to the folder name of one or more sites the API key should be allowed access to. ["*"] for all sites.

Expiry is the date and time this key expires.

seamist.toml

This is a site-specific configuration file which should be placed in the root of a site. It is entirely optional. If it doesn't exist, defaults will apply.

title = "My Site" # The name of your site
base_url = "https://cms.example.com" # The URL your CMS is accessible at
additional_domains = ["cms.domain1.com", "cms.domain2.com"] # More domains if needed
safe_html = false # Treat raw HTML in content as trusted. Defaults to false.

[content_types] # All true by default
html = true # Enable HTML output
md = true # Enable raw Markdown output
json = true # Enable JSON output

[[section]] # You can have multiple section definitions
name = "blog" # Name the section, for reference
path = "/blog" # Specify the directory 
type = "collection" # Specify the type of section
content_type = "post" # Specify what each file in the directory is
route_pattern = "/blog/{year}/{month}/{slug}" # Specify a route pattern
filename_pattern = "{year}-{month}-{slug}.smx" # Map the route pattern to filenames
sort_by = "created" # Sort by property
sort_direction = "desc" # Sort direction
suppress_default_routes = false # Suppress default routes for this section so only the rewritten routes are available