### Install MollySocket via Crates.io Source: https://github.com/mollyim/mollysocket/blob/main/README.md Use this command to install MollySocket using Cargo. Refer to INSTALL.md for detailed setup instructions. ```bash cargo install mollysocket ``` -------------------------------- ### Install MollySocket via Docker Source: https://github.com/mollyim/mollysocket/blob/main/README.md Use this command to pull the latest MollySocket Docker image. ```bash docker pull ghcr.io/mollyim/mollysocket:latest ``` -------------------------------- ### Configure VAPID Key in Systemd Service Source: https://github.com/mollyim/mollysocket/blob/main/README.md Example of how to set the VAPID private key directly in a systemd service unit file using an environment variable. The key file takes precedence if both are provided. ```ini [Service] Environment=MOLLY_VAPID_PRIVKEY=DSqYuWchrB6yIMYJtidvqANeRQic4uWy34afzZRsZnI ``` -------------------------------- ### Install MollySocket using Cargo Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Installs MollySocket from source using Cargo, the Rust package manager. Ensure you have Rust 1.59+ and necessary development packages like libssl-dev and libsqlite3-dev installed. ```bash cargo install mollysocket ``` ```bash cp ~/.cargo/bin/mollysocket /usr/local/bin/ms ``` -------------------------------- ### Decrypt VAPID Key with systemd-creds Source: https://github.com/mollyim/mollysocket/blob/main/README.md This example demonstrates how to decrypt an encrypted VAPID key using the systemd-creds tool. Ensure the 'cipher.cred' file contains the encrypted key. ```bash # cat cipher.cred k6iUCUh0RJCQyvL8k8q1UyAAAAABAAAADAAAABAAAAC1lFmbWAqWZ8dCCQkAAAAAgAAAA AAAAAALACMA0AAAACAAAAAAfgAg9uNpGmj8LL2nHE0ixcycvM3XkpOCaf+9rwGscwmqRJ cAEO24kB08FMtd/hfkZBX8PqoHd/yPTzRxJQBoBsvo9VqolKdy9Wkvih0HQnQ6NkTKEdP HQ08+x8sv5sr+Mkv4ubp3YT1Jvv7CIPCbNhFtag1n5y9J7bTOKt2SQwBOAAgACwAAABIA ID8H3RbsT7rIBH02CIgm/Gv1ukSXO3DMHmVQkDG0wEciABAAII6LvrmL60uEZcp5qnEkx SuhUjsDoXrJs0rfSWX4QAx5PwfdFuxPusgE== # systemd-creds decrypt ms_vapid DSqYuWchrB6yIMYJtidvqANeRQic4uWy34afzZRsZnI ``` -------------------------------- ### Generate VAPID Key with Docker Compose Source: https://github.com/mollyim/mollysocket/blob/main/README.md Generate a VAPID key using Docker Compose. This is a convenient way to manage keys when using Docker. ```bash docker compose run mollysocket vapid gen ``` -------------------------------- ### Create Dedicated User for MollySocket Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Creates a dedicated system user for running the MollySocket service. The -M flag prevents the creation of a home directory. ```bash # useradd mollysocket -M ``` -------------------------------- ### Restart and Check MollySocket Service Source: https://github.com/mollyim/mollysocket/blob/main/README.md Use these commands to restart the MollySocket service and view its logs. This is often necessary after configuration changes and should display a QR code if webserver is enabled. ```bash # systemctl restart mollysocket # journalctl -u mollysocket # # This should show a QR code ``` -------------------------------- ### Register MollySocket Connection Source: https://github.com/mollyim/mollysocket/blob/main/README.md Use these commands to register your account with the MollySocket server, especially in air-gapped mode. Replace placeholder parameters with your actual account details. ```console $ # If you use docker-compose: docker compose run mollysocket $ # Else, if you use the binary: mollysocket ``` -------------------------------- ### Generate VAPID Key Source: https://github.com/mollyim/mollysocket/blob/main/README.md Use this command to generate a new VAPID key for authorizing the MollySocket server to send requests to your push server. ```bash mollysocket vapid gen ``` -------------------------------- ### Add MollySocket Connection in Air-gapped Mode Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Adds a new connection to MollySocket in air-gapped mode. This command should be run on the server as the 'mollysocket' user with the correct configuration path. ```bash sudo -su mollysocket MOLLY_CONF=/etc/mollysocket/conf.toml /usr/local/bin/ms connection add baab32b9-d60b-4c39-9e14-15d8f6e1527e 2 thisisrandom 'https://push.mydomain.tld/upthisisrandom?up' ``` -------------------------------- ### Decrypt VAPID Private Key Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Decrypts the VAPID private key stored by systemd-creds. This command is used for backing up the private key. ```bash # systemd-creds decrypt /etc/mollysocket/vapid.key ``` -------------------------------- ### Restart MollySocket Service and Check Logs Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Restarts the MollySocket systemd service and then checks its logs using journalctl. This is useful for verifying configuration changes or troubleshooting. ```bash # systemctl restart mollysocket ``` ```bash # journalctl -u mollysocket ``` -------------------------------- ### Nginx Proxy Configuration Source: https://github.com/mollyim/mollysocket/blob/main/INSTALL.md Configures Nginx to proxy requests to the MollySocket service running on localhost:8020. It forwards the Host header and the original URL. ```nginx location / { proxy_pass http://127.0.0.1:8020/; proxy_set_header Host $host; proxy_set_header X-Original-URL $uri; } ``` -------------------------------- ### Nginx Reverse Proxy Configuration Source: https://github.com/mollyim/mollysocket/blob/main/README.md Configure your Nginx reverse proxy to correctly pass the original Host and URL to MollySocket. This is crucial when MollySocket is not exposed on the root of your domain. ```nginx # change to /molly/ if you don't expose it on the root of your domain location / { proxy_pass http://127.0.0.1:8020/; proxy_set_header Host $host; proxy_set_header X-Original-URL $uri; } ``` -------------------------------- ### Ping MollySocket Connection Source: https://github.com/mollyim/mollysocket/blob/main/README.md Send a ping to check if MollySocket is correctly registered and can communicate with your account. This is useful for diagnosing issues when notifications are not received. Replace the UUID with your actual account ID. ```console $ # Replace the UUID with your account Id $ # If you use docker-compose: docker compose run mollysocket connection ping c8d44128-5c99-4810-a7d3-71c079891c27 $ # Else, if you use the binary: mollysocket connection ping c8d44128-5c99-4810-a7d3-71c079891c27 ``` ```console $ # Replace the UUID with your account Id $ # If you use docker-compose: docker compose run mollysocket mollysocket connection ping c8d44128-5c99-4810-a7d3-71c079891c27 $ # Else, if you use the binary: mollysocket connection ping c8d44128-5c99-4810-a7d3-71c079891c27 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.