summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile3
-rw-r--r--INSTALL.md52
-rw-r--r--TROUBLESHOOT.md46
-rw-r--r--certs/app/models/client_certificate.rb3
-rw-r--r--certs/test/unit/client_certificate_test.rb12
-rw-r--r--config/defaults.yml3
6 files changed, 99 insertions, 20 deletions
diff --git a/Gemfile b/Gemfile
index 4bf0f3b..56cbf62 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,7 +13,8 @@ gem 'leap_web_help', :path => 'help'
# To use debugger
gem 'debugger', :platforms => :mri_19
-gem 'ruby-debug', :platforms => :mri_18
+# ruby 1.8 is not supported anymore
+# gem 'ruby-debug', :platforms => :mri_18
# unreleased so far ... but leap_web_certs need it
diff --git a/INSTALL.md b/INSTALL.md
index 9e93eb0..4a2a5b9 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,5 +1,23 @@
# Installation #
+Please see TROUBLESHOOT.md if you run into any issues during install.
+
+## TL;DR ##
+
+Install git, ruby 1.9, rubygems and couchdb on your system. Then run
+
+```
+gem install bundler
+git clone git://github.com/leapcode/leap_web.git
+cd leap_web
+bundle install
+git submodule init
+git submodule update
+bundle exec rails server
+```
+
+You will find Leap Web running on `localhost:3000`. Check out the Cert Distribution section below for setting up the cert and server config.
+
## Requirements ##
The webapp only depends on very basic ruby packages and installs the other requirements as gems through bundler.
@@ -9,17 +27,31 @@ The webapp only depends on very basic ruby packages and installs the other requi
The following packages need to be installed:
* git
-* ruby (1.8.7 and 1.9.3 work)
+* ruby1.9.3
* rubygems
* couchdb
+### Code ###
+
+Simply clone the git repository:
+
+```
+ git clone git://github.com/leapcode/leap_web.git
+ cd leap_web
+```
+
### Gems ###
-We install most gems we depend upon through [bundler](http://gembundler.com). However the bundler gem needs to be installed and the `bundle` command needs to be available to the user used for deploy.
+We install most gems we depend upon through [bundler](http://gembundler.com). First install bundler
-### Bundler ###
+```
+ gem install bundler
+```
-Run `bundle install` to install all the required gems.
+Then install all the required gems:
+```
+ bundle install
+```
## Setup ##
@@ -32,13 +64,15 @@ We currently use a git submodule to include srp-js. This will soon be replaced b
git submodule update
```
-### Cert Distribution ###
-
-The Webapp can hand out certs for the EIP client. These certs are either picked from a pool in CouchDB or from a file. For now you can either run [Leap CA](http://github.com/leapcode/leap_ca) to fill the pool or you can put your certs file in config/cert.
+### Provider Information ###
-We also ship provider information through the webapp. For now please add your eip-service.json to the public/config directory.
+The leap client fetches provider information via json files from the server.
+If you want to use that functionality please add your provider files the public/config directory.
## Running ##
-Run `rails server`, `bundle exec rails server` or whatever rack server you prefer.
+```
+bundle exec rails server
+```
+You'll find Leap Web running on `localhost:3000`
diff --git a/TROUBLESHOOT.md b/TROUBLESHOOT.md
new file mode 100644
index 0000000..f3db006
--- /dev/null
+++ b/TROUBLESHOOT.md
@@ -0,0 +1,46 @@
+# Troubleshooting #
+
+Here are some less common issues you might run into when installing Leap Web.
+
+## Cannot find Bundler ##
+
+### Error Messages ###
+
+`bundle: command not found`
+
+### Solution ###
+
+Make sure bundler is installed. `gem list bundler` should list `bundler`.
+You also need to be able to access the `bundler` executable in your PATH.
+
+## Outdated version of rubygems ##
+
+### Error Messages ###
+
+`bundler requires rubygems >= 1.3.6`
+
+### Solution ###
+
+`gem update --system` will install the latest rubygems
+
+## Missing development tools ##
+
+Some required gems will compile C extensions. They need a bunch of utils for this.
+
+### Error Messages ###
+
+`make: Command not found`
+
+### Solution ###
+
+Install the required tools. For linux the `build-essential` package provides most of them. For Mac OS you probably want the XCode Commandline tools.
+
+## Missing libraries and headers ##
+
+Some gem dependencies might not compile because they lack the needed c libraries.
+
+### Solution ###
+
+Install the libraries in question including their development files.
+
+
diff --git a/certs/app/models/client_certificate.rb b/certs/app/models/client_certificate.rb
index 1bc34c6..13e0318 100644
--- a/certs/app/models/client_certificate.rb
+++ b/certs/app/models/client_certificate.rb
@@ -66,8 +66,7 @@ class ClientCertificate
end
def common_name(for_free_cert = false)
- random_common_name +
- (for_free_cert ? APP_CONFIG[:free_cert_postfix] : '')
+ (for_free_cert ? APP_CONFIG[:free_cert_prefix] : '') + random_common_name
end
#
diff --git a/certs/test/unit/client_certificate_test.rb b/certs/test/unit/client_certificate_test.rb
index bcc61cc..abb5560 100644
--- a/certs/test/unit/client_certificate_test.rb
+++ b/certs/test/unit/client_certificate_test.rb
@@ -9,16 +9,16 @@ class ClientCertificateTest < ActiveSupport::TestCase
assert sample.to_s
end
- test "free cert has configured postfix" do
+ test "free cert has configured prefix" do
sample = ClientCertificate.new(free: true)
- postfix = APP_CONFIG[:free_cert_postfix]
- assert sample.cert.subject.common_name.include?(postfix)
+ prefix = APP_CONFIG[:free_cert_prefix]
+ assert sample.cert.subject.common_name.starts_with?(prefix)
end
- test "real cert has no free cert postfix" do
+ test "real cert has no free cert prefix" do
sample = ClientCertificate.new
- postfix = APP_CONFIG[:free_cert_postfix]
- assert !sample.cert.subject.common_name.include?(postfix)
+ prefix = APP_CONFIG[:free_cert_prefix]
+ assert !sample.cert.subject.common_name.starts_with?(prefix)
end
test "cert issuer matches ca subject" do
diff --git a/config/defaults.yml b/config/defaults.yml
index 54e4178..d0fb52f 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -8,7 +8,7 @@ cert_options: &cert_options
client_cert_bit_size: 2024
client_cert_hash: "SHA256"
free_certs_enabled: true
- free_cert_postfix: "*Free Cert*"
+ free_cert_prefix: "FREE"
development:
<<: *dev_ca
@@ -21,7 +21,6 @@ test:
<<: *cert_options
admins: [admin, admin2]
domain: test.me
-
production:
<<: *cert_options