2
0

Added a new recipe: wondercms_php8.

This commit is contained in:
2025-03-05 21:01:39 +01:00
parent e3b0dd03de
commit 48faad59c7
11 changed files with 3901 additions and 0 deletions

BIN
.metadata

Binary file not shown.

View File

View File

@ -0,0 +1,46 @@
# WonderCMS Flat File application with official Apache 2.4.x and PHP 8.x.
#
# This recipe doesn't extend the official image, it keeps all necessary
# modifications in the container. The application itself must be added
# with a persistent volume.
#
# Based on https://github.com/robiso/docker-wondercms/
#
services:
# https://github.com/WonderCMS/wondercms
# https://github.com/robiso/docker-wondercms/
# https://hub.docker.com/_/php
wondercms:
image: php:8-apache
restart: unless-stopped
# Take a look the possible public port collision.
ports:
- 8201:80
volumes:
- /etc/localtime:/etc/localtime:ro
# Needs R/W for UID 33 (www-data).
- ./storage/volumes/wonder_html/:/var/www/html/
environment:
TZ: Europe/Budapest
# We don't want to extend the official image to maintain
# watchtower's monitoring for updates. So we use CMD to
# make all the necessary changes. Unfortunately this will
# slightly prolong the start of the service.
command:
- /bin/bash
- -c
- |
DEBIAN_FRONTEND=noninteractive apt update
apt install -y libzip-dev zip
apt clean
rm -rf /var/lib/apt/lists/*
docker-php-ext-configure zip
docker-php-ext-install zip
a2enmod rewrite
cp -p /usr/local/etc/php/php.ini-production /usr/local/etc/php/conf.d/php.ini
apache2-foreground
extra_hosts:
- "host.docker.internal:host-gateway"
labels:
com.centurylinklabs.watchtower.enable: true

View File

@ -0,0 +1,8 @@
Options -Indexes
ServerSignature Off
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
RewriteRule database.js - [F]
RewriteRule cache.json - [F]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,557 @@
@font-face {
font-family: 'Catamaran';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('fonts/catamaran-v7-latin-ext_latin-regular.woff2') format('woff2')
}
@font-face {
font-family: 'Catamaran';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('fonts/catamaran-v7-latin-ext_latin-700.woff2') format('woff2')
}
@font-face {
font-family: 'Catamaran';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url('fonts/catamaran-v7-latin-ext_latin-900.woff2') format('woff2')
}
html, body, div, span, applet, object,
iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, a, abbr, acronym, address, big, cite,
code, del, dfn, em, img, ins, kbd, q, s, samp, strike, strong, sub, sup, tt, var, b,
u, i, center, dl, dt, dd, li, fieldset,
form, label, legend, caption,
tfoot, article, aside,
canvas, details, embed, figure, figcaption,
footer, header, hgroup, menu, nav, output, ruby,
section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline
}
html, body {
box-shadow: 0 0 200px rgba(0, 0, 0, 0.27) inset;
background-image: -webkit-linear-gradient(45deg, rgb(102, 95, 238) 0%, rgb(39, 194, 222) 100%);
min-height: 100%;
font-family: 'Catamaran';
color: #fff !important
}
.actions li {
list-style: none
}
input::-moz-focus-inner {
border: 0;
padding: 0
}
/* Basic */
html {
box-sizing: border-box
}
*, *:before, *:after {
box-sizing: inherit
}
/* Type */
body, select, textarea {
color: rgba(255, 255, 255, 0.8);
font-size: 16.5pt;
font-weight: normal;
line-height: 1.75
}
@media screen and (max-width: 1680px) {
body, input, select, textarea {
font-size: 13pt
}
}
@media screen and (max-width: 1280px) {
body, input, select, textarea {
font-size: 12pt
}
}
@media screen and (max-width: 360px) {
body, input, select, textarea {
font-size: 11pt
}
}
a {
-moz-transition: color 0.2s ease, border-bottom-color 0.2s ease;
-webkit-transition: color 0.2s ease, border-bottom-color 0.2s ease;
-ms-transition: color 0.2s ease, border-bottom-color 0.2s ease;
transition: color 0.2s ease, border-bottom-color 0.2s ease;
border-bottom: dotted 1px rgba(255, 255, 255, 0.35);
color: inherit;
text-decoration: none
}
a:hover {
border-bottom: solid 1px rgba(255, 255, 255, 0.88);
color: #ffffff
}
strong, b {
color: #ffffff;
font-weight: bold
}
em, i {
font-style: italic
}
p {
margin: 0 0 2em 0
}
h1, h2, h3, h4, h5, h6 {
color: #ffffff;
font-weight: bold;
line-height: 1.5
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: inherit;
text-decoration: none
}
h1 {
font-size: 2.75em
}
h2 {
font-size: 1.75em
}
h3 {
font-size: 1.1em
}
h4 {
font-size: 1em
}
h5 {
font-size: 0.8em
}
h6 {
font-size: 0.6em
}
@media screen and (max-width: 736px) {
h1 {
font-size: 3em
}
h2 {
font-size: 1.75em
}
h3 {
font-size: 1em
}
h4 {
font-size: 0.8em
}
h5 {
font-size: 0.6em
}
h6 {
font-size: 0.6em
}
}
code {
background: rgba(255, 255, 255, 0.05);
border-radius: 0.25em;
border: solid 1px rgba(255, 255, 255, 0.15);
font-family: "Courier New", monospace;
font-size: 0.9em;
margin: 0 0.25em;
padding: 0.25em 0.65em
}
pre {
-webkit-overflow-scrolling: touch;
font-family: "Courier New", monospace;
font-size: 0.9em;
margin: 0 0 2em 0
}
pre code {
display: block;
line-height: 1.75em;
padding: 1em 1.5em;
overflow-x: auto
}
.text-center {
text-align: center
}
/* Button */
input[type="button"],
button,
.button {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
-moz-transition: border-color 0.2s ease;
-webkit-transition: border-color 0.2s ease;
-ms-transition: border-color 0.2s ease;
transition: border-color 0.2s ease;
background-color: #fff;
border: solid 1px !important;
border-color: rgba(255, 255, 255, 0.15) !important;
border-radius: 3em;
color: #393939 !important;
cursor: pointer;
display: inline-block;
font-size: 0.7em;
font-weight: bold;
letter-spacing: 0.25em;
line-height: 4.75em;
outline: 0;
padding: 0 3.75em;
position: relative;
text-align: center;
text-decoration: none;
text-transform: uppercase;
white-space: nowrap
}
input[type="button"]:after,
button:after,
.button:after {
-moz-transform: scale(0.25);
-webkit-transform: scale(0.25);
-ms-transform: scale(0.25);
transform: scale(0.25);
pointer-events: none;
-moz-transition: opacity 0.2s ease, -moz-transform 0.2s ease;
-webkit-transition: opacity 0.2s ease, -webkit-transform 0.2s ease;
-ms-transition: opacity 0.2s ease, -ms-transform 0.2s ease;
transition: opacity 0.2s ease, transform 0.2s ease;
background: #ffffff;
border-radius: 3em;
content: '';
height: 100%;
left: 0;
opacity: 0;
position: absolute;
top: 0;
width: 100%
}
input[type="button"]:hover,
button:hover,
.button:hover {
border-color: rgba(255, 255, 255, 0.6) !important
}
input[type="button"]:hover:after,
button:hover:after,
.button:hover:after {
opacity: 0.05;
-moz-transform: scale(1);
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1)
}
input[type="button"]:hover:active,
button:hover:active,
.button:hover:active {
border-color: #ffffff !important
}
input[type="button"]:hover:active:after,
button:hover:active:after,
.button:hover:active:after {
opacity: 0.1
}
input[type="password"] {
border: 0;
outline: 0;
padding: 15px;
border-radius: 10px;
width: 300px
}
/* Wrapper */
.wrapper {
position: relative
}
.wrapper > .inner {
width: 100%;
padding: 5em 4em 2em 4em
}
@media screen and (max-width: 1680px) {
footer > .inner {
padding: 2em 4em 2em 4em !important
}
}
@media screen and (max-width: 736px) {
.wrapper > .inner {
padding: 2em 2em 2em 2em
}
footer > .inner {
padding: 2em 2em 2em 2em !important
}
}
.wrapper.style2 {
background-color: #5052b5
}
.wrapper.fullscreen {
min-height: calc(87vh - 2.5em)
}
@media screen and (max-width: 736px) {
.wrapper.fullscreen {
min-height: calc(40vh - 5.5em)
}
}
/* Wrapper */
#topMenu + #wrapper {
margin-left: 0;
position: relative
}
@media screen and (max-width: 736px) {
#topMenu + #wrapper {
padding-top: 0;
top: 2em
}
}
#header + #wrapper > .wrapper > .inner {
margin: 0 auto
}
/* Menu */
#topMenu {
padding: 0;
background:0;
cursor: default;
height: 5.4em;
left: 0;
text-align: center;
top: 0;
width: 100%;
line-height: 3.5em;
position: relative;
z-index: 20
}
#topMenu > .inner {
display: -moz-flex;
display: -webkit-flex;
display: -ms-flex;
display: flex;
-moz-flex-direction: row;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-moz-justify-content: center;
-webkit-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
-moz-transition: opacity 1s ease;
-webkit-transition: opacity 1s ease;
-ms-transition: opacity 1s ease;
transition: opacity 1s ease;
min-height: 100%;
opacity: 1;
width: 100%
}
#topMenu nav {
height: inherit;
line-height: inherit;
margin-top: 1em
}
#topMenu nav ul {
display: -moz-flex;
display: -webkit-flex;
display: -ms-flex;
display: flex;
height: inherit;
line-height: inherit;
list-style: none;
padding: 0
}
#topMenu nav a {
height: inherit;
line-height: inherit;
padding: 0
}
#topMenu nav > ul > li {
margin: 0 1em 0 1em;
opacity: 1;
padding: 0;
position: relative;
height: inherit;
line-height: inherit
}
#topMenu nav a {
border: 0;
font-size: 0.70em;
font-weight: bold;
letter-spacing: 0.25em;
line-height: 1.75;
outline: 0;
padding: 2em 0;
position: relative;
text-decoration: none;
text-transform: uppercase
}
#topMenu nav li.active, nav li.active a {
color: #fff !important
}
#topMenu nav .active a{
border-bottom: 1px solid #ffffff7d
}
#topMenu nav a:hover {
border-bottom: 1px solid #ffffff59
}
#topMenu nav a.active {
color: #ffffff
}
#topMenu nav a.active:after {
max-width: 100%
}
@media screen and (max-width: 736px) {
#topMenu {
height: auto;
font-size: 0.94em;
position: relative;
background-color: rgba(0, 0, 0, 0.30);
padding-bottom: 20px
}
#topMenu nav ul {
display: block;
float: left
}
#topMenu nav > ul > li {
display: block;
float: left;
margin: 0 1em 0 2em
}
#topMenu nav .active a {
border-bottom: 1px solid #fff
}
footer {
font-size: 1em
}
}
/* Intro */
#intro p {
font-size: 1.25em
}
@media screen and (max-width: 736px) {
#intro p {
font-size: 1em
}
}
/* Footer */
footer {
text-align: right
}
/* Submenus */
.subPageDropdown a {
border: 0 !important
}
.subPageDropdown ul {
margin: 0;
padding-left: 0
}
.subPageDropdown li {
color: #fff;
display: block;
float: left;
position: relative;
padding: 0 1em 0 1em;
text-decoration: none;
transition-duration: 0.5s
}
#topMenu li a {
color: rgba(255, 255, 255, 0.8)
}
#topMenu li:hover,
#topMenu li:focus-within {
cursor: pointer
}
#topMenu li:focus-within a {
outline: none
}
#topMenu .nav-item {
margin-top: 5px
}
ul.subPageDropdown {
visibility: hidden;
opacity: 0;
position: absolute;
margin-top: 10px;
display: none;
padding-left: 10px !important
}
#topMenu ul li:hover > ul,
#topMenu ul li:focus-within > ul,
#topMenu ul li ul:hover,
#topMenu ul li ul:focus {
visibility: visible;
opacity: 1;
display: block
}
#topMenu ul li ul li {
clear: both;
text-align: left;
background-color: rgba(0, 0, 0, 0.30);
white-space: nowrap
}
/* Submenus dropdown arrow */
.menu li > a:after {
content: ' ▼';
font-weight: bold
}
.menu > li > a:after {
content: ' ▼';
font-weight: bold
}
.menu li > a:only-child:after {
content: ''
}

