From 5b439c6975baf55cea38984a36a06d143eaab93c Mon Sep 17 00:00:00 2001 From: Bertrand Date: Thu, 2 Jun 2022 13:14:13 +0000 Subject: [PATCH] Add focalboard (docker-compose;focalboard settings;nginx settings;install script) --- focalboard/config.json | 17 +++++++ focalboard/docker-compose.yml | 12 +++++ focalboard/focalboard.noobtoroot.xyz | 70 ++++++++++++++++++++++++++++ focalboard/install.sh | 35 ++++++++++++++ gitea/install.sh | 2 +- 5 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 focalboard/config.json create mode 100644 focalboard/docker-compose.yml create mode 100644 focalboard/focalboard.noobtoroot.xyz create mode 100644 focalboard/install.sh diff --git a/focalboard/config.json b/focalboard/config.json new file mode 100644 index 0000000..50a8063 --- /dev/null +++ b/focalboard/config.json @@ -0,0 +1,17 @@ +{ + "serverRoot": "http://localhost:8000", + "port": 8000, + "dbtype": "sqlite3", + "dbconfig": "/var/lib/focalboard/focalboard.db", + "postgres_dbconfig": "dbname=focalboard sslmode=disable", + "useSSL": false, + "webpath": "./pack", + "filespath": "/var/lib/focalboard/file", + "telemetry": true, + "prometheus_address": ":9092", + "session_expire_time": 2592000, + "session_refresh_time": 18000, + "localOnly": false, + "enableLocalMode": true, + "localModeSocketLocation": "/var/tmp/focalboard_local.socket" +} diff --git a/focalboard/docker-compose.yml b/focalboard/docker-compose.yml new file mode 100644 index 0000000..8c92e1e --- /dev/null +++ b/focalboard/docker-compose.yml @@ -0,0 +1,12 @@ +services: + focalboard: + image: jimmymasaru/focalboard:latest + restart: unless-stopped + ports: + - "8000:8000" + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ./config.json:/opt/focalboard/config.json + - ./focalboard:/var/lib/focalboard + diff --git a/focalboard/focalboard.noobtoroot.xyz b/focalboard/focalboard.noobtoroot.xyz new file mode 100644 index 0000000..fd55199 --- /dev/null +++ b/focalboard/focalboard.noobtoroot.xyz @@ -0,0 +1,70 @@ +upstream focalboard { + server localhost:8000; + keepalive 32; +} + +server { + + server_name focalboard.noobtoroot.xyz; + + 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://localhost:8000; + } + + 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://localhost:8000; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/focalboard.noobtoroot.xyz/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/focalboard.noobtoroot.xyz/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + +} + + +server { + if ($host = focalboard.noobtoroot.xyz) { + return 301 https://$host$request_uri; + } # managed by Certbot + + + listen 80; + + server_name focalboard.noobtoroot.xyz; + return 404; # managed by Certbot + + +} \ No newline at end of file diff --git a/focalboard/install.sh b/focalboard/install.sh new file mode 100644 index 0000000..1990514 --- /dev/null +++ b/focalboard/install.sh @@ -0,0 +1,35 @@ +# CHECK DEPENDENCIES +# { +#DOCKER +REQUIRED_PKG="docker" +PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") +echo Checking for $REQUIRED_PKG: $PKG_OK +if [ "" = "$PKG_OK" ]; then + echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG." + sudo apt-get --yes install $REQUIRED_PKG +fi + +# DOCKER-COMPOSE +REQUIRED_PKG="docker-compose" +PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") +echo Checking for $REQUIRED_PKG: $PKG_OK +if [ "" = "$PKG_OK" ]; then + echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG." + curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '