Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use same directory listing format as nginx #65

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Conversation

flakey5
Copy link
Member

@flakey5 flakey5 commented Nov 13, 2023

This PR adopts similar directory listing structure as NGINX to keep existing crawlers and scripts working.

@flakey5 flakey5 marked this pull request as ready for review November 14, 2023 00:57
@flakey5 flakey5 requested a review from a team as a code owner November 14, 2023 00:57
@jbergstroem
Copy link
Member

jbergstroem commented Nov 14, 2023

Is there a context to the "fix"? Is the html structure expected for parsing reasons?

Never mind, just saw the linked issue.

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nginx uses columns with fixed length:
50 chars for the file name
1 space
date
20 chars for the file size

The name is truncated if it's too long: https://direct.nodejs.org/download/test/
The size is written in bytes, without a unit

@ovflowd
Copy link
Member

ovflowd commented Nov 14, 2023

nginx uses columns with fixed length: 50 chars for the file name 1 space date 20 chars for the file size

The name is truncated if it's too long: direct.nodejs.org/download/test The size is written in bytes, without a unit

I'm not sure we should limit to 50 characters, I don't think this is an issue for us.

@ovflowd
Copy link
Member

ovflowd commented Nov 14, 2023

@flakey5 can you also add an screenshot on some directory listings how it'd look like?

@flakey5
Copy link
Member Author

flakey5 commented Nov 14, 2023

@flakey5 can you also add an screenshot on some directory listings how it'd look like?

image

I wasn't able to figure out how exactly we should do the spacing. We could do something similar to what nginx does re @targos 's comment, it should work

@ovflowd
Copy link
Member

ovflowd commented Nov 14, 2023

We can try it. Also would love if dark theme kept working.

@flakey5 flakey5 force-pushed the flakey5/citgm/1028 branch 4 times, most recently from 266c781 to d0d6a81 Compare November 15, 2023 05:19
@flakey5
Copy link
Member Author

flakey5 commented Nov 15, 2023

This should be good to go, the only difference between the nginx listing & the worker should be that directories don't have a value for the last modified part

image

Also would love if dark theme kept working.

Same but will probably need to be something we revisit

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what it looks like on staging.

src/handlers/strategies/directoryListing.ts Outdated Show resolved Hide resolved
@ovflowd
Copy link
Member

ovflowd commented Nov 15, 2023

How we deploy to staging? 🤔

@targos
Copy link
Member

targos commented Nov 15, 2023

Isn't it done automatically when the PR is merged on main? I see deploy workflow runs on each commit here: https://github.com/nodejs/release-cloudflare-worker/commits/main/

@ovflowd
Copy link
Member

ovflowd commented Nov 15, 2023

Isn't it done automatically when the PR is merged on main? I see deploy workflow runs on each commit here: main (commits)

Oh yes, it is :)

Co-authored-by: Michaël Zasso <targos@protonmail.com>
@flakey5
Copy link
Member Author

flakey5 commented Nov 15, 2023

Should I merge to test in staging?

@ovflowd ovflowd merged commit f17d133 into main Nov 15, 2023
3 checks passed
@ovflowd ovflowd deleted the flakey5/citgm/1028 branch November 15, 2023 18:12
@flakey5
Copy link
Member Author

flakey5 commented Nov 15, 2023

There still appears to be some differences

image

@ovflowd
Copy link
Member

ovflowd commented Nov 15, 2023

There still appears to be some differences

image

Ugh, it should give v20.0.9.0... I wonder what is different.

@richardlau
Copy link
Member

Quotes? (Single vs double)

@flakey5
Copy link
Member Author

flakey5 commented Nov 15, 2023

Quotes? (Single vs double)

Yeah that appears to be the issue, thanks for catching! #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants