Crates.io | moella |
lib.rs | moella |
version | 0.2.0 |
source | src |
created_at | 2024-02-04 23:14:38.171169 |
updated_at | 2024-10-25 23:38:28.094488 |
description | An implementation of the Kvarn web server framework with a convenient config format. |
homepage | https://kvarn.org/ |
repository | https://github.com/Icelk/moella/ |
max_upload_size | |
id | 1126757 |
size | 174,859 |
This is the reference implementation of the Kvarn server library, offering a simple config to get you started using Kvarn.
See
moella --help
for config options
It's e.g. currently used by my domains icelk.dev and kvarn.org.
See kvarn.org for an example config and the schema of the config. You can also take a look at the icelk.dev config for a production example.
First install moella
.
Next, create a config file, let's say host.ron
:
(
hosts: [
Plain (
name: "my-website.com",
pk: "pk.pem",
cert: "cert.pem",
auto_cert: true,
path: "./",
extensions: ["arbetrary-name"],
options: (
public_data_directory: "build",
disable_server_cache: true,
disable_client_cache: false,
)
),
],
extensions: {
"arbetrary-name": [
// most of this can be removed; it's just an example
Csp ({
"/*": FromDefault ({
script_src: [ UnsafeInline, WasmUnsafeEval ],
style_src: [
Uri("https://fonts.googleapis.com"),
Uri("https://fonts.googleapis.com"),
UnsafeInline,
],
default_src: [ Uri("https://fonts.gstatic.com") ],
img_src: [ Uri("*"), Scheme("data:") ]
}),
// SVG XSS attacks if viewing file
"/groups/logo-images/*": FromDefault ({}),
}),
ClientCache ({
"/": MaxAge(3600),
"/_app/immutable/": Full,
"/groups/logo-images/": Changing,
"/groups/data": Changing,
"/groups/locations": Changing,
}),
]
},
import: ["./some-other.config-file.ron"],
ports: Standard(All),
)
Now, run moella -c host.ron --dev
. Your website should be working. Remove the --dev
flag when deploying.
See kvarn.org for more details.
If you have cargo
installed, simply run cargo install moella
.
There are builds available for Linux in Github Actions, and for other platforms under Releases.
To run it, download the binary appropriate for your platform.
chmod +x <downloaded binary>
to make it executable.chmod +x <downloaded binary>
, then open Finder and find
the binary. Right click and click Open
. Accept the warning../<downloaded binary> --help
in your shell to
get usage information.Install Rust and then run the following:
**If you're on macOS or Windows, you need to add --no-default-features -F bin
.
$ cargo install moella
During development, Mölla requires
Kvarn to be cloned at ../kvarn
,
Kvarn Search at ../kvarn-search
,
and Kvarn Auth at ../kvarn-auth
.
Many bugfixes to reverse proxy, including websockets finally working and body streaming for large files (e.g. movies through Jellyfin). Zstd is also supported now, and compression levels are generally more fitting.
http://10.0.0.12:8096
as an option to the reverse proxy.
Previously "tcp" was the only option.