From 79e2ed236bcdd32376101e97bf26b3b7720b0d8b Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 30 Aug 2011 10:11:53 -0400 Subject: [PATCH] added misc html files --- INSTALL.debian | 22 ++++++++++++++++++++-- config/deploy.rb | 24 +++++++++++++++++++++--- public/404.html | 6 +++++- public/422.html | 6 +++++- public/500.html | 6 +++++- public/503-redirect.html | 22 ++++++++++++++++++++++ public/503.html | 25 +++++++++++++++++++++++++ 7 files changed, 103 insertions(+), 8 deletions(-) create mode 100644 public/503-redirect.html create mode 100644 public/503.html diff --git a/INSTALL.debian b/INSTALL.debian index 8ee5e85cf..4e5a329f9 100644 --- a/INSTALL.debian +++ b/INSTALL.debian @@ -41,7 +41,7 @@ apt-get -y install build-essential automake openssl libssl-dev libyaml-dev libxm apt-get -y install python-software-properties add-apt-repository ppa:pitti/postgresql apt-get update -apt-get install -y postgresql-9.1 libpq-dev +apt-get install -y postgresql-9.1 postgresql-contrib-9.1 libpq-dev if [ $? -ne 0 ]; then exit 1 @@ -119,5 +119,23 @@ echo "* Enter a new password for the danbooru account *" echo "*************************************************" passwd danbooru +sudo -u danbooru createdb danbooru2 +cd /home/danbooru +sudo -u danbooru mkdir /home/danbooru/apps +git clone git://github.com/r888888888/danbooru.git danbooru +chown -R danbooru:danbooru danbooru +cap deploy:setup +cap deploy:update_code +cap deploy:migrate +chown danbooru:danbooru /var/www/danbooru/shared/log/development.log + echo -echo "I'm done!" +echo +echo "**************************************************************" +echo "* Danbooru has now been setup on this computer and should be *" +echo "* accessible from the web. Go ahead and create an account. *" +echo "* The first account will automatically be made an admin.You *" +echo "* can edit the configuration files by editing *" +echo "* /var/www/danbooru/shared/config/local_config and *" +echo "* /var/www/danbooru/shared/config/database.yml *" +echo "**************************************************************" diff --git a/config/deploy.rb b/config/deploy.rb index e0112eea2..fd1f13541 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -40,6 +40,21 @@ namespace :local_config do end end +namespace :data do + task :setup_directories do + run "mkdir -p #{deploy_to}/shared/data" + run "mkdir #{deploy_to}/shared/data/preview" + run "mkdir #{deploy_to}/shared/data/small" + run "mkdir #{deploy_to}/shared/data/large" + run "mkdir #{deploy_to}/shared/data/original" + end + + task :link_directories do + run "rm -f #{release_path}/public/data" + run "ln -s #{deploy_to}/shared/data #{release_path}/public/data" + end +end + desc "Change ownership of common directory to user" task :reset_ownership_of_common_directory do sudo "chown -R #{user}:#{user} /var/www/danbooru" @@ -49,12 +64,12 @@ namespace :deploy do namespace :web do desc "Present a maintenance page to visitors." task :disable do - run "mv #{current_path}/public/maintenance2.html #{current_path}/public/maintenance.html" + run "mv #{current_path}/public/maintenance.html.bak #{current_path}/public/maintenance.html" end desc "Makes the application web-accessible again." task :enable do - run "mv #{current_path}/public/maintenance.html #{current_path}/public/maintenance2.html" + run "mv #{current_path}/public/maintenance.html #{current_path}/public/maintenance.html.bak" end end end @@ -79,8 +94,11 @@ end after "deploy:setup", "reset_ownership_of_common_directory" after "deploy:setup", "local_config:setup_shared_directory" after "deploy:setup", "local_config:setup_local_files" +after "deploy:setup", "data:setup_directories" after "deploy:update_code", "local_config:link_local_files" +after "deploy:update_code", "data:link_directories" after "deploy:start", "delayed_job:start" after "deploy:stop", "delayed_job:stop" after "deploy:restart", "delayed_job:restart" - +before "deploy:update", "deploy:web:disable" +after "deploy:restart", "deploy:web:enable" diff --git a/public/404.html b/public/404.html index 9a48320a5..be5c82b42 100644 --- a/public/404.html +++ b/public/404.html @@ -2,7 +2,11 @@ The page you were looking for doesn't exist (404) -