Skip to main content
Topic: How to setup package servers in ElkArte? (Read 1755 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to setup package servers in ElkArte?

I tried to do it long time ago with SMF, but it never worked for me. Server was visible and I could look trough package list, but it wasn't possible to download anything.

Can someone make small description how to create working package server in ElkArte?

Re: How to setup package servers in ElkArte?

Reply #1

I think @Spuds is the one to chase for that info. :P

Re: How to setup package servers in ElkArte?

Reply #2

Do you mean,  download via the package manager in the Admin center? For me it works :)

Re: How to setup package servers in ElkArte?

Reply #3

yeah, but I want to create own server :)

Re: How to setup package servers in ElkArte?

Reply #4

At some point I should do a write up on how to do this, would be a good wiki article, but for now the fast high-level summary is this.

The addon site is a Jekyll based site, hosted on GitHub.  Jekyll is a static site builder, it builds sites using templates written using its language which allows for looping, logic, to name a few.  In building the site Jekyll runs the templates and it creates all of the static pages that get served (the created files are in _site, you will not see that in the repo itself)

Jekyll docs are here http://jekyllrb.com/docs/home/ You can see how we have addon site setup here: https://github.com/elkarte/addons/tree/gh-pages  Those our our templating files, they will makes sense if you go through the Jekyll docs.

Whenever an update is pushed to the addon gh-pages repo Jekyll automatically rebuilds all the static site with the updates, you don't have to do a thing. Just to note, Jekyll will run/build any file it finds in the repo root as long as it starts with a Jekyll front matter section (see the Jekyll docs)

As part of the build process it creates a json file of the addons.  To do that check this template file https://github.com/elkarte/addons/blob/gh-pages/package.json  The output of that template file is the static file http://addons.elkarte.net/package.json  Its this file that ElkArte reads, parses and presents in the package server area.

For a package server you don't necessarily have to have a Jekyll site, all you really need is a way to serve up a json file that follows that structure. This could be done with php as well, its just a json array object.  You can choose to host the addon package files or simply point to where they are hosted. 

So simply a package server is nothing more that a url that returns a json file structured as defined above.

Re: How to setup package servers in ElkArte?

Reply #5

I did that once in SMF but not an automated one. I think it was rather xml last time. The best package server would be an automated one as suggested by Arantor.

Re: How to setup package servers in ElkArte?

Reply #6

What is an automated package server? It's just a file.

Re: How to setup package servers in ElkArte?

Reply #7

And that static JSON file is automatically generated/updated whenever a addon is added / updated via commits to the addon site.