kopia lustrzana https://github.com/OpenDroneMap/NodeODM
commit
21d9bd7ab6
|
@ -37,7 +37,4 @@ COPY . /var/www
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN mkdir tmp
|
RUN mkdir tmp
|
||||||
|
|
||||||
# Fix old version of gdal2tiles.py
|
|
||||||
# RUN (cd / && patch -p0) <patches/gdal2tiles.patch
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/nodejs", "/var/www/index.js"]
|
ENTRYPOINT ["/usr/bin/nodejs", "/var/www/index.js"]
|
||||||
|
|
104
docs/index.adoc
104
docs/index.adoc
|
@ -8,7 +8,7 @@ REST API to access ODM
|
||||||
|
|
||||||
=== Version information
|
=== Version information
|
||||||
[%hardbreaks]
|
[%hardbreaks]
|
||||||
_Version_ : 1.2.2
|
_Version_ : 1.3.0
|
||||||
|
|
||||||
|
|
||||||
=== Contact information
|
=== Contact information
|
||||||
|
@ -43,6 +43,108 @@ _Schemes_ : HTTP
|
||||||
[[_paths]]
|
[[_paths]]
|
||||||
== Paths
|
== Paths
|
||||||
|
|
||||||
|
[[_auth_login_post]]
|
||||||
|
=== POST /auth/login
|
||||||
|
|
||||||
|
==== Description
|
||||||
|
Retrieve a token from a username/password pair.
|
||||||
|
|
||||||
|
|
||||||
|
==== Parameters
|
||||||
|
|
||||||
|
[options="header", cols=".^2,.^3,.^9,.^4,.^2"]
|
||||||
|
|===
|
||||||
|
|Type|Name|Description|Schema|Default
|
||||||
|
|*Body*|*password* +
|
||||||
|
_required_|Password|string|
|
||||||
|
|*Body*|*username* +
|
||||||
|
_required_|Username|string|
|
||||||
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
==== Responses
|
||||||
|
|
||||||
|
[options="header", cols=".^2,.^14,.^4"]
|
||||||
|
|===
|
||||||
|
|HTTP Code|Description|Schema
|
||||||
|
|*200*|Login Succeeded|<<_auth_login_post_response_200,Response 200>>
|
||||||
|
|*default*|Error|<<_error,Error>>
|
||||||
|
|===
|
||||||
|
|
||||||
|
[[_auth_login_post_response_200]]
|
||||||
|
*Response 200*
|
||||||
|
|
||||||
|
[options="header", cols=".^3,.^11,.^4"]
|
||||||
|
|===
|
||||||
|
|Name|Description|Schema
|
||||||
|
|*token* +
|
||||||
|
_required_|Token to be passed as a query parameter to other API calls.|string
|
||||||
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
[[_auth_login_get]]
|
||||||
|
=== GET /auth/login
|
||||||
|
|
||||||
|
==== Description
|
||||||
|
Retrieves login information for this node.
|
||||||
|
|
||||||
|
|
||||||
|
==== Responses
|
||||||
|
|
||||||
|
[options="header", cols=".^2,.^14,.^4"]
|
||||||
|
|===
|
||||||
|
|HTTP Code|Description|Schema
|
||||||
|
|*200*|LoginInformation|<<_auth_login_get_response_200,Response 200>>
|
||||||
|
|===
|
||||||
|
|
||||||
|
[[_auth_login_get_response_200]]
|
||||||
|
*Response 200*
|
||||||
|
|
||||||
|
[options="header", cols=".^3,.^11,.^4"]
|
||||||
|
|===
|
||||||
|
|Name|Description|Schema
|
||||||
|
|*instructions* +
|
||||||
|
_optional_|Message to be displayed to the user prior to login/registration. This might include instructions on how to register or login, or to communicate that authentication is not available.|string
|
||||||
|
|*loginUrl* +
|
||||||
|
_required_|URL (absolute or relative) where to make a POST request to obtain a token, or null if login is disabled.|string
|
||||||
|
|*registerUrl* +
|
||||||
|
_required_|URL (absolute or relative) where to make a POST request to register a user, or null if registration is disabled.|string
|
||||||
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
==== Tags
|
||||||
|
|
||||||
|
* auth
|
||||||
|
|
||||||
|
|
||||||
|
[[_auth_register_post]]
|
||||||
|
=== POST /auth/register
|
||||||
|
|
||||||
|
==== Description
|
||||||
|
Register a new username/password.
|
||||||
|
|
||||||
|
|
||||||
|
==== Parameters
|
||||||
|
|
||||||
|
[options="header", cols=".^2,.^3,.^9,.^4,.^2"]
|
||||||
|
|===
|
||||||
|
|Type|Name|Description|Schema|Default
|
||||||
|
|*Body*|*password* +
|
||||||
|
_required_|Password|string|
|
||||||
|
|*Body*|*username* +
|
||||||
|
_required_|Username|string|
|
||||||
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
==== Responses
|
||||||
|
|
||||||
|
[options="header", cols=".^2,.^14,.^4"]
|
||||||
|
|===
|
||||||
|
|HTTP Code|Description|Schema
|
||||||
|
|*200*|Response|<<_response,Response>>
|
||||||
|
|===
|
||||||
|
|
||||||
|
|
||||||
[[_info_get]]
|
[[_info_get]]
|
||||||
=== GET /info
|
=== GET /info
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
96
index.js
96
index.js
|
@ -721,6 +721,102 @@ app.get('/info', authCheck, (req, res) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** @swagger
|
||||||
|
* /auth/login:
|
||||||
|
* get:
|
||||||
|
* description: Retrieves login information for this node.
|
||||||
|
* tags: [auth]
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: LoginInformation
|
||||||
|
* schema:
|
||||||
|
* type: object
|
||||||
|
* required: [message, loginUrl, registerUrl]
|
||||||
|
* properties:
|
||||||
|
* instructions:
|
||||||
|
* type: string
|
||||||
|
* description: Message to be displayed to the user prior to login/registration. This might include instructions on how to register or login, or to communicate that authentication is not available.
|
||||||
|
* loginUrl:
|
||||||
|
* type: string
|
||||||
|
* description: URL (absolute or relative) where to make a POST request to obtain a token, or null if login is disabled.
|
||||||
|
* registerUrl:
|
||||||
|
* type: string
|
||||||
|
* description: URL (absolute or relative) where to make a POST request to register a user, or null if registration is disabled.
|
||||||
|
*/
|
||||||
|
app.get('/auth/info', (req, res) => {
|
||||||
|
res.json({
|
||||||
|
message: "Authentication not available on this node",
|
||||||
|
loginUrl: null,
|
||||||
|
registerUrl: null
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/** @swagger
|
||||||
|
* /auth/login:
|
||||||
|
* post:
|
||||||
|
* description: Retrieve a token from a username/password pair.
|
||||||
|
* parameters:
|
||||||
|
* -
|
||||||
|
* name: username
|
||||||
|
* in: body
|
||||||
|
* description: Username
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* -
|
||||||
|
* name: password
|
||||||
|
* in: body
|
||||||
|
* description: Password
|
||||||
|
* required: true
|
||||||
|
* type: string
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Login Succeeded
|
||||||
|
* schema:
|
||||||
|
* type: object
|
||||||
|
* required: [token]
|
||||||
|
* properties:
|
||||||
|
* token:
|
||||||
|
* type: string
|
||||||
|
* description: Token to be passed as a query parameter to other API calls.
|
||||||
|
* default:
|
||||||
|
* description: Error
|
||||||
|
* schema:
|
||||||
|
* $ref: '#/definitions/Error'
|
||||||
|
*/
|
||||||
|
app.post('/auth/login', (req, res) => {
|
||||||
|
res.json({error: "Not available"});
|
||||||
|
});
|
||||||
|
|
||||||
|
/** @swagger
|
||||||
|
* /auth/register:
|
||||||
|
* post:
|
||||||
|
* description: Register a new username/password.
|
||||||
|
* parameters:
|
||||||
|
* -
|
||||||
|
* name: username
|
||||||
|
* in: body
|
||||||
|
* description: Username
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* -
|
||||||
|
* name: password
|
||||||
|
* in: body
|
||||||
|
* description: Password
|
||||||
|
* required: true
|
||||||
|
* type: string
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Response
|
||||||
|
* schema:
|
||||||
|
* $ref: "#/definitions/Response"
|
||||||
|
*/
|
||||||
|
app.post('/auth/register', (req, res) => {
|
||||||
|
res.json({error: "Not available"});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
app.use((err, req, res, next) => {
|
app.use((err, req, res, next) => {
|
||||||
logger.error(err.stack);
|
logger.error(err.stack);
|
||||||
res.json({error: err.message});
|
res.json({error: err.message});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "node-opendronemap",
|
"name": "node-opendronemap",
|
||||||
"version": "1.2.2",
|
"version": "1.3.0",
|
||||||
"description": "REST API to access ODM",
|
"description": "REST API to access ODM",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- /usr/bin/gdal2tiles.py 2014-04-05 14:21:17.000000000 +0000
|
|
||||||
+++ gdal2tiles.py 2016-11-08 19:33:42.162188732 +0000
|
|
||||||
@@ -783,7 +783,7 @@
|
|
||||||
self.out_srs = osr.SpatialReference()
|
|
||||||
|
|
||||||
if self.options.profile == 'mercator':
|
|
||||||
- self.out_srs.ImportFromEPSG(900913)
|
|
||||||
+ self.out_srs.ImportFromEPSG(3857)
|
|
||||||
elif self.options.profile == 'geodetic':
|
|
||||||
self.out_srs.ImportFromEPSG(4326)
|
|
||||||
else:
|
|
Ładowanie…
Reference in New Issue