Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects

Krustacea

Create, serve and manage websites

------------------------------------------------
|------- Developped by Kuadrado Software ------|
------------------------------------------------

Krustacea is a package that contains a web server written in Rust (Actix based) and a web application to build a static website.


/!\ WIP

This package is a work in progress I have just begun. More features and documentation should become visible soon.


CLI Syntax

krustacea [OPTIONS]

Options

  • -c | --ctx : The execution context. Can be debug (DEFAULT) or production.
  • -d | --dir : Any Linux directory path to hold the Krustacea static files. DEFAULT : In a debug context, the $HOME directory will be used (i.e. a krusteacea directory will be created in the HOME dir and krustacea will use it to store static assets, backups, config files, etc). In production context, the /var directory will be used.
  • --load [OPTIONAL]: The path to the website to load as a JSON file. If no file is provided, a new website will be created from a blank template.
  • -h | --host : The host name. DEFAULT: localhost.
  • -p | --port : The HTTP port to use. DEFAULT: 8080
  • --ptls : The TLS port to use. DEFAULT: 8443
  • --certs_dir: The directory containing the SSL certificates. DEFAULT : /etc/letsencrypt/live. (The host name will be joined to this path to find the right certificates)

Website data

A website data is store as a JSON file with the following structure

// example.json
{
    "root_page": {
        "template_name": "A Custom Template",
        "metadata": {
            "title": "Hello Krustcea !",
            "description": "An example website",
            "image": "https://example.com/images/ex_pic.png",
            "css": [],
            "js": [],
            "url_slug": "",
            "lang": "en"
        },
        "body": [
            {
                "tag": "h1",
                "text": "Example Story"
            },
            {
                "tag": "p",
                "text": "Hello,<br />How are you?",
                "attrs": {
                    "class": "p_class"
                }
            },
            {
                "tag": "img",
                "attrs": {
                    "src": "/img/url.png"
                }
            }
        ],
        "sub_pages": []
    },
    "templates": [
        {
            "name": "Custom template",
            "layout": {
                "display": "grid"
            },
            "contents": [
                {
                    "tag": "div",
                    "attrs": {
                        "id": "custom-template",
                        "class":"page-template"
                    },
                    "contents": [
                        {
                            "tag": "nav",
                            "contents": [
                                {
                                    "tag": "ul",
                                    "contents": [
                                        {
                                            "tag": "li",
                                            "text": "menu item 1"
                                        },
                                        {
                                            "tag": "li",
                                            "text": "menu item 2"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "tag": "footer",
                            "contents": []
                        }
                    ]
                }
            ]
        }
    ],
    "assets_index": [
        "/assets/images/toto.jpg",
        "/assets/sounds/toto.mp3",
        "/assets/video/toto.mp4",
        "/assets/docs/toto.xcf",
        "/assets/source_code/toto.js"
    ]
}