View File

@ -0,0 +1,84 @@
<?php global $Wcms ?>
<!DOCTYPE html>
<html lang="<?= $Wcms->getSiteLanguage() ?>">
<head>
<!-- Encoding, browser compatibility, viewport -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Search Engine Optimization (SEO) -->
<meta name="title" content="<?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?>" />
<meta name="description" content="<?= $Wcms->page('description') ?>">
<meta name="keywords" content="<?= $Wcms->page('keywords') ?>">
<meta property="og:url" content="<?= $this->url() ?>" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?= $Wcms->get('config', 'siteTitle') ?>" />
<meta property="og:title" content="<?= $Wcms->page('title') ?>" />
<meta name="twitter:site" content="<?= $this->url() ?>" />
<meta name="twitter:title" content="<?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?>" />
<meta name="twitter:description" content="<?= $Wcms->page('description') ?>" />
<!-- Website and page title -->
<title>
<?= $Wcms->get('config', 'siteTitle') ?> - <?= $Wcms->page('title') ?>
</title>
<!-- Admin CSS -->
<?= $Wcms->css() ?>
<!-- Theme CSS -->
<link rel="stylesheet" rel="preload" as="style" href="<?= $Wcms->asset('css/style.css') ?>">
</head>
<body>
<!-- Admin settings panel and alerts -->
<?= $Wcms->settings() ?>
<?= $Wcms->alerts() ?>
<section id="topMenu">
<div class="inner">
<nav>
<ul class="menu">
<!-- Menu -->
<?= $Wcms->menu() ?>
</ul>
</nav>
</div>
</section>
<div id="wrapper">
<section id="intro" class="wrapper style1 fullscreen">
<div class="inner">
<!-- Main content for each page -->
<?= $Wcms->page('content') ?>
</div>
</section>
<section class="wrapper style2">
<div class="inner">
<!-- Static editable block, same on each page -->
<?= $Wcms->block('subside') ?>
</div>
</section>
</div>
<footer class="wrapper style2">
<div class="inner">
<!-- Footer -->
<?= $Wcms->footer() ?>
</div>
</footer>
<!-- Admin JavaScript. More JS libraries can be added below -->
<?= $Wcms->js() ?>
</body>
</html>

