1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00
No description
  • Rust 89.9%
  • Nix 5.8%
  • PHP 2.2%
  • Nushell 2%
Find a file
2023-05-04 18:35:08 +02:00
.github/workflows forward tty status to exec/occ 2023-04-28 17:10:13 +02:00
images add oracle support 2023-05-04 16:43:57 +02:00
src php 8.2 2023-05-04 18:35:08 +02:00
.envrc basic flake 2022-07-15 13:44:58 +02:00
.gitattributes experimental multi-s3 support 2023-02-03 16:03:09 +01:00
.gitignore basic flake 2022-07-15 13:44:58 +02:00
Cargo.lock forward tty status to exec/occ 2023-04-28 17:10:13 +02:00
Cargo.toml forward tty status to exec/occ 2023-04-28 17:10:13 +02:00
flake.lock experimental multi-s3 support 2023-02-03 16:03:09 +01:00
flake.nix fix flake with disabled proxy 2022-10-03 15:17:48 +02:00
LICENSE 1.0.0 2021-10-12 16:32:17 +02:00
README.md add oracle support 2023-05-04 16:43:57 +02:00

Haze

Hazy with a chance of clouds.

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.

Setup

Requirements

  • Docker

Installation

Config

Create a file ~/.config/haze/haze.toml with the following options:

sources_root = "/path/to/nextcloud/sources"

See the configuration section for more options.

Managing instances

Start an instance

haze start [database] [php-version]

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.0, 8.1, 8.2, defaults to 8.1. 7.3 and 7.4 are still supported but the docker images for those versions aren't being updated anymore so they might be missing some newer features.

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.
  • ldap: setup an LDAP server
  • office: setup a Nextcloud Office server
  • onlyoffice setup an onlyoffice document server
  • push setup client push
  • smb: setup a samba server for external storage use
  • kaspersky: setup a kaspersky scan engine server in http mode. (Requires manually setting up the image)
  • kaspersky-icap: setup a kaspersky scan engine server in ICAP mode.
  • clamav-icap: setup a clam av scanner in ICAP mode.

Run tests in a new instance

haze test [database] [php-version] [path]

Where path is a file or folder to run phpunit in, relative to the sources root.

List running instances

haze

or

haze list

Remove all running instances

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.

Open an instance

haze [match] open

Open the database of an instance

haze [match] db

Execute a command on an instance

haze [match] exec [cmd]

If no cmd is specified it will launch bash

Create a new instance and run a command

haze [match] shell [cmd]

If no cmd is specified it will launch bash

Execute an occ command on an instance

haze [match] occ [cmd]

Connect to the database on an instance

haze [match] db

Show the logs of an instance

haze [match] logs

Stop an instance

haze [match] stop

Pin an instance

haze [match] pin

Pinned instances will not be removed by haze clean.

Unpin an instance

haze [match] unpin

Run a command with instance environment variables set

haze [match] env <cmd> [args]

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 against an instance.

Configuration

Configuration is loaded from ~/.config/haze/haze.toml and has the following options

sources_root = "/path/to/sources" # path of the nextcloud sources. required
work_dir = "/path/to/temp/dir" # path to temporary directory. optional, defaults to "/tmp/haze"

[auto_setup] # optional
enabled = false # whether or not to automatically install nextcloud on `haze start`. optional, defaults to false
username = "foo" # username for admin user during auto setup. optional, defaults to "admin"
password = "bar" # password for admin user during auto setup. optional, defaults to "admin"
post_setup = [ # commands to execute after setup, defaults to []
    "occ app:enable deck",
]

[[volume]]
source = "/tmp/haze-shared"
target = "/shared"
create = true

[[volume]]
source = "/home/me/Downloads"
target = "/Downloads"
read_only = true