From 2ccf2c9826316cc118e5c146d567218846e265d3 Mon Sep 17 00:00:00 2001 From: ml Date: Wed, 1 Jul 2026 07:45:02 +0200 Subject: [PATCH] Adding proper editor when editing the vault Adding using Gitea with git over ssh --- LICENSE | 21 +++++++++++ README.md | 4 -- docs/runbook-configuration.md | 71 +++++++++++++++++++++++++++++++++++ docs/runbook-provisioning.md | 2 +- 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d207d52 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Matthias Ladkau + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 04d96c3..02816cb 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ Info: -- Server: Strato STRATO VPS Linux VC4-8 - Order Number: 9478462 - - Customer Number: 73171334 - Customer Login: https://www.strato.de/apps/CustomerService Cores: 4 Cores RAM: 8 GB RAM diff --git a/docs/runbook-configuration.md b/docs/runbook-configuration.md index 7becc0c..eed1b77 100644 --- a/docs/runbook-configuration.md +++ b/docs/runbook-configuration.md @@ -138,6 +138,77 @@ get an account (controlled by `ALLOW_ONLY_EXTERNAL_REGISTRATION`). Users can now sign in via **Sign in with keycloak** on the Gitea login page. +### 3.3 Use SSH key authentication for Git + +Gitea exposes SSH on port **2222** (host port mapped from the container's port 22). +Clone URLs use the full `ssh://` form because the port is non-standard. + +**Generate an SSH key** + +If you do not already have a key, generate a dedicated one for Gitea: + +```bash +ssh-keygen -t ed25519 -C "gitea.ladkau.de" -f ~/.ssh/id_ed25519_gitea +``` + +Leave the passphrase empty for unattended use, or set one for additional +security. The command creates two files: + +- `~/.ssh/id_ed25519_gitea` — private key (never share this) +- `~/.ssh/id_ed25519_gitea.pub` — public key (upload this to Gitea) + +**Add your key to Gitea** + +1. Go to `https://gitea.ladkau.de` → click your avatar (top right) → + **Settings** → **SSH / GPG Keys** → **Add Key**. +2. Paste the contents of `~/.ssh/id_ed25519_gitea.pub`. +3. Click **Add Key**. + +**Test the connection** + +```bash +ssh -p 2222 -i ~/.ssh/id_ed25519_gitea -T git@gitea.ladkau.de +``` + +A successful response looks like: + +``` +Hi ! You've successfully authenticated, but Gitea does not provide shell access. +``` + +**Clone, push, and pull** + +Gitea shows the correct SSH URL on every repository page. It takes the form: + +``` +ssh://git@gitea.ladkau.de:2222//.git +``` + +```bash +# Clone +git clone ssh://git@gitea.ladkau.de:2222//myrepo.git + +# Add remote on an existing repo +git remote add origin ssh://git@gitea.ladkau.de:2222//myrepo.git +``` + +**Optional: SSH config alias** + +Add this to `~/.ssh/config` to avoid repeating the port: + +``` +Host gitea.ladkau.de + User git + Port 2222 + IdentityFile ~/.ssh/id_ed25519_gitea +``` + +With the alias in place you can use the shorter SCP-like URL: + +```bash +git clone git@gitea.ladkau.de:/myrepo.git +``` + ## 4. Nextcloud The admin credentials are set via `nextcloud_admin_user` and diff --git a/docs/runbook-provisioning.md b/docs/runbook-provisioning.md index ff5c639..62c4fb4 100644 --- a/docs/runbook-provisioning.md +++ b/docs/runbook-provisioning.md @@ -168,7 +168,7 @@ The script enforces three tiers: To edit the vault later: ```bash -ansible-vault edit ansible/group_vars/all/vault.yml +EDITOR=nano ansible-vault edit ansible/group_vars/all/vault.yml ``` ### 5. Bootstrap the deploy user