Skip to content

Instantly share code, notes, and snippets.

@waltarix
Created February 9, 2012 08:30
Show Gist options
  • Save waltarix/1778459 to your computer and use it in GitHub Desktop.
Save waltarix/1778459 to your computer and use it in GitHub Desktop.
danbooru: for local
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..645da62
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,16 @@
+source 'http://rubygems.org'
+
+gem 'rails', '2.3.14'
+
+gem 'postgres'
+
+gem 'diff-lcs'
+gem 'html5'
+gem 'memcache-client'
+gem 'aws-s3'
+gem 'json'
+
+gem 'mechanize'
+gem 'net-sftp'
+
+gem 'daemons'
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..60bd274
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,75 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.14)
+ actionpack (= 2.3.14)
+ actionpack (2.3.14)
+ activesupport (= 2.3.14)
+ rack (~> 1.1.0)
+ activerecord (2.3.14)
+ activesupport (= 2.3.14)
+ activeresource (2.3.14)
+ activesupport (= 2.3.14)
+ activesupport (2.3.14)
+ aws-s3 (0.6.2)
+ builder
+ mime-types
+ xml-simple
+ builder (3.0.0)
+ chardet (0.9.0)
+ daemons (1.1.8)
+ diff-lcs (1.1.3)
+ domain_name (0.5.2)
+ unf (~> 0.0.3)
+ hoe (2.13.1)
+ rake (~> 0.8)
+ html5 (0.10.0)
+ chardet (>= 0.9.0)
+ hoe (>= 1.2.0)
+ json (1.6.5)
+ mechanize (2.1.1)
+ domain_name (~> 0.5, >= 0.5.1)
+ net-http-digest_auth (~> 1.1, >= 1.1.1)
+ net-http-persistent (~> 2.4, >= 2.4.1)
+ nokogiri (~> 1.4)
+ ntlm-http (~> 0.1, >= 0.1.1)
+ webrobots (~> 0.0, >= 0.0.9)
+ memcache-client (1.8.5)
+ mime-types (1.17.2)
+ net-http-digest_auth (1.2)
+ net-http-persistent (2.5)
+ net-sftp (2.0.5)
+ net-ssh (>= 2.0.9)
+ net-ssh (2.3.0)
+ nokogiri (1.5.0)
+ ntlm-http (0.1.1)
+ postgres (0.7.9.2008.01.28)
+ rack (1.1.3)
+ rails (2.3.14)
+ actionmailer (= 2.3.14)
+ actionpack (= 2.3.14)
+ activerecord (= 2.3.14)
+ activeresource (= 2.3.14)
+ activesupport (= 2.3.14)
+ rake (>= 0.8.3)
+ rake (0.9.2.2)
+ unf (0.0.4)
+ unf_ext
+ unf_ext (0.0.4)
+ webrobots (0.0.13)
+ xml-simple (1.1.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ aws-s3
+ daemons
+ diff-lcs
+ html5
+ json
+ mechanize
+ memcache-client
+ net-sftp
+ postgres
+ rails (= 2.3.14)
diff --git a/app/models/post_methods/file_methods.rb b/app/models/post_methods/file_methods.rb
index 095702d..19b35c5 100644
--- a/app/models/post_methods/file_methods.rb
+++ b/app/models/post_methods/file_methods.rb
@@ -13,7 +13,7 @@ module PostMethods
m.before_validation_on_create :generate_sample
m.before_validation_on_create :generate_preview
m.before_validation_on_create :move_file
- m.before_validation_on_create :distribute_file
+ #m.before_validation_on_create :distribute_file
end
def distribute_file
diff --git a/app/models/post_methods/image_store/local_flat.rb b/app/models/post_methods/image_store/local_flat.rb
index 4c01ae0..cb6715d 100644
--- a/app/models/post_methods/image_store/local_flat.rb
+++ b/app/models/post_methods/image_store/local_flat.rb
@@ -28,7 +28,7 @@ module PostMethods
end
def ssd_preview_url
- "/ssd/data/preview/#{md5}.jpg"
+ "/data/preview/#{md5}.jpg"
end
def sample_path
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 0000000..541f970
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,20 @@
+# Copy this to "database.yml" and adjust
+# the fields accordingly.
+
+development:
+ adapter: postgresql
+ database: danbooru
+ username: danbooru
+ host: 127.0.0.1
+
+test:
+ adapter: postgresql
+ database: danbooru_test
+ username: danbooru
+ host: 127.0.0.1
+
+production:
+ adapter: postgresql
+ database: danbooru
+ username: danbooru
+ host: 127.0.0.1
diff --git a/config/local_config.rb b/config/local_config.rb
new file mode 100644
index 0000000..c7e4140
--- /dev/null
+++ b/config/local_config.rb
@@ -0,0 +1,14 @@
+# This is the file you use to overwrite the default config values.
+# Look at default_config.rb and copy over any settings you want to change.
+
+# You MUST configure these settings for your own server!
+CONFIG["app_name"] = "DANBOORU"
+CONFIG["server_host"] = "localhost"
+CONFIG["admin_contact"] = "webmaster@" + CONFIG["server_host"]
+CONFIG["session_secret_key"] = "wasYvkgzevh3ddenw@cqsqEvylsy6j"
+
+#CONFIG["url_base"] = "http://" + CONFIG["server_host"] # set this to "" to get relative image urls
+CONFIG["url_base"] = ""
+
+# memcached
+CONFIG["memcache_servers"] = ["localhost:11211"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment