Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ensure configuration uses correct HTTP methods as per RFC 3253 #34

Merged
merged 2 commits into from

2 participants

@davidjb

These improvements to cherokee-admin follow the previous changes to the method handling for BASELINE_CONTROL/VERSION_CONTROL to BASELINE-CONTROL/VERSION-CONTROL respectively.

Includes a configuration upgrade path for any configuration that might have incorrect values.

(Also includes minor update to readme)

@skinkie skinkie merged commit d225bc6 into cherokee:master
@skinkie
Collaborator

Thanks David!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 24, 2012
  1. @davidjb

    Ensure configuration uses correct HTTP methods as per RFC 3253. Provi…

    davidjb authored
    …de configuration upgrade path.
Commits on Oct 3, 2012
  1. @davidjb
This page is out of date. Refresh to see the latest.
Showing with 43 additions and 2 deletions.
  1. +11 −0 README.rst
  2. +30 −0 admin/config_version.py
  3. +2 −2 admin/plugins/method.py
View
11 README.rst
@@ -192,3 +192,14 @@ How to create a self signed certificate for TLS
openssl req -days 1000 -new -x509 -nodes -out /etc/cherokee/ssl/cherokee.pem -keyout /etc/cherokee/ssl/cherokee.pem
+How to create a release .tar.gz
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+::
+ git clone --recursive http://github.com/cherokee/webserver.git
+ cd webserver
+ ./autogen.sh
+ make dist-gzip
+
+The resulting file will be created in the current directory and will be
+a ``.tar.gz`` archive.
View
30 admin/config_version.py
@@ -71,6 +71,32 @@ def upgrade_to_1_0_13 (cfg):
elif val == '0':
del(cfg[key])
+# Converts to 1.2.102
+METHODS_MAP = {'baseline_control': 'baseline-control',
+ 'version_control': 'version-control'
+ }
+def update_rules_methods(cfg, key, node):
+ if node.value == 'method':
+ method_key = '%s!method' % key
+ method_value = cfg.get_val(method_key)
+ # Check rule's method key value and replace if problematic
+ if method_value in METHODS_MAP:
+ cfg[method_key] = METHODS_MAP[method_value]
+ else:
+ for k in node.keys():
+ child_key = '%s!%s' % (key, k)
+ child_node = cfg[child_key]
+ update_rules_methods(cfg, child_key, child_node)
+
+def upgrade_to_1_2_102 (cfg):
+ # Update HTTP method specifications for those that were incorrect
+
+ for v in cfg.keys('vserver'):
+ for r in cfg.keys('vserver!%s!rule' % (v)):
+ # Traverse rules and look for HTTP method 'match' elements
+ rule_key = 'vserver!%s!rule!%s!match' % (v,r)
+ rule_node = cfg[rule_key]
+ update_rules_methods(cfg, rule_key, rule_node)
def config_version_get_current():
ver = configured.VERSION.split ('b')[0]
@@ -145,5 +171,9 @@ def config_version_update_cfg (cfg):
if ver_config_i < 1000013:
upgrade_to_1_0_13 (cfg)
+ # Update to.. 1.2.102
+ if ver_config_i < 1002102:
+ upgrade_to_1_2_102 (cfg)
+
cfg["config!version"] = ver_release_s
return True
View
4 admin/plugins/method.py
@@ -52,7 +52,7 @@
('unsubscribe', 'UNSUBSCRIBE'),
('report', 'REPORT'),
('patch', 'PATCH'),
- ('version_control', 'VERSION_CONTROL'),
+ ('version-control', 'VERSION-CONTROL'),
('checkout', 'CHECKOUT'),
('uncheckout', 'UNCHECKOUT'),
('checkin', 'CHECKIN'),
@@ -60,7 +60,7 @@
('label', 'LABEL'),
('mkworkspace', 'MKWORKSPACE'),
('mkactivity', 'MKACTIVITY'),
- ('baseline_control', 'BASELINE_CONTROL'),
+ ('baseline-control', 'BASELINE-CONTROL'),
('merge', 'MERGE')
]
Something went wrong with that request. Please try again.