Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6ea599c
add s3 support in app build
doxthree Dec 4, 2025
15cfdfd
exclude from ci
doxthree Dec 4, 2025
0ad7cb1
disable for ci
doxthree Dec 4, 2025
1e114c4
Use blocking filesystem driver during VaaS file upload (#273)
GermanCoding Dec 5, 2025
627d50f
Update author information to reflect G DATA CyberDefense AG
lennartdohmann Apr 17, 2026
21a3be6
Upgrading nextcloud dependency to version 33
May 4, 2026
67fe3c3
Fixing REUSE Compliance Check
May 4, 2026
8efa611
Refactor devcontainer setup and enhance Docker initialization script
doxthree May 5, 2026
79d4fde
Fix devcontainer
GermanCoding May 5, 2026
e888e01
Fix broken tests due to curl upgrade
GermanCoding May 5, 2026
8eb2151
Fix missing licenses and exclude Dockerfile from editorconfig checks
GermanCoding May 5, 2026
bdbe810
test: debug CI test connection failures
GermanCoding May 5, 2026
411030f
Add health check for Nextcloud status in test workflow
doxthree May 5, 2026
a01cdad
Add health check for Nextcloud status in test workflow
doxthree May 5, 2026
51eec04
Fix phpunit not passing environment variables
GermanCoding May 5, 2026
5df188b
Respect global NEXTCLOUD_VERSION argument for nextcloud version
GermanCoding May 5, 2026
fed3c35
Use consistent env name for nextcloud hostname
GermanCoding May 5, 2026
bd5e2dd
Merge branch 'DECO-2040-upgrade-nextcloud-33' of github.com:GDATASoft…
doxthree May 6, 2026
e6085a7
fix broken s3 ci condition
doxthree May 6, 2026
5b84e78
Improve CI environment variable handling in run-app.sh
doxthree May 6, 2026
e83fd2c
add retry
doxthree May 6, 2026
db9c931
add another retry
doxthree May 6, 2026
686c7e1
Add safe.directory configuration and improve .env sourcing in CI scripts
doxthree May 6, 2026
c89dd78
Replace Nextcloud status check URL in integration tests
doxthree May 6, 2026
a005388
Update Nextcloud hostname in integration tests to use container name
doxthree May 6, 2026
f8658ce
update dependencies
doxthree May 6, 2026
1190a0f
Merge pull request #281 from GDATASoftwareAG/DECO-2040-upgrade-nextcl…
doxthree May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SPDX-FileCopyrightText: 2026 G DATA CyberDefense AG <vaas@gdata.de>
# SPDX-License-Identifier: AGPL-3.0-or-later

FROM mcr.microsoft.com/devcontainers/base:trixie

ENV DEBIAN_FRONTEND=noninteractive

RUN \
mkdir -p ~/.local/bin \
&& echo "export PATH=\$PATH:~/.local/bin" >> ~/.bashrc

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=1000

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
bats \
ca-certificates \
curl \
git \
gnupg \
iputils-ping \
jq \
lsb-release \
make \
procps \
sudo \
telnet \
unzip \
vim \
zip \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /etc/apt/keyrings/githubcli.gpg \
&& chmod go+r /etc/apt/keyrings/githubcli.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod go+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" > /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
composer \
docker-ce \
docker-ce-cli \
docker-buildx-plugin \
docker-compose-plugin \
gh \
nodejs \
php \
php-cli \
php-curl \
php-gd \
php-intl \
php-mbstring \
php-xml \
php-zip \
shellcheck \
&& if ! getent group "$USERNAME" >/dev/null; then groupadd --gid "$USER_GID" "$USERNAME"; fi \
&& if ! id -u "$USERNAME" >/dev/null 2>&1; then useradd --uid "$USER_UID" --gid "$USER_GID" -m -s /bin/bash "$USERNAME"; fi \
&& usermod -aG docker "$USERNAME" \
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/$USERNAME" \
&& chmod 0440 "/etc/sudoers.d/$USERNAME" \
&& rm -rf /var/lib/apt/lists/*

# Save command line history
RUN echo "export HISTFILE=/home/vscode/commandhistory/.bash_history" >> "/home/vscode/.bashrc" \
&& echo "export PROMPT_COMMAND='history -a'" >> "/home/vscode/.bashrc" \
&& mkdir -p /home/vscode/commandhistory \
&& touch /home/vscode/commandhistory/.bash_history \
&& chown -R vscode /home/vscode/commandhistory

CMD ["sleep", "infinity"]
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.16.1",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd",
"integrity": "sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd"
}
}
}
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer-lock.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2026 G DATA CyberDefense AG <vaas@gdata.de>

