{"id":18792943,"url":"https://github.com/blacksmith-community/cf-postgres-tinsmith","last_synced_at":"2025-04-13T14:31:37.662Z","repository":{"id":32149394,"uuid":"117799389","full_name":"blacksmith-community/cf-postgres-tinsmith","owner":"blacksmith-community","description":"A Shared PostgreSQL Service Broker that sits atop a Blacksmith Dedicated Service","archived":false,"fork":false,"pushed_at":"2022-05-10T15:16:34.000Z","size":252,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-27T06:01:38.669Z","etag":null,"topics":["blacksmith","cloud-foundry","postgresql"],"latest_commit_sha":null,"homepage":null,"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/blacksmith-community.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":"2018-01-17T07:15:02.000Z","updated_at":"2023-03-21T21:59:36.000Z","dependencies_parsed_at":"2022-08-08T21:00:05.945Z","dependency_job_id":null,"html_url":"https://github.com/blacksmith-community/cf-postgres-tinsmith","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmith-community%2Fcf-postgres-tinsmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmith-community%2Fcf-postgres-tinsmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmith-community%2Fcf-postgres-tinsmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmith-community%2Fcf-postgres-tinsmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacksmith-community","download_url":"https://codeload.github.com/blacksmith-community/cf-postgres-tinsmith/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248727984,"owners_count":21152136,"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":["blacksmith","cloud-foundry","postgresql"],"created_at":"2024-11-07T21:22:28.808Z","updated_at":"2025-04-13T14:31:37.369Z","avatar_url":"https://github.com/blacksmith-community.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL Tinsmith\n\nA _tinsmith_, in Blacksmith Services parlance, is a Cloud Foundry\nService Broker that runs as a Cloud Foundry Application, consumes\na provisioned, on-demand Blacksmith Service, and makes it\navailable to the rest of the world as a shared, multi-tenant\nservice.\n\nA picture may make things clearer:\n\n![Tinsmith Architectural Diagram](docs/tinsmith.png)\n\nThis Tinsmith, in particular, takes a dedicated PostgreSQL\ninstance (most likely deployed via the [PostgreSQL Blacksmith\nForge][pg-forge]) and carves up the dedicated host / cluster into\nindividual databases for each service.  Bound applications will\nhave free run of their own database, but will be unable to\ninteract with other shared databases on the same installation.\n\n## Deploying\n\nTo deploy this Tinsmith, you need the code, a Cloud Foundry, and a\nPostgreSQL service from your CF Marketplace.  We heartily\nrecommend a service deployed via the [Blacksmith][blacksmith] and\nits [PostgreSQL Forge][pg-forge], but any service that provides the following \ninformation in its `$VCAP_SERVICES` credentials block should do:\n\n- `host`\n- `port` (as a number)\n- `username`\n- `password`  \n- `db_name` or `name` or `database`\n\nTo deploy and start the Tinsmith application:\n\n```shell\ngit clone https://github.com/blacksmith-community/cf-postgres-tinsmith\ncd cf-postgres-tinsmith\n\n# push the code for tinsmith\ncf push --no-start\n\n# bind your database service to tinsmith\ncf bind-service postgres-tinsmith YOUR-DATABASE-SERVICE\n\n# tag your database service so that tinsmith can find it\n# See \"Configuration\" below\ncf update-service YOUR-DATABASE-SERVICE -t \"postgresql\"\n\n# you may want to set some other environment variables at\n# this stage; see \"Configuration\", below.\ncf set-env postgres-tinsmith SB_BROKER_USERNAME my-broker\ncf set-env postgres-tinsmith SB_BROKER_PASSWORD a-secret\n\n# start the app\ncf start postgres-tinsmith\n```\n\nThen, create the Tinsmith service broker and enable the service. If you have the administrator role:\n\n```shell\ncf create-service-broker postgres-tinsmith my-broker a-secret \\\n  https://postgres-tinsmith.$APP_DOMAIN\n\n# enable the service\ncf enable-service-access postgres\n```\n\nIf you only have the space developer role:\n\n```shell\n# make sure to target your space\ncf target -s \u003cSPACE\u003e\n\ncf create-service-broker postgres-tinsmith my-broker a-secret \\\n  https://postgres-tinsmith.$APP_DOMAIN --space-scoped\n```  \n\nLastly, verify that the service appears in the marketplace:\n\n```shell\ncf marketplace\n```\n\n## Configuring\n\nThis tinsmith is configured entirely through environment\nvariables.\n\nThere are environment variables for governing the presentation of\nthis brokers service / plan in the marketplace:\n\n- `SERVICE_ID` - The internal ID of the service that this broker\n  provides to the marketplace.\n- `SERVICE_NAME` - The CLI-friendly name of the service.\n- `PLAN_ID` - The internal ID of the plan that this broker\n  provides to the marketplace.\n- `DESCRIPTION` - A human-friendly description of the service /\n  plan, to be displayed in the marketplace\n- `TAGS` - A comma-separated list of tags to apply to instances\n  of the service.\n\nThere are environment variables for controlling the security and\nauthentication parameters of the broker:\n\n- `SB_BROKER_USERNAME` - The HTTP Basic Auth username that must\n  be used to access this broker.  Defaults to `b-postgres`.\n- `SB_BROKER_PASSWORD` - The HTTP Basic Auth password that must\n  be used to access this broker.  Defaults to `postgres`.\n\nYou can also override the service selection logic and force it to\npick a specific, named service by setting the `USE_SERVICE`\nenvironment variable to its name.  Otherwise, the broker will look\nfor bound services that are tagged `postgres` or `postgresql`.\n\n\n\n\n\n[pg-forge]: https://github.com/blacksmith-community/postgresql-forge-boshrelease\n[blacksmith]: https://github.com/cloudfoundry-community/blacksmith\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmith-community%2Fcf-postgres-tinsmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacksmith-community%2Fcf-postgres-tinsmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmith-community%2Fcf-postgres-tinsmith/lists"}