bastille restart $JAILNAME
bastille pkg $JAILNAME install -y $PACKAGES
-bastille cmd $JAILNAME pw user add mastodon -m -h -
-jexec -U mastodon $JAILNAME /bin/sh <<SCRIPT
+bastille cmd $JAILNAME pw user add mastodon -m -h - -s /bin/sh
+
+# Install ruby
+bastille cp $JAILNAME ruby/$RUBY_SOURCE /root/
+RUBY_DIR=$(basename $RUBY_SOURCE .tar.gz)
+jexec -U root $JAILNAME /bin/sh <<SCRIPT
+set -e
+set -x
+cd
+tar xf $RUBY_DIR.tar.gz
+cd $RUBY_DIR
+./configure
+make -j8 install
+cd
+rm -rf $RUBY_DIR $RUBY_DIR.tar.gz
+gem install bundler --no-document
+SCRIPT
+
+jexec -U mastodon $JAILNAME <<SCRIPT
set -e
set -x
git checkout -b prod $MASTODON_VERSION
bundle config deployment 'true'
bundle config without 'development test'
+# required because ruby doesn't look for native libs in /usr/local
+bundle config set build.idn-ruby --with-idn-dir=/usr/local
bundle install
yarn install --pure-lockfile
SCRIPT
bastille cp $JAILNAME env.production /home/mastodon/live/.env.production
rm env.production
-jexec -U mastodon $JAILNAME /bin/sh -c 'cd ~/live && RAILS_ENV=production bundle exec rails assets:precompile'
+jexec -U mastodon $JAILNAME <<'SCRIPT'
+cd ~/live
+export RAILS_ENV=production
+bundle exec rails assets:precompile
+SCRIPT
bastille mount $JAILNAME $DATA_PATH/media usr/home/mastodon/live/public/system nullfs rw 0 0
jexec $JAILNAME /usr/sbin/chown mastodon:mastodon /home/mastodon/live/public/system
FREEBSD_RELEASE=13.1-RELEASE
+RUBY_SOURCE=ruby-3.0.6.tar.gz
# mainline
#MASTODON_REPO="https://github.com/tootsuite/mastodon.git"
# Awesome Garden Hometown
MASTODON_REPO="chip@yomiko:git/hometown.git"
-MASTODON_VERSION="origin/awesome-garden-main"
+MASTODON_VERSION="awesome-garden-main-2"
postgresql15-client
protobuf
readline
-ruby
-ruby30-gems
-rubygem-bundler
yarn-node16
zsh