Adding proper editor when editing the vault
Adding using Gitea with git over ssh
This commit is contained in:
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -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 <username>! 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/<username>/<repo>.git
|
||||
```
|
||||
|
||||
```bash
|
||||
# Clone
|
||||
git clone ssh://git@gitea.ladkau.de:2222/<username>/myrepo.git
|
||||
|
||||
# Add remote on an existing repo
|
||||
git remote add origin ssh://git@gitea.ladkau.de:2222/<username>/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:<username>/myrepo.git
|
||||
```
|
||||
|
||||
## 4. Nextcloud
|
||||
|
||||
The admin credentials are set via `nextcloud_admin_user` and
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user