Should there be a simpler method of addressing a show? #131

Open
opened 2023-06-21 20:59:38 +00:00 by davmo · 8 comments
Owner

There are times when it's useful to go straight to a show. You know the number but you don't have a link to click to get to it.

You can:

  • Type the URL https://hackerpublicradio.org/eps/hpr1234/, however you're a pretty bad typist or have accessibility issues

  • Find the latest show on the home page, click on its link and edit it. However, browsers don't make this easy - they "helpfully" select the entire line when you want to replace a few numbers in it, or they auto-complete part of it because you went to a similar link earlier.

Perhaps a simple entry widget could be presented, maybe in the form of:

https://hackerpublicradio.org/eps/hpr____/index.html
(where the underscores denote a gap)

Then all you have to do is enter the number in the gap?

There are times when it's useful to go straight to a show. You know the number but you don't have a link to click to get to it. You can: * Type the URL https://hackerpublicradio.org/eps/hpr1234/, however you're a pretty bad typist or have accessibility issues * Find the latest show on the *home* page, click on its link and edit it. However, browsers don't make this easy - they "helpfully" select the entire line when you want to replace a few numbers in it, or they auto-complete part of it because you went to a similar link earlier. Perhaps a simple entry widget could be presented, maybe in the form of: `https://hackerpublicradio.org/eps/hpr____/index.html` (where the underscores denote a gap) Then all you have to do is enter the number in the gap?
Owner

Yes good idea but the widget would imply javascript, which we are trying to avoid.

How about a redirect that if we get a number in the url we go to the episode page ?

So the link https://hackerpublicradio.org/1234, would go to L https://hackerpublicradio.org/eps/hpr1234/

Yes good idea but the widget would imply javascript, which we are trying to avoid. How about a redirect that if we get a number in the url we go to the episode page ? So the link https://hackerpublicradio.org/1234, would go to L https://hackerpublicradio.org/eps/hpr1234/
Contributor

It looks like we should be able to do this with a mod_rewrite rule:

RewriteRule ^([0-9]+)/?$ /eps/hpr$1 [L,R=301]

It looks like we should be able to do this with a `mod_rewrite` rule: ```RewriteRule ^([0-9]+)/?$ /eps/hpr$1 [L,R=301]```
Author
Owner

It looks like we should be able to do this with a mod_rewrite rule:

RewriteRule ^([0-9]+)/?$ /eps/hpr$1 [L,R=301]

This looks like a great idea.

