-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use ES modules, add eslint, fix issues and CI (#83)
- Loading branch information
Showing
108 changed files
with
802 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
[*.{js,json,yml}] | ||
charset = utf-8 | ||
end_of_line = crlf | ||
indent_style = tabs | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{yaml,yml}] | ||
charset = utf-8 | ||
end_of_line = crlf | ||
indent_style = spaces | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
env: | ||
node: true | ||
extends: | ||
- eslint:recommended | ||
- plugin:n/recommended | ||
parserOptions: | ||
ecmaVersion: 2022 | ||
sourceType: module | ||
globals: | ||
ee: readonly | ||
rules: | ||
n/no-extraneous-import: | ||
- error | ||
- allowModules: | ||
- restify-errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
{ | ||
"debug": true, | ||
"hostname": "127.0.0.1", | ||
"port": 8080, | ||
"exposePort": null, | ||
"apiPath": "/v1", | ||
"ssl": { | ||
"port": 443, | ||
"exposePort": null, | ||
"key": null, | ||
"certificate": null | ||
}, | ||
"serviceAccountCredentialsFile": "privatekey.json", | ||
"googleProjectId": "", | ||
"id": "openeo-earthengine-driver", | ||
"title": "Google Earth Engine Proxy for openEO", | ||
"description": "This is the Google Earth Engine Driver for openEO.\n\nGoogle Earth Engine is a planetary-scale platform for Earth science data & analysis. It is powered by Google's cloud infrastructure and combines a multi-petabyte catalog of satellite imagery and geospatial datasets with planetary-scale analysis capabilities. Google makes it available for scientists, researchers, and developers to detect changes, map trends, and quantify differences on the Earth's surface. Google Earth Engine is free for research, education, and nonprofit use.", | ||
"currency": "USD", | ||
"plans": { | ||
"default": "free", | ||
"options": [ | ||
{ | ||
"name": "free", | ||
"description": "Earth Engine is free for research, education, and nonprofit use. For commercial applications, Google offers paid commercial licenses. Please contact [email protected] for details.", | ||
"paid": false | ||
} | ||
] | ||
}, | ||
"otherVersions": [] | ||
} | ||
"debug": true, | ||
"hostname": "127.0.0.1", | ||
"port": 8080, | ||
"exposePort": null, | ||
"apiPath": "/v1", | ||
"ssl": { | ||
"port": 443, | ||
"exposePort": null, | ||
"key": null, | ||
"certificate": null | ||
}, | ||
"serviceAccountCredentialsFile": "privatekey.json", | ||
"googleProjectId": "", | ||
"id": "openeo-earthengine-driver", | ||
"title": "Google Earth Engine Proxy for openEO", | ||
"description": "This is the Google Earth Engine Driver for openEO.\n\nGoogle Earth Engine is a planetary-scale platform for Earth science data & analysis. It is powered by Google's cloud infrastructure and combines a multi-petabyte catalog of satellite imagery and geospatial datasets with planetary-scale analysis capabilities. Google makes it available for scientists, researchers, and developers to detect changes, map trends, and quantify differences on the Earth's surface. Google Earth Engine is free for research, education, and nonprofit use.", | ||
"currency": "USD", | ||
"plans": { | ||
"default": "free", | ||
"options": [ | ||
{ | ||
"name": "free", | ||
"description": "Earth Engine is free for research, education, and nonprofit use. For commercial applications, Google offers paid commercial licenses. Please contact [email protected] for details.", | ||
"paid": false | ||
} | ||
] | ||
}, | ||
"otherVersions": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
version: '3' | ||
services: | ||
openeo-gee-driver: | ||
build: | ||
context: . | ||
dockerfile: DOCKERFILE | ||
image: openeo-gee:0.3.0 | ||
container_name: openeo-earthengine-driver | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
openeo-gee-driver: | ||
build: | ||
context: . | ||
dockerfile: DOCKERFILE | ||
image: openeo-gee:0.3.0 | ||
container_name: openeo-earthengine-driver | ||
ports: | ||
- "80:80" | ||
- "443:443" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"testEnvironment": "node", | ||
"collectCoverage": true, | ||
"coverageDirectory": "coverage", | ||
"errorOnDeprecated": true, | ||
"reporters": [ | ||
"default", | ||
[ | ||
"./node_modules/jest-html-reporter", | ||
{ "pageTitle": "Test Report for openeo-earthengine-driver" } | ||
] | ||
], | ||
"transform": {}, | ||
"fakeTimers": { | ||
"enableGlobally": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,59 @@ | ||
{ | ||
"name": "@openeo/earthengine-driver", | ||
"version": "1.1.0-dev20240116", | ||
"stac_version": "1.0.0", | ||
"description": "An openEO driver for Google Earth Engine.", | ||
"main": "src/server.js", | ||
"scripts": { | ||
"dev": "nodemon src/server.js --trace-warnings", | ||
"up": "npm run sync && pm2 start src/server.js", | ||
"down": "pm2 stop src/server.js", | ||
"sync": "node src/sync.js", | ||
"adduser": "node src/adduser.js", | ||
"test": "jest --env=node", | ||
"debug": "node --nolazy --inspect src/server.js" | ||
}, | ||
"author": "Matthias Mohr", | ||
"license": "Apache-2.0", | ||
"homepage": "http://openeo.org", | ||
"bugs": { | ||
"url": "https://github.com/Open-EO/openeo-earthengine-editor/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Open-EO/openeo-earthengine-editor.git" | ||
}, | ||
"devDependencies": { | ||
"jest": "^29.7.0", | ||
"jest-html-reporter": "^3.10.2", | ||
"nodemon": "^3.0.2", | ||
"pm2": "^5.3.0" | ||
}, | ||
"dependencies": { | ||
"@google-cloud/storage": "^7.7.0", | ||
"@google/earthengine": "^0.1.385", | ||
"@openeo/js-commons": "^1.4.1", | ||
"@openeo/js-processgraphs": "^1.3.0", | ||
"@seald-io/nedb": "^4.0.4", | ||
"ajv": "^6.12.6", | ||
"axios": "^1.6.5", | ||
"check-disk-space": "^3.4.0", | ||
"epsg-index": "^2.0.0", | ||
"fs-extra": "^11.2.0", | ||
"proj4": "^2.10.0", | ||
"restify": "^11.1.0" | ||
}, | ||
"engines" : { | ||
"node" : ">=17.0.0" | ||
}, | ||
"nodemonConfig": { | ||
"watch": [ | ||
"src/", | ||
"server.js" | ||
] | ||
} | ||
"name": "@openeo/earthengine-driver", | ||
"version": "1.1.0-dev20240116", | ||
"stac_version": "1.0.0", | ||
"description": "An openEO driver for Google Earth Engine.", | ||
"main": "src/server.js", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "nodemon src/server.js --trace-warnings", | ||
"up": "npm run sync && pm2 start src/server.js", | ||
"down": "pm2 stop src/server.js", | ||
"sync": "node src/sync.js", | ||
"adduser": "node src/adduser.js", | ||
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --detectOpenHandles", | ||
"debug": "node --nolazy --inspect src/server.js", | ||
"lint": "eslint src/" | ||
}, | ||
"author": "Matthias Mohr", | ||
"license": "Apache-2.0", | ||
"homepage": "http://openeo.org", | ||
"bugs": { | ||
"url": "https://github.com/Open-EO/openeo-earthengine-editor/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Open-EO/openeo-earthengine-editor.git" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-n": "^16.6.2", | ||
"jest": "^29.7.0", | ||
"jest-html-reporter": "^3.10.2", | ||
"nodemon": "^3.0.2", | ||
"pm2": "^5.3.0" | ||
}, | ||
"dependencies": { | ||
"@google-cloud/storage": "^7.7.0", | ||
"@google/earthengine": "^0.1.385", | ||
"@openeo/js-commons": "^1.4.1", | ||
"@openeo/js-processgraphs": "^1.3.0", | ||
"@seald-io/nedb": "^4.0.4", | ||
"ajv": "^6.12.6", | ||
"axios": "^1.6.5", | ||
"check-disk-space": "^3.4.0", | ||
"epsg-index": "^2.0.0", | ||
"fs-extra": "^11.2.0", | ||
"proj4": "^2.10.0", | ||
"restify": "^11.1.0" | ||
}, | ||
"engines": { | ||
"node": ">=17.0.0" | ||
}, | ||
"nodemonConfig": { | ||
"watch": [ | ||
"src/", | ||
"server.js" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
const ServerContext = require("./servercontext"); | ||
const { createInterface } = require('node:readline/promises'); | ||
/*eslint n/no-process-exit: "off"*/ | ||
import ServerContext from "./utils/servercontext.js"; | ||
import { createInterface } from 'node:readline/promises'; | ||
|
||
async function run() { | ||
const serverContext = new ServerContext(); | ||
const users = serverContext.users(); | ||
const serverContext = new ServerContext(); | ||
const users = serverContext.users(); | ||
|
||
const rl = createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
const stop = (code) => { | ||
rl.close(); | ||
process.exit(code); | ||
} | ||
|
||
const username = await rl.question('Enter a username: '); | ||
if (username && username.length < 4) { | ||
console.error("Username must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const exists = await users.exists(username); | ||
if (exists) { | ||
console.error("User with the given name already exists."); | ||
stop(1); | ||
} | ||
const rl = createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
const stop = (code) => { | ||
rl.close(); | ||
process.exit(code); | ||
} | ||
|
||
const password = await rl.question('Enter a password: '); | ||
if (password && password.length < 4) { | ||
console.error("Password must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const username = await rl.question('Enter a username: '); | ||
if (username && username.length < 4) { | ||
console.error("Username must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const exists = await users.exists(username); | ||
if (exists) { | ||
console.error("User with the given name already exists."); | ||
stop(1); | ||
} | ||
|
||
try { | ||
await users.register(username, password); | ||
console.log('User created!'); | ||
stop(0); | ||
} catch (err) { | ||
console.error(err); | ||
stop(1); | ||
} | ||
const password = await rl.question('Enter a password: '); | ||
if (password && password.length < 4) { | ||
console.error("Password must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
|
||
run(); | ||
try { | ||
await users.register(username, password); | ||
console.log('User created!'); | ||
stop(0); | ||
} catch (err) { | ||
console.error(err); | ||
stop(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.