diff --git a/Gemfile b/Gemfile index be58c93..4b7e0dc 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,7 @@ end # gem 'capistrano', group: :development # Use debugger -# gem 'debugger', group: [:development, :test] +gem 'debugger', group: [:development, :test] # PostgreSQL support gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index cb09d29..9b96332 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,6 +72,12 @@ GEM jquery-cookie-rails jquery-rails debug_inspector (0.0.2) + debugger (1.6.8) + columnize (>= 0.3.1) + debugger-linecache (~> 1.2.0) + debugger-ruby_core_source (~> 1.3.5) + debugger-linecache (1.2.0) + debugger-ruby_core_source (1.3.8) erubis (2.7.0) execjs (2.5.2) fancybox2-rails (0.2.8) @@ -250,6 +256,7 @@ DEPENDENCIES bzip2-ruby! coffee-rails (~> 4.1.0) cookies_eu + debugger fancybox2-rails (~> 0.2.8) foundation-rails guard-minitest diff --git a/README.Developer b/README.Developer index 7a52854..6099c0f 100644 --- a/README.Developer +++ b/README.Developer @@ -82,4 +82,41 @@ properly unless the separate model validation is in place. Deployment ---------- -sudo apt-get install libyaml-dev libbz2-dev +To prepare your computer to run Debshots 2.x either for development +or production you need to… + +- unpack the project onto your disk somewhere +- install Ruby 2.0.0 via rvm (see http://rvm.io/) +- install the library header packages so that the required Ruby gems + can be compiled: + sudo apt-get install libbz2-dev libpq-dev libyaml-dev +- install a PostgreSQL database: + sudo apt-get install postgresql +- edit the PostgreSQL authentication configuration at + /etc/postgres/.../pg_hba.conf to allow password-based logins + from localhost. Change the line starting with *local* to read: + local all all md5 +- create a user and databases + - sudo su - postgres + - createuser -s -P debshots + - createdb debshots +- for development only: + - sudo su - postgres + - createdb debshots_dev +- migrate the data from the Debshots 1.x based production server: + - bin/get-data-from-old-live-server.sh +- install all Ruby gems required to run the application: + - gem install bundle + - bundler +- run database migrations for development + - RAILS_ENV=development rake db:migrate +- import long description information for the packages into development database + - RAILS_ENV=development rake debshots:update_longdescription_from_deb_repos +- run database migrations for production + - RAILS_ENV=production rake db:migrate +- RAILS_ENV=production rake debshots:update_longdescription_from_deb_repos + - import long description information for the packages into production database +- prepare the static assets (CSS, JS) for production + - RAILS_ENV=production rake assets:precompile +- run the production web server + - RAILS_ENV=production rails s diff --git a/app/assets/stylesheets/my.scss b/app/assets/stylesheets/my.scss index 48a41bb..b6d0658 100644 --- a/app/assets/stylesheets/my.scss +++ b/app/assets/stylesheets/my.scss @@ -151,7 +151,7 @@ html, body { img { - box-shadow: 0 0 10px 0px #888888; + filter: drop-shadow( 0px 0px 5px #888888 ); } } diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index a9b4c2c..5524ab0 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -42,7 +42,7 @@ class Screenshot < ActiveRecord::Base # Return Debshots 1.x path to allow migration of images into Paperclip filesystem schema def image_url(size) - '#{Rails.configuration.images_path_prefix}/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png' + "#{Rails.configuration.images_path_prefix}/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png" end diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 92a803f..91a2a73 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -15,6 +15,8 @@ html body // TODO: move topbar somewhere else than packages = render 'layouts/topbar' + #messages + = render 'layouts/messages' #content = yield = render 'layouts/footer' diff --git a/app/views/packages/details.slim b/app/views/packages/details.slim index 3f13948..fd3a756 100644 --- a/app/views/packages/details.slim +++ b/app/views/packages/details.slim @@ -19,13 +19,13 @@ onclick="return confirm('Really delete the screenshot?');" ] Delete screenshot - else - img src='/images/dummy/no-screenshots-available.svg' width='100%' + .row.listview + img src='/images/dummy/no-screenshots-available.svg' width='100%' // TODO: Enable comments in a later version // = partial '/package/comments' .small-5.medium-5.columns - = render 'layouts/messages' .bigpanel p.subtitle Details // TODO: split long_description by

tags diff --git a/app/views/welcome/about.slim b/app/views/welcome/about.slim index db7df42..cd8f8b4 100644 --- a/app/views/welcome/about.slim +++ b/app/views/welcome/about.slim @@ -101,8 +101,7 @@ p ' Whether you are a developer or not - we appreciate if you upload screenshots. ' See if your favorite package does not yet have a screenshot and - a href=upload_package_path upload one - ' . + ' upload one. h2 Statistics diff --git a/bin/get-data-from-old-live-server.sh b/bin/get-data-from-old-live-server.sh index 888b199..b01291d 100755 --- a/bin/get-data-from-old-live-server.sh +++ b/bin/get-data-from-old-live-server.sh @@ -15,13 +15,19 @@ rsync -v root@screenshots.debian.net:/home/debshots/debshots.sql /tmp echo Dropping existing database set +e psql -h $DB_HOST postgres debshots -c 'drop database debshots' +psql -h $DB_HOST postgres debshots -c 'drop database debshots_dev' +psql -h $DB_HOST postgres debshots -c 'drop database debshots_test' set -e echo Creating new database psql -h $DB_HOST postgres debshots -c 'create database debshots owner debshots' +psql -h $DB_HOST postgres debshots -c 'create database debshots_dev owner debshots' +psql -h $DB_HOST postgres debshots -c 'create database debshots_test owner debshots' echo Restoring PostgreSQL dump psql -h $DB_HOST debshots debshots < /tmp/debshots.sql +psql -h $DB_HOST debshots_dev debshots < /tmp/debshots.sql +psql -h $DB_HOST debshots_test debshots < /tmp/debshots.sql echo Unpacking screenshots tarball #cd ../public diff --git a/config/database.yml b/config/database.yml index 1e0e165..b335e6d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -9,8 +9,8 @@ development: adapter: postgresql database: debshots_dev username: debshots - password: GonwannEn0 - host: localhost + password: shootme + host: torf pool: 5 timeout: 5000 @@ -21,8 +21,8 @@ test: adapter: postgresql database: debshots_test username: debshots - password: GonwannEn0 - host: localhost + password: shootme + host: torf pool: 5 timeout: 5000