{"id":31904281,"url":"https://github.com/cloudfoundry-community/postgresql-cf-service-broker","last_synced_at":"2025-10-31T10:21:45.589Z","repository":{"id":30375514,"uuid":"33928122","full_name":"cloudfoundry-community/postgresql-cf-service-broker","owner":"cloudfoundry-community","description":"Cloud Foundry Service Broker for a PostgreSQL instance","archived":false,"fork":false,"pushed_at":"2016-10-16T10:41:33.000Z","size":92,"stargazers_count":17,"open_issues_count":3,"forks_count":28,"subscribers_count":40,"default_branch":"master","last_synced_at":"2024-04-14T22:47:42.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/cloudfoundry-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":"2015-04-14T11:35:43.000Z","updated_at":"2024-02-09T14:27:13.000Z","dependencies_parsed_at":"2022-09-08T16:15:01.065Z","dependency_job_id":null,"html_url":"https://github.com/cloudfoundry-community/postgresql-cf-service-broker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cloudfoundry-community/postgresql-cf-service-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fpostgresql-cf-service-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fpostgresql-cf-service-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fpostgresql-cf-service-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fpostgresql-cf-service-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry-community","download_url":"https://codeload.github.com/cloudfoundry-community/postgresql-cf-service-broker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fpostgresql-cf-service-broker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015343,"owners_count":26085686,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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-10-13T13:48:13.557Z","updated_at":"2025-10-13T13:48:43.754Z","avatar_url":"https://github.com/cloudfoundry-community.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud Foundry Service Broker for a PostgreSQL instance [![Build Status](https://travis-ci.org/cloudfoundry-community/postgresql-cf-service-broker.svg?branch=master)](https://travis-ci.org/cloudfoundry-community/postgresql-cf-service-broker)\n\nA Cloud Foundry Service Broker for a PostgreSQL instance built based on [s3-cf-service-broker](https://github.com/cloudfoundry-community/s3-cf-service-broker).\n\nThe broker currently publishes a single service and plan for provisioning PostgreSQL databases.\n\n## Design \n\nThe broker uses a PostgreSQL table for it's meta data. It does not maintain an internal database so it has no dependencies besides PostgreSQL.\n\nCapability with the Cloud Foundry service broker API is indicated by the project version number. For example, version 2.4.0 is based off the 2.4 version of the broker API.\n\n## Running\n\nSimply run the JAR file and provide a PostgreSQL jdbc url via the `MASTER_JDBC_URL` environment variable.\n\n### Locally\n\n```\nmvn package \u0026\u0026 MASTER_JDBC_URL=jdbcurl java -jar target/postgresql-cf-service-broker-2.4.0-SNAPSHOT.jar\n```\n\n### In Cloud Foundry\n\nFind out the database subnet and create a security group rule (postgresql.json):\n```\n[{\"protocol\":\"tcp\",\"destination\":\"10.10.8.0/24\",\"ports\":\"5432\"}]\n```\n\nimport this into CF with:\n```\ncf create-security-group postgresql-service postgresql.json\n```\n\nBind to the full cf install:\n```\ncf bind-running-security-group postgresql-service\n```\n\n\nBuild the package with `mvn package` then push it out:\n```\ncf push postgresql-cf-service-broker -p target/postgresql-cf-service-broker-2.4.0-SNAPSHOT.jar --no-start\n```\n\nExport the following environment variables:\n\n```\ncf set-env postgresql-cf-service-broker MASTER_JDBC_URL \"jdbcurl\"\ncf set-env postgresql-cf-service-broker JAVA_OPTS \"-Dsecurity.user.password=mysecret\"\n```\n\nStart the service broker:\n```\ncf start postgresql-cf-service-broker\n```\n\nCreate Cloud Foundry service broker:\n```\ncf create-service-broker postgresql-cf-service-broker user mysecret http://postgresql-cf-service-broker.cfapps.io\n```\n\nAdd service broker to Cloud Foundry Marketplace:\n```\ncf enable-service-access PostgreSQL -p \"Basic PostgreSQL Plan\" -o ORG\n```\n\n## Testing\n\n### Locally\n\nYou need to have a running PostgreSQL 9.x instance for this to work locally.\nTo create an PostgreSQL database matching the ```MASTER_JDBC_URL``` in ```src/test/resources/application.properties```:\n```\ndocker run  -p 5432:5432/tcp --name testpostgres --rm -e POSTGRES_DB=travis_ci_test -e  POSTGRES_PASSWORD= -e POSTGRES_USER=postgres postgres\n```\n\nThen run:\n```\nmvn test\n```\n\n### In Travis CI\nThe configuration for the test can be found in ```src/test/resources/application.properties``` and should match the configuration in Travis CI (```.travis.yml```).\n\n## Using the services in your application\n\n### Format of Credentials\n\nThe credentials provided in a bind call have the following format:\n\n```\n\"credentials\":{\n\t\"uri\":\"postgres://__username__:__password__@__hostname__:__port__/__database__\"\n}\n```\n\n## Broker Security\n\n[spring-boot-starter-security](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters/spring-boot-starter-security) is used. See the documentation here for configuration: [Spring boot security](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-security)\n\nThe default password configured is \"password\"\n\n## Creation of PostgreSQL databases\n\nA service provisioning call will create a PostgreSQL database. A binding call will return a database uri that can be used to connect to the database. Unbinding calls will disable the database user role and deprovisioning calls will delete all resources created.\n\n## User for Broker\n\nAn PostgreSQL user must be created for the broker. The username and password must be provided using the environment variable `MASTER_JDBC_URL`.\n\n## Registering a Broker with the Cloud Controller\n\nSee [Managing Service Brokers](http://docs.cloudfoundry.org/services/managing-service-brokers.html).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-community%2Fpostgresql-cf-service-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry-community%2Fpostgresql-cf-service-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-community%2Fpostgresql-cf-service-broker/lists"}