Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18.1 update/bugfix release #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ turnkey-tracks-18.1 (1) turnkey; urgency=low

* v18.1 rebuild - includes latest Debian & TurnKey packages.

* Update Tracks: v2.7.1.
* Install latest Tracks release: v2.7.1
- install via git using release tag (v18.0 used 'master').

* fix DB corruption on reboot - closes #1983.
* Use oldest stable Ruby: v3.1.x (Tracks notes v3.0.x - but that is now
EOL).

* Rebuild to fix DB corruption on reboot - closes #1983.

* Adds 'mariadb_admin' DB user - exclusively for use in the Webmin MariaDB
module. Part of #1945.

* Configuration console (confconsole) - v2.1.6:
- Bugfix broken DNS-01 Let's Encrypt challenge - closes #1876 & #1895.
Fixed in v2.1.5 - already included in some appliances.
- Let's Encrypt/Dehydrated - bugfix cron failure - closes #1962.
- General dehydrated-wrapper code cleanup - now passes shellcheck.
[Jeremy Davis <[email protected]>]

* Reduce log noise by creating ntpsec log dir - closes #1952.

* Apache mod_evasive config improvements:
- Bump DOSPageCount from (default) 2 -> 5 - closes #1951.
- DOSLogDir - use default log dir & fix permissions - closes #1950.
- Add DOSWhitelist example - commented out.
- Add DOSWhitelist example in conf - commented out.

-- Jeremy Davis <[email protected]> Wed, 25 Sep 2024 05:08:41 +0000
-- Jeremy Davis <[email protected]> Tue, 08 Oct 2024 21:07:30 +0000

turnkey-tracks-18.0 (1) turnkey; urgency=low

Expand Down
17 changes: 0 additions & 17 deletions conf.d/downloads

This file was deleted.

47 changes: 19 additions & 28 deletions conf.d/main
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash -ex

SRC=/usr/local/src
WEBROOT=/var/www/tracks

Expand All @@ -9,38 +8,26 @@ ADMIN_PASS=turnkey1
# start mysql
service mysql start

# install tracks and configure it
unzip $SRC/tracks-*.zip -d $(dirname $WEBROOT)
rm $SRC/tracks-*.zip
[[ -z "$FAB_HTTP_PROXY" ]] || export http_proxy=$FAB_HTTP_PROXY
[[ -z "$FAB_HTTPS_PROXY" ]] || export https_proxy=$FAB_HTTPS_PROXY

# clone repo
REPO=TracksApp/tracks
VERSION=$(gh_releases $REPO | grep -iv 'ALPHA\|BETA\|RC' | sort -V | tail -1)
mv $WEBROOT $WEBROOT.orig
mv $(dirname $WEBROOT)/tracks-* $WEBROOT
cp $WEBROOT.orig/config/database.yml $WEBROOT/config/database.yml
rm -rf $WEBROOT.orig
git clone --branch=$VERSION https://github.com/$REPO $WEBROOT

# config
cp $WEBROOT.orig/config/database.yml $WEBROOT/config/database.yml
cp $WEBROOT/config/site.yml.tmpl $WEBROOT/config/site.yml
rm $WEBROOT/.ruby-version # required to install on latest Ruby stable (v3.1)

rm $WEBROOT/.ruby-version

# install
cd $WEBROOT

[[ -z "$FAB_HTTP_PROXY" ]] || export http_proxy=$FAB_HTTP_PROXY
[[ -z "$FAB_HTTPS_PROXY" ]] || export https_proxy=$FAB_HTTPS_PROXY

# rails fixes
echo >> Gemfile
echo '# TKL: Fixes for old Rails with new Ruby causing issues' >> Gemfile
echo gem "'psych', '< 4'" >> Gemfile
echo gem "'net-smtp', require: false" >> Gemfile
echo gem "'net-pop', require: false" >> Gemfile

# fix broken dep - see https://github.com/TracksApp/tracks/blob/ruby31/Gemfile#L32
sed -i "\|^gem 'therubyracer',|s|'therubyracer'|'mini_racer'|" Gemfile

export RAILS_ENV="production"
bundle config set --local path 'vendor/bundle'
bundle config set --local without 'postgresql sqlite'
bundle update
bundle install
bundle exec rake db:migrate

# configure permissions
Expand All @@ -49,7 +36,11 @@ chown -R www-data:www-data $WEBROOT/{tmp,log,public/uploads}
chmod 666 $WEBROOT/log/*

# precompile assets
bundle exec rake assets:precompile RAILS_ENV=production
# Setting 'RAILS_GROUPS=assets' works around
# https://github.com/TracksApp/tracks/issues/3065
# See https://github.com/TracksApp/tracks/issues/3065#issuecomment-2400803381
# for reason/rationale.
RAILS_GROUPS=assets bundle exec rake assets:precompile

# turnkey-credit (passenger substitute x2 bug)
cat >>$WEBROOT/app/assets/stylesheets/tracks.css.scss<<EOF
Expand Down Expand Up @@ -87,10 +78,10 @@ curl -s -X POST -b /tmp/cookies.txt http://localhost/users \
--data-urlencode "user%5Bpassword%5D=${ADMIN_PASS}" \
--data-urlencode "user%5Bpassword_confirmation%5D=${ADMIN_PASS}"

# clean up
# clean up & finalize
rm -rf $WEBROOT.orig
unset RAILS_ENV http_proxy https_proxy
rm -f /tmp/cookies.txt

# stop services
rails tmp:clear
service mysql stop
service apache2 stop