SPDX-License-Identifier: AGPL-3.0-or-later
33 changes: 24 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
{
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye",
"name": "gdatavaas Local Dev",
"build": {
"dockerfile": "Dockerfile",
"context": ".",
"args": {
"USERNAME": "vscode",
"USER_UID": "1000",
"USER_GID": "1000"
}
},
"overrideCommand": false,
"init": true,
"runArgs": [
// "--userns=keep-id"
],
"remoteUser": "vscode",
"containerUser": "vscode",
"updateRemoteUserUID": true,
"containerEnv": {
"COMPOSER_MEMORY_LIMIT": "-1"
},
"forwardPorts": [
8080,
8081
Expand All @@ -19,14 +38,10 @@
]
}
},
"postStartCommand": ".devcontainer/postCreateCommands.sh",
"postStartCommand": "bash .devcontainer/postCreateCommands.sh",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/szkiba/devcontainer-features/bats:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
"packages": "bash-completion vim iputils-ping telnet"
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": "false"
}
}
}
30 changes: 17 additions & 13 deletions .devcontainer/postCreateCommands.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
#!/bin/bash

set -euo pipefail

# SPDX-FileCopyrightText: 2025 Lennart Dohmann <lennart.dohmann@gdata.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

for d in "/usr/local/etc/php/conf.d" "${PHP_INI_DIR}/conf.d"; do
if [ -n "$d" ] && [ -d "$d" ]; then
echo "Setting PHP CLI memory_limit=-1 in $d/99-memory-limit.ini"
echo "memory_limit = -1" | sudo tee "$d/99-memory-limit.ini" >/dev/null || true
fi
done
# for d in "/usr/local/etc/php/conf.d" "${PHP_INI_DIR}/conf.d"; do
# if [ -n "$d" ] && [ -d "$d" ]; then
# echo "Setting PHP CLI memory_limit=-1 in $d/99-memory-limit.ini"
# echo "memory_limit = -1" | sudo tee "$d/99-memory-limit.ini" >/dev/null || true
# fi
# done

export COMPOSER_MEMORY_LIMIT=-1

bash -i -c 'nvm install 20'
bash -i -c 'nvm use 20'

echo "setup php-scoper"
composer global require humbug/php-scoper
echo "export PATH=$(composer config home)/vendor/bin/:\$PATH" >> "$HOME"/.bashrc
composer global require --no-interaction humbug/php-scoper
PATH_EXPORT="export PATH=$(composer config home)/vendor/bin/:\$PATH"
if ! grep -qxF "$PATH_EXPORT" "$HOME"/.bashrc; then
echo "$PATH_EXPORT" >> "$HOME"/.bashrc
fi
COMPOSER_HOME=$(composer config home)
export PATH=$COMPOSER_HOME/vendor/bin/:$PATH

if [[ "$IS_CI" == 1 ]]; then
if [[ "${IS_CI:-0}" == 1 ]]; then
echo "Skipping bash completion setup in CI environment"
exit 0
fi
Expand All @@ -31,6 +33,8 @@ sudo bash -c "docker completion bash > /usr/share/bash-completion/completions/do
sudo bash -c "composer completion bash > /usr/share/bash-completion/completions/composer"
sudo bash -c "npm completion > /usr/share/bash-completion/completions/npm"

echo ". /usr/share/bash-completion/bash_completion" >> /home/vscode/.bashrc
if ! grep -qxF ". /usr/share/bash-completion/bash_completion" "$HOME"/.bashrc; then
echo ". /usr/share/bash-completion/bash_completion" >> "$HOME"/.bashrc
fi

./scripts/run-app.sh
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker -exclude "\.sh|\.ya?ml|\.md|\.gitignore|\.json|admin\.php|Dockerfile\.Nextcloud|\.txt|Makefile|\.xml|\.bats|\.env-test|\.ini"
- run: editorconfig-checker -exclude "\.sh|\.ya?ml|\.md|\.gitignore|\.json|admin\.php|Dockerfile\.Nextcloud|Dockerfile|\.txt|Makefile|\.xml|\.bats|\.env-test|\.ini"
15 changes: 11 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Mark workspace as safe for git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: postCreateCommands
run: |
source .devcontainer/postCreateCommands.sh
Expand All @@ -60,9 +64,6 @@ jobs:
sed -i "s/<version>0.0.0<\/version>/<version>$RELEASE_VERSION<\/version>/g" ./appinfo/info.xml

- name: unittests
env:
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: |
composer install
./vendor/bin/phpunit --bootstrap tests/unittests/bootstrap.php tests/unittests/ --testdox
Expand All @@ -76,7 +77,9 @@ jobs:
env:
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: ./scripts/run-app.sh 31.0.8 1
run: |
source nextcloud.env
./scripts/run-app.sh "$NEXTCLOUD_VERSION" 1

- name: add builder into nextcloud network
run: |
Expand All @@ -88,8 +91,12 @@ jobs:
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
NEXTCLOUD_HOSTNAME: nextcloud-container
run: |
curl --retry 5 --retry-delay 2 --retry-all-errors --fail --show-error --silent --connect-timeout 5 --max-time 10 "http://nextcloud-container/status.php" > /dev/null
bats --verbose-run --timing --trace ./tests/bats
# Need to dump env into .env because phpunit does not pass them on to tests
printenv | sed "s/'/'\"'\"'/g; s/=/='/; s/$/'/" > .env
./vendor/bin/phpunit --bootstrap tests/integration/bootstrap.php tests/integration/
rm -f .env

