Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
slapos
Commits
892ee511
Commit
892ee511
authored
May 24, 2013
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apache-frontend: Fix various bugs and add unforgivable line
parent
0f066115
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
software/apache-frontend/apache-yakari.cfg.in
software/apache-frontend/apache-yakari.cfg.in
+5
-2
software/apache-frontend/default-virtualhost.conf.in
software/apache-frontend/default-virtualhost.conf.in
+9
-5
software/apache-frontend/instance.cfg
software/apache-frontend/instance.cfg
+4
-4
No files found.
software/apache-frontend/apache-yakari.cfg.in
View file @
892ee511
{% set cached_server_dict = {} -%}
{% set cached_server_dict = {} -%}
{% set part_list = [] -%}
{% set part_list = [] -%}
{% set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
{% set generic_instance_parameter_dict = {'cache_access': cache_access,} -%}
{% set generic_instance_parameter_dict = {'cache_access': cache_access,} -%}
[jinja2-template-base]
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
...
@@ -28,10 +29,12 @@ context =
...
@@ -28,10 +29,12 @@ context =
{% set access_log = '/'.join([apache_log_directory, '%s_access_log' % slave_reference]) -%}
{% set access_log = '/'.join([apache_log_directory, '%s_access_log' % slave_reference]) -%}
{% set error_log = '/'.join([apache_log_directory, '%s_error_log' % slave_reference]) -%}
{% set error_log = '/'.join([apache_log_directory, '%s_error_log' % slave_reference]) -%}
# The slave use cache
# The slave use cache
{% if 'enable_cache' in slave_instance -%}
# Next line is forbidden and people who copy it will be hanged short
{% set enable_cache = ('' ~ slave_instance.get('enable_cache', '')).lower() in TRUE_VALUES -%}
{% if enable_cache -%}
{% do cached_server_dict.__setitem__(slave_instance.get('domain'), slave_instance.get('url')) -%}
{% do cached_server_dict.__setitem__(slave_instance.get('domain'), slave_instance.get('url')) -%}
{% endif -%}
{% do slave_instance.__setitem__('url', cache_access) -%}
{% do slave_instance.__setitem__('url', cache_access) -%}
{% endif -%}
{% do part_list.append(slave_section_title) -%}
{% do part_list.append(slave_section_title) -%}
# Set up slave configuration file
# Set up slave configuration file
[{{ slave_section_title }}]
[{{ slave_section_title }}]
...
...
software/apache-frontend/default-virtualhost.conf.in
View file @
892ee511
{% set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
<VirtualHost *:{{ http_port }}>
<VirtualHost *:{{ http_port }}>
ServerName {{ slave_parameter.get('domain'
, ''
) }}
ServerName {{ slave_parameter.get('domain') }}
ServerAlias {{ slave_parameter.get('domain'
, ''
) }}
ServerAlias {{ slave_parameter.get('domain') }}
SSLEngine on
SSLEngine on
SSLProxyEngine on
SSLProxyEngine on
# Rewrite part
# Rewrite part
...
@@ -25,12 +26,13 @@
...
@@ -25,12 +26,13 @@
{% endif -%}
{% endif -%}
# If nothing exist : put a nice error
# If nothing exist : put a nice error
# ErrorDocument 404 /notfound.html
# ErrorDocument 404 /notfound.html
# Dadiboom
</VirtualHost>
</VirtualHost>
<VirtualHost *:{{ https_port }}>
<VirtualHost *:{{ https_port }}>
ServerName {{ slave_parameter.get('domain'
, ''
) }}
ServerName {{ slave_parameter.get('domain') }}
ServerAlias {{ slave_parameter.get('domain'
, ''
) }}
ServerAlias {{ slave_parameter.get('domain') }}
SSLProxyEngine on
SSLProxyEngine on
# Rewrite part
# Rewrite part
ProxyVia On
ProxyVia On
...
@@ -47,7 +49,9 @@
...
@@ -47,7 +49,9 @@
# Remove "Secure" from cookies, as backend may be https
# Remove "Secure" from cookies, as backend may be https
Header edit Set-Cookie "(?i)^(.+);secure$" "$1"
Header edit Set-Cookie "(?i)^(.+);secure$" "$1"
{% if 'https-only' in slave_parameter -%}
# Next line is forbidden and people who copy it will be hanged short
{% set https_only = ('' ~ slave_parameter.get('https-only', '')).lower() in TRUE_VALUES -%}
{% if https_only in slave_parameter -%}
# Not using HTTPS? Ask that guy over there.
# Not using HTTPS? Ask that guy over there.
# Dummy redirection to https. Note: will work only if https listens
# Dummy redirection to https. Note: will work only if https listens
# on standard port (443).
# on standard port (443).
...
...
software/apache-frontend/instance.cfg
View file @
892ee511
...
@@ -65,7 +65,7 @@ custom-group = $${dynamic-custom-group-template-slave-list:rendered}
...
@@ -65,7 +65,7 @@ custom-group = $${dynamic-custom-group-template-slave-list:rendered}
[instance-parameter]
[instance-parameter]
# Fetches parameters defined in SlapOS Master for this instance.
# Fetches parameters defined in SlapOS Master for this instance.
# Always the same.
# Always the same.
recipe = slapos.cookbook:slapconfiguration
recipe = slapos.cookbook:slapconfiguration
.serialised
computer = $${slap_connection:computer_id}
computer = $${slap_connection:computer_id}
partition = $${slap_connection:partition_id}
partition = $${slap_connection:partition_id}
url = $${slap_connection:server_url}
url = $${slap_connection:server_url}
...
@@ -106,7 +106,7 @@ extra-context =
...
@@ -106,7 +106,7 @@ extra-context =
[dynamic-custom-personal-template-slave-list]
[dynamic-custom-personal-template-slave-list]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-slave-list:target}
template = ${template-slave-list:target}
filename = instance-slave-list.cfg
filename =
custom-personal-
instance-slave-list.cfg
extensions = jinja2.ext.do
extensions = jinja2.ext.do
extra-context =
extra-context =
key apache_configuration_directory apache-directory:slave-configuration
key apache_configuration_directory apache-directory:slave-configuration
...
@@ -125,7 +125,7 @@ extra-context =
...
@@ -125,7 +125,7 @@ extra-context =
[dynamic-custom-group-template-slave-list]
[dynamic-custom-group-template-slave-list]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-custom-slave-list:target}
template = ${template-custom-slave-list:target}
filename = instance-slave-list.cfg
filename =
custom-group-
instance-slave-list.cfg
extensions = jinja2.ext.do
extensions = jinja2.ext.do
extra-context =
extra-context =
key apache_configuration_directory apache-directory:slave-configuration
key apache_configuration_directory apache-directory:slave-configuration
...
@@ -145,7 +145,7 @@ extra-context =
...
@@ -145,7 +145,7 @@ extra-context =
[dynamic-default-template-slave-list]
[dynamic-default-template-slave-list]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-custom-slave-list:target}
template = ${template-custom-slave-list:target}
filename = instance-slave-list.cfg
filename =
default-
instance-slave-list.cfg
extensions = jinja2.ext.do
extensions = jinja2.ext.do
extra-context =
extra-context =
key apache_configuration_directory apache-directory:slave-configuration
key apache_configuration_directory apache-directory:slave-configuration
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment