Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2021 16:47:12 GMT
From:      Serhii (Sergey) Kozlov <skozlov@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: a72b75c84c8d - main - ftp/sftpgo: SFTP, FTP/S, and WebDAV server [NEW]
Message-ID:  <202106081647.158GlCBH072868@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by skozlov:

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

commit a72b75c84c8dbbfcecab49b0b121d63f184b1ad3
Author:     Serhii (Sergey) Kozlov <skozlov@FreeBSD.org>
AuthorDate: 2021-06-04 16:06:23 +0000
Commit:     Serhii (Sergey) Kozlov <skozlov@FreeBSD.org>
CommitDate: 2021-06-08 16:46:34 +0000

    ftp/sftpgo: SFTP, FTP/S, and WebDAV server [NEW]
    
    Fully featured and highly configurable SFTP server with optional FTP/S
    and WebDAV support, written in Go. Several storage backends are
    supported: local filesystem, encrypted local filesystem,
    S3 (compatible) Object Storage, Google Cloud Storage,
    Azure Blob Storage, SFTP.
    
    WWW: https://github.com/drakkan/sftpgo
    
    Approved by:    koobs
    Differential Revision:  https://reviews.freebsd.org/D30661
---
 GIDs                       |  2 +-
 UIDs                       |  2 +-
 ftp/Makefile               |  1 +
 ftp/sftpgo/Makefile        | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 ftp/sftpgo/distinfo        |  3 +++
 ftp/sftpgo/files/sftpgo.in | 57 +++++++++++++++++++++++++++++++++++++++
 ftp/sftpgo/pkg-descr       |  6 +++++
 ftp/sftpgo/pkg-plist       | 62 +++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 197 insertions(+), 2 deletions(-)

diff --git a/GIDs b/GIDs
index c88db791479c..f1359bc682d4 100644
--- a/GIDs
+++ b/GIDs
@@ -231,7 +231,7 @@ ntopng:*:288:
 victoria-metrics:*:289:
 _gmid:*:290:
 pydio:*:291:
-# free: 292
+sftpgo:*:292:
 # free: 293
 # free: 294
 # free: 295
diff --git a/UIDs b/UIDs
index 8a16d44b933c..815a01dad862 100644
--- a/UIDs
+++ b/UIDs
@@ -236,7 +236,7 @@ ntopng:*:288:288::0:0:ntopng daemon user:/nonexistent:/usr/sbin/nologin
 victoria-metrics:*:289:289::0:0:VictoriaMetrics user:/nonexistent:/usr/sbin/nologin
 _gmid:*:290:290::0:0:gmid daemon user:/var/empty:/usr/sbin/nologin
 pydio:*:291:291::0:0:pydio cells user:/var/pydio:/bin/sh
-# free: 292
+sftpgo:*:292:292::0:0:SFTPGo user:/nonexistent:/usr/sbin/nologin
 # free: 293
 # free: 294
 # free: 295
diff --git a/ftp/Makefile b/ftp/Makefile
index c78424d688fd..cbf45be174d1 100644
--- a/ftp/Makefile
+++ b/ftp/Makefile
@@ -75,6 +75,7 @@
     SUBDIR += rexx-curl
     SUBDIR += rubygem-curb
     SUBDIR += rubygem-net-ftp
+    SUBDIR += sftpgo
     SUBDIR += smbftpd
     SUBDIR += spegla
     SUBDIR += tftp-hpa
