{"id":30034370,"url":"https://github.com/sapphosys/mullvadcord","last_synced_at":"2025-08-13T06:00:48.764Z","repository":{"id":308587023,"uuid":"1033362809","full_name":"SapphoSys/mullvadcord","owner":"SapphoSys","description":"🔑 Control your devices for the Tailscale Mullvad VPN add-on with a Discord bot. Hosted with Cloudflare Workers.","archived":false,"fork":false,"pushed_at":"2025-08-06T17:44:12.000Z","size":78,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-06T19:28:12.033Z","etag":null,"topics":["discord","hono","mullvad","tailscale"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/SapphoSys.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,"zenodo":null},"funding":{"ko_fi":"solelychloe"}},"created_at":"2025-08-06T17:39:44.000Z","updated_at":"2025-08-06T18:30:57.000Z","dependencies_parsed_at":"2025-08-06T19:28:21.311Z","dependency_job_id":"45ea78bc-3e0e-4493-b159-f86e855edce0","html_url":"https://github.com/SapphoSys/mullvadcord","commit_stats":null,"previous_names":["sapphosys/mullvadcord"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SapphoSys/mullvadcord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SapphoSys%2Fmullvadcord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SapphoSys%2Fmullvadcord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SapphoSys%2Fmullvadcord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SapphoSys%2Fmullvadcord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SapphoSys","download_url":"https://codeload.github.com/SapphoSys/mullvadcord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SapphoSys%2Fmullvadcord/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269176081,"owners_count":24373088,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discord","hono","mullvad","tailscale"],"created_at":"2025-08-06T23:47:01.419Z","updated_at":"2025-08-06T23:47:07.066Z","avatar_url":"https://github.com/SapphoSys.png","language":"TypeScript","funding_links":["https://ko-fi.com/solelychloe"],"categories":[],"sub_categories":[],"readme":"# mullvadcord\nControl your devices for the Tailscale Mullvad VPN add-on with a Discord bot.\n\nHosted with Cloudflare Workers.\n\n## Why?\n1) Why not?\n2) The mobile app for Tailscale didn't really have a way to add / remove devices to the Mullvad VPN add-on, and we were too lazy to have to log in to the Tailscale dashboard.\n\n## Prerequisites\nThis project assumes the following:\n- You have `pnpm` installed ([install here](https://pnpm.io))\n- You have a [Cloudflare account](https://cloudflare.com) (registering one is free!)\n- You have a [Tailscale account](https://tailscale.com) (registering one is free!)\n- You have a subscription for the [Tailscale Mullvad VPN add-on](https://login.tailscale.com/admin/settings/general/mullvad)\n\n## Commands\n- `/mullvad-add device:\u003cdevice\u003e`: Adds a device from your tailnet to the Tailscale Mullvad VPN add-on. The device names and IP addresses have autocomplete.\n- `/mullvad-remove device:\u003cdevice\u003e`: Removes a device from your tailnet to Tailscale Mullvad VPN add-on. The device names and IP addresses have autocomplete.\n- `/mullvad-list`: Lists all devices which have the `mullvad` node attribute.\n\n## Setting up the project\n### 0. Initial setup\n- Rename the `.dev.vars.example` file to `.dev.vars`.\n- Run the `pnpm install` command on your terminal to install dependencies.\n\n### 1. Creating a Discord application\nCreate a Discord application in the [Discord Developer Portal](https://discord.com/developers/applications).\n  - Copy the Application ID and Public Key values in the **General Information** tab.\n  - Fill in the `DISCORD_APPLICATION_ID` and `DISCORD_PUBLIC_KEY` environment variables accordingly in the `.dev.vars` file.\n  - Copy the token value in the **Bot** tab.\n  - Fill in the `DISCORD_TOKEN` environment variable with the token value in the `.dev.vars` file.\n\n### 2. Creating a Tailscale application\nGo to your [Tailscale dashboard](https://login.tailscale.com/admin/machines), click on the Settings tab, and navigate to **OAuth clients**.\n  - Click on the \"Generate OAuth client...\" button.\n  - Optional, but recommended: add a description. This will distinguish it among the other OAuth clients you might have already created.\n  - The bot requires **Read** and **Write** permissions for **Policy File** in order to make changes to your Access Controls file, so select those.\n  - We only need the \"Client secret\" part. Paste the value for the `TAILSCALE_CLIENT_SECRET` environment variable in the `.dev.vars` file.\n\n### 3. Creating a Cloudflare KV namespace\nWe need to create a Cloudflare KV namespace. This will be used to cache the Tailscale API token, so we don't hit a ratelimit. \n\nTo do that, use the following instructions:\n  - Log in to your Cloudflare account by running the `pnpm wrangler login` command in your terminal.\n  - Afterwards, run the `pnpm wrangler kv namespace create \u003cnamespace\u003e` command in your terminal.\n  - Specify a unique name. For example, something like `tailscale-kv`. (`pnpm wrangler kv namespace create tailscale-kv`)\n  - Copy the `kv_namespaces` codeblock that the `wrangler kv` command returned, and replace the existing `kv_namespaces` property in the `wrangler.jsonc` file.\n\n### 4. Inviting the bot\nInvite the bot by either:\n  - going your application's page in [Discord Developer Portal](https://discord.com/developers/applications), navigating to the \"Installation\" tab and copying the \"Install Link\" URL\n  - or using the following link: `https://discord.com/oauth2/authorize?client_id=\u003cyour bot's client ID\u003e`, and replacing `\u003cyour bot's client ID\u003e` with the `DISCORD_APPLICATION_ID` environment variable in the `.dev.vars` file.\n\n### 5. Registering Discord commands\n  - Optional, but highly recommended: fill in the `DISCORD_GUILD_ID` environment value in the `.dev.vars` file with the ID of your, preferably, private Discord server to restrict commands to only run in said server.\n  - Run the `pnpm register` command in your terminal to sync your bot's slash commands against the Discord API.\n\n**By default, the commands are public, meaning anyone can execute them.** \n\nIf you don't want this behavior, go to your server -\u003e Settings -\u003e Integrations, then find your application. There, you'll find an overview of the permissions for commands. Modify this as you wish. (for example, restricting commands to a specific user/role)\n\n### 6. Uploading secrets to Cloudflare Workers\n  - Run the `pnpm wrangler bulk .dev.vars` command in your terminal to create secrets to your Cloudflare Worker.\n  - Wrangler might prompt you about the following message: `There doesn't seem to be a Worker called \"mullvadcord\". Do you want to create a new Worker with that name and add secrets to it?`. Just click Enter / respond with the \"Y\" key on your keyboard. \n  - This will create a Cloudflare Worker with the name `mullvadcord`, and add secrets from the `.dev.vars` file. If you want to change the name of your Worker, edit the `name` property in the `wrangler.jsonc` file.\n\n### 7. Deploying the bot\n  - Run the `pnpm push` command in your terminal. This might take a couple of seconds.\n  - You should see a URL like `https://mullvadcord.chloe.workers.dev`.\n  - Go to your application's page in the [Discord Developer Portal](https://discord.com/developers/applications), and paste the full `.workers.dev` URL that the `pnpm push` command returned in the \"Interactions Endpoint URL\" input field.\n\nThat's it! Your bot is now up and running.\n\n## License\nThis repository is licensed under the [MIT](LICENSE) license.\n\n© 2025 Sapphic Angels.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapphosys%2Fmullvadcord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapphosys%2Fmullvadcord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapphosys%2Fmullvadcord/lists"}