Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions security/acme-client/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh
Plugin Changelog
================

4.12

Added:
* new automation to upload to Zyxel GS1900 series switches (#5080)

4.11

Added:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,39 @@
<type>checkbox</type>
<help>If checked version 2 of the kv store will be used, otherwise version 1. If you use v2 please consider the comment in the field "Vault Prefix".</help>
</field>
<field>
<label>Required Parameters</label>
<type>header</type>
<style>method_table method_table_acme_zyxel_gs1900</style>
</field>
<field>
<id>action.acme_zyxel_gs1900_host</id>
<label>Switch Host</label>
<type>text</type>
<help>Hostname or IP adress of a Zyxel GS1900 series switch.</help>
</field>
<field>
<id>action.acme_zyxel_gs1900_user</id>
<label>Switch Admin User</label>
<type>text</type>
<help>A user configured as an adminstrator. Defaults to admin.</help>
</field>
<field>
<id>action.acme_zyxel_gs1900_password</id>
<label>Switch Admin Password</label>
<label>Password</label>
<type>password</type>
</field>
<field>
<id>action.acme_zyxel_gs1900_insecure</id>
<label>Skip Certificate Validation</label>
<type>checkbox</type>
<help>If checked the deployment will be run in insecure mode and will skip certificate validation when connecting to the switch.</help>
</field>
<field>
<id>action.acme_zyxel_gs1900_reboot</id>
<label>Restart Switch</label>
<type>checkbox</type>
<help>If checked the switch will be rebooted once the certificate has been successfully installed.</help>
</field>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

/*
* Copyright (C) 2025 Joseph Bauser
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

namespace OPNsense\AcmeClient\LeAutomation;

use OPNsense\AcmeClient\LeAutomationInterface;

/**
* Run acme.sh deploy hook zyxel_gs1900
* @package OPNsense\AcmeClient
*/
class AcmeZyxelGs1900 extends Base implements LeAutomationInterface
{
public function prepare()
{
// Required parameters
$this->acme_env['DEPLOY_ZYXEL_SWITCH_PASSWORD'] = (string)$this->config->acme_zyxel_gs1900_password;

// Optional Parameters
if (!empty((string)$this->config->acme_zyxel_gs1900_host)) {
$this->acme_env['DEPLOY_ZYXEL_SWITCH'] = (string)$this->config->acme_zyxel_gs1900_host;
}
if (!empty((string)$this->config->acme_zyxel_gs1900_user)) {
$this->acme_env['DEPLOY_ZYXEL_SWITCH_USER'] = (string)$this->config->acme_zyxel_gs1900_user;
}
if (!empty((string)$this->config->acme_zyxel_gs1900_validate)) {
$this->acme_env['DEPLOY_ZYXEL_SWITCH_VALIDATE'] = (string)$this->config->acme_zyxel_gs1900_validate;
}
if (!empty((string)$this->config->acme_zyxel_gs1900_reboot)) {
$this->acme_env['DEPLOY_ZYXEL_SWITCH_REBOOT'] = (string)$this->config->acme_zyxel_gs1900_reboot;
}

$this->acme_args[] = '--deploy-hook zyxel_gs1900';

if ((string)$this->config->acme_zyxel_gs1900_insecure == 1) {
array_push($this->acme_args, '--insecure');
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,7 @@
<acme_vault>Upload certificate to HashiCorp Vault</acme_vault>
<acme_synology_dsm>Upload certificate to Synology DSM</acme_synology_dsm>
<acme_truenas>Upload certificate to TrueNAS Core Server</acme_truenas>
<acme_zyxel_gs1900>Upload certificate to Zyxel GS1900 series switches</acme_zyxel_gs1900>
<acme_unifi>Update local Unifi keystore</acme_unifi>
<configd_generic>System or Plugin Command</configd_generic>
</OptionValues>
Expand Down Expand Up @@ -1720,6 +1721,26 @@
<acme_vault_kvv2 type="BooleanField">
<Default>1</Default>
</acme_vault_kvv2>
<acme_zyxel_gs1900_host type="HostnameField">
<Required>N</Required>
<mask>/^.{1,1024}$/u</mask>
<ValidationMessage>Should be a string between 1 and 1024 characters.</ValidationMessage>
</acme_zyxel_gs1900_host>
<acme_zyxel_gs1900_user type="TextField">
<default>admin</default>
<Required>N</Required>
</acme_zyxel_gs1900_user>
<acme_zyxel_gs1900_password type="TextField">
<Required>N</Required>
</acme_zyxel_gs1900_password>
<acme_zyxel_gs1900_insecure type="BooleanField">
<default>0</default>
<Required>N</Required>
</acme_zyxel_gs1900_insecure>
<acme_zyxel_gs1900_reboot type="BooleanField">
<default>0</default>
<Required>N</Required>
</acme_zyxel_gs1900_reboot>
</action>
</actions>
</items>
Expand Down