Update golang dependencies (sftpgo and dockerize).

This commit is contained in:
Buster "Silver Eagle" Neece 2021-03-02 21:48:23 -06:00
parent 3d0d19c70d
commit 3b3785e19d
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
5 changed files with 68 additions and 41 deletions

View File

@ -1,6 +1,4 @@
#
# Base install step (done first for caching purposes).
#
FROM ubuntu:focal as base
ENV TZ="UTC"
@ -15,12 +13,6 @@ RUN chmod a+x /bd_build/*.sh \
&& /bd_build/cleanup.sh \
&& rm -rf /bd_build
# Install SFTPgo
COPY --from=azuracast/azuracast_golang_deps:latest /usr/local/bin/sftpgo /usr/local/bin/sftpgo
# Install Dockerize
COPY --from=azuracast/azuracast_golang_deps:latest /usr/local/bin/dockerize /usr/local/bin/dockerize
#
# START Operations as `azuracast` user
#

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
source /bd_build/buildconfig
set -x
DOCKERIZE_VERSION=v0.6.1
wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

View File

@ -3,9 +3,14 @@ set -e
source /bd_build/buildconfig
set -x
add-apt-repository -y ppa:sftpgo/sftpgo
apt-get update
$minimal_apt_get_install sftpgo
mkdir -p /var/azuracast/sftpgo/persist /var/azuracast/sftpgo/backups
cp /bd_build/sftpgo/sftpgo.json /var/azuracast/sftpgo/sftpgo.json
touch /var/azuracast/sftpgo/sftpgo.db
chown -R azuracast:azuracast /var/azuracast/sftpgo
chown -R azuracast:azuracast /var/azuracast/sftpgo

View File

@ -1,33 +1,46 @@
{
"sftpd": {
"bind_port": 2022,
"bind_address": "",
"idle_timeout": 15,
"max_auth_tries": 0,
"umask": "0022",
"banner": "",
"upload_mode": 1,
"actions": {
"execute_on": ["upload"],
"command": "/usr/local/bin/azuracast_sftp_upload"
"common": {
"idle_timeout": 15,
"upload_mode": 1,
"actions": {
"execute_on": [
"upload"
],
"hook": "/usr/local/bin/azuracast_sftp_upload"
}
},
"keys": [
{"private_key": "persist/id_rsa"}
],
"enable_scp": true
},
"data_provider": {
"driver": "bolt",
"name": "sftpgo.db",
"users_base_dir": "/var/azuracast/stations",
"external_auth_program": "/usr/local/bin/azuracast_sftp_auth",
"external_auth_scope": 0
},
"httpd": {
"bind_port": 0,
"bind_address": "",
"templates_path": "templates",
"static_files_path": "static",
"backups_path": "backups"
}
}
"sftpd": {
"bindings": [
{
"port": 2022,
"address": "",
"apply_proxy_config": true
}
],
"host_keys": [
"persist/id_rsa",
"persist/id_ecdsa",
"persist/id_ed25519"
],
"enable_scp": true
},
"httpd": {
"bindings": [
{
"port": 0
}
],
"templates_path": "/usr/share/sftpgo/templates",
"static_files_path": "/usr/share/sftpgo/static"
},
"telemetry": {
"bind_port": 0
},
"data_provider": {
"driver": "bolt",
"name": "sftpgo.db",
"users_base_dir": "/var/azuracast/stations",
"external_auth_hook": "/usr/local/bin/azuracast_sftp_auth",
"external_auth_scope": 0
}
}

View File

@ -4,4 +4,12 @@ if [[ ! -f /var/azuracast/sftpgo/persist/id_rsa ]]; then
ssh-keygen -t rsa -b 4096 -f /var/azuracast/sftpgo/persist/id_rsa -q -N ""
fi
chown -R azuracast:azuracast /var/azuracast/sftpgo/persist
if [[ ! -f /var/azuracast/sftpgo/persist/id_ecdsa ]]; then
ssh-keygen -t ecdsa -b 521 -f /var/azuracast/sftpgo/persist/id_ecdsa -q -N ""
fi
if [[ ! -f /var/azuracast/sftpgo/persist/id_ed25519 ]]; then
ssh-keygen -t ed25519 -f /var/azuracast/sftpgo/persist/id_ed25519 -q -N ""
fi
chown -R azuracast:azuracast /var/azuracast/sftpgo/persist