16d2c8d8c1
Since we already introduced apache server for redfish, it will be a good idea to use it for sharing iso also. These changes add file-exchanger config that can be used to share iso. In addition apache allows the specified users (see rbac config) to upload files. This may help in future to better emulate deployment environment, where it will be necessary to do this step after airshipctl generated iso and before airshipctl invokes redfish to run that iso. Change-Id: Ice47fe977fb71cf9df14d39c5ac26e365e2006f2
54 lines
2.0 KiB
Django/Jinja
54 lines
2.0 KiB
Django/Jinja
{% from 'macroses.j2' import render_rbac as render_rbac %}
|
|
|
|
<IfModule mod_ssl.c>
|
|
{% if file_exchanger_https_port != 443 %}
|
|
Listen {{ file_exchanger_https_port }}
|
|
{% endif %}
|
|
<VirtualHost {{ file_exchanger_ip | default(['*']) | ipwrap | map('regex_replace', '(.*)', '\\1:{}'.format(file_exchanger_https_port)) | list | join(' ') }}>
|
|
# Add machine's IP address (use ifconfig command)
|
|
{% if file_exchanger_user is defined and file_exchanger_user != None %}
|
|
<Directory /var/www/file_exchanger_cgi-bin/>
|
|
AuthType Basic
|
|
AuthName "Authorised cgi-bin"
|
|
AuthUserFile /etc/apache2/sites-available/{{ file_exchanger_name }}.htpasswd
|
|
{% if file_exchanger_group is defined and file_exchanger_group != None %}
|
|
AuthGroupFile /etc/apache2/sites-available/{{ file_exchanger_name }}.htaccess
|
|
{% endif %}
|
|
{% if file_exchanger_rbac is defined and file_exchanger_rbac != None %}
|
|
{{ render_rbac(file_exchanger_rbac) }}
|
|
{% else %}
|
|
Require valid-user
|
|
{% endif %}
|
|
</Directory>
|
|
ScriptAlias /cgi-bin /var/www/file_exchanger_cgi-bin/
|
|
{% endif %}
|
|
|
|
# Give an alias to to start your website url with
|
|
DocumentRoot "{{ file_exchanger_path }}"
|
|
<Location />
|
|
Options Indexes FollowSymLinks
|
|
AllowOverride None
|
|
{% if file_exchanger_user is defined and file_exchanger_user != None %}
|
|
AuthType Basic
|
|
AuthName "Authentication Required"
|
|
AuthUserFile /etc/apache2/sites-available/{{ file_exchanger_name }}.htpasswd
|
|
{% if file_exchanger_group is defined and file_exchanger_group != None %}
|
|
AuthGroupFile /etc/apache2/sites-available/{{ file_exchanger_name }}.htaccess
|
|
{% endif %}
|
|
{% if file_exchanger_rbac is defined and file_exchanger_rbac != None %}
|
|
{{ render_rbac(file_exchanger_rbac) }}
|
|
{% else %}
|
|
Require valid-user
|
|
{% endif %}
|
|
Script PUT /cgi-bin/put
|
|
{% else %}
|
|
Require all granted
|
|
{% endif %}
|
|
</Location>
|
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
LogLevel warn
|
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
</VirtualHost>
|
|
</IfModule>
|
|
|