Skip to content

Commit 6305e34

Browse files
committed
added proftpd role
1 parent 86375d4 commit 6305e34

File tree

5 files changed

+92
-11
lines changed

5 files changed

+92
-11
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@
3030
[submodule "galaxy/ansible/roles/galaxy-htcondor"]
3131
path = galaxy/ansible/roles/galaxy-htcondor
3232
url = https://github.com/usegalaxy-eu/ansible-htcondor-grycap
33+
34+
[submodule "galaxy/ansible/roles/galaxy-proftpd"]
35+
path = galaxy/ansible/roles/galaxy-proftpd
36+
url = https://github.com/galaxyproject/ansible-proftpd

galaxy/Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ RUN groupadd -r postgres -g $GALAXY_POSTGRES_GID \
9696
## && apt-get install postgresql-10 --no-install-recommends -y \
9797
&& apt-get install nginx-extras nginx-common --no-install-recommends -y \
9898
&& apt-get install docker-ce --no-install-recommends -y \
99-
&& apt-get install proftpd proftpd-mod-pgsql proftpd-mod-crypto --no-install-recommends -y \
10099
&& apt-get install nano --no-install-recommends -y \
101100
&& apt-get install git --no-install-recommends -y \
102101
&& apt-get install gridengine-common gridengine-drmaa1.0 --no-install-recommends -y \
@@ -174,7 +173,7 @@ ADD ansible/ /ansible/
174173

175174
# Install ansible and related dependencies
176175
RUN apt update -qq && apt install --no-install-recommends -y software-properties-common dirmngr gpg gpg-agent bsdmainutils \
177-
&& sudo add-apt-repository ppa:ansible/ansible \
176+
&& sudo add-apt-repository ppa:ansible/ansible-7 \
178177
&& apt install --no-install-recommends -y ansible \
179178
&& apt purge -y systemd && apt-get autoremove -y && apt-get clean
180179

@@ -207,11 +206,18 @@ RUN ansible-playbook /ansible/slurm_provision.yml \
207206

208207
# Install htcondor
209208
RUN ansible-playbook /ansible/htcondor_provision.yml \
209+
--extra-vars galaxy_user_name=$GALAXY_USER
210+
211+
# Install proftpd
212+
RUN ansible-playbook /ansible/proftpd_provision.yml \
210213
--extra-vars galaxy_user_name=$GALAXY_USER \
211-
&& apt purge -y systemd && apt-get autoremove -y && apt-get clean
214+
--extra-vars proftpd_sql_db=galaxy@galaxy \
215+
--extra-vars proftpd_sql_user=$GALAXY_USER \
216+
--extra-vars proftpd_sql_password=$GALAXY_USER \
217+
--extra-vars galaxy_ftp_upload_dir=$EXPORT_DIR/ftp
212218

213-
RUN mkdir -p /shed_tools $EXPORT_DIR/ftp/ \
214-
&& chown $GALAXY_USER:$GALAXY_USER /shed_tools $EXPORT_DIR/ftp \
219+
RUN mkdir -p /shed_tools \
220+
&& chown $GALAXY_USER:$GALAXY_USER /shed_tools \
215221
&& ln -s /tool_deps/ $EXPORT_DIR/tool_deps \
216222
# Configure Galaxy to use the Tool Shed
217223
&& chown $GALAXY_USER:$GALAXY_USER $EXPORT_DIR/tool_deps \
@@ -234,16 +240,14 @@ RUN mkdir -p /shed_tools $EXPORT_DIR/ftp/ \
234240
--extra-vars galaxy_extras_config_tusd=True \
235241
--extra-vars galaxy_extras_config_cvmfs=True \
236242
--extra-vars galaxy_extras_config_gravity=True \
237-
--extra-vars proftpd_db_connection=galaxy@galaxy \
238-
--extra-vars proftpd_files_dir=$EXPORT_DIR/ftp \
239-
--extra-vars proftpd_use_sftp=True \
240243
--extra-vars galaxy_extras_docker_legacy=False \
241244
--extra-vars supervisor_postgres_config_path=$PG_CONF_DIR_DEFAULT/postgresql.conf \
242245
--extra-vars supervisor_postgres_autostart=false \
243246
--extra-vars nginx_use_remote_header=True \
244247
--extra-vars tus_upload_store_path=$GALAXY_CONFIG_TUS_UPLOAD_STORE \
245248
--extra-vars gx_it_proxy_sessions_path=$GALAXY_CONFIG_INTERACTIVETOOLS_MAP \
246-
--tags=galaxyextras,cvmfs --skip-tags=tusd,flower,redis,slurm,condor -c local \
249+
--extra-vars use_pbkdf2=True \
250+
--tags=galaxyextras,cvmfs --skip-tags=tusd,flower,redis,slurm,condor,proftpd -c local \
247251
&& . $GALAXY_VIRTUAL_ENV/bin/activate \
248252
&& pip install WeasyPrint \
249253
&& deactivate \
@@ -288,7 +292,7 @@ ENV GALAXY_CONFIG_JOB_WORKING_DIRECTORY=$EXPORT_DIR/galaxy-central/database/job_
288292
GALAXY_CONFIG_CITATION_CACHE_DATA_DIR=$EXPORT_DIR/galaxy-central/database/citations/data \
289293
GALAXY_CONFIG_FTP_UPLOAD_DIR=$EXPORT_DIR/ftp \
290294
GALAXY_CONFIG_FTP_UPLOAD_SITE=galaxy.docker.org \
291-
GALAXY_CONFIG_USE_PBKDF2=False \
295+
GALAXY_CONFIG_USE_PBKDF2=True \
292296
GALAXY_CONFIG_NGINX_X_ACCEL_REDIRECT_BASE=/_x_accel_redirect \
293297
GALAXY_CONFIG_DYNAMIC_PROXY_MANAGE=False \
294298
GALAXY_CONFIG_VISUALIZATION_PLUGINS_DIRECTORY=config/plugins/visualizations \

