kind of working

This commit is contained in:
2025-04-11 11:06:01 +02:00
parent 0b7f362c80
commit 3349ea882d
11 changed files with 235 additions and 37 deletions

View File

@@ -1,22 +1,34 @@
# Use the official Debian image as a base # Use the official Debian image as a base
FROM debian:latest FROM debian:bullseye
# Set environment variables # Set environment variables
# ENV DEBIAN_FRONTEND=noninteractive # ENV DEBIAN_FRONTEND=noninteractive
# Update the package list and install Apache2 and MariaDB # Update the package list and install Apache2 and MariaDB
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y apache2 && \ apt-get install -y apache2 apache2-dev && \
apt-get clean && \ apt-get clean && \
a2dismod mpm_event && \
a2enmod mpm_prefork && \
# apt-get install -y libapache2-rewrite && \
a2enmod rewrite && \
apt-get install -y libapache2-mod-perl2 libperl-dev libapache2-reload-perl libapache2-request-perl libapache2-mod-apreq2 build-essential imagemagick libapreq2-3 libapache-dbi-perl libauthen-sasl-perl libauthen-passphrase-perl libcalendar-simple-perl libcrypt-blowfish-perl libcgi-pm-perl libcgi-session-perl libcgi-simple-perl libconfig-general-perl libdatetime-perl libdate-calc-perl libdate-manip-perl libdbi-perl libdbd-mysql-perl libemail-sender-perl libencode-perl libjson-perl libhtml-formattext-withlinks-andtables-perl libhtml-parser-perl libhtml-template-perl libhtml-template-compiled-perl libmime-tools-perl libsession-token-perl libtext-multimarkdown-perl libtext-unidecode-perl libtext-wikicreole-perl liburi-escape-xs-perl perlmagick sox libsox-fmt-all && \
a2enmod perl && \
service apache2 restart && \
cpan App::cpanminus && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# RUN ["cpanm", "--force", "Image::Magick", "Image::Magick::Square" ]
# RUN ["cpanm", "--force", "Apache2::Reload", "Apache2::Request", "Apache2::Upload", "Apache::DBI", "Authen::Passphrase", "Authen::Passphrase::BlowfishCrypt", "Calendar::Simple", "CGI", "CGI::Carp", "CGI::Cookie", "CGI::Session", "CGI::Simple", "Config::General", "Data::Dumper", "Date::Calc", "Date::Manip", "DateTime", "DBD::mysql", "DBI", "Digest::MD5", "Encode::Locale", "HTML::Entities", "HTML::FormatText", "HTML::Parse", "HTML::Template::Compiled", "HTML::Template::Compiled::Plugin::XMLEscape", "Image::Magick", "Image::Magick::Square", "JSON", "ModPerl::Util", "Session::Token", "Text::Diff::FormatedHtml", "Text::Markdown", "Text::WikiCreole", "URI::Escape" ]
# Copy your website files to the Apache document root (optional) # Copy your website files to the Apache document root (optional)
COPY ./install/apache2-sites/coloradio.conf /etc/conf/apache2/sites-enabled/ COPY . /var/www/html/.
COPY ./install/apache2-sites/calcms.conf /etc/apache2/sites-enabled/
COPY ./website/agenda/config/config.cgi.off /var/www/html/website/config/config.cgi
COPY ./website/agenda/config/config.cgi.off /var/www/html/website/agenda/config/config.cgi
# Expose ports for Apache and MariaDB # Expose ports for Apache and MariaDB
EXPOSE 80 EXPOSE 80
# Start both Apache and MariaDB # Start both Apache and MariaDB
CMD service apache2 start && \ CMD service apache2 restart && \
tail -f /var/log/apache2/access.log tail -f /var/log/apache2/access.log

View File

@@ -1,13 +1,13 @@
services: services:
#web: web:
# build: build:
# context: .. context: ..
# dockerfile: ./docker/Dockerfile dockerfile: ./docker/Dockerfile
# ports: ports:
# - "80:80" - "80:80"
# #volumes: #volumes:
# #- ./your-website-files:/var/www/html/ #- ../:/var/www/html/
# #- ./httpd.conf:/etc/apache2/sites-available/000-default.conf #- ./httpd.conf:/etc/apache2/sites-available/000-default.conf
db: db:
image: mariadb:10 image: mariadb:10

