{
  "type": "object",
  "required": [
    "sections"
  ],
  "additionalProperties": false,
  "properties": {
    "pageInfo": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Title and heading for the app"
        },
        "description": {
          "type": "string",
          "description": "Sub-title, displayed in header"
        },
        "navLinks": {
          "type": "array",
          "maxItems": 6,
          "description": "Quick access links, displayed in header",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "path"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "path": {
                "type": "string"
              }
            }
          }
        },
        "footerText": {
          "type": "string"
        },
        "logo": {
          "type": "string",
          "description": "Path to an optional image asset, to be displayed in the header",
          "pattern": "^(http|/)",
          "examples": [
            "/web-icons/dashy-logo.png",
            "https://i.ibb.co/yhbt6CY/dashy.png"
          ]
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "appConfig": {
      "type": "object",
      "description": "Application configuration",
      "properties": {
        "backgroundImg": {
          "type": "string",
          "description": "A URL to an image asset to be displayed as background"
        },
        "language": {
          "type": "string",
          "description": "The ISO code of your desired language, must have translations present, check docs for more info"
        },
        "startingView": {
          "enum": [
            "default",
            "minimal",
            "workspace"
          ],
          "default": "default",
          "description": "Which page to load by default, and on the base page or domain root. You can still switch to different views from within the UI"
        },
        "theme": {
          "type": "string",
          "default": "callisto",
          "description": "A theme to be applied by default on first load",
          "examples": [
            "callisto",
            "thebe",
            "dracula",
            "material",
            "material-dark",
            "colorful",
            "nord",
            "nord-frost",
            "minimal-dark",
            "minimal-light",
            "matrix",
            "matrix-red",
            "hacker-girl",
            "raspberry-jam",
            "bee",
            "tiger",
            "material-original",
            "material-dark-original",
            "vaporware",
            "high-contrast-dark",
            "high-contrast-light"
          ]
        },
        "enableFontAwesome": {
          "type": "boolean",
          "default": true,
          "description": "Should load font-awesome assets"
        },
        "fontAwesomeKey": {
          "type": "string",
          "pattern": "^[a-z0-9]{10}$",
          "description": "API key for font-awesome"
        },
        "faviconApi": {
          "enum": [
            "local",
            "faviconkit",
            "google",
            "clearbit",
            "webmasterapi",
            "allesedv"
          ],
          "default": "faviconkit",
          "description": "Which service to use to resolve favicons. Set to local to do this locally instead"
        },
        "layout": {
          "enum": [
            "horizontal",
            "vertical",
            "auto",
            "sidebar"
          ],
          "default": "auto",
          "description": "Specifies sections layout orientation on the home screen"
        },
        "iconSize": {
          "enum": [
            "small",
            "medium",
            "large"
          ],
          "default": "medium",
          "description": "The size of each link item / icon"
        },
        "colCount": {
          "type": "number",
          "minimum": 1,
          "maximum": 8,
          "description": "Number of section columns for homepage. Leave blank for column count to be responsively calculated based on screen size"
        },
        "hideComponents": {
          "type": "object",
          "description": "Hide individual parts of the page. If not set, all components are visible by default",
          "properties": {
            "hideHeading": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, the page heading & subtitle will be hidden"
            },
            "hideNav": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, the navigation menu will be hidden"
            },
            "hideSearch": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, the search bar will be hidden"
            },
            "hideSettings": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, the settings buttons will be hidden"
            },
            "hideFooter": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, the page footer will be hidden"
            },
            "hideSplashScreen": {
              "type": "boolean",
              "default": "true",
              "description": "If set to true, the loading / splash screen will not be shown"
            }
          }
        },
        "cssThemes": {
          "type": "array",
          "description": "Theme names to be added to the dropdown",
          "items": {
            "type": "string"
          }
        },
        "customColors": {
          "type": "object",
          "description": "Set a custom color palette for any theme"
        },
        "externalStyleSheet": {
          "description": "URL or URLs of external stylesheets to add to dropdown/ load",
          "type": [
            "string",
            "array"
          ],
          "items": {
            "type": "string"
          }
        },
        "customCss": {
          "type": "string",
          "description": "Any custom CSS overides, must be minified"
        },
        "statusCheck": {
          "type": "boolean",
          "default": false,
          "description": "Displays an online/ offline status for each of your services"
        },
        "statusCheckInterval": {
          "type": "number",
          "default": 0,
          "description": "How often to recheck statuses. If set to 0, status will only be checked on page load"
        },
        "webSearch": {
          "type": "object",
          "description": "Configure options for web search",
          "additionalProperties": false,
          "properties": {
            "disableWebSearch": {
              "type": "boolean",
              "default": "false",
              "description": "If set to true, web search will be disabled all together"
            },
            "searchEngine": {
              "type": "string",
              "default": "duckduckgo",
              "description": "Set your default search engine. Reference provider by key, see docs for all supported search engines, or set to custom to use your own",
              "examples": [
                "duckduckgo",
                "google",
                "whoogle",
                "qwant",
                "startpage",
                "searx-bar",
                "searx-info",
                "ecosia",
                "metager",
                "wikipedia",
                "wolframalpha",
                "stackoverflow",
                "bbc",
                "custom"
              ]
            },
            "customSearchEngine": {
              "type": "string",
              "description": "Set the URL of a self-hosted or custom search engine, including GET query params. You must also set searchEngine: custom"
            },
            "openingMethod": {
              "enum": [
                "newtab",
                "sametab",
                "modal",
                "workspace"
              ],
              "default": "newtab",
              "description": "Set where you would like search results to open to"
            },
            "searchBangs": {
              "type": "object",
              "additionalProperties": true,
              "examples": [
                {
                  "/r": "reddit",
                  "!w": "https://whoogle.local/search?q="
                }
              ],
              "description": "A KV-pair of custom search bangs. The key should be the shortcut to type, and the value is the search engine, specified either by key or full URL"
            }
          }
        },
        "auth": {
          "type": "object",
          "description": "Settings for enabling authentication",
          "additionalProperties": false,
          "properties": {
            "enableGuestAccess": {
              "type": "boolean",
              "default": false,
              "description": "If set to true, an unauthenticated user will be able to have read-only access to dashboard, without needing to login. Requires auth to be configured."
            },
            "users": {
              "type": "array",
              "description": "Usernames and hashed credentials for frontend authentication",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "user",
                  "hash"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "The username for a user"
                  },
                  "hash": {
                    "type": "string",
                    "description": "A SHA-256 hashed password for that user",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "type": {
                    "enum": [
                      "admin",
                      "normal"
                    ],
                    "description": "User type, denoting privilege level, either admin or normal",
                    "default": "normal"
                  }
                }
              }
            },
            "enableKeycloak": {
              "type": "boolean",
              "default": false,
              "description": "If set to true, and auth.keycloak is also configured, then Keycloak will be used for app auth"
            },
            "keycloak": {
              "type": "object",
              "description": "Configuration for Keycloak server",
              "additionalProperties": false,
              "required": [
                "serverUrl",
                "realm",
                "clientId"
              ],
              "properties": {
                "serverUrl": {
                  "type": "string",
                  "description": "The URL (or URL/ IP + Port) where your keycloak server is running"
                },
                "realm": {
                  "type": "string",
                  "description": "The name of the realm (must already be created) that you want to use"
                },
                "clientId": {
                  "type": "string",
                  "description": "The Client ID of the client you created for use with Dashy"
                }
              }
            }
          }
        },
        "enableMultiTasking": {
          "type": "boolean",
          "default": false,
          "description": "If set to true, will keep apps opened in the workspace open in the background. Useful for switching between sites, but comes at the cost of performance"
        },
        "allowConfigEdit": {
          "type": "boolean",
          "default": true,
          "description": "Can user write changes to conf.yml file from the UI. If set to false, preferences are only stored locally"
        },
        "enableServiceWorker": {
          "type": "boolean",
          "default": false,
          "description": "If set to true, then service workers will be used to cache page contents"
        },
        "disableContextMenu": {
          "type": "boolean",
          "default": false,
          "description": "If set to true, custom right-click context menu will be disabled"
        },
        "disableUpdateChecks": {
          "type": "boolean",
          "default": false,
          "description": "Prevents Dashy from checking for updates"
        },
        "disableSmartSort": {
          "type": "boolean",
          "default": false,
          "description": "Prevents the app storing local click count, required for the last-used and most-used sort orders"
        },
        "enableErrorReporting": {
          "type": "boolean",
          "default": false,
          "description": "Enable anonymous crash reports. This helps bugs be found and fixed, in order to make Dashy more stable. Reporting is off by default, and no data will EVER be collected without your explicit and active concent."
        },
        "sentryDsn": {
          "type": "string",
          "description": "The DSN to your self-hosted Sentry server, if you need to collect bug reports. Only used if enableErrorReporting is enabled"
        },
        "workspaceLandingUrl": {
          "type": "string",
          "description": "The URL of an app, service or website to render when the Workspace view is opened"
        }
      },
      "additionalProperties": false
    },
    "sections": {
      "type": "array",
      "description": "Array of sections, containing items",
      "items": {
        "type": "object",
        "required": [
          "name",
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Title/ heading for a section"
          },
          "icon": {
            "type": "string",
            "description": "Icon will be displayed next to title"
          },
          "displayData": {
            "type": "object",
            "additionalProperties": false,
            "description": "Optional meta data for customizing a section",
            "properties": {
              "sortBy": {
                "enum": [
                  "default",
                  "most-used",
                  "last-used",
                  "alphabetical",
                  "reverse-alphabetical",
                  "random"
                ],
                "default": "default",
                "description": "How to sort items within the section. By default items are displayed in the order in which they are listed in within the config"
              },
              "collapsed": {
                "type": "boolean",
                "default": false,
                "description": "If true, section needs to be clicked to open"
              },
              "color": {
                "type": "string",
                "description": "Hex code, or HTML color for section fill"
              },
              "customStyles": {
                "type": "string",
                "description": "CSS overides for section container"
              },
              "itemSize": {
                "enum": [
                  "small",
                  "medium",
                  "large"
                ],
                "default": "medium",
                "description": "Size of items within the section"
              },
              "rows": {
                "type": "number",
                "minimum": 1,
                "maximum": 5,
                "default": 1,
                "description": "The amount of space that the section spans vertically"
              },
              "cols": {
                "type": "number",
                "minimum": 1,
                "maximum": 5,
                "default": 1,
                "description": "The amount of space that the section spans horizontally"
              },
              "sectionLayout": {
                "enum": [
                  "grid",
                  "auto"
                ],
                "default": "auto",
                "description": "If set to grid, items have uniform width, and itemCount can be set"
              },
              "itemCountX": {
                "type": "number",
                "minimum": 1,
                "maximum": 12,
                "description": "Number of items per column"
              },
              "itemCountY": {
                "type": "number",
                "minimum": 1,
                "maximum": 12,
                "description": "Number of items per row"
              },
              "hideForUsers": {
                "type": "array",
                "description": "Section will be visible to all users, except for those specified in this list",
                "items": {
                  "type": "string",
                  "description": "Username for the user that will not be able to view this section"
                }
              },
              "showForUsers": {
                "type": "array",
                "description": "Section will be hidden from all users, except for those specified in this list",
                "items": {
                  "type": "string",
                  "description": "Username for the user that will have access to this section"
                }
              },
              "hideForGuests": {
                "type": "boolean",
                "default": false,
                "description": "If set to true, section will be visible for logged in users, but not for guests"
              }
            }
          },
          "items": {
            "type": "array",
            "description": "Array of items to display with a section",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Text shown on the item"
                },
                "description": {
                  "type": "string",
                  "nullable": true,
                  "description": "Short description, shown on hover or in a tooltip"
                },
                "icon": {
                  "type": "string",
                  "nullable": true,
                  "description": "An icon, either as a font-awesome identifier, local or remote URL, or the word favicon or generative"
                },
                "url": {
                  "type": "string",
                  "description": "The destination to navigate to when item is clicked"
                },
                "target": {
                  "enum": [
                    "newtab",
                    "sametab",
                    "modal",
                    "workspace"
                  ],
                  "default": "newtab",
                  "description": "Opening method, when item is clicked"
                },
                "hotkey": {
                  "type": "number",
                  "description": "A numeric shortcut key, between 0 and 9. Useful for quickly launching frequently used applications"
                },
                "tags": {
                  "type": "array",
                  "description": "Tags, which can be used for improved search",
                  "maxItems": 12,
                  "items": {
                    "type": "string"
                  }
                },
                "color": {
                  "type": "string",
                  "description": "A custom fill color of the item"
                },
                "provider": {
                  "type": "string",
                  "description": "Provider name, e.g. Microsoft"
                },
                "statusCheck": {
                  "type": "boolean",
                  "default": false,
                  "description": "Whether or not to display online/ offline status for this service. Will override appConfig.statusCheck"
                },
                "statusCheckUrl": {
                  "type": "string",
                  "description": "If you've enabled statusCheck, and want to use a different URL to what is defined under the item, then specify it here"
                },
                "statusCheckHeaders": {
                  "type": "object",
                  "description": " If you're endpoint requires any specific headers for the status checking, then define them here"
                },
                "statusCheckAllowInsecure": {
                  "type": "boolean",
                  "default": false,
                  "description": "Allows for running status checks on insecure content/ non-HTTPS apps"
                }
              }
            }
          }
        }
      }
    }
  }
}