diff --git a/.gitignore b/.gitignore index ca247a26844..fa48cc4d69e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,9 @@ tine20/.htaccess tine20/install.properties tine20/Tinebase/js/node_modules* tine20/vendor* +/ci/dependency/package.json +/ci/dependency/composer.json +/ci/dependency/composer.lock +/ci/dependency/library/ +/ci/source/tine20/ +/ci/dependency/npm-shrinkwrap.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000000..1be10e4b5c6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,130 @@ +# $REG see settings>ci_cd>variables +# $REG_USER see settings>ci_cd>variables +# $REG_PASS see settings>ci_cd>variables +# $CI_PROJECT_DIR set by gitlab +# $REG_PREFIX see settings>ci_cd>variables +# $CI_PIPELINE_ID set by gitlab +# $PHP_IMAGE_TAG default = 7.3-fpm-alpine +# $SKIP_TEST_SOURCE default = false +# $SKIP_TEST_BUILT default = false +# $SKIP_DEPLOY_1 default = false +# $SKIP_DEPLOY_2 default = false + +# $PUSH default = true, false -> to skip pushing final images to registry +include: + - local: '/ci/gitlab-ci.yml/abstract_test.yml' + +stages: + - build_1 + - build_2 + - test_source + - build_3 + - test_built + - deploy_1 + - deploy_2 + - cleanup + +variables: + PUSH: "true" + REG: "$CI_REGISTRY" + REG_USER: "$CI_REGISTRY_USER" + REG_PASS: "$CI_REGISTRY_PASSWORD" + +docker_build_base_and_dependency_images: + image: docker:19.03.1 + stage: build_1 + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_build_1 + +docker_build_source_and_source_test_images: + image: docker:19.03.1 + stage: build_2 + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_build_2 + rules: + - when: on_success + +php_unit_all_test_source: + extends: .abstract_test.php_unit_test + stage: test_source + image: + name: "$REG/$REG_PREFIX/test-source:$CI_PIPELINE_ID" + rules: + - if: $SKIP_TEST_SOURCE == "true" + when: never + - when: on_success + +docker_build_dev_and_built_and_built_test_images: + image: docker:19.03.1 + stage: build_3 + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_build_3 + rules: + - if: &working_branch_condition $CI_COMMIT_REF_NAME =~ /^feat\// # todo match feature branches + when: never + - when: on_success + + +php_unit_all_tests_built: + extends: .abstract_test.php_unit_test + stage: test_built + image: + name: "$REG/$REG_PREFIX/test-built:$CI_PIPELINE_ID" + rules: + - if: $SKIP_TEST_BUILT == "true" + when: never + - if: *working_branch_condition + when: never + - when: on_success + +php_unit_all_tests_built_with_ldap: + extends: .abstract_test.php_unit_test_with_ldap + stage: test_built + image: + name: "$REG/$REG_PREFIX/test-built:$CI_PIPELINE_ID" + rules: + - if: $RUN_LDAP_TESTA == "true" + when: on_success + - when: never + +docker_push_base_and_dependency_images: + image: docker:19.03.1 + stage: deploy_1 + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_deploy_1 + rules: + - if: $SKIP_DEPLOY == "true" + when: never + - when: on_success + +docker_push_built_and_built_test_and_dev_images: + image: docker:19.03.1 + stage: deploy_2 + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_deploy_2 + rules: + - if: $SKIP_DEPLOY == "true" + when: never + - if: *working_branch_condition + when: never + - when: on_success + +docker_untag_build_id_tag_images: + image: docker:19.03.1 + stage: cleanup + before_script: + - sh -e $CI_PROJECT_DIR/ci/build.sh docker_login + script: + - sh -e $CI_PROJECT_DIR/ci/build.sh stage_delete_images + rules: + - when: always \ No newline at end of file diff --git a/ci/base/Dockerfile b/ci/base/Dockerfile new file mode 100644 index 00000000000..f5f0060ee64 --- /dev/null +++ b/ci/base/Dockerfile @@ -0,0 +1,95 @@ +# tine20-docker-registry.mws-hosting.net/docker/tine20/base +# base docker file +# software: +# + php +# + php-fpm +# + nginx +# + supervisor -> to run multiple processes +# + confd -> for environment variable to config mapping +# + php modules: bcmath, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, hash, iconv, igbinary, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, +# posix, readline, redis, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib +# +# configuration +# + metadata ./confd/conf.d +# + templates ./confd/templates +# +# running +# + nginx: port 80 +# + nginx & php-fpm user: nginx +# + status: /ADMIN/nginx-status , /ADMIN/fpm-status +# + healthcheck: /ADMIN/fpm-ping +# + container checks every 30s + +# tag is replaced by the pipeline +ARG SOURCE_IMAGE_TAG=7.3-fpm-alpine +ARG SOURCE_IMAGE=php + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +# https://github.com/docker-library/php/issues/240 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php +RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv + +# install.tmpl webserver and pcs +RUN apk --no-cache add nginx supervisor curl && \ + mkdir -p /etc/supervisor.d/ && \ + mkdir -p /run/nginx/ && \ +# install.tmpl configuration managers working like a charm. Also the changing +# confd enabels configuration with env variables +# there for it creates configuration files from templates + wget https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 && \ + mv ./confd-0.16.0-linux-amd64 /usr/sbin/confd && \ + chmod +x /usr/sbin/confd && \ + mkdir -p /etc/confd && \ +# install.tmpl php build dependencies + apk add --no-cache --virtual .build-deps autoconf gcc musl-dev make g++ && \ + docker-php-source extract && \ +# install.tmpl php module dependencies + apk add --no-cache libjpeg-turbo-dev libpng-dev icu-dev libxslt-dev zlib-dev libzip-dev yaml-dev freetype-dev gettext libintl gettext-dev bash openldap-dev && \ +# install.tmpl php extentions + docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ + docker-php-ext-install bcmath exif mysqli pcntl pdo_mysql soap sockets zip xsl intl gd opcache gettext iconv ldap && \ + docker-php-ext-enable ldap && \ + pecl install igbinary && echo -e "extension=igbinary.so\nigbinary.compact_strings=On" > /usr/local/etc/php/conf.d/php-ext-igbinary.ini && \ + echo "yes" | pecl install redis-4.3.0 && echo "extension=redis.so" > /usr/local/etc/php/conf.d/php-ext-redis.ini && \ + echo "" | pecl install yaml && echo "extension=yaml.so" > /usr/local/etc/php/conf.d/php-ext-yaml.ini && \ +# remove php build dependencies + apk del --purge .build-deps && \ + docker-php-source delete && \ +#install.tmpl nodejs and npm +# create tine folders + mkdir /tine && \ + mkdir /tine/conf.d && \ + mkdir /tine/logs && \ + mkdir /tine/files && \ + mkdir /tine/tmp && \ + mkdir /tine/caching && \ + mkdir /tine/sessions && \ + mkdir /etc/tine20 && \ + mkdir /var/run/tine20 && \ + chown nginx:nginx /tine/logs && \ + chown nginx:nginx /tine/files && \ + chown nginx:nginx /tine/caching && \ + chown nginx:nginx /tine/sessions && \ + chown nginx:nginx /tine/tmp + +# start up script +COPY install_tine.sh /install_tine.sh +COPY wait_for_db.php /wait_for_db.php + +# copy config templates to confd dir +COPY confd /etc/confd +COPY supervisor/* /etc/supervisor.d/ + +# set workdir +WORKDIR /tine + +# setup entrypoint +# + first runs confd to create configs +# + then start supervisor +COPY entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] + +# checks if php-fpm an nginx are working +HEALTHCHECK --timeout=30s CMD curl --silent --fail http://127.0.0.1:80/ADMIN/fpm-ping \ No newline at end of file diff --git a/ci/base/confd/conf.d/nginx-vhost.toml b/ci/base/confd/conf.d/nginx-vhost.toml new file mode 100644 index 00000000000..84220787f29 --- /dev/null +++ b/ci/base/confd/conf.d/nginx-vhost.toml @@ -0,0 +1,11 @@ +[template] +prefix = "/nginxv" +src = "nginx-vhost.conf.tmpl" +dest = "/etc/nginx/conf.d/default.conf" +owner = "root" +mode = "0644" +keys = [ + "/server/name", + "/client/max/body/size", + +] \ No newline at end of file diff --git a/ci/base/confd/conf.d/nginx.toml b/ci/base/confd/conf.d/nginx.toml new file mode 100644 index 00000000000..d6c89f75ed8 --- /dev/null +++ b/ci/base/confd/conf.d/nginx.toml @@ -0,0 +1,14 @@ +[template] +prefix = "/nginx" +src = "nginx.conf.tmpl" +dest = "/etc/nginx/nginx.conf" +owner = "root" +mode = "0644" +keys = [ + "/client/max/body/size", + "/keepalive/timeout", + "/tcp/nopush", + "/gzip", + "/gzip/static" +] +check_cmd = "/usr/sbin/nginx -t -c {{.src}}" \ No newline at end of file diff --git a/ci/base/confd/conf.d/php-fpm.toml b/ci/base/confd/conf.d/php-fpm.toml new file mode 100644 index 00000000000..3357106b134 --- /dev/null +++ b/ci/base/confd/conf.d/php-fpm.toml @@ -0,0 +1,15 @@ +[template] +prefix = "/phpfpm" +src = "php-fpm.conf.tmpl" +dest = "/usr/local/etc/php-fpm.d/www.conf" +owner = "root" +mode = "0644" +keys = [ + "/dynamic", + "/pm/max/children", + "/pm/start/server", + "/pm/min/spare/servers", + "/pm/max/spare/servers", + "/pm/max/requests", + "healthcheck" +] \ No newline at end of file diff --git a/ci/base/confd/conf.d/php.toml b/ci/base/confd/conf.d/php.toml new file mode 100644 index 00000000000..0dc909713ad --- /dev/null +++ b/ci/base/confd/conf.d/php.toml @@ -0,0 +1,23 @@ +[template] +prefix = "/php" +src = "php.ini.tmpl" +dest = "/usr/local/etc/php/conf.d/php.ini" +owner = "root" +mode = "0644" +keys = [ + "/percision", + "/output/buffering", + "/implicit/flush", + "/expose/php", + "/max/execution/time", + "/max/input/time", + "/max/input/nesting/level", + "/max/input/vars", + "/memory/limit", + "/display/errors", + "/variables/order", + "/post/max/size", + "/upload/max/filesize", + "/max/file/uploads", + "/default/socket/timeout" +] \ No newline at end of file diff --git a/ci/base/confd/conf.d/tine-install.toml b/ci/base/confd/conf.d/tine-install.toml new file mode 100644 index 00000000000..44f3f294caf --- /dev/null +++ b/ci/base/confd/conf.d/tine-install.toml @@ -0,0 +1,11 @@ +[template] +prefix = "/install" +src = "install.tmpl" +dest = "/etc/tine20/install.properties" +owner = "root" +mode = "0644" +keys = [ + "/login/username", + "/login/password", + "/admin/email" +] \ No newline at end of file diff --git a/ci/base/confd/conf.d/tine.toml b/ci/base/confd/conf.d/tine.toml new file mode 100644 index 00000000000..e14f0c5f7c3 --- /dev/null +++ b/ci/base/confd/conf.d/tine.toml @@ -0,0 +1,34 @@ +[template] +prefix = "/tine20" +src = "config.inc.php.tmpl" +dest = "/etc/tine20/config.inc.php" +owner = "root" +mode = "0644" +keys = [ + "/buildtype", + "/logger/priority", + "/filesdir", + "/tmpdir", + "/database/host", + "/database/dbname", + "/database/username", + "/database/password", + "/database/tableprefix", + "/database/adapter", + "/setupuser/username", + "/setupuser/password", + "/login/username", + "/login/password", + "/caching/active", + "/caching/lifetime", + "/caching/backend", + "/caching/redis/host", + "/caching/redis/port", + "/caching/redis/prefix", + "/caching/path", + "/session/lifetime", + "/session/backend", + "/session/host", + "/session/port", + "/session/path" +] \ No newline at end of file diff --git a/ci/base/confd/templates/config.inc.php.tmpl b/ci/base/confd/templates/config.inc.php.tmpl new file mode 100644 index 00000000000..aeaa1a5dfa5 --- /dev/null +++ b/ci/base/confd/templates/config.inc.php.tmpl @@ -0,0 +1,59 @@ + '{{getv "/buildtype" "RELEASE"}}', + 'confdfolder' => '/tine/conf.d', + + 'logger' => array ( + 'active' => true, + 'filename' => 'php://stdout', + 'priority' => {{getv "/logger/priority" "5"}}, + 'additionalWriters' => array(array( + 'active' => true, + 'filename' => '/tine/logs/debug.log', + 'priority' => '7', + )) + ), + + 'filesdir' => '{{getv "/filesdir" "/tine/files"}}', + 'tmpdir' => '{{getv "/tmpdir" "/tine/tmp"}}', + + 'database' => array( + 'host' => '{{getv "/database/host" ""}}', + 'dbname' => '{{getv "/database/dbname" ""}}', + 'username' => '{{getv "/database/username" ""}}', + 'password' => '{{getv "/database/password" ""}}', + 'tableprefix' => '{{getv "/database/tableprefix" "tine20_"}}', + 'adapter' => '{{getv "/database/adapter" "pdo_mysql"}}', + ), + + 'setupuser' => array( + 'username' => '{{getv "/setupuser/username" "tine20setup"}}', + 'password' => '{{getv "/setupuser/password" "tine20setup"}}', + ), + + 'login' => array( + 'username' => '{{getv "/login/username" "tine20admin"}}', + 'password' => '{{getv "/login/password" "tine20admin"}}', + ), + + 'caching' => array ( + 'active' => {{getv "/caching/active" "true"}}, + 'lifetime' => {{getv "/caching/lifetime" "3600"}}, + 'backend' => '{{getv "/caching/backend" "File"}}', + 'redis' => array ( + 'host' => '{{getv "/caching/redis/host" ""}}', + 'port' => {{getv "/caching/redis/port" "null"}}, + 'prefix' => '{{getv "/caching/redis/prefix" "master"}}', + ), + 'path' => '{{getv "/caching/path" "/tine/caching"}}', + ), + + 'session' => array ( + 'lifetime' => {{getv "/session/lifetime" "86400"}}, + 'backend' => '{{getv "/session/backend" "File"}}', + 'path' => '{{getv "/session/path" "/tine/sessions"}}', + ), + + 'credentialCacheSharedKey' => '{{getv "/credentialcachesharedkey" "changeMeNow"}}', +); diff --git a/ci/base/confd/templates/install.tmpl b/ci/base/confd/templates/install.tmpl new file mode 100644 index 00000000000..55f9cd79f81 --- /dev/null +++ b/ci/base/confd/templates/install.tmpl @@ -0,0 +1,3 @@ +adminLoginName={{getv "/login/username" "tine20admin"}} +adminPassword={{getv "/login/password" "tine20admin"}} +adminEmailAddress={{getv "/admin/email" "tine20admin@example.com"}} \ No newline at end of file diff --git a/ci/base/confd/templates/nginx-vhost.conf.tmpl b/ci/base/confd/templates/nginx-vhost.conf.tmpl new file mode 100644 index 00000000000..d41afc82e35 --- /dev/null +++ b/ci/base/confd/templates/nginx-vhost.conf.tmpl @@ -0,0 +1,94 @@ +server { + listen 80; + listen [::]:80; + + server_name {{getv "/server/name" "_"}}; + root "/tine/tine20"; + index index.php; + + error_log /dev/stderr; + access_log /dev/stdout; + + port_in_redirect off; + client_max_body_size {{getv "/client/max/body/size" "24M"}}; + + set $PHP_VALUE "include_path=/etc/tine20:/tine/tine20 + max_execution_time = 1800 + memory_limit = 256M"; + + if ($request_method != (GET|POST) ) { + rewrite ^$ /index.php?frontend=webdav last; + } + + rewrite (?i)^/Microsoft-Server-ActiveSync /index.php?frontend=activesync last; + rewrite (?i)^/users/(.*) /index.php?frontend=openid&username=$1 last; + rewrite (?i)^/(addressbooks|calendars|webdav|principals|remote.php) /index.php?frontend=webdav last; + rewrite (?i)^/download/get/(.*) /index.php?method=Download.downloadNode&path=$1 last; + rewrite (?i)^/download/show/(.*) /index.php?method=Download.displayNode&path=$1 last; + + # webpack + rewrite ^/webpack-dev-server /webpack-dev-server last; + + + ################# + # tine20 config # + ################# + + location / { + try_files $uri $uri/ /index.php; + + # polls + if (!-e $request_filename) { + rewrite ^/.*$ /index.php?doRouting=1 last; + } + + rewrite .+\.php /index.php; + } + + location ~ ^(/setup.php$|/hidden) { + try_files $uri /index.php; + fastcgi_param PHP_ADMIN_VALUE $PHP_ADMIN_VALUE; + fastcgi_param PHP_VALUE $PHP_VALUE; + include /etc/nginx/fastcgi_params; + #fastcgi_pass unix:/var/run/php-fpm.sock; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_read_timeout 3600; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~ .+\.php$ { + try_files $uri /index.php; + fastcgi_param PHP_ADMIN_VALUE $PHP_ADMIN_VALUE; + fastcgi_param PHP_VALUE $PHP_VALUE; + include /etc/nginx/fastcgi_params; + #fastcgi_pass unix:/var/run/php-fpm.sock; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_read_timeout 3600; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + try_files $uri /index.php; + expires 7d; + add_header Pragma public; + add_header Cache-Control "public"; + } + + location = /ADMIN/nginx-status { + stub_status; + } + + location = /ADMIN/fpm-status { + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass 127.0.0.1:9000; + } + + location = /ADMIN/fpm-ping { + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass 127.0.0.1:9000; + } +} diff --git a/ci/base/confd/templates/nginx.conf.tmpl b/ci/base/confd/templates/nginx.conf.tmpl new file mode 100644 index 00000000000..197ceaf1b0e --- /dev/null +++ b/ci/base/confd/templates/nginx.conf.tmpl @@ -0,0 +1,50 @@ +# /etc/nginx/nginx.conf + +user nginx; + +worker_processes auto; + +pcre_jit on; + +error_log /dev/stderr warn; + +include /etc/nginx/modules/*.conf; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + server_tokens off; + + client_max_body_size {{getv "/client/max/body/size" "1m"}}; + + keepalive_timeout {{getv "/keepalive/timeout" "65"}}; + + sendfile on; + + tcp_nodelay on; + + tcp_nopush {{getv "/tcp/nopush" "off"}}; + + ssl_prefer_server_ciphers on; + + ssl_session_cache shared:SSL:2m; + + gzip {{getv "/gzip" "off"}}; + + gzip_vary on; + + gzip_static {{getv "/gzip/static" "off"}}; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /dev/stdout main; + + include /etc/nginx/conf.d/*; +} \ No newline at end of file diff --git a/ci/base/confd/templates/php-fpm.conf.tmpl b/ci/base/confd/templates/php-fpm.conf.tmpl new file mode 100644 index 00000000000..78a443a105d --- /dev/null +++ b/ci/base/confd/templates/php-fpm.conf.tmpl @@ -0,0 +1,38 @@ +[global] +error_log = /dev/stderr + +[www] +user = nginx +group = nginx + +listen = 127.0.0.1:9000 + +;listen.backlog = 511 + +;listen.allowed_clients = 127.0.0.1 + +pm = {{getv "/dynamic" "dynamic"}} +pm.max_children = {{getv "/pm/max/children" "5"}} +pm.start_servers = {{getv "/pm/start/server" "2"}} +pm.min_spare_servers = {{getv "/pm/min/spare/servers" "1"}} +pm.max_spare_servers = {{getv "/pm/max/spare/servers" "3"}} +;pm.process_idle_timeout = 10s; +pm.max_requests = {{getv "/pm/max/requests" "500"}} + +access.log = /dev/stdout +slowlog = /dev/stdout + +;request_slowlog_timeout = 0 +;request_slowlog_trace_depth = 20 +;request_terminate_timeout = 0 + +;rlimit_files = 1024 +;rlimit_core = 0 + +;catch_workers_output = yes +;decorate_workers_output = no +clear_env = no + +pm.status_path = /ADMIN/fpm-status +ping.path = /ADMIN/fpm-ping +;ping.response = pong \ No newline at end of file diff --git a/ci/base/confd/templates/php.ini.tmpl b/ci/base/confd/templates/php.ini.tmpl new file mode 100644 index 00000000000..b68e024670d --- /dev/null +++ b/ci/base/confd/templates/php.ini.tmpl @@ -0,0 +1,127 @@ +[PHP] +include_path = ".:/etc/tine20:/usr/local/lib/php" +engine = On +short_open_tag = Off +precision = {{getv "/percision" "14"}} +output_buffering = {{getv "/output/buffering" "4096"}} +zlib.output_compression = Off +implicit_flush = {{getv "/implicit/flush" "Off"}} +unserialize_callback_func = +serialize_precision = -1 +disable_functions = +disable_classes = +;realpath_cache_size = 4096k +;realpath_cache_ttl = 120 +zend.enable_gc = On +expose_php = {{getv "/expose/php" "On"}} +max_execution_time = {{getv "/max/execution/time" "30"}} +max_input_time = {{getv "/max/input/time" "60"}} +max_input_nesting_level = {{getv "/max/input/nesting/level" "64"}} +max_input_vars = {{getv "/max/input/vars" "1000"}} +memory_limit = {{getv "/memory/limit" "1024M"}} +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT +display_errors = {{getv "/display/errors" "Off"}} +display_startup_errors = Off +log_errors = On +log_errors_max_len = 1024 +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On +html_errors = On +variables_order = {{getv "/variables/order" "EGPCS"}} +request_order = "GP" +register_argc_argv = Off +auto_globals_jit = On +;enable_post_data_reading = Off +post_max_size = {{getv "/post/max/size" "8M"}} +auto_prepend_file = +auto_append_file = +default_mimetype = "text/html" +default_charset = "UTF-8" +doc_root = +user_dir = +enable_dl = Off +file_uploads = On +upload_max_filesize = {{getv "/upload/max/filesize" "2M"}} +max_file_uploads = {{getv "/max/file/uploads" "20"}} +allow_url_fopen = On +allow_url_include = Off +default_socket_timeout = {{getv "/default/socket/timeout" "60"}} +[CLI Server] +cli_server.color = On +[Pdo_mysql] +pdo_mysql.default_socket= +[mail function] +SMTP = localhost +smtp_port = 25 +mail.add_x_header = Off +[ODBC] +odbc.allow_persistent = On +odbc.check_persistent = On +odbc.max_persistent = -1 +odbc.max_links = -1 +odbc.defaultlrl = 4096 +odbc.defaultbinmode = 1 +[Interbase] +ibase.allow_persistent = 1 +ibase.max_persistent = -1 +ibase.max_links = -1 +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" +ibase.dateformat = "%Y-%m-%d" +ibase.timeformat = "%H:%M:%S" +[MySQLi] +mysqli.max_persistent = -1 +mysqli.allow_persistent = On +mysqli.max_links = -1 +mysqli.default_port = 3306 +mysqli.default_socket = +mysqli.default_host = +mysqli.default_user = +mysqli.default_pw = +mysqli.reconnect = Off +[mysqlnd] +mysqlnd.collect_statistics = On +mysqlnd.collect_memory_statistics = Off +[PostgreSQL] +pgsql.allow_persistent = On +pgsql.auto_reset_persistent = Off +pgsql.max_persistent = -1 +pgsql.max_links = -1 +pgsql.ignore_notice = 0 +pgsql.log_notice = 0 +[bcmath] +bcmath.scale = 0 +[Session] +session.save_handler = files +session.use_strict_mode = 0 +session.use_cookies = 1 +session.use_only_cookies = 1 +session.name = PHPSESSID +session.auto_start = 0 +session.cookie_lifetime = 0 +session.cookie_path = / +session.cookie_domain = +session.cookie_httponly = +session.cookie_samesite = +session.serialize_handler = php +session.gc_probability = 1 +session.gc_divisor = 1000 +session.gc_maxlifetime = 1440 +session.referer_check = +session.cache_limiter = nocache +session.cache_expire = 180 +session.use_trans_sid = 0 +session.sid_length = 26 +session.trans_sid_tags = "a=href,area=href,frame=src,form=" +session.sid_bits_per_character = 5 +[Assertion] +zend.assertions = -1 +[Tidy] +tidy.clean_output = Off +[soap] +soap.wsdl_cache_enabled=1 +soap.wsdl_cache_dir="/tmp" +soap.wsdl_cache_ttl=86400 +soap.wsdl_cache_limit = 5 +[ldap] +ldap.max_links = -1 \ No newline at end of file diff --git a/ci/base/entrypoint.sh b/ci/base/entrypoint.sh new file mode 100755 index 00000000000..8e168cbb7f7 --- /dev/null +++ b/ci/base/entrypoint.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +/usr/sbin/confd -onetime -backend env +/usr/bin/supervisord -c /etc/supervisord.conf --nodaemon \ No newline at end of file diff --git a/ci/base/install_tine.sh b/ci/base/install_tine.sh new file mode 100644 index 00000000000..1c702c4128f --- /dev/null +++ b/ci/base/install_tine.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +if [ "${TINE20_INSTALL,,}" != "true" ]; then exit; fi + +/usr/local/bin/php /wait_for_db.php +cd /tine/tine20/ && php setup.php --install --config /etc/tine20/config.inc.php -- \ + adminLoginName="${TINE20_LOGIN_USERNAME:-tine20admin}" \ + adminPassword="${TINE20_LOGIN_PASSWORD:-tine20admin}" \ + adminEmailAddress="${TINE20_ADMIN_EMAIL:-tine20admin@example.org}" \ + acceptedTermsVersion=1000 \ + imap="${TINE20_EMAIL_IMAP}" \ + smtp="${TINE20_EMAIL_SMTP}" \ + sieve="${TINE20_EMAIL_SIEVE}" \ + authentication="${TINE20_AUTHENTICATION}" \ + accounts="${TINE20_ACCOUNTS}" \ No newline at end of file diff --git a/ci/base/supervisor/nginx.ini b/ci/base/supervisor/nginx.ini new file mode 100644 index 00000000000..4e1fd4519b2 --- /dev/null +++ b/ci/base/supervisor/nginx.ini @@ -0,0 +1,12 @@ +[program:nginx] +command=/usr/sbin/nginx -g "daemon off; error_log /dev/stderr info;" +autostart=true +autorestart=true +priority=10 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stopsignal=QUIT \ No newline at end of file diff --git a/ci/base/supervisor/php-fpm.ini b/ci/base/supervisor/php-fpm.ini new file mode 100644 index 00000000000..85aabbb1300 --- /dev/null +++ b/ci/base/supervisor/php-fpm.ini @@ -0,0 +1,12 @@ +[program:php-fpm] +command = /usr/local/sbin/php-fpm --force-stderr --nodaemonize --fpm-config /usr/local/etc/php-fpm.d/www.conf +autostart=true +autorestart=true +priority=5 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stopsignal=QUIT diff --git a/ci/base/wait_for_db.php b/ci/base/wait_for_db.php new file mode 100644 index 00000000000..3c6c6f2f7cc --- /dev/null +++ b/ci/base/wait_for_db.php @@ -0,0 +1,51 @@ + 20) { + print($e->getMessage()); + } + } + sleep(1); +} + +print("Failed to connect to database, with: type=$type, host=$host, dbname=$dbname, username=$user, password=********."); +print("Loaded from /etc/tine20/config.inc.php"); \ No newline at end of file diff --git a/ci/build.sh b/ci/build.sh new file mode 100644 index 00000000000..76fc2147386 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,161 @@ +build_all() { + stage_build_1 + stage_build_2 + stage_build_3 + stage_deploy_1 + stage_deploy_2 +} + +stage_build_1() { + docker_build_image base $BUILD_TAG php $PHP_TAG + job_build_dependency + docker_push_image base $BUILD_TAG + docker_push_image dependency $BUILD_TAG +} + +stage_build_1_lazy() { + if docker_pull dependency "$TINE_TAG-$PHP_TAG"; then + if docker_pull base "$TINE_TAG-$PHP_TAG"; then + docker_tag dependency "$TINE_TAG-$PHP_TAG" $BUILD_TAG + docker_push_image dependency $BUILD_TAG + docker_tag base "$TINE_TAG-$PHP_TAG" $BUILD_TAG + docker_push_image base $BUILD_TAG + else + stage_build_1 + fi + else + stage_build_1 + fi +} + +stage_build_2() { + job_build_source + job_build_test_source + docker_push_image source $BUILD_TAG + docker_push_image test-source $BUILD_TAG +} + +stage_build_3() { + docker_build_image build $BUILD_TAG $REGISTRY/source $BUILD_TAG + job_build_built + docker_build_image dev $BUILD_TAG $REGISTRY/base $BUILD_TAG + job_build_test_built + + docker_push_image built $BUILD_TAG + docker_push_image dev $BUILD_TAG + docker_push_image test-built $BUILD_TAG +} + +stage_deploy_1() { + docker_tag base $BUILD_TAG "$TINE_TAG-$PHP_TAG" + docker_tag dependency $BUILD_TAG "$TINE_TAG-$PHP_TAG" + + docker_push_image base "$TINE_TAG-$PHP_TAG" + docker_push_image dependency "$TINE_TAG-$PHP_TAG" +} + +stage_deploy_2() { + docker_tag built $BUILD_TAG "$TINE_TAG-$PHP_TAG" + docker_tag dev $BUILD_TAG "$TINE_TAG-$PHP_TAG" + + docker_push_image built "$TINE_TAG-$PHP_TAG" + docker_push_image dev "$TINE_TAG-$PHP_TAG" +} + +stage_delete_images() { + docker_image_rm base $BUILD_TAG + docker_image_rm dependency $BUILD_TAG + docker_image_rm source $BUILD_TAG + docker_image_rm test-source $BUILD_TAG + docker_image_rm build $BUILD_TAG + docker_image_rm dev $BUILD_TAG + docker_image_rm built $BUILD_TAG + docker_image_rm test-built $BUILD_TAG +} + +job_build_test_source() { + cp -r ../docs/config ./test-source/config + + docker_build_image test-source $BUILD_TAG $REGISTRY/source $BUILD_TAG +} + +job_build_dependency() { + cp -r ../tine20/library ./dependency/library + cp ../tine20/composer.json ./dependency/composer.json + cp ../tine20/composer.lock ./dependency/composer.lock + cp ../tine20/Tinebase/js/package.json ./dependency/package.json + cp ../tine20/Tinebase/js/npm-shrinkwrap.json ./dependency/npm-shrinkwrap.json + + docker_build_image dependency $BUILD_TAG $REGISTRY/base $BUILD_TAG +} + +job_build_source() { + mkdir ../ci/source/tine20 + cp -r ../.git ./source/tine20/ + cp -r ../scripts ./source/tine20/ + cp -r ../tests ./source/tine20/ + cp -r ../tine20 ./source/tine20/ + + docker_build_image source $BUILD_TAG $REGISTRY/dependency $BUILD_TAG +} + +job_build_built() { + echo "$ docker build ./built -t $REGISTRY/built:$BUILD_TAG --build-arg SOURCE_IMAGE_BUILD=build --build-arg SOURCE_IMAGE_TAG_BUILD=$BUILD_TAG --build-arg SOURCE_IMAGE_BASE=$REGISTRY/base --build-arg SOURCE_IMAGE_TAG_BASE=$BUILD_TAG;" + docker build ./built -t $REGISTRY/built:$BUILD_TAG --build-arg SOURCE_IMAGE_BUILD=$REGISTRY/build --build-arg SOURCE_IMAGE_TAG_BUILD=$BUILD_TAG --build-arg SOURCE_IMAGE_BASE=$REGISTRY/base --build-arg SOURCE_IMAGE_TAG_BASE=$BUILD_TAG; +} + +job_build_test_built() { + cp -r ../docs/config ./test-built/config + + echo "$ docker build ./test-built -t $REGISTRY/test-built:$BUILD_TAG --build-arg SOURCE_IMAGE_BUILD=build --build-arg SOURCE_IMAGE_TAG_BUILD=$BUILD_TAG --build-arg SOURCE_IMAGE_BUILT=$REGISTRY/built --build-arg SOURCE_IMAGE_TAG_BUILT=$BUILD_TAG;" + docker build ./test-built -t $REGISTRY/test-built:$BUILD_TAG --build-arg SOURCE_IMAGE_BUILD=$REGISTRY/build --build-arg SOURCE_IMAGE_TAG_BUILD=$BUILD_TAG --build-arg SOURCE_IMAGE_BUILT=$REGISTRY/built --build-arg SOURCE_IMAGE_TAG_BUILT=$BUILD_TAG; +} + +docker_build_image() { + echo "$ docker build ./$1 -t $REGISTRY/$1:$2 --build-arg SOURCE_IMAGE=$3 --build-arg SOURCE_IMAGE_TAG=$4;" + docker build ./$1 -t $REGISTRY/$1:$2 --build-arg SOURCE_IMAGE=$3 --build-arg SOURCE_IMAGE_TAG=$4; +} + +docker_push_image() { + if [ "$PUSH" = "true" ] ; then + echo "$ docker push $REGISTRY/$1:$2" + docker push $REGISTRY/$1:$2 + fi +} + +docker_login() { + if [ "$PUSH" = "true" ] ; then + echo "$ docker login $REG --username **** --password ****" + docker login $REG --username $REG_USER --password $REG_PASS + fi +} + + +docker_pull() { + echo "$ docker pull $REGISTRY/$1:$2" + docker pull $REGISTRY/$1:$2 +} + +docker_tag() { + echo "$ docker tag $REGISTRY/$1:$2 $REGISTRY/$1:$3" + docker tag $REGISTRY/$1:$2 $REGISTRY/$1:$3 +} + +docker_image_rm() { + echo "$ docker image rm $REGISTRY/$1:$2 || true" + docker image rm $REGISTRY/$1:$2 || true +} + +REG="${REG:-tine20-docker-registry.mws-hosting.net}" +REG_PREFIX="${REG_PREFIX:-docker/tine20}" +BUILD_TAG="${CI_PIPELINE_ID:-latest}" +PUSH="${PUSH:-false}" +REGISTRY="$REG/$REG_PREFIX" +TINE_TAG="${CI_COMMIT_REF_NAME:-unknown}" +TINE_TAG="$(echo $TINE_TAG | sed sI/I-Ig)" +PHP_TAG="${PHP_IMAGE_TAG:-unknown}" + +echo $PUSH + +cd `dirname "$0"` +$1 \ No newline at end of file diff --git a/ci/build/Dockerfile b/ci/build/Dockerfile new file mode 100644 index 00000000000..7855ca6e74a --- /dev/null +++ b/ci/build/Dockerfile @@ -0,0 +1,8 @@ +ARG SOURCE_IMAGE_TAG +ARG SOURCE_IMAGE=source + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +# build tine +RUN cd /tine/tine20/ && vendor/bin/phing build \ No newline at end of file diff --git a/ci/built/Dockerfile b/ci/built/Dockerfile new file mode 100644 index 00000000000..c7f8b1c1987 --- /dev/null +++ b/ci/built/Dockerfile @@ -0,0 +1,17 @@ +ARG SOURCE_IMAGE_TAG_BUILD +ARG SOURCE_IMAGE_TAG_BASE +ARG SOURCE_IMAGE_BUILD=build +ARG SOURCE_IMAGE_BASE=base + + +FROM ${SOURCE_IMAGE_BUILD}:${SOURCE_IMAGE_TAG_BUILD} as build + +FROM ${SOURCE_IMAGE_BASE}:${SOURCE_IMAGE_TAG_BASE} as built +# copy tine source +COPY --from=build /tine/tine20 /tine/tine20 +COPY --from=build /tine/scripts /tine/scripts + +# start up script +COPY supervisor /etc/supervisor.d + +RUN chmod +x /install_tine.sh \ No newline at end of file diff --git a/ci/built/supervisor/install_tine.ini b/ci/built/supervisor/install_tine.ini new file mode 100644 index 00000000000..b4616cea6ec --- /dev/null +++ b/ci/built/supervisor/install_tine.ini @@ -0,0 +1,10 @@ +[program:install_tine] +command=/install_tine.sh +autostart=true +priority=1023 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/ci/dependency/Dockerfile b/ci/dependency/Dockerfile new file mode 100644 index 00000000000..cc0b6e550bb --- /dev/null +++ b/ci/dependency/Dockerfile @@ -0,0 +1,21 @@ +ARG SOURCE_IMAGE_TAG +ARG PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ARG SOURCE_IMAGE=base + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +#install.tmpl tools +RUN apk add --no-cache composer git npm + +RUN mkdir /tine/tine20 +RUN mkdir -p /tine/tine20/Tinebase/js + +COPY ./library /tine/tine20/library +COPY ./composer.json /tine/tine20/composer.json +COPY ./composer.lock /tine/tine20/composer.lock +COPY ./package.json /tine/tine20/Tinebase/js/package.json +COPY ./npm-shrinkwrap.json /tine/tine20/Tinebase/js/package.json + +RUN cd /tine/tine20 && composer install --no-scripts +RUN cd /tine/tine20/Tinebase/js && npm --no-optional install \ No newline at end of file diff --git a/ci/dev/Dockerfile b/ci/dev/Dockerfile new file mode 100644 index 00000000000..52354667b8b --- /dev/null +++ b/ci/dev/Dockerfile @@ -0,0 +1,21 @@ +ARG SOURCE_IMAGE_TAG +ARG SOURCE_IMAGE=base + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +# install.tmpl php build dependencies +RUN apk add --no-cache --virtual .build-deps autoconf gcc musl-dev make g++ +RUN docker-php-source extract + +# xdebug +RUN pecl install xdebug +RUN docker-php-ext-enable xdebug +RUN echo -e "zend_extension=xdebug.so\nxdebug.default_enable=on\nxdebug.remote_enable=on\nxdebug.remote_handler=dbgp\nxdebug.remote_port=9001\nxdebug.remote_host=172.118.0.1\nxdebug.remote_autostart=on\nxdebug.idekey=tine20docker" >> /usr/local/etc/php/conf.d/xdebug.ini + +# webpack +COPY supervisor* /etc/supervisor.d/* + +# cleanup +RUN apk del --purge .build-deps +RUN docker-php-source delete diff --git a/ci/dev/supervisor/webpack.ini b/ci/dev/supervisor/webpack.ini new file mode 100644 index 00000000000..57f6903777f --- /dev/null +++ b/ci/dev/supervisor/webpack.ini @@ -0,0 +1,12 @@ +[program:webpack] +command=/usr/bin/npm start +directory=/tine/tine20/Tinebase/js/ +autostart=true +autorestart=true +priority=10 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/ci/gitlab-ci.yml/abstract_test.yml b/ci/gitlab-ci.yml/abstract_test.yml new file mode 100644 index 00000000000..68022bf433c --- /dev/null +++ b/ci/gitlab-ci.yml/abstract_test.yml @@ -0,0 +1,73 @@ +.mariadb_service: &abstract_test-mariadb_service + name: mariadb:10.4.1 + alias: db +.redis_service: &abstract_test-redis_service + name: redis:5.0.5 + alias: cache +.postfix_service: &abstract_test-postfix_service + name: dockerregistry.metaways.net/tine20/docker/postfix:1.0.0 + alias: postfix + # fix service service discovery https://gitlab.com/gitlab-org/gitlab-runner/issues/1042#note_144420147 + entrypoint: ["/bin/sh", "-c", "while [ ! -f /$CI_PROJECT_DIR/hosts_$CI_JOB_ID ]; do sleep 1; done && cat /$CI_PROJECT_DIR/hosts_$CI_JOB_ID > /etc/hosts && postconf -e 'smtp_host_lookup = native' 'lmtp_host_lookup = native' && /bin/sh /root/docker-entrypoint.sh"] +.dovecot_service: &abstract_test-dovecot_service + name: dockerregistry.metaways.net/tine20/docker/dovecot:1.0.1 + alias: dovecot + entrypoint: ["/bin/sh", "-c", "while [ ! -f /$CI_PROJECT_DIR/hosts_$CI_JOB_ID ]; do sleep 1; done && cat /$CI_PROJECT_DIR/hosts_$CI_JOB_ID > /etc/hosts && /bin/sh /root/docker-entrypoint.sh"] +.ldap_service: &abstract_test-ldap_service + name: dockerregistry.metaways.net/tine20/docker/ldap:1.0.0 + alias: ldap + entrypoint: ["/container/tool/run", "--copy-service"] + +.abstract_test.php_unit_test: + variables: + MYSQL_HOST: db + MYSQL_ROOT_PASSWORD: rootpw + MYSQL_DATABASE: tine20db + MYSQL_USER: tine20 + MYSQL_PASSWORD: tine20pw + TINE20_BUILDTYPE: DEVELOPMENT + TINE20_DATABASE_HOST: db + TINE20_DATABASE_DBNAME: tine20db + TINE20_DATABASE_USERNAME: tine20 + TINE20_DATABASE_PASSWORD: tine20pw + TINE20_SETUPUSER_USERNAME: tine20setup + TINE20_SETUPUSER_PASSWORD: tine20setup + TINE20_LOGIN_USERNAME: tine20admin + TINE20_LOGIN_PASSWORD: tine20admin + TINE20_ADMIN_EMAIL: tine20admin@mail.test + TINE20_EMAIL_IMAP: "active:true,host:dovecot,port:143,useSystemAccount:1,ssl:none,verifyPeer:0,backend:dovecot_imap,domain:mail.test,instanceName:tine.test,dovecot_host:db,dovecot_dbname:dovecot,dovecot_username:tine20,dovecot_password:tine20pw,dovecot_uid:vmail,dovecot_gid:vmail,dovecot_home:/var/vmail/%d/%u,dovecot_scheme:SSHA256" + TINE20_EMAIL_SMTP: "active:true,backend:postfix,hostname:postfix,port:25,ssl:none,auth:none,name:postfix,primarydomain:mail.test,instanceName:tine.test,postfix_host:db,postfix_dbname:postfix,postfix_username:tine20,postfix_password:tine20pw" + TINE20_EMAIL_SIEVE: "hostname:dovecot,port:4190,ssl:none" + services: + - *abstract_test-mariadb_service + - *abstract_test-redis_service + - *abstract_test-postfix_service + - *abstract_test-dovecot_service + before_script: + - cp /etc/hosts "${CI_PROJECT_DIR}/hosts_$CI_JOB_ID" + - /usr/sbin/confd -onetime -backend env + - php /wait_for_db.php + - bash /install_mail.sh + - bash /install_tine.sh + - supervisord + # /usr/sbin/confd -onetime -backend env && php /wait_for_db.php && bash /install_mail.sh && bash /install_tine.sh && supervisord && cd /tine/tests/tine20/ + script: + - cd /tine/tests/tine20/ + - php /tine/tine20/vendor/bin/phpunit --color --debug --exclude-group longrunning,needsbuild,nogitlabci CiTestSuite$CI_NODE_INDEX + parallel: 10 + +.abstract_test.php_unit_test_with_ldap: + extends: .abstract_test.php_unit_test + stage: test_built + variables: + LDAP_ORGANISATION: "Tine20 dev" + LDAP_DOMAIN: "tine.test" + LDAP_ADMIN_PASSWORD: "admin" + TINE20_AUTHENTICATION: "bindRequiresDn:1,backend:ldap,host:ldap\\://ldap,port:389,username:cn=admin\\,dc=tine\\,dc=test,password:admin,baseDn:ou=users\\,dc=tine\\,dc=test,accountFilterFormat:(&(objectClass=posixAccount)(uid=%s)),accountCanonicalForm:2" + TINE20_ACCOUNTS: "backend:ldap,host:ldap\\://ldap,port:389,username:cn=admin\\,dc=tine\\,dc=test,password:admin,userDn:ou=users\\,dc=tine\\,dc=test,groupsDn:ou=groups\\,dc=tine\\,dc=test,defaultUserGroupName:Users,defaultAdminGroupName:Administrators" + services: + - *abstract_test-mariadb_service + - *abstract_test-redis_service + - *abstract_test-postfix_service + - *abstract_test-dovecot_service + - *abstract_test-ldap_service \ No newline at end of file diff --git a/ci/source/Dockerfile b/ci/source/Dockerfile new file mode 100644 index 00000000000..92818f65481 --- /dev/null +++ b/ci/source/Dockerfile @@ -0,0 +1,16 @@ +ARG SOURCE_IMAGE_TAG +ARG PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ARG SOURCE_IMAGE=dependency + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +# copy tine source +COPY ./tine20/.git /tine/.git +COPY ./tine20/tine20/ /tine/tine20/ +COPY ./tine20/tests/ /tine/tests/ +COPY ./tine20/scripts/ /tine/scripts/ + +# install tine dependencies +RUN cd /tine/tine20 && composer install +RUN cd /tine/tine20/Tinebase/js && npm --no-optional install \ No newline at end of file diff --git a/ci/test-built/Dockerfile b/ci/test-built/Dockerfile new file mode 100644 index 00000000000..42dd1cf1946 --- /dev/null +++ b/ci/test-built/Dockerfile @@ -0,0 +1,26 @@ +ARG SOURCE_IMAGE_TAG_BUILD +ARG SOURCE_IMAGE_TAG_BUILT +ARG PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ARG SOURCE_IMAGE_BUILD=build +ARG SOURCE_IMAGE_BUILT=built + +FROM ${SOURCE_IMAGE_BUILD}:${SOURCE_IMAGE_TAG_BUILD} as build + +FROM ${SOURCE_IMAGE_BUILT}:${SOURCE_IMAGE_TAG_BUILT} as test + +COPY --from=build /tine/tests /tine/tests +COPY --from=build /tine/.git /tine/.git + +COPY supervisor/* /etc/supervisor.d/ +COPY config/ /config +COPY install_mail.sh /install_mail.sh + +#install.tmpl tools +RUN apk add --no-cache composer git npm mysql-client + +RUN cd /tine/tine20 && composer install + +RUN cd /tine/tine20/Tinebase/js && npm --no-optional install + + +ENV TINE20_INSTALL=true \ No newline at end of file diff --git a/ci/test-built/install_mail.sh b/ci/test-built/install_mail.sh new file mode 100644 index 00000000000..63872b59f9e --- /dev/null +++ b/ci/test-built/install_mail.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +/usr/local/bin/php /wait_for_db.php + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS dovecot" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS postfix" + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON postfix.* TO '$MYSQL_USER'@'%'" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON dovecot.* TO '$MYSQL_USER'@'%'" + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" "dovecot" < /config/dovecot_tables.sql +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" "postfix" < /config/postfix_tables.sql + +echo "mail stack db init" \ No newline at end of file diff --git a/ci/test-built/supervisor/webpack.ini b/ci/test-built/supervisor/webpack.ini new file mode 100644 index 00000000000..d64f76acf94 --- /dev/null +++ b/ci/test-built/supervisor/webpack.ini @@ -0,0 +1,12 @@ +[program:webpack] +command=/usr/bin/npm start +directory=/tine/tine20/Tinebase/js/ +autostart=true +autorestart=true +priority=10 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/ci/test-source/Dockerfile b/ci/test-source/Dockerfile new file mode 100644 index 00000000000..f48587c3435 --- /dev/null +++ b/ci/test-source/Dockerfile @@ -0,0 +1,19 @@ +ARG SOURCE_IMAGE_TAG +ARG PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ARG SOURCE_IMAGE=source + + +FROM ${SOURCE_IMAGE}:${SOURCE_IMAGE_TAG} + +COPY supervisor/* /etc/supervisor.d/ +COPY config/ /config +COPY install_mail.sh /install_mail.sh + +RUN apk add mysql-client + +#install dependencyies +RUN cd /tine/tine20 && composer install +RUN cd /tine/tine20/Tinebase/js && npm --no-optional install + + +ENV TINE20_INSTALL=true \ No newline at end of file diff --git a/ci/test-source/install_mail.sh b/ci/test-source/install_mail.sh new file mode 100644 index 00000000000..63872b59f9e --- /dev/null +++ b/ci/test-source/install_mail.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +/usr/local/bin/php /wait_for_db.php + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS dovecot" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS postfix" + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON postfix.* TO '$MYSQL_USER'@'%'" +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON dovecot.* TO '$MYSQL_USER'@'%'" + +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" "dovecot" < /config/dovecot_tables.sql +mysql -hdb -uroot -p"$MYSQL_ROOT_PASSWORD" "postfix" < /config/postfix_tables.sql + +echo "mail stack db init" \ No newline at end of file diff --git a/ci/test-source/supervisor/webpack.ini b/ci/test-source/supervisor/webpack.ini new file mode 100644 index 00000000000..d64f76acf94 --- /dev/null +++ b/ci/test-source/supervisor/webpack.ini @@ -0,0 +1,12 @@ +[program:webpack] +command=/usr/bin/npm start +directory=/tine/tine20/Tinebase/js/ +autostart=true +autorestart=true +priority=10 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/docs/config/dovecot_tables.sql b/docs/config/dovecot_tables.sql new file mode 100644 index 00000000000..d8a620a436a --- /dev/null +++ b/docs/config/dovecot_tables.sql @@ -0,0 +1,34 @@ +CREATE TABLE IF NOT EXISTS `dovecot_users` ( + `userid` varchar(80) NOT NULL, + `domain` varchar(80) NOT NULL DEFAULT '', + `username` varchar(80) NOT NULL, + `loginname` varchar(255) DEFAULT NULL, + `password` varchar(100) NOT NULL, + `quota_bytes` bigint(20) NOT NULL DEFAULT 2000, + `quota_message` int(11) NOT NULL DEFAULT 0, + `quota_sieve_bytes` bigint(20) NOT NULL DEFAULT 0, + `quota_sieve_script` int(11) NOT NULL DEFAULT 0, + `uid` varchar(20) DEFAULT NULL, + `gid` varchar(20) DEFAULT NULL, + `home` varchar(256) DEFAULT NULL, + `last_login` datetime DEFAULT NULL, + `last_login_unix` int(11) DEFAULT NULL, + `instancename` varchar(40) DEFAULT NULL, + PRIMARY KEY (`userid`,`domain`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `dovecot_usage` ( + `username` VARCHAR( 80 ) NOT NULL , + `storage` BIGINT NOT NULL DEFAULT 0, + `messages` BIGINT NOT NULL DEFAULT 0, + PRIMARY KEY (`username`), + CONSTRAINT `dovecot_usage::username--dovecot_users::username` FOREIGN KEY (`username`) REFERENCES `dovecot_users` (`username`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=Innodb DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `dovecot_master_users` ( + `username` varchar(80) COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `service` enum('sieve') COLLATE utf8_unicode_ci DEFAULT 'sieve', + PRIMARY KEY (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci diff --git a/docs/config/postfix_tables.sql b/docs/config/postfix_tables.sql new file mode 100644 index 00000000000..abe9d2b4c98 --- /dev/null +++ b/docs/config/postfix_tables.sql @@ -0,0 +1,20 @@ +CREATE TABLE IF NOT EXISTS `smtp_users` ( + `userid` varchar(40) NOT NULL, + `client_idnr` varchar(40) NOT NULL, + `username` varchar(80) NOT NULL, + `passwd` varchar(256) NOT NULL, + `email` varchar(80) DEFAULT NULL, + `forward_only` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`userid`, `client_idnr`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `email` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `smtp_destinations` ( + `userid` VARCHAR( 40 ) NOT NULL , + `source` VARCHAR( 80 ) NOT NULL , + `destination` VARCHAR( 80 ) NOT NULL , + `dispatch_address` tinyint(1) NOT NULL DEFAULT 1, + CONSTRAINT `smtp_destinations::userid--smtp_users::userid` FOREIGN KEY (`userid`) + REFERENCES `smtp_users` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=Innodb DEFAULT CHARSET=utf8; diff --git a/docs/config/postfixmultiinstance_tables.sql b/docs/config/postfixmultiinstance_tables.sql new file mode 100644 index 00000000000..f75a1bbe2e3 --- /dev/null +++ b/docs/config/postfixmultiinstance_tables.sql @@ -0,0 +1,30 @@ +CREATE TABLE IF NOT EXISTS `smtp_users` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `userid` varchar(40) NOT NULL, + `client_idnr` varchar(40) DEFAULT NULL, + `username` varchar(80) NOT NULL, + `passwd` varchar(256) NOT NULL, + `email` varchar(80) DEFAULT NULL, + `forward_only` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `userid-client_idnr` (`userid`,`client_idnr`), + UNIQUE KEY `email` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +CREATE TABLE IF NOT EXISTS `smtp_destinations` ( + `users_id` int(11) NOT NULL, + `source` varchar(80) NOT NULL, + `destination` varchar(80) NOT NULL, + KEY `users_id` (`users_id`), + KEY `source` (`source`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `smtp_destinations` +ADD CONSTRAINT `smtp_destinations_ibfk_1` FOREIGN KEY (`users_id`) REFERENCES `smtp_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +CREATE TABLE `smtp_virtual_domains` ( + `domain` varchar(50) NOT NULL, + `instancename` varchar(40) NOT NULL, + PRIMARY KEY (`domain`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/tests/tine20/ActiveSync/Command/PingTests.php b/tests/tine20/ActiveSync/Command/PingTests.php index ee375a297c6..20714bf1629 100644 --- a/tests/tine20/ActiveSync/Command/PingTests.php +++ b/tests/tine20/ActiveSync/Command/PingTests.php @@ -267,6 +267,8 @@ public function testPingForEvents() /** * test sync of existing imap folder + * + * @group nogitlabci */ public function testPingForEmails() { diff --git a/tests/tine20/Addressbook/LdapSyncTest.php b/tests/tine20/Addressbook/LdapSyncTest.php index d761de4caa0..d82f4520790 100644 --- a/tests/tine20/Addressbook/LdapSyncTest.php +++ b/tests/tine20/Addressbook/LdapSyncTest.php @@ -87,6 +87,8 @@ protected function _checkUIDinBaseDN($uid, $presence = true) /** * test sync to sync backend works, we need to match filter {n_fn contains "test"} + * + * @group nogitlabci_ldap */ public function testSyncBackend() { diff --git a/tests/tine20/Admin/JsonTest.php b/tests/tine20/Admin/JsonTest.php index d729d594b78..d79cc8a3c01 100644 --- a/tests/tine20/Admin/JsonTest.php +++ b/tests/tine20/Admin/JsonTest.php @@ -123,11 +123,14 @@ public function testAddGroup() * try to save an account * * @return array + * + * @group nogitlabci_ldap */ public function testSaveAccount() { $this->testAddGroup(); + $accountData = $this->_getUserArrayWithPw(); $accountData['accountPrimaryGroup'] = Tinebase_Group::getInstance()->getGroupByName('tine20phpunitgroup')->getId(); $accountData['accountFirstName'] = 'PHPUnitup'; @@ -206,9 +209,11 @@ public function testPwdMustChange() $account =$this->_json->getUser($account['accountId']); self::assertEquals(0, $account['password_must_change']); } - + /** * try to get all accounts + * + * @group nogitlabci_ldap */ public function testGetAccounts() { @@ -223,6 +228,8 @@ public function testGetAccounts() * testGetUserCount * * @see 0006544: fix paging in admin/users grid + * + * @group nogitlabci_ldap */ public function testGetUserCount() { @@ -256,8 +263,10 @@ public function testGetNonExistentAccountByLoginName() /** * try to create an account with existing login name - * + * * @see 0006770: check if username already exists when creating new user / changing username + * + * @group nogitlabci_ldap */ public function testSaveAccountWithExistingName() { @@ -306,6 +315,8 @@ public function testSaveHiddenAccount() * testUpdateUserWithoutContainerACL * * @see 0006254: edit/create user is not possible + * + * @group nogitlabci_ldap */ public function testUpdateUserWithoutContainerACL() { @@ -334,11 +345,13 @@ protected function _removeGrantsOfInternalContainer($account) return $internalContainer; } - + /** * testUpdateUserRemoveGroup * * @see 0006762: user still in admin role when admin group is removed + * + * @group nogitlabci_ldap */ public function testUpdateUserRemoveGroup() { @@ -401,6 +414,8 @@ public function testDeleteAccounts() /** * try to set account state + * + * @group nogitlabci_ldap */ public function testSetAccountState() { @@ -417,6 +432,8 @@ public function testSetAccountState() * test send deactivation notification * * @see 0009956: send mail on account deactivation + * + * @group nogitlabci_ldap */ public function testAccountDeactivationNotification() { @@ -449,6 +466,8 @@ public function testAccountDeactivationNotification() /** * try to reset password + * + * @group nogitlabci_ldap */ public function testResetPassword() { @@ -465,6 +484,8 @@ public function testResetPassword() * try to reset pin * * @see 0013320: allow admin to reset pin for accounts + * + * @group nogitlabci_ldap */ public function testResetPin() { @@ -522,7 +543,7 @@ public function testUpdateGroup() $userArray = $this->_createUser(); $groupMembers = array($userArray['accountId']); $data['members'] = $groupMembers; - + $result = $this->_json->saveGroup($data); $this->assertGreaterThan(0,sizeof($result['members'])); @@ -642,6 +663,8 @@ protected function _getAccessLogFilter($_loginname = NULL, $_clienttype = NULL) /** * try to get all access log entries + * + * @group nogitlabci_ldap */ public function testGetAccessLogsWithDeletedUser() { @@ -721,6 +744,8 @@ public function testSetApplicationState() /** * try to add role and set members/rights + * + * @group nogitlabci_ldap */ public function testAddRole() { @@ -759,6 +784,7 @@ public function testAddRole() /** * try to get role rights * + * @group nogitlabci_ldap */ public function testGetRoleRights() { @@ -773,6 +799,8 @@ public function testGetRoleRights() /** * try to save role + * + * @group nogitlabci_ldap */ public function testUpdateRole() { @@ -798,6 +826,8 @@ public function testGetRoles() /** * try to delete roles + * + * @group nogitlabci_ldap */ public function testDeleteRoles() { @@ -1322,6 +1352,8 @@ protected function _getPrimaryDomain() /** * testChangeContactEmailCheckPrimaryDomain + * + * @group nogitlabci_ldap */ public function testChangeContactEmailCheckPrimaryDomain() { @@ -1484,6 +1516,8 @@ public function testUpdateConfig() /** * @see 0011504: deactivated user is removed from group when group is saved + * + * @group nogitlabci_ldap */ public function testDeactivatedUserGroupSave() { @@ -1510,6 +1544,8 @@ protected function _saveGroup($userArray, $additionalData = []) /** * @see 0011504: deactivated user is removed from group when group is saved + * + * @group nogitlabci_ldap */ public function testBlockedUserGroupSave() { @@ -1537,6 +1573,8 @@ public function testAccountOnlyGroup() /** * test set expired status + * + * @group nogitlabci_ldap */ public function testSetUserExpiredStatus() { diff --git a/tests/tine20/Calendar/Controller/EventNotificationsTests.php b/tests/tine20/Calendar/Controller/EventNotificationsTests.php index dc64a732c18..9e9a5392a0b 100644 --- a/tests/tine20/Calendar/Controller/EventNotificationsTests.php +++ b/tests/tine20/Calendar/Controller/EventNotificationsTests.php @@ -139,6 +139,8 @@ public function testMuteToogleUpdateAttendeeStatus() * * @see 0008592: append event file attachments to invitation mail * @see 0009246: Mail address of organizer is broken in invite mails + * + * @group nogitlabci */ public function testInvitationWithAttachment() { diff --git a/tests/tine20/Calendar/Export/ICalTest.php b/tests/tine20/Calendar/Export/ICalTest.php index 30e53c82509..c638bb11f39 100644 --- a/tests/tine20/Calendar/Export/ICalTest.php +++ b/tests/tine20/Calendar/Export/ICalTest.php @@ -185,7 +185,7 @@ public function testExportAlarm() /** * test ical cli export - * + * @group nogitlabci */ public function testCliExport() { diff --git a/tests/tine20/Calendar/Import/ICalTest.php b/tests/tine20/Calendar/Import/ICalTest.php index 1c277fb33fb..15d8bf171d4 100644 --- a/tests/tine20/Calendar/Import/ICalTest.php +++ b/tests/tine20/Calendar/Import/ICalTest.php @@ -190,6 +190,8 @@ public function testTineCliImport() * test ical cli import * * @see 0007104: Calender Import Crashes + * + * @group nogitlabci */ public function testCliImport() { @@ -212,6 +214,8 @@ public function testCliImport() * testImportTwice (forceUpdateExisting) * * @see 0008652: Import von .ics-Dateien in Kalender schlägt fehl + * + * @group nogitlabci */ public function testImportTwice() { diff --git a/tests/tine20/CiTestSuite1.php b/tests/tine20/CiTestSuite1.php new file mode 100644 index 00000000000..d04b5998ebc --- /dev/null +++ b/tests/tine20/CiTestSuite1.php @@ -0,0 +1,14 @@ +addTestSuite(ActiveSync_AllTests::class); + $suite->addTestSuite(Filemanager_AllTests::class); + $suite->addTestSuite(Voipmanager_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite10.php b/tests/tine20/CiTestSuite10.php new file mode 100644 index 00000000000..47c95c47a23 --- /dev/null +++ b/tests/tine20/CiTestSuite10.php @@ -0,0 +1,14 @@ +addTestSuite(Felamimail_AllTests::class); + $suite->addTestSuite(Timetracker_AllTests::class); + + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite2.php b/tests/tine20/CiTestSuite2.php new file mode 100644 index 00000000000..2963379582b --- /dev/null +++ b/tests/tine20/CiTestSuite2.php @@ -0,0 +1,13 @@ +addTestSuite(Addressbook_AllTests::class); + $suite->addTestSuite(HumanResources_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite3.php b/tests/tine20/CiTestSuite3.php new file mode 100644 index 00000000000..0550a9653fc --- /dev/null +++ b/tests/tine20/CiTestSuite3.php @@ -0,0 +1,14 @@ +addTestSuite(Admin_AllTests::class); + $suite->addTestSuite(Inventory_AllTests::class); + $suite->addTestSuite(Zend_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite4.php b/tests/tine20/CiTestSuite4.php new file mode 100644 index 00000000000..367b13cb7bd --- /dev/null +++ b/tests/tine20/CiTestSuite4.php @@ -0,0 +1,13 @@ +addTestSuite(Calendar_AllTests::class); + $suite->addTestSuite(OpenDocument_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite5.php b/tests/tine20/CiTestSuite5.php new file mode 100644 index 00000000000..455605dab22 --- /dev/null +++ b/tests/tine20/CiTestSuite5.php @@ -0,0 +1,14 @@ +addTestSuite(CoreData_AllTests::class); + $suite->addTestSuite(Phone_AllTests::class); + $suite->addTestSuite(Courses_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite6.php b/tests/tine20/CiTestSuite6.php new file mode 100644 index 00000000000..2f5d2a64492 --- /dev/null +++ b/tests/tine20/CiTestSuite6.php @@ -0,0 +1,12 @@ +addTestSuite(Tinebase_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite7.php b/tests/tine20/CiTestSuite7.php new file mode 100644 index 00000000000..8f3005805c0 --- /dev/null +++ b/tests/tine20/CiTestSuite7.php @@ -0,0 +1,13 @@ +addTestSuite(Crm_AllTests::class); + $suite->addTestSuite(Sales_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite8.php b/tests/tine20/CiTestSuite8.php new file mode 100644 index 00000000000..45f9fc287dc --- /dev/null +++ b/tests/tine20/CiTestSuite8.php @@ -0,0 +1,13 @@ +addTestSuite(Events_AllTests::class); + $suite->addTestSuite(Scheduler_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/CiTestSuite9.php b/tests/tine20/CiTestSuite9.php new file mode 100644 index 00000000000..1e02bcc4cff --- /dev/null +++ b/tests/tine20/CiTestSuite9.php @@ -0,0 +1,14 @@ +addTestSuite(Tasks_AllTests::class); + $suite->addTestSuite(SimpleFAQ_AllTests::class); + $suite->addTestSuite(Projects_AllTests::class); + + return $suite; + } +} \ No newline at end of file diff --git a/tests/tine20/Courses/JsonTest.php b/tests/tine20/Courses/JsonTest.php index 3706938406b..4e933009c8b 100644 --- a/tests/tine20/Courses/JsonTest.php +++ b/tests/tine20/Courses/JsonTest.php @@ -289,6 +289,7 @@ public function testImportMembersIntoCourse3() * test for import of members (4) / json import * * @see 0006672: allow to import (csv) files with only CR linebreaks + * @group nogitlabci */ public function testImportMembersIntoCourse4() { diff --git a/tests/tine20/Crm/Import/CsvTest.php b/tests/tine20/Crm/Import/CsvTest.php index 19edaf434f2..1f461d6a3f0 100644 --- a/tests/tine20/Crm/Import/CsvTest.php +++ b/tests/tine20/Crm/Import/CsvTest.php @@ -136,6 +136,8 @@ protected function _searchTestTasks($containerId, $summary = null) /** * @see 0011376: send mail on lead import to responsibles + * + * @group nogitlabci */ public function testEmailNotification() { diff --git a/tests/tine20/Felamimail/Controller/MessageTest.php b/tests/tine20/Felamimail/Controller/MessageTest.php index b61ecba1c52..f0bdaf4dcf9 100644 --- a/tests/tine20/Felamimail/Controller/MessageTest.php +++ b/tests/tine20/Felamimail/Controller/MessageTest.php @@ -1407,6 +1407,8 @@ public function testNoAttachement() * @see 0007726: show inline images of multipart/related message parts * * @todo allow external resources + * + * @group nogitlabci */ public function testHtmlPurify() { @@ -1727,6 +1729,8 @@ public function testTnefRichtext() * https://forge.tine20.org/mantisbt/view.php?id=10126 * * http://htmlpurifier.org/live/configdoc/plain.html#HTML.TidyLevel + * + * @group nogitlabci */ public function testInvalidHtml() { diff --git a/tests/tine20/Felamimail/Frontend/JsonTest.php b/tests/tine20/Felamimail/Frontend/JsonTest.php index 1140f9ef035..37ef0150886 100644 --- a/tests/tine20/Felamimail/Frontend/JsonTest.php +++ b/tests/tine20/Felamimail/Frontend/JsonTest.php @@ -1380,6 +1380,8 @@ public function testMessagePGPInline() * set and get vacation sieve script * * @see 0007768: Sieve - Vacation notify frequency not being set (Cyrus) + * + * @group nogitlabci */ public function testGetSetVacation() { @@ -1426,6 +1428,8 @@ public static function getVacationData($_account) /** * test mime vacation sieve script + * + * @group nogitlabci */ public function testMimeVacation() { @@ -1442,6 +1446,7 @@ public function testMimeVacation() /** * test get/set of rules sieve script + * @group nogitlabci */ public function testGetSetRules() { @@ -1465,6 +1470,8 @@ public function testGetSetRules() * testRemoveRules * * @see 0006490: can not delete single filter rule + * + * @group nogitlabci */ public function testRemoveRules() { @@ -1524,6 +1531,8 @@ protected function _getRuleData() /** * test to set a forward rule to this accounts email address * -> should throw exception to prevent mail cycling + * + * @group nogitlabci */ public function testSetForwardRuleToSelf() { @@ -1555,6 +1564,8 @@ public function testSetForwardRuleToSelf() /** * @see 0006222: Keep a copy from mails forwarded to another emailaddress + * + * @group nogitlabci */ public function testSetForwardRuleWithCopy() { @@ -1580,6 +1591,8 @@ public function testSetForwardRuleWithCopy() /** * @see 0006222: Keep a copy from mails forwarded to another emailaddress + * + * @group nogitlabci */ public function testSetForwardRuleWithoutCopy() { @@ -1698,6 +1711,8 @@ public function testGetVacationWithSignature() * testSetVacationWithStartAndEndDate * * @see 0006266: automatic deactivation of vacation message + * + * @group nogitlabci */ public function testSetVacationWithStartAndEndDate() { @@ -1714,6 +1729,8 @@ public function testSetVacationWithStartAndEndDate() * testSieveRulesOrder * * @see 0007240: order of sieve rules changes when vacation message is saved + * + * @group nogitlabci */ public function testSieveRulesOrder() { @@ -1737,6 +1754,9 @@ public function testSieveRulesOrder() $this->assertContains($sieveScriptRules, $sieveScriptVacation, 'rule order changed'); } + /** + * @group nogitlabci + */ public function testSieveEmailNotification() { $this->_setTestScriptname(); @@ -1900,6 +1920,8 @@ public function testAttachmentMethodPublicDownloadLinkFromFilemanager() * type = download_protected: uploaded from harddisk, supposed to be a protected download link * * @see 0012950: More attachment methods for mail + * + * @group nogitlabci */ public function testAttachmentMethodProtectedDownloadLink() { diff --git a/tests/tine20/Filemanager/Frontend/WebDAVTest.php b/tests/tine20/Filemanager/Frontend/WebDAVTest.php index 33c018aa126..00c9a91660a 100644 --- a/tests/tine20/Filemanager/Frontend/WebDAVTest.php +++ b/tests/tine20/Filemanager/Frontend/WebDAVTest.php @@ -245,6 +245,8 @@ public function testGetNodeForPath_webdav_filemanager_shared() /** * test (UN)LOCK functionality of WebDAV * @group ServerTests + * + * @group nogitlabci_ldap */ public function testUNandLOCKQueries() { diff --git a/tests/tine20/HumanResources/Import/DemoDataTest.php b/tests/tine20/HumanResources/Import/DemoDataTest.php index 8333eba2334..a4b0ada4c85 100644 --- a/tests/tine20/HumanResources/Import/DemoDataTest.php +++ b/tests/tine20/HumanResources/Import/DemoDataTest.php @@ -20,6 +20,7 @@ class HumanResources_Import_DemoDataTest extends TestCase /** * @group longrunning + * @group nogitlabci * @throws Tinebase_Exception_InvalidArgument */ public function testImportDemoData() diff --git a/tests/tine20/Inventory/ControllerTest.php b/tests/tine20/Inventory/ControllerTest.php index be1bbbb5e7e..8234cfb834d 100644 --- a/tests/tine20/Inventory/ControllerTest.php +++ b/tests/tine20/Inventory/ControllerTest.php @@ -14,9 +14,13 @@ */ class Inventory_ControllerTest extends Inventory_TestCase { + /** + * @group nogitlabci + */ public function testGetModels() { $models = Inventory_Controller::getInstance()->getModels(); + $this->assertEquals(array( 'Inventory_Model_InventoryItem', 'Inventory_Model_Status' diff --git a/tests/tine20/Scheduler/SchedulerTest.php b/tests/tine20/Scheduler/SchedulerTest.php index 0a49f057150..a055f98c3f0 100644 --- a/tests/tine20/Scheduler/SchedulerTest.php +++ b/tests/tine20/Scheduler/SchedulerTest.php @@ -84,6 +84,7 @@ public function testCanRemoveTask() /** * Tests if a task can be successfully dispatched. + * @group nogitlabci */ public function testCanDispatchTask() { diff --git a/tests/tine20/Tasks/JsonTest.php b/tests/tine20/Tasks/JsonTest.php index 4f99cd20b6b..48c800cf94f 100644 --- a/tests/tine20/Tasks/JsonTest.php +++ b/tests/tine20/Tasks/JsonTest.php @@ -145,6 +145,8 @@ public function testCreateTaskWithAlarm() /** * test alarm sending failure (with wrong stmp user/password) + * + * @group nogitlabci */ public function testAlarmSendingFailure() { diff --git a/tests/tine20/Tinebase/DaemonTest.php b/tests/tine20/Tinebase/DaemonTest.php index 8e163b6f6e3..7da3d467eb9 100644 --- a/tests/tine20/Tinebase/DaemonTest.php +++ b/tests/tine20/Tinebase/DaemonTest.php @@ -15,6 +15,7 @@ /** * Test class for Tinebase_CustomField + * @group nogitlabci */ class Tinebase_DaemonTest extends PHPUnit_Framework_TestCase { diff --git a/tests/tine20/Tinebase/Frontend/HttpTest.php b/tests/tine20/Tinebase/Frontend/HttpTest.php index 798748a0c2f..4fe6401c389 100644 --- a/tests/tine20/Tinebase/Frontend/HttpTest.php +++ b/tests/tine20/Tinebase/Frontend/HttpTest.php @@ -40,6 +40,7 @@ public function testMainScreen() /** * @group needsbuild + * @group nogitlabci */ public function testgetPostalXWindow() { diff --git a/tests/tine20/Tinebase/TranslationTest.php b/tests/tine20/Tinebase/TranslationTest.php index 2b4e4a2eeb2..b4a31c28d83 100644 --- a/tests/tine20/Tinebase/TranslationTest.php +++ b/tests/tine20/Tinebase/TranslationTest.php @@ -193,6 +193,7 @@ public function testTranslationFiles() * check if lang helper is outputting usage information * * TODO add more langHelper functionality tests + * @group nogitlabci */ public function testLangHelperUsageInfo() { diff --git a/tests/tine20/Tinebase/User/EmailUser/Imap/DovecotTest.php b/tests/tine20/Tinebase/User/EmailUser/Imap/DovecotTest.php index 2add67475b3..c135eb76ea0 100644 --- a/tests/tine20/Tinebase/User/EmailUser/Imap/DovecotTest.php +++ b/tests/tine20/Tinebase/User/EmailUser/Imap/DovecotTest.php @@ -156,6 +156,8 @@ protected function _assertImapUser($additionalExpectations = array()) * testSavingDuplicateAccount * * @see 0006546: saving user with duplicate imap/smtp user entry fails + * + * @group nogitlabci */ public function testSavingDuplicateAccount() {