Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/gitpod optimize #18

Merged
merged 170 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
a1b8010
[TASK] Add gitpod dockerfile
ochorocho Aug 18, 2022
9bc5d40
[BUGFIX] Comment example
ochorocho Aug 18, 2022
b1a3453
[BUGFIX] Use env var
ochorocho Aug 18, 2022
e738847
[BUGFIX] Ensure ports are open and lamp stack is running
ochorocho Aug 18, 2022
0fbf494
[BUGFIX] Use default mysql image
ochorocho Aug 18, 2022
63d75ec
[BUGFIX] Start apache on init
ochorocho Aug 18, 2022
bf93a41
[TASK] Use nginx
ochorocho Aug 18, 2022
d9a80a7
[TASK] Export path
ochorocho Aug 18, 2022
b36d854
[TASK] Use apache
ochorocho Aug 18, 2022
8bb5881
[TASK] Modify php.ini
ochorocho Aug 18, 2022
0af175b
[TASK] Start apache after git clone
ochorocho Aug 18, 2022
74d1d15
[TASK] Add preview script
ochorocho Aug 18, 2022
ea4709a
[TASK] Make preview script executable
ochorocho Aug 18, 2022
3a5fe07
[TASK] Add settings and open info
ochorocho Aug 18, 2022
003d4c4
[TASK] Create default database
ochorocho Aug 18, 2022
3a69199
[TASK] Add details about database credentials
ochorocho Aug 18, 2022
a49c38b
[TASK] Add basic config for database
ochorocho Aug 19, 2022
6c4d8dd
[TASK] Creat typo3conf folder
ochorocho Aug 19, 2022
69ea685
[TASK] Add features array
ochorocho Aug 19, 2022
59deb98
[TASK] Change command order
ochorocho Aug 19, 2022
1864f6b
[TASK] Change command order
ochorocho Aug 19, 2022
2eef210
[TASK] Change command order to make it work on stop/start
ochorocho Aug 19, 2022
05b8bfb
[TASK] Add environment variable for apache
ochorocho Aug 19, 2022
864864c
[TASK] Extend info
ochorocho Aug 19, 2022
3895bfa
[TASK] Set commands executable
ochorocho Aug 19, 2022
bd77493
[TASK] Set terminal name
ochorocho Aug 19, 2022
0f7922c
[TASK] open initial internal
ochorocho Aug 20, 2022
a3ad31d
[TASK] open initial eternal
ochorocho Aug 21, 2022
a60dd49
[TASK] ignore .vscode
ochorocho Aug 21, 2022
35cf24d
[TASK] Install and run Mailhog
ochorocho Aug 21, 2022
a8891a8
[TASK] Add mailhog preview command and avoid creation of nohup.out
ochorocho Aug 21, 2022
8b486c6
[TASK] Add db tools
ochorocho Aug 21, 2022
0813948
[TASK] Workaround mysql v8 connection issue setting password.
ochorocho Aug 21, 2022
2fb9f4e
[TASK] Workaround mysql v8 issue
ochorocho Aug 21, 2022
8386b64
[TASK] Workaround mysql v8 issue
ochorocho Aug 21, 2022
e83a4c2
[TASK] Workaround mysql v8 issue
ochorocho Aug 21, 2022
0ee0390
[TASK] Workaround mysql v8 issue
ochorocho Aug 21, 2022
d25d62a
[TASK] use apexsql
ochorocho Aug 21, 2022
1d8e7fc
[TASK] Add default db connection
ochorocho Aug 21, 2022
fc353c0
[TASK] Add default db connection
ochorocho Aug 21, 2022
19c9894
[TASK] Add default db connection
ochorocho Aug 21, 2022
bde5ba2
[TASK] Add infos about commands
ochorocho Aug 21, 2022
ad23630
[TASK] Add xdebug
ochorocho Aug 22, 2022
297a7a6
[TASK] Add xdebug
ochorocho Aug 22, 2022
3de60e6
[TASK] Add xdebug
ochorocho Aug 22, 2022
a48593c
[TASK] Add xdebug
ochorocho Aug 22, 2022
66fb042
[TASK] Configure xdebug module and add launch config for vscode
ochorocho Aug 23, 2022
f04a5a8
[TASK] Add launch file
ochorocho Aug 23, 2022
a9e17ec
[TASK] Add max_nesting_level
ochorocho Aug 23, 2022
df05566
[TASK] Add max_nesting_level
ochorocho Aug 23, 2022
62f68d8
[TASK] Install xdebug depending on php version set via env var
ochorocho Aug 24, 2022
43ca74c
[TASK] Detect php version based on composer.json if no env TDK_PHP_VE…
ochorocho Aug 24, 2022
462a105
[TASK] Add 7.4 compatability
ochorocho Aug 24, 2022
de0b44a
[TASK] Relax version constrainst
ochorocho Aug 24, 2022
5962aee
[TASK] Add string
ochorocho Aug 24, 2022
af2b1a0
[TASK] Create folder prior touching files
ochorocho Aug 24, 2022
5919389
[TASK] add php switcher
ochorocho Aug 26, 2022
63d5293
[TASK] Simplify php switcher
ochorocho Aug 27, 2022
2d9af7b
[TASK] Simplify php switcher
ochorocho Aug 27, 2022
0fe8ca1
[TASK] Simplify php switcher
ochorocho Aug 27, 2022
7cb7622
[TASK] Simplify php switcher
ochorocho Aug 27, 2022
8aea27f
[TASK] Use custom docker file
ochorocho Aug 27, 2022
efba02c
[TASK] Use custom docker file
ochorocho Aug 27, 2022
5af95c7
[TASK] Use custom docker file
ochorocho Aug 27, 2022
e7519c7
[TASK] Use custom docker file
ochorocho Aug 27, 2022
51fd7fc
[TASK] Use custom docker file
ochorocho Aug 27, 2022
e83558d
[TASK] Use custom docker file
ochorocho Aug 27, 2022
6e1b468
[TASK] Use custom docker file
ochorocho Aug 27, 2022
49c028a
[TASK] Use custom docker file
ochorocho Aug 27, 2022
6033dfb
[TASK] Use custom docker file
ochorocho Aug 27, 2022
85fee93
[TASK] Add mailhog init script
ochorocho Aug 27, 2022
34e3a33
[TASK] Add mailhog init script
ochorocho Aug 28, 2022
e2790b4
[TASK] Move stuff to docker build
ochorocho Aug 28, 2022
da6dc82
[BUGFIX] Fix typo in php switch command name
ochorocho Aug 28, 2022
570ba84
[BUGFIX] Install required modules
ochorocho Aug 28, 2022
b3635b8
[BUGFIX] Install required modules
ochorocho Aug 28, 2022
f56fed1
[TASK] Optimize image, add more details to commands
ochorocho Aug 28, 2022
a86760a
[TASK] Compile and use ImageMagick 7
ochorocho Aug 28, 2022
172c28f
[TASK] Use base image, install mysql and php versions
ochorocho Aug 28, 2022
82b51e3
[TASK] Change mailhog path
ochorocho Aug 28, 2022
a5fd508
[TASK] Add apache config, and set permissions
ochorocho Aug 28, 2022
d8deb72
[BUGFIX] Run setup once php versions are installed
ochorocho Aug 28, 2022
aebd204
[BUGFIX] Run make with 4 cpus
ochorocho Aug 28, 2022
00c4e49
[TASK] Use DOCKER_BUILDKIT=1
ochorocho Aug 28, 2022
8bca2f3
[TASK] Add apache webserver
ochorocho Aug 28, 2022
43a900d
[TASK] Enable only required modules for apache/php
ochorocho Aug 28, 2022
698c39a
[TASK] Set memory_limit
ochorocho Aug 28, 2022
1bb73ce
[TASK] Add ghostscript
ochorocho Aug 29, 2022
5ef5943
[TASK] Add systemLocale, name port 1025
ochorocho Aug 29, 2022
b3721e0
[TASK] Enable xdebug by default for now.
ochorocho Aug 29, 2022
49f1f85
[TASK] Copy envvars at the very end.
ochorocho Aug 29, 2022
82314aa
[TASK] Do not reload webserver until public folder exists
ochorocho Aug 29, 2022
6e9e295
[TASK] Use switch script to run apache
ochorocho Aug 29, 2022
d8c5485
[TASK] Use switch script to run apache
ochorocho Aug 29, 2022
a87d11f
[TASK] Use switch script to run apache
ochorocho Aug 29, 2022
8b2f702
[TASK] Enable xdebug again
ochorocho Aug 29, 2022
ed0bdbf
[BUGFIX] Set correct path for xdebug config to copy
ochorocho Aug 29, 2022
52a4bdf
[BUGFIX] Set correct path for xdebug config to copy
ochorocho Aug 29, 2022
d5813b8
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
5dac768
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
ce72530
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
3ace5ea
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
ac780dc
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
78eaeac
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
2051e8a
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
88dc9e8
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
e5028ed
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
d4a4684
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
57943f9
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
4ca280b
[BUGFIX] Create log file for xdebug
ochorocho Aug 29, 2022
d519bde
[TASK] Test imagemagick 6.9
ochorocho Aug 30, 2022
55dc9f5
[TASK] Test imagemagick
ochorocho Aug 30, 2022
b8a9652
[TASK] New configure command imagemagick
ochorocho Aug 30, 2022
3b77b01
[TASK] New configure command imagemagick
ochorocho Aug 30, 2022
6d6ddb9
[TASK] New configure command imagemagick
ochorocho Aug 30, 2022
74d589c
[TASK] New configure command imagemagick
ochorocho Aug 30, 2022
af1512c
[TASK] Add imagemagick policy config for pdf/ai files
ochorocho Aug 30, 2022
ac54df8
[BUGFIX] Add missing mysql.cnf
ochorocho Aug 30, 2022
ee05dda
[BUGFIX] Fix database script
ochorocho Aug 30, 2022
5ceb2d9
[TASK] Use packages mysql init script
ochorocho Aug 30, 2022
b5ff9e5
[TASK] Use packages mysql init script
ochorocho Aug 30, 2022
99899d4
[TASK] Use packages mysql init script
ochorocho Aug 30, 2022
4040150
[TASK] Use packages mysql init script
ochorocho Aug 31, 2022
f18fbfc
[TASK] Use packages mysql init script
ochorocho Aug 31, 2022
e01f41b
[TASK] Use root as service user
ochorocho Aug 31, 2022
f845de4
[TASK] Add start/stop command to db script
ochorocho Aug 31, 2022
613eaef
[TASK] Cleanup
ochorocho Aug 31, 2022
8d55dc2
[TASK] Use custom command to start mysql
ochorocho Aug 31, 2022
b51a514
[TASK] Init script again
ochorocho Aug 31, 2022
fdfb669
[TASK] Copy init file
ochorocho Aug 31, 2022
0835bcf
[BUGFIX] Change scripts according to shellcheck
ochorocho Aug 31, 2022
0245f9e
[TASK] Finaly fix mysql start ?!
ochorocho Aug 31, 2022
e215fff
[BUGFIX] Use older base image for sqltools extension
ochorocho Aug 31, 2022
189d75e
Doh!
ochorocho Aug 31, 2022
31d6698
[TASK] Give mysql some time to initialize the datadir
ochorocho Aug 31, 2022
bbf6e14
Use older image
ochorocho Aug 31, 2022
e1c69d7
use latest again
ochorocho Aug 31, 2022
bbc55ac
[TASK] Create user with 'mysql_native_password' to prevent auth issues
ochorocho Aug 31, 2022
c950760
[TASK] Add mysql terminal window
ochorocho Aug 31, 2022
0eb77a6
[TASK] Remove non existing extension
ochorocho Sep 1, 2022
0a1b363
[TASK] install mycli
ochorocho Sep 1, 2022
a9fcdb8
[TASK] Do not remove python, add editors to be removed instead
ochorocho Sep 1, 2022
644a208
[TASK] Do not remove python
ochorocho Sep 1, 2022
b7b89ad
[TASK] Open mysql in split view
ochorocho Sep 1, 2022
251939c
[TASK] Update readme
ochorocho Sep 1, 2022
4674180
[TASK] fix permissions for sqltools cache folder, optimize image size
ochorocho Sep 2, 2022
2fe5d24
[TASK] Add cron command
ochorocho Sep 2, 2022
41e8c97
[BUGFIX] Use correct path and command
ochorocho Sep 2, 2022
0bee007
[TASK] More verbose cron output
ochorocho Sep 2, 2022
5231229
[TASK] Combine tdk* commands and add basic autocompletion
ochorocho Sep 3, 2022
4179335
[TASK] Use combinded tdk command when setting up gitpod
ochorocho Sep 3, 2022
60a23dc
[TASK] Enable bash autocompletion globally
ochorocho Sep 3, 2022
c8d572a
[BUGFIX] Use new command
ochorocho Sep 3, 2022
50f47d7
[BUGFIX] Add missing variable
ochorocho Sep 3, 2022
4dd8003
[TASK] Make shellcheck happy
ochorocho Sep 3, 2022
8cf9e22
[TASK] Re-add sqltools to extensions
ochorocho Sep 3, 2022
72ba568
[TASK] Update info
ochorocho Sep 3, 2022
a5f82f8
[TASK] Configure editor to unfold folder
ochorocho Sep 3, 2022
f214d76
[TASK] Ensure ide extensions are installed
ochorocho Sep 3, 2022
52bc847
[BUGFIX] Use correct syntax
ochorocho Sep 3, 2022
bc5d5a4
Fix syntax
ochorocho Sep 3, 2022
0f7544a
Fix syntax
ochorocho Sep 3, 2022
a22f63c
Fix xdebug config
ochorocho Sep 3, 2022
7f0198f
Add cronjob info
ochorocho Sep 3, 2022
110177d
Fix comment
ochorocho Sep 3, 2022
39a010e
[TASK] Add autocompletion for subcommand
ochorocho Sep 3, 2022
ecf22b2
Add completion for option
ochorocho Sep 3, 2022
7f84672
[TASK] Make shellcheck happy, streamline service output
ochorocho Sep 3, 2022
fb7c01f
Fix scripts
ochorocho Sep 3, 2022
fa4fe79
Merge branch 'main' into task/gitpod-optimize
ochorocho Sep 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.gitpod export-ignore
/tests export-ignore
/.php.cs export-ignore
/codeception.yml export-ignore
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ typo3-core
packages/*
!packages/.gitkeep
.ddev/
config/
/config/
test-acceptance-tdk/
/tests/_support/_generated
/tests/_support/_generated
/.vscode
65 changes: 38 additions & 27 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,64 @@
---
# Example
# 8.1 https://gitpod.io/#TDK_PHP_VERSION=8.1,TDK_BRANCH=main,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/task/gitpod-optimize
# 8.0 https://gitpod.io/#TDK_PHP_VERSION=8.0,TDK_BRANCH=main,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/task/gitpod-optimize
# Detect php: https://gitpod.io/#TDK_BRANCH=11.5,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/task/gitpod-optimize

image: ochorocho/gitpod-tdk:latest

tasks:
- init: |
.gitpod/utils/ddev-in-gitpod-setup.sh
ddev config --docroot=public --create-docroot --project-type=typo3 --project-name=typo3
command: |
.gitpod/utils/env-setup.sh
- name: TDK
init: |
mkdir -p .vscode
cp -Rp .gitpod/vscode/settings.json .vscode/settings.json
cp -Rp .gitpod/vscode/launch.json .vscode/launch.json
tdk php "$(php .gitpod/php/version.php)" --no-reload
gp open .gitpod/info.md
composer tdk:clone
composer tdk:checkout
composer install
composer tdk:set-git-config
composer tdk:enable-hooks -- --force
composer tdk:apply-patch
ddev start
mkdir -p public/typo3conf
touch public/FIRST_INSTALL
cp -Rp .gitpod/typo3/AdditionalConfiguration.php public/typo3conf/AdditionalConfiguration.php
command: |
tdk php "$(php .gitpod/php/version.php)"
sudo service mailhog start
sudo service mysql start
sudo service cron start
sleep 5
tdk db create
composer tdk:help
tdk preview fe
gp sync-done tdk-done

# VScode xdebug extension
vscode:
extensions:
# PHP extensions.
- felixfbecker.php-debug
- wongjn.php-sniffer
- neilbrayfield.php-docblocker
- bmewburn.vscode-intelephense-client

# Bash extensions.
- timonwong.shellcheck
- rogalmic.bash-debug
# @todo: Installing sqltools does not work as expected
# it requires a window reload in some cases
- mtxr.sqltools
- mtxr.sqltools-driver-mysql

ports:
# Used by ddev - direct-bind https port
- port: 2222
onOpen: ignore
# Used by ddev - local db clients
- port: 3306
name: database
onOpen: ignore
# Used by projector
- port: 6942
onOpen: ignore
# Used by MailHog
- port: 8025
- port: 8001
name: apache
onOpen: ignore
# Used by phpMyAdmin
- port: 8036
- port: 1025
name: mailhog catcher
onOpen: ignore
# Direct-connect ddev-webserver port that is the main port
- port: 8080
- port: 8025
name: mailhog
onOpen: ignore
# xdebug port
- port: 9000
- port: 9003
name: xdebug
description: xdebug
onOpen: ignore
4 changes: 0 additions & 4 deletions .gitpod/commands/preview.sh

This file was deleted.

48 changes: 48 additions & 0 deletions .gitpod/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Image on docker hub: https://hub.docker.com/r/ochorocho/gitpod-tdk/tags
FROM gitpod/workspace-base:latest

USER root

# Add custom config/scripts to container
COPY config /config
COPY config/apache.conf /etc/apache2/apache2.conf
COPY config/envvars.txt /etc/apache2/envvars
COPY scripts/mailhog /etc/init.d/mailhog
COPY scripts/mysql /etc/init.d/mysql
COPY scripts/tdk /usr/bin/
COPY scripts/tdk-completion /etc/bash_completion.d/
COPY config/mysql-client.cnf /etc/mysql/mysql.conf.d/client.cnf
COPY config/mysql.cnf /etc/mysql/mysql.conf.d/mysql.cnf
# Allow ImageMagick 6 to read/write pdf files
COPY config/imagemagick-policy.xml /etc/ImageMagick-6/policy.xml

# Install required packages
RUN add-apt-repository --yes ppa:ondrej/php && \
apt-get update && \
apt-get install --no-install-recommends -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
bash-completion cron imagemagick apache2 libapache2-mod-php* php*-xdebug php*-curl php*-zip php*-gd php*-intl php*-mysql php*-mbstring golang-go mysql-server ghostscript php-xdebug-all-dev && \
phpenmod zip curl gd intl mysqli pdo_mysql mbstring pdo xdebug && \
a2enmod alias authz_core autoindex deflate expires filter headers setenvif rewrite && \
# Configure all available PHP versions + xdebug
bash /config/php-setup.sh && \
# Enable autocompletion
echo "source /etc/profile.d/bash_completion.sh" >> /etc/bash.bashrc && \
# Install mailhog
go get github.com/mailhog/MailHog && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
# Cleanup image
apt-get remove -y --purge \
python3.8 python python3 python3.8-minimal gcc-7 build-essential apt-utils make linux-headers gcc g++ subversion mercurial emacs-bin-common emacsen-common vim-common vim && \
apt-get autoremove -y && \
apt-get clean && \
rm -Rf /var/lib/mysql/* /var/lib/apt/lists /usr/share/doc/ /config && \
# Create log file and set permissions, otherwise it will be reported as missing
touch /var/log/apache2/xdebug.log /var/log/cron.log && \
mkdir -p /var/run/mysqld /var/log/mysql && \
chown -R gitpod:gitpod /etc/apache2 /home/gitpod /var/log/apache2 /etc/mysql /var/run/mysqld /var/log/mysql /var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/lib/mysql-upgrade /var/log/cron.log && \
chmod a+x /etc/init.d/mysql /etc/init.d/mailhog /usr/bin/tdk && \
# Required to run cronjob as user "gitpod" to avoid permission issues
echo "* * * * * gitpod /usr/bin/tdk cron >> /var/log/cron.log" > /etc/cron.d/typo3

# @todo Reset required?!
# export APACHE_SERVER_NAME=$(gp url 8001 | sed -e s/https:\\/\\/// | sed -e s/\\///)
5 changes: 5 additions & 0 deletions .gitpod/docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
#--no-cache
DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain . -f Dockerfile -t ochorocho/gitpod-tdk:latest && docker run --rm -it -v `pwd`/test.sh:/tmp/test.sh --entrypoint "bash" ochorocho/gitpod-tdk:latest /tmp/test.sh
docker images | grep ochorocho/gitpod-tdk
# docker push ochorocho/gitpod-tdk:latest
38 changes: 38 additions & 0 deletions .gitpod/docker/config/apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Apache httpd v2.4 minimal configuration
# see https://wiki.apache.org/httpd/Minimal_Config for documentation

ServerRoot ${GITPOD_REPO_ROOT}

PidFile ${APACHE_PID_FILE}
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

# Modules as installed/activated via apt-get
IncludeOptional /etc/apache2/mods-enabled/*.load
IncludeOptional /etc/apache2/mods-enabled/*.conf

# Configure hostname and port for server
ServerName ${APACHE_SERVER_NAME}
Listen *:8001

# Configure Logging
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog ${APACHE_LOG_DIR}/access.log common
ErrorLog ${APACHE_LOG_DIR}/error.log

# Never change this block
<Directory />
AllowOverride None
Require all denied
</Directory>

# Direcrory and files to be served
DirectoryIndex index.html index.htm index.php
DocumentRoot "${GITPOD_REPO_ROOT}/${APACHE_DOCROOT_IN_REPO}"
<Directory "${GITPOD_REPO_ROOT}/${APACHE_DOCROOT_IN_REPO}">
AllowOverride all
Require all granted
</Directory>

# Include conf installed via apt-get
IncludeOptional /etc/apache2/conf-enabled/*.conf
10 changes: 10 additions & 0 deletions .gitpod/docker/config/envvars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export APACHE_RUN_USER="gitpod"
export APACHE_RUN_GROUP="gitpod"
export APACHE_RUN_DIR=/var/run/apache2
export APACHE_PID_FILE="$APACHE_RUN_DIR/apache.pid"
export APACHE_LOCK_DIR=/var/lock/apache2
export APACHE_DOCROOT_IN_REPO=public
export APACHE_SERVER_NAME=localhost
export APACHE_LOG_DIR=/var/log/apache2
export TYPO3_CONTEXT=Development
export GITPOD_REPO_ROOT=/workspace/tdk
97 changes: 97 additions & 0 deletions .gitpod/docker/config/imagemagick-policy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ATTLIST policymap xmlns CDATA #FIXED ''>
<!ELEMENT policy EMPTY>
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
]>
<!--
Configure ImageMagick policies.

Domains include system, delegate, coder, filter, path, or resource.

Rights include none, read, write, execute and all. Use | to combine them,
for example: "read | write" to permit read from, or write to, a path.

Use a glob expression as a pattern.

Suppose we do not want users to process MPEG video images:

<policy domain="delegate" rights="none" pattern="mpeg:decode" />

Here we do not want users reading images from HTTP:

<policy domain="coder" rights="none" pattern="HTTP" />

The /repository file system is restricted to read only. We use a glob
expression to match all paths that start with /repository:

<policy domain="path" rights="read" pattern="/repository/*" />

Lets prevent users from executing any image filters:

<policy domain="filter" rights="none" pattern="*" />

Any large image is cached to disk rather than memory:

<policy domain="resource" name="area" value="1GP"/>

Define arguments for the memory, map, area, width, height and disk resources
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
exceeds policy maximum so memory limit is 1GB).

Rules are processed in order. Here we want to restrict ImageMagick to only
read or write a small subset of proven web-safe image types:

<policy domain="delegate" rights="none" pattern="*" />
<policy domain="filter" rights="none" pattern="*" />
<policy domain="coder" rights="none" pattern="*" />
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
-->
<policymap>
<!-- <policy domain="system" name="shred" value="2"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->
<!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="map" value="512MiB"/>
<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>
<!-- <policy domain="resource" name="list-length" value="128"/> -->
<policy domain="resource" name="area" value="128MB"/>
<policy domain="resource" name="disk" value="1GiB"/>
<!-- <policy domain="resource" name="file" value="768"/> -->
<!-- <policy domain="resource" name="thread" value="4"/> -->
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
<!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
<!-- <policy domain="system" name="shred" value="2"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->
<!-- not needed due to the need to use explicitly by mvg: -->
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
<!-- use curl -->
<policy domain="delegate" rights="none" pattern="URL" />
<policy domain="delegate" rights="none" pattern="HTTPS" />
<policy domain="delegate" rights="none" pattern="HTTP" />
<!-- in order to avoid to get image with password text -->
<policy domain="path" rights="none" pattern="@*"/>
<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<!--policy domain="coder" rights="none" pattern="PDF" /-->
<policy domain="coder" rights="write | read" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
</policymap>
10 changes: 10 additions & 0 deletions .gitpod/docker/config/mysql-client.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[client]
host = localhost
user = root
password =
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password =
socket = /var/run/mysqld/mysqld.sock
26 changes: 26 additions & 0 deletions .gitpod/docker/config/mysql.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
user = gitpod
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /workspace/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1

key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8

myisam-recover-options = BACKUP

general_log_file = /var/log/mysql/mysql.log
general_log = 1
log_error = /var/log/mysql/error.log
12 changes: 12 additions & 0 deletions .gitpod/docker/config/php-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Configure all php versions
# * 40-php.ini
# * 20-xdebug.ini

ALL_VERSIONS=$(ls /etc/php)
for version in $ALL_VERSIONS
do
cat /config/xdebug.ini | sudo tee "/etc/php/${version}/apache2/conf.d/20-xdebug.ini" > /dev/null
echo -e "memory_limit=256M\nmax_execution_time=240\nmax_input_vars=1500" | sudo tee -a "/etc/php/${version}/cli/conf.d/40-php.ini" | sudo tee -a "/etc/php/${version}/apache2/conf.d/40-php.ini"
done
10 changes: 10 additions & 0 deletions .gitpod/docker/config/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
zend_extension=xdebug.so

xdebug.mode = debug
xdebug.client_host = 0.0.0.0
xdebug.client_port = 9003
xdebug.start_with_request=yes
xdebug.log="/var/log/apache2/xdebug.log"
xdebug.idekey = VSCODE
xdebug.discover_client_host=false
xdebug.max_nesting_level=500
Loading