12
docker/initdb.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
# Call the original entrypoint script
exec docker-entrypoint.sh
# Run the first script as root
mariadb -h 127.0.0.1 -u root -p"$MYSQL_ROOT_PASSWORD" < /init/01-init.sql
#
## Run the second script as caladmin
mariadb -h 127.0.0.1 -u calcms_admin -pcaladmin000 < /init/02-create.sql

View File

@@ -6,9 +6,9 @@ LimitInternalRecursion 4
# Redirect permanent /agenda/planung https://${domain}/agenda/planung # Redirect permanent /agenda/planung https://${domain}/agenda/planung
Define domain localhost Define domain localhost
Define base_dir /home/calcms/racalmas Define base_dir /var/www/html
Define web_dir /home/calcms/racalmas/website/ Define web_dir /var/www/html/website/
Define perl_lib /home/calcms/racalmas/lib Define perl_lib /var/www/html/lib
Define archive_dir /home/radio/archive/ Define archive_dir /home/radio/archive/
# Redirect permanent /agenda/planung https://${domain}/agenda/planung # Redirect permanent /agenda/planung https://${domain}/agenda/planung

View File

@@ -5,9 +5,9 @@ LogLevel info
LimitInternalRecursion 4 LimitInternalRecursion 4
Define domain localhost Define domain localhost
Define base_dir /home/milan/radio/coloradio/racalmas.orig/ Define base_dir /var/www/html/
Define perl_lib /home/milan/radio/coloradio/racalmas.orig/lib/calcms Define perl_lib /var/www/html/lib/calcms
Define web_dir /home/milan/radio/coloradio/racalmas.orig/website/ Define web_dir /var/www/html/website/
Define archive_dir /home/radio/archive/ Define archive_dir /home/radio/archive/
# calcms endpoints for your website # calcms endpoints for your website

View File

@@ -3,15 +3,15 @@ CREATE DATABASE IF NOT EXISTS calcms;
CREATE DATABASE IF NOT EXISTS calcms_test; CREATE DATABASE IF NOT EXISTS calcms_test;
--- Create admin user --- Create admin user
CREATE USER IF NOT EXISTS 'calcms_admin'@'localhost' IDENTIFIED BY 'caladmin000'; CREATE USER IF NOT EXISTS 'calcms_admin'@'%' IDENTIFIED BY 'caladmin000';
GRANT ALL PRIVILEGES ON calcms.* TO 'calcms_admin'@'localhost'; GRANT ALL PRIVILEGES ON calcms.* TO 'calcms_admin'@'%';
GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_admin'@'localhost'; GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_admin'@'%';
--- Create write user --- Create write user
CREATE USER IF NOT EXISTS 'calcms_write'@'localhost' IDENTIFIED BY 'calwrite000'; CREATE USER IF NOT EXISTS 'calcms_write'@'%' IDENTIFIED BY 'calwrite000';
GRANT SELECT, INSERT, UPDATE, DELETE ON calcms.* TO 'calcms_write'@'localhost'; GRANT SELECT, INSERT, UPDATE, DELETE ON calcms.* TO 'calcms_write'@'%';
GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_write'@'localhost'; GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_write'@'%';
--- Create read user --- Create read user
CREATE USER IF NOT EXISTS 'calcms_read'@'localhost' IDENTIFIED BY 'calread000'; CREATE USER IF NOT EXISTS 'calcms_read'@'%' IDENTIFIED BY 'calread000';
GRANT SELECT ON calcms.* TO 'calcms_read'@'localhost'; GRANT SELECT ON calcms.* TO 'calcms_read'@'%';
GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_read'@'localhost'; GRANT ALL PRIVILEGES ON calcms_test.* TO 'calcms_read'@'%';

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
perl -I /home/calcms/lib/calcms update_program.pl perl -I /var/www/html/lib/calcms/update_program.pl
#perl -I /home/radio/calcms/calcms aggregate.cgi date=today 2>/dev/null > /home/radio/radio/agenda/programm.html #perl -I /home/radio/calcms/calcms aggregate.cgi date=today 2>/dev/null > /home/radio/radio/agenda/programm.html

