7

I've developed a couple of custom QGIS Plugins for use by our office. I can't post them to the official QGIS Plugins repository as they reference/utilize sensitive data on our own servers.

For distribution, I'm currently just having users copy the plugin folder over to their local plugins folder. However, this is inconvenient and won't give them an easy way to update.

Can I set up a custom repository on a network drive or server (behind our firewall) that users can connect to?

10

It is possible, yes. I have not done it myself, but I have read about it in this book. (I hope this does not count as an ad; if someone thinks so, please edit the post and remove the link).

You would first have to create an XML file that looks like the following:

<?xml version="1.0"?>
<plugins>
    <pyqgis_plugin name="SomeName" version="0.1">
        <description>This plugin shows sensitive data</description>
        <homepage>www.gisisfun.com</homepage>
        <qgis_minimum_version>2.2</qgis_minimum_version>
        <file_name>somePlugin.zip</file_name>
        <author_name>YourName</author_name>
        <download_url>http://my-site.com/somePlugin.zip</download_url>
    </pyqgis_plugin>
</plugins>

That file and your plugin(s) would then be uploaded to a web server (of course you’d configure your server so only people from your company can access its contents).

Now, what is important here, and what you might have guessed already, is that you create a 'plugin section' for each plugin that you want to upload to your repository, so basically you'd have to add the following tags (and any info in between) multiple times:

 <pyqgis_plugin name="SomeName" version="0.1">  INFO HERE    </pyqgis_plugin>

After uploading the XML and your plugins to your server you have already done the bulk of the work.

Now you would start QGIS and open the Plugin Manager, just like you would normally do to find and add plugins. You would have to navigate to the Settings tab, where you can add connections to repositories:

enter image description here

Now you will give the repository a Name (it really does not matter what this name is, but something that makes sense and lets you recognize it; kind of like when you define a database connection in QGIS), and then under URL you would provide the full URL to your XML file on your server (e.g. http://gisiscool.com/gis/plugins/plugins.xml).

enter image description here

That should do it. You can now search and find your own plugins!

  • Thanks BritishSteel, I'd prefer a network drive but this looks to be a reasonable solution. – mike Feb 19 '15 at 16:56
  • @mike network drive is possible. You just have to add a `file:\` in front of the absolut path to the network drive. – Adarkas2302 Jun 15 '17 at 9:31
2

Just a short addition to the answer of user BritishSteel:

I doubt that a networkdrive would work as the http-protocol should be used. ( see the tooltip in this screenshot:)

enter image description here

But you can setup a webserver like apache,nginx,jetty or something like that (if not already exists) and make the xml-file available through the http-protocol(see screenshot.my local server name is gazelle).

enter image description here

You can also just download the official plugins.xml to get an idea of the xml syntax you need to use in order to setup your own repository:

enter image description here

  • 2
    networkdrive works fine. You just have to add file: in front of the absolut link of the networkdrive. – Adarkas2302 Jun 15 '17 at 8:32
2

In my opinion, a much easier way to use an "in house" plugin is to place a copy in the following directory:

C:\OSGeo4W\apps\qgis\python\plugins

Also within this directory you will see other plugins that are installed as core plugins that come with the OSGEO4W download of QGIS.

After placing a copy of your custom plugin into this directory, be sure to go to the plugins manager in QGIS and enable the added plugin.

This method has worked flawlessly for my custom plugins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.