Skip to content

Commit ec14e97

Browse files
Worker Builderskjnldsv
authored andcommitted
build(hub): 34.0.0rc4
Signed-off-by: Worker Builder <worker-builder@nextcloud.com>
0 parents  commit ec14e97

12,377 files changed

Lines changed: 1697430 additions & 0 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
FROM ubuntu:noble
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# PHP
6+
RUN apt-get update -y && \
7+
apt install -y apache2 vim software-properties-common sudo nano gnupg2 wget curl git \
8+
lsb-release ca-certificates apt-transport-https && \
9+
add-apt-repository ppa:ondrej/php -y && \
10+
apt-get update -y
11+
12+
RUN apt-get install --no-install-recommends -y \
13+
php8.4 \
14+
php8.4-common \
15+
php8.4-gd \
16+
php8.4-zip \
17+
php8.4-curl \
18+
php8.4-xml \
19+
php8.4-xmlrpc \
20+
php8.4-mbstring \
21+
php8.4-sqlite \
22+
php8.4-xdebug \
23+
php8.4-pgsql \
24+
php8.4-intl \
25+
php8.4-imagick \
26+
php8.4-gmp \
27+
php8.4-apcu \
28+
php8.4-bcmath \
29+
php8.4-redis \
30+
php8.4-soap \
31+
php8.4-imap \
32+
php8.4-opcache \
33+
php8.4-cli \
34+
php8.4-dev \
35+
libmagickcore-6.q16-7-extra \
36+
lsof \
37+
make \
38+
unzip
39+
40+
# Composer
41+
RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php && \
42+
curl -sS https://composer.github.io/installer.sig -o /tmp/composer-setup.sig && \
43+
php -r "if (hash_file('sha384', '/tmp/composer-setup.php') !== trim(file_get_contents('/tmp/composer-setup.sig'))) { echo 'Composer installation failed, invalid hash'; exit(1); }" && \
44+
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
45+
rm /tmp/composer-setup.php /tmp/composer-setup.sig
46+
47+
RUN echo "xdebug.remote_enable = 1" >> /etc/php/8.4/cli/conf.d/20-xdebug.ini && \
48+
echo "xdebug.remote_autostart = 1" >> /etc/php/8.4/cli/conf.d/20-xdebug.ini && \
49+
echo "apc.enable_cli=1" >> /etc/php/8.4/cli/conf.d/20-apcu.ini
50+
51+
# Autostart XDebug for apache
52+
RUN { \
53+
echo "xdebug.mode=debug"; \
54+
echo "xdebug.start_with_request=yes"; \
55+
} >> /etc/php/8.4/apache2/conf.d/20-xdebug.ini
56+
57+
# Increase PHP memory limit to 512mb
58+
RUN sed -i 's/memory_limit = .*/memory_limit = 512M/' /etc/php/8.4/apache2/php.ini
59+
60+
# Docker CLI only (for controlling host Docker via socket)
61+
RUN install -m 0755 -d /etc/apt/keyrings && \
62+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
63+
chmod a+r /etc/apt/keyrings/docker.asc && \
64+
echo \
65+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
66+
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
67+
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
68+
apt-get update -y && \
69+
apt-get install -y docker-ce-cli && \
70+
ln -s /var/run/docker-host.sock /var/run/docker.sock
71+
72+
# Dedicated DevContainer user runs Apache
73+
ENV APACHE_RUN_USER=devcontainer
74+
ENV APACHE_RUN_GROUP=devcontainer
75+
# Delete any existing user/group with UID/GID 1000 first
76+
RUN (getent passwd 1000 && userdel -r $(getent passwd 1000 | cut -d: -f1)) || true && \
77+
(getent group 1000 && groupdel $(getent group 1000 | cut -d: -f1)) || true && \
78+
groupadd -g 1000 ${APACHE_RUN_GROUP} && \
79+
useradd -u 1000 -g 1000 -ms /bin/bash ${APACHE_RUN_USER} && \
80+
adduser ${APACHE_RUN_USER} sudo && \
81+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
82+
sed -ri "s/^export APACHE_RUN_USER=.*$/export APACHE_RUN_USER=${APACHE_RUN_USER}/" "/etc/apache2/envvars" && \
83+
sed -ri "s/^export APACHE_RUN_GROUP=.*$/export APACHE_RUN_GROUP=${APACHE_RUN_GROUP}/" "/etc/apache2/envvars"
84+
85+
USER devcontainer
86+
87+
# NVM
88+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
89+
RUN bash --login -i -c 'source /home/devcontainer/.bashrc && nvm install 22'
90+
91+
WORKDIR /var/www/html

.devcontainer/Dockerfile.license

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
SPDX-License-Identifier: AGPL-3.0-or-later

