git: ead99507a41e - main - net/foreman-proxy: Update to 3.4.0

From: Guangyuan Yang <ygy_at_FreeBSD.org>
Date: Thu, 10 Nov 2022 17:17:29 UTC
The branch main has been updated by ygy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ead99507a41eea8951fad445d9cda7f85d98d4c0

commit ead99507a41eea8951fad445d9cda7f85d98d4c0
Author:     Frank Wall <freebsd@moov.de>
AuthorDate: 2022-11-10 17:17:16 +0000
Commit:     Guangyuan Yang <ygy@FreeBSD.org>
CommitDate: 2022-11-10 17:17:16 +0000

    net/foreman-proxy: Update to 3.4.0
    
    Changelog:      https://theforeman.org/manuals/3.4/index.html#Releasenotesfor3.4
    
    PR:             267579
---
 net/foreman-proxy/Makefile                               | 16 ++++++++--------
 net/foreman-proxy/distinfo                               |  6 +++---
 net/foreman-proxy/files/foreman-proxy.in                 |  4 +++-
 net/foreman-proxy/files/patch-bin-smart-proxy            |  2 +-
 .../files/patch-config-settings.yml.example              | 11 -----------
 ...ig_settings.d_puppet__proxy__puppet__api.yml.example} |  6 +++---
 ...tings.d_puppetca__hostname__whitelisting.yml.example} |  4 ++--
 ...ch-config_settings.d_puppetca__http__api.yml.example} |  4 ++--
 ...-config_settings.d_puppetca__puppet__cert.yml.example |  9 ---------
 ...> patch-config_settings.d_realm__freeipa.yml.example} |  5 +++--
 ....example => patch-config_settings.d_tftp.yml.example} |  4 ++--
 .../files/patch-lib_proxy_http__download.rb              |  6 +++---
 net/foreman-proxy/pkg-message                            | 12 +++++-------
 net/foreman-proxy/pkg-plist                              |  5 -----
 14 files changed, 35 insertions(+), 59 deletions(-)

diff --git a/net/foreman-proxy/Makefile b/net/foreman-proxy/Makefile
index e83765a5ccbc..2ca0f3721e77 100644
--- a/net/foreman-proxy/Makefile
+++ b/net/foreman-proxy/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	foreman-proxy
-PORTVERSION=	3.1.2
+PORTVERSION=	3.4.0
 CATEGORIES=	net
 MASTER_SITES=	https://downloads.theforeman.org/foreman-proxy/
 
@@ -19,6 +19,7 @@ RUN_DEPENDS=	rubygem-bundler_ext>=0.4:sysutils/rubygem-bundler_ext \
 		rubygem-rsec>=0.4.3:devel/rubygem-rsec \
 		rubygem-sd_notify>=0.1.1:devel/rubygem-sd_notify \
 		rubygem-sinatra>=2.0:www/rubygem-sinatra \
+		rubygem-webrick>=1.7:www/rubygem-webrick \
 		curl:ftp/curl
 
 USES=		shebangfix tar:bzip2
@@ -34,8 +35,8 @@ USE_RUBY=	yes
 
 FOREMAN_PROXY_USER?=	foreman_proxy
 FOREMAN_PROXY_GROUP?=	foreman_proxy
-FOREMAN_PROXY_LOGDIR?=	/var/log/foreman-proxy
-FOREMAN_PROXY_RUNDIR?=	/var/run/foreman-proxy
+FOREMAN_PROXY_LOGDIR?=	${DESTDIR}/var/log/foreman-proxy
+FOREMAN_PROXY_RUNDIR?=	${DESTDIR}/var/run/foreman-proxy
 
 USERS=		${FOREMAN_PROXY_USER}
 GROUPS=		${FOREMAN_PROXY_GROUP}
