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

acme client package for pfSense, initial commit #89

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 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
97 changes: 97 additions & 0 deletions security/pfSense-pkg-acme/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-acme
PORTVERSION= 0.1
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
EXTRACT_ONLY= # empty

MAINTAINER= PiBa-NL
COMMENT= pfSense package acme

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add LICENSE= APACHE20 between COMMENT and USE_PHP leaving a blank line before and after

USE_PHP= ftp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

USE_PHP alone is deprecated. keep this line replacing space by TAB to separate = and value and add the following line before it:

USES=	php


CONFLICTS=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank CONFLICT block


NO_BUILD= yes
NO_MTREE= yes

SUB_FILES= pkg-install pkg-deinstall
SUB_LIST= PORTNAME=${PORTNAME}

do-extract:
${MKDIR} ${WRKSRC}

do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/pkg
${MKDIR} ${STAGEDIR}${PREFIX}/pkg/acme
${MKDIR} ${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MKDIR macro is 'mkdir -p' so you just need to run it to last level and it will create parent directories, remove lines creating pkg and pkg/acme

${MKDIR} ${STAGEDIR}${PREFIX}/www
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line, next one will create this directory too

${MKDIR} ${STAGEDIR}${PREFIX}/www/acme
${MKDIR} ${STAGEDIR}/etc/inc/priv
${MKDIR} ${STAGEDIR}${DATADIR}
${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/acme.xml \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} -m 0755 ${FILESDIR}${PREFIX}/pkg/acme/acme.sh \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme_sh.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} -m 0755 ${FILESDIR}${PREFIX}/pkg/acme/acme_command.sh \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme_gui.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme_htmllist.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme_serverconnectors.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/acme_utils.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/pkg_acme_tabs.inc \
${STAGEDIR}${PREFIX}/pkg/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_ovh.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_pdns.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_ali.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_aws.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_cf.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_cx.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_dp.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_gd.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_ispconfig.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_lexicon.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_lua.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_me.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/acme/dnsapi/dns_nsupdate.sh \
${STAGEDIR}${PREFIX}/pkg/acme/dnsapi
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/acme/acme_accountkeys.php \
${STAGEDIR}${PREFIX}/www/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/acme/acme_accountkeys_edit.php \
${STAGEDIR}${PREFIX}/www/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/acme/acme_certificates.php \
${STAGEDIR}${PREFIX}/www/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/acme/acme_certificates_edit.php \
${STAGEDIR}${PREFIX}/www/acme
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/acme/acme_generalsettings.php \
${STAGEDIR}${PREFIX}/www/acme
${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/acme.priv.inc \
${STAGEDIR}/etc/inc/priv
${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
${STAGEDIR}${DATADIR}
@${REINPLACE_CMD} -i '' -e "s|%%PKGVERSION%%|${PKGVERSION}|" \
${STAGEDIR}${DATADIR}/info.xml

.include <bsd.port.mk>
29 changes: 29 additions & 0 deletions security/pfSense-pkg-acme/files/etc/inc/priv/acme.priv.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/*
* acme.priv.inc
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2015 Rubicon Communications, LLC (Netgate)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

global $priv_list;

$priv_list['page-service-acme'] = array();
$priv_list['page-service-acme']['name'] = "WebCfg - Services: Acme package";
$priv_list['page-service-acme']['descr'] = "Allow access to Acme package GUI";
$priv_list['page-service-acme']['match'] = array();

$priv_list['page-service-acme']['match'][] = "acme/*";
3 changes: 3 additions & 0 deletions security/pfSense-pkg-acme/files/pkg-deinstall.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/local/bin/php -f /etc/rc.packages %%PORTNAME%% ${2}
7 changes: 7 additions & 0 deletions security/pfSense-pkg-acme/files/pkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ "${2}" != "POST-INSTALL" ]; then
exit 0
fi

/usr/local/bin/php -f /etc/rc.packages %%PORTNAME%% ${2}
51 changes: 51 additions & 0 deletions security/pfSense-pkg-acme/files/usr/local/pkg/acme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
<![CDATA[
/*
* acme.xml
*
* part of pfSense (https://www.pfSense.org/)
* Copyright (C) 2015 ESF, LLC
* Copyright (C) 2016 PiBa-NL
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
]]>
</copyright>
<name>acme</name>
<title>Acme</title>
<include_file>/usr/local/pkg/acme/acme.inc</include_file>
<menu>
<name>Acme Certificates</name>
<tooltiptext></tooltiptext>
<section>Services</section>
<url>/acme/acme_certificates.php</url>
</menu>
<plugins>
<item>
<type>plugin_certificates</type>
</item>
</plugins>
<configpath>installedpackages->acme->config</configpath>
<custom_php_install_command>
pfsense_pkg\acme\acme_custom_php_install_command();
</custom_php_install_command>
<custom_php_deinstall_command>
pfsense_pkg\acme\acme_custom_php_deinstall_command();
</custom_php_deinstall_command>
</packagegui>
Loading