diff --git a/sysutils/zrepl-dsh2dsh/Makefile b/sysutils/zrepl-dsh2dsh/Makefile index a390e0b354fe..d7730883bc8d 100644 --- a/sysutils/zrepl-dsh2dsh/Makefile +++ b/sysutils/zrepl-dsh2dsh/Makefile @@ -1,49 +1,61 @@ PORTNAME= zrepl DISTVERSIONPREFIX= v -DISTVERSION= 0.8.4 +DISTVERSION= 0.8.5 CATEGORIES= sysutils PKGNAMESUFFIX= -dsh2dsh MAINTAINER= dsh@bamus.cz COMMENT= ZFS dataset replication tool (fork with more features) WWW= https://github.com/dsh2dsh/${PORTNAME} LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:1.23,modules ncurses -USE_RC_SUBR= ${PORTNAME} GO_MODULE= github.com/dsh2dsh/${PORTNAME} GO_BUILDFLAGS= -ldflags "${STRIP} -w -X github.com/dsh2dsh/${PORTNAME}/version.${PORTNAME}Version=${DISTVERSIONFULL}" CONFLICTS_INSTALL= ${PORTNAME} -SUB_FILES= pkg-message 500.${PORTNAME} ${PORTNAME}.daily +SUB_FILES= pkg-message OPTIONS_DEFINE= EXAMPLES +post-patch: + @${REINPLACE_CMD} \ + -e 's|/usr/local/etc/${PORTNAME}|${ETCDIR}|g' \ + -e 's|/usr/local|${PREFIX}|g' \ + ${WRKSRC}/dist/freebsd/etc/periodic/daily/${PORTNAME} \ + ${WRKSRC}/dist/freebsd/etc/periodic/weekly/500.${PORTNAME} \ + ${WRKSRC}/dist/freebsd/etc/rc.d/${PORTNAME} + post-install: - ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} \ - ${STAGEDIR}${ETCDIR} \ - ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d - ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf \ + ${MKDIR} ${STAGEDIR}${ETCDIR} \ + ${STAGEDIR}${EXAMPLESDIR} \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ + ${STAGEDIR}${PREFIX}/etc/periodic/daily \ + ${STAGEDIR}${PREFIX}/etc/periodic/weekly + ${INSTALL_SCRIPT} ${WRKSRC}/dist/freebsd/etc/rc.d/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/etc/rc.d + ${INSTALL_DATA} \ + ${WRKSRC}/dist/freebsd/etc/newsyslog.conf.d/${PORTNAME}.conf \ ${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf - ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.yml \ + ${INSTALL_DATA} ${WRKSRC}/dist/freebsd/etc/${PORTNAME}/${PORTNAME}.yml \ ${STAGEDIR}${ETCDIR}/${PORTNAME}.yml.sample - ${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily \ - ${STAGEDIR}${PREFIX}/etc/periodic/weekly - ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.daily \ + ${INSTALL_SCRIPT} \ + ${WRKSRC}/dist/freebsd/etc/periodic/daily/${PORTNAME} \ ${STAGEDIR}${PREFIX}/etc/periodic/daily/${PORTNAME} - ${INSTALL_SCRIPT} ${WRKDIR}/500.${PORTNAME} \ + ${INSTALL_SCRIPT} \ + ${WRKSRC}/dist/freebsd/etc/periodic/weekly/500.${PORTNAME} \ ${STAGEDIR}${PREFIX}/etc/periodic/weekly/500.${PORTNAME} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/hooks (cd ${WRKSRC}/config/samples && \ ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) ${INSTALL_DATA} \ ${WRKSRC}/dist/grafana/grafana-prometheus-${PORTNAME}.json \ ${STAGEDIR}${EXAMPLESDIR} .include diff --git a/sysutils/zrepl-dsh2dsh/distinfo b/sysutils/zrepl-dsh2dsh/distinfo index ca1e66007623..1a33ef83c56b 100644 --- a/sysutils/zrepl-dsh2dsh/distinfo +++ b/sysutils/zrepl-dsh2dsh/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1727718613 -SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.4/v0.8.4.mod) = 6d039a394e4025517e66e4f016d60b5299d1541dca23913e1a8fa96bbedece12 -SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.4/v0.8.4.mod) = 3638 -SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.4/v0.8.4.zip) = f4a6f71ae6711e8307f4d1bb2a53e653b11ed3389c879597800a331db674fd39 -SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.4/v0.8.4.zip) = 605289 +TIMESTAMP = 1728757205 +SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.5/v0.8.5.mod) = fa6b007413229b4bcba2c4871c96a3024f0cd52e8a42b0e60ff844bff0a8a2c5 +SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.5/v0.8.5.mod) = 3490 +SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.5/v0.8.5.zip) = b209f3417f5c1b5b4dee485eda8e54aec73689f3784333252c1fe001aa42fd62 +SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.5/v0.8.5.zip) = 605727 diff --git a/sysutils/zrepl-dsh2dsh/files/500.zrepl.in b/sysutils/zrepl-dsh2dsh/files/500.zrepl.in deleted file mode 100644 index b7f1b3abb4d3..000000000000 --- a/sysutils/zrepl-dsh2dsh/files/500.zrepl.in +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# Check zrepl SSL certificates for impending expiration each week -# -# Add the following lines to /etc/periodic.conf: -# -# weekly_zrepl_enable (bool): Set to "NO" by default -# weekly_zrepl_warntime (int): Set to one month's worth of seconds by default - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -# 30 days in seconds -: ${weekly_zrepl_warntime="2592000"} - -rc=0 -case "$weekly_zrepl_enable" in - [Yy][Ee][Ss]) - echo - echo "Check Zrepl certificates for upcoming expiration:" - - for cert in `/usr/bin/find %%ETCDIR%% -maxdepth 1 -name *.crt`; do - /usr/bin/openssl x509 --in "${cert}" \ - -checkend "${weekly_zrepl_warntime}" - - if [ $? -gt 0 ]; then - echo "${cert} will expire soon" - /usr/bin/openssl x509 --in "${cert}" -noout -enddate - rc=3 - fi - done - ;; - *) rc=0;; -esac - -exit $rc diff --git a/sysutils/zrepl-dsh2dsh/files/newsyslog.conf b/sysutils/zrepl-dsh2dsh/files/newsyslog.conf deleted file mode 100644 index 82bb8667cdd7..000000000000 --- a/sysutils/zrepl-dsh2dsh/files/newsyslog.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Newsyslog configuration file for zrepl. -# See newsyslog.conf(5) for details. -# -# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -/var/log/zrepl.log 644 7 * 24 JNC diff --git a/sysutils/zrepl-dsh2dsh/files/pkg-message.in b/sysutils/zrepl-dsh2dsh/files/pkg-message.in index c8dc1af29cda..f1b1d52c1f00 100644 --- a/sysutils/zrepl-dsh2dsh/files/pkg-message.in +++ b/sysutils/zrepl-dsh2dsh/files/pkg-message.in @@ -1,38 +1,43 @@ [ { type: install message: <&2 "${name} not running? (check $pidfile)." - return 1 - fi - - echo "Gracefully stopping ${name}." - eval "$procname" signal shutdown - wait_for_pids "$rc_pid" -} - -if checkyesno zrepl_gracefully; then - stop_cmd="zrepl_gracefulstop" -fi - -run_rc_command "$1" diff --git a/sysutils/zrepl-dsh2dsh/files/zrepl.yml b/sysutils/zrepl-dsh2dsh/files/zrepl.yml deleted file mode 100644 index c52b4e016317..000000000000 --- a/sysutils/zrepl-dsh2dsh/files/zrepl.yml +++ /dev/null @@ -1,151 +0,0 @@ -# zrepl main configuration file. For documentation, refer to -# https://zrepl.github.io/ and https://github.com/dsh2dsh/zrepl -# -global: - # rpc_timeout: "1m" - zfs_bin: "/sbin/zfs" - - logging: - - type: "file" - format: "text" # or "json" - time: false # don't prepend with date and time - hide_fields: &hide-log-fields - - "span" # don't log "span" field - level: "error" # log errors only - # without filename logs to stderr - - type: "file" - format: "text" - hide_fields: *hide-log-fields - level: "info" - filename: "/var/log/zrepl.log" - -# Add "jobs:" section(s) here for your specific use cases. -jobs: - - name: "hourly-snap" - type: "snap" - filesystems: &filesystems - "zroot/ROOT/default<": true - "zroot/usr/home<": true - snapshotting: - type: "periodic" - interval: "1h" - prefix: "zrepl_hourly_" - pruning: &keep-all - - - name: "daily-snap" - type: "snap" - filesystems: *filesystems - snapshotting: - type: "periodic" - interval: "1d" - prefix: "zrepl_daily_" - pruning: *keep-all - - - name: "monthly-snap" - type: "snap" - filesystems: *filesystems - snapshotting: - type: "periodic" - interval: "30d" - prefix: "zrepl_monthly_" - pruning: *keep-all - - - name: "zdisk" - type: "sink" - root_fs: "zdisk/zrepl" - serve: - type: "local" - listener_name: "zdisk" - recv: - placeholder: - encryption: "inherit" - monitor: &monitor-snapshots - count: - - prefix: "zrepl_frequently_" - warning: 18 - critical: 30 - - prefix: "zrepl_hourly_" - warning: 32 - critical: 50 - - prefix: "zrepl_daily_" - warning: 92 - critical: 100 - - prefix: "zrepl_monthly_" - warning: 14 - critical: 15 - - prefix: "" # everything else - warning: 2 - critical: 10 - latest: - - prefix: "zrepl_frequently_" - critical: "48h" # 2d - - prefix: "zrepl_hourly_" - critical: "48h" - - prefix: "zrepl_daily_" - critical: "48h" - - prefix: "zrepl_monthly_" - critical: "768h" # 32d - oldest: - # see zroot-to-zdisk prunner.keep_receiver - - prefix: "zrepl_frequently_" - critical: "48h" # 2d - - prefix: "zrepl_hourly_" - critical: "168h" # 7d - - prefix: "zrepl_daily_" - critical: "2208h" # 90d + 2d - - prefix: "zrepl_monthly_" - critical: "8688h" # 30 * 12 = 360d + 2d - - prefix: "" # everything else - critical: "168h" # 7d - - - name: "zroot-to-zdisk" - type: "push" - connect: - type: "local" - listener_name: "zdisk" - client_identity: "localhost" - filesystems: *filesystems - replication: &replication - # Send all intermediary snapshots as a stream package, instead of sending - # them one by one. - #one_step: true - concurrency: - size_estimates: 8 - conflict_resolution: &conflict_resolution - initial_replication: "all" - snapshotting: - type: "periodic" - cron: "*/15 * * * *" - prefix: "zrepl_frequently_" - pruning: - keep_sender: - - type: "not_replicated" - - type: "last_n" - count: 16 - regex: "^zrepl_frequently_" - - type: "regex" - negate: true - regex: "^zrepl_" - - type: "last_n" - count: 8 - regex: "^zrepl_hourly_" - - type: "last_n" - count: 4 - regex: "^zrepl_daily_" - - type: "last_n" - count: 2 - regex: "^zrepl_monthly_" - keep_receiver: &keep-receiver - - type: "last_n" - count: 2 - regex: "^zrepl_frequently_" - - type: "last_n" - count: 30 - regex: "^zrepl_hourly_" - - type: "last_n" - count: 90 - regex: "^zrepl_daily_" - - type: "last_n" - count: 12 - regex: "^zrepl_monthly_" - monitor: *monitor-snapshots diff --git a/sysutils/zrepl-dsh2dsh/pkg-plist b/sysutils/zrepl-dsh2dsh/pkg-plist index fcb072f2a996..3e2aac89ae3b 100644 --- a/sysutils/zrepl-dsh2dsh/pkg-plist +++ b/sysutils/zrepl-dsh2dsh/pkg-plist @@ -1,23 +1,24 @@ bin/zrepl etc/periodic/daily/zrepl etc/periodic/weekly/500.zrepl +etc/rc.d/zrepl @sample %%ETCDIR%%/zrepl.yml.sample %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bandwidth_limit.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/grafana-prometheus-zrepl.json %%PORTEXAMPLES%%%%EXAMPLESDIR%%/hooks/template.sh %%PORTEXAMPLES%%%%EXAMPLESDIR%%/local.yml @sample %%EXAMPLESDIR%%/newsyslog.conf etc/newsyslog.conf.d/zrepl.conf %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pull.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/pull_ssh.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/push.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/quickstart_backup_to_external_disk.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/quickstart_continuous_server_backup_receiver.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/quickstart_continuous_server_backup_sender.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/quickstart_fan_out_replication_source.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/quickstart_fan_out_replication_target.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sink.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/snap.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/snap_cron.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/source.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/source_ssh.yml @dir etc/newsyslog.conf.d