1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 09:04:12 +02:00

initial nix based docker images

This commit is contained in:
Robin Appelman 2025-06-07 18:24:39 +02:00
commit 06bf3b4b62
72 changed files with 472 additions and 789 deletions

101
README.md
View file

@ -6,8 +6,8 @@ Easy setup and management of Nextcloud test instances using docker
## What
`haze` provides an easy way to setup Nextcloud test instances with a choice of php version, database server, optional s3
or ldap setup and more.
`haze` provides an easy way to setup Nextcloud test instances with a choice of
php version, database server, optional s3 or ldap setup and more.
## Setup
@ -17,7 +17,9 @@ or ldap setup and more.
### Installation
- Grab a binary from the [github releases](https://github.com/icewind1991/haze/releases) and place it in your `$PATH`
- Grab a binary from the
[github releases](https://github.com/icewind1991/haze/releases) and place it
in your `$PATH`
### Config
@ -31,13 +33,15 @@ See the [configuration section](#configuration) for more options.
### Quick examples
- Start a Nextcloud instance with `postgresql`, `php 8.1` and `s3` primary storage:
- Start a Nextcloud instance with `postgresql`, `php 8.1` and `s3` primary
storage:
```bash
haze start pgsq s3
```
- Start a Nextcloud instance with `sqlite`, `php 8.2` and an `smb` external storage:
- Start a Nextcloud instance with `sqlite`, `php 8.2` and an `smb` external
storage:
```bash
haze start 8.2 smb
@ -56,19 +60,22 @@ See the [configuration section](#configuration) for more options.
haze start [database] [php-version] [services]
```
Where `database` is one of `sqlite`, `mysql`, `mariadb`, `pgsql` or `oracle` with an optional version (e.g. `pgsql:12`),
defaults to `sqlite`.
And `php-version` is one of `8.1`, `8.2`, `8.3`, defaults to `8.1`. `7.3` and `7.4` and `8.0` are still supported but
the docker images for those versions aren't being updated anymore so they might be missing some newer features.
Where `database` is one of `sqlite`, `mysql`, `mariadb`, `pgsql` or `oracle`
with an optional version (e.g. `pgsql:12`), defaults to `sqlite`. And
`php-version` is one of `8.1`, `8.2`, `8.3`, defaults to `8.1`. `7.3` and `7.4`
and `8.0` are still supported but the docker images for those versions aren't
being updated anymore so they might be missing some newer features.
Each php version also comes with a `-dbg` variant that has php compiled in debug mode and can be used for debugging php
itself with gdb.
Each php version also comes with a `-dbg` variant that has php compiled in debug
mode and can be used for debugging php itself with gdb.
Additionally, you can use the following options when starting an instance:
- `s3`: setup an S3 server and configure to Nextcloud to use it as primary storage.
- `<path to app.tar.gz>`: by specifying the path to an app package this package will be extracted into the apps.
directory of the new instance (overwriting any existing app code). This can be used to quickly test a packaged app.
- `s3`: setup an S3 server and configure to Nextcloud to use it as primary
storage.
- `<path to app.tar.gz>`: by specifying the path to an app package this package
will be extracted into the apps. directory of the new instance (overwriting
any existing app code). This can be used to quickly test a packaged app.
- `ldap`: setup an LDAP server.
- `office`: setup a Nextcloud Office server.
- `onlyoffice` setup an onlyoffice document server.
@ -76,14 +83,16 @@ Additionally, you can use the following options when starting an instance:
- `smb`: setup a samba server for external storage use.
- `dav`: setup a WebDAV server for external storage use.
- `sftp`: setup a SFTP server for external storage use.
- `kaspersky`: setup a kaspersky scan engine server in http mode. (
Requires [manually setting up the image](https://github.com/icewind1991/kaspersky-docker))
- `kaspersky`: setup a kaspersky scan engine server in http mode. ( Requires
[manually setting up the image](https://github.com/icewind1991/kaspersky-docker))
- `kaspersky-icap`: setup a kaspersky scan engine server in ICAP mode.
- `clamav-icap`: setup a clam av scanner in ICAP mode.
- `clamav-icap-tls`: setup a clam av scanner in ICAP mode with TLS encryption.
- `oc`: start an ownCloud instance in the same network.
- `imaginary`: start an Imaginary service and configure it for preview generation.
- `mail`: start an [smtp4dev](https://github.com/rnwood/smtp4dev) server and configure it the mail server.
- `imaginary`: start an Imaginary service and configure it for preview
generation.
- `mail`: start an [smtp4dev](https://github.com/rnwood/smtp4dev) server and
configure it the mail server.
- `redis-tls`: connect to redis over TLS.
- The name of any configured preset.
@ -93,7 +102,8 @@ Additionally, you can use the following options when starting an instance:
haze test [database] [php-version] [path]
```
Where `path` is a file or folder to run phpunit in, relative to the sources root.
Where `path` is a file or folder to run phpunit in, relative to the sources
root.
### List running instances
@ -115,8 +125,8 @@ haze clean
## Controlling running instances
The following commands run against the most recently started instance and allow optionally providing a `match` to select
a specific instance by it's name.
The following commands run against the most recently started instance and allow
optionally providing a `match` to select a specific instance by it's name.
#### Open an instance
@ -190,50 +200,57 @@ haze [match] unpin
haze [match] env <cmd> [args]
```
Runs the provided command with `NEXTCLOUD_URL`, `DATABASE_URL` and `REDIS_URL` environment variables set for the matched
instance.
Runs the provided command with `NEXTCLOUD_URL`, `DATABASE_URL` and `REDIS_URL`
environment variables set for the matched instance.
This is indented to run a local [push daemon](https://github.com/nextcloud/notify_push) against an instance.
This is indented to run a local
[push daemon](https://github.com/nextcloud/notify_push) against an instance.
## Federation
Multiple instances can reach each other by using their instance name as domain name to allow for testing federation
between instances.
Alternatively, you can setup the haze proxy and the proxied domains to get https support between instances.
Multiple instances can reach each other by using their instance name as domain
name to allow for testing federation between instances. Alternatively, you can
setup the haze proxy and the proxied domains to get https support between
instances.
## Proxy
By default, instances can be accessed by their IP. In order to get more memorable urls and allow supporting https,
haze comes with a builtin reverse proxy to allow using a wildcard domain.
By default, instances can be accessed by their IP. In order to get more
memorable urls and allow supporting https, haze comes with a builtin reverse
proxy to allow using a wildcard domain.
### Requirements
- A domain name you can set wildcard DNS records for
- A reverse proxy like nginx or apache
- (optionally) a wildcard ssl certificate (can be acquiring using letsencrypt and dns verification)
- (optionally) a wildcard ssl certificate (can be acquiring using letsencrypt
and dns verification)
### Setup
- Set a DNS record for `*.haze.exmaple.com` and `haze.example.com` pointing to your development machine. (127.0.0.1 will
not work)
- Set a DNS record for `*.haze.exmaple.com` and `haze.example.com` pointing to
your development machine. (127.0.0.1 will not work)
- Set the `proxy` configuration with your domain and desired listen endpoint
- Setup a service to run `haze proxy` in the background as your own user. A systemd user service is recommended.
- Configure your reverse proxy of choice to proxy `*.haze.example.com` and `haze.example.com` to the proxy's listen
endpoint
- (optional) acquire a wildcard ssl certificate for your domain and set your reverse proxy to use it.
This will be highly dependent on your DNS
provider, [this](https://community.letsencrypt.org/t/dns-providers-who-easily-integrate-with-lets-encrypt-dns-validation/86438)
- Setup a service to run `haze proxy` in the background as your own user. A
systemd user service is recommended.
- Configure your reverse proxy of choice to proxy `*.haze.example.com` and
`haze.example.com` to the proxy's listen endpoint
- (optional) acquire a wildcard ssl certificate for your domain and set your
reverse proxy to use it. This will be highly dependent on your DNS provider,
[this](https://community.letsencrypt.org/t/dns-providers-who-easily-integrate-with-lets-encrypt-dns-validation/86438)
lists some DNS providers and supported ACME clients.
### Usage
When the proxy is configured, generated urls for the instances will use a subdomain of the configured domain, e.g.
the `rolling-bees` instance will be available at `rolling-bees.haze.example.com`. Additionally, `haze.example.com` will
automatically point to the last created instance.
When the proxy is configured, generated urls for the instances will use a
subdomain of the configured domain, e.g. the `rolling-bees` instance will be
available at `rolling-bees.haze.example.com`. Additionally, `haze.example.com`
will automatically point to the last created instance.
## Configuration
Configuration is loaded from `~/.config/haze/haze.toml` and has the following options
Configuration is loaded from `~/.config/haze/haze.toml` and has the following
options
```toml
sources_root = "/path/to/sources" # path of the nextcloud sources. required