Skip to content

Commit 8883842

Browse files
committed
Merge branch 'master' into dev/public_html
2 parents cb22c00 + 839694e commit 8883842

File tree

647 files changed

+8385
-4670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

647 files changed

+8385
-4670
lines changed

.ci/compose.yaml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
services:
2+
mailhost:
3+
image: docker.io/greenmail/standalone
4+
browserhost:
5+
image: docker.io/selenium/standalone-chromium
6+
ports:
7+
# Allow to watch the remote controlled browser (comment out the
8+
# `--headless` argument in TestCase::driver() before).
9+
- '127.0.0.1:7900:7900'
10+
volumes:
11+
- '/dev/shm:/dev/shm'
12+
- '../tests/Browser/downloads:/downloads'
13+
14+
browser_tests:
15+
depends_on:
16+
- mailhost
17+
- browserhost
18+
hostname: 'testrunner'
19+
image: ghcr.io/roundcube/roundcubemail-testrunner:php8.3
20+
volumes:
21+
- '..:/app'
22+
- '../tests/Browser/downloads:/downloads'
23+
environment:
24+
WEBDRIVER_CONNECT_URL: 'http://browserhost:4444'
25+
SERVER_URL: 'http://testrunner:8000'
26+
SERVER_BIND: '0.0.0.0:8000'
27+
BROWSER_DOWNLOADS_DIR: '/downloads'
28+
TESTRUNNER_DOWNLOADS_DIR: '../tests/Browser/downloads'
29+
RC_CONFIG_IMAP_HOST: 'tls://mailhost:3143'
30+
RC_CONFIG_SMTP_HOST: 'mailhost:3025'
31+
command:
32+
- .ci/run_browser_tests.sh
33+
34+
tests:
35+
depends_on:
36+
- mailhost
37+
image: ghcr.io/roundcube/roundcubemail-testrunner:php8.3
38+
volumes:
39+
- '..:/app'
40+
command:
41+
- .ci/run_tests.sh
42+
43+
codespell:
44+
image: ghcr.io/roundcube/roundcubemail-testrunner:php8.3
45+
volumes:
46+
- '..:/app'
47+
command:
48+
- vendor/bin/php-cs-fixer
49+
- fix
50+
- --dry-run
51+
- --using-cache=no
52+
- --diff
53+
- --verbose
54+
55+
codestyle:
56+
image: ghcr.io/roundcube/roundcubemail-testrunner:php8.3
57+
volumes:
58+
- '..:/app'
59+
command:
60+
- npx
61+
- eslint
62+
- .

.github/config-test.inc.php .ci/config-test.inc.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
$config['db_dsnw'] = 'sqlite:///' . sys_get_temp_dir() . '/roundcube-test-sqlite.db?mode=0646';
77

88
// Test user credentials
9-
$config['tests_username'] = 'test';
10-
$config['tests_password'] = 'test';
9+
$config['tests_username'] = '[email protected]';
10+
$config['tests_password'] = 'admin';
11+
12+
$config['imap_host'] = getenv('RC_CONFIG_IMAP_HOST') ?: 'localhost:143';
13+
$config['imap_auth_type'] = 'IMAP';
14+
$config['imap_conn_options'] = [
15+
'ssl' => [
16+
'verify_peer' => false,
17+
'verify_peer_name' => false,
18+
],
19+
];
20+
// $config['managesieve_host'] = 'localhost:4190';
1121

1222
// GreenMail
13-
$config['smtp_host'] = 'localhost:25';
23+
$config['smtp_host'] = getenv('RC_CONFIG_SMTP_HOST') ?: 'localhost:25';
1424

1525
// Settings required by the tests
1626

.ci/docker-images/Dockerfile

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ARG PHPVERSION=8.3
2+
FROM php:${PHPVERSION}-cli
3+
LABEL org.opencontainers.image.source="https://github.com/roundcube/roundcubemail"
4+
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
RUN apt-get update \
8+
&& apt-get install -y --no-install-recommends \
9+
libfreetype6-dev \
10+
libicu-dev \
11+
libjpeg62-turbo-dev \
12+
libldap2-dev \
13+
libpng-dev \
14+
libpq-dev \
15+
libsqlite3-dev \
16+
libzip-dev \
17+
libpspell-dev \
18+
libonig-dev \
19+
libldap-common \
20+
libenchant-2-dev \
21+
nodejs \
22+
npm \
23+
aspell \
24+
aspell-en \
25+
aspell-de \
26+
hunspell-en-us \
27+
git \
28+
locales \
29+
&& apt-get clean
30+
31+
# Some tests require en_US.UTF-8 as locale.
32+
RUN sed -i 's/^# en_US.UTF-8 /en_US.UTF-8 /' /etc/locale.gen && locale-gen
33+
34+
# TODO: Do we need the multiarch-args? What for?
35+
#RUN debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \
36+
RUN docker-php-ext-configure gd --with-jpeg --with-freetype \
37+
#&& docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch" \
38+
&& docker-php-ext-configure ldap \
39+
&& docker-php-ext-install \
40+
zip \
41+
pcntl \
42+
gd \
43+
ldap \
44+
intl \
45+
pspell \
46+
enchant
47+
48+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
49+
50+
# Create working directory
51+
WORKDIR /app
52+
53+
VOLUME /app

