diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bb26915 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +* text=auto +*.sh text eol=lf +*.crt text eol=lf +*.csr text eol=lf +*.key text eol=lf +*.php text eol=lf +*.cnf text eol=lf +*.conf text eol=lf +*.keymap text eol=lf +*.ini text eol=lf +*.phar -text +*.so -text \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..de7324d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,58 @@ +FROM webdevops/php:7.4 + +ARG APP_ENV=production +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV APP_ENV "$APP_ENV" +ENV fpm.pool.clear_env no +ENV fpm.pool.pm=ondemand +ENV fpm.pool.pm.max_children=50 +ENV fpm.pool.pm.process_idle_timeout=10s +ENV fpm.pool.pm.max_requests=500 +ENV COMPOSER_NO_INTERACTION 1 + +# Preconfigure Nginx +COPY conf/docker/ /opt/docker/ +COPY conf/sources/nginx.list /etc/apt/sources.list.d/nginx.list +RUN wget http://nginx.org/keys/nginx_signing.key \ + && apt-key add nginx_signing.key + +# Install apps and libs +RUN apt-get update && apt-get -y install \ + nginx \ + apt-utils \ + procps \ + mcedit \ + bsdtar \ + libaio1 \ + musl-dev \ + gettext \ + libpcre3-dev \ + gzip \ + git \ + software-properties-common \ +&& docker-run-bootstrap \ +&& docker-image-cleanup + +# Install Phalcon, PSR, Xdebug, configure OPcache +RUN pecl install xdebug psr +COPY conf/xdebug/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +COPY conf/extensions/phalcon.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/phalcon.so +RUN docker-php-ext-enable psr phalcon && docker-php-ext-configure opcache --enable-opcache + +# Install composer +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ + && php composer-setup.php \ + && php -r "unlink('composer-setup.php');" \ + && mv composer.phar /usr/local/bin/composer + +# Configure `edit` command to use mcedit with `modarin256` skin +COPY conf/mcedit/mc.keymap /etc/mc/mc.keymap +COPY conf/mcedit/edit.sh /usr/bin/edit +RUN chmod +x /usr/bin/edit + +EXPOSE 80 443 diff --git a/README.md b/README.md index 01b0550..ff2b762 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -### Phalcon dockerfile \ No newline at end of file +### Dockerfile for Phalcon 4.0.5 + +**Includes:** +- PHP 7.4.* +- Phalcon 4.0.5 +- Nginx +- Xdebug \ No newline at end of file diff --git a/conf/docker/bin/service.d/nginx.d/10-init.sh b/conf/docker/bin/service.d/nginx.d/10-init.sh new file mode 100644 index 0000000..8acb511 --- /dev/null +++ b/conf/docker/bin/service.d/nginx.d/10-init.sh @@ -0,0 +1,5 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi diff --git a/conf/docker/bin/service.d/nginx.sh b/conf/docker/bin/service.d/nginx.sh new file mode 100644 index 0000000..3517c72 --- /dev/null +++ b/conf/docker/bin/service.d/nginx.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_NGINX_OPTS" ]]; then SERVICE_NGINX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/nginx.d/" + +exec /usr/sbin/nginx -g 'daemon off;' $SERVICE_NGINX_OPTS diff --git a/conf/docker/etc/nginx/conf.d/.gitkeep b/conf/docker/etc/nginx/conf.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/docker/etc/nginx/conf.d/10-php.conf b/conf/docker/etc/nginx/conf.d/10-php.conf new file mode 100644 index 0000000..9abe45f --- /dev/null +++ b/conf/docker/etc/nginx/conf.d/10-php.conf @@ -0,0 +1,3 @@ +upstream php { + server ; +} diff --git a/conf/docker/etc/nginx/global.conf b/conf/docker/etc/nginx/global.conf new file mode 100644 index 0000000..b6141db --- /dev/null +++ b/conf/docker/etc/nginx/global.conf @@ -0,0 +1 @@ +# deprecated diff --git a/conf/docker/etc/nginx/main.conf b/conf/docker/etc/nginx/main.conf new file mode 100644 index 0000000..06de065 --- /dev/null +++ b/conf/docker/etc/nginx/main.conf @@ -0,0 +1,4 @@ +include /opt/docker/etc/nginx/global.conf; +include /opt/docker/etc/nginx/php.conf; +include /opt/docker/etc/nginx/conf.d/*.conf; +include /opt/docker/etc/nginx/vhost.conf; diff --git a/conf/docker/etc/nginx/php.conf b/conf/docker/etc/nginx/php.conf new file mode 100644 index 0000000..b6141db --- /dev/null +++ b/conf/docker/etc/nginx/php.conf @@ -0,0 +1 @@ +# deprecated diff --git a/conf/docker/etc/nginx/ssl/server.crt b/conf/docker/etc/nginx/ssl/server.crt new file mode 100644 index 0000000..6b06949 --- /dev/null +++ b/conf/docker/etc/nginx/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6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SwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN +VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/conf/docker/etc/nginx/ssl/server.csr b/conf/docker/etc/nginx/ssl/server.csr new file mode 100644 index 0000000..8a9909f --- /dev/null +++ b/conf/docker/etc/nginx/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/conf/docker/etc/nginx/ssl/server.key b/conf/docker/etc/nginx/ssl/server.key new file mode 100644 index 0000000..c9eec14 --- /dev/null +++ b/conf/docker/etc/nginx/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik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J +x3FDfXx5FH4O4ebW3a+pnAcKoN1xcX+N0O6LDRqUYcue3sTAOs3gC9CUbr91KAWD +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/conf/docker/etc/nginx/vhost.common.conf b/conf/docker/etc/nginx/vhost.common.conf new file mode 100644 index 0000000..a5df62e --- /dev/null +++ b/conf/docker/etc/nginx/vhost.common.conf @@ -0,0 +1,2 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate +include /opt/docker/etc/nginx/vhost.common.d/*.conf; diff --git a/conf/docker/etc/nginx/vhost.common.d/.gitkeep b/conf/docker/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/docker/etc/nginx/vhost.common.d/10-general.conf b/conf/docker/etc/nginx/vhost.common.d/10-general.conf new file mode 100644 index 0000000..d3fd0aa --- /dev/null +++ b/conf/docker/etc/nginx/vhost.common.d/10-general.conf @@ -0,0 +1 @@ +client_max_body_size 50m; diff --git a/conf/docker/etc/nginx/vhost.common.d/10-location-root.conf b/conf/docker/etc/nginx/vhost.common.d/10-location-root.conf new file mode 100644 index 0000000..8dcd8c8 --- /dev/null +++ b/conf/docker/etc/nginx/vhost.common.d/10-location-root.conf @@ -0,0 +1,3 @@ +location / { + try_files /public/$uri /public/$uri/ /public/index.php?$query_string; +} \ No newline at end of file diff --git a/conf/docker/etc/nginx/vhost.common.d/10-log.conf b/conf/docker/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 0000000..9646c68 --- /dev/null +++ b/conf/docker/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr warn; diff --git a/conf/docker/etc/nginx/vhost.common.d/10-php.conf b/conf/docker/etc/nginx/vhost.common.d/10-php.conf new file mode 100644 index 0000000..22b08a5 --- /dev/null +++ b/conf/docker/etc/nginx/vhost.common.d/10-php.conf @@ -0,0 +1,7 @@ +location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_read_timeout ; +} diff --git a/conf/docker/etc/nginx/vhost.conf b/conf/docker/etc/nginx/vhost.conf new file mode 100644 index 0000000..8225f31 --- /dev/null +++ b/conf/docker/etc/nginx/vhost.conf @@ -0,0 +1,26 @@ +server { + listen 80 default_server; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; +} + +############## +# SSL +############## + +server { + listen 443 default_server; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; + include /opt/docker/etc/nginx/vhost.ssl.conf; +} diff --git a/conf/docker/etc/nginx/vhost.ssl.conf b/conf/docker/etc/nginx/vhost.ssl.conf new file mode 100644 index 0000000..4ddba25 --- /dev/null +++ b/conf/docker/etc/nginx/vhost.ssl.conf @@ -0,0 +1,7 @@ +ssl on; +ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # not possible to do exclusive +ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'; +ssl_prefer_server_ciphers on; + +ssl_certificate /opt/docker/etc/nginx/ssl/server.crt; +ssl_certificate_key /opt/docker/etc/nginx/ssl/server.key; diff --git a/conf/docker/etc/supervisor.d/nginx.conf b/conf/docker/etc/supervisor.d/nginx.conf new file mode 100644 index 0000000..657bf49 --- /dev/null +++ b/conf/docker/etc/supervisor.d/nginx.conf @@ -0,0 +1,14 @@ +[group:nginx] +programs=nginxd +priority=20 + +[program:nginxd] +command = /opt/docker/bin/service.d/nginx.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/conf/docker/provision/bootstrap.d/.gitkeep b/conf/docker/provision/bootstrap.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/docker/provision/bootstrap.d/10-nginx.sh b/conf/docker/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 0000000..8909da4 --- /dev/null +++ b/conf/docker/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Remove daemon statement (will be added as command line argument) +go-replace --mode=lineinfile --regex --regex-backrefs \ + -s '^[\s#]*daemon ' -r '' \ + -- /etc/nginx/nginx.conf + +go-replace --mode=line --regex --regex-backrefs \ + -s '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stdout $3' \ + -s '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stderr $3' \ + -- /etc/nginx/nginx.conf + +# Enable nginx main config +ln -sf /opt/docker/etc/nginx/main.conf /etc/nginx/conf.d/10-docker.conf + +rm -f \ + /etc/nginx/sites-enabled/default \ + /etc/nginx/conf.d/default.conf + +if [[ "$IMAGE_FAMILY" == "RedHat" ]] || [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + ln -sf /opt/docker/etc/nginx/nginx.conf /etc/nginx/nginx.conf +fi + +# Clear log dir +rm -rf /var/lib/nginx/logs +mkdir -p /var/lib/nginx/logs + +# Set log to stdout/stderr +ln -sf /var/lib/nginx/logs/access.log /docker.stdout +ln -sf /var/lib/nginx/logs/error.log /docker.stderr + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/nginx/ssl +find /opt/docker/etc/nginx/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/nginx/ssl -type f -exec chmod 640 {} \; diff --git a/conf/docker/provision/bootstrap.d/10-php.sh b/conf/docker/provision/bootstrap.d/10-php.sh new file mode 100644 index 0000000..4a7d826 --- /dev/null +++ b/conf/docker/provision/bootstrap.d/10-php.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/conf/docker/provision/entrypoint.d/.gitkeep b/conf/docker/provision/entrypoint.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/docker/provision/entrypoint.d/20-nginx.sh b/conf/docker/provision/entrypoint.d/20-nginx.sh new file mode 100644 index 0000000..c607d66 --- /dev/null +++ b/conf/docker/provision/entrypoint.d/20-nginx.sh @@ -0,0 +1,23 @@ +# Create tmp dir for nginx +mkdir -p /var/tmp/nginx/ + +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf +fi diff --git a/conf/extensions/phalcon.so b/conf/extensions/phalcon.so new file mode 100644 index 0000000..19a0497 Binary files /dev/null and b/conf/extensions/phalcon.so differ diff --git a/conf/mcedit/edit.sh b/conf/mcedit/edit.sh new file mode 100644 index 0000000..b846128 --- /dev/null +++ b/conf/mcedit/edit.sh @@ -0,0 +1,3 @@ +#!/bin/bash +export TERM=xterm-256color +/usr/bin/mcedit --skin=modarin256 $1 \ No newline at end of file diff --git a/conf/mcedit/mc.keymap b/conf/mcedit/mc.keymap new file mode 100644 index 0000000..453dbb2 --- /dev/null +++ b/conf/mcedit/mc.keymap @@ -0,0 +1,459 @@ +[main] +ChangePanel = tab +Help = f1 +UserMenu = f2 +View = f3 +# ViewFile = +Edit = f4 +# EditForceInternal = +Copy = f5 +Move = f6 +MakeDir = f7 +Delete = f8 +Menu = +Quit = f9; f10 +MenuLastSelected = f19 +QuitQuiet = f20 +Find = alt-question +CdQuick = alt-c +HotList = ctrl-backslash +Reread = ctrl-r +DirSize = ctrl-space +Suspend = ctrl-z +Swap = ctrl-u +History = alt-h +# PanelListing = +PanelListingSwitch = alt-t +# PanelListingChange = +ShowHidden = alt-dot +SplitVertHoriz = alt-comma +SplitEqual = alt-equal +SplitMore = alt-shift-right +SplitLess = alt-shift-left +Shell = ctrl-o +PutCurrentPath = alt-a +PutOtherPath = alt-shift-a +PutCurrentSelected = alt-enter; ctrl-enter +PutCurrentFullSelected = ctrl-shift-enter +ViewFiltered = alt-exclamation +Select = kpplus +Unselect = kpminus +SelectInvert = kpasterisk +ScreenList = alt-prime +# OptionsLayout = +# OptionsAppearance = +# OptionsPanel = +# OptionsConfirm = +# OptionsDisplayBits = +# OptionsVfs = +# LearnKeys = +# SaveSetup = +# EditExtensionsFile = +# EditFileHighlightFile = +# Filter = +# ConnectFish = +# ConnectFtp = +# ConnectSmb = +# Undelete = +ExtendedKeyMap = ctrl-x + +[main:xmap] +ChangeMode = c +ChangeOwn = o +CompareDirs = d +CompareFiles = ctrl-d +HotListAdd = h +LinkSymbolicEdit = ctrl-s +Link = l +LinkSymbolic = s +LinkSymbolicRelative = v +PanelInfo = i +PanelQuickView = q +ExternalPanelize = exclamation +VfsList = a +Jobs = j +PutCurrentPath = p +PutOtherPath = ctrl-p +PutCurrentTagged = t +PutOtherTagged = ctrl-t +PutCurrentLink = r +PutOtherLink = ctrl-r + +[panel] +Search = ctrl-s; alt-s +Mark = insert; ctrl-t +MarkUp = shift-up +MarkDown = shift-down +# MarkLeft = +# MarkRight = +Down = down; ctrl-n +Up = up; ctrl-p +Left = left +Right = right +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +PanelOtherCd = alt-o +PanelOtherCdLink = alt-l +ViewRaw = f13 +EditNew = f14 +CopySingle = f15 +MoveSingle = f16 +DeleteSingle = f18 +# SelectExt = +Select = alt-plus +Unselect = alt-minus +SelectInvert = alt-asterisk +CdChild = ctrl-pgdn +CdParent = ctrl-pgup +# CdParentSmart = +# Panelize = +History = alt-shift-h +HistoryNext = alt-u +HistoryPrev = alt-y +BottomOnScreen = alt-j +MiddleOnScreen = alt-r +TopOnScreen = alt-g +PanelOtherSync = alt-i +SelectCodepage = alt-e +Top = alt-lt; home; a1 +Bottom = alt-gt; end; c1 +# Sort = +# SortPrev = +# SortNext = +# SortReverse = +# SortByName = +# SortByExt = +# SortBySize = +# SortByMTime = +# ScrollLeft = +# ScrollRight = + +[dialog] +Ok = enter +Cancel = f9; f10; esc; ctrl-g +Up = left; up +#Left = left; up +Down = right; down +#Right = right; down +Help = f1 +Suspend = ctrl-z +Refresh = ctrl-l +ScreenList = alt-prime +ScreenNext = alt-rbrace +ScreenPrev = alt-lbrace + +[input] +Home = ctrl-a; alt-lt; home; a1 +End = ctrl-e; alt-gt; end; c1 +Left = left; alt-left; ctrl-b +Right = right; alt-right; ctrl-f +WordLeft = ctrl-left; alt-b +WordRight = ctrl-right; alt-f +Backspace = backspace; ctrl-h +Delete = delete; ctrl-d +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +# Mark = +Remove = ctrl-w +# Cut = +Store = alt-w +# Paste = +Yank = ctrl-y +DeleteToEnd = ctrl-k +HistoryPrev = alt-p; ctrl-down +HistoryNext = alt-n; ctrl-up +History = alt-h +Complete = alt-tab +# Clear = +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkToHome = shift-home +MarkToEnd = shift-end + +[listbox] +Up = up; ctrl-p +Down = down; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Delete = delete; d +Clear = shift-delete; shift-d + +[tree] +Help = f1 +Reread = f2; ctrl-r +Forget = f3 +ToggleNavigation = f4 +Copy = f5 +Move = f6 +Up = up; ctrl-p +Down = down; ctrl-n +Left = left +Right = right +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +Search = ctrl-s; alt-s +Delete = f8; delete + +[help] +Help = f1 +Index = f2; c +Back = f3; left; l +Quit = f9; f10; esc +Up = up; ctrl-p +Down = down; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Enter = right; enter +LinkNext = tab +LinkPrev = alt-tab +NodeNext = n +NodePrev = p + +[editor] +Store = ctrl-insert +Paste = shift-insert +Cut = shift-delete +Up = up +Down = down +Left = left +Right = right +WordLeft = ctrl-left; ctrl-z +WordRight = ctrl-right; ctrl-x +Enter = enter +Return = shift-enter; ctrl-enter; ctrl-shift-enter +BackSpace = backspace; ctrl-h +Delete = delete; ctrl-d +PageUp = pgup +PageDown = pgdn +Home = home +End = end +Tab = tab; shift-tab; ctrl-tab; ctrl-shift-tab +Undo = ctrl-u +Redo = alt-r +Top = ctrl-home; alt-lt +Bottom = ctrl-end; alt-gt +ScrollUp = ctrl-up +ScrollDown = ctrl-down +TopOnScreen = ctrl-pgup +BottomOnScreen = ctrl-pgdn +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +DeleteLine = ctrl-y +DeleteToEnd = ctrl-k +# DeleteToHome = +# ParagraphUp = +# ParagraphDown = +Save = f2 +# EditFile = +EditNew = ctrl-n +SaveAs = f12; ctrl-f2 +# Close = +Mark = f3 +Copy = f5 +Move = f6 +Remove = f8 +# MarkLine = +# MarkWord = +# MarkAll = +# Unmark = +Search = f7 +SearchContinue = f17 +# BlockShiftLeft = +# BlockShiftRight = +MarkPageUp = shift-pgup +MarkPageDown = shift-pgdn +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkUp = shift-up +MarkDown = shift-down +MarkToHome = shift-home +MarkToEnd = shift-end +MarkToFileBegin = ctrl-shift-home +MarkToFileEnd = ctrl-shift-end +MarkToPageBegin = ctrl-shift-pgup +MarkToPageEnd = ctrl-shift-pgdn +MarkScrollUp = ctrl-shift-up +MarkScrollDown = ctrl-shift-down +# MarkParagraphUp = +# MarkParagraphDown = +MarkColumnPageUp = alt-pgup +MarkColumnPageDown = alt-pgdn +MarkColumnLeft = alt-left +MarkColumnRight = alt-right +MarkColumnUp = alt-up +MarkColumnDown = alt-down +# MarkColumnScrollUp = +# MarkColumnScrollDown = +# MarkColumnParagraphUp = +# MarkColumnParagraphDown = +BlockSave = ctrl-f +MarkColumn = f13 +Replace = f4 +ReplaceContinue = f14 +Complete = alt-tab +InsertFile = f15 +Quit = f9; f10; esc +InsertOverwrite = insert +Help = f1 +# Date = +Refresh = ctrl-l +Goto = alt-l +Sort = alt-t +Mail = alt-m +ParagraphFormat = alt-p +MatchBracket = alt-b +ExternalCommand = alt-u +UserMenu = f11 +Menu = +Bookmark = alt-k +BookmarkFlush = alt-o +BookmarkNext = alt-j +BookmarkPrev = alt-i +# History = +Shell = ctrl-o +InsertLiteral = ctrl-q +# MacroStartRecord = +# MacroStopRecord = +MacroStartStopRecord = ctrl-r +# MacroDelete = +ShowNumbers = alt-n +ShowTabTws = alt-underline +SyntaxOnOff = ctrl-s +# SyntaxChoose = +# ShowMargin = +Find = alt-enter +FilePrev = alt-minus +FileNext = alt-plus +# RepeatStartStopRecord = +SelectCodepage = alt-e +# Options = +# OptionsSaveMode = +# SpellCheck = +SpellCheckCurrentWord = ctrl-p +# SpellCheckSelectLang = +# LearnKeys = +# WindowMove = +# WindowResize = +# WindowFullscreen = +# WindowList = +# WindowNext = +# WindowPrev = +# ExtendedKeyMap = + +[viewer] +Help = f1 +WrapMode = f2 +Quit = f3; f9; f10; q; esc +HexMode = f4 +Goto = f5 +Search = f7 +SearchForward = slash +SearchBackward = question +SearchContinue = f17; n +SearchForwardContinue = ctrl-s +SearchBackwardContinue = ctrl-r +MagicMode = f8 +NroffMode = +Home = ctrl-a +End = ctrl-e +Left = h; left +Right = l; right +LeftQuick = ctrl-left +RightQuick = ctrl-right +Up = k; y; insert; up; ctrl-p +Down = j; e; delete; down; enter; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +BookmarkGoto = m +Bookmark = r +FileNext = ctrl-f +FilePrev = ctrl-b +SelectCodepage = alt-e +Shell = ctrl-o +Ruler = alt-r + +[viewer:hex] +Help = f1 +HexEditMode = f2 +Quit = f3; f9; f10; q; esc +HexMode = f4 +Goto = f5 +Save = f6 +Search = f7 +SearchForward = slash +SearchBackward = question +SearchContinue = f17; n +SearchForwardContinue = ctrl-s +SearchBackwardContinue = ctrl-r +MagicMode = f8 +NroffMode = +ToggleNavigation = tab +Home = ctrl-a; home +End = ctrl-e; end +Left = b; left +Right = f; right +Up = k; y; up +Down = j; delete; down +PageDown = pgdn; ctrl-v +PageUp = pgup; alt-v +Top = ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g + +[diffviewer] +ShowSymbols = alt-s; s +ShowNumbers = alt-n; l +SplitFull = f +SplitEqual = equal +SplitMore = gt +SplitLess = lt +Tab2 = 2 +Tab3 = 3 +Tab4 = 4 +Tab8 = 8 +Swap = ctrl-u +Redo = ctrl-r +HunkNext = n; enter; space +HunkPrev = p; backspace +Goto = g; shift-g +Save = f2 +Edit = f4 +EditOther = f14 +Merge = f5 +MergeOther = f15 +Search = f7 +SearchContinue = f17 +Options = +Top = ctrl-home +Bottom = ctrl-end +Down = down +Up = up +LeftQuick = ctrl-left +RightQuick = ctrl-right +Left = left +Right = right +PageDown = pgdn +PageUp = pgup +Home = home +End = end +Help = f1 +Quit = f9; f10; q; shift-q; esc +Shell = ctrl-o +SelectCodepage = alt-e diff --git a/conf/sources/nginx.list b/conf/sources/nginx.list new file mode 100644 index 0000000..af2bda2 --- /dev/null +++ b/conf/sources/nginx.list @@ -0,0 +1,2 @@ +deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu/ bionic nginx +deb-src http://nginx.org/packages/mainline/ubuntu/ bionic nginx \ No newline at end of file diff --git a/conf/xdebug/xdebug.ini b/conf/xdebug/xdebug.ini new file mode 100644 index 0000000..d7e878a --- /dev/null +++ b/conf/xdebug/xdebug.ini @@ -0,0 +1,8 @@ +zend_extension=xdebug.so +xdebug.remote_enable=1 +xdebug.remote_handler=dbgp +xdebug.remote_port=9001 +xdebug.remote_autostart=1 +xdebug.remote_connect_back=0 +xdebug.idekey=docker +xdebug.remote_host=dockerhost