mitra
- Google Compute Engine
e2-small
- Debian GNU/Linux 12 (bookworm)
- 作業後に
e2-micro
に変更
ユーザー作成
# user admin
$ sudo adduser mitra
Install Caddy
# user admin
$ sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
$ curl -1sLf '<https://dl.cloudsmith.io/public/caddy/stable/gpg.key>' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
$ curl -1sLf '<https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt>' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
$ sudo apt update
$ sudo apt install caddy
$ caddy version # バージョン確認
# いったん止めておく
$ sudo systemctl stop caddy
# 自動起動の有効化
$ sudo systemctl enable caddy
Install Postgres
# user admin
$ sudo sh -c 'echo "deb <https://apt.postgresql.org/pub/repos/apt> $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
$ wget --quiet -O - <https://www.postgresql.org/media/keys/ACCC4CF8.asc> | sudo apt-key add -
$ sudo apt update
$ sudo apt install postgresql-16
Install Rust
# user admin
$ curl --proto '=https' --tlsv1.3 <https://sh.rustup.rs> -sSf | sh
$ source "$HOME/.cargo/env"
$ rustc --version # バージョン確認
Install Mitra
# user admin
# 現行最新verを落としてくる
$ curl -OL <https://codeberg.org/silverpill/mitra/releases/download/v3.13.1/mitra_3.13.1_amd64.deb>
$ mv mitra_3.13.1_amd64.deb mitra_amd64.deb
$ ls -l # 確認
$ sudo dpkg -i mitra_amd64.deb
$ sudo vi /etc/mitra/config.yaml
# user admin
# データディレクトリの作成
$ sudo mkdir /var/lib/mitra
$ sudo chown mitra:mitra /var/lib/mitra
# 自動起動の有効化
$ sudo systemctl enable mitra
$ su - mitra
# user mitra
# Mitraのアカウント作成
$ mitractl create-account adminusername password admin
$ mitractl create-account username password
Settings Database
# user admin
$ sudo -i -u postgres
$ user postgres
$ psql
CREATE USER mitra WITH PASSWORD 'password';
CREATE DATABASE mitra OWNER mitra ENCODING 'UTF8';
Set Server