forked from diaspora/diaspora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get rid of early pathname requirement * Use require_relative where approciate * Drop unused files * Imported new application.rb, environment.rb and environments/* from fresh Rails app * Cleaned up boot.rb * Load config in boot.rb * Deduplicate environments/integration*.rb * Move username blacklist into defaults.yml * Ruby 1.9 Hash syntax everywhere * Reorganize lib/diaspora/markdownify to match conventions * Get rid of full path requires where possible * Add dummy content to production section diaspora.yml.example to prevent warning * Drop sqlite? method * Move postgres? method into ConfigurationMethods * Drop token authentication from User
- Loading branch information
Showing
40 changed files
with
257 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
# Copyright (c) 2010-2011, Diaspora Inc. This file is | ||
# licensed under the Affero General Public License version 3 or later. See | ||
# the COPYRIGHT file. | ||
|
||
require 'pathname' | ||
require 'rubygems' | ||
|
||
# Set up gems listed in the Gemfile. | ||
gemfile = Pathname.new(__FILE__).dirname.join('..').expand_path.join('Gemfile') | ||
begin | ||
ENV['BUNDLE_GEMFILE'] = gemfile.to_s | ||
require 'bundler' | ||
Bundler.setup | ||
rescue Bundler::GemNotFound => e | ||
STDERR.puts e.message | ||
STDERR.puts "Try running `bundle install`." | ||
exit! | ||
end if File.exist?(gemfile) | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) | ||
|
||
# Ensure Builder is loaded | ||
require 'active_support/builder' unless defined?(Builder) | ||
|
||
# Load configuration early | ||
require_relative 'load_config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,5 @@ | ||
# Copyright (c) 2010-2011, Diaspora Inc. This file is | ||
# licensed under the Affero General Public License version 3 or later. See | ||
# the COPYRIGHT file. | ||
|
||
# check what database you have | ||
def postgres? | ||
@using_postgres ||= defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) | ||
end | ||
|
||
def sqlite? | ||
@using_sqlite ||= defined?(ActiveRecord::ConnectionAdapters::SQLite3Adapter) && ActiveRecord::Base.connection.class == ActiveRecord::ConnectionAdapters::SQLite3Adapter | ||
end | ||
|
||
# Load the rails application | ||
require Pathname.new(__FILE__).dirname.expand_path.join('application') | ||
|
||
# Load configuration system early | ||
require Rails.root.join('config', 'load_config') | ||
|
||
Haml::Template.options[:format] = :html5 | ||
Haml::Template.options[:escape_html] = true | ||
|
||
# Blacklist of usernames | ||
USERNAME_BLACKLIST = ['admin', 'administrator', 'hostmaster', 'info', 'postmaster', 'root', 'ssladmin', | ||
'ssladministrator', 'sslwebmaster', 'sysadmin', 'webmaster', 'support', 'contact', 'example_user1dsioaioedfhgoiesajdigtoearogjaidofgjo'] | ||
require_relative 'application' | ||
|
||
# Initialize the rails application | ||
Diaspora::Application.initialize! | ||
|
||
# allow token auth only for posting activitystream photos | ||
module Devise | ||
module Strategies | ||
class TokenAuthenticatable < Authenticatable | ||
private | ||
def valid_params_request? | ||
params[:controller] == "activity_streams/photos" && params[:action] == "create" | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
# Ensure Builder is loaded | ||
require 'active_support/builder' unless defined?(Builder) |
Oops, something went wrong.