MollySocket allows getting signal notifications via UnifiedPush.

Overview

MollySocket

This software is still in alpha.

MollySocket allows getting signal notifications via UnifiedPush. It works like a linked device, which doesn't have encryption key, connected to the Signal server. Everytime it receives an encrypted event, it notifies your mobile via UnifiedPush.

Status

This is still in alpha.

Review of the server code is welcomed.

The associated pull request for Molly (android) can be found here: mollyim/mollyim-android#152.

We are currently testing it and the efficiency of the different strategy. Your feedback is welcome here: #1.

Configuration

  • MollySocket web server does not provide TLS. It should be accessible behind a reverse proxy. It is possible to use MollySocket without the web server: see the Air Gaped mode on Android settings.

Environment

  • Use the environment variable ROCKET_PORT to change the port used by the webserver.
  • Use the environment variable MOLLY_CONF to change the path to the configuration file.
  • Use the environment variable RUST_LOG to change the log level.

Configuration file

  • You can allow registration for all accounts by setting allowed_uuids to ['*']. Else set your account ids in the array: ['account_id1','account_id2'].
  • You can allow all endpoints by adding * to allowed_endpoints (for instance ['*']). Else you can add the allowed endpoints in the array: ['https://dom1.tld','https//dom2.tld:4443]. Note that endpoints on your local network must be allowed explicitly
  • You can specify the db path in the db setting.

Android

  • If MollySocket webserver is not accessible from the Internet, you can enable the Air Gaped mode. You will have to register your connection manually on MollySocket.
  • There are 2 different fetch strategies:
    • REST: Every time MollySocket receives a(n encrypted) data : it notifies Molly via UnifiedPush and Molly fetch using the rest strategy (that's a built-in strategy)
    • Websocket: Every time MollySocket receives a(n encrypted) data : it notifies Molly via UnifiedPush if it hasn't notified the last 5 seconds. Then Molly open the websocket for 20secs. This strategy avoid to reach some rate limit for some public provider such as https://ntfy.sh but may increase a little bit the battery drain.

Build

Until is_global is stabilize (rust-lang/rust#27709), it requires rust nightly to be compiled.

License

AGPLv3: see LICENSE.txt.

Disclaimer

This project is NOT sponsored by or affiliated to Signal Messenger, Signal Foundation or the Molly project (*).

The software is produced independently of Signal and carries no guarantee about quality, security or anything else. Use at your own risk.

* But they are ok with name "MollySocket"

Comments
  • Deployment in Kubernetes (and build an image for it)

    Deployment in Kubernetes (and build an image for it)

    • Container image
      • for me only a debian based image works (distroless has no library for sqlite + alpine segfaulted on running -> as comment below, how i build an image)
      • CI: will upload in githubs registry
    • Helm Chart
      • is an default way to deploy in Kubernetise
      • CI: will generate automaticaly new version (git-tag) and publish in gh-pages / github page (maybe in an extra repo because of auto tagging ...)
      • i will add an ServiceMonitor and maybe an Grafana-Dashboard after #3
    opened by genofire 7
  • Howto compile

    Howto compile

    I try to create an container image and got this error during compiling:

    cargo build --release --bin mollysocket:
    #10 270.9 
    #10 271.0 error[E0554]: `#![feature]` may not be used on the stable release channel
    #10 271.0  --> src/main.rs:1:12
    #10 271.0   |
    #10 271.0 1 | #![feature(ip)]
    
    opened by genofire 2
  • fix(ci): camelcase in project name

    fix(ci): camelcase in project name

    • Changing my fork name into one with CamelCase
    • testing fix with Action-Run: https://github.com/genofire/MollySocket/actions/runs/3618174553/jobs/6097728653
    opened by genofire 0
  • Add prometheus support

    Add prometheus support

    fixes #3

    Add also custom Metric:

    # HELP mollysocket_up Is Mollysocket ready
    # TYPE mollysocket_up gauge
    mollysocket_up{version="0.1.0"} 1
    # HELP mollysocket_signal_connected Connected to signal
    # TYPE mollysocket_signal_connected gauge
    mollysocket_signal_connected{type="Websocket",uuid="43db7325-37f9-4183-a614-9f0d4a02b142"} 1
    

    Add default rocket metric endpoints (for find slow endpoint / path) - Rename metrics with ENV-Variable ROCKET_PROMETHEUS_NAMESPACE (default rocket) from rocket_* to mollysocket_* is possible:

    # HELP rocket_http_requests_duration_seconds HTTP request duration in seconds for all requests
    # TYPE rocket_http_requests_duration_seconds histogram
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.005"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.01"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.025"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.05"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.1"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.25"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="0.5"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="1"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="2.5"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="5"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="10"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="GET",status="200",le="+Inf"} 31
    rocket_http_requests_duration_seconds_sum{endpoint="/",method="GET",status="200"} 0.0038883740000000004
    rocket_http_requests_duration_seconds_count{endpoint="/",method="GET",status="200"} 31
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.005"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.01"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.025"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.05"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.1"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.25"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="0.5"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="1"} 6
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="2.5"} 7
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="5"} 7
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="10"} 7
    rocket_http_requests_duration_seconds_bucket{endpoint="/",method="POST",status="200",le="+Inf"} 7
    rocket_http_requests_duration_seconds_sum{endpoint="/",method="POST",status="200"} 2.928642397
    rocket_http_requests_duration_seconds_count{endpoint="/",method="POST",status="200"} 7
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.005"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.01"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.025"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.05"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.1"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.25"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="0.5"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="1"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="2.5"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="5"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="10"} 5
    rocket_http_requests_duration_seconds_bucket{endpoint="/metrics",method="GET",status="200",le="+Inf"} 5
    rocket_http_requests_duration_seconds_sum{endpoint="/metrics",method="GET",status="200"} 0.001272728
    rocket_http_requests_duration_seconds_count{endpoint="/metrics",method="GET",status="200"} 5
    # HELP rocket_http_requests_total Total number of HTTP requests
    # TYPE rocket_http_requests_total counter
    rocket_http_requests_total{endpoint="/",method="GET",status="200"} 31
    rocket_http_requests_total{endpoint="/",method="POST",status="200"} 7
    rocket_http_requests_total{endpoint="/metrics",method="GET",status="200"} 5
    
    opened by genofire 3
  • Add metrics endpoint

    Add metrics endpoint

    to would be nice to have metrics for monitoring/alerting that mollysocket works correct.

    An nice library is https://docs.rs/rocket_prometheus/0.10.0-rc.3/rocket_prometheus/index.html.

    therefore it would be nice to have an prometheus / openmetric endpoint with gauge and counter like:

    # HELP state is websocket connected
    # gauge mollysocket_websocket_connected
    mollysocket_websocket_connected{uuid="A",endpoint="https://ntfy.sum7.eu"} 1
    mollysocket_websocket_connected{uuid="B",endpoint="https://ntfy.sh"} 0
    # HELP counter of how man reconnect happen
    # counter mollysocket_websocket_reconnect
    mollysocket_websocket_reconnect{uuid="A",endpoint="https://ntfy.sum7.eu"} 3
    mollysocket_websocket_reconnect{uuid="B",endpoint="https://ntfy.sh"} 1
    

    Alternative

    if you do not like to have metrics labels by there uuid (and endpoint), it woukd be nice to have also an counter for not_connected.

    # HELP current count of connected websocket
    # gauge mollysocket_websocket_connected
    mollysocket_websocket_connected 1
    # HELP current count of not connected websocket
    # gauge mollysocket_websocket_not_connected
    mollysocket_websocket_not_connected 1
    # HELP counter of how man reconnect happen
    # counter mollysocket_websocket_reconnect
    mollysocket_websocket_reconnect 3
    

    other metrics like who many pings are active (and counter for failed) or so would be also nice

    also an up with labels like version (and the value is calced e.g. 1=if database is accessible and so on 0=there is an problem:

    mollysocket_up{version="0.1.0"} 1
    
    opened by genofire 0
  • Alpha tests

    Alpha tests

    Please use the following template to provide efficiency feedback.

    Several different factors can play a role in battery consumption. But we may get a good idea with many feedback. The objective is to compare FCM/background socket/unifiedpush with websocket strategy/unifiedpush with rest strategy.

    Please not that the REST Strategy may reach rate limit on some public provider such as https://ntfy.sh.

    * Your phone model:
    * Your phone model's [don't kill my app](https://dontkillmyapp.com/) score:
    * Operating System Version:
    * MollySocket Version/commit:
    * Molly (andoid) Version/commit:
    * Molly (andoid) battery optimized (yes/no):
    * UnifiedPush Distributor: (eg. ntfy/NextPush)
    * Public server (yes/no): (eg. yes: https://ntfy.sh)
    * Fetch Strategy (rest/websocket):
    * Molly use time:
    * Average battery consumption (molly / phone / duration): (eg. molly: 8%, phone: 70%, duration: 25h)
    * Previous notification strategy (background socket/FCM):
    * Missing notifications (no/one or two/a lot):
    * Previous average battery consumption:
    * Battery drain reduced/increase (how much):
    * Anything else:
    opened by p1gp1g 2
Releases(0.1.0)
Owner
null
A thread-safe signal/slot library based on boost::signals2

About signals2 is a thread-safe signal/slot library based on the boost::signals2 C++ library. Signals are objects that contain a list of callback func

Christian Daley 15 Dec 21, 2022
A CLI tool for getting screenshots of URLs using headless chrome

rustywitness ?? ?? ?? Web screenshot utility A CLI tool for getting screenshots of URLs using headless chrome Built with ❤︎ by swanandx and contributo

Swanand Mulay 16 Jan 3, 2023
Reading Getting Friendly With CPU Caches

Getting Friendly With CPU Caches Reading Getting Friendly With CPU Caches, by Miki Tebeka and William Kennedy, inspired me to look at some Rust equiva

Herbert 6 Jul 25, 2023
Cross-platform GameMaker extension for getting system information and resource usage

GM Sysinfo Cross-platform GameMaker extension for getting system information and resource usage Table of Contents Table of Contents Examples Display m

SpikeHD 3 Dec 1, 2023
Simple, cross-platform GameMaker lib for getting file metadata

File Metadata Tiny baby library for getting file metadata. Originally written to work for a GameMaker game a friend is creating. Table of Contents Ins

SpikeHD 3 Nov 28, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024
❗️ Small script to view GitHub notifications in the terminal

github-notifications Small script to view GitHub notifications in the terminal Shows and color-codes the notification source, eg if you're the owner o

Brian Shaginaw 1 Jan 10, 2022
macOS Sleep / Wake notifications

mac-power-monitor Inspiration from: prashantgupta24/mac-sleep-notifier Install pnpm add @oomol-lab/mac-power-monitor # or npm install @oomol-lab/mac-p

null 9 Oct 27, 2023
Cli tool for git productivity written in Rust and packaged for consumption via NPM

crust ?? cli tool for git productivity written in Rust and packaged for consumption via NPM This repo is identical with @skyneticist/golee in terms of

null 2 Jul 30, 2022
Terminal text styling via ANSI escape sequences.

Iridescent Features iridescent is a library for styling terminal text easily. It supports basic ANSI sequences, Xterm-256 colors, and RGB. You can ope

Rob 2 Oct 20, 2022
A tool to control the fan speed by monitoring the temperature of CPU via IPMI.

ipmi-fan-control A tool to control the fan speed by monitoring the temperature of CPU via IPMI. Why Our Dell R730 server's iDRAC is not works as expec

yinheli 9 Dec 29, 2022
Small microservice to render Lottie animation files via an http REST API.

Lottie Renderer Service Small microservice to render Lottie animation files via an http REST API. Run via docker docker run -p 8080:8080 ghcr.io/mikbo

Mikbot 3 Oct 22, 2022
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
🚀 A fast & easy way to interface w/ Farcaster.xyz via Rust 🦀

farcaster-rs ?? A simple & easy way to interface with Farcaster via Rust ?? Author: Landon Boles GitHub | Farcaster | Bird App Credits MistApproach To

Landon 29 Dec 15, 2022
Reflection via DWARF.

deflect [EXPERIMENTAL] Deflect brings reflection to Rust using DWARF debug info. Deflect can be used to recover the concrete types of trait objects, i

Jack Wrenn 206 Jan 5, 2023
Process Injection via Component Object Model (COM) IRundown::DoCallback().

COM PROCESS INJECTION for RUST Process Injection via Component Object Model (COM) IRundown::DoCallback(). 该技术由 @modexpblog 挖掘发现,在我对该技术进行深入研究过程中,将原项目 m

Lane 7 Jan 20, 2023
A library and binary for testing unhooking ntdll by identifying hooks via in-memory disassembly

(First Public?) Sample of unhooking ntdll (All Exports & IAT imports) hooks in Rust using in-memory disassembly, avoiding direct syscalls and all hooked functions (incl. hooked NtProtectVirtualMemory)

Signal Labs 52 Apr 9, 2023
CLI utility that screencaptures your Linux desktop and streams it to Kodi via UPNP/DLNA and RTSP

desktopcast Desktopcast is a little CLI application that allows you to cast your Linux desktop to any UPNP/DLNA device capable of the AVTransfer servi

Markus Ebner 25 Apr 16, 2023
Choose Rust types at compile-time via boolean constants

condtype Choose Rust types at compile-time via boolean constants, brought to you by Nikolai Vazquez. If you find this library useful, consider starrin

Nikolai Vazquez 36 May 8, 2023