restore bitwarden

This commit is contained in:
Alexandre
2025-12-28 20:13:40 +01:00
committed by GitHub
parent 6c582f36ea
commit 0c11a1091f
39 changed files with 268 additions and 97 deletions

154
bitwarden/CHANGELOG.md Normal file
View File

@@ -0,0 +1,154 @@
## 1.35.0 (28-12-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
- The Home Assistant project has deprecated support for the armv7, armhf and i386 architectures. Support wil be fully dropped in the upcoming Home Assistant 2025.12 release
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
## 1.34.3 (01-08-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.34.1 (31-05-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.33.2 (15-02-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.33.1 (08-02-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.33.0 (01-02-2025)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.7 (21-12-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.6 (14-12-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.5 (23-11-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.4 (16-11-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.3 (02-11-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.2 (19-10-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.1 (05-10-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.32.0 (17-08-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.31.0 (13-07-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
## 1.30.5 (04-05-2024)
- Update to latest version from dani-garcia/bitwarden_rs (changelog : https://github.com/dani-garcia/bitwarden_rs/releases)
- Deprecated, please use version from community repository. Just export your vault from this addon, and import it in the official addon.
## 1.30.1 (21-11-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.30.0 (11-11-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.29.2-2 (02-09-2023)
- Minor bugs fixed
- Fix https://github.com/alexbelgium/hassio-addons/issues/975
## 1.29.2 (02-09-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.29.1 (29-07-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.29.0 (15-07-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.28.1 (08-04-2023)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.28.0 (31-03-2023)
- Update to latest version from dani-garcia/bitwarden_rs
- Implemented healthcheck
## 1.27.0 (25-12-2022)
- Update to latest version from dani-garcia/bitwarden_rs
- WARNING : update to supervisor 2022.11 before installing
## 1.26.0 (15-10-2022)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.25.2 (28-07-2022)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.25.1 (17-07-2022)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.25.0 (24-05-2022)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.24.0 (27-04-2022)
- Update to latest version from dani-garcia/bitwarden_rs
- Add codenotary sign
## 1.24.0 (31-01-2022)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.23.1 (15-12-2021)
- Update to latest version from dani-garcia/bitwarden_rs
- New standardized logic for Dockerfile build and packages installation
## 1.23.0 (21-10-2021)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.22.2 (26-07-2021)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.22.1 (30-06-2021)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.22.0 (29-06-2021)
- Update to latest version from dani-garcia/bitwarden_rs
- Project renamed to vaultwarden
## 1.21.0 (30-04-2021)
- Update to latest version from dani-garcia/bitwarden_rs
## 1.20.0
- Update to latest version from dani-garcia/bitwarden_rs (Implemented Send functionality, Updated web vault to 2.19.0, CORS fixes, Updated diagnostics page with more info, Updated dependencies)
## 1.19.0
- Update to latest version from dani-garcia/bitwarden_rs
## 1.18.0
- Exposed settings.json in /share/transmission
- Add smb and local disks mount [(@dianlight)](https://github.com/dianlight)

View File

@@ -14,18 +14,43 @@
# 1 Build Image #
#################
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:7.1.0
ARG BUILD_VERSION
ARG BUILD_UPSTREAM="1.35.0"
FROM "vaultwarden/server:${BUILD_UPSTREAM}" as vaultwarden
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base:9.1.0
###############################################################################
# Get prebuild containers from Vaultwarden
###############################################################################
FROM "vaultwarden/server:latest" AS vaultwarden
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
###############################################################################
# Build the actual add-on.
###############################################################################
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Get the Bitwarden from official images
COPY --from=vaultwarden /vaultwarden /opt/vaultwarden
#COPY --from=vaultwarden /Rocket.toml /opt/Rocket.toml
COPY --from=vaultwarden /web-vault /opt/web-vault
# add Nginx
# hadolint ignore=DL3009
RUN \
apt-get update \
\
&& apt-get install -y --no-install-recommends \
libmariadb-dev-compat=1:11.8.3-0+deb13u1 \
libpq5=17.6-0+deb13u1 \
nginx=1.26.3-3+deb13u1 \
sqlite3=3.46.1-7 \
&& apt-get clean \
&& rm -f -r \
/etc/nginx \
\
&& mkdir -p /var/log/nginx \
&& touch /var/log/nginx/error.log
##################
# 2 Modify Image #
##################

View File

@@ -1,7 +1,7 @@
arch:
- aarch64
- amd64
description: Deprecated - please use community version
description: Open source password management solution
image: ghcr.io/alexbelgium/vaultwarden-{arch}
init: false
map:
@@ -9,25 +9,25 @@ map:
name: zzz_archived - Vaultwarden
options:
env_vars: []
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
ssl: true
ports:
7277/tcp: 7277
ports_description:
7277/tcp: Bitwarden Vault
7277/tcp: Vaultwarden Web interface
schema:
env_vars:
- name: match(^[A-Za-z0-9_]+$)
value: str?
log_level: list(trace|debug|info|notice|warning|error|fatal)?
ssl: bool
certfile: str
keyfile: str
log_level: list(trace|debug|info|notice|warning|error|fatal)?
request_size_limit: int?
ssl: bool
slug: bitwarden
stage: deprecated
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/bitwarden
version: "1.35.0"
version: 1.35.0
webui: "[PROTO:ssl]://[HOST]:[PORT:7277]"

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -4,5 +4,3 @@ server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
client_max_body_size %%max_body_size%%;

View File

@@ -0,0 +1,8 @@
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -0,0 +1,3 @@
upstream backend {
server 127.0.0.1:80;
}

View File

@@ -27,11 +27,7 @@ events {
http {
include /etc/nginx/includes/mime.types;
log_format homeassistant '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)';
access_log /proc/1/fd/1 homeassistant;
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
gzip on;

View File

@@ -12,12 +12,4 @@ server {
proxy_pass http://backend;
}
location /notifications/hub {
proxy_pass http://wsbackend;
}
location /notifications/hub/negotiate {
proxy_pass http://backend;
}
}

View File

@@ -8,12 +8,4 @@ server {
proxy_pass http://backend;
}
location /notifications/hub {
proxy_pass http://wsbackend;
}
location /notifications/hub/negotiate {
proxy_pass http://backend;
}
}

View File

@@ -1,13 +1,11 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Home Assistant Community Add-on: Bitwarden
# This file configures nginx
# Home Assistant Community Add-on: Vaultwarden
# This file configures NGINX
# ==============================================================================
declare certfile
declare keyfile
declare max_body_size
bashio::config.require.ssl
@@ -21,11 +19,3 @@ if bashio::config.true 'ssl'; then
else
mv /etc/nginx/servers/direct.disabled /etc/nginx/servers/direct.conf
fi
max_body_size="10M"
# Increase body size to match config
if bashio::config.has_value 'request_size_limit'; then
max_body_size=$(bashio::config 'request_size_limit')
fi
sed -i "s/%%max_body_size%%/${max_body_size}/g" \
/etc/nginx/includes/server_params.conf

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-nginx/run

View File

@@ -0,0 +1,26 @@
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Vaultwarden
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="NGINX"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi

View File

@@ -1,8 +1,6 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Bitwarden
# Home Assistant Community Add-on: Vaultwarden
# Runs the Nginx daemon
# ==============================================================================
bashio::net.wait_for 80

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,27 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Vaultwarden
# Take down the S6 supervision tree when the server fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="Vaultwarden"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi

View File

@@ -1,8 +1,7 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Home Assistant Community Add-on: Bitwarden
# Home Assistant Community Add-on: Vaultwarden
# Runs the Vaultwarden server
# ==============================================================================
declare admin_token
@@ -22,19 +21,19 @@ export ROCKET_SECRET_KEY="${secret_key}"
# Find the matching log level
if bashio::config.has_value 'log_level'; then
case "$(bashio::string.lower "$(bashio::config 'log_level')")" in
all | trace)
all|trace)
log_level="trace"
;;
debug)
log_level="debug"
;;
info | notice)
info|notice)
log_level="info"
;;
warning)
log_level="warn"
;;
error | fatal)
error|fatal)
log_level="error"
;;
off)
@@ -46,7 +45,7 @@ if bashio::config.has_value 'log_level'; then
fi
# Show admin token in the log, if config does not exist.
if ! bashio::fs.file_exists '/data/config.yaml'; then
if ! bashio::fs.file_exists '/data/config.json'; then
admin_token=$(openssl rand -base64 48)
export ADMIN_TOKEN="${admin_token}"
@@ -73,10 +72,6 @@ if bashio::config.has_value 'request_size_limit'; then
export ROCKET_LIMITS="{json=${request_size_limit}}"
fi
# Always enable Websockets
export WEBSOCKET_ENABLED=true
export WEBSOCKET_PORT=8080
# Run the Bitwarden server
bashio::log.info 'Starting the Vaultwarden server...'
cd /opt || bashio::exit.nok

View File

@@ -0,0 +1 @@
longrun

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,9 +0,0 @@
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -1,7 +0,0 @@
upstream backend {
server 127.0.0.1:80;
}
upstream wsbackend {
server 127.0.0.1:8080;
}

View File

@@ -1,12 +0,0 @@
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Vaultwarden
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "NGINX crashed, halting add-on"
/run/s6/basedir/bin/halt
fi
bashio::log.info "NGINX stopped, restarting..."

View File

@@ -1,9 +0,0 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: Bitwarden
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services