[Aside: I'm getting email updates from Gitea now, where this has been broken for me for a while!]

> It looks like we should be able to do this with a `mod_rewrite` rule: > > ```RewriteRule ^([0-9]+)/?$ /eps/hpr$1 [L,R=301]``` This looks like a great idea. [Aside: I'm getting email updates from Gitea now, where this has been broken for me for a while!]
Owner

We want to avoid RewriteRules, and have as much as possible generated statically. The goal is for anyone to be able to rsync the site and navigate using file://path/to/hpr/site/eps/hpr____/index.html and have everything just work.

The hub will be the only place where we can be sure that we are running php/apache. In this case the text should be a form "jump to episode", "hpr|twat" in dropdown, then a form to a php redirect on the hub site.

We want to avoid RewriteRules, and have as much as possible generated statically. The goal is for anyone to be able to rsync the site and navigate using `file://path/to/hpr/site/eps/hpr____/index.html` and have everything just work. The hub will be the only place where we can be sure that we are running php/apache. In this case the text should be a form "jump to episode", "hpr|twat" in dropdown, then a form to a php redirect on the hub site.
Contributor

I'd love to know more about that -- the goal of keeping everything able to be run from a local file system would seem to be quite limiting in what it allows us to do? Is there a lot of call for that kind of thing? I didn't even realize it was an option.

I'd love to know more about that -- the goal of keeping everything able to be run from a local file system would seem to be quite limiting in what it allows us to do? Is there a lot of call for that kind of thing? I didn't even realize it was an option.
Owner

To protect against ddos and add redundancy, most companies use geo dispersed data centers and content delivery networks.

We however are in the fairly unique situation that everything except the server credentials belong to the community. At a very basic level, you should be able to rsync the entire site and serve it off a local hotspot. Similar to https://en.wikipedia.org/wiki/World_Possible

We can however build our own CDN using the old "mirror my site" philosophy of the early Internet. High Speed fiber connections are becoming normal now in certain regions, so we can have the community offer a HPR Mirror, that we can add to dns/geo resolver to provide local access.

The only thing we can't do (as yet) is the reserving a slot etc. but if we suffer a DDOS that takes down the site for days (which has happened) of if we loose access to the HPR Domain (which has also happened) we can just decide as a community to promote another server to master and continue operating until the issues have been fixed.

This is why we support the MSQL and SQLite. The goal is to allow people to do complex queries locally. My feeling is that we can run the entire site off SQL checked into git and dumped into a SQLite database to generate the static pages. But we have more to do to get there.

So general rule of thumb, we move as much as possible to the static site. Static pages are also safer, smaller, faster, and cheaper.

To protect against ddos and add redundancy, most companies use geo dispersed data centers and content delivery networks. We however are in the fairly unique situation that everything except the server credentials belong to the community. At a very basic level, you should be able to rsync the entire site and serve it off a local hotspot. Similar to https://en.wikipedia.org/wiki/World_Possible We can however build our own CDN using the old "mirror my site" philosophy of the early Internet. High Speed fiber connections are becoming normal now in certain regions, so we can have the community offer a HPR Mirror, that we can add to dns/geo resolver to provide local access. The only thing we can't do (as yet) is the reserving a slot etc. but if we suffer a DDOS that takes down the site for days (which has happened) of if we loose access to the HPR Domain (which has also happened) we can just decide as a community to promote another server to master and continue operating until the issues have been fixed. This is why we support the MSQL and SQLite. The goal is to allow people to do complex queries locally. My feeling is that we can run the entire site off SQL checked into git and dumped into a SQLite database to generate the static pages. But we have more to do to get there. So general rule of thumb, we move as much as possible to the static site. Static pages are also safer, smaller, faster, and cheaper.
Contributor

I can understand getting away from the server-side processing of a language like PHP in favour of static site for the scenario above, but presumably if we're going to be using a 'cdn' mode, then we would still be running it on a web server of some description.

We've made extensive use of mod-rewrite already. Are we planning to get rid of all those rules too?

I can understand getting away from the server-side processing of a language like PHP in favour of static site for the scenario above, but presumably if we're going to be using a 'cdn' mode, then we would still be running it on a web server of some description. We've made extensive use of mod-rewrite already. Are we planning to get rid of all those rules too?
Owner

You are correct that we are making extensive use of mod-rewrite. However it it doing so to aid the migration of old dynamic links to new static ones. At some point when the linking indexes are updated and the calls are no longer coming in, those rewrite rules will be removed.

As far as the Community Centric Content Delivery Network (C3DN) is concerned, you are relying on whoever is hosting it to provide the technology. You cannot assume that mod rewrite will be available. Nor can you assume that the person hosting it is at the stage where they are comfortable working with rewrite rules. I've been working for ISP's for years, and I am reluctant to mess with Rewrite rules on production sites, due to their less than obvious way of working.

So rule of thumb, if it's currently dynamic - then it needs to be added to the static generator.
If it can't be static, then do we need it. If so then host it on the hpr hub server, but keep thinking of a way to make it part of the C3DN

However think of the opportunities when everything is static. I would hope that the Hacker Community would use all sort of eccentric hardware and software to host it. And send us in a (a series) of shows(s) about it.

You are correct that we are making extensive use of mod-rewrite. However it it doing so to aid the migration of old dynamic links to new static ones. At some point when the linking indexes are updated and the calls are no longer coming in, those rewrite rules will be removed. As far as the Community Centric Content Delivery Network (C3DN) is concerned, you are relying on whoever is hosting it to provide the technology. You cannot assume that mod rewrite will be available. Nor can you assume that the person hosting it is at the stage where they are comfortable working with rewrite rules. I've been working for ISP's for years, and I am reluctant to mess with Rewrite rules on production sites, due to their less than obvious way of working. So rule of thumb, if it's currently dynamic - then it needs to be added to the static generator. If it can't be static, then do we need it. If so then host it on the hpr hub server, but keep thinking of a way to make it part of the C3DN However think of the opportunities when everything is static. I would hope that the Hacker Community would use all sort of eccentric hardware and software to host it. And send us in a (a series) of shows(s) about it.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HPR/hpr_generator#131
No description provided.