Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 201da97178 | |||
| e3594fe5c4 | |||
| 7442538c2f | |||
| 6625132927 | |||
| 9b3ed6ee3c | |||
| 61db98eeee | |||
| 2b73c61480 | |||
| a34c73df3b | |||
| 1422c78fe8 | |||
| a32dec1516 | |||
| 998b7a06ed | |||
| 8f0ba7b3cb | |||
| f5ec329fd9 | |||
| b501b22a3b | |||
| 13a001965c | |||
| a0b2c1f45e | |||
| 23f3cc9404 | |||
| dfe75ad54d | |||
| 2c4e5276cd | |||
| eb5d7696fc | |||
| 7c9bdb1eae | |||
| e810162ce4 | |||
| 54cd62b844 | |||
| 116c812da4 | |||
| fab4ac3a10 | |||
| cca7fb8ed8 |
@@ -24,6 +24,7 @@ dockerfilelint:
|
||||
.ONESHELL:
|
||||
shellcheck:
|
||||
for file in $$(find . -type f -iname '*.sh' -not -path './wip/*'); do shellcheck --format=gcc $$file; done;
|
||||
for file in $$(find ./scripts -type f); do shellcheck --format=gcc $$file; done;
|
||||
|
||||
.ONESHELL:
|
||||
template-apply:
|
||||
|
||||
@@ -1,381 +1,172 @@
|
||||
# nextcloud-dev-docker-compose
|
||||
|
||||
A docker based Nextcloud development environment that is easy to setup and use.
|
||||
Hi beginner developer ! 👋
|
||||
|
||||
⚠ **DO NOT USE THIS IN PRODUCTION**
|
||||
This project allows you to start developing a Nextcloud app or contribute to Nextcloud server.
|
||||
|
||||
Various settings in this setup are considered insecure and default passwords and secrets are used all over the place
|
||||
This project is very **modular** where you can add [features](#different-feature-you-can-use).
|
||||
So, you can use this project for your development environment only.
|
||||
|
||||
Features
|
||||
⚠ **DO NOT USE THIS IN PRODUCTION** Various settings in this setup are considered insecure and default passwords and secrets are used all over the place.
|
||||
|
||||
- ☁ Nextcloud
|
||||
- 🔒 Nginx proxy with SSL termination
|
||||
- 💾 MySQL
|
||||
- 💡 Redis
|
||||
- 👥 LDAP with example user data
|
||||
- ✉ Mailhog
|
||||
- 🚀 Blackfire
|
||||
- 📄 Collabora
|
||||
If you don't know how to install Docker, please, read this tutorial by Daphne Muller: https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa
|
||||
Be careful : Read the "README.md" of the tutorial written by Daphne Muller first.
|
||||
|
||||
## Getting started
|
||||
## Getting started 🎮
|
||||
|
||||
|
||||
<details><summary>Installation requirements on Ubuntu</summary>
|
||||
|
||||
1. Install docker and git
|
||||
```
|
||||
sudo apt install docker.io git
|
||||
```
|
||||
|
||||
Continue with the installation instructions below.
|
||||
</details>
|
||||
|
||||
<details><summary>Installation requirements on macOS</summary>
|
||||
|
||||
1. Install the Xcode command line utils: `xcode-select --install`
|
||||
2. Install Docker https://www.docker.com/products/docker-desktop/
|
||||
|
||||
|
||||
Continue with the installation instructions below.
|
||||
</details>
|
||||
|
||||
<details><summary>Installation requirements on Windows</summary>
|
||||
|
||||
This development environment can be used under Windows using WSL2 and Docker. This step by step guide is using VS Code as an editor as it allows to easily work within the Linux environment on the remote WSL instance. You may follow https://code.visualstudio.com/blogs/2020/03/02/docker-in-wsl2 in order setup everything required, but in short the steps are the following:
|
||||
|
||||
1. Install Windows 10, version 1903 or higher or Windows 11.
|
||||
2. Enable WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
|
||||
3. Install the Ubuntu distribution for WSL https://docs.microsoft.com/en-us/windows/wsl/install
|
||||
3. Download and install the Linux kernel update package.
|
||||
4. Install Docker Desktop for Windows.
|
||||
6. Open the Ubuntu terminal and run the installation command below
|
||||
|
||||
Continue with the installation instructions below.
|
||||
</details>
|
||||
|
||||
To get the setup running:
|
||||
|
||||
```bash
|
||||
curl -L https://yeeeha.org/nc-dev | bash
|
||||
```
|
||||
|
||||
This will:
|
||||
- Clone the Nextcloud server source code
|
||||
- Ask for your sudo password to add the hostnames for your local environment to /etc/hosts
|
||||
|
||||
The command will end with some instructions on how to start your development environment:
|
||||
|
||||
- Start the docker container
|
||||
```
|
||||
|
||||
## Manual setup
|
||||
|
||||
The above script will clone this repository and afterwards perform the setup of the development manual with the following steps:
|
||||
|
||||
To properly verify what is happening you might want to clone manually using the following commands, if you don't trust piping random URLs to the terminal:
|
||||
First, get the setup running:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/juliushaertl/nextcloud-docker-dev
|
||||
cd nextcloud-docker-dev
|
||||
./bootstrap.sh
|
||||
sudo sh -c "echo '127.0.0.1 nextcloud.local' >> /etc/hosts"
|
||||
docker compose up nextcloud proxy
|
||||
```
|
||||
# Common tasks
|
||||
|
||||
### Starting the containers
|
||||
Ok, let's go to understand these commands line !
|
||||
|
||||
- Start full setup: `docker-compose up`
|
||||
- Minimum: `docker-compose up proxy nextcloud` (nextcloud mysql redis mailhog)
|
||||
First, you download the project with the git command, then you move to the `nextcloud-docker-dev` folder.
|
||||
|
||||
### Running stable versions
|
||||
The `bootstrap.sh` script check if all requirements are present and prepares your workspace.
|
||||
You have the `./workspace` folder where there is the `server` folder, the Nextcloud's core and [other Nextcloud versions](docs/running-stable-versions.md) if you want (the stable21, stable22, stable23, and so on).
|
||||
|
||||
The main nextcloud service is ment for running the master branch checkout of the server and your apps. The docker-compose file provides individual containers for stable Nextcloud releases. In order to run those you will need a checkout of the stable version server branch to your workspace directory. Using [git worktree](https://blog.juliushaertl.de/index.php/2018/01/24/how-to-checkout-multiple-git-branches-at-the-same-time/) makes it easy to have different branches checked out in parallel in separate directories.
|
||||
So, you if you want to contribute to the Nextcloud's core, you can work in this folder directly !
|
||||
|
||||
During the bootstrap script an initial set of the last 3 stable releases will be checked out already at the workspace/ directory, however you may add newer or older ones manually using the following commands:
|
||||
Then, you add `nextcloud.local` to your hosts file.
|
||||
|
||||
Finally, the `docker compose up nextcloud proxy` command line. This command line runs the nextcloud, proxy, redis and mailhog containers.
|
||||
|
||||
Once here, you can read the [First connection](#first-connection) section after seeing this result in your terminal :
|
||||
|
||||
```bash
|
||||
cd workspace/server
|
||||
git worktree add ../stable23 stable23
|
||||
cd ../stable23
|
||||
git submodule update --init
|
||||
nextcloud-nextcloud-1 | The user "alice" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user6" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user1" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "nextcloud" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user3" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user5" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "jane" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "john" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "bob" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user4" was created successfully
|
||||
nextcloud-nextcloud-1 | The user "user2" was created successfully
|
||||
```
|
||||
|
||||
After adding the worktree you can start the stable container using `docker-compose up -d stable23`. You can then add `stable23.local 127.0.0.1` to your `/etc/hosts` file to access it.
|
||||
This result means that all users are created and you can try to log in with the admin account or [other users](#which-user-accounts-can-i-use).
|
||||
|
||||
Git worktrees can also be used to have a checkout of an apps stable brach within the server stable directory.
|
||||
If you want to stop the services, you should use `Ctrl+C`. But, the containers are always running or presents.
|
||||
|
||||
```
|
||||
cd workspace/server/apps-extra/text
|
||||
git worktree add ../../../stable23/apps-extra/text stable23
|
||||
Look at the status of your containers with `docker compose ps` :
|
||||
|
||||
```bahs
|
||||
$ docker compose ps
|
||||
NAME COMMAND SERVICE STATUS PORTS
|
||||
nextcloud-database-mysql-1 "docker-entrypoint.s…" database-mysql running 0.0.0.0:8212->3306/tcp, :::8212->3306/tcp
|
||||
nextcloud-mail-1 "MailHog" mail running 1025/tcp, 8025/tcp
|
||||
nextcloud-nextcloud-1 "/usr/local/bin/boot…" nextcloud exited (0)
|
||||
nextcloud-proxy-1 "/app/docker-entrypo…" proxy exited (2)
|
||||
nextcloud-redis-1 "docker-entrypoint.s…" redis running 6379/tcp
|
||||
```
|
||||
|
||||
### Running into errors
|
||||
|
||||
If your setup isn't working and you can not figure out the reason why, running
|
||||
`docker-compose down -v` will remove the relevant containers and volumes,
|
||||
allowing you to run `docker-compose up` again from a clean slate.
|
||||
|
||||
|
||||
## Configuration
|
||||
### Environment variables
|
||||
|
||||
This is automatically done by the bootstrap script.
|
||||
|
||||
A `.env` file should be created in the repository root, to keep configuration default on the dev setup:
|
||||
|
||||
```
|
||||
cp example.env .env
|
||||
```
|
||||
|
||||
Replace `REPO_PATH_SERVER` with the path from above.
|
||||
|
||||
### Setting the PHP version to be used
|
||||
|
||||
The Nextcloud instance is setup to run with PHP 7.2 by default.
|
||||
If you wish to use a different version of PHP, set the `PHP_VERSION` `.env` variable.
|
||||
|
||||
The variable supports the following values:
|
||||
|
||||
1. PHP 7.1: `71`
|
||||
1. PHP 7.2: `72`
|
||||
1. PHP 7.3: `73`
|
||||
1. PHP 7.4: `74`
|
||||
1. PHP 8.0: `80`
|
||||
|
||||
### dnsmasq to resolve wildcard domains
|
||||
|
||||
Instead of adding the individual container domains to `/etc/hosts` a local dns server like dnsmasq can be used to resolve any domain ending with the configured DOMAIN_SUFFIX in `.env` to localhost.
|
||||
|
||||
For dnsmasq adding the following configuration would be sufficient for `DOMAIN_SUFFIX=.local`:
|
||||
```
|
||||
address=/.local/127.0.0.1
|
||||
```
|
||||
|
||||
### Use valid certificates trusted by your system
|
||||
|
||||
* Install mkcert https://github.com/FiloSottile/mkcert
|
||||
* Go to `data/ssl`
|
||||
* `mkcert nextcloud.local`
|
||||
|
||||
* `mv nextcloud.local-key.pem nextcloud.local.key`
|
||||
* `mv nextcloud.local.pem nextcloud.local.crt`
|
||||
* `docker-compose restart proxy`
|
||||
|
||||
# Services
|
||||
|
||||
Each service can be started using `docker-compose up -d <service>`. Some services like LDAP come with autoconfiguration if the used Nextcloud service is installed from scratch, so you may want to destroy the existing containers before starting the service using `docker-compose down -v`, but this will also drop any data or configuration you may already have on the instances.
|
||||
|
||||
## 🔒 Reverse Proxy
|
||||
|
||||
Used for SSL termination. To setup SSL support provide a proper DOMAIN_SUFFIX environment variable and put the certificates to ./data/ssl/ named by the domain name.
|
||||
|
||||
You might need to add the domains to your `/etc/hosts` file:
|
||||
|
||||
```
|
||||
127.0.0.1 nextcloud.local
|
||||
127.0.0.1 collabora.local
|
||||
```
|
||||
|
||||
This is assuming you have set `DOMAIN_SUFFIX=.local`
|
||||
|
||||
You can generate it through:
|
||||
|
||||
```
|
||||
awk -v D=.local '/- [A-z0-9]+\${DOMAIN_SUFFIX}/ {sub("\\$\{DOMAIN_SUFFIX\}", D " 127.0.0.1", $2); print $2}' docker-compose.yml
|
||||
```
|
||||
|
||||
You can generate selfsigned certificates using:
|
||||
|
||||
```
|
||||
cd data/ssl
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nextcloud.local.key -out nextcloud.local.crt
|
||||
```
|
||||
|
||||
## ✉ Mail
|
||||
|
||||
Sending/receiving mails can be tested with [mailhog](https://github.com/mailhog/MailHog) which is available on ports 1025 (SMTP).
|
||||
|
||||
To use the webui, add `127.0.0.1 mail.local` to your `/etc/hosts` and open [mail.local](http://mail.local).
|
||||
|
||||
## 🚀 Blackfire
|
||||
|
||||
Blackfire needs to use a hostname/ip that is resolvable from within the blackfire container. Their free version is [limited to local profiling](https://support.blackfire.io/troubleshooting/hack-edition-users-cannot-profile-non-local-http-applications) so we need to browse Nextcloud though its local docker IP or add the hostname to `/etc/hosts`.
|
||||
|
||||
### Using with curl
|
||||
|
||||
```
|
||||
alias blackfire='docker-compose exec -e BLACKFIRE_CLIENT_ID=$BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN=$BLACKFIRE_CLIENT_TOKEN blackfire blackfire'
|
||||
blackfire curl http://192.168.21.8/
|
||||
```
|
||||
|
||||
## 👥 LDAP
|
||||
|
||||
The LDAP sample data is based on https://github.com/rroemhild/docker-test-openldap and extended with randomly generated users/groups. For details see [data/ldap-generator/](https://github.com/juliushaertl/nextcloud-docker-dev/tree/master/data/ldap-generator). LDAP will be configured automatically if the ldap container is available during installation.
|
||||
|
||||
Example users are: `leela fry bender zoidberg hermes professor`. The password is the same as the uid.
|
||||
|
||||
Useful commands:
|
||||
|
||||
```
|
||||
docker-compose exec ldap ldapsearch -H 'ldap://localhost' -D "cn=admin,dc=planetexpress,dc=com" -w admin -b "dc=planetexpress,dc=com" "(&(objectclass=inetOrgPerson)(description=*use*))"
|
||||
```
|
||||
|
||||
## Collabora
|
||||
|
||||
- Make sure to have the collabora hostname setup in your /etc/hosts file: `127.0.0.1 collabora.local`
|
||||
- Automatically enable for one of your containers (e.g. the main nextcloud one):
|
||||
- Run `./scripts/enable-collabora nextcloud`
|
||||
- Manual setup
|
||||
- Start the Collabora Online server in addition to your other containers `docker-compose up -d collabora`
|
||||
- Make sure you have the richdocuments app cloned to your apps-extra directory and built the frontend code of the app with `npm ci && npm run build`
|
||||
- Enable the app and configure `collabora.local` in the Collabora settings inside of Nextcloud
|
||||
|
||||
|
||||
## ONLYOFFICE
|
||||
|
||||
- Make sure to have the collabora hostname setup in your /etc/hosts file: `127.0.0.1 onlyoffice.local`
|
||||
- Automatically enable for one of your containers (e.g. the main nextcloud one):
|
||||
- Run `./scripts/enable-onlyoffice nextcloud`
|
||||
- Manual setup
|
||||
- Start the ONLYOFFICE server in addition to your other containers `docker-compose up -d onlyoffice`
|
||||
- Clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud into your apps directory
|
||||
- Enable the app and configure `onlyoffice.local` in the ONLYOFFICE settings inside of Nextcloud
|
||||
|
||||
|
||||
## Antivirus
|
||||
To down your containers, use the `docker compose down -v` command :
|
||||
|
||||
```bash
|
||||
docker-compose up -d proxy nextcloud av
|
||||
```
|
||||
|
||||
The clanav antivirus will then be exposed as a deamon with host `clam` and
|
||||
port 3310.
|
||||
|
||||
## SAML
|
||||
|
||||
```
|
||||
docker-compose up -d proxy nextcloud saml
|
||||
```
|
||||
|
||||
- uid mapping: `urn:oid:0.9.2342.19200300.100.1.1`
|
||||
- idp entity id: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/metadata.php`
|
||||
- single sign on service url: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/SSOService.php`
|
||||
- single log out service url: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/SingleLogoutService.php`
|
||||
- use certificate from docker/configs/var-simplesamlphp/cert/example.org.crt
|
||||
```
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICrDCCAhWgAwIBAgIUNtfnC2jE/rLdxHCs2th3WaYLryAwDQYJKoZIhvcNAQEL
|
||||
BQAwaDELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJZMRIwEAYDVQQHDAlXdWVyemJ1
|
||||
cmcxFDASBgNVBAoMC0V4YW1wbGUgb3JnMSIwIAYDVQQDDBlzc28ubG9jYWwuZGV2
|
||||
LmJpdGdyaWQubmV0MB4XDTE5MDcwMzE0MjkzOFoXDTI5MDcwMjE0MjkzOFowaDEL
|
||||
MAkGA1UEBhMCREUxCzAJBgNVBAgMAkJZMRIwEAYDVQQHDAlXdWVyemJ1cmcxFDAS
|
||||
BgNVBAoMC0V4YW1wbGUgb3JnMSIwIAYDVQQDDBlzc28ubG9jYWwuZGV2LmJpdGdy
|
||||
aWQubmV0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHPZwU+dAc76yB6bOq
|
||||
0AkP1y9g7aAi1vRtJ9GD4AEAsA3zjW1P60BYs92mvZwNWK6NxlJYw51xPak9QMk5
|
||||
qRHaTdBkmq0a2mWYqh1AZNNgCII6/VnLcbEIgyoXB0CCfY+2vaavAmFsRwOMdeR9
|
||||
HmtQQPlbTA4m5Y8jWGVs1qPtDQIDAQABo1MwUTAdBgNVHQ4EFgQUeZSoGKeN5uu5
|
||||
K+n98o3wcitFYJ0wHwYDVR0jBBgwFoAUeZSoGKeN5uu5K+n98o3wcitFYJ0wDwYD
|
||||
VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQA25X/Ke+5dw7up8gcF2BNQ
|
||||
ggBcJs+SVKBmPwRcPQ8plgX4D/K8JJNT13HNlxTGDmb9elXEkzSjdJ+6Oa8n3IMe
|
||||
vUUejXDXUBvlmmm+ImJVwwCn27cSfIYb/RoZPeKtned4SCzpbEO9H/75z3XSqAZS
|
||||
Z1tiHzYOVtEs4UNGOtz1Jg==
|
||||
-----END CERTIFICATE-----
|
||||
```
|
||||
- cn `urn:oid:2.5.4.3`
|
||||
- email `urn:oid:0.9.2342.19200300.100.1.3`
|
||||
|
||||
### Environment based SSO
|
||||
|
||||
A simple approach to test environment based SSO with the user_saml app is to use apache basic auth with the following configuration:
|
||||
|
||||
```
|
||||
|
||||
<Location /login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /index.php/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /index.php/apps/user_saml/saml/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /apps/user_saml/saml/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
```
|
||||
|
||||
## Fulltextsearch
|
||||
|
||||
```
|
||||
docker-compose up -d elasticsearch elasticsearch-ui
|
||||
```
|
||||
|
||||
- Address for configuring in Nextcloud: `http://elastic:elastic@elasticsearch:9200`
|
||||
- Adress to access elastic search from outside: `http://elastic:elastic@elasticsearch.local`
|
||||
- Address for accessing the ui: http://elasticsearch-ui.local/
|
||||
|
||||
`sudo sysctl -w vm.max_map_count=262144`
|
||||
foo@bar:~/Documents/codes/nextcloud-docker-dev$ docker compose down -v
|
||||
[+] Running 16/5
|
||||
⠿ Container nextcloud-nextcloud-1 Removed 0.0s
|
||||
⠿ Container nextcloud-proxy-1 Removed 0.0s
|
||||
⠿ Container nextcloud-mail-1 Removed 0.6s
|
||||
#...
|
||||
foo@bar:~/Documents/codes/nextcloud-docker-dev$
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Object storage
|
||||
|
||||
Primary object storage can be enabled by setting the `PRIMARY=minio` environment variable either in your .env file or in docker-compose.yml for individual containers.
|
||||
Once you understand the mechanisms, you could run your containers in the background with the `-d` flag.
|
||||
|
||||
```bash
|
||||
docker-composer up proxy nextcloud minio
|
||||
foo@bar:~/Documents/codes/nextcloud-docker-dev$ docker compose up -d proxy nextcloud
|
||||
[+] Running 12/1
|
||||
⠿ Network nextcloud_default Created 0.2s
|
||||
⠿ Volume "nextcloud_postgres" Created 0.0s
|
||||
⠿ Volume "nextcloud_mysql" Created 0.0s
|
||||
⠿ Volume "nextcloud_smb" Created 0.0s
|
||||
⠿ Volume "nextcloud_clam" Created 0.0s
|
||||
⠿ Volume "nextcloud_document_data" Created 0.0s
|
||||
#...
|
||||
foo@bar:~/Documents/codes/nextcloud-docker-dev$
|
||||
```
|
||||
|
||||
## Development
|
||||
The difference with the `-d` flag is you can use your currently prompt after run the `docker compose` command.
|
||||
|
||||
### OCC
|
||||
## First connection
|
||||
|
||||
Run inside of the Nextcloud container:
|
||||
```
|
||||
set XDEBUG_CONFIG=idekey=PHPSTORM
|
||||
sudo -E -u www-data php -dxdebug.remote_host=192.168.21.1 occ
|
||||
```
|
||||
After running the `docker compose up nextcloud proxy` command, you have to wait a few minutes before trying to connect to your development instance.
|
||||
|
||||
### Useful commands
|
||||
In fact, you will see that the `nextcloud` and `proxy` containers initialize your Nextcloud, create user accounts, and so on. Step by step.
|
||||
|
||||
- Restart apache to reload php configuration without a full container restart: `docker-compose kill -s USR1 nextcloud`
|
||||
- Access to mysql console: `mysql -h $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nextcloud_database-mysql_1) -P 3306 -u nextcloud -pnextcloud`
|
||||
- Run an LDAP search: `ldapsearch -x -H ldap://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nextcloud_ldap_1) -D "cn=admin,dc=planetexpress,dc=com" -w admin -b "dc=planetexpress,dc=com" -s subtree <filter> <attrs>`
|
||||
Then, once these steps are completed, you can connect to your development instance. You must enter `http://nextcloud.local` in your address bar!
|
||||
|
||||
## Keycloak
|
||||
|
||||
- Keycloak is using ldap as a user backend (make sure the ldap container is also running)
|
||||
- `occ user_oidc:provider Keycloak -c nextcloud -s 09e3c268-d8bc-42f1-b7c6-74d307ef5fde -d https://keycloak.local.dev.bitgrid.net/auth/realms/Example/.well-known/openid-configuration`
|
||||
- https://keycloak.local.dev.bitgrid.net/auth/realms/Example/.well-known/openid-configuration
|
||||
- nextcloud
|
||||
- 09e3c268-d8bc-42f1-b7c6-74d307ef5fde
|
||||
|
||||
## Global scale
|
||||
|
||||
```
|
||||
docker-compose up -d proxy portal gs1 gs2 lookup database-mysql
|
||||
```
|
||||
|
||||
Users are named the same as the instance name, e.g. gs1, gs2
|
||||
|
||||
## Imaginary
|
||||
|
||||
Enable the imaginary server for generating previews
|
||||
|
||||
```bash
|
||||
docker-composer up proxy nextcloud previews_hpb
|
||||
./scripts/enable-preview-imaginary.sh
|
||||
```
|
||||
In fact, with the `proxy` container you don't need to specify the port number and you can't use `http://localhost` or `http://127.0.0.1`. Just, you have to use this address : `http://nextcloud.local`.
|
||||
|
||||
|
||||
### Which user accounts can I use ?
|
||||
|
||||
Here is a list of user accounts you can use :
|
||||
|
||||
| uid | password |
|
||||
|:---:|:---:|
|
||||
| admin | admin |
|
||||
| user1 | user1 |
|
||||
| user2 | user2 |
|
||||
| user3 | user3 |
|
||||
| user4 | user4 |
|
||||
| user5 | user5 |
|
||||
| user6 | user6 |
|
||||
| nextcloud | nextcloud |
|
||||
| alice | alice |
|
||||
| bob | bob |
|
||||
| jane | jane |
|
||||
| john | john |
|
||||
|
||||
## Where can I add my app for development ?
|
||||
|
||||
Once you have ran the Nextcloud's server with `docker compose`. You can clone your app in this folder : `./workspace/server/apps-extra/`.
|
||||
|
||||
Of course, you should adapt to the nextcloud release you are using (server, stable23, stable24, and so on.).
|
||||
|
||||
If you have not yet generated an app, you can do so from this web page : [https://apps.nextcloud.com/developer/apps/generate](https://apps.nextcloud.com/developer/apps/generate).
|
||||
|
||||
|
||||
## Going further
|
||||
|
||||
If you want to go further, you can add new features or customize your development environment by following this documentation : [Configure my environment](docs/manual-setup.md#copy-environment-variables).
|
||||
|
||||
If you use **XDEBUG** to debug your PHP code. Please, read the [Set Up Xdebug](docs/setup-xdebug.md) documentation.
|
||||
|
||||
If you want to set up the Nextcloud's core, please, read the [Manual setup](docs/manual-setup.md) documentation.
|
||||
|
||||
If you aren't comfortable with Docker or other tools from the various containers (ldap, mysql, and so on.). You can read the [Useful commands](docs/useful-commands.md) file with some tips.
|
||||
|
||||
If you encounter any problems, please, look at this documentation : [Troubleshooting](docs/troubleshooting.md).
|
||||
|
||||
### Different feature you can use
|
||||
|
||||
These are features where you can use :
|
||||
|
||||
- ☁ Nextcloud
|
||||
- 🔒 [Nginx proxy with SSL termination](docs/containers/ssl.md)
|
||||
- 💾 [MySQL](docs/containers/mysql.md)
|
||||
- 💡 Redis
|
||||
- 👥 [LDAP with example user data](docs/containers/ldap.md)
|
||||
- ✉ [Mailhog](docs/containers/mail.md)
|
||||
- 🚀 [Blackfire](docs/containers/blackfire.md)
|
||||
- 📄 [Collabora](docs/containers/collabora.md)
|
||||
- 📄 [Only Office](docs/containers/onlyoffice.md)
|
||||
- 👥 [SAML](docs/containers/saml.md)
|
||||
- 🔍 [Full Text Search](docs/containers/fulltextsearch.md)
|
||||
- 🪣 [Object Storage](docs/containers/objectstorage.md)
|
||||
- 💉 [Antivirus](docs/containers/antivirus.md)
|
||||
- 🔑 [Keycloak](docs/containers/keycloak.md)
|
||||
- [Global Scale](docs/containers/globalscale.md)
|
||||
- [Imaginary](docs/containers/imaginary.md)
|
||||
|
||||
+18
-53
@@ -40,7 +40,6 @@ echo
|
||||
echo "⏩ Performing system checks"
|
||||
|
||||
is_installed docker
|
||||
is_installed docker-compose
|
||||
is_installed git
|
||||
|
||||
(
|
||||
@@ -51,55 +50,28 @@ is_installed git
|
||||
echo
|
||||
echo "⏩ Setting up folder structure and fetching repositories"
|
||||
|
||||
# check if already in git
|
||||
if [[ ! -f bootstrap.sh && ! -d .git ]]
|
||||
then
|
||||
git clone https://github.com/juliushaertl/nextcloud-docker-dev.git &&
|
||||
cd nextcloud-docker-dev
|
||||
echo "✅ Cloned the docker environment" | indent
|
||||
fi
|
||||
|
||||
pwd
|
||||
|
||||
INSTALL_SHIPPED_APPS="activity viewer recommendations files_pdfviewer"
|
||||
INSTALL_
|
||||
|
||||
mkdir -p workspace/
|
||||
(
|
||||
(
|
||||
echo "🌏 Fetching server (this might take a while to finish)" &&
|
||||
git clone https://github.com/nextcloud/server.git --depth 1 workspace/server &&
|
||||
cd workspace/server && git submodule update --init
|
||||
git clone https://github.com/nextcloud/server.git --depth 1 workspace/server 2>&1 | indent_cli &&
|
||||
cd workspace/server && git submodule update --init 2>&1 | indent_cli
|
||||
) || echo "❌ Failed to clone Nextcloud server code"
|
||||
echo "✅ Cloned the Nextcloud server source code"
|
||||
) | indent
|
||||
|
||||
#(
|
||||
# (
|
||||
# cd workspace/server && \
|
||||
# git worktree add ../stable19 stable19 2>&1 | indent_cli
|
||||
# ) || echo "❌ Failed to setup worktree for stable19"
|
||||
#) | indent
|
||||
|
||||
mkdir -p workspace/server/apps-extra
|
||||
install_app viewer
|
||||
install_app recommendations
|
||||
install_app files_pdfviewer
|
||||
install_app profiler
|
||||
|
||||
# TODO download last 3 stable branches
|
||||
install_stable() {
|
||||
cd workspace/server && \
|
||||
git worktree add ../stable24 stable24 2>&1
|
||||
}
|
||||
(
|
||||
(
|
||||
install_stable stable24 | indent_cli
|
||||
install_stable stable23 | indent_cli
|
||||
install_stable stable22 | indent_cli
|
||||
) || echo "❌ Failed to setup worktree for stable19"
|
||||
) | indent
|
||||
|
||||
# Add /etc/hosts from container list
|
||||
echo "⏩ Adding development URLs to /etc/hosts"
|
||||
sudo sh -c "echo '127.0.0.1 nextcloud.local' >> /etc/hosts"
|
||||
|
||||
awk -v D=.local '/- [A-z0-9]+\${DOMAIN_SUFFIX}/ {sub("\\$\{DOMAIN_SUFFIX\}", D " 127.0.0.1", $2); print $2}' docker-compose.yml
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "⏩ Setup your environment in an .env file"
|
||||
@@ -132,36 +104,29 @@ cat <<EOF
|
||||
|
||||
🚀 Start the Nextcloud server by running
|
||||
|
||||
$ docker-compose up -d nextcloud
|
||||
|
||||
|
||||
🌍 Open the browser
|
||||
|
||||
http://nextcloud.local
|
||||
$ docker compose up -d nextcloud
|
||||
|
||||
|
||||
💤 Stop it with
|
||||
|
||||
$ docker-compose stop nextcloud
|
||||
$ docker compose stop nextcloud
|
||||
|
||||
|
||||
🗑 Fresh install and wipe all data
|
||||
|
||||
$ docker-compose down -v
|
||||
$ docker compose down -v
|
||||
|
||||
|
||||
Note that for performance reasons the server repository has been cloned with --depth=1. To get the full history it is highly recommended to run:
|
||||
=======
|
||||
Note that for performance reasons the server repository has been cloned with
|
||||
--depth=1. To get the full history it is highly recommended to run:
|
||||
Note that for performance reasons the server repository has been cloned with
|
||||
--depth=1. To get the full history it is highly recommended to run:
|
||||
|
||||
cd workspace/server
|
||||
git fetch --unshallow
|
||||
$ cd workspace/server
|
||||
$ git fetch --unshallow
|
||||
|
||||
This may take some time depending on your internet connection speed.
|
||||
This may take some time depending on your internet connection speed.
|
||||
|
||||
|
||||
For more details about the individual setup options see
|
||||
For more details about the individual setup options see
|
||||
the README.md file or checkout the repo at
|
||||
https://github.com/juliushaertl/nextcloud-docker-dev
|
||||
EOF
|
||||
|
||||
@@ -66,6 +66,8 @@ services:
|
||||
VIRTUAL_HOST: "nextcloud${DOMAIN_SUFFIX}"
|
||||
ADDITIONAL_APPS_PATH:
|
||||
NEXTCLOUD_TRUSTED_DOMAINS:
|
||||
BLACKFIRE_CLIENT_ID:
|
||||
BLACKFIRE_CLIENT_TOKEN:
|
||||
volumes:
|
||||
- '${REPO_PATH_SERVER:-/home/jus/repos/nextcloud/server}:/var/www/html'
|
||||
- data:/var/www/html/data
|
||||
|
||||
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+2
-14
@@ -67,26 +67,14 @@ RUN mkdir --parent /var/log/cron
|
||||
ADD configs/cron.conf /etc/nc-cron.conf
|
||||
RUN crontab /etc/nc-cron.conf
|
||||
|
||||
# PHP configuration
|
||||
RUN { \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.enable_cli=1'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.memory_consumption=128'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=1'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini
|
||||
|
||||
ADD configs/php/nextcloud.ini /usr/local/etc/php/conf.d/nextcloud.ini
|
||||
ADD configs/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
# Setup blackfire probe
|
||||
RUN wget -q -O - https://packages.blackfire.io/gpg.key | sudo apt-key add - \
|
||||
&& echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php \
|
||||
&& apt-get install -y --no-install-recommends blackfire-php blackfire \
|
||||
&& printf "blackfire.agent_socket=tcp://blackfire:8307\n" >> $PHP_INI_DIR/conf.d/zz-blackfire.ini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@@ -36,7 +36,5 @@
|
||||
|
||||
'skeletondirectory' => '/skeleton',
|
||||
|
||||
'dbuser' => 'root',
|
||||
|
||||
//PLACEHOLDER
|
||||
];
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
display_startup_errors=0
|
||||
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.interned_strings_buffer=8
|
||||
opcache.max_accelerated_files=10000
|
||||
opcache.memory_consumption=128
|
||||
opcache.save_comments=1
|
||||
opcache.revalidate_freq=1
|
||||
|
||||
apc.enable_cli=1
|
||||
memory_limit=512M
|
||||
@@ -0,0 +1,8 @@
|
||||
# Antivirus
|
||||
|
||||
```bash
|
||||
docker compose up -d proxy nextcloud av
|
||||
```
|
||||
|
||||
The clanav antivirus will then be exposed as a deamon with host `clam` and
|
||||
port 3310.
|
||||
@@ -0,0 +1,10 @@
|
||||
# 🚀 Blackfire
|
||||
|
||||
Blackfire needs to use a hostname/ip that is resolvable from within the blackfire container. Their free version is [limited to local profiling](https://support.blackfire.io/troubleshooting/hack-edition-users-cannot-profile-non-local-http-applications) so we need to browse Nextcloud though its local docker IP or add the hostname to `/etc/hosts`.
|
||||
|
||||
## Using with curl
|
||||
|
||||
```
|
||||
alias blackfire='docker compose exec -e BLACKFIRE_CLIENT_ID=$BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN=$BLACKFIRE_CLIENT_TOKEN blackfire blackfire'
|
||||
blackfire curl http://192.168.21.8/
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
# Collabora
|
||||
|
||||
- Make sure to have the collabora hostname setup in your /etc/hosts file: `127.0.0.1 collabora.local`
|
||||
- Automatically enable for one of your containers (e.g. the main nextcloud one):
|
||||
- Run `./scripts/enable-collabora nextcloud`
|
||||
- Manual setup
|
||||
- Start the Collabora Online server in addition to your other containers `docker compose up -d collabora`
|
||||
- Make sure you have the richdocuments app cloned to your apps-extra directory and built the frontend code of the app with `npm ci && npm run build`
|
||||
- Enable the app and configure `collabora.local` in the Collabora settings inside of Nextcloud
|
||||
@@ -0,0 +1,19 @@
|
||||
# Full Text Search
|
||||
|
||||
To use Full Text Search, follow these commands :
|
||||
|
||||
```bash
|
||||
docker compose down -v
|
||||
docker compose up nextcloud proxy elasticsearch elasticsearch-ui
|
||||
```
|
||||
|
||||
You can add another services from `docker-compose.yaml` if you want.
|
||||
|
||||
- Address for configuring in Nextcloud: `http://elastic:elastic@elasticsearch:9200`
|
||||
- Adress to access elastic search from outside: `http://elastic:elastic@elasticsearch.local`
|
||||
- Address for accessing the ui: http://elasticsearch-ui.local/
|
||||
|
||||
```bash
|
||||
sudo sysctl -w vm.max_map_count=262144
|
||||
```
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
## Global scale
|
||||
|
||||
```bash
|
||||
docker compose up -d proxy portal gs1 gs2 lookup database-mysql
|
||||
```
|
||||
|
||||
Users are named the same as the instance name, e.g. gs1, gs2
|
||||
@@ -0,0 +1,8 @@
|
||||
# Imaginary
|
||||
|
||||
Enable the imaginary server for generating previews
|
||||
|
||||
```bash
|
||||
docker composer up proxy nextcloud previews_hpb
|
||||
./scripts/enable-preview-imaginary.sh
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
# Keycloak
|
||||
|
||||
- Keycloak is using ldap as a user backend (make sure the ldap container is also running)
|
||||
- `occ user_oidc:provider Keycloak -c nextcloud -s 09e3c268-d8bc-42f1-b7c6-74d307ef5fde -d https://keycloak.local.dev.bitgrid.net/auth/realms/Example/.well-known/openid-configuration`
|
||||
- https://keycloak.local.dev.bitgrid.net/auth/realms/Example/.well-known/openid-configuration
|
||||
- nextcloud
|
||||
- 09e3c268-d8bc-42f1-b7c6-74d307ef5fde
|
||||
@@ -0,0 +1,29 @@
|
||||
# 👥 LDAP
|
||||
|
||||
The LDAP sample data is based on https://github.com/rroemhild/docker-test-openldap and extended with randomly generated users/groups. For details see [data/ldap-generator/](https://github.com/juliushaertl/nextcloud-docker-dev/tree/master/data/ldap-generator). LDAP will be configured automatically if the ldap container is available during installation.
|
||||
|
||||
|
||||
|uid (login) | password |
|
||||
|---|---|
|
||||
| leela | leela |
|
||||
| fry | fry |
|
||||
| zoidberg | zoidberg |
|
||||
| hermes | hermes |
|
||||
| professor | professor |
|
||||
| ... | ... |
|
||||
|
||||
|
||||
To add LDAP in your dev environment use these commands :
|
||||
|
||||
```bash
|
||||
docker compose down -v
|
||||
docker compose up nextcloud proxy ldap
|
||||
```
|
||||
|
||||
You can add another services from `docker-compose.yaml` if you want.
|
||||
|
||||
Useful commands to know all LDAP's objects :
|
||||
|
||||
```
|
||||
docker compose exec ldap ldapsearch -H 'ldap://localhost' -D "cn=admin,dc=planetexpress,dc=com" -w admin -b "dc=planetexpress,dc=com" "(&(objectclass=inetOrgPerson)(description=*use*))"
|
||||
```
|
||||
@@ -0,0 +1,5 @@
|
||||
# ✉ Mail
|
||||
|
||||
Sending/receiving mails can be tested with [mailhog](https://github.com/mailhog/MailHog) which is available on ports 1025 (SMTP).
|
||||
|
||||
To use the webui, add `127.0.0.1 mail.local` to your `/etc/hosts` and open [mail.local](http://mail.local).
|
||||
@@ -0,0 +1,25 @@
|
||||
# Mysql
|
||||
|
||||
This is information about the mysql service :
|
||||
|
||||
- user root : `root`
|
||||
- password root : `nextcloud`
|
||||
|
||||
- user : `nextcloud`
|
||||
- password : `nextcloud`
|
||||
|
||||
- database name : `nextcloud`
|
||||
|
||||
## How to connect on the mysql service ?
|
||||
|
||||
You can run this command to be in the mysql prompt as no root :
|
||||
|
||||
```bash
|
||||
docker compose exec database-mysql mysql -unextcloud -pnextcloud
|
||||
```
|
||||
|
||||
If you want to be as root, use this command :
|
||||
|
||||
```bash
|
||||
docker compose exec database-mysql mysql -uroot -pnextcloud
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
# Object storage
|
||||
|
||||
Primary object storage can be enabled by setting the `PRIMARY=minio` environment variable either in your .env file or in docker-compose.yml for individual containers.
|
||||
|
||||
```bash
|
||||
docker composer up proxy nextcloud minio
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
# ONLYOFFICE
|
||||
|
||||
- Make sure to have the collabora hostname setup in your /etc/hosts file: `127.0.0.1 onlyoffice.local`
|
||||
- Automatically enable for one of your containers (e.g. the main nextcloud one):
|
||||
- Run `./scripts/enable-onlyoffice nextcloud`
|
||||
- Manual setup
|
||||
- Start the ONLYOFFICE server in addition to your other containers `docker compose up -d onlyoffice`
|
||||
- Clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud into your apps directory
|
||||
- Enable the app and configure `onlyoffice.local` in the ONLYOFFICE settings inside of Nextcloud
|
||||
@@ -0,0 +1,65 @@
|
||||
# SAML
|
||||
|
||||
```bash
|
||||
docker compose up -d proxy nextcloud saml
|
||||
```
|
||||
|
||||
- uid mapping: `urn:oid:0.9.2342.19200300.100.1.1`
|
||||
- idp entity id: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/metadata.php`
|
||||
- single sign on service url: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/SSOService.php`
|
||||
- single log out service url: `https://sso.local.dev.bitgrid.net/simplesaml/saml2/idp/SingleLogoutService.php`
|
||||
- use certificate from docker/configs/var-simplesamlphp/cert/example.org.crt
|
||||
|
||||
```
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICrDCCAhWgAwIBAgIUNtfnC2jE/rLdxHCs2th3WaYLryAwDQYJKoZIhvcNAQEL
|
||||
BQAwaDELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJZMRIwEAYDVQQHDAlXdWVyemJ1
|
||||
cmcxFDASBgNVBAoMC0V4YW1wbGUgb3JnMSIwIAYDVQQDDBlzc28ubG9jYWwuZGV2
|
||||
LmJpdGdyaWQubmV0MB4XDTE5MDcwMzE0MjkzOFoXDTI5MDcwMjE0MjkzOFowaDEL
|
||||
MAkGA1UEBhMCREUxCzAJBgNVBAgMAkJZMRIwEAYDVQQHDAlXdWVyemJ1cmcxFDAS
|
||||
BgNVBAoMC0V4YW1wbGUgb3JnMSIwIAYDVQQDDBlzc28ubG9jYWwuZGV2LmJpdGdy
|
||||
aWQubmV0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHPZwU+dAc76yB6bOq
|
||||
0AkP1y9g7aAi1vRtJ9GD4AEAsA3zjW1P60BYs92mvZwNWK6NxlJYw51xPak9QMk5
|
||||
qRHaTdBkmq0a2mWYqh1AZNNgCII6/VnLcbEIgyoXB0CCfY+2vaavAmFsRwOMdeR9
|
||||
HmtQQPlbTA4m5Y8jWGVs1qPtDQIDAQABo1MwUTAdBgNVHQ4EFgQUeZSoGKeN5uu5
|
||||
K+n98o3wcitFYJ0wHwYDVR0jBBgwFoAUeZSoGKeN5uu5K+n98o3wcitFYJ0wDwYD
|
||||
VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQA25X/Ke+5dw7up8gcF2BNQ
|
||||
ggBcJs+SVKBmPwRcPQ8plgX4D/K8JJNT13HNlxTGDmb9elXEkzSjdJ+6Oa8n3IMe
|
||||
vUUejXDXUBvlmmm+ImJVwwCn27cSfIYb/RoZPeKtned4SCzpbEO9H/75z3XSqAZS
|
||||
Z1tiHzYOVtEs4UNGOtz1Jg==
|
||||
-----END CERTIFICATE-----
|
||||
```
|
||||
|
||||
- cn `urn:oid:2.5.4.3`
|
||||
- email `urn:oid:0.9.2342.19200300.100.1.3`
|
||||
|
||||
## Environment based SSO
|
||||
|
||||
A simple approach to test environment based SSO with the user_saml app is to use apache basic auth with the following configuration:
|
||||
|
||||
```xml
|
||||
<Location /login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /index.php/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /index.php/apps/user_saml/saml/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
<Location /apps/user_saml/saml/login>
|
||||
AuthType Basic
|
||||
AuthName "SAML"
|
||||
AuthUserFile /var/www/html/.htpasswd
|
||||
Require valid-user
|
||||
</Location>
|
||||
```
|
||||
@@ -0,0 +1,52 @@
|
||||
# SSL
|
||||
|
||||
## What is SSL ?
|
||||
|
||||
<!-- ## How to use this container with others ?-->
|
||||
<!-- This section describes if there are particularities or others with this container. -->
|
||||
|
||||
## 🔒 Reverse Proxy
|
||||
|
||||
Used for SSL termination. To setup SSL support provide a proper DOMAIN_SUFFIX environment variable and put the certificates to ./data/ssl/ named by the domain name.
|
||||
|
||||
You might need to add the domains to your `/etc/hosts` file:
|
||||
|
||||
```
|
||||
127.0.0.1 nextcloud.local
|
||||
127.0.0.1 collabora.local
|
||||
```
|
||||
|
||||
This is assuming you have set `DOMAIN_SUFFIX=.local`
|
||||
|
||||
You can generate it through:
|
||||
|
||||
```bash
|
||||
awk -v D=.local '/- [A-z0-9]+\${DOMAIN_SUFFIX}/ {sub("\\$\{DOMAIN_SUFFIX\}", D " 127.0.0.1", $2); print $2}' docker-compose.yml
|
||||
```
|
||||
|
||||
You can generate selfsigned certificates using:
|
||||
|
||||
```bash
|
||||
cd data/ssl
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nextcloud.local.key -out nextcloud.local.crt
|
||||
```
|
||||
|
||||
### dnsmasq to resolve wildcard domains
|
||||
|
||||
Instead of adding the individual container domains to `/etc/hosts` a local dns server like dnsmasq can be used to resolve any domain ending with the configured DOMAIN_SUFFIX in `.env` to localhost.
|
||||
|
||||
For dnsmasq adding the following configuration would be sufficient for `DOMAIN_SUFFIX=.local`:
|
||||
|
||||
```
|
||||
address=/.local/127.0.0.1
|
||||
```
|
||||
|
||||
### Use valid certificates trusted by your system
|
||||
|
||||
* Install mkcert https://github.com/FiloSottile/mkcert
|
||||
* Go to `data/ssl`
|
||||
* `mkcert nextcloud.local`
|
||||
|
||||
* `mv nextcloud.local-key.pem nextcloud.local.key`
|
||||
* `mv nextcloud.local.pem nextcloud.local.crt`
|
||||
* `docker compose restart proxy`
|
||||
@@ -0,0 +1,57 @@
|
||||
# Manual setup
|
||||
|
||||
## Nextcloud Code
|
||||
|
||||
The Nextcloud code base needs to be available including the `3rdparty` submodule. To clone it from github run:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/nextcloud/server.git
|
||||
cd server
|
||||
git submodule update --init
|
||||
pwd
|
||||
```
|
||||
|
||||
The last command prints the path to the Nextcloud server directory.
|
||||
Use it for setting the `REPO_PATH_SERVER` in the next step.
|
||||
|
||||
## Configure my environment
|
||||
|
||||
### Copy environment variables
|
||||
|
||||
For this section you don't need to run the `./bootstrap.sh` script.
|
||||
|
||||
Here, we learn how to customise our development environment !
|
||||
|
||||
First, a `.env` file should be created in the repository root, to keep configuration default on the dev setup:
|
||||
|
||||
```bash
|
||||
cp example.env .env
|
||||
```
|
||||
|
||||
Replace `REPO_PATH_SERVER` with your path using the `pwd` command from the project.
|
||||
|
||||
```bash
|
||||
foo@bar:~/Documents/codes/nextcloud-docker-dev$ pwd
|
||||
/home/foo/Documents/codes/nextcloud-docker-dev
|
||||
```
|
||||
|
||||
And the new value is :
|
||||
|
||||
```bash
|
||||
REPO_PATH_SERVER=/home/foo/Documents/codes/nextcloud-docker-dev/workspace/server
|
||||
```
|
||||
|
||||
### Setting the PHP version to be used
|
||||
|
||||
The Nextcloud instance is setup to run with PHP 8.1 by default.
|
||||
But, the program adapts the PHP default release to suit the Nextcloud stable release using. For example, the stable23 use PHP 7.3 and the stable24 use PHP 7.4.
|
||||
|
||||
If you wish to use a different version of PHP, set the `PHP_VERSION` `.env` variable.
|
||||
|
||||
The variable supports the following values:
|
||||
|
||||
1. PHP 7.1: `71`
|
||||
1. PHP 7.2: `72`
|
||||
1. PHP 7.3: `73`
|
||||
1. PHP 7.4: `74`
|
||||
1. PHP 8.0: `80`
|
||||
@@ -0,0 +1,28 @@
|
||||
# Running stable versions
|
||||
|
||||
The docker compose file provides individual containers for stable Nextcloud releases. In order to run those you will need a checkout of the stable version server branch to your workspace directory. Using [git worktree](https://blog.juliushaertl.de/index.php/2018/01/24/how-to-checkout-multiple-git-branches-at-the-same-time/) makes it easy to have different branches checked out in parallel in separate directories.
|
||||
|
||||
Note that for performance reasons the server repository might have been cloned with --depth=1 by default. To get the full history it is highly recommended to run:
|
||||
|
||||
```bash
|
||||
cd workspace/server
|
||||
git fetch --unshallow
|
||||
```
|
||||
|
||||
This may take some time depending on your internet connection speed.
|
||||
|
||||
```bash
|
||||
cd workspace/server
|
||||
git worktree add ../stable23 stable23
|
||||
cd ../stable23
|
||||
git submodule update --init
|
||||
```
|
||||
|
||||
After adding the worktree you can start the stable container using `docker compose up -d stable23`. You can then add stable23.local to your `/etc/hosts` file to access it.
|
||||
|
||||
Git worktrees can also be used to have a checkout of an apps stable brach within the server stable directory.
|
||||
|
||||
```bash
|
||||
cd workspace/server/apps-extra/text
|
||||
git worktree add ../../../stable23/apps-extra/text stable23
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
## Set up XDebug
|
||||
|
||||
Run inside of the Nextcloud container:
|
||||
|
||||
```bash
|
||||
set XDEBUG_CONFIG=idekey=PHPSTORM
|
||||
sudo -E -u www-data php -dxdebug.remote_host=192.168.21.1 occ
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
# Troubleshooting
|
||||
|
||||
## Running into errors
|
||||
|
||||
If your setup isn't working and you can not figure out the reason why, running
|
||||
`docker compose down -v` will remove the relevant containers and volumes,
|
||||
allowing you to run `docker compose up` again from a clean slate.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Useful commands
|
||||
|
||||
|
||||
## Related to Apache
|
||||
|
||||
- Restart apache to reload php configuration without a full container restart: `docker compose kill -s USR1 nextcloud`
|
||||
|
||||
|
||||
## Related to MySql
|
||||
|
||||
- Access to mysql console: `mysql -h $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nextcloud_database-mysql_1) -P 3306 -u nextcloud -pnextcloud`
|
||||
|
||||
|
||||
## Related to LDAP
|
||||
|
||||
- Run an LDAP search: `ldapsearch -x -H ldap://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nextcloud_ldap_1) -D "cn=admin,dc=planetexpress,dc=com" -w admin -b "dc=planetexpress,dc=com" -s subtree <filter> <attrs>`
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
COMPOSE_PROJECT_NAME=master
|
||||
|
||||
# Paths
|
||||
REPO_PATH_SERVER=/home/jus/repos/nextcloud/server
|
||||
ADDITIONAL_APPS_PATH=/home/jus/repos/nextcloud/server/apps-extra
|
||||
REPO_PATH_SERVER=/home/foobar/repos/nextcloud-docker-dev/workspace/server
|
||||
ADDITIONAL_APPS_PATH=/home/foobar/repos/nextcloud-docker-dev/workspace/server/apps-extra
|
||||
|
||||
# Stable releases root directory
|
||||
STABLE_ROOT_PATH=/home/jus/repos/nextcloud/
|
||||
STABLE_ROOT_PATH=/home/foobar/repos/nextcloud-docker-dev/workspace
|
||||
|
||||
# Install Nextcloud apps per default
|
||||
# NEXTCLOUD_AUTOINSTALL_APPS="viewer activity"
|
||||
|
||||
@@ -12,6 +12,7 @@ function occ() {
|
||||
docker compose exec "$CONTAINER" sudo -E -u www-data "./occ" "$@"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source .env
|
||||
|
||||
echo "Setting up Collabora with collabora$DOMAIN_SUFFIX on $CONTAINER"
|
||||
|
||||
@@ -12,6 +12,7 @@ function occ() {
|
||||
docker compose exec "$CONTAINER" sudo -E -u www-data "./occ" "$@"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source .env
|
||||
|
||||
echo "Setting up ONLYOFFICE with onlyoffice$DOMAIN_SUFFIX on $CONTAINER"
|
||||
|
||||
Reference in New Issue
Block a user