No description
Find a file
Christoph Haas 07be9eadcc Remove the temporary show=libs inspection view
The libs-section blacklist is confirmed safe; the review view has
served its purpose.
2026-08-23 14:13:53 +02:00
.forgejo/workflows Add manual Forgejo action to promote :latest → :prod 2026-05-28 00:33:26 +02:00
.github ffs 2026-02-05 00:36:19 +01:00
.idea remove x-sendfile for local development 2026-02-03 00:01:58 +01:00
.kamal Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00
app Remove the temporary show=libs inspection view 2026-08-23 14:13:53 +02:00
bin Switch from yarn to bun 2026-05-21 22:26:22 +02:00
config Remove lograge configuration from Docker image and production 2026-08-22 22:08:05 +02:00
db Add semantic package search via pgvector embeddings 2026-08-22 22:07:56 +02:00
doc add explanation for x-sendfile 2025-06-16 00:25:02 +02:00
lib Blacklist the libs section from package imports 2026-08-23 11:03:05 +02:00
log Blank rails 4.0 project started 2013-07-27 00:19:29 +02:00
public rails 8.0.2 to 8.1. lograte for logging. 2026-02-25 00:09:25 +01:00
test Remove the temporary show=libs inspection view 2026-08-23 14:13:53 +02:00
vendor/javascript Moved from Fancybox to Photoswipe for click-to-zoom 2025-05-08 01:10:03 +02:00
.dockerignore trying to stop invalidating the docker build cache when I work on woodpecker.yml 2026-02-08 13:23:07 +01:00
.env.development fixed webhook URL for stage 2026-02-26 20:23:27 +01:00
.env.example Add .env.example template for required environment variables 2026-02-26 01:42:15 +01:00
.env.production Set up git-crypt to encrypt .env files 2026-02-26 01:45:03 +01:00
.gitattributes Set up git-crypt to encrypt .env files 2026-02-26 01:45:03 +01:00
.gitignore ignore test files 2026-03-01 22:11:38 +01:00
.gitlab-ci.yml speed up build with cache 2025-06-06 23:19:59 +02:00
.node-version Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00
.rubocop.yml no ugly reformatting of if-unless 2025-06-18 01:36:37 +02:00
.ruby-version Ruby and Gem updates 2025-02-03 01:08:20 +01:00
.tool-versions Upgrade Ruby from 3.2.4 to 3.4.7 2026-05-21 22:58:42 +02:00
.woodpecker.yml ffs 2026-02-08 19:47:06 +01:00
AGENTS.md Switch from yarn to bun 2026-05-21 22:26:22 +02:00
app.json Removed rake db:schema:load from predeploy. Need to find better way. 2024-07-21 12:48:00 +02:00
bun.lock Update dependencies: bump Ruby gems, JS packages, remove unused jquery/webpack 2026-05-27 21:45:41 +02:00
config.ru General Rails and Ruby updates 2021-05-28 21:07:45 +02:00
dns moved to coolify1 2025-06-16 00:24:34 +02:00
docker-compose.yml dummy smtp server added 2025-05-19 00:21:03 +02:00
Dockerfile Remove lograge configuration from Docker image and production 2026-08-22 22:08:05 +02:00
Gemfile Expose which search strategy produced each result 2026-08-23 10:39:50 +02:00
Gemfile.lock Expose which search strategy produced each result 2026-08-23 10:39:50 +02:00
Guardfile Enable screen clearing in Guard 2018-08-14 15:00:52 +02:00
LICENSE GPL3 license added 2018-08-08 17:02:03 +02:00
Makefile Add Makefile for building and deploying container images 2026-02-26 01:40:19 +01:00
nginx.conf.sigil Reflecting Shrine path change in nginx config template 2021-02-13 23:15:25 +01:00
package.json Update dependencies: bump Ruby gems, JS packages, remove unused jquery/webpack 2026-05-27 21:45:41 +02:00
postcss.config.js Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00
Procfile Trivial change to trigger re-deployment 2021-04-27 00:20:24 +02:00
Procfile.dev move shrine files out of public. use x-sendfile to send files for security. 2025-06-16 00:24:11 +02:00
Rakefile Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00
README.md Document search result sources and show_sources param 2026-08-23 10:51:37 +02:00
sql Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00
webpack.config.js Massive revamping for Rails 8 and Zurb 2025-03-16 00:44:43 +01:00

About debshots

Debshots is a web application written in Ruby-on-Rails that powers the screenshots.debian.net web site. Many services like packages.debian.net, Ubuntu Software or Synaptic rely on it.

State of the application

The code you find here resembles the version that is deployed to screenshots.debian.net. It has been refactored in 06/2024 to Rails 7. If you find strange or changed behavior please open an issue at https://salsa.debian.org/debian/debshots/-/issues

Development

Check out the doc/README.Development.md

The package search combines several strategies, tried in this order:

  1. Exact package name: Searching for vim shows exactly this package without calling any external service.
  2. Name prefix matches: Packages whose name starts with the query rank first, e.g. searching for sqlite promotes sqlite3, sqlitebrowser and friends above all other results.
  3. Compound word splitting: Packages whose name contains all query tokens match too, so sqlite browser finds sqlitebrowser.
  4. Semantic search: The query is embedded via the vector service (all-MiniLM-L6-v2, 384 dimensions) and the nearest neighbors among the package description embeddings are returned, using the pgvector extension with an HNSW cosine index. Embeddings are computed from the package description and long description and can be (re-)built with bin/rails debshots:compute_vectors.
  5. Full-text fallback: If the vector service cannot be reached, classic PostgreSQL full-text search takes over.

Queries that share no vocabulary with the package data (gibberish, keyboard mash) return an honest empty result instead of random semantic matches.

Why is this package in my results? Each result knows which search strategy produced it. The controller exposes this as @search_sources (a hash mapping package ids to :exact, :name_prefix, :name_contains, :semantic or :fulltext). For debugging you can render a small badge on every result card by adding show_sources=1 to the URL, e.g. https://screenshots.debian.net/packages?search=sqlite&show_sources=1.

Package pages also show semantically related packages, computed as a nearest neighbor query against the package's own description embedding - no external service call involved.

Deployment

Read the doc/README.Installation.md