@@ -93,11 +94,10 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/config/settings.yml.example \
 		${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.yml.sample
 .for cfg in bmc dhcp_isc dhcp_libvirt dhcp_native_ms dhcp dns_dnscmd \
-	dns_libvirt dns_nsupdate_gss dns_nsupdate dns facts httpboot \
-	logs puppet_proxy_puppet_api puppet \
-	puppetca_hostname_whitelisting puppetca_http_api \
-	puppetca_puppet_cert puppetca_token_whitelisting \
-	puppetca realm_freeipa realm registration templates tftp
+	dns_libvirt dns_nsupdate_gss dns_nsupdate dns facts httpboot logs \
+	puppet_proxy_puppet_api puppet puppetca_hostname_whitelisting \
+	puppetca_http_api puppetca_token_whitelisting puppetca realm_freeipa \
+	realm registration templates tftp
 	${INSTALL_DATA} ${WRKSRC}/config/settings.d/${cfg}.yml.example \
 		${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.d/${cfg}.yml.sample
 .endfor
diff --git a/net/foreman-proxy/distinfo b/net/foreman-proxy/distinfo
index ffa4444487b8..5f63713e5c40 100644
--- a/net/foreman-proxy/distinfo
+++ b/net/foreman-proxy/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1646448265
-SHA256 (foreman-proxy-3.1.2.tar.bz2) = 14a21af2e735e266f5e22ec64e4597bf4821b53fb7a2393a5146587f1400a1eb
-SIZE (foreman-proxy-3.1.2.tar.bz2) = 199897
+TIMESTAMP = 1667679385
+SHA256 (foreman-proxy-3.4.0.tar.bz2) = 5846625b59ee0c0da4b9af4eac97f5f5d7020b48b31ee0b28b2946f1b94181cf
+SIZE (foreman-proxy-3.4.0.tar.bz2) = 195061
diff --git a/net/foreman-proxy/files/foreman-proxy.in b/net/foreman-proxy/files/foreman-proxy.in
index e66423c40a20..5f4a4cee9d87 100644
--- a/net/foreman-proxy/files/foreman-proxy.in
+++ b/net/foreman-proxy/files/foreman-proxy.in
@@ -12,9 +12,11 @@
 name="foreman_proxy"
 rcvar="foreman_proxy_enable"
 
-command="%%PREFIX%%/sbin/smart-proxy"
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/sbin/smart-proxy"
 command_interpreter="%%RUBY%%"
 pidfile="%%FOREMAN_PROXY_RUNDIR%%/foreman-proxy.pid"
+command_args="-p ${pidfile} -t ${procname} ${command_interpreter} ${procname}"
 
 foreman_proxy_enable=${foreman_proxy_enable:-"NO"}
 foreman_proxy_user=${foreman_proxy_user-"%%FOREMAN_PROXY_USER%%"}
diff --git a/net/foreman-proxy/files/patch-bin-smart-proxy b/net/foreman-proxy/files/patch-bin-smart-proxy
index 3df6da1863db..01f0fac5fdc9 100644
--- a/net/foreman-proxy/files/patch-bin-smart-proxy
+++ b/net/foreman-proxy/files/patch-bin-smart-proxy
@@ -1,4 +1,4 @@
---- bin/smart-proxy.orig	2017-05-08 15:18:42 UTC
+--- bin/smart-proxy.orig       2017-05-08 15:18:42 UTC
 +++ bin/smart-proxy
 @@ -1,6 +1,7 @@
  #!/usr/bin/env ruby
diff --git a/net/foreman-proxy/files/patch-config-settings.yml.example b/net/foreman-proxy/files/patch-config-settings.yml.example
deleted file mode 100644
index ff3ac32eedde..000000000000
--- a/net/foreman-proxy/files/patch-config-settings.yml.example
+++ /dev/null
@@ -1,11 +0,0 @@
---- config/settings.yml.example.orig	2018-12-06 13:30:25.000000000 +0100
-+++ config/settings.yml.example	2019-02-11 22:25:42.626500000 +0100
-@@ -43,7 +43,7 @@
- #:foreman_ssl_key: ssl/private_keys/fqdn.pem
- 
- # by default smart_proxy runs in the foreground. To enable running as a daemon, uncomment 'daemon' setting
--#:daemon: true
-+:daemon: true
- # Only used when 'daemon' is set to true.
- # Uncomment and modify if you want to change the default pid file '/var/run/foreman-proxy/foreman-proxy.pid'
- #:daemon_pid: /var/run/foreman-proxy/foreman-proxy.pid
diff --git a/net/foreman-proxy/files/patch-config-settings.d-puppet_proxy_puppet_api.yml.example b/net/foreman-proxy/files/patch-config_settings.d_puppet__proxy__puppet__api.yml.example
similarity index 82%
rename from net/foreman-proxy/files/patch-config-settings.d-puppet_proxy_puppet_api.yml.example
rename to net/foreman-proxy/files/patch-config_settings.d_puppet__proxy__puppet__api.yml.example
index 84cff78da77f..5493d15ada23 100644
--- a/net/foreman-proxy/files/patch-config-settings.d-puppet_proxy_puppet_api.yml.example
+++ b/net/foreman-proxy/files/patch-config_settings.d_puppet__proxy__puppet__api.yml.example
@@ -1,6 +1,6 @@
---- config/settings.d/puppet_proxy_puppet_api.yml.example.orig	2018-12-06 13:30:25.000000000 +0100
-+++ config/settings.d/puppet_proxy_puppet_api.yml.example	2019-02-11 22:22:53.410247000 +0100
-@@ -9,9 +9,9 @@
+--- config/settings.d/puppet_proxy_puppet_api.yml.example.orig	2022-09-08 13:50:11 UTC
++++ config/settings.d/puppet_proxy_puppet_api.yml.example
+@@ -3,9 +3,9 @@
  #:puppet_url: https://puppet.example.com:8140
  #
  # SSL certificates used to access the puppet API
diff --git a/net/foreman-proxy/files/patch-config-settings.d-puppetca_hostname_whitelisting.yml.example b/net/foreman-proxy/files/patch-config_settings.d_puppetca__hostname__whitelisting.yml.example
similarity index 78%
rename from net/foreman-proxy/files/patch-config-settings.d-puppetca_hostname_whitelisting.yml.example
rename to net/foreman-proxy/files/patch-config_settings.d_puppetca__hostname__whitelisting.yml.example
index 644021449e3c..4d33a0dac6b4 100644
--- a/net/foreman-proxy/files/patch-config-settings.d-puppetca_hostname_whitelisting.yml.example
+++ b/net/foreman-proxy/files/patch-config_settings.d_puppetca__hostname__whitelisting.yml.example
@@ -1,5 +1,5 @@
---- config/settings.d/puppetca_hostname_whitelisting.yml.example.orig     2021-10-26 14:48:17.000000000 +0200
-+++ config/settings.d/puppetca_hostname_whitelisting.yml.example  2021-11-24 11:59:39.227846000 +0100
+--- config/settings.d/puppetca_hostname_whitelisting.yml.example.orig	2022-09-08 13:50:11 UTC
++++ config/settings.d/puppetca_hostname_whitelisting.yml.example
 @@ -3,4 +3,4 @@
  # Configuration of the PuppetCA hostname_whitelisting provider
  #
diff --git a/net/foreman-proxy/files/patch-config-settings.d-puppetca_http_api.yml.example b/net/foreman-proxy/files/patch-config_settings.d_puppetca__http__api.yml.example
similarity index 74%
rename from net/foreman-proxy/files/patch-config-settings.d-puppetca_http_api.yml.example
rename to net/foreman-proxy/files/patch-config_settings.d_puppetca__http__api.yml.example
index b6f1d195b004..a1bc798173b9 100644
--- a/net/foreman-proxy/files/patch-config-settings.d-puppetca_http_api.yml.example
+++ b/net/foreman-proxy/files/patch-config_settings.d_puppetca__http__api.yml.example
@@ -1,5 +1,5 @@
---- config/settings.d/puppetca_http_api.yml.example.orig  2021-10-26 14:48:17.000000000 +0200
-+++ config/settings.d/puppetca_http_api.yml.example       2021-11-24 12:00:12.367622000 +0100
+--- config/settings.d/puppetca_http_api.yml.example.orig	2022-09-08 13:50:11 UTC
++++ config/settings.d/puppetca_http_api.yml.example
 @@ -3,6 +3,6 @@
  #:puppet_url: https://puppet.example.com:8140
  #
diff --git a/net/foreman-proxy/files/patch-config_settings.d_puppetca__puppet__cert.yml.example b/net/foreman-proxy/files/patch-config_settings.d_puppetca__puppet__cert.yml.example
deleted file mode 100644
index a236513fca8e..000000000000
--- a/net/foreman-proxy/files/patch-config_settings.d_puppetca__puppet__cert.yml.example
+++ /dev/null
@@ -1,9 +0,0 @@
---- config/settings.d/puppetca_puppet_cert.yml.example.orig	2019-12-22 22:37:03 UTC
-+++ config/settings.d/puppetca_puppet_cert.yml.example
-@@ -1,4 +1,4 @@
- ---
--#:ssldir: /var/lib/puppet/ssl
-+#:ssldir: /var/puppet/ssl
- #:puppetca_use_sudo: true
--#:sudo_command: /usr/bin/sudo
-+#:sudo_command: %%LOCALBASE%%/bin/sudo
diff --git a/net/foreman-proxy/files/patch-config-settings.d-realm_freeipa.yml.example b/net/foreman-proxy/files/patch-config_settings.d_realm__freeipa.yml.example
similarity index 67%
rename from net/foreman-proxy/files/patch-config-settings.d-realm_freeipa.yml.example
rename to net/foreman-proxy/files/patch-config_settings.d_realm__freeipa.yml.example
index c7eb5e8a5d54..a8f00ac16ab6 100644
--- a/net/foreman-proxy/files/patch-config-settings.d-realm_freeipa.yml.example
+++ b/net/foreman-proxy/files/patch-config_settings.d_realm__freeipa.yml.example
@@ -1,5 +1,5 @@
---- config/settings.d/realm_freeipa.yml.example.orig      2021-10-26 14:48:17.000000000 +0200
-+++ config/settings.d/realm_freeipa.yml.example   2021-11-24 12:26:05.935474000 +0100
+--- config/settings.d/realm_freeipa.yml.example.orig	2022-09-08 13:50:11 UTC
++++ config/settings.d/realm_freeipa.yml.example
 @@ -1,9 +1,9 @@
  ---
  # Authentication for Kerberos-based Realms
@@ -11,3 +11,4 @@
 +:ipa_config: %%LOCALBASE%%/etc/ipa/default.conf
  # Remove from DNS when deleting the FreeIPA entry
  :remove_dns: true
+ 
diff --git a/net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example b/net/foreman-proxy/files/patch-config_settings.d_tftp.yml.example
similarity index 64%
rename from net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example
rename to net/foreman-proxy/files/patch-config_settings.d_tftp.yml.example
index 5aae4bfc8a6a..e86fbfa5a9de 100644
--- a/net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example
+++ b/net/foreman-proxy/files/patch-config_settings.d_tftp.yml.example
@@ -1,5 +1,5 @@
---- config/settings.d/tftp.yml.example.orig	2018-12-06 13:30:25.000000000 +0100
-+++ config/settings.d/tftp.yml.example	2019-02-11 22:24:46.060855000 +0100
+--- config/settings.d/tftp.yml.example.orig	2022-09-08 13:50:11 UTC
++++ config/settings.d/tftp.yml.example
 @@ -2,7 +2,7 @@
  # Can be true, false, or http/https to enable just one of the protocols
  :enabled: false
diff --git a/net/foreman-proxy/files/patch-lib_proxy_http__download.rb b/net/foreman-proxy/files/patch-lib_proxy_http__download.rb
index 030c87085c8e..354fd915f8e7 100644
--- a/net/foreman-proxy/files/patch-lib_proxy_http__download.rb
+++ b/net/foreman-proxy/files/patch-lib_proxy_http__download.rb
@@ -1,8 +1,8 @@
---- lib/proxy/http_download.rb.orig	2022-02-16 01:16:26 UTC
+--- lib/proxy/http_download.rb.orig	2022-09-08 13:50:11 UTC
 +++ lib/proxy/http_download.rb
 @@ -10,7 +10,7 @@ module Proxy
-       logger.warn('Deprecated: HttpDownload read_timeout is deprecated and will be removed in 4.0') if read_timeout
-       logger.warn('Deprecated: HttpDownload dns_timeout is deprecated and will be removed in 4.0') if dns_timeout
+       logger.warn('Deprecated: HttpDownload read_timeout is deprecated and will be removed in 3.5') if read_timeout
+       logger.warn('Deprecated: HttpDownload dns_timeout is deprecated and will be removed in 3.5') if dns_timeout
        connect_timeout ||= DEFAULT_CONNECT_TIMEOUT
 -      args = [which('curl')]
 +      args = ["%%LOCALBASE%%/bin/curl"]
diff --git a/net/foreman-proxy/pkg-message b/net/foreman-proxy/pkg-message
index 451fa7a16cc4..61c3256bd9c7 100644
--- a/net/foreman-proxy/pkg-message
+++ b/net/foreman-proxy/pkg-message
@@ -1,17 +1,15 @@
 [
 { type: upgrade
-  maximum_version: 1.11
+  maximum_version: 3.4
   message: <<EOM
 WARNING:
 
-In version 1.11+ Foreman Smart Proxy splits its configuration in even smaller
-chunks located in:
+In version 3.4+ Foreman Smart Proxy on FreeBSD uses daemon(1), which
+requires the following setting in ${PREFIX}/etc/foreman-proxy/settings.yml:
 
-${PREFIX}/etc/foreman-proxy/settings.d
+  :daemon: false
 
-You can use a bundled script to convert your old settings to new settings:
-
-${PREFIX}/share/foreman-proxy/extra/migrate_settings.rb
+Otherwise the service will fail to start.
 EOM
 }
 ]
diff --git a/net/foreman-proxy/pkg-plist b/net/foreman-proxy/pkg-plist
index f4ae423e3751..c96d1ac659cf 100644
--- a/net/foreman-proxy/pkg-plist
+++ b/net/foreman-proxy/pkg-plist
@@ -16,7 +16,6 @@
 @sample %%ETCDIR%%/settings.d/puppetca.yml.sample
 @sample %%ETCDIR%%/settings.d/puppetca_hostname_whitelisting.yml.sample
 @sample %%ETCDIR%%/settings.d/puppetca_http_api.yml.sample
-@sample %%ETCDIR%%/settings.d/puppetca_puppet_cert.yml.sample
 @sample %%ETCDIR%%/settings.d/puppetca_token_whitelisting.yml.sample
 @sample %%ETCDIR%%/settings.d/realm.yml.sample
 @sample %%ETCDIR%%/settings.d/realm_freeipa.yml.sample
@@ -213,10 +212,6 @@ sbin/smart-proxy
 %%DATADIR%%/modules/puppetca_http_api/puppetca_http_api.rb
 %%DATADIR%%/modules/puppetca_http_api/puppetca_http_api_plugin.rb
 %%DATADIR%%/modules/puppetca_http_api/puppetca_impl.rb
-%%DATADIR%%/modules/puppetca_puppet_cert/plugin_configuration.rb
-%%DATADIR%%/modules/puppetca_puppet_cert/puppetca_impl.rb
-%%DATADIR%%/modules/puppetca_puppet_cert/puppetca_puppet_cert.rb
-%%DATADIR%%/modules/puppetca_puppet_cert/puppetca_puppet_cert_plugin.rb
 %%DATADIR%%/modules/puppetca_token_whitelisting/plugin_configuration.rb
 %%DATADIR%%/modules/puppetca_token_whitelisting/puppetca_token_whitelisting.rb
 %%DATADIR%%/modules/puppetca_token_whitelisting/puppetca_token_whitelisting_autosigner.rb