Giter Site home page Giter Site logo

cloudfoundry-community / phppgadmin-cf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phppgadmin/phppgadmin

18.0 33.0 0.0 13.05 MB

the premier web-based administration tool for postgresql working on Cloud Foundry

Home Page: http://phppgadmin.sourceforge.net/

License: Other

PHP 75.00% JavaScript 19.10% Shell 0.04% HTML 5.11% CSS 0.71% PLpgSQL 0.04%

phppgadmin-cf's Introduction

phpPgAdmin - Cloud Foundry Ready

This version is a real fork from phpPgAdmin. It can be use with service provided by Dingo PostgreSQL, postgresql-cf-service-broker, and others.

It use cf-helper-php to auto-binding postgresql service on phpPgAdmin.

Installation & usage

Just 5 steps:

  1. Download the zip file from here: https://github.com/cloudfoundry-community/phppgadmin-cf/archive/cf-ready.zip.
  2. Unzip it
  3. Go inside the unzipped folder and run cf push --no-start -n phppgadmin-SPACENAME
  4. If needed create a user-provided service to connect to an existing remote pg instance (e.g. cf cups ccdb-pg -p '{"uri":"postgres://192.168.131.8:5524/ccdb"}' )
  5. Bind your postgresql service with cf bs phppgadmin-cfready <service_name> and repeat for all postgresql services you want in your phpPgAdmin
  6. Restage the service with cf restage phppgadmin-cfready
  7. Connect to phpPgAdmin through its HTTP route, and select the db instance to connect to from the list, and specify associated login/password of the pgdb to access

Combo

Bonus command to deploy the app, discover and bind all "postgresql" tagged service instances in the current space to the phppgadmin-cfready application, using cf curl, jq, and xargs:

git clone https://github.com/cloudfoundry-community/phppgadmin-cf -b cf-ready
cd phppgadmin-cf
appname=phppgadmin
space_guid=$(cat ~/.cf/config.json| jq -r ".SpaceFields.GUID")
space_name=$(cat ~/.cf/config.json| jq -r ".SpaceFields.Name")
org_name=$(cat ~/.cf/config.json| jq -r ".OrganizationFields.Name")
app_hostname="phppgadmin-${org_name}-${space_name}"
cf push ${appname} --no-start -n ${app_hostname}
cf curl /v2/services | jq -r ".resources[] | select(.entity.tags | contains([\"postgresql\"])) | .entity.service_plans_url" | xargs -L1 cf curl | jq -r ".resources[].entity.service_instances_url" | awk "{print \$1\"\\\\?q=space_guid:${space_guid}\"}" | xargs -L1 cf curl | jq -r ".resources[].entity.name" | xargs -L1 cf bind-service ${appname}
cf restart ${appname}

Yeah, cf curl, jq and xargs are pretty fantastic when combined together.

To dump all the credentials for all the bound databases, try:

cf curl /v2/apps\?q=name:${appname} | jq -r ".resources[0].entity.service_bindings_url" | xargs -L1 cf curl | jq -r ".resources[].entity.credentials"

FAQ

I'm getting the following error message, although the submitted credentials are correct:

Attempt to connect with invalid server parameter, possibly someone is trying to hack your system

Try closing your HTTP session (clear your cookies or use a private browsing window) to flush your PHP session. It might be your previous attempts to log in are interferring.

phppgadmin-cf's People

Contributors

arthurhlt avatar drnic avatar ffflabs avatar firzen avatar fwendt avatar g0tar avatar gberche-orange avatar hans-chen avatar ibarwick avatar ioguix avatar ironiridis avatar kissaki avatar leonardosapiras avatar marv-cz avatar mhagander avatar rjuju avatar skatox avatar xabolcs avatar xzilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phppgadmin-cf's Issues

Wont Install on cflinuxfs3 - looking for libicui18n.so.52

When I did a push of the current clode following the README steps the app deploys but is inaccessible due to what appears to be a missing lib file
This is to build in a cflinuxfs3 instance due to the imminent demise of cflinuxfs2

/home/vcap/app/php/sbin/php-fpm: error while loading shared libraries: libicui18n.so.52: cannot open shared object file: No such file or directory

/IdeaProjects/phppgadmin-cf-cf-ready$ cf push --no-start -n phppgadmin-staging -s cflinuxfs3
Pushing from manifest to org test1 / space staging as user1...
Using manifest file /home/user1/IdeaProjects/phppgadmin-cf-cf-ready/manifest.yml
Getting app info...
Updating app with these attributes...
name: phppgadmin-cfready
path: /home/user1/IdeaProjects/phppgadmin-cf-cf-ready
command: $HOME/.bp/bin/start
disk quota: 1G
health check type: port
instances: 1
memory: 1G

  • stack: cflinuxfs2
  • stack: cflinuxfs3
    services:
    webportal-db
    routes:
    removed

Updating app phppgadmin-cfready...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
2.06 MiB / 2.06 MiB [=====================================================================================================================================================] 100.00% 12s

Waiting for API to complete processing files...

name: phppgadmin-cfready
requested state: stopped
routes: removed
last uploaded:
stack:
buildpacks:

type: web
instances: 0/1
memory usage: 1024M
state since cpu memory disk details
#0 down 2019-02-14T06:34:37Z 0.0% 0 of 0 0 of 0

No server supplied error

Below are the steps to recreate error:

  1. Pushed the application on cloud foundry and binded with postgres instance
  2. During import to a table using any csv file it thows error saying "No server supplied"

Not able to Import/Export

I have deployed the app on Predix Platform and everything seems to be working fine but I'm getting error when trying to export

Export error: Failed to execute pg_dump (given path in your conf/config.inc.php : /home/vcap/tmp/pg_dump). Please, fix this path in your configuration and relog.

Binding multiple service instances on same host but distinct db only keeps the 1st one

While trying to connect two distinct DBs on the page pg process, the phppgadmin-cf only displays the first one in the ui in the list of servers. Could it be possible that the credentials parsing code fails to consider unique host/port/dbname triplet and only considers host/port ?

Reproduced with the following credentials format:

$ cf cups uaadb-pg -p '{"uri":"postgres://192.168.131.8:5524/uaadb"}'
$ cf cups ccdb-pg -p '{"uri":"postgres://192.168.131.8:5524/ccdb"}'

/CC @poblin-orange @ArthurHlt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.