{"id":24283597,"url":"https://github.com/containercraft/ccio-simplestreams","last_synced_at":"2026-06-06T11:31:36.012Z","repository":{"id":114566176,"uuid":"250875324","full_name":"ContainerCraft/ccio-simplestreams","owner":"ContainerCraft","description":"LXD SimpleStreams Image Service","archived":false,"fork":false,"pushed_at":"2020-03-29T05:15:47.000Z","size":5536,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T15:51:51.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainerCraft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-28T19:20:31.000Z","updated_at":"2020-03-29T05:15:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"153ee705-b1e6-466e-845c-f241c1c82086","html_url":"https://github.com/ContainerCraft/ccio-simplestreams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ContainerCraft/ccio-simplestreams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-simplestreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-simplestreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-simplestreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-simplestreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainerCraft","download_url":"https://codeload.github.com/ContainerCraft/ccio-simplestreams/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-simplestreams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33981122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-16T04:16:53.698Z","updated_at":"2026-06-06T11:31:35.997Z","avatar_url":"https://github.com/ContainerCraft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lxd-image-server\n================\n[Docker Hub Image](https://hub.docker.com/r/containercraft/ccio-simplestreams)\n[Application Repo](https://github.com/containercraft/simplestreams-service)\nCreates and manages a simplestreams lxd image server on top of nginx.\nIf installed as a debian package, a new service is created and it monitors\nif there are any changes in the image directory and updates json files.\n\nRequirements\n------------\n\n* Python: Version 3.5.2 or higher.\n\n* Nginx\n\n* OpenSSL\n\nBuilding the debian package\n---------------------------\n\n### Building the package ###\n\nTo build lxd-image-server, first, install the build dependecies:\n\n```bash\n# debhelper \u003e= 9\n# dh-virtualenv \u003e= 9\napt-get install debhelper dh-exec python3 python-dev dh-virtualenv\n```\n\nThen build the package:\n\n```bash\ndpkg-buildpackage -us -uc -b\n```\n\n### Building the package in a Docker container ###\n\nTo build lxd-image-server itself in a Docker container, call docker build:\n\n```bash\ndocker build --tag lxd-image-server-builder .\n```\n\nThis will build the DEB package for Ubuntu Bionic by default. Add e.g.\n--build-arg distro=ubuntu:xenial to build for Ubuntu Xenial.\n\nThe resulting files must be copied out of the build container, using these\ncommands:\n\n```bash\nmkdir -p dist \u0026\u0026 docker run --rm lxd-image-server-builder tar -C /dpkg -c . | tar -C dist -xv\n```\n\nInstallation\n------------\n\n### From debian package (recommended) ###\n\nThe debian package will automatically copy the source files, create the user lxdadm\nto upload the files and setup the nginx server with its configuration (included a\nself signed ssl certificate).\n\n* **Install from repository**:\n\n```sh\napt-get install lxd-image-server\n```\n\n* **Install using dpkg**:\n\n```sh\ndpkg -i lxd-image-server_0.0.1~xenial_all.deb\n```\n\nAfter the installation of the package, a rsa key has to be generated at\n/home/lxdadm/.ssh to control the upload of images:\n\n```sh\nssh-keygen\nGenerating public/private rsa key pair.\nEnter file in which to save the key (/root/.ssh/id_rsa): # use /home/lxdadm/.ssh/id_rsa\n...\n```\n\nThe generated id_rsa key will be used to upload files to the server.\n\n### From source code ###\n\nClone the repository and run:\n\n```sh\npython setup.py install\n```\n\nThe subcommand init generates all the default directories, ssl keys and links nginx\nconfiguration (when using default configuration it is recommended to use debian installation)\n\nUsage\n-----\n\nLxd-image-server is not just a new remote for your lxd, it also allows you to\ndistribute your images to different mirrors. Clients will update new images to\nthe master server and the master will mirror the image on the mirrors defined\non the configuration file.\n\nThe following picture describes, the master server which replicates images to\nother two servers. Clients can get images from any of them but they can only\nupload new images to the master.\n\n\n![usage](/doc/images/lxd-usage.svg \"lxc usage\")\n\nThe configuration file would be:\n\n```yaml\n[mirrors]\n  [mirror1]\n  user = \"lxdadm\"\n  url = \"https://mirror1.xxxxxxx.com:8443\"\n  key_path = \"/etc/lxd-image-server/lxdhub.key\"\n  [mirror2]\n  user = \"lxdadm\"\n  url = \"https://mirror2.xxxxxxx.com:8443\"\n  key_path = \"/etc/lxd-image-server/lxdhub.key\"\n```\n\nConfiguration files are 'toml' files and are read from (/etc,~/.config)/lxd-image-server/(config.toml,conf.d/*)\nCode should automatically reload them if they change.\n \nThe installed service on the master will automatically monitor the image\ndirectory and update all the required metadata. No further commands are needed.\n\nThis is the structure the simplestreams server needs to have:\n\n```\n- /var/www                                         # document root\n        `- simplestreams\n           |- images                               # images folder\n           |  `- iats                              # environment|product\n           |     `- xenial                         # release\n           |        `- amd64                       # architecture\n           |           `- default                  # box type\n           |              `- 20180716_12:00        # version 1 (mandatory format: 'YYYYMMDD_HH:MM')\n           |                 |- lxd.tar.xz         # index and templates\n           |                 `- rootfs.squashfs    # rootfs of container\n           `- streams\n              `- v1\n                 |- index.json                     # index of products\n                 `- images.json                    # info with versions of products\n```\n\nYour product will be named by concatenating all the directories names. As seen above, name will be\n\"iats:xenial:amd64:default\"\n\nYour product definition, inside images.json file will have these fields:\n- arch = the name of the architecture directory (amd64, in the example)\n- os = the environment|product name (iats, in the example)\n- release = the release directory name (xenial, in the example)\n- release_title = the release directory name (xenial, in the example)\n- aliases: a **single** alias with the name of the product (iats:xenial:amd64:default, in the example)\n\nYou can change these values by uploading also a 'metadata.json' file (which will not appear in the images.json file), \nand which can contain the following fields:\n- os\n- release_title\n- aliases = string of aliases, joined by ','. Name of product alias will be added automatically.\nPreferably you should upload this 'metadata.json' at the beginning rather than after the big actual image files.\n\nThe command `lxd-image-server` can be used to manage the server manually:\n\n```sh\nUsage: lxd-image-server [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --log-file TEXT  [default: ./lxd-image-server.log]\n        use 'STDOUT' or 'STDERR' as file names, if needed\n  --verbose        Sets log level to debug\n  --help           Show this message and exit.\n\nCommands:\n  init\n  update\n  watch\n\nDefault paths:\n    - Index files: /var/www/simplestreams/streams/v1\n    - Image dirs: /var/www/simplestreams/images\n```\n\n### Subcommands ###\n\n#### init ####\n\nInit creates default configuration needed for the server. See Installation\nsection for more info.\n\n#### Update ####\n\nUpdate recreates all the metadata from scratch, and recalculate the\nsha256 info for all the images. This option is only intended as a safeguard or in case\nthe service is not running.\n\n#### Watch ####\n\nWatch will start the monitoring of the directory. It is intended to be\nused only if the service is not running.\n\nHow to use my new server?\n-------------------------\n\n### How to add server as lxd remote ###\n\nOnce your own image server is running, you can add it as new remote on lxc:\n\n```bash\nlxc remote add \u003cname\u003e \u003curl\u003e --protocol=simplestreams\n```\n\nRemember to add the certificate:\nIf behind a SSL terminating proxy, skip this step, and you can run 'init' step with '--ssl_skip'  \n\n```bash\nopenssl s_client -showcerts -connect \u003curl\u003e:443 \u003c/dev/null 2\u003e/dev/null | openssl x509 -outform PEM \u003e my-lxd-image-server.cert\ncp my-lxc-image-server.cert /user/local/share/ca-certificates\nupdate-ca-certificates\nsystemctl restart lxd\n```\n\nAlso, you can use https://letsencrypt.org/ to make your server easier to set up.\n\n### Publish a new image ###\n\nCreate a image container and publish:\n\n```bash\nlxc launch lxc:ubuntu/bionic/amd64 n1\nlxc exec n1 -- apt-get -y install vim\nlxc stop n1\nlxc publish --public n1 --alias=bionic-vim\nlxc image copy bionic-vim \u003curl\u003e\n```\n\nNow, you can use your image in a new container\n\n```bash\nlxc launch bionic-vim ntest\nlxc exec ntest -- vim -c \"smile\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fccio-simplestreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainercraft%2Fccio-simplestreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fccio-simplestreams/lists"}