commit e9d9fdbf612c025d259928b1a7129eafa43edcf5 Author: Jochen Maes Date: Sat Nov 18 10:11:59 2023 +0100 Initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..bfb10f8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,27 @@ +kind: pipeline +type: docker +name: bw-image-builder +platform: + arch: arm64 +volumes: + - name: dockersock + host: + path: /var/run/docker.sock +steps: + - name: publish image + image: plugins/docker + settings: + username: builder + password: + from_secret: builder_password + registry: gitea.sejo-it.be + repo: gitea.sejo-it.be/sejo-it/bw-client + tags: + - latest + - ${DRONE_TAG##v} + volumes: + - name: dockersock + path: /run/docker.sock +trigger: + event: + - tag diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e39fb17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:bookworm + +ENV BW_CLI_VERSION=2023.4.0 + +RUN apt update && \ + apt install -y wget unzip && \ + wget https://github.com/bitwarden/clients/releases/download/cli-v${BW_CLI_VERSION}/bw-linux-${BW_CLI_VERSION}.zip && \ + unzip bw-linux-${BW_CLI_VERSION}.zip && \ + chmod +x bw && \ + mv bw /usr/local/bin/bw && \ + rm -rfv *.zip + +COPY entrypoint.sh / + +CMD ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..7e99cb8 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +bw config server ${BW_HOST} + +export BW_SESSION=$(bw login ${BW_USER} --passwordenv BW_PASSWORD --raw) + +bw unlock --check + +echo 'Running `bw server` on port 8087' +bw serve --hostname 0.0.0.0 #--disable-origin-protection