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

Test use of GitHub-hosted map file and model files #27

Open
follower opened this issue Jan 11, 2017 · 9 comments
Open

Test use of GitHub-hosted map file and model files #27

follower opened this issue Jan 11, 2017 · 9 comments

Comments

@follower
Copy link
Contributor

No description provided.

@dave5
Copy link
Contributor

dave5 commented Jan 14, 2017

a cursory search indicates that github pages will work ok for serving up static JSON

@follower
Copy link
Contributor Author

Approaches to referencing GitHub-based files (tested with .stl files):

GitHub Raw

Requires no configuration. Probably not an "endorsed" use--although that may be a historical issue.

RawGit

https://rawgit.com/

Note: 3rd Party service not run by GitHub.

  • Non-CDN appears to just redirect (thinks it's a binary file?). e.g. http://rawgit.com/Omniblox/pcb-component-models/f7e9fd80446ec4771459ea92b55462a94e02a411/models/sparkfun/production_parts/passive/resistors/0603/LED-0603.stl (Only intended for development and not production use.)
  • CDN appears to retrieve & serve correctly. e.g. http://cdn.rawgit.com/Omniblox/pcb-component-models/f7e9fd80446ec4771459ea92b55462a94e02a411/models/sparkfun/production_parts/passive/resistors/0603/LED-0603.stl. Content type given as application/vnd.ms-pki.stl.

GitHub Pages

Requires one-off configuration to enable.

  • "GitHub graciously includes a wildcarded CORS header in the responses." via (But this now appears on GitHub Raw too.)
  • Can use master (or master/docs) in addition to gh-pages for source (via & via). This seems like a good thing as it means we don't need to replicate master to gh-pages but it does raise questions about how best to support versioning.

Summary

For quick-and-dirty use, one-off GitHub Raw URLs work but questions over legitimacy mean they're not really an option for ongoing use.

Recommend ongoing uses GitHub pages (ideally with some sort of versioning).

@follower
Copy link
Contributor Author

I've enabled GitHub pages with master as the source, for now (e.g. https://omniblox.github.io/pcb-component-models/components.json). Can be configured for use with:

viewComponents: true,                                                                                                                                                 
componentMapCfg: {mapUrl: "https://omniblox.github.io/pcb-component-models/components.json",                                                                          
                  urlPrefix: "https://omniblox.github.io/pcb-component-models/"}                                                                                      

We will probably regret not having versioning at some point. :)

It occurred to me we probably want to use a custom sub-domain of omniblox.com rather than github.io—this requires "Setting up a custom subdomain".

We would need the CNAME configured on the DNS side and then configured on GitHub (although they recommend the reverse order of operations).

@follower
Copy link
Contributor Author

follower commented Jan 23, 2017

Current status:

  • Need to add example using hosted files.
  • Need to decide on and configure a subdomain of omniblox.com if we want that. [via]

@dave5
Copy link
Contributor

dave5 commented Jan 24, 2017

i've pointed omniblox.parts at omniblox.github.io as a custom domain.

@follower
Copy link
Contributor Author

Lol, fancy, @ the TLD*. :)

Thanks for setting that up. I can confirm the following appear to work happily:

Now that we have the domain set up, I wonder if we want to change the default behaviour of the Eagle-Loader library to be to use the hosted version of the components.json and models? Do you have a preference?

Also, at some point we may wish to look at additionally hosting with HTTPS.

(* Did you also register the .party variation? After all, "...there ain't no party like an Omniblox party...")

@dave5
Copy link
Contributor

dave5 commented Jan 25, 2017

to save our future selves cursing our past selves into eternity... can you version the urls please? let's put this work on omniblox.parts/0/

@follower
Copy link
Contributor Author

Okay. :)

I was thinking we could have a non-versioned URL always be the latest and then a versioned URL if people need to stick to a particular version?

I just looked into GitHub Pages symlink support and this repository suggests that it might be possible to use symlinks: https://github.com/s4y/gh-pages-symlink-test

I'll try out the symlink approach and see if it works--unless you want to use only versioned URLs.

@dave5
Copy link
Contributor

dave5 commented Jan 26, 2017

i'd prefer versioned urls right now

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

No branches or pull requests

2 participants