diff --git a/homepage/cwsvJudo/.aiignore b/homepage/cwsvJudo/.aiignore new file mode 100644 index 0000000..fac7b93 --- /dev/null +++ b/homepage/cwsvJudo/.aiignore @@ -0,0 +1,13 @@ +# This file contains rules for the AI assistant to ignore files and patterns in this project. + +# Ignore all files matching the glob pattern *.local +*.local + +# Ignore the build folder +build/ + +# Ignore all files containing the string 'password' +*password* + +# Ignore all files with a 'credentials' in the name +*credentials* diff --git a/homepage/cwsvJudo/.gitignore b/homepage/cwsvJudo/.gitignore index d80be2e..698ac30 100644 --- a/homepage/cwsvJudo/.gitignore +++ b/homepage/cwsvJudo/.gitignore @@ -1,6 +1,8 @@ build/* temp/* +participo/.venv + scripts/* !scripts/*.template @@ -10,3 +12,8 @@ node_modules Makefile.local db_root_password.txt db_password.txt + + +# temporary +# @todo include content and adjusted theming from JudoWiki +src/JudoWiki diff --git a/homepage/cwsvJudo/Makefile.heliohost b/homepage/cwsvJudo/Makefile.heliohost index 8d59df5..a962644 100644 --- a/homepage/cwsvJudo/Makefile.heliohost +++ b/homepage/cwsvJudo/Makefile.heliohost @@ -14,9 +14,14 @@ configFiles = $(wildcard config/*.php) LN = ln -f + +participoSource = ./participo +participoTarget = $(distWebRoot)/participo + + .PHONY: all all: build/css/cwsvJudo.css images -# @todo This should only be temporary. Better outsource the graphics to it's own Makefile. +# @todo This should only be temporary. Better outsource the graphics to their own Makefile. make -j graphiken make build/css/cwsvJudo.css @@ -66,6 +71,10 @@ installDependencies: tar xf submodules/parsedown/$(VERSION_PARSEDOWN).tar.gz --directory submodules/parsedown # - php-markdown (alternative markdown parser) if [ ! -d "submodules/php-markdown" ]; then cd submodules; git clone https://github.com/michelf/php-markdown.git; fi + cd submodules/php-markdown; git checkout lib; git pull; +# - spyc (yaml parser in php) + if [ ! -d "submodules/spyc" ]; then cd submodules; git clone https://github.com/mustangostang/spyc.git; fi + cd submodules/spyc; git checkout master; git pull; # copy/link all together to get a "distributable" package @@ -126,11 +135,18 @@ dist: all # - api mkdir -p $(distDir)/ # - parsedown +# @todo Legacy location! Remove! Either completely switch to php-markdown (Michelf) or at least but it in a common phpLib directory. mkdir -p $(distWebRoot)/pages/responsive/phpLibs/parsedown $(LN) submodules/parsedown/parsedown-$(VERSION_PARSEDOWN)/Parsedown.php $(distWebRoot)/pages/responsive/phpLibs/parsedown +# Current location: + mkdir -p $(distDir)/libs/php/parsedown + $(LN) submodules/parsedown/parsedown-$(VERSION_PARSEDOWN)/Parsedown.php $(distDir)/libs/php/parsedown/ # - php-markdown mkdir -p $(distWebRoot)/pages/responsive/phpLibs/php-markdown/Michelf find submodules/php-markdown/Michelf -type f -exec $(LN) {} $(distWebRoot)/pages/responsive/phpLibs/php-markdown/Michelf \; +# - spyc + mkdir -p $(distDir)/libs/php/spyc + $(LN) submodules/spyc/Spyc.php $(distDir)/libs/php/spyc/ # graphics mkdir -p $(distWebRoot)/ressourcen/graphiken/logos/favIcons @@ -170,23 +186,44 @@ dist: all find ./res/fonts -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/fonts \; find ./submodules/material-design-icons/material-design-icons-$(GOOGLE_MATERIAL_ICONS_VERSION)/font/ -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/fonts \; -# htaccess - $(LN) ./src/htaccess/heliohost/.htaccess $(distDir)/httpdocs/.htaccess - $(LN) ./src/htaccess/heliohost/pages/responsive/.htaccess $(distDir)/httpdocs/pages/responsive/.htaccess - -# config files - $(LN) ./configs/localDocker/pages.config.inc.php $(distDir)/httpdocs/pages/responsive/config.php - - mkdir -p $(distDir)/.local - $(LN) configs/heliohost/config.json $(distDir)/.local/config.json - $(LN) configs/heliohost/secrets.json $(distDir)/.local/secrets.json - # sitemap $(LN) ./sitemaps/cwsvjudo-de.xml $(distWebRoot)/sitemap.xml # @todo shouldn't be used any more $(LN) configs/local/db.config.php $(distDir)/.local/db.config.php +# participo + + mkdir -p $(participoTarget) + for dir in api api/inc config css images lib lib/participoLib local shared sidenav; do mkdir $(participoTarget)/$$dir; done; + $(LN) $(participoSource)/.htaccess $(participoTarget) + $(LN) $(participoSource)/api/*.php $(participoTarget)/api/ + $(LN) $(participoSource)/api/inc/*.php $(participoTarget)/api/inc + $(LN) $(participoSource)/*.php $(participoTarget) + $(LN) $(participoSource)/*.js $(participoTarget) + $(LN) $(participoSource)/css/*.css $(participoTarget)/css/ + $(LN) $(participoSource)/images/*.svg $(participoTarget)/images/ + for dir in lib lib/participoLib shared sidenav; do $(LN) $(participoSource)/$$dir/*.php $(participoTarget)/$$dir; done; + # @todo Make bash call work in Makefile + # ./scripts/deep-directory-linking $(participoSource)/markdown $(participoTarget)/markdown + cp -r $(participoSource)/markdown/ $(participoTarget)/ + # @todo check why a linked file isn't validating as php function `is_file` proberly. + cp -r $(participoSource)/videos/ $(participoTarget)/ + + # htaccess + $(LN) ./src/htaccess/heliohost/.htaccess $(distDir)/httpdocs/.htaccess + $(LN) ./src/htaccess/heliohost/pages/responsive/.htaccess $(distDir)/httpdocs/pages/responsive/.htaccess + +# config files +# - server specific configs +# - participo + $(LN) ./configs/localDocker/participo/config.php $(participoTarget)/ + $(LN) ./configs/localDocker/participo/api/config.php $(participoTarget)/api +# - common configs + mkdir -p $(distDir)/.local + $(LN) configs/localDocker/*.json $(distDir)/.local/ +# - pages + $(LN) ./configs/localDocker/pages.config.inc.php $(distWebRoot)/pages/responsive/config.php docker-compose restart diff --git a/homepage/cwsvJudo/PHP.dockerfile b/homepage/cwsvJudo/PHP.dockerfile index fed6cd6..2bfff58 100644 --- a/homepage/cwsvJudo/PHP.dockerfile +++ b/homepage/cwsvJudo/PHP.dockerfile @@ -17,3 +17,7 @@ RUN apt-get -y update \ RUN pecl install xdebug && docker-php-ext-enable xdebug RUN ln /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/ + +# add phpstan +# @todo Check again if phpstan could be included in the dist dockerfile. +# COPY --from=ghcr.io/phpstan/phpstan:latest-php8.3 /composer/vendor/phpstan/phpstan/phpstan.phar /app/phpstan.phar diff --git a/homepage/cwsvJudo/configs/heliohost/config.json b/homepage/cwsvJudo/configs/heliohost/config.json index 80a2a54..1c932f1 100644 --- a/homepage/cwsvJudo/configs/heliohost/config.json +++ b/homepage/cwsvJudo/configs/heliohost/config.json @@ -1,5 +1,8 @@ { "cwsvJudo": { + "http": { + "serve_dir": "httpdocs" + }, "db": { "host": "localhost", "name": "cwsvjudo_main", @@ -11,4 +14,4 @@ "wallpapers": "/ressourcen/graphiken/wallpapers" } } -} \ No newline at end of file +} diff --git a/homepage/cwsvJudo/configs/heliohost/participo/config.php b/homepage/cwsvJudo/configs/heliohost/participo/config.php new file mode 100644 index 0000000..1361589 --- /dev/null +++ b/homepage/cwsvJudo/configs/heliohost/participo/config.php @@ -0,0 +1,5 @@ + diff --git a/homepage/cwsvJudo/configs/localDocker/pages.config.inc.php b/homepage/cwsvJudo/configs/localDocker/pages.config.inc.php index 631af40..1ea638e 100644 --- a/homepage/cwsvJudo/configs/localDocker/pages.config.inc.php +++ b/homepage/cwsvJudo/configs/localDocker/pages.config.inc.php @@ -4,11 +4,12 @@ $baseDomain = "localhost"; /// Subdomain, unter dem dieses Verzeichnis zu finden ist (falls der Fall gegeben ist) $subDomain = ""; /// homeverzeichnis auf dem server -$home = "/home/cwsvjudo.de"; +$home = "/var/www"; +$serve_dir = "html"; /// Basis(/Root)-Verzeichnis auf dem Server (für Dateizugriffe, insbesondere phpIncludes) /// (ist eigentlich das serve verzeichnis, aka www-data) -$basePath = "/var/www/html"; +$basePath = join("/", [$home, $serve_dir]); /// Url zum Zugriff auf "shared Data" unter der Hauptadresse $baseUrl = "http://" . $baseDomain; diff --git a/homepage/cwsvJudo/configs/localDocker/participo/config.php b/homepage/cwsvJudo/configs/localDocker/participo/config.php new file mode 100644 index 0000000..4a46280 --- /dev/null +++ b/homepage/cwsvJudo/configs/localDocker/participo/config.php @@ -0,0 +1,5 @@ + diff --git a/homepage/cwsvJudo/configs/localDocker/participo/local/dbConf.php b/homepage/cwsvJudo/configs/localDocker/participo/local/dbConf.php new file mode 100644 index 0000000..59f4005 --- /dev/null +++ b/homepage/cwsvJudo/configs/localDocker/participo/local/dbConf.php @@ -0,0 +1,6 @@ + diff --git a/homepage/cwsvJudo/docker-compose.yaml b/homepage/cwsvJudo/docker-compose.yaml index 8b839b3..8e5ea3d 100644 --- a/homepage/cwsvJudo/docker-compose.yaml +++ b/homepage/cwsvJudo/docker-compose.yaml @@ -16,10 +16,11 @@ services: volumes: # this line maps the content of ./html in your pc to the /var/www/html of the container - ./build/dist/heliohost/httpdocs:/var/www/html - - ./build/dist/heliohost/pages:/home/cwsvjudo.de/pages - - ./build/dist/heliohost/shared:/home/cwsvjudo.de/shared - - ./configs/localDocker/config.json:/home/cwsvjudo.de/.local/config.json - - ./configs/localDocker/secrets.json:/home/cwsvjudo.de/.local/secrets.json + - ./build/dist/heliohost/pages:/var/www/pages + - ./build/dist/heliohost/shared:/var/www/shared + - ./build/dist/heliohost/libs:/var/www/libs + - ./configs/localDocker/config.json:/var/www/.local/config.json + - ./configs/localDocker/secrets.json:/var/www/.local/secrets.json db: # check the mysql version you need for your project image: mariadb:latest diff --git a/homepage/cwsvJudo/pandocTemplate/amp-template.html b/homepage/cwsvJudo/pandocTemplate/amp-template.html deleted file mode 100644 index 9fcc197..0000000 --- a/homepage/cwsvJudo/pandocTemplate/amp-template.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - -
- - -
-
- Judo
-
-
-
-
- 

-