feat: privkey
All checks were successful
/ deploy (push) Successful in 13s

This commit is contained in:
ange 2025-04-27 10:06:15 +00:00
parent 4b8bcac14e
commit dc42bd66e6
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
3 changed files with 23 additions and 2 deletions

View File

@ -5,8 +5,8 @@ RUN apt-get update \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -pm0700 "$HOME/.ssh/" \
&& touch "$HOME/.ssh/known_hosts" \
&& chmod 0600 "$HOME/.ssh/known_hosts"
&& touch "$HOME/.ssh"/{known_hosts,id_ed25519} \
&& chmod 0600 "$HOME/.ssh"/*
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT "entrypoint.sh"
CMD ["borg"]

20
README.md Normal file
View File

@ -0,0 +1,20 @@
# borg
## example
```yaml
---
services:
borg:
image: git.gmoker.com/gmoker/borg:main
environment:
- BORG_PASSPHRASE=passphrase
- |
SSH_ED25519=-----BEGIN OPENSSH PRIVATE KEY-----
keyhere
-----END OPENSSH PRIVATE KEY-----
- SSH_KNOWN_HOSTS=serv ssh-ed25519 pubkey
command:
- sh
- -c
- borg create ssh://HOST/REPO/::BACKUPNAME FILESTOBACKUP
```

View File

@ -1,4 +1,5 @@
#!/bin/bash -e
echo "$SSH_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
echo "$SSH_ID_ED25519" > "$HOME/.ssh/id_ed25519"
exec "$@"