Skip to content

Commit

Permalink
Merge branch '16-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
JedMeister committed May 6, 2020
2 parents 6160659 + 1a88e4b commit 9f148b4
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 616 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
COMMON_OVERLAYS = tkl-webcp
COMMON_CONF = tkl-webcp

include $(FAB_PATH)/common/mk/turnkey/lamp.mk
include $(FAB_PATH)/common/mk/turnkey.mk
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ and on top of that:
they **ARE NOT** configured to install automatically. See `CakePHP
documentation`_ for upgrading.

- Includes TurnKey Web Control panel with links to useful references,
relevant path information, and CakePHP checks (convenience).
- Includes a turnkey php shim with links to useful references,
relevant path information.
- SSL support out of the box.
- `Adminer`_ administration frontend for MySQL (listening on port
12322 - uses SSL).
Expand All @@ -36,5 +36,5 @@ Credentials *(passwords set at first boot)*

.. _CakePHP: https://cakephp.org/
.. _TurnKey Core: https://www.turnkeylinux.org/core
.. _CakePHP documentation: https://book.cakephp.org/3.0/en/upgrade-tool.html
.. _CakePHP documentation: https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html
.. _Adminer: https://www.adminer.org/
26 changes: 26 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
turnkey-cakephp-16.0 (1) turnkey; urgency=low

* Latest upstream version of CakePHP - v4.0.7.

* Replace turnkey landing page with turnkey-shim injected
into cakephp's landing page at build time.

* Explcitly disable TLS<1.2 (i.e. SSLv3, TLSv1, TLSv1.1). (v15.x
TurnKey releases supported TLS 1.2, but could fallback as low as TLSv1).

* Update SSL/TLS cyphers to provide "Intermediate" browser/client support
(suitable for "General-purpose servers with a variety of clients,
recommended for almost all systems"). As provided by Mozilla via
https://ssl-config.mozilla.org/.

* Updated all relevant Debian packages to Buster/10 versions; including
PHP 7.3.

* Updated version of mysqltuner script - now installed as per upstream
recommendation.

* Note: Please refer to turnkey-core's changelog for changes common to all
appliances. Here we only describe changes specific to this appliance.

-- Stefan Davis <stefan@turnkeylinux.org> Wed, 06 May 2020 16:32:58 +1000

turnkey-cakephp-15.1 (1) turnkey; urgency=low

* Latest upstream version of CakePHP (v3.6.13)
Expand Down
37 changes: 24 additions & 13 deletions conf.d/main
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,39 @@ chown -R root:root $WEBROOT
chown -R www-data:www-data $WEBROOT/tmp

# tweak configuration
CONF=$WEBROOT/config/app.php
CONF=$WEBROOT/config/app_local.php

sed -i "\
s#\\('salt' => \\)'.\\+'#\\1'$(mcookie)'#; \
/Datasources/,/ \\],/{ \
s#\\('salt' => \\).*#\\1'$(mcookie)'#; \
/Datasources/,/^ \\],/{ \
s#\\('username' => \\)'.*'#\\1'cakephp'#; \
s#\\('database' => \\)'.*'#\\1'cakephp'#; \
s#\\('password' => \\)'.*'#\\1'$DB_PASS'# \
}; \
/EmailTransport/,/ \\]/ \
s#\\('className' => \\)'Mail'#\\1'Smtp'# \
" $CONF
sed -i "\
/Datasources/ { a\
\ 'debug_kit' => [\n\
'className' => 'Cake\\\\Database\\\\Connection',\n\
'driver' => 'Cake\\\\Database\\\\Driver\\\\Mysql',\n\
'persistent' => false,\n\
'host' => 'localhost',\n\
'port' => '3306',\n\
'database' => 'cakephp',\n\
'username' => 'cakephp',\n\
'password' => '$DB_PASS',\n\
'timezone' => 'UTC',\n\
'flags' => [],\n\
'log' => false,\n\
],\n\
};" $CONF
sed -i "/DebugKit/,/<hr>/ {
/<hr>/a\
<?php include 'turnkey-shim.php' ?>
};" /var/www/cakephp/templates/Pages/home.php

chown www-data:www-data $CONF
chmod 640 $CONF
Expand All @@ -46,13 +67,3 @@ service mysql stop
a2dissite 000-default
a2ensite cakephp
a2enmod rewrite

# setup tkl-webcp
mv /var/www/js/* $WEBROOT/webroot/js/; rm -rf /var/www/js
mv /var/www/css/* $WEBROOT/webroot/css/; rm -rf /var/www/css
mv /var/www/images/* $WEBROOT/webroot/img/; rm -rf /var/www/images

ln -s $WEBROOT/webroot/img $WEBROOT/webroot/images

cp -TdR $SRC/cakephp.overlay $WEBROOT
rm -rf $SRC/cakephp.overlay
6 changes: 3 additions & 3 deletions overlay/usr/lib/inithooks/firstboot.d/20regen-cakephp-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

. /etc/default/inithooks

CONF=/var/www/cakephp/config/app.php
sed -i "s#\\('salt' => \\)'.\\+'#\\1'$(mcookie)'#" $CONF
CONF=/var/www/cakephp/config/app_local.php
sed -i "s#\\('salt' => \\).*#\\1'$(mcookie)'#" $CONF

PASSWORD=$(mcookie)
sed -i "\
/Datasources/,/ \\],/{ \
/Datasources/,/^ \\],/{ \
s#\\('password' => \\)'.*'#\\1'$PASSWORD'# \
}; \
" $CONF
Expand Down

This file was deleted.

180 changes: 0 additions & 180 deletions overlay/usr/local/src/cakephp.overlay/src/Template/Pages/home.ctp

This file was deleted.

Loading

0 comments on commit 9f148b4

Please sign in to comment.