Added Vaultwarden guide for disabling the admin page (#13858)

**Description**
Added Vaultwarden guide for disabling the admin page

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
ZasX
2023-10-21 21:28:37 +02:00
committed by GitHub
parent 244bf51ff4
commit 73bb7e3590

View File

@@ -0,0 +1,51 @@
# Disabling the Admin Interface
:::caution Backup Reminder
Before proceeding, ensure that you have backed up important configurations, especially when making changes to configuration files or secrets. It's also advisable to back up the Vaultwarden database to prevent potential data loss.
:::
This guide is a combination of the [upstream documentation](https://github.com/dani-garcia/vaultwarden/wiki/Enabling-admin-page#disabling-the-admin-page) and how we implemented it.
## Modify the Host Secret
To start with the deactivation, you must first modify the secret on the host's shell. Execute the following command:
```bash
k3s kubectl patch secret vaultwarden-vaultwardensecret -n ix-vaultwarden --type='json' -p='[{"op": "remove", "path": "/data/ADMIN_TOKEN"}]'
```
:::info Command Explanation
The command above utilizes `kubectl`, a command-line tool for interacting with Kubernetes clusters. Here's a breakdown:
- `k3s`: This is a lightweight version of Kubernetes.
- `patch secret vaultwarden-vaultwardensecret`: This indicates that we are patching (modifying) the secret named `vaultwarden-vaultwardensecret`.
- `-n ix-vaultwarden`: This specifies the namespace (`ix-vaultwarden`) in which the secret resides.
- `--type='json'`: Specifies that the patch content is of type JSON.
- `-p='[{"op": "remove", "path": "/data/ADMIN_TOKEN"}]'`: This JSON patch instruction tells Kubernetes to remove the `ADMIN_TOKEN` field from the secret.
:::
## Update Container Config
Next, while inside the Vaultwarden container, run the command below to modify the `config.json` file:
```bash
sed -i.bak '/admin_token/d' /data/config.json
```
:::info Command Explanation
- The `sed` command is used to search and delete the line containing `admin_token` from the `config.json` file.
- A backup of the original `config.json` is created with the `.bak` extension before making the change.
:::
## Adjust the App Configuration
Finally, head to the Vaultwarden app's configuration:
1. Find and disable the admin interface option (if it is still enabled).
2. Click "Save" at the bottom to apply the changes.