{"id":17340101,"url":"https://github.com/sadok-f/docker-secrets","last_synced_at":"2025-04-14T18:50:51.491Z","repository":{"id":62539078,"uuid":"105290240","full_name":"sadok-f/docker-secrets","owner":"sadok-f","description":"Simple PHP library to read docker secrets.","archived":false,"fork":false,"pushed_at":"2018-03-09T14:07:37.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:52:23.409Z","etag":null,"topics":["docker","docker-secret","docker-secrets","php","php-library","swarm"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/sadok-f.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}},"created_at":"2017-09-29T15:48:44.000Z","updated_at":"2024-05-31T10:11:47.000Z","dependencies_parsed_at":"2022-11-02T15:17:23.830Z","dependency_job_id":null,"html_url":"https://github.com/sadok-f/docker-secrets","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadok-f%2Fdocker-secrets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadok-f%2Fdocker-secrets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadok-f%2Fdocker-secrets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadok-f%2Fdocker-secrets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadok-f","download_url":"https://codeload.github.com/sadok-f/docker-secrets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248941471,"owners_count":21186914,"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":["docker","docker-secret","docker-secrets","php","php-library","swarm"],"created_at":"2024-10-15T15:44:02.951Z","updated_at":"2025-04-14T18:50:51.458Z","avatar_url":"https://github.com/sadok-f.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://travis-ci.org/sadok-f/docker-secrets\"\u003e\u003cimg alt=\"Build Status\" src=\"https://travis-ci.org/sadok-f/docker-secrets.svg?branch=master\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codeclimate.com/github/sadok-f/docker-secrets\"\u003e\u003cimg alt=\"Code Climate\" src=\"https://codeclimate.com/github/sadok-f/docker-secrets/badges/gpa.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Docker Secrets\n\nA simple PHP library to read [docker secrets](https://docs.docker.com/engine/swarm/secrets/) from a Swarm cluster.\n\n# Installation\n\n```bash\n composer require sadok-f/docker-secrets\n```\n\n# Usage\n\n### Read All\n\n```php\n$dockerSecrets = new DockerSecrets\\Reader\\SecretsReader();\n$allSecrets = $dockerSecrets-\u003ereadAll();\n```\nreturn:\n```\nArray\n(\n    [my_secret_data_1] =\u003e testSecretDataContent1\n    [my_secret_data_2] =\u003e testSecretDataContent2\n)\n```\n\n### Read a single secret\n\n```php\n$dockerSecrets = new DockerSecrets\\Reader\\SecretsReader();\n$dockerSecrets-\u003eread('my_secret');\n```\n\n### Custom Location\nThe default location for secrets folder is to `/run/secrets/` in Linux containers.\nif you're using Docker 17.06 and higher with custom location you can use the library like this example:\n\n```php\n$dockerSecrets = new DockerSecrets\\Reader\\SecretsReader('/var/myCustomLocation');\n$dockerSecrets-\u003eread('my_secret');\n```\n\n### Read secrets in Windows containers\n\n```php\n$dockerSecrets = new DockerSecrets\\Reader\\SecretsReader('C:\\ProgramData\\Docker\\secrets');\n$dockerSecrets-\u003eread('my_secret');\n```\n\n# PHPUnit\n\n```bash\n./vendor/bin/phpunit\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadok-f%2Fdocker-secrets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadok-f%2Fdocker-secrets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadok-f%2Fdocker-secrets/lists"}