Installing sgx-jmp in an Incus container
Container setup and prerequisites
incus launch images:debian/12 sgx-jmp
incus shell sgx-jmp
apt install build-essential ruby ruby-dev git redis libhiredis-dev postgresql-15 postgresql-server-dev-15 postgresql-postgis sqitch
adduser --disabled-password jmp
PostgreSQL foreign data wrapper for Redis
git clone https://github.com/pg-redis-fdw/redis_fdw
cd redis_fdw
make
make install
PostgreSQL setup
sudo -u postgres psql -c "CREATE ROLE jmp LOGIN"
sudo -u postgres psql -c "CREATE DATABASE jmp WITH OWNER jmp"
sudo -u postgres psql -d jmp -c "CREATE EXTENSION btree_gist"
sudo -u postgres psql -d jmp -c "CREATE EXTENSION citext"
sudo -u postgres psql -d jmp -c "CREATE EXTENSION pgcrypto"
sudo -u postgres psql -d jmp -c "CREATE EXTENSION postgis"
sudo -u postgres psql -d jmp -c "CREATE EXTENSION redis_fdw"
sudo -u postgres psql -d jmp -c "CREATE SERVER redis_server FOREIGN DATA WRAPPER redis_fdw OPTIONS (address '127.0.0.1', port '6379')"
sudo -u postgres psql -d jmp -c "CREATE USER MAPPING FOR PUBLIC server redis_server"
sudo -u postgres psql -d jmp -c "GRANT ALL ON FOREIGN SERVER redis_server TO jmp"
PostgreSQL initialisation
su - jmp
git clone https://git.singpolyma.net/sgx-jmp
cd sgx-jmp/schemas
sqitch deploy
sgx-jmp setup
su - jmp
cd sgx-jmp
bundle3.1 install --path=.gems
cp config.dhall.sample config.dhall
Edit config.dhall
and fill in details for Braintree, local Prosody, etc.
bundle exec ruby sgx_jmp.rb ./config.dhall