-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsftpplus-docker-entrypoint.sh
More file actions
28 lines (26 loc) · 1.05 KB
/
sftpplus-docker-entrypoint.sh
File metadata and controls
28 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if [ -z "$SFTPPLUS_CONFIGURATION" ] ; then
# Use default configuration directory.
SFTPPLUS_CONFIGURATION=/opt/sftpplus/configuration
fi
if [ -f "${SFTPPLUS_CONFIGURATION}/server.ini" ]; then
echo "Configuration directory already initialized."
else
echo "Initializing the configuration"
mkdir -p ${SFTPPLUS_CONFIGURATION}
cp /opt/sftpplus/configuration/server.ini.seed ${SFTPPLUS_CONFIGURATION}/server.ini
./bin/admin-commands.sh generate-self-signed \
--common-name=sftpplus-docker.example.com \
--key-size=2048 \
--sign-algorithm=sha256 \
> ${SFTPPLUS_CONFIGURATION}/ssl_certificate.pem
./bin/admin-commands.sh generate-ssh-key \
--key-file=${SFTPPLUS_CONFIGURATION}/ssh_host_rsa_key \
--key-type=rsa \
--key-size=2048
# Cleanup public key as we don't need it.
rm ${SFTPPLUS_CONFIGURATION}/ssh_host_rsa_key.pub
fi
echo "Starting using configuration from: $SFTPPLUS_CONFIGURATION"
cd ${SFTPPLUS_CONFIGURATION}/../
/opt/sftpplus/bin/admin-commands.sh start-in-foreground \
--config="$SFTPPLUS_CONFIGURATION/server.ini"