samueltallet / mongodb-php-gui Goto Github PK
View Code? Open in Web Editor NEWOpen-source graphical interface for MongoDB database. Written in PHP, JavaScript, HTML & CSS.
Open-source graphical interface for MongoDB database. Written in PHP, JavaScript, HTML & CSS.
Hi could you please explain how can I install and serve the application from a subfolder?
Instead of serving the application from http://domain.com, I would like to serve it from http://domain.com/mongodb.
I'm trying to create a Docker image, for which you can configure the basepath.
The Dockerfile I'm using is:
FROM registry.hub.docker.com/library/php:7.4.16-apache-buster
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENV VERSION="v1.1.0"
WORKDIR /var/www/html
RUN \
apt-get update && \
apt-get install -y build-essential git unzip && \
pecl install mongodb-1.8.2 && \
docker-php-ext-enable mongodb && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
a2enmod rewrite
CMD ["bash", "/docker-entrypoint.sh"]
and docker-entrypoint.sh is
#!/usr/bin/env bash
if [ ! -f /initialized ]; then
echo "Installing into ${PWD}"
git clone https://github.com/SamuelTS/MongoDB-PHP-GUI.git .
git checkout "tags/${VERSION}" -b "${VERSION}"
composer install
touch /initialized
fi
apache2-foreground
I think I'm missing something in the rewrite rules for Apache, but unfortunately this is not my area of expertise and I can't properly debug the issue.
With the current rewrite rules if I access http://domain.com/mongodb/login# everything works as expected, but if I access http://domain.com/mongodb I get redirected to http://domain.com/mongodb//index/login# and everything is broken.
Could you provide some guidance?
Thanks in advance.
I would like a way to setup the field(s) to return.
for example for a Person
, I would have an extra text field to set {"name":1, "age":1}
(or it could be a bunch of checkboxes)
I would like a way to execute a find/count without leaving text area.
I have a ingress with prefix '/mongo'. When access https://host/mongo it will redirect to https://host/login which could not be accessed
How to deploy on kubernetes
I think that when you type MongoDB login details it should try to connect to MongoDB. If the connection was not successful, display an error on the login page and don't let the user go to the dashboard.
I've seen the way to quick edit a given document attribute when your mouse is hover a given field, you have a pen with a input form to edit the attribute content 👍
but now I need to quickly refactor the whole document:
One simple way to do that is to add an "edit mode"
in current mode, add a EDIT button on a result array > data row
a clic on this button will switch to "edit mode"
in "edit mode"
so cancel return in initial mode without saving
and save return to initial mode after saving document
In base one document
array[1] 0{5} _id{1} $oid:5f325f98114bec5750892193 email:[email protected] emailVerified{1} $date{1} $numberLong:1597141066973 createdAt{1} $date{1} $numberLong:1597136792802 updatedAt{1} $date{1} $numberLong:1597141066984
exporter
[ { "_id": { "$oid": "5f325f98114bec5750892193" }, "email": "[email protected]", "emailVerified": { "$date": { "$numberLong": "1597141066973" } }, "createdAt": { "$date": { "$numberLong": "1597136792802" } }, "updatedAt": { "$date": { "$numberLong": "1597141066984" } } } ]
when try insert get error
Error: invalid document for insert: keys cannot begin with "$": "$date"
For automated deployments it is desirable to pre-populate the login fields for user, host, port, database so these do not have to be looked up by the operator every time they need to login.
I have followed these steps
Docker (PHP built-in server)
Clone current repository.
Run once docker build -t mongodb-php-gui . at project's root directory.
Run docker run -it -p 5000:5000 mongodb-php-gui at project's root directory.
Open your browser at this address: http://127.0.0.1:5000/ to access GUI.
i am able access the UI but how to login ? what will be the credentials
Already installed everything needed, including composer install
, but it displayed 404 not found. Am I missing something?
Hello, I cannot get it to work with docker php-fpm 7.2.
=> PHP Fatal error: Uncaught Error: Class 'Controllers\LoginController' not found in routes.php
Should I install / enable another extension along mongodb ???
Thanks
I don't feel comfortable using "latest" tag, and i'm pretty sure i am not the only one :)
Hi
I've a test environment with a test mongo database and a test user account:
(example on mongodb.com > manage access view > custom role)
NB/ in following example, I replaced real data with "blah blah".
When using "mongo uri login page" with following entry
mongodb+srv://testuser:[email protected]/test-database?retryWrites=true&w=majority
Then I got the following Screen:
If I retry using "detailed fields login ui", then I'm able to get in and I see
Error: No suitable servers found (`serverSelectionTryOnce` set): [Failed to resolve 'blah.blah.mongodb.net']
NB: I got no more logs on docker side:
[Sun Dec 5 14:51:34 2021] 172.21.0.1:53274 Accepted
[Sun Dec 5 14:51:34 2021] 172.21.0.1:53274 [500]: POST /listCollections
[Sun Dec 5 14:51:34 2021] 172.21.0.1:53274 Closing
Please note that if I'm trying to connect from command line in order to list collections, I've no issue
mongo.exe mongodb+srv://testuser:[email protected]/test-database?retryWrites=true\&w=majority
PRIMARY> show collections
.coll
collB
I expect to use MongoDB-PHP-UI even if my security context doesn't allow me to list all databases (end so on.. manage index/users..)
If I've no access to some feature, I may have a feedback to understand that point
If I've only database read/and/or/write access, then I must be able to use MongoDB-PHP-GUI related feature (find/count..)
Is this hostable on shared hosting without access to the cmd line?
All site files are in DocumentRoot, so direct request to any *.php file is allowed. Tested some of them (for example /routes.php) - got 500 Internal server error. I think it would be better to have DocumentRoot dir with only things needed to be publicly accessible and leave all other outside DocumentRoot.
What do you think ?
Hey,
Arm64 is not supported over docker. Will you add it?
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Add option that you can add hcaptcha, so before connecting to DB, users need to complete captcha on the login page.
I cannot query based on objectId in this thing.
{key: "<id>"} doesn't work
{key: ObjectId("<id>")} doesn't work either!
Whole db export import would be very handy for me. Love the product.
Brad
This is a feature request
I've a mongo instance per dev / per integration / per production.
Each time I use MongoDB-PHP-GUI, I have to go back to my creds to pick mongo URI and past it on GUI.
I would like a feature to store my different login:
I've installed it on apache with php 8.1.9. Installed all dependencies with composer. No errors shown.
When i open the page it routes to login# and shows a blank page with the message: No input file specified.
Add an option that you can provide MySQL connection data in the index.php and that session data will be stored in MySQL database when it was provided
Starting from a find on a given collection, I got a json document as result.
If a given attribute has a value ; ex. name : Joe
: by clicking on joe
I can update the value and this works well.
but if a given attribute has a null
value ; ex. name : null
: by clicking on null
I cant update the value and this produces following JavaScript console logs:
VM74:1 Uncaught SyntaxError: Unexpected token d in JSON at position 0
at JSON.parse (<anonymous>)
at MPG.helpers.convertStringToAny (queryDatabase.js:152:64)
at HTMLDivElement.<anonymous> (queryDatabase.js:508:49)
As user, I would like to know where the project is hosted.
support point of view:
help point of view
this could help end users and make some ads for this repo
suggest to add link either on home page and/or on top level menu once logged
I'm able to connect successfully to a (Bitnami) MongoDB container by clicking on "I don't have an URI" and then entering the relevant details. Once logged in, I can see the database that I've set up in the MongoDB container listed under "Databases", towards the top left of the web page.
When I try the same credentials using the mongodb://user:pass...[etc] URI, I can also get logged in, but the difference is that I cannot see the database. On the page being displayed, there's nothing listed under "Databases".
Any help or advice much appreciated.
in mongo console I see
"createdAt" : ISODate("2020-08-11T09:06:32.802Z")
but in interface I see
createdAt{1} $date{1} $numberLong:1597136792802
and date in this format hard to edit
Hi Samuel,
So far the project is really great!
Nevertheless, I have a few feature requests that came up while using the web gui in a larger development environment:
I hope that some or even all features will make it into the product.
Keep up the good work!
Thanks a lot
Attachments:
Example screenshot of collection size in "Rockmongo": http://www.w3big.com/mongodb/rockmongo.png
Hello @SamuelTS,
First of all thanks for your work and for sharing it!
I'm trying to make the UI run, I have the requirement that it has to run behind a reverse proxy. For that I need two things:
(1) I could solve via a special docker setup hack [hack 1]. Albeit it would be certainly nicer to have an environment variable like: docker run -p 5000:5000 samueltallet/mongodb-php-gui. -e CONTEXT='/my/base/url'
or like 2b:
docker run -p 5000:5000 samueltallet/mongodb-php-gui. -e ABS_URI='https://host.com/my/base/url'
(2) My big problem is the login redirect as can be seen here:
It's just not good (for this setup).
I'm wondering if you would feel comfortable having 2a or rather 2b implemented in the codebase.
Thanks for your answer in advance.
Regards,
Viktor
[hack 1]
FROM php:7.4-cli-alpine
WORKDIR /opt/
RUN apk update && apk add --no-cache --virtual .build-deps autoconf build-base openssl-dev curl \
&& pecl install mongodb-1.8.2 && docker-php-ext-enable mongodb \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& apk del .build-deps \
&& apk add --no-cache openjdk8-jre git
RUN git clone https://github.com/SamuelTS/MongoDB-PHP-GUI \
&& mkdir -p /opt/mongodb-php-gui/api/mongo-ui/ \
&& mv MongoDB-PHP-GUI/* /opt/mongodb-php-gui/api/mongo-ui/
WORKDIR /opt/mongodb-php-gui/api/mongo-ui/
RUN composer install
WORKDIR /opt/mongodb-php-gui/
EXPOSE 5000
CMD ["php", "-S", "0.0.0.0:5000"]
Data visualization now displays the contents of the Document in a single window in the output, with no page-turning support. You can display each element of the document in a separate window, then edit the contents of that item individually, add a limit on the maximum number of displays per page, and turn the page to the last item, which feels easier to manage the data.
Hi
On login page we set some sensible credentials (ex. db access).
As php gui user, I dont want that the browser retains form value for this field. I dont want autocomplete. I dont want to be able to retrieve mongodb url from my previous access.
Technically, the input may have autocomplete="off"
or type=password
somewhere .. to dig.
Please notice that this issue is not the opposite of #37 but independant enhancement. This issue drives the "default browser behavior". At the end, if the user want to store some information, this is a choice that should not be forced.
This is a security issue.
Thanks
Regards
Would you consider publishing the Docker image to Docker hub? You can do it for free using the Dockerhub free plan which already integrates with Github.
Accept mongo DB connection URI instead of writing user, password, host, port and database. There should be a button to switch to connection URI authorization on the login page.
Hi Samuel,
as mentioned in the title, the database visualization tab gets really slow when displaying a lot of data. Maybe you can provide a configuration property (gui or docker environment variable) for toggling (show/hide) this tab?
Example: 15+ databases with around 5-10+ collections each.
Best regards
Import from csv / export to csv would be a great feature. I love this software. Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.