Commit 2a4db54d authored by Jonne Haß's avatar Jonne Haß
Browse files

New configuration system

* Throw away old system
* Add new system
* Add new example files
* Replace all calls
* add the most important docs
* Add Specs
* rename disable_ssl_requirement to require_ssl
* cloudfiles isn't used/called in our code
* since community_spotlight.list is only used as enable flag replace it with such one and remove all legacy and irelevant codepaths around it
* die if session secret is unset and on heroku
* First basic infrastructure for version information
parent 5bea6309
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -4,13 +4,9 @@ app/assets/images/custom/*


# Configuration files
config/app_config.yml
config/app.yml
config/application.yml
config/diaspora.yml
config/heroku.yml
config/script_server*.yml
config/fb_config.yml
config/oauth_keys.yml
config/script_server.yml
config/initializers/secret_token.rb
config/redis.conf
config/deploy_config.yml

Changelog.md

0 → 100644
+24 −0
Original line number Diff line number Diff line
# 0.0.1.0pre

## New configuration system! 

Copy over config/diaspora.yml.example to config/diaspora.yml and migrate your settings! An updated Heroku guide including basic hints on howto migrate is [here](https://github.com/diaspora/diaspora/wiki/Installing-on-heroku).

The new configuration system allows all possible settings to be overriden by environment variables. This makes it possible to deploy heroku without checking any credentials into git. Read the top of `config/diaspora.yml.example` for an explanation on how to convert the setting names to environment variables.

### Environment variable changes:

#### deprectated

* REDISTOGO_URL in favour of REDIS_URL or ENVIRONMENT_REDIS

#### removed

*  application_yml - Obsolete, all settings are settable via environment variables now

#### renamed

* SINGLE_PROCESS_MODE -> ENVIRONMENT_SINGLE_PROCESS_MODE
* SINGLE_PROCESS -> ENVIRONMENT_SINGLE_PROCESS_MODE
* NO_SSL -> ENVIRONMENT_REQUIRE_SSL
* ASSET_HOST -> ENVIRONMENT_ASSETS_HOST
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ group :heroku do
  gem 'unicorn', '4.3.1', :require => false
end

gem 'settingslogic', :git => 'https://github.com/binarylogic/settingslogic.git'
# database

gem "activerecord-import", "0.2.11"
+0 −7
Original line number Diff line number Diff line
@@ -7,12 +7,6 @@ GIT
      activesupport (>= 2.3.0)
      nokogiri (>= 1.3.3)

GIT
  remote: https://github.com/binarylogic/settingslogic.git
  revision: 4884d455bf18d92723cb8190cfd2dbf87f3aafd5
  specs:
    settingslogic (2.0.8)

GIT
  remote: https://github.com/plataformatec/markerb.git
  revision: 93b1e8bea9b8fa89ef930f78ba562f596c022198
@@ -519,7 +513,6 @@ DEPENDENCIES
  ruby-oembed (= 0.8.7)
  sass-rails (= 3.2.5)
  selenium-webdriver (= 2.25.0)
  settingslogic!
  spork (= 1.0.0rc3)
  thin (= 1.4.1)
  timecop (= 0.5.1)
+8 −4
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base

  before_filter :ensure_http_referer_is_set
  before_filter :set_locale
  before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision])
  before_filter :set_diaspora_header
  before_filter :set_grammatical_gender
  before_filter :mobile_switch

@@ -61,9 +61,13 @@ class ApplicationController < ActionController::Base
    params[:page] = params[:page] ? params[:page].to_i : 1
  end

  def set_git_header
    headers['X-Git-Update'] = AppConfig[:git_update] if AppConfig[:git_update].present?
    headers['X-Git-Revision'] = AppConfig[:git_revision] if AppConfig[:git_revision].present?
  def set_diaspora_header
    headers['X-Diaspora-Version'] = AppConfig.version_string
    
    if AppConfig.git_available?
      headers['X-Git-Update'] = AppConfig.git_update if AppConfig.git_update.present?
      headers['X-Git-Revision'] = AppConfig.git_revision if AppConfig.git_revision.present?
    end
  end

  def set_locale
Loading