View File

@@ -8,8 +8,8 @@ use Date::Calc;
use config; use config;
use template; use template;
my $perlPath='-I /home/calcms/lib/calcms'; my $perlPath='-I /var/www/html/lib/calcms';
my $configPath=$ARGV[0]||'/home/calcms/website/agenda/config/config.cgi'; my $configPath=$ARGV[0]||'/var/www/html/website/agenda/config/config.cgi';
unless (defined $config::config){ unless (defined $config::config){
config::get($configPath); config::get($configPath);

View File

@@ -1,12 +1,12 @@
#!/usr/bin/perl #!/usr/bin/perl
print "Content-type:text/plain\n\nAccess denies."; #print "Content-type:text/plain\n\nAccess denies.";
exit; #exit;
__END__ #__END__
<config> <config>
Define DOMAIN localhost Define DOMAIN localhost
Define BASE_DIR /home/calcms/racalmas/website Define BASE_DIR /var/www/html/website
# default project from database # default project from database
project my-project project my-project
@@ -100,7 +100,7 @@ domain ${DOMAIN}
</permissions> </permissions>
<access> <access>
hostname localhost hostname db
port 3306 port 3306
database calcms database calcms

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<import
xmlns="https://roko.li/_schema/aura/import-0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://roko.li/_schema/aura/import-0.1 import.xsd"
version="0.1"
>
<created-at datetime="2024-10-11T02:28:16" timezone="Europe/Berlin">11. Oktober 2024</created-at>
<!-- Das System aus dem dieses Dokument exportiert wurde (URL ist empfohlen). -->
<exported-from>https:<TMPL_VAR base_domain></exported-from>
<defaults>
<import-operation>update-or-create</import-operation>
</defaults>
<payload>
<episode id="DMF-1">
<title><TMPL_VAR full_title></title>
<summary><TMPL_VAR excerpt></summary>
<description> <TMPL_VAR content ESCAPE=0><!-- TODO: find way to get description --> </description>
<created-at datetime="<TMPL_VAR created_at>" timezone="Europe/Berlin">11. Oktober 2024</created-at>
<!-- List of tags here, but do they exist? -->
<tag>Sendung</tag>
<!-- Bild dieser Episode -->
<image-ref ref="https:<TMPL_VAR base_domain><TMPL_VAR image_url>"/>
<!-- Mitwirkende an dieser Episode -->
<contributor-ref ref="person-konrad"/>
<!-- Sprachen dieser Episode -->
<language-ref ref="https://aura.roko.li/steering/api/v1/languages/20/"/>
<language-ref ref="https://aura.roko.li/steering/api/v1/languages/9/"/>
<!-- Themen dieser Episode -->
<topic-ref ref="https://aura.roko.li/steering/api/v1/topics/3/"/>
<topic-ref ref="<TMPL_VAR topic ESCAPE=0"/>
<media>
<!-- Dieses Playable wird direkt in AURA hochgeladen (HTTP Upload) -->
<TMPL_IF media_url>
<playable>
<audio src="<TMPL_VAR media_url"/>
</playable>
</TMPL_IF>
</media>
</episode>
<license id="license-cc-by-sa-4.0">
<identifier>CC-BY-SA</identifier>
<needs-author>true</needs-author>
</license>
<license id="license-unsplash">
<identifier>Unsplash</identifier>
</license>
<topic id="topic-soziales">
<name>Soziales</name>
</topic>
<profile id="person-konrad">
<name>Bastian Baltasar Bux</name>
</profile>
<image id="image-01">
<filename>28771759517_54ecd90cf9_o.jpg</filename>
<author>Enrico Strocchi</author>
<alt>Ein abgesägter und von Moos überzogener Baumstamm</alt>
<license-ref ref="license-cc-by-sa-4.0"/>
<img src="file:///28771759517_54ecd90cf9_o-800x.jpg"/>
</image>
<image id="image-02">
<filename>ilnur-kalimullin-KJedOlSAdO8-unsplash.jpg</filename>
<author>Ilnur Kalimullin</author>
<author-grants-use>true</author-grants-use>
<alt>Große Balkons mit integrierten Pflanzenkübeln an einem Plattenbau</alt>
<attribution>
<![CDATA[Foto von <a href="https://unsplash.com/de/@kalimullin">Ilnur Kalimullin</a> auf <a href="https://unsplash.com/de/fotos/gebaude-aus-grauem-beton-KJedOlSAdO8">Unsplash</a>]]>
</attribution>
<license-ref ref="license-unsplash"/>
<img src="file:///ilnur-kalimullin-KJedOlSAdO8-unsplash-800x.jpg"/>
</image>
</payload>
</import>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<import
xmlns="https://roko.li/_schema/aura/import-0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://roko.li/_schema/aura/import-0.1 import.xsd"
version="0.1"
>
<created-at datetime="2024-10-11T02:28:16" timezone="Europe/Berlin">11. Oktober 2024</created-at>
<!-- Das System aus dem dieses Dokument exportiert wurde (URL ist empfohlen). -->
<exported-from>https:<TMPL_VAR base_domain></exported-from>
<defaults>
<import-operation>update-or-create</import-operation>
</defaults>
<payload>
<episode id="DMF-1">
<title><TMPL_VAR full_title></title>
<summary><TMPL_VAR excerpt></summary>
<description> <TMPL_VAR content ESCAPE=0><!-- TODO: find way to get description --> </description>
<created-at datetime="<TMPL_VAR created_at>" timezone="Europe/Berlin">11. Oktober 2024</created-at>
<!-- List of tags here, but do they exist? -->
<tag>Sendung</tag>
<!-- Bild dieser Episode -->
<image-ref ref="https:<TMPL_VAR base_domain><TMPL_VAR image_url>"/>
<!-- Mitwirkende an dieser Episode -->
<contributor-ref ref="person-konrad"/>
<!-- Sprachen dieser Episode -->
<language-ref ref="https://aura.roko.li/steering/api/v1/languages/20/"/>
<language-ref ref="https://aura.roko.li/steering/api/v1/languages/9/"/>
<!-- Themen dieser Episode -->
<topic-ref ref="https://aura.roko.li/steering/api/v1/topics/3/"/>
<topic-ref ref="<TMPL_VAR topic ESCAPE=0"/>
<media>
<!-- Dieses Playable wird direkt in AURA hochgeladen (HTTP Upload) -->
<TMPL_IF media_url>
<playable>
<audio src="<TMPL_VAR media_url"/>
</playable>
</TMPL_IF>
</media>
</episode>
<license id="license-cc-by-sa-4.0">
<identifier>CC-BY-SA</identifier>
<needs-author>true</needs-author>
</license>
<license id="license-unsplash">
<identifier>Unsplash</identifier>
</license>
<topic id="topic-soziales">
<name>Soziales</name>
</topic>
<profile id="person-konrad">
<name>Bastian Baltasar Bux</name>
</profile>
<image id="image-01">
<filename>28771759517_54ecd90cf9_o.jpg</filename>
<author>Enrico Strocchi</author>
<alt>Ein abgesägter und von Moos überzogener Baumstamm</alt>
<license-ref ref="license-cc-by-sa-4.0"/>
<img src="file:///28771759517_54ecd90cf9_o-800x.jpg"/>
</image>
<image id="image-02">
<filename>ilnur-kalimullin-KJedOlSAdO8-unsplash.jpg</filename>
<author>Ilnur Kalimullin</author>
<author-grants-use>true</author-grants-use>
<alt>Große Balkons mit integrierten Pflanzenkübeln an einem Plattenbau</alt>
<attribution>
<![CDATA[Foto von <a href="https://unsplash.com/de/@kalimullin">Ilnur Kalimullin</a> auf <a href="https://unsplash.com/de/fotos/gebaude-aus-grauem-beton-KJedOlSAdO8">Unsplash</a>]]>
</attribution>
<license-ref ref="license-unsplash"/>
<img src="file:///ilnur-kalimullin-KJedOlSAdO8-unsplash-800x.jpg"/>
</image>
</payload>
</import>