galaxy/ansible/htcondor_provision.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
- 'DISCARD_SESSION_KEYRING_ON_STARTUP=False'
6969
- 'TRUST_UID_DOMAIN=true'
7070

71-
# Remove the init script
71+
# Remove the init script and systemd
7272
post_tasks:
7373
- name: Stop HTCondor service
7474
command: /etc/init.d/condor stop
@@ -80,3 +80,6 @@
8080

8181
- name: Remove HTCondor init script registration
8282
command: update-rc.d -f condor remove
83+
84+
- name: Purge systemd and perform cleanup
85+
shell: apt purge -y systemd && apt-get autoremove -y && apt-get clean

galaxy/ansible/proftpd_provision.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
- hosts: localhost
2+
connection: local
3+
remote_user: root
4+
vars:
5+
proftpd_galaxy_auth: yes
6+
galaxy_user:
7+
name: "{{ galaxy_user_name }}"
8+
proftpd_galaxy_modules:
9+
- mod_sql.c
10+
- mod_sql_passwd.c
11+
- mod_sql_postgres.c
12+
- mod_sftp.c
13+
- mod_sftp_pam.c
14+
- mod_sftp_sql.c
15+
proftpd_create_ftp_upload_dir: yes
16+
proftpd_options:
17+
- User: "{{ galaxy_user_name }}"
18+
- Group: "{{ galaxy_user_name }}"
19+
proftpd_global_options:
20+
- PassivePorts: 30000 40000
21+
proftpd_display_connect: |
22+
Public Galaxy FTP
23+
base_ssh_host_keys_dir: /etc/proftpd/ssh_host_keys
24+
proftpd_virtualhosts:
25+
- id: sftp
26+
address: 0.0.0.0
27+
options:
28+
- Port: 22
29+
- SFTPEngine: on
30+
- SFTPPAMEngine: off
31+
- CreateHome: on dirmode 700
32+
- SFTPHostKey: "{{ base_ssh_host_keys_dir}}/rsa"
33+
- SFTPHostKey: "{{ base_ssh_host_keys_dir }}/dsa"
34+
- SFTPCompression: delayed
35+
- SQLEngine: on
36+
- SQLPasswordEngine: on
37+
- SQLLogFile: /var/log/proftpd/sql.log
38+
- SQLBackend: postgres
39+
- SQLAuthenticate: users
40+
- SQLConnectInfo: "{{ proftpd_sql_db }} {{ proftpd_sql_user }} {{ proftpd_sql_password }}"
41+
- SQLAuthTypes: PBKDF2 SHA1
42+
- SQLPasswordPBKDF2: sql:/GetPBKDF2Params
43+
- SQLPasswordEncoding: base64
44+
- SQLUserInfo: custom:/LookupGalaxyUser
45+
- SQLPasswordUserSalt: sql:/GetUserSalt
46+
- SQLNamedQuery: GetPBKDF2Params SELECT "(CASE WHEN split_part(password, '$', 1) = 'PBKDF2' THEN UPPER(split_part(password, '$', 2)) ELSE 'SHA256' END), (CASE WHEN split_part(password, '$', 1) = 'PBKDF2' THEN split_part(password, '$', 3) ELSE '10000' END), 24 FROM galaxy_user WHERE email='%U'"
47+
- SQLNamedQuery: GetUserSalt SELECT "(CASE WHEN split_part(password, '$', 1) = 'PBKDF2' THEN split_part(password, '$', 4) END) FROM galaxy_user WHERE email='%U'"
48+
- SQLNamedQuery: LookupGalaxyUser SELECT "email, (CASE WHEN split_part(password, '$', 1) = 'PBKDF2' THEN split_part(password, '$', 5) ELSE encode(decode(password, 'hex'), 'base64') END),'{{ galaxy_user_name }}','{{ galaxy_user_name }}','{{ galaxy_ftp_upload_dir }}/%U','/bin/bash' FROM galaxy_user WHERE email='%U'"
49+
50+
# Required for sftp server
51+
pre_tasks:
52+
- name: Install OpenSSH client package
53+
apt: pkg=openssh-client
54+
55+
- name: Create ssh host keys directory
56+
file: path="{{ base_ssh_host_keys_dir }}" state=directory
57+
58+
- name: Generate new SSH keys (rsa)
59+
shell: ssh-keygen -b 2048 -t rsa -f "{{ base_ssh_host_keys_dir }}/rsa" -N ""
60+
args:
61+
creates: "{{ base_ssh_host_keys_dir }}/rsa"
62+
63+
- name: Generate new SSH keys (dsa)
64+
shell: ssh-keygen -b 1024 -t dsa -f "{{ base_ssh_host_keys_dir }}/dsa" -N ""
65+
args:
66+
creates: "{{ base_ssh_host_keys_dir }}/dsa"
67+
68+
roles:
69+
- role: galaxy-proftpd

galaxy/ansible/roles/galaxy-proftpd

Submodule galaxy-proftpd added at fa2aed8

0 commit comments

Comments
 (0)