.ci/docker-images/build.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
case "$1" in
4+
8.1|8.3)
5+
phpversion="$1"
6+
;;
7+
*)
8+
echo "Error: first and only argument must be the wanted PHP version."
9+
echo "Usage: $(basename $0) 8.1|8.3"
10+
exit 1
11+
;;
12+
esac
13+
14+
exec docker build --build-arg "PHPVERSION=$phpversion" -f "$(realpath $(dirname $0)/Dockerfile)" -t "ghcr.io/pabzm/roundcubemail-testrunner:php$phpversion" "$(realpath $(dirname $0)/../../..)"

.ci/run_browser_tests.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash -ex
2+
3+
# The script is intended for use locally, as well as in the CI.
4+
# It runs the browser-tests ("E2E" in the CI).
5+
# It expects a running IMAP server (connection configured in
6+
# `config-test.inc.php`, and a running Chrome/Chromium browser (connection
7+
# hard-coded in code, overrideable via environment variables).
8+
9+
# Make temp and logs writeable to everyone.
10+
chmod 777 temp logs
11+
12+
# Create downloads dir and ensure permissions (if it's set, the variable might
13+
# be blank if tests are not run using containers).
14+
if test -n "$TESTRUNNER_DOWNLOADS_DIR"; then
15+
# Use sudo because in the Github action we apparently can't use a
16+
# directory in $HOME or /tmp but another one for which we need
17+
# superuser-rights.
18+
install -m 777 -d "$TESTRUNNER_DOWNLOADS_DIR"
19+
fi
20+
21+
if ! test -f config/config-test.inc.php; then
22+
cp -v .ci/config-test.inc.php config/config-test.inc.php
23+
fi
24+
25+
# Install dependencies for to remote control the browser.
26+
composer require -n "nesbot/carbon:^2.62.1" --no-update
27+
composer require -n "laravel/dusk:^7.9" --no-update
28+
29+
if $(echo $PHP_VERSION | grep -q '^8.3'); then
30+
# Downgrade dependencies (for PHP 8.3 only)
31+
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress --optimize-autoloader
32+
else
33+
composer update --prefer-dist --no-interaction --no-progress
34+
fi
35+
36+
# Install development tools.
37+
npm install
38+
39+
# Install javascript dependencies
40+
bin/install-jsdeps.sh
41+
42+
# Compile Elastic's styles
43+
npx lessc --clean-css="--s1 --advanced" skins/elastic/styles/styles.less > skins/elastic/styles/styles.min.css
44+
npx lessc --clean-css="--s1 --advanced" skins/elastic/styles/print.less > skins/elastic/styles/print.min.css
45+
npx lessc --clean-css="--s1 --advanced" skins/elastic/styles/embed.less > skins/elastic/styles/embed.min.css
46+
47+
# Use minified javascript files
48+
bin/jsshrink.sh
49+
50+
# Run tests
51+
echo "TESTS_MODE: DESKTOP"
52+
TESTS_MODE=desktop vendor/bin/phpunit -c tests/Browser/phpunit.xml --fail-on-warning --fail-on-risky --exclude-group=failsonga
53+
54+
echo "TESTS_MODE: TABLET"
55+
TESTS_MODE=tablet vendor/bin/phpunit -c tests/Browser/phpunit.xml --fail-on-warning --fail-on-risky --exclude-group=failsonga-tablet
56+
57+
# Mobile mode tests are unreliable on Github Actions
58+
# echo "TESTS_MODE: PHONE"
59+
# TESTS_MODE=phone vendor/bin/phpunit -c tests/Browser/phpunit.xml --fail-on-warning --fail-on-risky --exclude-group=failsonga-phone

