konga icon indicating copy to clipboard operation
konga copied to clipboard

Patched sails-postgresql module to support >= postgres12

Open vichaos opened this issue 2 years ago • 16 comments

This patch should solve following issues #649 #646 #631 #487 #457

146282410-e1b0c147-2a55-4d5f-941e-ec046381a4ef

vichaos avatar Dec 22 '21 11:12 vichaos

I made some changes to make it auto patched during npm postinstall.

vichaos avatar Jan 07 '22 07:01 vichaos

Is this ever going to get merged?

MuizMahdi avatar Feb 05 '22 09:02 MuizMahdi

Is this ever going to get merged?

@pedrovsn

Ditto. I hope this gets merged soon.

peter-dough avatar Feb 09 '22 02:02 peter-dough

I also hope this gets merged soon @pantsel . I have run into a problem with postgres 14 on konga.

MArK1done avatar Feb 25 '22 16:02 MArK1done

Is there an ETA on merging this ?

axelsean avatar Apr 13 '22 04:04 axelsean

please merge at least this PR

ederparaiso avatar May 05 '22 20:05 ederparaiso

@vichaos : How do you set that up? I checked our your PR branch, build the container but still run into the issue.

git checkout add-support-to-postgres12-or-newer
docker build -t konga .

docker run -it \
    --network host \
    -e "NODE_ENV=development" \
    -e "TOKEN_SECRET=123456" \
    -e "HOST=127.0.0.1" \
    -e "PORT=1337" \
    -e "DB_ADAPTER=postgres" \
    -e "DB_HOST=$KONG_PG_HOST" \
    -e "DB_PORT=$KONG_PG_PORT" \
    -e "DB_USER=$KONG_PG_USER" \
    -e "DB_DATABASE=konga2" \
    -e "DB_PASSWORD=$KONG_PG_PASSWORD" \
    -e "KONGA_HOOK_TIMEOUT=120000" \
    --name konga \
    konga
error: A hook (`orm`) failed to load!
error: error: column r.consrc does not exist
    at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
    at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
    at Socket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
    at Socket.emit (events.js:310:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at addChunk (_stream_readable.js:286:12)
    at readableAddChunk (_stream_readable.js:268:9)
    at Socket.Readable.push (_stream_readable.js:209:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
/app/node_modules/sails-postgresql/lib/adapter.js:158
        var collection = connectionObject.collections[table];
                                          ^

TypeError: Cannot read property 'collections' of undefined

oborchers avatar Jul 08 '22 11:07 oborchers

@oborchers, Please take a look at the image I have provided on the first comment. I have shown how to get konga working with postgres14.

docker run -it \
    --network host \
    -e "NODE_ENV=development" \
    -e "TOKEN_SECRET=123456" \
    -e "HOST=127.0.0.1" \
    -e "PORT=1337" \
    -e "DB_ADAPTER=postgres" \
    -e "DB_HOST=$KONG_PG_HOST" \
    -e "DB_PORT=$KONG_PG_PORT" \
    -e "DB_USER=$KONG_PG_USER" \
    -e "DB_DATABASE=konga2" \
    -e "DB_PASSWORD=$KONG_PG_PASSWORD" \
    -e "KONGA_HOOK_TIMEOUT=120000" \
    -e "DB_IS_PG12_OR_NEWER=true" \                         # <--------  this variable is missing 
    --name konga \
    konga

P.S. I don't remember whether konga supports SCRAM-SHA-256 password_encryption_hash or not but it supports MD5 for sure. So, if it only supports MD5 just follow this SCRAM-SHA-256_to_MD5 guide

Screenshot 2565-07-09 at 07 26 01 Screenshot 2565-07-09 at 07 39 11

vichaos avatar Jul 09 '22 01:07 vichaos

@vichaos it works nicely! Can I give you a coffee?

oborchers avatar Jul 11 '22 09:07 oborchers

Hi, any update regarding the merge?

sha31dev avatar Aug 07 '22 11:08 sha31dev

@vichaos Could you push the image in https://hub.docker.com/?

msartor92 avatar Feb 17 '23 16:02 msartor92

any update?

dark-code avatar Feb 23 '23 06:02 dark-code

worked nicely with postgres 13.7 :+1:

dezoitodemaio avatar Mar 15 '23 20:03 dezoitodemaio

I build get this errors

/usr/local/lib/node_modules/patch-package/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:1047:16)
    at Module._compile (internal/modules/cjs/loader.js:1097:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/patch-package/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `bower --allow-root install && patch-package`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-07-27T07_09_26_624Z-debug.log

thanhtai9606 avatar Jul 27 '23 07:07 thanhtai9606

SCRAM is very important:

  • https://github.com/scram-sasl/info/issues/1

Neustradamus avatar Aug 18 '23 01:08 Neustradamus

@thanhtai9606 I had to use an older version of patch-package

npm install -g [email protected]

matejd avatar Sep 09 '23 09:09 matejd