diff --git a/ftp/sftpgo/Makefile b/ftp/sftpgo/Makefile
new file mode 100644
index 000000000000..83f2ed4db7e1
--- /dev/null
+++ b/ftp/sftpgo/Makefile
@@ -0,0 +1,66 @@
+PORTNAME=	sftpgo
+PORTVERSION=	2.0.4
+CATEGORIES=	ftp www
+MASTER_SITES=	https://github.com/drakkan/${PORTNAME}/releases/download/v${DISTVERSION}/
+DISTNAME=	${PORTNAME}_v${PORTVERSION}_src_with_deps
+
+MAINTAINER=	skozlov@FreeBSD.org
+COMMENT=	Fully featured and highly configurable SFTP, FTP/S, and WebDAV server
+
+LICENSE=	AGPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		go:modules tar:xz
+USE_RC_SUBR=	${PORTNAME}
+
+NO_WRKSUBDIR=	yes
+
+OPTIONS_DEFINE=		BASH FISH ZSH MANPAGES
+OPTIONS_DEFAULT=	BASH FISH ZSH MANPAGES
+OPTIONS_SUB=		yes
+
+USERS=		sftpgo
+GROUPS=		sftpgo
+
+post-patch:
+	${REINPLACE_CMD} -e 's|"templates"|"${DATADIR}/templates"|; \
+		s|"static"|"${DATADIR}/static"|; \
+		s|"sftpgo.db"|"/var/db/${PORTNAME}/${PORTNAME}.db"|' \
+		${WRKSRC}/${PORTNAME}.json
+
+post-build-BASH-on:
+	${GO_WRKDIR_BIN}/${PORTNAME} gen completion bash > ${WRKDIR}/bash_completions
+
+post-build-FISH-on:
+	${GO_WRKDIR_BIN}/${PORTNAME} gen completion fish > ${WRKDIR}/fish_completions
+
+post-build-ZSH-on:
+	${GO_WRKDIR_BIN}/${PORTNAME} gen completion zsh > ${WRKDIR}/zsh_completions
+
+post-build-MANPAGES-on:
+	${MKDIR} ${WRKDIR}/manpages
+	${GO_WRKDIR_BIN}/${PORTNAME} gen man --dir ${WRKDIR}/manpages
+
+post-install:
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	cd ${WRKSRC} && \
+		${COPYTREE_SHARE} templates ${STAGEDIR}${DATADIR} && \
+		${COPYTREE_SHARE} static ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.json ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.json.sample
+
+post-install-BASH-on:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
+	${INSTALL_DATA} ${WRKDIR}/bash_completions ${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME}
+
+post-install-FISH-on:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/fish/completions
+	${INSTALL_DATA} ${WRKDIR}/fish_completions ${STAGEDIR}${PREFIX}/share/fish/completions/${PORTNAME}.fish
+
+post-install-ZSH-on:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions
+	${INSTALL_DATA} ${WRKDIR}/zsh_completions ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME}
+
+post-install-MANPAGES-on:
+	${FIND} ${WRKDIR}/manpages -type f -execdir ${INSTALL_MAN} {} ${STAGEDIR}${MANPREFIX}/man/man1 \;
+
+.include <bsd.port.mk>
diff --git a/ftp/sftpgo/distinfo b/ftp/sftpgo/distinfo
new file mode 100644
index 000000000000..159739316427
--- /dev/null
+++ b/ftp/sftpgo/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1622828171
+SHA256 (sftpgo_v2.0.4_src_with_deps.tar.xz) = 6e76df02bae6a1e869b4ac8f35bd46dd07dc7085348cc6179430c3455751ec91
+SIZE (sftpgo_v2.0.4_src_with_deps.tar.xz) = 7697892
diff --git a/ftp/sftpgo/files/sftpgo.in b/ftp/sftpgo/files/sftpgo.in
new file mode 100644
index 000000000000..2944809dee43
--- /dev/null
+++ b/ftp/sftpgo/files/sftpgo.in
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# PROVIDE: sftpgo
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable SFTPGo:
+#
+# sftpgo_enable (bool):    Set to "NO" by default.
+#                          Set to "YES" to enable SFTPGo.
+# sftpgo_user (str):       Default to "sftpgo".
+# sftpgo_group (str):      Default to "sftpgo".
+#                          User and group to run SFTPGo with.
+# sftpgo_flags (str):      Additional flags to append to "sftpgo serve" command.
+#                          Read sftpgo(1) for more information.
+# sftpgo_config (str):     Default to "%%PREFIX%%/etc/sftpgo.json".
+#                          SFTPGo config directory.
+# sftpgo_configdir (str):  Default to "/var/db/sftpgo".
+#                          Directory for private keys, SQLite database etc.
+# sftpgo_logdir (str):     Default to "/var/log/sftpgo".
+#                          Directory to store sftpgo logs
+
+. /etc/rc.subr
+
+name=sftpgo
+rcvar=sftpgo_enable
+desc=SFTPGo
+
+load_rc_config sftpgo
+
+: ${sftpgo_enable:=NO}
+: ${sftpgo_user:=sftpgo}
+: ${sftpgo_group:=sftpgo}
+: ${sftpgo_config=%%PREFIX%%/etc/sftpgo.json}
+: ${sftpgo_configdir=/var/db/sftpgo}
+: ${sftpgo_logdir=/var/log/sftpgo}
+
+pidfile=/var/run/${name}/${name}.pid
+start_precmd=sftpgo_precmd
+procname="%%PREFIX%%/bin/sftpgo"
+required_files="${sftpgo_config}"
+command=/usr/sbin/daemon
+command_args="-cf -p ${pidfile} ${procname} serve --config-dir ${sftpgo_configdir} --config-file ${sftpgo_config} --log-file-path ${sftpgo_logdir}/sftpgo.log ${sftpgo_flags}"
+
+sftpgo_precmd()
+{
+    # Create PID file directory
+    install -d -o ${sftpgo_user} -g ${sftpgo_group} -m 0755 "$(dirname ${pidfile})"
+
+    install -d -o ${sftpgo_user} -g ${sftpgo_group} -m 0755 "${sftpgo_configdir}"
+    install -d -o ${sftpgo_user} -g ${sftpgo_group} -m 0755 "${sftpgo_logdir}"
+
+    # Remove default flags, they're added in `command_args` manually
+    rc_flags=""
+}
+
+run_rc_command "$1"
diff --git a/ftp/sftpgo/pkg-descr b/ftp/sftpgo/pkg-descr
new file mode 100644
index 000000000000..4c090aabab6e
--- /dev/null
+++ b/ftp/sftpgo/pkg-descr
@@ -0,0 +1,6 @@
+Fully featured and highly configurable SFTP server with optional FTP/S and
+WebDAV support, written in Go. Several storage backends are supported:
+local filesystem, encrypted local filesystem, S3 (compatible) Object Storage,
+Google Cloud Storage, Azure Blob Storage, SFTP.
+
+WWW: https://github.com/drakkan/sftpgo
diff --git a/ftp/sftpgo/pkg-plist b/ftp/sftpgo/pkg-plist
new file mode 100644
index 000000000000..b1b7733a42aa
--- /dev/null
+++ b/ftp/sftpgo/pkg-plist
@@ -0,0 +1,62 @@
+bin/sftpgo
+%%BASH%%etc/bash_completion.d/sftpgo
+@sample etc/sftpgo.json.sample
+%%MANPAGES%%man/man1/sftpgo-gen-completion.1.gz
+%%MANPAGES%%man/man1/sftpgo-gen-man.1.gz
+%%MANPAGES%%man/man1/sftpgo-gen.1.gz
+%%MANPAGES%%man/man1/sftpgo-initprovider.1.gz
+%%MANPAGES%%man/man1/sftpgo-portable.1.gz
+%%MANPAGES%%man/man1/sftpgo-revertprovider.1.gz
+%%MANPAGES%%man/man1/sftpgo-serve.1.gz
+%%MANPAGES%%man/man1/sftpgo-startsubsys.1.gz
+%%MANPAGES%%man/man1/sftpgo.1.gz
+%%FISH%%share/fish/completions/sftpgo.fish
+%%DATADIR%%/static/css/fonts.css
+%%DATADIR%%/static/css/sb-admin-2.min.css
+%%DATADIR%%/static/favicon.ico
+%%DATADIR%%/static/img/undraw_profile.svg
+%%DATADIR%%/static/js/sb-admin-2.js
+%%DATADIR%%/static/js/sb-admin-2.min.js
+%%DATADIR%%/static/vendor/bootstrap/js/bootstrap.bundle.min.js
+%%DATADIR%%/static/vendor/bootstrap/js/bootstrap.min.js
+%%DATADIR%%/static/vendor/datatables/buttons.bootstrap4.min.css
+%%DATADIR%%/static/vendor/datatables/buttons.bootstrap4.min.js
+%%DATADIR%%/static/vendor/datatables/dataTables.bootstrap4.min.css
+%%DATADIR%%/static/vendor/datatables/dataTables.bootstrap4.min.js
+%%DATADIR%%/static/vendor/datatables/dataTables.buttons.min.js
+%%DATADIR%%/static/vendor/datatables/dataTables.select.min.js
+%%DATADIR%%/static/vendor/datatables/jquery.dataTables.min.js
+%%DATADIR%%/static/vendor/datatables/select.bootstrap4.min.css
+%%DATADIR%%/static/vendor/datatables/select.bootstrap4.min.js
+%%DATADIR%%/static/vendor/fontawesome-free/css/fontawesome.min.css
+%%DATADIR%%/static/vendor/fontawesome-free/css/solid.min.css
+%%DATADIR%%/static/vendor/fontawesome-free/webfonts/fa-solid-900.eot
+%%DATADIR%%/static/vendor/fontawesome-free/webfonts/fa-solid-900.svg
+%%DATADIR%%/static/vendor/fontawesome-free/webfonts/fa-solid-900.ttf
+%%DATADIR%%/static/vendor/fontawesome-free/webfonts/fa-solid-900.woff
+%%DATADIR%%/static/vendor/fontawesome-free/webfonts/fa-solid-900.woff2
+%%DATADIR%%/static/vendor/fonts/LICENSE.txt
+%%DATADIR%%/static/vendor/fonts/README.txt
+%%DATADIR%%/static/vendor/fonts/Roboto-Bold-webfont.woff
+%%DATADIR%%/static/vendor/fonts/Roboto-Light-webfont.woff
+%%DATADIR%%/static/vendor/fonts/Roboto-Regular-webfont.woff
+%%DATADIR%%/static/vendor/jquery-easing/jquery.easing.compatibility.js
+%%DATADIR%%/static/vendor/jquery-easing/jquery.easing.min.js
+%%DATADIR%%/static/vendor/jquery/jquery.min.js
+%%DATADIR%%/static/vendor/moment/js/moment.min.js
+%%DATADIR%%/static/vendor/tempusdominus/css/tempusdominus-bootstrap-4.min.css
+%%DATADIR%%/static/vendor/tempusdominus/js/tempusdominus-bootstrap-4.min.js
+%%DATADIR%%/templates/admin.html
+%%DATADIR%%/templates/admins.html
+%%DATADIR%%/templates/base.html
+%%DATADIR%%/templates/changepwd.html
+%%DATADIR%%/templates/connections.html
+%%DATADIR%%/templates/folder.html
+%%DATADIR%%/templates/folders.html
+%%DATADIR%%/templates/login.html
+%%DATADIR%%/templates/maintenance.html
+%%DATADIR%%/templates/message.html
+%%DATADIR%%/templates/status.html
+%%DATADIR%%/templates/user.html
+%%DATADIR%%/templates/users.html
+%%ZSH%%share/zsh/site-functions/_sftpgo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106081647.158GlCBH072868>