Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout for find queries #40

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
1a2a602
Fixing dependencies to work with node v12
cajogos Mar 9, 2020
40afebc
Add binary data support
Mar 23, 2020
902c4f1
Update depencies server and fix build scripts
Mar 23, 2020
2793c92
Update to angular 8
Mar 23, 2020
e3686e4
Update some packages before angular 9
Mar 23, 2020
e70d0e5
Upgrade to angular 9
Mar 23, 2020
4961dd1
Some theme fixes and npm audit
Mar 23, 2020
26bddb4
Update readme
Mar 23, 2020
f4f3db7
Merge pull request #1 from tomvardasca/binarydata_support
tomvardasca Mar 23, 2020
3efaec0
Create publish_docker.yml
tomvardasca Mar 23, 2020
89353cf
Update publish_docker.yml
tomvardasca Mar 23, 2020
4cca931
Fix workflow
Mar 23, 2020
afa9864
Fix docker image
Mar 23, 2020
8b3911f
Use node slim docker image
Mar 23, 2020
b1d9919
Add configurable timeout for find queries
SirAnthony Apr 30, 2020
1386768
Update README.md
SirAnthony Apr 30, 2020
9298fc8
Merge pull request #1 from cajogos/master
SirAnthony May 1, 2020
067e0cd
Bump version
SirAnthony May 1, 2020
7a44036
merge
SirAnthony May 1, 2020
3a0d9a3
Merge branch 'tomvardasca-master'
SirAnthony May 1, 2020
cd237e6
Remove temporary files
SirAnthony May 1, 2020
9d790dc
Do not add lockfiles to git
SirAnthony May 1, 2020
e6d9272
Fix + encoding
SirAnthony May 7, 2020
1bee820
Do not publish to wrong repositories
SirAnthony May 7, 2020
d625a18
Do not execute doker actionswq
SirAnthony May 7, 2020
ca18af9
Update dependencies
SirAnthony May 7, 2020
334e9c5
Fix codemirror cannot calculate size on documents with <10 lines
SirAnthony May 7, 2020
00bc1c1
Ignore vim files
SirAnthony May 8, 2020
e0103e5
Add server support for objectid
SirAnthony May 8, 2020
03e5e53
Fix angular route issue
SirAnthony May 8, 2020
62d0839
Use angular url fix
SirAnthony May 8, 2020
bf3ec81
Add converter to objectid
SirAnthony May 8, 2020
6feb4e9
Fix objectid usage
SirAnthony May 8, 2020
6101bb2
Improve coding
SirAnthony May 8, 2020
a9fb109
Check objectid also
SirAnthony May 8, 2020
cbb21f2
Add insertion server side
SirAnthony May 8, 2020
8c9e2af
Add view for documents insert
SirAnthony May 8, 2020
fcc0945
Bump version
SirAnthony May 8, 2020
16a1e01
change meta info
Aug 27, 2020
d478674
fix removing doc from document's page
Sep 4, 2020
624bdb1
chmod +x
Sep 4, 2020
cfcbe75
fix ts errors
Sep 4, 2020
b9e375c
change meta->hola
Sep 4, 2020
c46f2bf
reset pagination on query changed
Sep 4, 2020
3b538aa
Merge pull request #3 from alexbadm/master
SirAnthony Sep 7, 2020
c2aa781
better positioning of yes-no buttons
Sep 7, 2020
3e63c84
revert objid_re
Sep 7, 2020
acfa769
fix preparing script
Sep 7, 2020
a8d654c
bump version
Sep 7, 2020
91fd408
increase limit for bodyParser
Sep 7, 2020
8d88955
bump patch version
Sep 7, 2020
96b3d80
Bump version to match npm
SirAnthony Sep 7, 2020
129a561
Improve build scripts
SirAnthony Sep 7, 2020
637d4b2
Fix slashes in document id
SirAnthony Sep 8, 2020
cc5144f
display id in original letter-case
Sep 17, 2020
3c3bda7
useUnifiedTopology
Feb 18, 2021
3582327
Merge pull request #4 from alexbadm/master
alexbadm Feb 19, 2021
8e944d2
bump patch version
Feb 19, 2021
b7c8f91
update dependencies
Feb 19, 2021
83cd8de
rm Error as a Server
Feb 19, 2021
a5451b4
update dependencies
Feb 25, 2021
e1bc130
replace obsolete URL.parse
Feb 25, 2021
dcd723e
import just class
Feb 25, 2021
bd1ba06
revert output message on mongodb connected
Feb 25, 2021
6bb9c48
bump patch version
Feb 25, 2021
c05f0da
enable ReadPreference.SECONDARY_PREFERRED
Feb 25, 2021
d89f45c
bump to 1.3.14
Feb 25, 2021
78adbe1
Sync mongoku with BRD
sreym Feb 21, 2023
e362d70
Fix sign in message
sreym Feb 22, 2023
191e5c7
Bump version
sreym Feb 22, 2023
799a869
Update nedb to a newer version
sreym Feb 6, 2024
13f5a14
Merge updates from base, bump libs (#5)
SirAnthony Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

hosts.db
*.tgz

# compiled output
.angular/
/dist
/dist-server
/tmp
Expand All @@ -12,6 +14,8 @@ hosts.db
node_modules

# IDEs and editors
*.swp
*.swo
/.idea
.project
.classpath
Expand All @@ -35,6 +39,8 @@ node_modules
npm-debug.log
testem.log
/typings
package-lock.json
app/package-lock.json

# e2e
/e2e/*.js
Expand Down
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
FROM node:latest
FROM node:18

ENV UID=991 GID=991

ENV MONGOKU_DEFAULT_HOST="localhost:27017"
ENV MONGOKU_DEFAULT_HOST="mongodb://localhost:27017"
ENV MONGOKU_SERVER_PORT=3100
ENV MONGOKU_DATABASE_FILE="/tmp/mongoku.db"
ENV MONGOKU_COUNT_TIMEOUT=5000
ARG READ_ONLY=false
ENV MONGOKU_READ_ONLY_MODE=$READ_ONLY

RUN mkdir -p /app
WORKDIR /app
RUN mkdir -p /mongoku
WORKDIR /mongoku

COPY ./ /app
COPY ./ /mongoku

RUN npm install -g typescript @angular/cli \
&& npm install \
RUN npm install -g typescript@4.5.4 @angular/cli \
&& npm ci \
&& cd app \
&& npm install \
&& ng build --prod \
&& npm ci \
&& ng build --configuration production \
&& cd .. \
&& tsc

EXPOSE 3100

LABEL description="MongoDB client for the web. Query your data directly from your browser. You can host it locally, or anywhere else, for you and your team."


CMD ["/app/docker-run.sh"]
ENTRYPOINT node dist/server.js
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,11 @@ docker run -d --name mongoku -p 3100:3100 yournamehere/mongoku
If you want to manually build and run mongoku, just clone this repository and run the following:

```bash
# Install the angular cli if you don't have it already
npm install -g typescript @angular/cli
npm install

# Build the front
cd app
npm install
ng build

# And the back
cd ..
tsc
# Install deps and build everything
./run.sh

# Run
node dist/server.js
npm start
```

### Configuration
Expand All @@ -91,4 +81,33 @@ MONGOKU_DATABASE_FILE="/tmp/mongoku.db"

# Timeout before falling back to estimated documents count in ms (Default = 5000)
MONGOKU_COUNT_TIMEOUT=1000

# Read-only mode
MONGOKU_READ_ONLY_MODE=true

# Timeout before aborting find query in ms (Default = 300000)
MONGOKU_QUERY_TIMEOUT=5000

# Session secret
MONGOKU_SESSION_SECRET="keyboard cat"

# Authentication endpoint. This address will be used to authenticate users
MONGOKU_AUTH_ENDPOINT=http://localhost/auth

# Disable authorization (allow any requests), useful for debugging environment
MONGOKU_DISABLE_AUTH=true

# MONGOKU_EXT_SESSION_COOKIE and MONGOKU_EXT_SESSION_ENDPOINT enable
# "external session auth" mode when a request to the api may be authorized
# using web session managed by another appication.

# If the given cookie is present on a request to the api
# mongoku server mades request to MONGOKU_EXT_SESSION_ENPOINT with that cookie
# to get the current user.
MONGOKU_EXT_SESSION_COOKIE="app.sid"

# The given endpoint must accept GET request with MONGOKU_EXT_SESSION_COOKIE set
# and response with json {"login":"<curret_user_login>"} if session is valid
# or 40x code otherwise.
MONGOKU_EXT_SESSION_ENDPOINT=http://localhost/whoami
```
21 changes: 15 additions & 6 deletions app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "../dist/app",
"index": "src/index.html",
"main": "src/main.ts",
Expand All @@ -22,14 +23,23 @@
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [],
"allowedCommonJsDependencies": [
"codemirror/mode/javascript/javascript",
"@ctrl/ngx-codemirror"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down Expand Up @@ -65,8 +75,7 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"src/tsconfig.app.json"
],
"exclude": [
"**/node_modules/**"
Expand All @@ -85,10 +94,10 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
}
12 changes: 12 additions & 0 deletions app/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
Loading