electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 351 forks source link

ackee does not read the env file #299

Closed itstueben closed 2 years ago

itstueben commented 2 years ago

🐞 Describe the bug

i intsalled ackee as described. I create a ".env" file in the root directory and start with "yarn start" i got the following output after starting

yarn start
yarn run v1.22.15
$ npm run build && npm run server

> ackee@3.2.0 build
> node build.js

[Ackee] › …  awaiting  Building and writing 'dist/index.html'
[Ackee] › ✔  success   Finished building 'dist/index.html'

> ackee@3.2.0 server
> node src/index.js

[Ackee] › …  awaiting  Connecting to mongodb://localhost:27017/ackee
(node:5623) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./public/" in the "exports" field module resolution of the package at /home/roettens/Ackee/node_modules/extract-files/package.json.
Update this package.json to use a subpath pattern like "./public/*".
(Use `node --trace-deprecation ...` to show where the warning was created)
[Ackee] › ✖  fatal     MongoParseError: URI malformed
    at new ConnectionString (/home/roettens/Ackee/node_modules/mongodb-connection-string-url/lib/index.js:77:19)
    at Object.parseOptions (/home/roettens/Ackee/node_modules/mongodb/lib/connection_string.js:211:17)
    at new MongoClient (/home/roettens/Ackee/node_modules/mongodb/lib/mongo_client.js:62:46)
    at /home/roettens/Ackee/node_modules/mongoose/lib/connection.js:779:16
    at new Promise (<anonymous>)
    at NativeConnection.Connection.openUri (/home/roettens/Ackee/node_modules/mongoose/lib/connection.js:776:19)
    at /home/roettens/Ackee/node_modules/mongoose/lib/index.js:330:10
    at /home/roettens/Ackee/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5
    at new Promise (<anonymous>)
    at promiseOrCallback (/home/roettens/Ackee/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10)
error Command failed with exit code 1.

My .env file: ACKEE_MONGODB=mongodb://username:password@localhost:27017/ackee ACKEE_USERNAME=something ACKEE_PASSWORD=somewhat

📚 To Reproduce

yarn start

💡 Expected behavior

the connection string looks like i configured in .env file

🖼️ Screenshots

If applicable, add screenshots to help explain your problem.

⚙️ Environment

Add any other context about the problem here.

electerious commented 2 years ago

Ackee removes the username and password from the connection string for security reasons. It seems that the env works correctly, but there's something wrong with the URI itself. Maybe some special characters in the username/password?

itstueben commented 2 years ago

Yeahh, there were special characters in the password that are not URI malformed. This is now running as expexted