ocf / projects

Overview of technical OCF projects
3 stars 0 forks source link

Short link manager #64

Open RonitNath opened 3 years ago

RonitNath commented 3 years ago

You know what would be good? If we didn't have to constantly guess all of the ocf.io/ addresses. This should be a fairly easy introductory project, you just have to read the puppet file with the short links and spit that out somewhere accessible. Also add a page to our documentation.

s-truax commented 3 years ago

Would this be a page on the website that just tells you the corresponding long address for each ocf.io/ short address? Maybe something like

Short link translations

Short (ocf.io) Long
/gdrive https://drive.google.com/a/ocf.berkeley.edu
/hours https://ocf.io/lab#hours
ethanhs commented 3 years ago

Yes, that is pretty much it. Right now you can go to https://ocf.io/shorturl and it takes you to the puppet config. It would be nice if this was a nice autogenerated page on ocfweb that is based on what is in puppet, like you describe.

ethanhs commented 3 years ago

@s-truax do you want to work on this?

s-truax commented 3 years ago

@ethanhs I am interested in working on this, but I probably can't get something turned around until at least next weekend. I threw together an extremely short script to parse some of the raw .pp file with the extensions here. I was thinking the next step would be to auto-generate some HTML using the extracted short url declarations, but I haven't looked more into how to do that. I'm also down to work with anyone else who wants to do this, or if anyone feels they can get it turned around really quickly, then I won't mind if someone else takes care of it.

strellic commented 3 years ago

Hey, so I was bored and had an hour and a half before I had to go somewhere, so I decided to try and help make it. https://gist.github.com/strellic/8e55f273d8e8d9873d5a49fce1866546

It's just an HTML file that fetches shorturl.pp, then displays it in a table. It also tries to simplify some regexes, just to make it look nicer. Let me know if you want me to make any changes.

s-truax commented 3 years ago

Keeping everything in one html file seems a lot cleaner to me, nice!

ja5087 commented 3 years ago

For reference here is the shorturl.pp page

bryli commented 2 years ago

Just an update, I worked with @jefwei and @niapo and have submitted a pull request to create a page at ocf.berkeley.edu/test/shorturl that contains the short URL table. There is also a pull request on the puppet repo (https://github.com/ocf/puppet/pull/1150) that will change ocf.io/shorturl to link to the HTML table of short URLs, and ocf.io/shorturlpp will link to the puppet file instead.

Thanks @strellic!