From c1486cb9688d53c5ae266ff22ab279ead12eaa36 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 10 Apr 2014 12:45:21 +0200 Subject: move certs into toplevel cleaned up all the engine stuff that was never really used. Afterwards there is not that much left that makes it into the toplevel. --- config/defaults.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index cb18795..e7d0f5e 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -1,6 +1,6 @@ dev_ca: &dev_ca - client_ca_key: "./certs/test/files/ca.key" - client_ca_cert: "./certs/test/files/ca.crt" + client_ca_key: "./test/files/ca.key" + client_ca_cert: "./test/files/ca.crt" ca_key_password: nil cert_options: &cert_options -- cgit v1.2.3 From 614745c84cab37dd03f2bd8f06160fd01c7fabdb Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Apr 2014 12:06:38 +0200 Subject: UnauthenticatedUser as current_user this still allows us to do current_user.service_level. Have not gone through the rest of the code yet. Only made sure logged_in? now tests for is_a? User instead of !!current_user --- config/defaults.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index e7d0f5e..47c3ad7 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -67,6 +67,7 @@ service_levels: &service_levels USD: 10 EUR: 10 default_service_level: 1 + unauthenticated_service_level: 0 development: <<: *downloads -- cgit v1.2.3 From 7a9ece43bd61246b450471ed6bb1089570321e38 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Apr 2014 19:27:47 +0200 Subject: make use of the UnauthorizedUser Null Pattern for current_user - use it to get rid of some conditionals --- config/defaults.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index 47c3ad7..383aa1c 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -7,11 +7,6 @@ cert_options: &cert_options client_cert_lifespan: 2 client_cert_bit_size: 2024 client_cert_hash: "SHA256" - allow_limited_certs: false - allow_unlimited_certs: true - allow_anonymous_certs: false - limited_cert_prefix: "LIMITED" - unlimited_cert_prefix: "UNLIMITED" downloads: &downloads client_download_domain: https://dl.bitmask.net @@ -53,12 +48,17 @@ service_levels: &service_levels name: anonymous cert_prefix: "LIMITED" description: "anonymous account, with rate limited VPN" + services: + - eip 1: name: free cert_prefix: "LIMITED" description: "free account, with rate limited VPN" cost: 0 quota: 100 + services: + - eip + - email 2: name: premium cert_prefix: "UNLIMITED" @@ -66,6 +66,9 @@ service_levels: &service_levels cost: USD: 10 EUR: 10 + services: + - eip + - email default_service_level: 1 unauthenticated_service_level: 0 -- cgit v1.2.3 From 9216ab8252246a263c5d17f6755a7d3887145f94 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 18 Apr 2014 11:55:40 +0200 Subject: change service level configuration strategy The changes to the configuration required some non minor changes to the platform and also added some flexibility we don't require yet - and thus some new possibilities for errors. So instead we still use the allow_..._certs and ..._cert_prefix options. They basically provide the framework in which service levels can operate. The service level configuration will not include the cert prefix anymore. It only states if the service level is rate limited or not. This avoids conflicts between the two configuration options. I also removed the anonymous service level entirely. It was also turning a boolean decision (do we provide anonymous eip or not) into something way more complex. Instead I added the AnonymousServiceLevel class to handle the corner cases for people who are not logged in. Furthermore i renamed the UnauthenticatedUser to AnonymousUser so it matches the Anonymous Service Level nicely. It's also shorter and more intuitive. --- config/defaults.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index 383aa1c..a7b70a3 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -7,6 +7,11 @@ cert_options: &cert_options client_cert_lifespan: 2 client_cert_bit_size: 2024 client_cert_hash: "SHA256" + allow_limited_certs: false + allow_unlimited_certs: true + allow_anonymous_certs: false + limited_cert_prefix: "LIMITED" + unlimited_cert_prefix: "UNLIMITED" downloads: &downloads client_download_domain: https://dl.bitmask.net @@ -44,33 +49,19 @@ common: &common service_levels: &service_levels service_levels: - 0: - name: anonymous - cert_prefix: "LIMITED" - description: "anonymous account, with rate limited VPN" - services: - - eip 1: name: free - cert_prefix: "LIMITED" description: "free account, with rate limited VPN" cost: 0 + eip_rate_limit: true quota: 100 - services: - - eip - - email 2: name: premium - cert_prefix: "UNLIMITED" description: "premium account, with unlimited vpn" cost: USD: 10 EUR: 10 - services: - - eip - - email default_service_level: 1 - unauthenticated_service_level: 0 development: <<: *downloads -- cgit v1.2.3 From be81b7430e0a2046125be7c3a4b01b8725f4afe6 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 18 Apr 2014 12:51:18 +0200 Subject: adopt service_level config to platform settings cost -> rate quota -> storage --- config/defaults.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index a7b70a3..47cb641 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -52,13 +52,12 @@ service_levels: &service_levels 1: name: free description: "free account, with rate limited VPN" - cost: 0 eip_rate_limit: true - quota: 100 + storage: 100 2: name: premium description: "premium account, with unlimited vpn" - cost: + rate: USD: 10 EUR: 10 default_service_level: 1 -- cgit v1.2.3 From 0261e82686ec4fcfc8b633664fadb1dd6d9c8070 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 13 May 2014 10:52:55 +0200 Subject: keep empty email field if user removed prefill We should respect the users choice. We can still get their email from the user id if we really need to. --- config/defaults.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config/defaults.yml') diff --git a/config/defaults.yml b/config/defaults.yml index 47cb641..1c7e694 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -54,12 +54,17 @@ service_levels: &service_levels description: "free account, with rate limited VPN" eip_rate_limit: true storage: 100 + services: + - eip 2: name: premium description: "premium account, with unlimited vpn" rate: USD: 10 EUR: 10 + services: + - eip + - email default_service_level: 1 development: -- cgit v1.2.3