.devcontainer/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
# Nextcloud DevContainer
6+
7+
## Usage
8+
9+
Make sure you have the [VSCode DevContainer](https://code.visualstudio.com/docs/devcontainers/containers) extensions installed. If you open the project, VSCode will ask you if you want to open it inside of the DevContainer. If that's not the case, use <kbd>F1</kbd>&rarr;*Dev Containers: Open Folder in Container*.
10+
11+
Alternatively open the project directly in [GitHub Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=stable34&repo=60243197&skip_quickstart=true).
12+
13+
That's already it. Everything else will be configured automatically by the Containers startup routine.
14+
15+
## Credentials
16+
17+
On first start the Container installs and configures Nextcloud with the following credentials:
18+
19+
**Nextcloud Admin Login**
20+
21+
Username: `admin` <br>
22+
Password: `admin`
23+
24+
**Postgres credentials**
25+
26+
Username: `postgres` <br>
27+
Password: `postgres` <br>
28+
Database: `postgres`
29+
30+
## Services
31+
32+
The following services will be started:
33+
34+
| Service | Local port | Description |
35+
|---------|------------|-------------|
36+
| Nextcloud (served via Apache) | `80` | The main application |
37+
| Mailhog | `8025` | SMTP email delivery for testing |
38+
| Adminer | `8080` | Database viewer. Use credentials from above and connect to `localhost` to get access to the NC database |
39+
40+
## Permissions
41+
42+
The container runs with the user `devcontainer` who is also running the Apache2 process. All mounted source files have
43+
proper permissions so that this user can access everything which is inside the current workspace. If you need to
44+
get root permissions for whatever reason, use `sudo su` or `sudo <command>` (for example `sudo service apache2 restart`).
45+
Everything else (like building the application, adjusting files, ...) should be done as `devcontainer` user.
46+
47+
## NodeJs and NVM
48+
49+
The container comes with [`nvm`](https://github.com/nvm-sh/nvm) and Node 16 installed. This should be sufficient to
50+
build Nextcloud Core sources via `make`. If you need a different Node Version (for example for
51+
app development), you can easily switch between different versions by running:
52+
53+
```bash
54+
# Install and use Node 14
55+
nvm install 14
56+
nvm use 14
57+
58+
# Check version
59+
node -v
60+
61+
# Switch back to Node 16
62+
nvm use 16
63+
64+
# Check version
65+
node -v
66+
```
67+
68+
Note that `nvm` is only installed for the user `devcontainer` and won't work out of the box for
69+
any other user.
70+
71+
## Debugging
72+
73+
The Apache webserver is already configured to automatically try to connect to a debugger process
74+
listening on port `9003`. To start the VSCode debugger process, use the delivered debug profile `Listen for XDebug`.
75+
After you started the VSCode debugger, just navigate to the appropriate Nextcloud URL to get your
76+
debug hits.

.devcontainer/codespace.config.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
/**
4+
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
6+
*/
7+
$codespaceName = getenv('CODESPACE_NAME');
8+
$codespaceDomain = getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN');
9+
10+
$CONFIG = [
11+
'mail_from_address' => 'no-reply',
12+
'mail_smtpmode' => 'smtp',
13+
'mail_sendmailmode' => 'smtp',
14+
'mail_domain' => 'example.com',
15+
'mail_smtphost' => 'localhost',
16+
'mail_smtpport' => '1025',
17+
'memcache.local' => '\OC\Memcache\APCu',
18+
];
19+
20+
if(is_string($codespaceName) && !empty($codespaceName) && is_string($codespaceDomain) && !empty($codespaceDomain)) {
21+
$host = $codespaceName . '-80.' . $codespaceDomain;
22+
$CONFIG['overwritehost'] = $host;
23+
$CONFIG['overwrite.cli.url'] = 'https://' . $host;
24+
$CONFIG['overwriteprotocol'] = 'https';
25+
$CONFIG['trusted_domains'] = [ $host ];
26+
}

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "NextcloudServer",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "nextclouddev",
5+
"postCreateCommand": ".devcontainer/setup.sh",
6+
"postStartCommand": ".devcontainer/postStart.sh",
7+
"forwardPorts": [
8+
80,
9+
8080,
10+
8025
11+
],
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"felixfbecker.php-debug",
16+
"felixfbecker.php-intellisense",
17+
"ms-azuretools.vscode-docker",
18+
"xdebug.php-debug",
19+
"donjayamanne.githistory"
20+
],
21+
"settings": {
22+
"php.suggest.basic": false
23+
}
24+
}
25+
},
26+
"workspaceFolder": "/var/www/html",
27+
"remoteUser": "devcontainer"
28+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
SPDX-License-Identifier: AGPL-3.0-or-later

.devcontainer/docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
services:
4+
nextclouddev:
5+
build: .
6+
volumes:
7+
- .:/workspace:cached
8+
- /var/run/docker.sock:/var/run/docker-host.sock
9+
- ..:/var/www/html
10+
command: /var/www/html/.devcontainer/entrypoint.sh
11+
ports:
12+
- 80:80
13+
- 8080:8080
14+
- 8025:8025
15+
16+
db:
17+
image: postgres
18+
restart: always
19+
environment:
20+
POSTGRES_PASSWORD: postgres
21+
PGDATA: /data/postgres
22+
volumes:
23+
- db:/data/postgres
24+
network_mode: service:nextclouddev
25+
26+
adminer:
27+
image: adminer
28+
restart: always
29+
network_mode: service:nextclouddev
30+
31+
mailhog:
32+
image: mailhog/mailhog
33+
restart: always
34+
network_mode: service:nextclouddev
35+
36+
volumes:
37+
db:

.devcontainer/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
#
3+
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-License-Identifier: AGPL-3.0-or-later
5+
#
6+
sudo service apache2 start
7+
8+
while sleep 1000; do :; done

.devcontainer/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Listen for Xdebug",
9+
"type": "php",
10+
"request": "launch",
11+
"port": 9003
12+
}
13+
]
14+
}

.devcontainer/launch.json.license

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
2+
SPDX-License-Identifier: AGPL-3.0-or-later

0 commit comments

Comments
 (0)