FocalboardというNotionクローンがあるらしく試してみた結果のメモ。
外部に公開することは一切考慮していません。ローカルマシンでの個人利用を想定しています。
目次
確認環境
Env | Ver |
---|---|
Ubuntu | 20.04.4 LTS |
WSL2 | 1.0.3.0 |
Focalboard | 0.15.0 |
MySQL | Ver 15.1 Distrib 10.3.37-MariaDB |
前提条件
- MySQLはセットアップ済み
手順
基本的なセットアップ
wget https://github.com/mattermost/focalboard/releases/download/v0.15.0/focalboard-server-linux-amd64.tar.gz
tar -xvzf focalboard-server-linux-amd64.tar.gz
sudo mv focalboard /var/lib/
cat <<'EOF' | sudo tee /etc/nginx/conf.d/focalboard.conf
upstream focalboard {
server localhost:15001;
keepalive 32;
}
server {
server_name focalboard.test;
access_log /var/log/nginx/focalboard.access.log;
error_log /var/log/nginx/focalboard.error.log;
location ~ /ws/* {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 50M;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
client_body_timeout 60;
send_timeout 300;
lingering_timeout 5;
proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
proxy_pass http://focalboard;
}
location / {
client_max_body_size 50M;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_cache_revalidate on;
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_http_version 1.1;
proxy_pass http://focalboard;
}
}
EOF
sudo cat << 'EOF' | sudo tee /etc/init.d/focalboard
#!/bin/sh
### BEGIN INIT INFO
# Provides: focalboard
# Required-Start: $syslog $network
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: A self-hosted Git service written in Go.
# Description: A self-hosted Git service written in Go.
### END INIT INFO
. /lib/lsb/init-functions
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="Focalboard server"
NAME=focalboard
SERVICEVERBOSE=yes
PIDFILE=/run/$NAME.pid
STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}"
do_start()
{
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
--background --chdir /var/lib/focalboard \
--exec /var/lib/focalboard/bin/focalboard-server
}
do_stop()
{
kill -9 $(cat /run/focalboard.pid)
# does not work
#start-stop-daemon --stop --quiet --retry=$STOP_SCHEDULE --pidfile $PIDFILE --name $NAME --oknodo
rm -f $PIDFILE
}
do_status()
{
if [ -f $PIDFILE ]; then
if kill -0 $(cat "$PIDFILE"); then
echo "$NAME is running, PID is $(cat $PIDFILE)"
else
echo "$NAME process is dead, but pidfile exists"
fi
else
echo "$NAME is not running"
fi
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
do_start
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
;;
status)
do_status
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
do_start
;;
*)
log_daemon_msg "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
exit 2
;;
esac
exit 0
EOF
sudo chmod 755 /etc/init.d/focalboard
sudo update-rc.d focalboard defaults
mysql -u XXX -pYYY
DBの作成
CREATE DATABASE boards;
GRANT ALL on boards.* to 'boardsuser'@'localhost' identified by 'boardsuser-password';
exit
DBとportの変更
nano /var/lib/focalboard/config.json
port
とdbtype
を以下の内容に書き換え
"port": 15001,
"dbtype": "mysql",
起動
以下を叩き http://focalboard.test/ にアクセスできればOK
sudo service focalboard start
感想
Notionっぽいけどかなりしょぼい
ボードが作れてmdが書ける程度
2カラムレイアウト作るとか、画像をドラッグで移動するとかはできない
表組みへの画像挿入は「画像添付 -> 表のmdを書く -> HTMLからblob URLを貼る」で可能だが、見切れるので微妙
今のところ実用性はあまりないかも