diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index f14c403a..539121a4 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -74,6 +74,7 @@ class Controller: log.info("Controller is starting") await self._install_base_configs() + await self._install_custom_symbols() installed_disks = await self._install_builtin_disks() if installed_disks: await update_disk_checksums(installed_disks) @@ -371,6 +372,19 @@ class Controller: except OSError as e: log.error(f"Could not install disk files to {dst_path}: {e}") + async def _install_custom_symbols(self): + """ + At startup we copy custom symbols to the user location to allow + them to use with appliances + """ + + dst_path = self.symbols.symbols_path() + log.info(f"Installing custom symbols in '{dst_path}'") + try: + return await Controller.install_resource_files(dst_path, "custom_symbols", upgrade_resources=False) + except OSError as e: + log.error(f"Could not install custom symbols to {dst_path}: {e}") + def images_path(self): """ Get the image storage directory diff --git a/gns3server/custom_symbols/README.rst b/gns3server/custom_symbols/README.rst deleted file mode 100644 index ae1b614f..00000000 --- a/gns3server/custom_symbols/README.rst +++ /dev/null @@ -1,39 +0,0 @@ -Symbols -******* - -This directory contains symbols that you can use in GNS3. - -Rules -===== - -* All symbols must be a SVG file -* A file named symbol.txt should exist and contains the symbol licence -* Try to keep the file size small -* The recommended maximum width and height is 70px, please see how to resize a SVG below - - -Resize a SVG -============ - -It is possible to resize a SVG file using a software like Inkscape or any -other editor that works for SVG images. - -Alternatively, you could use ImageMagick (with rsvg support) on Mac OS and Linux - -Example to install ImageMagick on Mac using Homebrew: - -``` -brew install imagemagick --with-librsvg -``` - -Example to install ImageMagick on Debian or Ubuntu: - -``` -sudo apt-get install imagemagick -``` - -Example to resize to a width and height of 70px: - -``` -convert -background none symbols/firefox.svg -resize x70 firefox.svg -``` diff --git a/scripts/sync_appliances.sh b/scripts/sync_appliances.sh index 108e60fd..54b734df 100755 --- a/scripts/sync_appliances.sh +++ b/scripts/sync_appliances.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (C) 2016 GNS3 Technologies Inc. # @@ -21,10 +21,15 @@ rm gns3server/appliances/* rmdir gns3server/appliances +rm gns3server/custom_symbols/* +rmdir gns3server/custom_symbols rm -Rf /tmp/gns3-registry git clone https://github.com/GNS3/gns3-registry.git /tmp/gns3-registry mv /tmp/gns3-registry/appliances gns3server/appliances +mv /tmp/gns3-registry/symbols gns3server/custom_symbols +rm gns3server/custom_symbols/*.{txt,rst,md} git add gns3server/appliances/* +git add gns3server/custom_symbols/* git commit -m "Sync appliances"