* Extract Nextcloud major upgrade logic to script and add UI button Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/8cd11b09-5073-4e27-8e59-9afffaf96c1f Rename sendNotification to execCommandInContainer and reuse for upgrade method Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/88744552-9d64-4de2-9f64-5a98a5e3b200 Add $cmd array validation to execCommandInContainer Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/45d5228c-7834-404e-ba54-90b5c8c207c8 Apply suggestion from @szaimen Signed-off-by: Simon L. <szaimen@e.mail.de> Apply suggestion from @szaimen Signed-off-by: Simon L. <szaimen@e.mail.de> Apply suggestion from @szaimen Signed-off-by: Simon L. <szaimen@e.mail.de> Apply suggestion from @szaimen Signed-off-by: Simon L. <szaimen@e.mail.de> Set installLatestMajor when upgrade-to-latest-major button is clicked Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/7b977c85-9b74-4027-a536-152e49a01976 Extract getLatestMajorVersion() to avoid duplicating the version string Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/d5ec921f-8629-4f6e-949a-e8f89f1eb85f Address PR review comments and hardcode updater channel to stable Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/c40941ff-2bf8-4a57-82be-2a0bd22b19a2 Restore sendNotification(), update cron files, extract getPlainStreamingCallback() Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/a5b6cd86-d278-4771-8a11-976c4a862966 Remove getPlainStreamingCallback, unify on getAddToStreamingResponseBody Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/15a4b815-076b-469f-95b2-c61df688a28d Revert "Remove getPlainStreamingCallback, unify on getAddToStreamingResponseBody" This reverts commit 6846c3a99549703121461f910cc26e6c116e0dc4. * Refactor creating and using addToStreamingResponseBody() This way we stick to having one implementation of the function, not three. Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Read streamed output line by line, not via buffer This way the code doesn't wait for a buffer to be filled, and we don't need to implement logic ourselves that is provided by a present library already. Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Ensure all HTTP requests are proxied, even with streaming When requesting a streamed response, Guzzle apparently doesn't use curl, and thus we have to specify the unix socket proxy differently. We can't specify it when creating the client, though (Guzzle complains). Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Fix syntax errors Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Remove broken code Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Fix readline line from streaming response Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Strip ANSI codes from command output before sending it to the browser Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Run PHP commands as www-data Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Properly compare version numbers Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Fix using memory limits from env Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Fix return type spec This method always returns a closure, never null. Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Use more general return type Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Avoid psalm complaint Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Fix namespace of return type Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> * Apply suggestion from @szaimen Signed-off-by: Simon L. <szaimen@e.mail.de> --------- Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> Signed-off-by: Simon L. <szaimen@e.mail.de> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Pablo Zmdl <pablo@nextcloud.com> Co-authored-by: Simon L. <szaimen@e.mail.de>
PHP Docker Controller
This is the code for the PHP Docker controller.
How to run
Running this locally requires :
1. Install the development environment
This project uses Composer as dependency management software. It is very similar to NPM. The command to install all dependencies is:
composer install
2. Access to docker socket
The root user has all privileges including access to the Docker socket.
But it is not recommended to launch the local instance with full privileges, consider the docker group for docker access without being root.
See https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
3. Run a nextcloud-aio-mastercontainer container
This application manages containers, including its own container.
So you need to run a nextcloud-aio-mastercontainer container for the application to work properly.
Here is a command to quickly launch a container :
docker run \
--rm \
--name nextcloud-aio-mastercontainer \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock \
ghcr.io/nextcloud-releases/all-in-one:latest
4. Start your server
With this command you will launch the server:
# Make sure to launch this command with a user having access to the docker socket.
SKIP_DOMAIN_VALIDATION=true composer run dev
You can then access the web interface at http://localhost:8080.
Note: You can restart the server by preceding the command with other environment variables.
Composer routine
| Command | Description |
|---|---|
composer run dev |
Starts the development server |
composer run psalm |
Run Psalm static analysis |
composer run psalm:strict |
Run Psalm static analysis strict |
composer run psalm:update-baseline |
Run Psalm with --update-baseline arg |
composer run lint |
Run PHP Syntax check |
composer run lint:twig |
Run Twig Syntax check |
composer run php-deprecation-detector |
Run PHP Deprecation Detector |