Anti-Social Media Server
Short version is, a personal communication platform for small groups of people, be it family, friends, organization, or company. Easy to setup, and servers can connect to each other, so two users installing their own on their machines is perfectly viable. Secure and encrypted messaging, voice and video-calls (screen-sharing included) are available, as is file-transfer.
Client (and proxy) documentation
The aim is to return the ownership of people's time, data, and privacy to themselves from corporations. There is absolutely no need for anyone to see promotions of items and services they don't have use for in their lives, from companies on the other end of the planet.
All the while the middleman corporations gather your personal data to profit off you, and train AI on your personal identity.
Returning to the basics, Magnolia presents the basic functionality one would expect:
- messaging with friends, family members, and colleagues,
- sharing posts, images, videos, files, link with each other,
- voice and video calls.
All this in a package that anyone can install on any system to supply themselves and their close ones or associates with these features, without corporations leeching on them.
No AI systems are running in the server (because there is absolutely no need for them)
Would you be paying it to yourself?
The server is run by you, all data remains with you (as far as the server is concerned).
Only for communication between humans as far as I am concerned. If you want to talk with bots, you'll have to do that part yourself.
The server instances are by default capable of connecting to other instances, creating what is known as a mesh network. Currently server-to-server direct connections are working, but relays are also planned. Meaning currently any two servers can talk to each other, and the plan is for servers to be able to pass along messages for other nodes. Two connecting servers, internally labeled as federation, allows the users of each server to communicate with each other.
- Basic communication features as per above.
- Encrypted communication between users (message, voice, video).
- Group messages and calls.
- A "global" (server-wide) voice call channel, that any user on the server can join (not shared with federated servers).
- Server to Server communication.
- Encrypted communication between servers.
- WebView Frontend (HTML, CSS, JS) served from the rust backend.
- No React, no daily critical vulnerability update, not breaking on every other build.
- If it builds, it runs.
- Thanks to servers identifying with signatures, they can change network addresses, and can work through VPNs without issue.
- Admin interface built into the frontend (for admin users) to manage and configure overarching settings, like SMTP, federation, default color scheme, users, registration, etc.
- While your server is offline, the messages sent from other servers are not lost, and when reestablishing connection everyone receives the messages they missed while their server was offline.
- Passphrase protected message encryption key. Key stored on the server, but encrypted, so you can login from anywhere to view your messages, but only if you remember the passphrase. This also means that if someone logs into your account, they cannot read your messages unless they know your passphrase.
- Reset passwords without emails, using a key file, that you can create when logged in. (Needs to be turned on by admin.)
- Proxy account system for separated automation (bots).
- Session management
-
Server installed by user or someone known to them.
-
User joins the server through: a. public registration. b. invitation (can be enforced that only the email set by the admin can use the invitation) c. application (registration request)
-
User communicates with other users
-
Admin finds someone else with a server
-
Server federates (connects with) other server, one admin sends a request to the other server, who accepts (or rejects it)
-
If user decides, they communicate with users on federated servers. Users can completely opt-out, use whitelist and blacklist modes to decide which servers they want to interact with.
(assuming Linux system, Windows works similarly but currently doesn't have automatic nginx configuration, macos was done completely on theory)
- a) Download server installer binary of your choice (currently Windows and Linux(.deb for debian, .rpm for fedora))
- b) Download source code to build for your system (There is a macos build script setup, but I have no compatible hardware so cannot test, best of luck).
- Install on your system (it should get most of environment values from you in the process).
- Addendum (IMPORTANT), during setup you will be prompted to include an admin account, if this doesn't happen or fails, the website should start in setup mode, meaning the first to connect gets to create an admin account through the web interface. If even this fails, there is a binary in the project that allows for inserting an admin user straight into the database.
- Setup your reverse-proxy (if you have nginx the installer SHOULD add a new entry for the server).
- Windows addendum: For windows you don't need nginx to run on your machine.
But if you need some extra info on in this direction, server is registered with Windows Service Control Manager, so there should be registry entry at
HKLM\SYSTEM\CurrentControlSet\Services\magnolia_server\Environment. - Don't forget to open a port on your router (this allows the application to be reachable from the interwebz).
- Setup your subdomain to the open port, and match with the right environment variables.
Admins can configure SMTP to send emails for password resets, and registration invitations. If you don't configure during installation, or just need to change it, you can do it through the admin interface. To configure you will generally need to also consult your SMTP service. This is not hosted in this server, but elsewhere.
SMTP_HOSThost address of your SMTP service.SMTP_PORTsame but port.SMTP_USERNAMEself explaining.SMTP_PASSWORDself explaining.SMTP_FROMthe email address you are using to send the emails.
Data for the server is (hopefully) stored on the machine where installed and running, not in any cloud instance.
Database is SQL schema based, capable of both SQLite and PostgreSQL.
Environment variable DATABASE_URL dictates which one is used, and where it can be accessed.
HOSTenvironment variable decides whether to run locally (127.0.0.1) or publically (0.0.0.0).PORTenvironment variable is the open port, where you should direct your reverse-proxy or domain.BASE_URLis the PUBLICLY accessible address for your server. It can be either IPv4(http://127.0.0.1:3000) or URL (http://whatever.mydomain.internet).WEB_ORIGINgenerally the same asBASE_URL, used for cors.
LOCAL_PORT optional variable, if present opens a second server port for localhost, in case you want to run the server both publically and locally. Through localhost access your connection doesn't go through the internet, and can be absolutely securely used without TLS. So even without TLS on servers, if you are using your localhost access to your server, and the server is federated with servers, they communicate with eachother encrypted, without exposing your data.
SESSION_DURATION_DAYSis how many days you stay logged in.RATE_LIMIT_GLOBALis the number of calls an address (generally user device) can ask the server for something.RATE_LIMIT_AUTHis for setting how many times a login can be attempted unsuccessfully.ENCRYPTION_AT_REST_KEYgives the key for encrypting data that is not currently in memory (is unused at the moment).TRUSTED_PROXYsets a trusted proxy for the rate-limiters.ENVif the value isdevelopment, sets login cookie security header to false (true in all other cases).
TURN_ENABLEDvaluetrueto turn on.TURN_LISTEN_ADDRis youraddress:portwhere you want to run your TURN server (default value if not given:0.0.0.0:3478).TURN_REALMthe shared realm/topic TURN connections are looking for, default valuemagnolia.SESSION_SECRETused for TURN (it's for a specific type of connection that can be enabled for calls).TURN_EXTERNAL_IPis (as per name) the ip address where the TURN server can be reached from external sources.
As said in title, the issue here is that the two major rust projects for turn are less than ideal. Turn-rs choose not to publish the lib and is primarily a binary product. While the (I assume) google maintained alternative is... Pushed multiple times, each times slightly different, and none of them have any tangible documentation on what's googling on. Or not sure, I'm honestly confused by the situation, so here are some links to them rtc-turn "turn" webrtc-turn
On account of the above, I'll probably have to create/fork-and-fix a turn library. Until then, STUN it is.
LOG_FORMATvalueprettycauses output to be "pretty", meaning contents are separated by spaces and new lines. All other values cause json-blob.LOG_OUTPUTvaluefileprints the logs into file,bothprints to file and stdout, anything else causes logs to go to only stdout.LOG_FILE_PATHvalue is the file where log files will go.LOG_INCLUDE_SOURCEvaluetrueor1will include code position in the source file to be logged as well.
for low hardware requirement use-cases. Sometimes you are okay with running an app with 30MB ram usage and not a whole webview, or you just don't want to run a browser. Maybe you need more free hardware resource for other applications but still want to talk with a colleague/family member. Native applications can run way too many times better than running a whole webview for what? A panel and a text field? That really shouldn't take a whole gigabyte of ram and 4 cpu cores, snatching everything you do and labeling it "telemetry".
I'm planning to build a mobile application that is fully working with one or even more server instances, with operations for a single server, or multiple associated servers.
I don't have enough RAM to tell what this is.
Currently missing easily understandable documentation for users and developers for extensions and repairs. Documentation to help connect bots (yeah I know... but this is a pretty standard feature at this point) if you want to get messages from them.
Some elements like incoming federation requests sometimes only update when refreshing. Needs further testing to find bottlenecks.
- Servers between each other are currently communicating mostly with POST requests instead of the established web-socket channel. Both are encrypted, it's just a work-in-progress feature.
- When the server was offline and you receive an image/video/file, it is loaded when your server reestablishes connection. If you are logged in in the meantime, you might need to refresh the page for the file to load into the frontend. It will still be visible that there is an attachment, but for for example a video, it will not display even a thumbnail.
- Groups calls between servers can be problematic. Haven't figured out the source of it yet.
Setting up two separate servers (with their own databases, and on separate ports) works, with the caveat that when you are trying voice and/or video calls, and you have one of the servers on localhost (127.0.0.1) and the other on the public net (0.0.0.0) (for example because you want to test mobile login into your server) it will only work if your localhost server is calling the public address; while the other way around will not connect in the browser.
- Run release compiled server on localhost port 3000 with
my.dbas the database file.
HOST=127.0.0.1 PORT=3000 BASE_URL=http://127.0.0.1:3000/ DATABASE_URL=sqlite:./my.db cargo run --release --bin magnolia_serverPretty much the same as the command just above.
You'll need rustc, try cargo. I'm as of now running on rustc 1.92.0.
Take a look at: Rust
Look inside the installer folder, you will find... more folders. Select your target platform.
you'll need inno.
you'll need zig for the cross-compile. build script attached. Prerequisites:
winget install zig.zig
cargo install cargo-zigbuild cargo-deb
Usage:
cross-build.bat
cross-build.bat --target aarch64-unknown-linux-gnu
but I've no idea about mac, godspeed.
Your browser probably disallows security for your session (your server is not on HTTPS but only HTTP, and you are not on localhost), it will not allow you to use encryption. So you either have to get a certificate on your address, get the exception into your browser (this will turn your connection insecure, and all your data will go around unencrypted), or you need to switch to the localhost port (if the server is running on your machine and you enabled it with LOCAL_PORT).
WebRTC is a pain in the everything. But really! Usually you can just serialize things, encrypt things, send them over the wire, decrypt, deserialize, and you are done. But WebRTC is like nooooooooooooooooooo buddy. Or might just be that browsers are bloated and like to cause issues, you be the judge of that.
This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
