|
| 1 | +# Proxmox Setup with tsidp |
| 2 | + |
| 3 | +This section covers: |
| 4 | +- Deploying tsidp in a Docker container within a Linux Container (LXC) |
| 5 | +- Configuring Proxmox to use tsidp for authentication |
| 6 | + |
| 7 | +## Deploy tsidp in Docker within an LXC |
| 8 | + |
| 9 | +### Prerequisites |
| 10 | + |
| 11 | +Before starting, download an LXC template: |
| 12 | +- See the [Proxmox Linux Container documentation](https://pve.proxmox.com/wiki/Linux_Container) for details |
| 13 | +- For video guidance, see [this tutorial](https://www.youtube.com/watch?v=iIfRchzYSzM&t=300s) by [Christian Lempa](https://www.youtube.com/@christianlempa) |
| 14 | +- This guide uses `alpine-3.21-default_20241217_amd64.tar.xz`, though other templates should work |
| 15 | + |
| 16 | +### Create the LXC |
| 17 | + |
| 18 | +1. **Log in to Proxmox** and create a new LXC (we'll name it `tsidp-lxc`, but any name works) |
| 19 | + |
| 20 | +  |
| 21 | + |
| 22 | +2. **Configure the container** with these settings: |
| 23 | + - **General** |
| 24 | + - ✅ Enable "Unprivileged container" |
| 25 | + - ✅ Enable "Nesting" (required for Docker) |
| 26 | + - **Template** |
| 27 | + - Select `alpine-3.21-default_20241217_amd64.tar.xz` |
| 28 | + - **Disks** |
| 29 | + - Disk size: 4 GiB |
| 30 | + - **CPU** |
| 31 | + - Cores: 1 |
| 32 | + - **Memory** |
| 33 | + - Memory: 512 MiB |
| 34 | + - Swap: 512 MiB |
| 35 | + - **Network** |
| 36 | + - Use default settings |
| 37 | + - **DNS** |
| 38 | + - Use default settings |
| 39 | + - **Confirm** |
| 40 | + - ✅ Enable "Start after created" |
| 41 | + - Click "Finish" |
| 42 | + |
| 43 | + > **Note**: We're not enabling `keyctl=1` as tsidp doesn't use Docker secrets. |
| 44 | +
|
| 45 | +### Set Up Docker and tsidp |
| 46 | + |
| 47 | +1. **Access the container console** in Proxmox |
| 48 | + - Log in as `root` with the password you specified |
| 49 | + |
| 50 | +2. **Update packages and install dependencies** |
| 51 | + ```bash |
| 52 | + apk update |
| 53 | + apk add docker git |
| 54 | + ``` |
| 55 | + |
| 56 | +3. **Start and enable Docker** |
| 57 | + ```bash |
| 58 | + rc-service docker start |
| 59 | + rc-update add docker boot |
| 60 | + ``` |
| 61 | + > You may see warnings, but should see `* Starting Docker Daemon ... [ ok ]` |
| 62 | +
|
| 63 | +4. **Verify Docker installation** |
| 64 | + ```bash |
| 65 | + docker --version |
| 66 | + ``` |
| 67 | + |
| 68 | +5. **Clone the tsidp repository** |
| 69 | + ```bash |
| 70 | + mkdir -p /usr/local/src && cd /usr/local/src |
| 71 | + git clone https://github.com/tailscale/tsidp.git |
| 72 | + ``` |
| 73 | + |
| 74 | +6. **Build and run tsidp** |
| 75 | + - Follow the [Building your own container](../../README.md) instructions to launch tsidp inside of a Docker container in the LXC |
| 76 | + |
| 77 | +### Configure Auto-start |
| 78 | + |
| 79 | +Once `https://idp...` is working: |
| 80 | + |
| 81 | +1. **Enable Docker container auto-restart** |
| 82 | + ```bash |
| 83 | + docker update --restart unless-stopped tsidp |
| 84 | + ``` |
| 85 | + |
| 86 | +2. **Enable LXC auto-start** in Proxmox UI: |
| 87 | + - Select the container |
| 88 | + - Go to Options → Set "Start at boot" to "Yes" |
| 89 | + |
| 90 | +3. **Test the configuration** by rebooting the LXC and/or Proxmox server |
| 91 | + |
| 92 | +## Configure Proxmox to Use tsidp |
| 93 | + |
| 94 | +This example assumes: |
| 95 | +- Proxmox server: `https://scruggs.yourtailnet.ts.net:8006` |
| 96 | +- tsidp instance: `https://idp.yourtailnet.ts.net` |
| 97 | + |
| 98 | +### Register Proxmox as a Client in tsidp |
| 99 | + |
| 100 | +1. **Visit** `https://idp.yourtailnet.ts.net` and click "Add New Client" |
| 101 | + |
| 102 | +  |
| 103 | + |
| 104 | +2. **Configure the client**: |
| 105 | + - Add redirect URIs for each way you access Proxmox |
| 106 | + - Save the generated Client ID and Client Secret; you'll use these next |
| 107 | + |
| 108 | +  |
| 109 | + |
| 110 | +### Configure OpenID Connect in Proxmox |
| 111 | + |
| 112 | +1. **Navigate to** Datacenter → Permissions → Realms -> **Add an OpenID Connect Server** |
| 113 | + |
| 114 | +  |
| 115 | + |
| 116 | +2. **Configure the OpenID Connect Server realm** with these settings: |
| 117 | + - **Issuer URL**: `https://idp.yourtailnet.ts.net` |
| 118 | + - **Realm**: `tailscale` (or your preferred name) |
| 119 | + - **Client ID**: (from tsidp) |
| 120 | + - **Client Secret**: (from tsidp) |
| 121 | + - **Default**: Yes |
| 122 | + - **Autocreate Users**: Yes |
| 123 | + - **Username Claim**: `email` |
| 124 | + |
| 125 | +  |
| 126 | + |
| 127 | +### Test the Authentication |
| 128 | + |
| 129 | +1. **Open an incognito browser window** and navigate to `https://scruggs.yourtailnet.ts.net:8006` |
| 130 | + |
| 131 | +2. **Log in** using the `tailscale` realm |
| 132 | + - Authentication should work immediately |
| 133 | + - Proxmox will auto-create a user account (due to "Autocreate Users: yes") |
| 134 | + - However, this user account will have no permissions. |
| 135 | + |
| 136 | +  |
| 137 | + |
| 138 | +3. **Close the incognito window** |
| 139 | + |
| 140 | +### Assign User Permissions |
| 141 | + |
| 142 | +1. **Create an admin group**: |
| 143 | + - Go to Datacenter → Permissions → Groups |
| 144 | + - Create a group called `tsadmins` |
| 145 | + |
| 146 | +2. **Grant administrator privileges**: |
| 147 | + - Go to Datacenter → Permissions |
| 148 | + - Add a Group Permission: |
| 149 | + - **Path**: `/` |
| 150 | + - **Group**: `tsadmins` |
| 151 | + - **Role**: `Administrator` |
| 152 | + |
| 153 | +  |
| 154 | + |
| 155 | +3. **Add users to the admin group**: |
| 156 | + - Go to Datacenter → Permissions → Users |
| 157 | + - Edit the auto-created user |
| 158 | + - Add them to the `tsadmins` group |
| 159 | + |
| 160 | +## Final Verification |
| 161 | + |
| 162 | +Log out of Proxmox and log back in using the new Tailscale realm to verify everything is working correctly. |
0 commit comments