- uses: actions/upload-artifact@master
with:
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ appstore_package_name=$(appstore_build_directory)/$(app_real_name)
npm=$(shell which npm 2> /dev/null)
composer=$(shell which composer 2> /dev/null)

include nextcloud.env

all: build

# Fetches dependencies and builds it
Expand All @@ -30,7 +32,7 @@ endif
.PHONY: oc
oc:
ifeq (,$(wildcard nextcloud-server))
./scripts/get-nc-server.sh
./scripts/get-nc-server.sh "$(NEXTCLOUD_VERSION)"
endif

# Installs and updates the composer dependencies. If composer is not installed
Expand Down Expand Up @@ -80,20 +82,20 @@ unittests:
# Run integration tests
.PHONY: integrationtests
integrationtests:
./scripts/run-app.sh "32.0.0" 1
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1
composer install
./vendor/bin/phpunit -c tests/integration/phpunit.xml tests/integration/ --testdox

# Run bats tests
.PHONY: bats
bats:
./scripts/run-app.sh "32.0.0" 1
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1
bats --verbose-run --timing --trace ./tests/bats

# Complete production like but static Nextcloud and app setup
.PHONY: prod
prod: oc
./scripts/run-app.sh "32.0.0" 1
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1

# Same as clean but also removes dependencies and build related folders
.PHONY: distclean
Expand All @@ -111,7 +113,7 @@ local: build
docker compose kill || true
docker stop nextcloud-container || true
docker container rm nextcloud-container || true
docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v32.0.0" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest
docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v$(NEXTCLOUD_VERSION)" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest
composer install

# Builds the app for production and prepares it for the appstore under ./build/artifacts
Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Please make sure the "Authentication Method" "Resource Owner Password Flow" is s
]]></description>
<version>0.0.0</version>
<licence>agpl</licence>
<author mail="vaas@gdata.de" homepage="https://github.com/GDATASoftwareAG/nextcloud-gdata-antivirus">Lennart Dohmann</author>
<author mail="vaas@gdata.de" homepage="https://github.com/GDATASoftwareAG/nextcloud-gdata-antivirus">G DATA CyberDefense AG</author>
<namespace>GDataVaas</namespace>
<category>security</category>
<bugs>https://github.com/GDATASoftwareAG/nextcloud-gdata-antivirus/issues</bugs>
Expand All @@ -55,7 +55,7 @@ Please make sure the "Authentication Method" "Resource Owner Password Flow" is s
<database>pgsql</database>
<database>mysql</database>
<database>sqlite</database>
<nextcloud min-version="32" max-version="32"/>
<nextcloud min-version="33" max-version="33"/>
</dependencies>
<background-jobs>
<job>OCA\GDataVaas\BackgroundJobs\ScanJob</job>
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
"license": "AGPL-3.0-or-later",
"authors": [
{
"name": "Lennart Dohmann"
"name": "G DATA CyberDefense AG"
}
],
"require": {
"gdata/vaas": "11.0.1",
"gdata/vaas": "11.1.0",
"coduo/php-humanizer": "5.0.0"
},
"require-dev": {
"nextcloud/ocp": "v32.0.2",
"nextcloud/ocp": "v33.0.0",
"psalm/phar": "6.8.2",
"nextcloud/coding-standard": "v1.4.0",
"colinodell/psr-testlogger": "1.3.1",
"phpunit/phpunit": "10.5.58",
"symfony/console": "v6.4.27",
"phpunit/phpunit": "11.5.55",
"symfony/console": "v7.4.9",
"amphp/http-client": "5.3.4",
"amphp/amp": "3.1.1",
"vlucas/phpdotenv": "5.6.2"
"vlucas/phpdotenv": "5.6.3"
},
"autoload": {
"psr-4": {
Expand All @@ -45,7 +45,7 @@
"composer/package-versions-deprecated": true
},
"platform": {
"php": "8.1"
"php": "8.2"
}
}
}
}
17 changes: 16 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

services:
nextcloud-container:
image: nextcloud:32.0.0
image: nextcloud:${NEXTCLOUD_VERSION:?NEXTCLOUD_VERSION must be set}
ports:
- "8080:80"
container_name: nextcloud-container
Expand All @@ -26,5 +26,20 @@ services:
networks:
- nextcloud-network

garaged:
image: dxflrs/garage:v2.1.0
container_name: garaged
hostname: garaged
restart: unless-stopped
volumes:
- ./garage.toml:/etc/garage.toml
ports:
- "3900:3900"
- "3901:3901"
- "3902:3902"
- "3903:3903"
networks:
- nextcloud-network

networks:
nextcloud-network:
Loading
Loading