それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

bitwardenのインストール

bitwardenを動かしてみる。

LXC 仮想マシン準備

name=bitwarden
lxc launch ubuntu:20.04 $name --storage bt01
lxc config set $name security.privileged true
lxc config set $name security.nesting true
lxc restart $name
lxc shell $name

docker 準備

apt update 
apt upgrade -y 
apt install docker-compose -y
docker run --rm hello-world

作業用ディレクト

cd 
mkdir sample 
cd sample

bitwarden サーバー

curl -s -o bitwarden.sh \    https://raw.githubusercontent.com/bitwarden/server/master/scripts/bitwarden.sh \
    && chmod +x bitwarden.sh
./bitwarden.sh install
./bitwarden.sh start

インストールID

https://bitwarden.com/host/

  • Installation Id: a5dd017f-ca06-xxxxx
  • Installation Key: mPYQiuxxxx

再インストール

rm -rf bwdata
./bitwarden.sh install

バックアップ

./biwarden stop
rclone bwdata xx:/backup

証明書

証明書は、letsencrypt を certbot するけど、自動取得がNAT内部だと動かないので、最初は自己署名証明書にしておくのがベター

自分インストールの物を使う。

Chromeの拡張で自分のサーバーを使うには、次のボタンを押す。

f:id:takuya_1st:20210928145933p:plain

インストールのログ

root@bitwarden:~/sample# ./bitwarden.sh install
 _     _ _                         _
| |__ (_) |___      ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2021, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 1.42.3
Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.1
docker-compose version 1.25.0, build unknown

(!) Enter the domain name for your Bitwarden instance (ex. bitwarden.example.com): bit.exampmle.com

(!) Do you want to use Let's Encrypt to generate a free SSL certificate? (y/n): n

(!) Enter the database name for your Bitwarden instance (ex. vault):

1.42.3: Pulling from bitwarden/setup
Digest: sha256:a85998defed50c28dcd477c1b196df9282e0f46c18dfb5d0f5378833fe02f81e
Status: Image is up to date for bitwarden/setup:1.42.3
docker.io/bitwarden/setup:1.42.3

(!) Enter your installation id (get at https://bitwarden.com/host): a5dd017f-ca06-xxx-xxx-xxxxxxxx

(!) Enter your installation key: mPYQiuHnxxxxxxxxx

(!) Do you have a SSL certificate to use? (y/n): n

(!) Do you want to generate a self-signed SSL certificate? (y/n): y

Generating self signed SSL certificate.
Generating a RSA private key
..................++++
...........................................................................................................................................................................................................................................................................++++
writing new private key to '/bitwarden/ssl/self/bit.example.com/private.key'
-----
Generating key for IdentityServer.
Generating a RSA private key
...................................++++
.........................................++++
writing new private key to 'identity.key'
-----

!!!!!!!!!! WARNING !!!!!!!!!!
You are using an untrusted SSL certificate. This certificate will not be
trusted by Bitwarden client applications. You must add this certificate to
the trusted store on each device or else you will receive errors when trying
to connect to your installation.

Building nginx config.
Building docker environment files.
Building docker environment override files.
Building FIDO U2F app id.
Building Asset Links For Fido2.
Building docker-compose.yml.

Installation complete

If you need to make additional configuration changes, you can modify
the settings in `./bwdata/config.yml` and then run:
`./bitwarden.sh rebuild` or `./bitwarden.sh update`

Next steps, run:
`./bitwarden.sh start`