diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 41d7565..b266b3d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base
end
def check_public_access
- require_user unless APP_CONFIG[:public]
+ require_user unless ENV['public'] == 'true'
end
def current_user_session
diff --git a/app/models/album.rb b/app/models/album.rb
index 9dd0e3f..285a27f 100644
--- a/app/models/album.rb
+++ b/app/models/album.rb
@@ -92,13 +92,13 @@ class Album < ActiveRecord::Base
private
def create_folders
- Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) unless File.exists?( APP_CONFIG[:photos_path] + self.path )
- Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) unless File.exists?( APP_CONFIG[:thumbs_path] + self.path )
+ #Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) unless File.exists?( APP_CONFIG[:photos_path] + self.path )
+ #Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) unless File.exists?( APP_CONFIG[:thumbs_path] + self.path )
end
def destroy_folders
#puts "DELETE DIRECTORY " + APP_CONFIG[:photos_path] + self.path
- Dir.delete( APP_CONFIG[:photos_path] + self.path ) if File.exists?( APP_CONFIG[:photos_path] + self.path )
- Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if File.exists?( APP_CONFIG[:thumbs_path] + self.path )
+ #Dir.delete( APP_CONFIG[:photos_path] + self.path ) if File.exists?( APP_CONFIG[:photos_path] + self.path )
+ #Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if File.exists?( APP_CONFIG[:thumbs_path] + self.path )
end
end
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index 2390eed..d0a1066 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -8,8 +8,11 @@ class FileUploader < CarrierWave::Uploader::Base
# Choose what kind of storage to use for this uploader
#storage :file
- storage :s3
-
+ if ENV['S3_KEY']
+ storage :s3
+ else
+ storage :file
+ end
# Override the directory where uploaded files will be stored
# This is a sensible default for uploaders that are meant to be mounted:
diff --git a/app/views/albums/_form.html.erb b/app/views/albums/_form.html.erb
index 28df6ff..bf83b9b 100644
--- a/app/views/albums/_form.html.erb
+++ b/app/views/albums/_form.html.erb
@@ -27,7 +27,4 @@
<%= form.text_field :tags, { :autocomplete => "off", :class => 'tag_list', :value => (@album.tags.map{|tag|tag.title}.join(" ") unless @album.tags.nil?) } %>
-<% if @album.path? %>
-Location on disk: <%= APP_CONFIG[:photos_path] + @album.path %>
-Contains: <%= @album.photos.count %> photos
-<% end %>
\ No newline at end of file
+Contains: <%= @album.photos.count %> photos
\ No newline at end of file
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index b995820..70439fd 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -3,7 +3,7 @@