summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicola Murino2020-10-11 08:54:20 +0200
committerNicola Murino2020-10-11 08:54:20 +0200
commit3a212313235b47452f1d54f5280edb87f351940b (patch)
treebc5144a3e9743151b6c3a99b5cee4fd60d3c8f11
parent1550b7c9a442f85c4fddc8f458bfd3276a448ef4 (diff)
downloadaur-3a212313235b47452f1d54f5280edb87f351940b.tar.gz
update to 1.1.0
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD31
-rw-r--r--sftpgo.install29
-rw-r--r--sftpgo.json72
-rw-r--r--sftpgo.sysusers1
5 files changed, 113 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 276560f43366..57bd03281471 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = sftpgo
- pkgdesc = Fully featured and highly configurable SFTP server
- pkgver = 1.0.0
- pkgrel = 2
+ pkgdesc = Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support. It can serve local filesystem, S3, GCS
+ pkgver = 1.1.0
+ pkgrel = 1
url = https://github.com/drakkan/sftpgo
install = sftpgo.install
arch = i686
@@ -10,6 +10,7 @@ pkgbase = sftpgo
makedepends = gcc
makedepends = git
makedepends = go
+ makedepends = gzip
depends = glibc
optdepends = sqlite: to use SQLite provider
optdepends = postgresql: to use PostgreSQL provider
@@ -17,10 +18,12 @@ pkgbase = sftpgo
optdepends = python-requests: REST API CLI
optdepends = python-pygments: REST API CLI colors highlight
backup = etc/sftpgo/sftpgo.json
- source = git+https://github.com/drakkan/sftpgo#tag=v1.0.0
+ source = git+https://github.com/drakkan/sftpgo#tag=v1.1.0
source = sftpgo.json
+ source = sftpgo.sysusers
sha256sums = SKIP
- sha256sums = fb4dc558c4dcba5e9d9ce9716653439b11d34f468599609cc4b8e79692ef8417
+ sha256sums = f969c0ca4d52e55de3a9823d8fbede2726c1b33feae54a2baa712a0496ceefc7
+ sha256sums = 44658210043f805057c2e4b473653637a91204e4da17954b08081292c72edcb8
pkgname = sftpgo
diff --git a/PKGBUILD b/PKGBUILD
index 0dee2a2de71c..bd511db39aab 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,14 @@
# Maintainer: drakkan <nicola.murino at gmail dot com>
# Contributor: drakkan <nicola.murino at gmail dot com>
pkgname=sftpgo
-pkgver=1.0.0
-pkgrel=2
-pkgdesc='Fully featured and highly configurable SFTP server'
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support. It can serve local filesystem, S3, GCS'
arch=('i686' 'x86_64')
url="https://github.com/drakkan/${pkgname}"
license=('GPL3')
depends=('glibc')
-makedepends=('gcc' 'git' 'go')
+makedepends=('gcc' 'git' 'go' 'gzip')
optdepends=(
"sqlite: to use SQLite provider"
"postgresql: to use PostgreSQL provider"
@@ -20,21 +20,30 @@ backup=("etc/${pkgname}/sftpgo.json")
install=${pkgname}.install
source=("git+https://github.com/drakkan/${pkgname}#tag=v${pkgver}"
- "sftpgo.json")
+ "sftpgo.json"
+ "sftpgo.sysusers")
sha256sums=('SKIP'
- 'fb4dc558c4dcba5e9d9ce9716653439b11d34f468599609cc4b8e79692ef8417')
+ 'f969c0ca4d52e55de3a9823d8fbede2726c1b33feae54a2baa712a0496ceefc7'
+ '44658210043f805057c2e4b473653637a91204e4da17954b08081292c72edcb8')
+
+_uid_sftpgo=315
+_gid_sftpgo=315
build() {
cd "${pkgname}"
- go build -i -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date --utc +%FT%TZ`" -o sftpgo
+ go build -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date --utc +%FT%TZ`" -o sftpgo
+ ./sftpgo gen completion bash > sftpgo-completion.bash
+ ./sftpgo gen man -d man1
+ gzip man1/*
}
package() {
cd "${pkgname}"
install -Dm 755 sftpgo "$pkgdir/usr/bin/${pkgname}"
- install -Dm 755 examples/rest-api-cli/sftpgo_api_cli.py "${pkgdir}"/usr/bin/sftpgo_api_cli
+ install -Dm 755 examples/rest-api-cli/sftpgo_api_cli "${pkgdir}"/usr/bin/sftpgo_api_cli
install -Dm 644 init/${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system"
- install -Dm 644 "$srcdir/sftpgo.json" -t "${pkgdir}/etc/${pkgname}"
+ install -dm750 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "${pkgdir}/etc/${pkgname}"
+ install -Dm 640 -o ${_uid_sftpgo} -g ${_gid_sftpgo} "$srcdir/sftpgo.json" -t "${pkgdir}/etc/${pkgname}"
install -d "${pkgdir}/var/lib/${pkgname}"
install -d "${pkgdir}/usr/share/${pkgname}"
cp -r templates "${pkgdir}/usr/share/${pkgname}/"
@@ -44,6 +53,10 @@ package() {
echo "" >> "${pkgdir}"/usr/share/doc/${pkgname}/README
echo "https://github.com/drakkan/sftpgo/blob/v${pkgver}/README.md" >> "${pkgdir}"/usr/share/doc/${pkgname}/README
install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
+ install -Dm 644 sftpgo-completion.bash "${pkgdir}/usr/share/bash-completion/completions/sftpgo"
+ install -d "${pkgdir}/usr/share/man"
+ cp -r man1 "${pkgdir}/usr/share/man/"
+ install -Dm 644 "$srcdir/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
}
# vim:set ts=2 sw=2 et:
diff --git a/sftpgo.install b/sftpgo.install
index b9c4e4c290e5..7b07b717ccbc 100644
--- a/sftpgo.install
+++ b/sftpgo.install
@@ -1,10 +1,23 @@
-#!/bin/sh
+pre_remove() {
+ systemctl stop sftpgo.service
+ cat <<EOF
+==> Leftover files may reside in /var/lib/sftpgo and /etc/sftpgo
+==> If you remove them, you may also want to remove user and
+==> group 'sftpgo'
+EOF
+}
-post_install() {
- echo ":: You need to initialize a data provider prior to starting the service."
- echo " This can be done using the initprovider command, for example:"
- echo ""
- echo " sftpgo initprovider"
- echo ""
- echo " take a look at sftpgo initprovider --help for more options"
+post_upgrade() {
+ if (( $(vercmp $2 1.0.0-4) < 0 )); then
+ chown -R 315:315 /etc/sftpgo /var/lib/sftpgo
+ chmod 750 /etc/sftpgo /var/lib/sftpgo
+ chmod 640 /etc/sftpgo/sftpgo.json
+ cat <<EOF
+==> After this update SFTPGo will run using the dedicated "sftpgo"
+==> system user, you will probably need to manually fix the
+==> permissions for the SFTPGo virtual users home directory using
+==>
+==> chown -R sftpgo:sftpgo </path/to/sftpgo/home/dir>
+EOF
+fi
}
diff --git a/sftpgo.json b/sftpgo.json
index 1b8679cb6f71..bff9dcc2f67f 100644
--- a/sftpgo.json
+++ b/sftpgo.json
@@ -1,23 +1,27 @@
{
- "sftpd": {
- "bind_port": 2022,
- "bind_address": "",
+ "common": {
"idle_timeout": 15,
- "max_auth_tries": 0,
- "umask": "0022",
- "banner": "",
"upload_mode": 0,
"actions": {
"execute_on": [],
"hook": ""
},
+ "setstat_mode": 0,
+ "proxy_protocol": 0,
+ "proxy_allowed": [],
+ "post_connect_hook": ""
+ },
+ "sftpd": {
+ "bind_port": 2022,
+ "bind_address": "",
+ "max_auth_tries": 0,
+ "banner": "",
"host_keys": [],
"kex_algorithms": [],
"ciphers": [],
"macs": [],
"trusted_user_ca_keys": [],
"login_banner_file": "",
- "setstat_mode": 0,
"enabled_ssh_commands": [
"md5sum",
"sha1sum",
@@ -26,8 +30,42 @@
"scp"
],
"keyboard_interactive_auth_hook": "",
- "proxy_protocol": 0,
- "proxy_allowed": []
+ "password_authentication": true
+ },
+ "ftpd": {
+ "bind_port": 0,
+ "bind_address": "",
+ "banner": "",
+ "banner_file": "",
+ "active_transfers_port_non_20": false,
+ "force_passive_ip": "",
+ "passive_port_range": {
+ "start": 50000,
+ "end": 50100
+ },
+ "certificate_file": "",
+ "certificate_key_file": "",
+ "tls_mode": 0
+ },
+ "webdavd": {
+ "bind_port": 0,
+ "bind_address": "",
+ "certificate_file": "",
+ "certificate_key_file": "",
+ "cors": {
+ "enabled": false,
+ "allowed_origins": [],
+ "allowed_methods": [],
+ "allowed_headers": [],
+ "exposed_headers": [],
+ "allow_credentials": false,
+ "max_age": 0
+ },
+ "cache": {
+ "enabled": true,
+ "expiration_time": 0,
+ "max_size": 50
+ }
},
"data_provider": {
"driver": "sqlite",
@@ -42,7 +80,7 @@
"manage_users": 1,
"track_quota": 2,
"pool_size": 0,
- "users_base_dir": "",
+ "users_base_dir": "/var/lib/sftpgo/users",
"actions": {
"execute_on": [],
"hook": ""
@@ -50,7 +88,19 @@
"external_auth_hook": "",
"external_auth_scope": 0,
"credentials_path": "/var/lib/sftpgo/credentials",
- "pre_login_hook": ""
+ "pre_login_hook": "",
+ "post_login_hook": "",
+ "post_login_scope": 0,
+ "check_password_hook": "",
+ "check_password_scope": 0,
+ "password_hashing": {
+ "argon2_options": {
+ "memory": 65536,
+ "iterations": 1,
+ "parallelism": 2
+ }
+ },
+ "update_mode": 0
},
"httpd": {
"bind_port": 8080,
diff --git a/sftpgo.sysusers b/sftpgo.sysusers
new file mode 100644
index 000000000000..a552b58ce5f5
--- /dev/null
+++ b/sftpgo.sysusers
@@ -0,0 +1 @@
+u sftpgo 315 "SFTPGo user" /var/lib/sftpgo