{"id":17650029,"url":"https://github.com/alfiosalanitri/wireguard-client-connection-notification","last_synced_at":"2025-06-13T15:11:43.191Z","repository":{"id":38395875,"uuid":"371658237","full_name":"alfiosalanitri/wireguard-client-connection-notification","owner":"alfiosalanitri","description":"Receive notifications via Telegram or Gotify whenever a client connects or disconnects from a WireGuard tunnel.","archived":false,"fork":false,"pushed_at":"2025-02-14T23:23:01.000Z","size":23,"stargazers_count":52,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T09:50:21.048Z","etag":null,"topics":["bash-script","gotify","telegram-api","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alfiosalanitri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-28T10:03:44.000Z","updated_at":"2025-04-08T20:46:01.000Z","dependencies_parsed_at":"2024-11-15T07:04:44.168Z","dependency_job_id":"d3848b73-dbaf-47c0-b2f9-2f03a9c667e9","html_url":"https://github.com/alfiosalanitri/wireguard-client-connection-notification","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":0.3939393939393939,"last_synced_commit":"f5d6de400bec137b2304f5a99d03a78acda0d8ae"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alfiosalanitri/wireguard-client-connection-notification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfiosalanitri%2Fwireguard-client-connection-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfiosalanitri%2Fwireguard-client-connection-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfiosalanitri%2Fwireguard-client-connection-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfiosalanitri%2Fwireguard-client-connection-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfiosalanitri","download_url":"https://codeload.github.com/alfiosalanitri/wireguard-client-connection-notification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfiosalanitri%2Fwireguard-client-connection-notification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259668700,"owners_count":22893134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","gotify","telegram-api","wireguard"],"created_at":"2024-10-23T11:34:48.569Z","updated_at":"2025-06-13T15:11:43.160Z","avatar_url":"https://github.com/alfiosalanitri.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WireGuard Client Connection Notification\n\nReceive notifications via Telegram or Gotify whenever a client connects or disconnects from a WireGuard tunnel.\n\n## Installation and Setup\n\nFollow these steps to set up the notification service on your WireGuard server.\n\n### 1. Clone the Repository\n\nStart by cloning this repository onto your server:\n\n```bash\ngit clone https://github.com/yourusername/wireguard-client-connection-notification.git\n```\n\n### 2. Configure the Service\n\n1. Rename the configuration file template:\n\n   ```bash\n   mv .config-example .config\n   ```\n\n2. Edit the `.config` file to include your notification settings. Make sure to configure either Telegram or Gotify server details.\n\n### 3. Set Up Permissions and Schedule the Script\n\n1. Grant execution permissions to the main script:\n\n   ```bash\n   sudo chmod +x /path/to/wireguard-client-connection-notification/wg-clients-guardian.sh\n   ```\n\n2. Add the script to the root user's cron job to run it periodically. Elevated privileges are required to access WireGuard tunnel information.\n\n   - Open the root crontab editor:\n\n     ```bash\n     sudo crontab -e\n     ```\n\n   - Add the following line to execute the script every minute:\n\n     ```bash\n     * * * * * cd /path/to/wireguard-client-connection-notification \u0026\u0026 /path/to/wireguard-client-connection-notification/wg-clients-guardian.sh /path/to/wireguard-client-connection-notification/.config \u003e /dev/null 2\u003e\u00261\n     ```\n\n### 4. Start Receiving Notifications\n\nOnce everything is set up, the script will check for client connections or disconnections every minute and send a notification through your configured method.\n\n## Acknowledgements\n\nThis project was inspired by and built upon the work done by the [PiVPN](https://github.com/pivpn/pivpn) project. Special thanks to the PiVPN team for their `clientSTAT.sh` script, which served as a foundation for understanding and managing WireGuard client connections. You can find the original script [here](https://github.com/pivpn/pivpn/blob/master/scripts/wireguard/clientSTAT.sh).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfiosalanitri%2Fwireguard-client-connection-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfiosalanitri%2Fwireguard-client-connection-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfiosalanitri%2Fwireguard-client-connection-notification/lists"}