No description
Find a file
2014-12-31 17:30:33 +01:00
.komodotools Added tidy commands for Komodo Edit IDE 2013-11-18 18:53:51 +01:00
app CSS style renamed 2014-12-31 17:30:25 +01:00
bin Fixed script that imports data from the current live server 2014-12-07 22:46:57 +01:00
config File upload route added 2014-12-31 17:30:33 +01:00
db Schema updated. (Reason unknown.) 2014-12-30 16:56:55 +01:00
lib Script tidied up 2014-12-07 22:49:37 +01:00
log Blank rails 4.0 project started 2013-07-27 00:19:29 +02:00
public Added placeholder image 2014-11-30 16:06:40 +01:00
test Added automatically generated tests. 2013-08-06 22:36:04 +02:00
vendor/assets Missing asset for jQuery plugins added 2014-11-23 19:54:36 +01:00
.gitignore Ignoring dynamically created assets 2014-12-07 22:51:16 +01:00
.project Aptana project file added 2013-11-16 23:53:17 +01:00
config.ru Blank rails 4.0 project started 2013-07-27 00:19:29 +02:00
debshots.komodoproject Komodo Edit project added 2013-11-13 23:23:39 +01:00
Gemfile Updated fancybox2 rails gem 2014-12-29 15:00:17 +01:00
Gemfile.lock Updated fancybox2 rails gem 2014-12-29 15:00:17 +01:00
Rakefile Blank rails 4.0 project started 2013-07-27 00:19:29 +02:00
README.Developer Search feature repaired 2014-11-30 23:20:26 +01:00
README.rdoc Minor reformatting. 2013-11-20 16:33:06 +01:00

== Installing debshots

TODO

== Supported URL paths (aka routes)

/screenshots/:package_inital/:package/:(id)_:size.png
* package = name of the package
* id = numerical ID of the screenshot
* size = "large" or "small"
* Returns a PNG image of a screenshot
* Should be served as a static asset

/image/:(id)_:size.png
* id = numerical ID of the screenshot
* size = "large" or "small"
* Returns a PNG image of a screenshot
* Usually used for unapproved images that should just be shown to the uploader

/about
* Return an informational HTML page

/packages
* Return a list of packages with pagination

/packages/with_screenshots
* Return a list of packages with pagination
* Select only those packages that have screenshots.

/packages/without_screenshots
* Return a list of packages with pagination
* Select only those packages that do not have screenshots.

/packages/games_without_screenshots (deprecated)
* Return a list of packages with pagination
* Select only those packages that belong to Debian's "games" section

/json/packages
* Return a JSON data structure of all packages

/json/screenshots
* Return a JSON data structure containing packages and screenshots

/json/packages-without-screenshots
* Return a JSON data structure of those packages that do not have any screenshots

/packages/moderate
* Return a HTML page showing packages that need moderation
* Must only be available to logged in moderators

/upload
* Return a HTML page containing an upload form for new screenshots

/guidelines (deprecated)
* Return a HTML page showing general guidelines for creating screenshots
* Should just redirect to the /upload page

/upload/:package
* ??

/uploadfile
* ??

/login
* Show a login form

/logout
* Logout the user by invalidating the cookie session.

/package/:package
* Show details of a certain package

/json/package/:package
* Return a JSON data structure containing details of a certain package

/thumbnail/:package
/thumbnail-404/:package (deprecated)
* Return a small (160x120 pixel) PNG screenshot file of a package
* If the package does not have any screenshots then return a 404 code

/thumbnail-with-version/:package/:version
* Return a small (160x120 pixel) PNG screenshot file of a package
* If the package does not have any screenshots then return a 404 code
* Prefer screenshots of a certain version

/screenshot/:package
/screenshot-404/:package (deprecated)
* Return a small (320x240 pixel) PNG screenshot file of a package
* If the package does not have any screenshots then return a 404 code

/screenshot-with-version/:package/:version
* Return a large (320x240 pixel) PNG screenshot file of a package
* If the package does not have any screenshots then return a 404 code
* Prefer screenshots of a certain version

/delete_screenshot/:screenshot
* Users: request deletion of a screenshot
* Moderators: delete a screenshot

/approve_screenshot/:screenshot
* Users: 403
* Moderators: approve a screenshot

/keep_screenshot/:screenshot
* Users: 403
* Moderators: re-approve a screenshot that was requested for deletion

/rss
* Return an RSS feed of new uploads of screenshots


== Using Xapian

Ruby gem "xapian" does not exist. Debian only has bindings for Ruby 1.9.x.
Xapian may be lightweight and nice but is too much hassle.



== Elasticsearch

= Install

Get it from https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.6.deb

Also: apt-get install openjdk-7-jre-headless

= Configure

Edit /etc/elasticsearch/elasticsearch.yml for single-server usage:
- cluster.name: ...
- node.name: ...
- index.number_of_shards: 1
- index.number_of_replicas: 0
- discovery.zen.ping.multicast.enabled: false

= Add useful plugins

/usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head
URL: serve:9200/_plugin/head

/usr/share/elasticsearch/bin/plugin -install lukas-vlcek/bigdesk
URL: serve:9200/_plugin/bigdesk

= Install River (that feeds PostgreSQL data into ElasticSearch):

Get the PostgreSQL ODBC driver from
wget http://jdbc.postgresql.org/download/postgresql-9.3-1100.jdbc41.jar
(according to http://jdbc.postgresql.org/download.html)

cp postgresql-9.3-1100.jdbc41.jar /usr/share/elasticsearch/plugins/river-jdbc

/usr/share/elasticsearch/bin/plugin -install river-jdbc -url http://bit.ly/1iovWV9
(according to https://github.com/jprante/elasticsearch-river-jdbc)

Fix permissions after plugin installation:
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/plugins

Restart Elasticsearch.

curl -XPUT 'localhost:9200/_river/debshots_jdbc_river/_meta' -d '{
     "type" : "jdbc",
     "jdbc" : {
         "driver" : "org.postgresql.Driver",
         "url" : "jdbc:postgresql://localhost:5432/debshots",
         "user" : "debshots",
         "password" : "shootme",
         "sql" : "select id as _id,name,description from packages",
         "strategy" : "simple",
         "poll" : "5m"
 },
     "index" : {
         "index" : "debshots",
         "type" : "jdbc"
     }
 }'

Should return:

{"ok":true,"_index":"_river","_type":"my_jdbc_river","_id":"_meta","_version":1}


TODO: Tire versus Rivers