Skip to content
Snippets Groups Projects
Commit b513424e authored by Florent Thiery's avatar Florent Thiery
Browse files

enable FTP over TLS, fixes #27817

parent 61ed1757
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import socket
import utils
......@@ -17,7 +17,7 @@ def setup(interactive=True):
raise Exception('Invalid user/pass definition, separator not present or too many detected')
# Run commands
cmds = [
'apt-get install --yes pure-ftpd python3-unidecode python3-mediaserver-mediaimport',
'apt-get install --yes pure-ftpd python3-unidecode python3-mediaserver-mediaimport openssl',
dict(line='adduser --disabled-login --gecos "" --shell /bin/false ftp', cond='id ftp', cond_neg=True, cond_skip=True),
'mkdir -p /usr/local/bin',
'cp "%s/mediaimport_create_ftp_user.sh" /usr/local/bin' % (dir_path),
......@@ -32,6 +32,8 @@ def setup(interactive=True):
'echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone',
'echo "yes" > /etc/pure-ftpd/conf/DontResolve',
'echo "no" > /etc/pure-ftpd/conf/PAMAuthentication',
'echo 1 > /etc/pure-ftpd/conf/TLS',
'openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem -subj "/C=FR/ST=NA/L=Paris/O=Ubicast/CN=%s"' % socket.gethostname(),
# Post upload script
'cp "%s/on_ftp_upload.py" /home/ftp/on_ftp_upload.py' % dir_path,
'chown ftp:ftp /home/ftp/on_ftp_upload.py',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment