print("Bootstrap:")
start_port=2000
+ ftps_pasv_port_start=8000
+ ftps_pasv_port_num_of_ports=10
+
+ ftps_pasv_port_end=ftps_pasv_port_start + ftps_pasv_port_num_of_ports
+
for i in range(int(args.bootstrap)):
print("PNF simulator instance: " + str(i) + ".")
str(PortSftp) + " " + \
str(PortFtps) + " " + \
str(UrlFtps) + " " + \
- str(UrlSftp)
+ str(UrlSftp) + " " + \
+ str(ftps_pasv_port_start) + " " + \
+ str(ftps_pasv_port_end)
completed = subprocess.run(
'set -x; cd ' +
composercmd,
shell=True)
print('Cloning:', completed.stdout)
+
+ ftps_pasv_port_start += ftps_pasv_port_num_of_ports + 1
+ ftps_pasv_port_end += ftps_pasv_port_num_of_ports +1
completed = subprocess.run('set -x; cd pnf-sim-lightweight; ./simulator.sh build ', shell=True)
print("Build docker image: ", completed.stdout)
front-${I}:
ipv4_address: "${IPFTPS}"
ports:
- - "${PORTFTPS}:21"
+ - "${PORTFTPS}:21"
+ - "${FTPS_PASV_MIN}-${FTPS_PASV_MAX}:${FTPS_PASV_MIN}-${FTPS_PASV_MAX}"
environment:
FTP_USER: onap
FTP_PASSWORD: pano
PASV_ADDRESS: localhost
- PASV_MIN_PORT: 8001
- PASV_MAX_PORT: 8010
+ PASV_MIN_PORT: ${FTPS_PASV_MIN}
+ PASV_MAX_PORT: ${FTPS_PASV_MAX}
volumes:
- ./tls/ftp.crt:/etc/ssl/private/ftp.crt:ro
- ./tls/ftp.key:/etc/ssl/private/ftp.key:ro
case $COMMAND in
"compose")
- compose $2 $3 $4 $5 $6 $7 $8 $9 "${10}" "${11}" "${12}" ;;
- #IPGW, #IPSUBNET, #I, #URLVES, #IPPNFSIM, #IPFILESERVER, #TYPEFILESERVER, #PORTSFTP, #PORTFTPS, #IPFTPS, #IPSFTP
+ compose $2 $3 $4 $5 $6 $7 $8 $9 "${10}" "${11}" "${12}" "${13}" "${14}" ;;
+ #IPGW, #IPSUBNET, #I, #URLVES, #IPPNFSIM, #IPFILESERVER, #TYPEFILESERVER, #PORTSFTP, #PORTFTPS, #IPFTPS, #IPSFTP, #FTPS_PASV_MIN, #FTPS_PAST_MAX
"build")
build_image;;
"start")
function compose(){
#creating custom docker-compose based on IP arguments
#creting config.json by injecting the same IP
-
+
export IPGW=$1
export IPSUBNET=$2
export I=$3
export PORTFTPS=$9
export IPFTPS=${10}
export IPSFTP=${11}
+ export FTPS_PASV_MIN=${12}
+ export FTPS_PASV_MAX=${13}
LOCALTIME=$(ls -l /etc/localtime)
export TIMEZONE=${LOCALTIME//*zoneinfo\/}
./ROP_file_creator.sh $I &
- set_vsftpd_file_owner
-
write_config $URLVES $IPFILESERVER $TYPEFILESERVER $PORTSFTP $PORTFTPS $IPPNFSIM
+ cd config
+ envsubst < vsftpd_ssl-TEMPLATE.conf > vsftpd_ssl.conf
+ cd -
+
+ set_vsftpd_file_owner
+
}
function build_image(){