diff --git "a/docs/10_\360\237\244\224_Why.md" "b/docs/10_\360\237\244\224_Why.md" new file mode 100644 index 0000000000000000000000000000000000000000..d2ee7a3a673582b4ab002c99c5192b49ae360583 --- /dev/null +++ "b/docs/10_\360\237\244\224_Why.md" @@ -0,0 +1,17 @@ +# What problem does it solve? + +I have a few php based projects with or without a database. + +As a newbie in docker I installed a rootless docker. + +And to dockerfy exsiting projects quick and dirty. Sure copy & paste works, but if you have multiple configuration files where variables must match then variables are very helpful. So here is a stupid simple template generator. + +The init script: + +* sets permisssions for container and local user +* generates needed files for docker from configuration and a set of templates +* starts/ stops your container + +# What problems does it not solve? + +It is a script for a dual container and Apache + PHP and Mariadb only. Nothing else. diff --git "a/docs/10_\342\234\205_Requirements.md" "b/docs/20_\342\234\205_Requirements.md" similarity index 79% rename from "docs/10_\342\234\205_Requirements.md" rename to "docs/20_\342\234\205_Requirements.md" index af02ac8ecd758a4d9750f2c143e76b3ea8bd8ccc..39bc40e9e7d9fddf5ade47244e8f3de19ecdd751 100644 --- "a/docs/10_\342\234\205_Requirements.md" +++ "b/docs/20_\342\234\205_Requirements.md" @@ -1,5 +1,7 @@ ## Requirements ## -* Bash (tested on Linux only) +It was tested on Linux only. + +* Bash + GNU cure utilities * Docker Non-root installation - see <https://docs.docker.com/engine/security/rootless/> * ACL to enable write permissions on web data for Apache httpd in the container container and local user (you) \ No newline at end of file diff --git "a/docs/20_\360\237\224\206_Init_a_new_project.md" "b/docs/30_\360\237\224\206_Init_a_new_project.md" similarity index 90% rename from "docs/20_\360\237\224\206_Init_a_new_project.md" rename to "docs/30_\360\237\224\206_Init_a_new_project.md" index 275093f0f1c1a7401549f3639fbcf2bf6917cbc7..aab91c982950d37fc573e78f1b7d695e7d9b9b54 100644 --- "a/docs/20_\360\237\224\206_Init_a_new_project.md" +++ "b/docs/30_\360\237\224\206_Init_a_new_project.md" @@ -56,10 +56,10 @@ The initial file structure looks like this: ### First start ### * start init script in the docker folder: ```./docker/init.sh``` - * use "g" to remove git data of the starterkit - * use "i" for init ... it sets an ACL on the ./public_html/ subdir to allow write access for your current user and the apache user in the docker container - * use "t" to generate config files from templates with the settings from ./docker/init.sh.cfg - * use "u" to bring up the container (OR run ```docker-compose up -d``` ) + * use `g` to remove git data of the starterkit + * use `i` for init ... it sets an ACL on the ./public_html/ subdir to allow write access for your current user and the apache user in the docker container + * use `t` to generate config files from templates with the settings from ./docker/init.sh.cfg + * use `u` to bring up the container (OR run ```docker-compose up -d``` ) ### Edit files ### diff --git "a/docs/30_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" "b/docs/40_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" similarity index 95% rename from "docs/30_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" rename to "docs/40_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" index aac9931158787661d08937c80948462fa48254c8..d2eda1145370a3cc0218ed1c52361b2123d314cd 100644 --- "a/docs/30_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" +++ "b/docs/40_\342\232\231\357\270\217_Configuration/10_init.sh.cfg.md" @@ -108,8 +108,8 @@ APP_APT_PACKAGES | string | list of additional packages in apache c APP_NAME | string | a uniq application name. It will be used as prefix for containers, network and other places. It is a MUST to change it in every new project. APP_ONSTARTUP | string | optional command to execut if the apache container is up "" APP_PHP_MODULES | string | list of additional php modules in apache container; separated with spaces<br>see <https://github.com/mlocati/docker-php-extension-installer> for the list of supported modules<br>example: "curl mbstring xml zip xdebug" -APP_PHP_VERSION | string | PHP version in apache container; example: 8.1 -APP_PORT | int | port number for your local machine that will be maped to port 80 in the container; Change it if you run multiple projects in parallel; example: 8001 +APP_PHP_VERSION | string | PHP version in apache container; example: 8.2 +APP_PORT | int | port number for your local machine that will be maped to port 80 in the container; Change it if you run multiple projects in parallel; example: 8001;<br>Hint: set one port per application. Coordinate within in your dev team what port to use for what application CUTTER_NO_DATABASE | const | do not change it; the string is used to cut templates from there if no database is used DB_ADD | bool | flag: do you add a Mariadb container? default: false DB_PORT | int | port number for your local machine that will be mapped to port 3306 in the container; You can use it in a local db manager; remark: tha apache container needs 3306 and not the mapped port. diff --git "a/docs/30_\342\232\231\357\270\217_Configuration/20_Templates.md" "b/docs/40_\342\232\231\357\270\217_Configuration/20_Templates.md" similarity index 92% rename from "docs/30_\342\232\231\357\270\217_Configuration/20_Templates.md" rename to "docs/40_\342\232\231\357\270\217_Configuration/20_Templates.md" index 1e1870fb1d07be459820c220b736abb445997776..798494339a773ff2d17e4cffdbc090cee5615f93 100644 --- "a/docs/30_\342\232\231\357\270\217_Configuration/20_Templates.md" +++ "b/docs/40_\342\232\231\357\270\217_Configuration/20_Templates.md" @@ -164,7 +164,8 @@ Apache vhost configuration for your app. ❗**It's a MUST to change this file.** -Setup modules and the vhost including rewrites , ... +Setup your vhost config files. +For the security headers in the buttom part the apache module "headers" ist needed. ```txt # TARGET: docker/containers/web-server/apache/sites-enabled/vhost_app.conf @@ -184,6 +185,18 @@ Setup modules and the vhost including rewrites , ... Require all denied </Location> + # security headers + + Header unset X-Powered-By + + Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" + + Header set X-Frame-Options "SAMEORIGIN" + Header set X-Content-Type-Options "nosniff" + Header set X-XSS-Protection "1; mode=block" + Header set Feature-Policy "sync-xhr 'self'" + Header set Referrer-Policy "strict-origin-when-cross-origin" + </VirtualHost> ``` diff --git "a/docs/40_\342\232\231\357\270\217_Configuration/_index.md" "b/docs/40_\342\232\231\357\270\217_Configuration/_index.md" new file mode 100644 index 0000000000000000000000000000000000000000..33d645e1e2a3dc992c18e4b3ed3a46306b9cc1f2 --- /dev/null +++ "b/docs/40_\342\232\231\357\270\217_Configuration/_index.md" @@ -0,0 +1,5 @@ +<html> +<div class="hero"> + <h2>Configuration</h2> +</div> +</html> diff --git a/docs/_index.md b/docs/_index.md index 6d641effb24faaf35d83b8c31859f2423b3680ad..e1e8a2be469556475d506218b86d17301698510c 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -1,5 +1,13 @@ +<html> +<div class="hero"> + <h2>Docker starter kit</h2> + This template folder brings up a docker container with a PHP 8.x dev environment with<br> + Apache httpd2 + mod_php.<br> + It can add an optionally 2nd container with a Mariadb instance. + +</div> +</html> -# Docker starter kit # Free software and Open Source from University of Bern :: IML - Institute of Medical Education @@ -9,16 +17,6 @@ Free software and Open Source from University of Bern :: IML - Institute of Medi - - - -## About this template ## - -This template folder brings up a docker container with a PHP 8.x dev environment with Apache httpd2 + mod_php. - -It can add an optionally 2nd container with a Mariadb instance. +## Screenshot ##  - -The init script - -* sets permisssions for container and local user -* generates needed files for docker from configuration and a set of templates -* starts/ stops your container diff --git a/docs/images/main_menu.png b/docs/images/main_menu.png index ca709ab3b97e57a63c1853155d517642a4a0b263..c6953692ea4832ae39ed2106465f2d2abfee6c08 100644 Binary files a/docs/images/main_menu.png and b/docs/images/main_menu.png differ diff --git a/docs/style.css b/docs/style.css index 4186d17f75909f2d9190cff5152d48366c829baf..45383c3288f17a74d88fc2ffca48307f794d4592 100644 --- a/docs/style.css +++ b/docs/style.css @@ -1,13 +1,14 @@ /* override css elements of daux.io blue theme - version 2023-10-09 + version 2023-11-10 */ :root { /* Axels Overrides */ --color-text: #234; - --link-color: #822; + --link-color: #228; --brand-color: var(--color-text); --brand-background: var(--body-background); + --code-tag-border-color: #d8d8d8; --hr-color: none; --search-field-background: none; --search-field-border-color: none; @@ -46,9 +47,10 @@ .dark { /* Axels Overrides */ --color-text: #c0c0c0; - --link-color: #c66; + --link-color: #88e; --brand-color: var(--color-text); --brand-background: var(--body-background); + --body-background: #101418; --hr-color: none; --code-tag-background-color_: #bcc; --search-field-background: none; @@ -175,10 +177,12 @@ img{ .s-content .TableOfContentsContainer h4 { margin: 1em 0; - font-size: 100%; + font-size: 110%; text-align: center; - background-color: rgba(0, 0, 0, 0.05); + background-color: rgba(0, 0, 0, 0.1); padding: 0.3em; + font-weight: bold; + font-family: Arial; } ul.TableOfContents a{ color: var(--color-text);