Project

Profile

Help

Story #5378

closed

Index pages on content server

Added by jaymzh about 5 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

As a user, I would like to be able to use a browser to view the content served by a Distribution as if it was being served by static file server. The root of each directory should display a listing of that directory.

Solution

If a request is made to a directory in a distribution, the content app will return an html page with a list of all files in that directory and with each item being a hyperlink to the file's location. The list of files will be determined based on the published artifacts in the publication.

Alternatively, plugins can override (or customize) this behavior by creating index.html files. The content app will first check for these files before displaying an html directory listing.


Related issues

Related to Pulp - Story #5397: As a user, I can see an index page at :24816/<CONTENT_PREFIX>/CLOSED - CURRENTRELEASEdkliban@redhat.com

Actions
Related to Pulp - Story #5559: As a plugin writer, I cannot export my Publication to POSIX filesystemsCLOSED - CURRENTRELEASEdaviddavis

Actions
Actions #1

Updated by dkliban@redhat.com about 5 years ago

  • Tracker changed from Issue to Story
  • Description updated (diff)
  • % Done set to 0

This is 2 feature requests. I'm updating the description of this one and will open a separate story for the 'welcome page index'.

Actions #2

Updated by dkliban@redhat.com about 5 years ago

  • Related to Story #5397: As a user, I can see an index page at :24816/<CONTENT_PREFIX>/ added
Actions #3

Updated by daviddavis about 5 years ago

  • Sprint/Milestone set to 71
Actions #4

Updated by bmbouter about 5 years ago

  • Sprint/Milestone changed from 71 to 3.0.0
Actions #5

Updated by bmbouter about 5 years ago

  • Related to Story #5559: As a plugin writer, I cannot export my Publication to POSIX filesystems added
Actions #6

Updated by daviddavis about 5 years ago

  • Description updated (diff)
Actions #7

Updated by bmbouter about 5 years ago

This rewrite looks good. The only detail I expected differently was the ability to use

index
index.html
index.*

where the mimetype of Content-Type for the content being responded with would match the file extension of index. Alternatively we could accept this story as-is, only support index.html and ensure Content-Type: text/html; is set on the response.

@daviddavis should we accept the story as you've written and save ^ for followup work later?

Actions #8

Updated by daviddavis about 5 years ago

bmbouter do you have some examples of some use cases where plugins/users would use something other than text/html?

Actions #9

Updated by bmbouter about 5 years ago

I was imagining a static JSON blob API. Maybe like the PyPI one? https://warehouse.pypa.io/api-reference/json/

Still though a pre-generated json artifacts as content is a little far fetched so we should wait until someone is actually requesting it. I'm ok with only implementing index.html for now.

Actions #10

Updated by daviddavis about 5 years ago

+1, sounds good to me.

Actions #11

Updated by bmbouter about 5 years ago

We should consider using one of these libraries to easily generate a page with clickable links that looks decent.

https://wiki.python.org/moin/Templating#HTML_Generation_Packages

Actions #12

Updated by dkliban@redhat.com about 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

Added by dkliban@redhat.com about 5 years ago

Revision 3a2ad9b5 | View on GitHub

Return HTML listing of directories served by content app

This patch enables users to browse each distribution. However, the /pulp/content/ endpoint continues to return a 404.

When a user requests the 'base_url' of a Distribution or any path that ends in '/' inside the Distribution's 'base_url' path, the pulpcore-content app looks for either a PublishedArtifact or ContentArtifact with a relative path equal to 'index.html'. If no such relative path is found for the RepositoryVersion or Publication, an HTML page is dynamically generated and returned.

closes #5378 https://pulp.plan.io/issues/5378

Actions #13

Updated by dkliban@redhat.com about 5 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100
Actions #15

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF