Unverified Commit db3b9bf3 authored by Alexander Kahl's avatar Alexander Kahl
Browse files

Initial commit

parents
Pipeline #1646 failed with stages
in 18 seconds
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
stages:
- build
- tag
before_script:
- docker login -u $DOCKER_USER -p "$DOCKER_PASSWORD"
build:
stage: build
variables:
REGISTRY_IMAGE: communicatio/ftp
script:
- docker pull $REGISTRY_IMAGE:latest || true
- docker build --cache-from $REGISTRY_IMAGE:latest --tag $REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $REGISTRY_IMAGE:latest . -f Dockerfile.httpd
- docker push $REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $REGISTRY_IMAGE:latest
tag:
stage: tag
variables:
REGISTRY_IMAGE: communicatio/ftp
script:
- docker pull $REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $REGISTRY_IMAGE:$CI_COMMIT_SHA $REGISTRY_IMAGE:production
- docker push $REGISTRY_IMAGE:production
only:
- master
FROM fedora:30
RUN dnf install -y vsftpd \
&& dnf clean all
VOLUME /srv/ftp
VOLUME /var/log/vsftpd
EXPOSE 20 21
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
ENV PASV_MIN_PORT 40000
ENV PASV_MAX_PORT 40100
ENV PASV_ADDRESS REQUIRED
RUN touch /etc/vsftpd/virtual
COPY docker/vsftpd.conf /etc/vsftpd/vsftpd.conf
COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint
COPY docker/pam.conf /etc/pam.d/vsftpd-virtual
version: '3.7'
services:
vsftpd:
build:
context: .
environment:
PASV_ADDRESS: 127.0.0.1
volumes:
- ./docker/users:/etc/vsftpd/virtual
version: '3.7'
services:
vsftpd:
image: communicatio/ftp:latest
networks: [ftp]
ports:
- "20:20"
- "21:21"
- "40000-40100:40000-40100"
volumes:
- ftp:/srv/ftp
volumes:
ftp:
external: true
networks:
ftp:
external: true
#!/usr/bin/env bash
set -e
if [ "$PASV_ADDRESS" = "REQUIRED" ]; then
echo "Please insert IPv4 address of your host"
exit 1
fi
cat >> /etc/vsftpd/vsftpd.conf <<EOF
pasv_address=${PASV_ADDRESS}
pasv_min_port=${PASV_MIN_PORT}
pasv_max_port=${PASV_MAX_PORT}
EOF
db_load -T -t hash -f /etc/vsftpd/virtual /etc/vsftpd/virtual.db
chown -R ftp: /srv/ftp /var/log/vsftpd
/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
#%PAM-1.0
auth required pam_userdb.so db=/etc/vsftpd/virtual
account required pam_userdb.so db=/etc/vsftpd/virtual
session required pam_loginuid.so
admin
admin
listen=YES
listen_ipv6=NO
background=NO
anonymous_enable=NO
local_enable=YES
guest_enable=YES
write_enable=YES
local_umask=022
virtual_use_local_privs=YES
dirmessage_enable=YES
use_localtime=YES
log_ftp_protocol=YES
vsftpd_log_file=/var/log/vsftpd/vsftpd.log
xferlog_enable=YES
xferlog_std_format=NO
chroot_local_user=YES
allow_writeable_chroot=YES
ls_recurse_enable=YES
pam_service_name=vsftpd-virtual
user_sub_token=$USER
local_root=/srv/ftp/$USER
port_enable=YES
connect_from_port_20=YES
ftp_data_port=20
pasv_enable=YES
pasv_addr_resolve=NO
version: '3.7'
services:
vsftpd:
deploy:
placement:
constraints: [node.role == manager]
environment:
PASV_ADDRESS:
logging:
driver: gelf
options:
gelf-address: udp://127.0.0.1:12201
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment