{"id":15470448,"url":"https://github.com/shyim/composer-registry","last_synced_at":"2025-04-22T12:09:44.168Z","repository":{"id":45318075,"uuid":"513506456","full_name":"shyim/composer-registry","owner":"shyim","description":"Composer v2 Registry","archived":false,"fork":false,"pushed_at":"2024-06-22T06:22:17.000Z","size":169,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T12:09:01.200Z","etag":null,"topics":["composer","github","gitlab","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","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/shyim.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":"2022-07-13T12:08:45.000Z","updated_at":"2025-01-22T11:34:55.000Z","dependencies_parsed_at":"2023-12-19T02:35:31.446Z","dependency_job_id":"b7320b26-c8cf-4d28-baf3-f0accc3ca5e0","html_url":"https://github.com/shyim/composer-registry","commit_stats":{"total_commits":102,"total_committers":5,"mean_commits":20.4,"dds":0.5882352941176471,"last_synced_commit":"67965e1d46dc0d7d9aaf35c209c602cb0e64118d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyim%2Fcomposer-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyim%2Fcomposer-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyim%2Fcomposer-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyim%2Fcomposer-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shyim","download_url":"https://codeload.github.com/shyim/composer-registry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237832,"owners_count":21397401,"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":["composer","github","gitlab","webhook"],"created_at":"2024-10-02T02:04:44.226Z","updated_at":"2025-04-22T12:09:44.142Z","avatar_url":"https://github.com/shyim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Composer Registry\n\nThis Composer registry fetches multiple sources and serves them as Composer packages.  \n\n## Features\n\n- Gitlab Support\n- GitHub Support\n- Mirror Shopware Composer Repository\n- Adding custom packages using ZIP files\n\n## Installation\n\n- Download the latest version from the released files\n- Create a `config.json` or a `config.yml` like your preferences.\n\n### Docker\n\n```shell\ndocker run \\ \n  -p 8080:8080 \\\n  -v $(pwd)/config.json:/config.json \\\n  -v $(pwd)/storage:/storage \\\n  ghcr.io/shyim/composer-registry:latest\n```\n\n`/storage` will be used to save the database and zips if mirroring is enabled\n\n### NixOS\n\nImport this as flake.\n\n```nix\ninputs = {\n    composer-registry = {\n      url = \"github:shyim/composer-registry\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n}\n```\n\nImport the module on your system.\n\n```nix\n{ pkgs, inputs, ... }:\n{\n  imports = [\n    inputs.composer-registry.nixosModules.default\n  ];\n}\n```\n\nActivate the given service:\n\n```nix\nservices.composer-registry = {\n    enable = true;\n\n    settings = {\n      base_url = \"https://my.composer.io\";\n    };\n};\n```\n\n## Configuration\n\nThe base config file looks like this:\n\n```json\n{\n  \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n  \"base_url\": \"http://localhost:8080\"\n}\n```\n\nThe `base_url` is the URL where the instance is available. Currently it is not possible to change this afterwards. (This will be used only for mirroring/custom packages).\n\n### Gitlab\n\n```javascript\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"providers\": [\n        {\n            \"name\": \"my-gitlab-instance\", // provider name.\n            \"type\": \"gitlab\",\n            \"domain\": \"gitlab.com\", // gitlab.com or your instance domain\n            \"token\": \"my-gitlab-token\", // access token with read_api\n            \"webhook_secret\": \"my-gitlab-webhook-secret\", // webhook secret Webhook address is /webhook/\u003cprovider-name\u003e \n            \"fetch_all_on_start\": true, // Fetches all packages on start, Optional\n            \"projects\": [\n                {\n                    \"name\": \"my-gitlab-group/repo\" // project name to consider\n                }\n            ],\n            \"cron_schedule\": \"*/5 * * * *\" // Cron schedule for refetching anything. Optional if you don't want to have webhooks\n        }\n    ]\n}\n```\n\nThe registry serves only the package information, the zip will be directly downloaded from your Gitlab instance. To do this you need to configure composer too.\n\nAdd following to your `composer.json`\n\n```json\n\"repositories\": [\n    {\n        \"type\": \"composer\",\n        \"url\": \"\u003curl-of-this-service-hosted\u003e\"\n    }\n],\n\"config\": {\n    \"gitlab-domains\": [\"\u003cGITLAB-DOMAIN\u003e\"]\n}\n```\n\n```shell\n\u003e composer config gitlab-token.\u003cGITLAB-DOMAIN\u003e TOKEN\n```\n\n### Github\n\n```javascript\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"providers\": [\n        {\n            \"name\": \"my-github-instance\", // provider name.\n            \"type\": \"github\",\n            \"token\": \"my-github-token\", // personal access token\n            \"webhook_secret\": \"my-github-webhook-secret\", // webhook secret Webhook address is /webhook/\u003cprovider-name\u003e \n            \"fetch_all_on_start\": true, // Fetches all packages on start, Optional\n            \"projects\": [\n                {\n                    \"name\": \"my-github-group/repo\" // project name to consider\n                }\n            ],\n            \"cron_schedule\": \"*/5 * * * *\" // Cron schedule for refetching anything. Optional if you don't want to have webhooks\n        }\n    ]\n}\n```\n\nThe registry serves only the package information, the zip will be directly downloaded from your GitHub instance. To do this you need to configure composer too.\n\nAdd following to your `composer.json`\n\n```shell\n\u003e composer config github-oauth.github.com token\n```\n\n### Mirroring Shopware Composer\n\n```javascript\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"providers\": [\n        {\n            \"name\": \"shopware\", // provider name.\n            \"type\": \"shopware\",\n            \"fetch_all_on_start\": true, // Fetches all packages on start, Optional\n            \"projects\": [\n                {\n                    \"name\": \"The Composer Token\" // project name to consider\n                }\n            ],\n            \"cron_schedule\": \"*/5 * * * *\" // Cron schedule for refetching anything. Optional if you don't want to have webhooks\n        }\n    ]\n}\n```\n\nThe registry will download all packages from the Shopware Composer repository and serve them.\n\n### Adding custom zips as package\n\n```javascript\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"providers\": [\n        {\n            \"name\": \"custom\", // provider name.\n            \"type\": \"custom\",\n            \"webhook_secret\": \"my-api-secret\"\n        }\n    ]\n}\n```\n\nThis will enable two API endpoints to add/update or delete packages:\n\nCreate/update package:\n\n\n```http request\nPOST http://localhost:8080/custom/package/create\nAuthorization: bearer \u003cwebhook-secret\u003e\n```\n\nThe request body is the ZIP file.\n\n\nDelete package:\n\n```http request\nDELETE http://localhost:8080/custom/package/\u003cname\u003e/\u003cversion\u003e\nAuthorization: bearer \u003cwebhook-secret\u003e\n```\n\n# Authentication\n\nBy default, is the authentication disabled. To enabled add users to your configuration.\n\n```json\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"users\": [\n        {\n            \"token\": \"TOKEN\"\n        }\n    ]\n}\n```\n\nThe token can be configured like so\n\n```shell\n\u003e composer config bearer.\u003cinstance-domain\u003e \u003cyour-token\u003e\n```\n\n## Rules\n\nYou can add to the tokens rules, when they match then the token will be able to download that package.\n\nPossible types are: `begins_with`, `ends_with`, `contains`, `equals`\n\n```json\n{\n    \"$schema\": \"https://raw.githubusercontent.com/shyim/composer-registry/main/config-schema.json\",\n    \"base_url\": \"http://localhost:8080\",\n    \"users\": [\n        {\n            \"token\": \"test\",\n            \"rules\": [\n                {\n                    \"type\": \"begins_with\",\n                    \"value\": \"store.shopware.com\"\n                }\n            ]\n        }\n    ]\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyim%2Fcomposer-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshyim%2Fcomposer-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyim%2Fcomposer-registry/lists"}