Prerequisites
- Internet-facing web server with reverse proxy and domain name (preferably SSL of course)
- Server behind the reverse proxy with Rust environment
Installation
- Don’t bother downloading the source code to your server; installing it that way gives you a big debug executable
- Instead just
cargo install mollysocket
- Move the
mollysocket
executable if desired - Run
mollysocket
once so that it will emit the default config
Configuration
- Fish the config file out of
.config/mollysocket/default-config.toml
and copy it somewhere.
config.toml
- In the new file, replace the
allowed_endpoints
line withallowed_endpoints = ['*']
. The default 0.0.0.0 config appears to be a bug; this setting controls access to endpoints within the app, not IPs from outside. Leaving the original value causes mollysocket to reject everything. - Put a proper path in the
db = './mollysocket.db'
line rather than just having it land wherever you’re sitting. - Delete the
mollysocket.db
that was created on first run (even if it’s already where you’re intending to put it). This is just to make sure the web server creates it and has the correct permissions.
Run script
- The environment variable ROCKET_PORT must be set or the server will sit and do nothing. It’s best to create all of the environment variables mentioned in the README, whether that is in a user profile script or in a shell script that wraps startup. You can change any of these values, but they must exist.
-
export ROCKET_PORT=8020 export RUST_LOG=info export MOLLY_CONF=/path/to/your/config.toml
Proxy server
- You’ll need to proxy everything from
/
to your mollysocket server and ROCKET_PORT. - Exclude anything that you may need served from your web server, such as .well-known.
Things to know
- I get this warning on startup: “Forced shutdown is disabled. Runtime settings may be suboptimal.”
- I also can’t stop my server with any sane signal; only SIGKILL brings it down.
- Some discussion here: https://github.com/SergioBenitez/Rocket/discussions/1880
strangest thing. i updated firefox and now i have no notifications. only a limited number of sites have notification perms; they still say they have that permission and my system settings still have firefox allowed. i have another machine running ubuntu (with firefox from the PPA for apt) and notifications are unchanged there.