Compare commits

...

32 Commits

Author SHA1 Message Date
marlon b0d701b0e8 Define $COMPOSE_FILE in config to fix abra app deploy error
By default, the config options provided in the template fail because $COMPOSE_FILE is not set, leading to an error `[abra recipe path] is a directory` when running `abra app deploy`. This is fixed by setting `$COMPOSE_FILE` to `compose.yml`
2024-09-20 13:59:25 +00:00
javielico 7f60d33d21 chore: publish 0.9.0+1.32.0 release 2024-08-26 18:07:07 +01:00
p4u1 57a40cfaa1 chore: publish 0.8.0+1.31.0 release 2024-07-19 18:55:59 +02:00
knoflook 373db38548 feat: add smtp support 2024-07-09 15:37:09 +02:00
javielico 4c50e82865 chore: publish 1.2.0+1.30.5 release 2024-03-18 15:00:09 +00:00
javielico 06c0d8ffd4 chore: publish 1.1.0+1.30.5 release 2024-03-18 14:55:49 +00:00
javielico 371fa36d15 chore: publish 1.0.0+1.30.5 release 2024-03-18 14:54:20 +00:00
p4u1 c3dbb3e4dd chore: publish 0.7.2+1.30.3 release 2024-02-13 17:50:11 +01:00
3wordchant 8ef06543d2 chore: publish 0.7.1+1.30.1 release 2023-11-20 12:55:18 +00:00
decentral1se c59446cca2 Merge pull request 'add config for backup command' (#2) from p4u1/vaultwarden:enable-backup into main
Reviewed-on: coop-cloud/vaultwarden#2
2023-11-06 23:11:14 +00:00
p4u1 88210401bd add config for backup command 2023-11-06 21:26:00 +01:00
3wordchant 94a6b11bc8 chore: publish 0.7.0+1.30.0 release 2023-11-06 13:25:30 +00:00
kawaiipunk e98ebf7440 chore: publish 0.6.0+1.29.2 release 2023-10-23 13:52:59 +01:00
3wordchant 16e12cd293 chore: publish 0.5.1+1.29.1 release 2023-08-04 15:27:39 +02:00
decentral1se d5ef9db98f chore: publish 0.5.0+1.29.0 release 2023-07-20 17:01:22 +02:00
3wordchant 03f734de7d chore: publish 0.4.0+1.28.1 release 2023-04-27 14:51:59 -04:00
3wordchant 28d0e9498b Switch to self-hosted stack-ssh-deploy image 2023-01-21 11:46:42 -08:00
knoflook 452e40fd30 remove merge leftovers 2023-01-21 11:51:35 +01:00
3wordchant f88255476f Add drone configs / secrets [mass update] 2023-01-20 21:32:07 -08:00
3wordchant ba48419611 Add CI and catalogue generation [mass update] 2023-01-20 10:45:03 -08:00
3wordchant ceb8e3981f Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:28 -08:00
knoflook 6e44ff96b1 Merge branch 'main' of https://git.coopcloud.tech/coop-cloud/vaultwarden 2022-12-01 11:29:43 +01:00
knoflook 7baac51174 add backup capability 2022-12-01 11:28:45 +01:00
3wordchant 07e6c27f34 chore: publish 0.2.0+1.26.0 release 2022-11-18 07:06:00 -08:00
decentral1se bf75cde0b5 Merge pull request 'Up version to 1.26.0' (#1) from javielico/vaultwarden:main into main
Reviewed-on: coop-cloud/vaultwarden#1
2022-11-12 16:50:05 +00:00
javielico 4631a00d72 Adding version number 2022-11-11 22:01:05 +00:00
javielico 830d22e4c6 Up version to 1.26.0 2022-11-11 17:49:40 +00:00
3wordchant 66eaa6eecf Fix docker image spec 2022-10-18 17:49:51 -04:00
decentral1se eb04428dd4 add note about fail2ban config 2022-08-16 13:41:11 +02:00
decentral1se 01db057d6a specify log file 2022-08-16 13:15:17 +02:00
decentral1se 9da4e72f75 logging for fail2ban 2022-08-16 13:08:58 +02:00
decentral1se 7a90ea495a getting this thing ship/shape 2022-08-16 13:03:07 +02:00
7 changed files with 206 additions and 35 deletions
+40
View File
@@ -0,0 +1,40 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: vaultwarden
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
networks:
- proxy
environment:
DOMAIN: vaultwarden.swarm-test.autonomic.zone
STACK_NAME: vaultwarden
LETS_ENCRYPT_ENV: production
APP_ENTRYPOINT_VERSION: v1
SECRET_ADMIN_TOKEN_VERSION: v1
trigger:
branch:
- main
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag
+22 -3
View File
@@ -1,7 +1,26 @@
TYPE=vaultwarden
DOMAIN=vaultwarden.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.vaultwarden.example.com`'
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
WEBSOCKET_ENABLED=true
SIGNUPS_ALLOWED=true
USE_SYSLOG=true
EXTENDED_LOGGING=true
LOG_FILE=/data/vaultwarden.log
LOG_LEVEL=warn
SECRET_ADMIN_TOKEN_VERSION=v1 # length=48
## SMTP settings
#COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml"
#SECRET_SMTP_PASSWORD_VERSION=v1
#SMTP_FROM=noreply@example.com
#SMTP_USERNAME=noreply@example.com
#SMTP_HOST=mail.example.com
#SMTP_PORT=587
#SMTP_SECURITY=starttls
+29 -15
View File
@@ -1,30 +1,44 @@
# vaultwarden
TODO
> Open source password manager
<!-- metadata -->
* **Category**: Apps
* **Status**:
* **Image**:
* **Healthcheck**:
* **Backups**:
* **Email**:
* **Tests**:
* **SSO**:
* **Status**: 2, beta
* **Image**: [`vaultwarden/server`](https://hub.docker.com/vaultwarden/server), 4, upstream
* **Healthcheck**: 3
* **Backups**: No
* **Email**: No
* **Tests**: No
* **SSO**: No
<!-- endmetadata -->
## Basic usage
## Quick start
1. Set up Docker Swarm and [`abra`]
2. Deploy [`coop-cloud/traefik`]
3. `abra app new ${REPO_NAME} --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass`)
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
6. Open the configured domain in your browser to finish set-up
3. `abra app new vaultwarden`
4. `abra app config YOURAPPDOMAIN`
5. `abra app deploy YOURAPPDOMAIN`
[`abra`]: https://git.coopcloud.tech/coop-cloud/abra
[`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik
## Tips & Tricks
### Wiring up `fail2ban`
You need the following logging config:
```
USE_SYSLOG=true
EXTENDED_LOGGING=true
LOG_FILE=/data/vaultwarden.log
LOG_LEVEL=warn
```
Then follow [this guide](https://github.com/dani-garcia/vaultwarden/wiki/Fail2Ban-Setup).
And you must use `COMPOSE_FILE="$COMPOSE_FILE:compose.host.yml"` in your traefik config to get real IPs.
+28
View File
@@ -0,0 +1,28 @@
export APP_ENTRYPOINT_VERSION=v2
APP_DIR="app:/data"
_backup_app() {
# Copied _abra_backup_dir to make UX better on restore and backup
{
abra__src_="$1"
abra__dst_="-"
}
# shellcheck disable=SC2154
FILENAME="$(basename "$1").tar"
debug "Copying '$1' to '$FILENAME'"
silence
mkdir -p /tmp/abra
sub_app_cp > /tmp/abra/$FILENAME
unsilence
}
abra_backup_app() {
# shellcheck disable=SC2154
ARK_FILENAME="$ABRA_BACKUP_DIR/${abra__app_}_app_$(date +%F).tar.gz"
# Cant be FILENAME as that gets changed by something
_backup_app $APP_DIR
success "Backed up 'app' to $ARK_FILENAME"
}
+19
View File
@@ -0,0 +1,19 @@
---
version: "3.8"
services:
app:
secrets:
- smtp_password
environment:
- "SMTP_PASSWORD_FILE=/run/secrets/smtp_password"
- "SMTP_FROM"
- "SMTP_USERNAME"
- "SMTP_HOST"
- "SMTP_PORT"
- "SMTP_SECURITY"
secrets:
smtp_password:
external: true
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
+36 -17
View File
@@ -3,37 +3,45 @@ version: "3.8"
services:
app:
image: vaultwarden/server:1.25.0
image: vaultwarden/server:1.32.0
networks:
- proxy
environment:
- "DOMAIN=https://$DOMAIN"
- "WEBSOCKET_ENABLED=true"
- "ADMIN_TOKEN=test"
# - SIGNUPS_ALLOWED: $$cap_register_enabled
# - ADMIN_TOKEN: $$cap_admin_token
- "WEBSOCKET_ENABLED=$WEBSOCKET_ENABLED"
- "SIGNUPS_ALLOWED=$SIGNUPS_ALLOWED"
- "ADMIN_TOKEN_FILE=/run/secrets/admin_token"
- "USE_SYSLOG=$USE_SYSLOG"
- "EXTENDED_LOGGING=$EXTENDED_LOGGING"
- "LOG_FILE=$LOG_FILE"
- "LOG_LEVEL=$LOG_LEVEL"
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
mode: 0555
entrypoint: /docker-entrypoint.sh
command: /start.sh
secrets:
- admin_token
volumes:
- vaultwarden_data:/data
healthcheck:
test: curl -f http://localhost/alive || exit 1
interval: 5s
timeout: 3s
retries: 10
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+1.25.0"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
- "coop-cloud.${STACK_NAME}.version=0.9.0+1.32.0"
- "backupbot.backup=true"
- "backupbot.backup.path=/data"
volumes:
vaultwarden_data:
@@ -41,3 +49,14 @@ volumes:
networks:
proxy:
external: true
configs:
app_entrypoint:
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
secrets:
admin_token:
external: true
name: ${STACK_NAME}_admin_token_${SECRET_ADMIN_TOKEN_VERSION}
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "ADMIN_TOKEN"
file_env "SMTP_PASSWORD"
# upstream startup command
# https://github.com/dani-garcia/vaultwarden/blob/60ed5ff99d15dec0b82c85987f9a3e244b8bde91/docker/Dockerfile.j2#L254
/start.sh