To setup UnifiedPush on Molly FOSS, I chose a server and installed ntfy. Tried setting it up for a while before giving up 🤷♂️. How have you set up UnifiedPush?
How have you set up UnifiedPush?
- Edited
You need to install mollysocket with Docker somewhere. Doesn't have to be internet facing,
it supports "airgapped mode", basically it pings the ntfy server itself when there are messages from Signal.
But it has to maintain connections to the Signal server and ntfy.sh:
https://github.com/mollyim/mollysocket
Btw, you don't have to install your own ntfy instance, their hosted free one works perfectly fine.
Basically it just receives a callback from mollysocket telling "hey wake the app, there is an event"
and the app will connect to Signal servers and get the messages, so no privacy issue here.
23Sha-ger I reinstalled ntfy and enabled UnifiedPush in Molly. It found ntfy under Notification method
but it is greyed out and the status shows "Unable to find the endpoint." In the section where the server URL from ntfy.sh goes in Molly, it shows a "⚠" beside it.
Disabled all battery optimizations too. No idea where to go from here.
- Edited
You need to install mollysocket on a server that has 24/7 availability and has access to the internet. It doesn't necessarily have to have inbound access from the internet, like a webserver. That's the beauty of the "air-gapped" mode mentioned by @23Sha-ger.
Your mollysocket server essentially bridges the gap between the Signal server and your Android phone running ntfy. There's a cool diagram that explains how this works at https://github.com/mollyim/mollysocket. A picture is worth a thousand words, as they say.
You don't have to use Docker to install mollysocket -- you can use crates.io, like I did. I'm going to reproduce my build steps below in the chance it might help someone use this excellent software from the devs that brought you Molly. Their install docs on GitHub are very good, but I did have to connect a few dots. You should also have a decent understanding of the Linux CLI before you attempt this. Also, I do a lot of things logged in as root, which you probably shouldn't do.
0) Find a server you can use to run mollysocket. I signed up for a VPS on https://1984.hosting/ because they have a reputation as a privacy-oriented hosting company. I don't get anything if you sign up with them but I have had a great experience so far and it's very co$t effective, in my opinion. After your VPS is up and running:
1) Install rustup, which also installs cargo
curl https://sh.rustup.rs -sSf | sh
Restart the bash shell afterwards (assumes you're using the bash shell)
source ~/.bashrc
Add Rust to PATH
source "$HOME/.cargo/env"
Verify the installation
rustc -V
2) Create the molllysocket user and home directory
sudo useradd mollysocket -m -d /opt/mollysocket
sudo -su mollysocket
cd
3) Install any dependencies you might be missing (if logged in as root) or sudo
sudo apt-get update
sudo apt-get install libssl-dev
sudo apt-get install libsqlite3-dev
4) Login as the mollysocket user you created and install mollysocket
sudo -su mollysocket
cargo install mollysocket
Create the symbolic link
ln -s /opt/mollysocket/.cargo/bin/mollysocket /opt/mollysocket/ms
5) Download the config file to /opt/mollysocket
wget -O /opt/mollysocket/prod.toml https://github.com/mollyim/mollysocket/raw/main/config-sample.toml
6) Exit back to root
7) Download the systemd unit file to /etc/systemd/system/
wget -O /etc/systemd/system/mollysocket.service https://github.com/mollyim/mollysocket/raw/main/mollysocket.service
8) Start the mollysocket service
systemctl enable --now mollysocket
Verify the mollysocket service is running at any time using:
systemctl status mollysocket
9) Download ntfy from F-Droid/Obtanium and install on the Android phone
10) Install the UnifiedPush version of Molly on the Android phone with Obtanium: https://github.com/mollyim/mollyim-android-unifiedpush
It has to be the UnifiedPush version and not any of the other flavors of Molly.
11) Configure "Air Gapped Mode" on Molly UnifiedPush app by going to: Settings > Notifications
Delivery Method = UnifiedPush
UnifiedPush Status = Air Gapped
Notification method = ntfy
Air gapped switch = On
Copy server parameters
12) Using server parameters copied from Molly, add a new connection to the mollysocket service. Fill in the parts that are unique to your install exactly as you copied from Molly Settings > Notifications
mollysocket -c /opt/mollysocket/prod.toml connection add your-UUID-goes-here 2 \thisisyouruniquestring 'https://ntfy.sh/upthisisuniquetoyou?up=1'
If all of the above was successful, this will generate a push notification from mollysocket to your phone: "Unified Push This is a test notification received from your MollySocket server."
Molly should now receive push notifications when Signal messages are sent to you even when the database is locked.
You'll see the ntfy app is persistent in the status bar/shade: "Listening for incoming notifications".
New Signal incoming messages will send a push notification to your Molly app: "You may have new messages."
Anyway, this will get you 95% of the way there. I may add some post-install steps below to harden the installation as this post is already long enough. And I'm not the strongest Linux person but I hope this helps someone.
- Edited
Sort of. You might take a look at the MollySocket Fly.io Service: https://github.com/pcrockett/mollysocket-fly
This might shortcut some of the steps you'd undoubtedly have to perform if you setup your own server as I've detailed above. But since I don't use it I couldn't really tell you too much more about it. YMMV.
yore there is molly.adminforge.de
Hi, thank you for this tutorial !!
When I run the command cargo install mollysocket
l I’m stuck with this error :
error: could not compile `rocket` (lib)
Caused by:
process didn't exit successfully: `rustc --crate-name rocket --edition=2021 /opt/mollysocket/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rocket-0.5.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=146 --crate-type lib --emit=dep-info,metadata,link -C opt-level=s -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="default"' --cfg 'feature="http2"' --cfg 'feature="json"' --cfg 'feature="serde_json"' -C metadata=8facc7c49fb5d813 -C extra-filename=-8facc7c49fb5d813 --out-dir /tmp/cargo-installM7QGmP/release/deps -C strip=symbols -L dependency=/tmp/cargo-installM7QGmP/release/deps --extern async_stream=/tmp/cargo-installM7QGmP/release/deps/libasync_stream-765b54c384a1fd33.rmeta --extern async_trait=/tmp/cargo-installM7QGmP/release/deps/libasync_trait-3cb037c0398a702f.so --extern atomic=/tmp/cargo-installM7QGmP/release/deps/libatomic-b38fc79ac614441e.rmeta --extern binascii=/tmp/cargo-installM7QGmP/release/deps/libbinascii-a6da8236ec011398.rmeta --extern bytes=/tmp/cargo-installM7QGmP/release/deps/libbytes-253a1b5623a34275.rmeta --extern either=/tmp/cargo-installM7QGmP/release/deps/libeither-22b429810b1fae34.rmeta --extern figment=/tmp/cargo-installM7QGmP/release/deps/libfigment-02c85fdfca4b4518.rmeta --extern futures=/tmp/cargo-installM7QGmP/release/deps/libfutures-74709cc336d845d8.rmeta --extern indexmap=/tmp/cargo-installM7QGmP/release/deps/libindexmap-7ea229ac91fb8bd0.rmeta --extern log=/tmp/cargo-installM7QGmP/release/deps/liblog-84a09634f6079297.rmeta --extern memchr=/tmp/cargo-installM7QGmP/release/deps/libmemchr-914fa3a4b9fe7c47.rmeta --extern multer=/tmp/cargo-installM7QGmP/release/deps/libmulter-e20bf6d522ab40d1.rmeta --extern num_cpus=/tmp/cargo-installM7QGmP/release/deps/libnum_cpus-a6102e23e772d3bf.rmeta --extern parking_lot=/tmp/cargo-installM7QGmP/release/deps/libparking_lot-929cab0229d8ae83.rmeta --extern pin_project_lite=/tmp/cargo-installM7QGmP/release/deps/libpin_project_lite-83171d66fc4134bd.rmeta --extern rand=/tmp/cargo-installM7QGmP/release/deps/librand-6f2330679db85709.rmeta --extern ref_cast=/tmp/cargo-installM7QGmP/release/deps/libref_cast-3b89ac4a0dbcc318.rmeta --extern rocket_codegen=/tmp/cargo-installM7QGmP/release/deps/librocket_codegen-30b006903b8e4288.so --extern rocket_http=/tmp/cargo-installM7QGmP/release/deps/librocket_http-afee4c0a97bfee88.rmeta --extern serde=/tmp/cargo-installM7QGmP/release/deps/libserde-bf6ad016b6283aae.rmeta --extern serde_json=/tmp/cargo-installM7QGmP/release/deps/libserde_json-e91a6508b33f52f2.rmeta --extern state=/tmp/cargo-installM7QGmP/release/deps/libstate-2473f2f77a849772.rmeta --extern tempfile=/tmp/cargo-installM7QGmP/release/deps/libtempfile-6e2f4c445fc3d245.rmeta --extern time=/tmp/cargo-installM7QGmP/release/deps/libtime-bfbe505885cd1cdb.rmeta --extern tokio=/tmp/cargo-installM7QGmP/release/deps/libtokio-e1e430b5983e9d4e.rmeta --extern tokio_stream=/tmp/cargo-installM7QGmP/release/deps/libtokio_stream-8d9e9eb1331d5c0b.rmeta --extern tokio_util=/tmp/cargo-installM7QGmP/release/deps/libtokio_util-b8c36ec4d65c3a65.rmeta --extern ubyte=/tmp/cargo-installM7QGmP/release/deps/libubyte-cb5dc70844299151.rmeta --extern yansi=/tmp/cargo-installM7QGmP/release/deps/libyansi-700f36e0a1834d88.rmeta --cap-lints allow` (signal: 9, SIGKILL: kill)
error: failed to compile `mollysocket v1.6.0`, intermediate artifacts can be found at `/tmp/cargo-installM7QGmP`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Ubuntu 22 LTS
I don’t know how to solve it.
Perhaps anyone of you has an idea ?
Thx !!
Yes it’s possible I run it on a small vps.
I’m now trying to get it work with a docker-compose but I’m very new to docker and i didn’t find a detailed tutorial for mollysocket
I run both ntfy and mollysocket in an Alpine LXC container on top of Proxmox. It works very good. I do not use Docker, I download the precompiled mollysocket binary (musl) from Github and update it manually from now on. I can probably make a script that checks for updates periodically and downloads the new binary when it updates. For ntfy I use the Alpine package repositories.
I have mollysocket air gapped and it have been working flawlessly. Calls and messages have never been missed.
I have ntfy behind a nginx reverse proxy run in a Alpine VM also on Proxmox. I use my self-hosted ntfy server for all my apps that support UnifiedPush and all of them works without issues.
I would like to use hardened_malloc for my nginx VM but I haven't yet gotten it to work. Hardened_malloc is in the Alpine testing repositories. If anyone can give me a clue how to get it to run I would greatly appreciate it.