View File

@ -0,0 +1,13 @@
{
"version": 1,
"themes": {
"sky": {
"name": "Sky",
"repo": "https://github.com/robiso/sky/tree/master",
"zip": "https://github.com/robiso/sky/archive/master.zip",
"summary": "Default WonderCMS theme (2022). Theme works without Bootstrap and jQuery.",
"version": "3.2.4",
"image": "https://raw.githubusercontent.com/robiso/sky/master/preview.jpg"
}
}
}

View File

@ -0,0 +1,125 @@
#!/bin/bash
#
# A service script to backup the entire WonderCMS website.
# Creates a tarball in $BASE_DIR/storage/backups/tarballs folder
# (by default). An optional parameter may change the target folder.
#
# Call as a Docker manager user (member of the docker Linux group) via cron.
#
# Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
# License: GNU/GPL 3+ https://www.gnu.org/licenses/gpl-3.0.en.html
# 2025-03-05 v0.2
# mod: gitbackup handling stub has been temporarily removed.
# 2025-01-14 v0.1 Initial version.
# Accepted environment variables and their defaults.
#
PAR_BASEDIR=${PAR_BASEDIR:-""} # Service's base folder
PAR_BACKUPDIR=${PAR_BACKUPDIR:-""} # Folder to dump within
# Messages (maybe overridden by configuration).
#
MSG_DOCKERGRPNEED="You must be a member of the docker group."
MSG_DOESNOTRUN="This service doesn't run."
MSG_MISSINGDEP="Fatal: missing dependency"
MSG_MISSINGYML="Fatal: didn't find the docker-compose.yml file"
MSG_NONWRITE="The target directory isn't writable"
MSG_NOLOCATE="Cannot locate the WonderCMS container."
# Other initialisations.
#
BACKUPDIR="storage/backups/tarballs" # Folder to dump within
GITBACKUP="storage_gitbackup.sh" # Git backup utility
SERVICENAME="wondercms" # The composed WonderCMS service
USER=${USER:-LOGNAME} # Fix for cron enviroment only
YMLFILE="docker-compose.yml"
# Checks the dependencies.
#
TR=$(which tr 2>/dev/null)
if [ -z "$TR" ]; then echo "$MSG_MISSINGDEP tr."; exit 1 ; fi
for item in basename cat cut date dirname docker \
find grep hostname id pwd tail xargs
do
if [ -n "$(which $item)" ]
then export $(echo $item | "$TR" '[:lower:]' '[:upper:]' | "$TR" '-' '_')=$(which $item)
else echo "$MSG_MISSINGDEP $item." >&2; exit 1; fi
done
# All dependencies are available via "$THECOMMAND" (upper case) call.
#
# Let's find which version of docker-compose is installed.
if [ $($DOCKER compose version 2>&1 >/dev/null; echo $?) -eq 0 ]; then
# We'll use v2 if it is available.
DOCKER_COMPOSE="$DOCKER"
commandstring="compose"
else
# Otherwise falling back to v1.
DOCKER_COMPOSE="$(which docker-compose)"
commandstring=""
fi
# One of the two is mandatory.
if [ -z "$DOCKER_COMPOSE" ];then echo "$MSG_MISSINGDEP docker-compose" >&2; exit 1; fi
# Below docker-compose should be called as "$DOCKER_COMPOSE" $commandstring sequence.
# Where I'm?
# https://gist.github.com/TheMengzor/968e5ea87e99d9c41782
SOURCE="$0"
while [ -h "$SOURCE" ]; do
# resolve $SOURCE until the file is no longer a symlink
SCRPATH="$( cd -P "$("$DIRNAME" "$SOURCE" )" && echo "$PWD" )" #"
SOURCE="$("$READLINK" "$SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it
# relative to the path where the symlink file was located
[[ $SOURCE != /* ]] && SOURCE="$SCRPATH/$SOURCE"
done; SCRPATH="$( cd -P "$("$DIRNAME" "$SOURCE" )" && echo "$PWD" )" #"
# Need to be root or a Docker manager user.
#
[[ "$USER" != 'root' ]] \
&& [[ -z "$(echo "$("$ID" -Gn "$USER") " | "$GREP" ' docker ')" ]] \
&& echo "$MSG_DOCKERGRPNEED" >&2 && exit 1 #"
# Searches the base folder, containing a docker-compose.yml file.
#
# Called from the base folder (./)?
BASE_DIR="$PAR_BASEDIR"
TEST_DIR="$SCRPATH"
[[ -z "$BASE_DIR" ]] && [[ -r "$TEST_DIR/$YMLFILE" ]] && BASE_DIR="$TEST_DIR"
# Called from ./tools?
TEST_DIR="$("$DIRNAME" "$TEST_DIR")"
[[ -z "$BASE_DIR" ]] && [[ -r "$TEST_DIR/$YMLFILE" ]] && BASE_DIR="$TEST_DIR"
# Called from ./tools/*.d?
TEST_DIR="$("$DIRNAME" "$TEST_DIR")"
[[ -z "$BASE_DIR" ]] && [[ -r "$TEST_DIR/$YMLFILE" ]] && BASE_DIR="$TEST_DIR"
# On failure gives it up here.
if [ -z "$BASE_DIR" -o ! -r "$BASE_DIR/$YMLFILE" ]; then
echo "$MSG_MISSINGYML" >&2; exit 1
fi
# Sets the absolute paths.
BACKUPDIR="${PAR_BACKUPDIR:-$BASE_DIR/$BACKUPDIR}"
# The dump target folder must be writable.
#
[[ ! -w "$BACKUPDIR" ]] \
&& echo "$MSG_NONWRITE: $BACKUPDIR" >&2 && exit 1
# The service must be running - silently gives up here if not.
#
[[ -z "$(cd "$BASE_DIR"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \
&& exit 1
# Converts the service name to an actual running container's name.
#
MYCONTAINER="$("$DOCKER" inspect -f '{{.Name}}' $(cd "$BASE_DIR"; "$DOCKER_COMPOSE" $commandstring ps -q "$SERVICENAME") | "$CUT" -c2-)"
# Gives up here if failed.
if [ -z "$MYCONTAINER" ]; then echo "$MSG_NOLOCATE" >&2; exit 1; fi
# Tries the FS backup.
if [ -w "$BACKUPDIR" ]; then
BACKUP_NAME=$MYCONTAINER.$("$DATE" '+%Y%m%d_%H%M%S').$("$HOSTNAME")
"$DOCKER" exec $MYCONTAINER sh \
-c "cd /var/www/html; tar cz ." \
> "$BACKUPDIR/$BACKUP_NAME.tgz" 2>>"$BACKUPDIR/$BACKUP_NAME.log"
fi
# That's all, Folks! :)