Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextcloud: add ability to include custom php file in InstallStep migration #1197

Merged
merged 1 commit into from Jul 3, 2023

Conversation

SergeyMosin
Copy link

This is useful for automating deployments. For example a domain can be added automatically, settings changed, etc...

Usage:

php occ config:app:set snappymail custom_config_file --value="/my/custom/config-example.php"

/my/custom/config-example.php

$oProvider = \RainLoop\Api::Actions()->DomainProvider();
$oDomain = $oProvider->Load('cool.domain');
if (!$oDomain) {
	$oDomain = \RainLoop\Model\Domain::fromArray('cool.domain', [
			"IMAP" => [
				"host" => "imap.cool.domain",
				"port" => 993,
				"type" => \MailSo\Net\Enumerations\ConnectionSecurityType::SSL,
				"shortLogin" => false,
			],
			"SMTP" => [
				"host" => "smtp.cool.domain",
				"port" => 465,
				"type" => \MailSo\Net\Enumerations\ConnectionSecurityType::SSL,
				"timeout" => 60,
				"useAuth" => true,
				"shortLogin" => false,
			],
			"Sieve" => [
				"host" => "imap.cool.domain",
				"port" => 4190,
				"enabled" => false
			],
			"whiteList" => "",
		]
	);
	$oProvider->Save($oDomain);
}

$oConfig = \RainLoop\Api::Config();
$oConfig->Set('webmail','title','My Cool SnappyMail');
$oConfig->Save();

@the-djmaze the-djmaze merged commit 2f746cb into the-djmaze:master Jul 3, 2023
the-djmaze pushed a commit that referenced this pull request Jul 3, 2023
@SergeyMosin SergeyMosin deleted the nexctloud-custom-config branch July 9, 2023 12:57
@the-djmaze the-djmaze added enhancement New feature or request Nextcloud labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Nextcloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants