{"id":17760763,"url":"https://github.com/Metaswitch/apt-package-function","last_synced_at":"2025-03-15T10:30:52.173Z","repository":{"id":226050738,"uuid":"766878649","full_name":"Metaswitch/apt-package-function","owner":"Metaswitch","description":"apt-package-function is an Azure Function App which maintains an apt package repository in Azure Blob Storage, by regenerating repository information whenever packages are uploaded","archived":false,"fork":false,"pushed_at":"2025-02-17T02:39:56.000Z","size":351,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T00:04:31.129Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Metaswitch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-04T09:51:02.000Z","updated_at":"2025-01-23T15:10:46.000Z","dependencies_parsed_at":"2024-07-08T09:58:29.189Z","dependency_job_id":"42a0dd43-6fb1-48b7-93ee-e6a3d73d4383","html_url":"https://github.com/Metaswitch/apt-package-function","commit_stats":null,"previous_names":["microsoft/apt-package-function","metaswitch/apt-package-function"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaswitch%2Fapt-package-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaswitch%2Fapt-package-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaswitch%2Fapt-package-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaswitch%2Fapt-package-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Metaswitch","download_url":"https://codeload.github.com/Metaswitch/apt-package-function/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243718764,"owners_count":20336589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-26T19:12:37.831Z","updated_at":"2025-03-15T10:30:51.871Z","avatar_url":"https://github.com/Metaswitch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apt-package-function\n\nFunctionality to create a Debian package repository in Azure Blob Storage with\nan Azure Function App to keep it up to date. For use with\n[apt-transport-blob](https://github.com/microsoft/apt-transport-blob).\n\n# Getting Started\n\n## Required tools\n\n- `poetry` and `poetry-plugin-export`: required for running the creation commands and exporting dependencies to requirements.txt format.\n  - Poetry installation instructions are available at https://python-poetry.org/docs/#installation\n  - Once poetry is installed, run\n    ```bash\n    poetry self add poetry-plugin-export\n    ```\n    to install `poetry-plugin-export`.\n- Azure CLI\n  - Installation instructions available at https://learn.microsoft.com/en-us/cli/azure/install-azure-cli\n\n- Docker (when not using shared key access from the function app to the storage container)\n  - Installation instructions available at https://docs.docker.com/engine/install/\n\n## Basic usage\n\nTo create a new Debian package repository with an Azure Function App, run\n\n```bash\npoetry run create-resources \u003cresource_group_name\u003e\n```\n\nwith the name of the desired resource group. The scripting will autogenerate a\npackage repository name for you - `debianrepo` followed by a unique string to\ndifferentiate it across Azure.\n\nIf you wish to control the suffix used, you can pass the `--suffix` parameter:\n\n```bash\npoetry run create-resources --suffix \u003csuffix\u003e \u003cresource_group_name\u003e\n```\nwhich will attempt to create a storage container named `debianrepo\u003csuffix\u003e`.\n\nBy default all resources are created in the `eastus` location - this can be\noverridden by passing the `--location` parameter:\n\n```bash\npoetry run create-resources --location uksouth \u003cresource_group_name\u003e\n```\n\n## No shared-key access / Managed Identities\n\nBy default, the storage container that is created has shared-key access enabled.\nYou can instead create a deployment that uses Managed Identities, but this\nrequires Docker (as the function application and its dependencies must be\ncompiled and packed appropriately).\n\nTo create a new Debian package repository which uses Managed Identities, run\n\n```bash\npoetry run create-resources --no-shared-key [--suffix \u003csuffix\u003e] [--location \u003clocation\u003e] \u003cresource_group_name\u003e\n```\n\nThis creates an additional blob container (`python`) in the storage account to\nhold the compiled function application zip file; the function application is\nrun directly from that zip file.\n\n# Design\n\nThe function app works as follows:\n\n- It is triggered whenever a `.deb` file is uploaded to the monitored blob\n  storage container\n    - It is triggered by an Event Grid trigger.\n- It iterates over all `.deb` files and looks for a matching `.package` file.\n- If that file does not exist, it is created\n    - The `.deb` file is downloaded and the control information is extracted\n    - The hash values for the file are calculated (MD5sum, SHA1, SHA256)\n    - All of this information is added to the `.package` file\n- All `.package` files are iterated over, downloaded, and combined into a\n  single `Package` file, which is then uploaded. A `Packages.xz` file is also\n  created.\n\n## Speed of repository update\n\nThe function app triggers at the speed of an Event Grid trigger running in Consumption\nmode; in the worst case this means triggering from a Cold Start. In practice\nthe repository is updated within 1 minute.\n\n# Project\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMetaswitch%2Fapt-package-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMetaswitch%2Fapt-package-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMetaswitch%2Fapt-package-function/lists"}