.ci/run_tests.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash -ex
2+
3+
if ! test -f config/config-test.inc.php; then
4+
cp -v .ci/config-test.inc.php config/config-test.inc.php
5+
fi
6+
7+
composer require "kolab/net_ldap3:~1.1.4" --no-update
8+
9+
# Install dependencies, prefer highest.
10+
composer update --prefer-dist --no-interaction --no-progress
11+
12+
# Execute tests.
13+
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky
14+
15+
# Downgrade dependencies to the lowest versions.
16+
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress --optimize-autoloader
17+
18+
# Execute tests again.
19+
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ module.exports = {
1616
'/vendor',
1717
'/public_html',
1818
'/plugins/jqueryui/js',
19+
'/plugins/managesieve/codemirror',
20+
'/program/js/tinymce',
21+
'/program/js/publickey.js',
22+
'node_modules',
23+
'*.min.js',
1924
],
2025
rules: {
2126
'brace-style': ['error', '1tbs'],
@@ -177,6 +182,7 @@ module.exports = {
177182
'unicorn/prefer-string-replace-all': 'off', // (43 matches)
178183
'unicorn/prefer-string-slice': 'off', // (39 matches)
179184
'unicorn/prefer-string-starts-ends-with': 'off', // (2 matches)
185+
'unicorn/prefer-string-raw': 'off', // (2 matches)
180186
'unicorn/prefer-ternary': 'off', // (16 matches)
181187
'unicorn/require-array-join-separator': 'off', // (5 matches)
182188
'unicorn/switch-case-braces': 'off', // (161 matches)

.github/ISSUE_TEMPLATE/bug_report.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Report a bug
2+
description: Describe a bug or issue you may have identified in Roundcube.
3+
title: "Provide a general summary of the issue"
4+
labels: []
5+
assignees: []
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
**IMPORTANT!** If you have problems with your email account (e.g. cannot log in, emails got lost, etc.) or if you have questions how to configure your Outlook or mobile phone to get email, this isn't the right place to ask. **Roundcube is not a service but free software which somebody installed for you.**
11+
12+
Please contact your internet hosting provider or IT responsible instead. If you don't know who this might be, please review your bills and find out who you're paying for email and webhosting services.
13+
- type: checkboxes
14+
attributes:
15+
label: Prerequisites
16+
options:
17+
- label: I have [searched](https://github.com/roundcube/roundcubemail/issues?q=is%3Aissue) for duplicate or closed issues
18+
required: true
19+
- label: I can recreate the issue with all plugins disabled
20+
required: false
21+
- type: textarea
22+
id: what-happened
23+
attributes:
24+
label: Describe the issue
25+
description: Provide a summary of the issue and what you expected to happen, including specific steps to reproduce.
26+
validations:
27+
required: true
28+
- type: markdown
29+
attributes:
30+
value: |
31+
## Environment
32+
- type: dropdown
33+
id: browser
34+
attributes:
35+
label: What browser(s) are you seeing the problem on?
36+
multiple: true
37+
options:
38+
- Chrome
39+
- Edge
40+
- Firefox
41+
- Safari
42+
- Other
43+
- type: input
44+
id: php
45+
attributes:
46+
label: What version of PHP are you using?
47+
placeholder: "e.g., v7.2 or v8.1"
48+
- type: input
49+
id: version
50+
attributes:
51+
label: What version of Roundcube are you using?
52+
placeholder: "e.g., v1.5.2 or v1.6.6"
53+
validations:
54+
required: true
55+
- type: markdown
56+
attributes:
57+
value: |
58+
## Logs
59+
- type: textarea
60+
id: js-errors
61+
attributes:
62+
label: JavaScript errors
63+
description: Provide any relevant entries from the browser's JavaScript console.
64+
- type: textarea
65+
id: logs
66+
attributes:
67+
label: PHP errors
68+
description: Provide any relevant entries from the Roundcube error log.

.github/ISSUE_TEMPLATE/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Ask for help
3+
url: https://www.roundcubeforum.net/
4+
about: Ask and discuss questions with other Roundcube community members.
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Suggest a new feature
2+
description: Suggest a new feature to be developed for Roundcube.
3+
title: "Suggest a new feature"
4+
labels: []
5+
assignees: []
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Prerequisites
10+
options:
11+
- label: I have [searched](https://github.com/roundcube/roundcubemail/issues?q=is%3Aissue) for duplicate or closed feature requests
12+
required: true
13+
- label: I have [searched](https://plugins.roundcube.net/) for plugins that provide already provide the feature
14+
required: true
15+
- type: textarea
16+
id: proposal
17+
attributes:
18+
label: Proposal
19+
description: Describe the new feature you would like to see in Roundcube.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: motivation
24+
attributes:
25+
label: Motivation and context
26+
description: Tell us why this change is needed or helpful, and what problems it may help solve.
27+
validations:
28+
required: true

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
- package-ecosystem: "composer"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
versioning-strategy: "widen"
12+
- package-ecosystem: "npm"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
versioning-strategy: "widen"

0 commit comments

Comments
 (0)