Skip to content

Commit a778548

Browse files
authored
Merge pull request #332 from pierotofy/ssl
SSL
2 parents 2911c5f + b2739a2 commit a778548

15 files changed

+496
-126
lines changed

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
WO_HOST=localhost
2+
WO_PORT=8000
3+
WO_MEDIA_DIR=appmedia
4+
WO_SSL=NO
5+
WO_SSL_KEY=
6+
WO_SSL_CERT=
7+
WO_SSL_INSECURE_PORT_REDIRECT=80
8+
WO_DEBUG=YES

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ node_modules/
9393
webpack-stats.json
9494
pip-selfcheck.json
9595
.idea/
96+
package-lock.json
97+
.cronenv

Dockerfile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ ENV PYTHONPATH $PYTHONPATH:/webodm
88
RUN mkdir /webodm
99
WORKDIR /webodm
1010

11-
# Install pip reqs
12-
ADD requirements.txt /webodm/
13-
RUN pip install -r requirements.txt
14-
15-
ADD . /webodm/
16-
17-
RUN git submodule update --init
18-
19-
# Install Node.js
2011
RUN curl --silent --location https://deb.nodesource.com/setup_6.x | bash -
21-
RUN apt-get install -y nodejs
12+
RUN apt-get -qq install -y nodejs
2213

2314
# Configure use of testing branch of Debian
2415
RUN printf "Package: *\nPin: release a=stable\nPin-Priority: 900\n" > /etc/apt/preferences.d/stable.pref
2516
RUN printf "Package: *\nPin: release a=testing\nPin-Priority: 750\n" > /etc/apt/preferences.d/testing.pref
2617
RUN printf "deb http://mirror.steadfast.net/debian/ stable main contrib non-free\ndeb-src http://mirror.steadfast.net/debian/ stable main contrib non-free" > /etc/apt/sources.list.d/stable.list
2718
RUN printf "deb http://mirror.steadfast.net/debian/ testing main contrib non-free\ndeb-src http://mirror.steadfast.net/debian/ testing main contrib non-free" > /etc/apt/sources.list.d/testing.list
2819

29-
# Install GDAL, nginx
30-
RUN apt-get update && apt-get install -t testing -y binutils libproj-dev gdal-bin nginx
20+
# Install Node.js GDAL, nginx, letsencrypt
21+
RUN apt-get -qq update && apt-get -qq install -t testing -y binutils libproj-dev gdal-bin nginx && apt-get -qq install -y gettext-base cron certbot
22+
23+
# Install pip reqs
24+
ADD requirements.txt /webodm/
25+
RUN pip install -r requirements.txt
26+
27+
ADD . /webodm/
28+
29+
# Setup cron
30+
RUN ln -s /webodm/nginx/crontab /etc/cron.d/nginx-cron && chmod 0644 /webodm/nginx/crontab && service cron start && chmod +x /webodm/nginx/letsencrypt-autogen.sh
31+
32+
RUN git submodule update --init
3133

3234
WORKDIR /webodm/nodeodm/external/node-OpenDroneMap
3335
RUN npm install

README.md

Lines changed: 106 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
A free, user-friendly, extendable application and [API](http://docs.webodm.org) for drone image processing. Generate georeferenced maps, point clouds, elevation models and textured 3D models from aerial images. It uses [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap) for processing.
66

77
* [Getting Started](#getting-started)
8-
* [Common Troubleshooting](#common-troubleshooting)
98
* [Add More Processing Nodes](#add-more-processing-nodes)
109
* [Security](#security)
10+
* [Enable SSL](#enable-ssl)
1111
* [Where Are My Files Stored?](#where-are-my-files-stored)
12+
* [Common Troubleshooting](#common-troubleshooting)
1213
* [API Docs](#api-docs)
13-
* [Run the docker version as a Linux Service](#run-the-docker-version-as-a-linux-service)
14-
* [Run it natively](#run-it-natively)
1514
* [OpenDroneMap, node-OpenDroneMap, WebODM... what?](#opendronemap-node-opendronemap-webodm-what)
1615
* [Roadmap](#roadmap)
17-
* [Terminology](#terminology)
1816
* [Getting Help](#getting-help)
17+
* [Support the Project](#support-the-project)
18+
* [Become a Contributor](#become-a-contributor)
19+
* [Run the docker version as a Linux Service](#run-the-docker-version-as-a-linux-service)
20+
* [Run it natively](#run-it-natively)
1921

2022

2123
![Alt text](https://user-images.githubusercontent.com/1951843/28586405-af18e8cc-7141-11e7-9853-a7feca7c9c6b.gif)
@@ -26,7 +28,6 @@ A free, user-friendly, extendable application and [API](http://docs.webodm.org)
2628

2729
![Alt text](https://user-images.githubusercontent.com/1951843/28586977-8588ebfe-7143-11e7-94d6-a66bf02c1517.png)
2830

29-
If you know Python, web technologies (JS, HTML, CSS, etc.) or both, it's easy to make a change to WebODM! Make a fork, clone the repository and run `./devenv.sh start`. That's it! See the [Development Quickstart](http://docs.webodm.org/#development-quickstart) and [Contributing](/CONTRIBUTING.md) documents for more information. All ideas are considered and people of all skill levels are welcome to contribute.
3031

3132
## Getting Started
3233

@@ -68,6 +69,50 @@ We recommend that you read the [Docker Documentation](https://docs.docker.com/)
6869

6970
For Windows users an [Installer](https://www.webodm.org/installer) is also available.
7071

72+
### Add More Processing Nodes
73+
74+
WebODM can be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap). The default configuration already includes a "node-odm-1" processing node which runs on the same machine as WebODM, just to help you get started. As you become more familiar with WebODM, you might want to install processing nodes on separate machines.
75+
76+
Adding more processing nodes will allow you to run multiple jobs in parallel.
77+
78+
You **will not be able to distribute a single job across multiple processing nodes**. We are actively working to bring this feature to reality, but we're not there yet.
79+
80+
### Security
81+
82+
If you want to run WebODM in production, make sure to pass the `--no-debug` flag while starting WebODM:
83+
84+
```bash
85+
./webodm.sh down && ./webodm.sh start --no-debug
86+
```
87+
88+
This will disable the `DEBUG` flag from `webodm/settings.py` within the docker container. This is [really important](https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-DEBUG).
89+
90+
### Enable SSL
91+
92+
WebODM has the ability to automatically request and install a SSL certificate via [Let’s Encrypt](https://letsencrypt.org/), or you can manually specify your own key/certificate pair.
93+
94+
- Setup your DNS record (webodm.myorg.com --> IP of server).
95+
- Make sure port 80 and 443 are open.
96+
- Run the following:
97+
98+
```bash
99+
./webodm.sh down && ./webodm.sh start --ssl --hostname webodm.myorg.com
100+
```
101+
102+
That's it! The certificate will automatically renew when needed.
103+
104+
If you want to specify your own key/certificate pair, simply pass the `--ssl-key` and `--ssl-cert` option to `./webodm.sh`. See `./webodm.sh --help` for more information.
105+
106+
### Where Are My Files Stored?
107+
108+
When using Docker, all processing results are stored in a docker volume and are not available on the host filesystem. If you want to store your files on the host filesystem instead of a docker volume, you need to pass a path via the `--media-dir` option:
109+
110+
```bash
111+
./webodm.sh down && ./webodm.sh start --media-dir /home/user/webodm_data
112+
```
113+
114+
Note that existing task results will not be available after the change. Refer to the [Migrate Data Volumes](https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes) section of the Docker documentation for information on migrating existing task results.
115+
71116
### Common Troubleshooting
72117

73118
Sympthoms | Possible Solutions
@@ -82,41 +127,74 @@ Getting a `No space left on device` error, but hard drive has enough space left
82127

83128
Have you had other issues? Please [report them](https://github.com/OpenDroneMap/WebODM/issues/new) so that we can include them in this document.
84129

85-
### Add More Processing Nodes
130+
## API Docs
86131

87-
WebODM can be linked to one or more processing nodes running [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap). The default configuration already includes a "node-odm-1" processing node which runs on the same machine as WebODM, just to help you get started. As you become more familiar with WebODM, you might want to install processing nodes on separate machines.
132+
See the [API documentation page](http://docs.webodm.org).
88133

89-
Adding more processing nodes will allow you to run multiple jobs in parallel.
134+
## OpenDroneMap, node-OpenDroneMap, WebODM... what?
90135

91-
You **will not be able to distribute a single job across multiple processing nodes**. We are actively working to bring this feature to reality, but we're not there yet.
136+
The [OpenDroneMap project](https://github.com/OpenDroneMap/) is composed of several components.
92137

93-
### Security
138+
- [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap) is a command line toolkit that processes aerial images. Users comfortable with the command line are probably OK using this component alone.
139+
- [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap) is a lightweight interface and API (Application Program Interface) built directly on top of [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap). Users not comfortable with the command line can use this interface to process aerial images and developers can use the API to build applications. Features such as user authentication, map displays, etc. are not provided.
140+
- [WebODM](https://github.com/OpenDroneMap/WebODM) adds more features such as user authentication, map displays, 3D displays, a higher level API and the ability to orchestrate multiple processing nodes (run jobs in parallel). Processing nodes are simply servers running [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap).
94141

95-
If you want to run WebODM in production, make sure to disable the `DEBUG` flag from `webodm/settings.py` and go through the [Django Deployment Checklist](https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/).
142+
![webodm](https://cloud.githubusercontent.com/assets/1951843/25567386/5aeec7aa-2dba-11e7-9169-aca97b70db79.png)
96143

97-
### Where Are My Files Stored?
144+
In general, follow these guidelines to find out what you should use:
98145

99-
When using Docker, all processing results are stored in a docker volume and are not available on the host filesystem. If you want to store your files on the host filesystem instead of a docker volume, you need to change a line in `docker-compose.yml` as follows:
146+
I am a... | Best choice
147+
--------- | -----------
148+
End user, I'm not really comfortable with the command line | [WebODM](https://github.com/OpenDroneMap/WebODM)
149+
End user, I like shell commands, I need to process images for myself. I use other software to display processing results | [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap)
150+
End user, I can work with the command line, but I'd rather not. I use other software to display processing results | [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap)
151+
End user, I need a drone mapping application for my organization that everyone can use. | [WebODM](https://github.com/OpenDroneMap/WebODM)
152+
Developer, I'm looking to build an app that displays map results and takes care of things like permissions | [WebODM](https://github.com/OpenDroneMap/WebODM)
153+
Developer, I'm looking to build an app that will stay behind a firewall and just needs raw results | [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap)
100154

101-
From:
102-
```
103-
volumes:
104-
- appmedia:/webodm/app/media
105-
```
155+
## Roadmap
156+
- [X] User Registration / Authentication
157+
- [X] UI mockup
158+
- [X] Task Processing
159+
- [X] 2D Map Display
160+
- [X] 3D Model Display
161+
- [ ] NDVI display
162+
- [ ] Volumetric Measurements
163+
- [X] Cluster management and setup.
164+
- [ ] Mission Planner
165+
- [ ] Plugins/Webhooks System
166+
- [X] API
167+
- [X] Documentation
168+
- [ ] Android Mobile App
169+
- [ ] iOS Mobile App
170+
- [ ] Processing Nodes Volunteer Network
171+
- [X] Unit Testing
172+
- [X] SSL Support
106173

107-
To:
108-
```
109-
volumes:
110-
- /path/where/to/store/files:/webodm/app/media
111-
```
174+
Don't see a feature that you want? [Help us make it happen](/CONTRIBUTING.md).
112175

113-
Then restart WebODM.
176+
## Getting Help
114177

115-
Note that existing task results will not be available after the change. Refer to the [Migrate Data Volumes](https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes) section of the Docker documentation for information on migrating existing task results.
178+
We have several channels of communication for people to ask questions and to get involved with the community:
116179

117-
## API Docs
180+
- [OpenDroneMap Community Forum](http://community.opendronemap.org/c/webodm)
181+
- [Report Issues](https://github.com/OpenDroneMap/WebODM/issues)
118182

119-
See the [API documentation page](http://docs.webodm.org).
183+
We also have a [Gitter Chat](https://gitter.im/OpenDroneMap/web-development), but the preferred way to communicate is via the [OpenDroneMap Community Forum](http://community.opendronemap.org/c/webodm).
184+
185+
## Support the Project
186+
187+
There are many ways to contribute back to the project:
188+
189+
- Help us test new and existing features and report [bugs](https://www.github.com/OpenDroneMap/WebODM/issues) and [feedback](http://community.opendronemap.org/c/webodm).
190+
- [Share](http://community.opendronemap.org/c/datasets) your aerial datasets.
191+
- Help answer questions on the community [forum](http://community.opendronemap.org/c/webodm) and [chat](https://gitter.im/OpenDroneMap/web-development).
192+
- While we don't accept donations, you can purchase an [installer](https://webodm.org/download#installer) or a [premium support package](https://webodm.org/services#premium-support).
193+
- Become a contributor (see below).
194+
195+
## Become a Contributor
196+
197+
If you know Python, web technologies (JS, HTML, CSS, etc.) or both, it's easy to make a change to WebODM! Make a fork, clone the repository and run `./devenv.sh start`. That's it! See the [Development Quickstart](http://docs.webodm.org/#development-quickstart) and [Contributing](/CONTRIBUTING.md) documents for more information. All ideas are considered and people of all skill levels are welcome to contribute.
120198

121199
## Run the docker version as a Linux Service
122200

@@ -260,63 +338,4 @@ pip --version
260338
npm --version
261339
gdalinfo --version
262340
```
263-
Should all work without errors.
264-
265-
## OpenDroneMap, node-OpenDroneMap, WebODM... what?
266-
267-
The [OpenDroneMap project](https://github.com/OpenDroneMap/) is composed of several components.
268-
269-
- [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap) is a command line toolkit that processes aerial images. Users comfortable with the command line are probably OK using this component alone.
270-
- [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap) is a lightweight interface and API (Application Program Interface) built directly on top of [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap). Users not comfortable with the command line can use this interface to process aerial images and developers can use the API to build applications. Features such as user authentication, map displays, etc. are not provided.
271-
- [WebODM](https://github.com/OpenDroneMap/WebODM) adds more features such as user authentication, map displays, 3D displays, a higher level API and the ability to orchestrate multiple processing nodes (run jobs in parallel). Processing nodes are simply servers running [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap).
272-
273-
![webodm](https://cloud.githubusercontent.com/assets/1951843/25567386/5aeec7aa-2dba-11e7-9169-aca97b70db79.png)
274-
275-
In general, follow these guidelines to find out what you should use:
276-
277-
I am a... | Best choice
278-
--------- | -----------
279-
End user, I'm not really comfortable with the command line | [WebODM](https://github.com/OpenDroneMap/WebODM)
280-
End user, I like shell commands, I need to process images for myself. I use other software to display processing results | [OpenDroneMap](https://github.com/OpenDroneMap/OpenDroneMap)
281-
End user, I can work with the command line, but I'd rather not. I use other software to display processing results | [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap)
282-
End user, I need a drone mapping application for my organization that everyone can use. | [WebODM](https://github.com/OpenDroneMap/WebODM)
283-
Developer, I'm looking to build an app that displays map results and takes care of things like permissions | [WebODM](https://github.com/OpenDroneMap/WebODM)
284-
Developer, I'm looking to build an app that will stay behind a firewall and just needs raw results | [node-OpenDroneMap](https://github.com/OpenDroneMap/node-OpenDroneMap)
285-
286-
## Roadmap
287-
- [X] User Registration / Authentication
288-
- [X] UI mockup
289-
- [X] Task Processing
290-
- [X] 2D Map Display
291-
- [X] 3D Model Display
292-
- [ ] NDVI display
293-
- [ ] Volumetric Measurements
294-
- [X] Cluster management and setup.
295-
- [ ] Mission Planner
296-
- [ ] Plugins/Webhooks System
297-
- [X] API
298-
- [X] Documentation
299-
- [ ] Android Mobile App
300-
- [ ] iOS Mobile App
301-
- [ ] Processing Nodes Volunteer Network
302-
- [X] Unit Testing
303-
304-
Don't see a feature that you want? [Help us make it happen](/CONTRIBUTING.md).
305-
306-
## Terminology
307-
308-
- `Project`: A collection of tasks (successfully processed, failed, waiting to be executed, etc.)
309-
- `Task`: A collection of input aerial images and an optional set of output results derived from the images, including an orthophoto, a georeferenced model and a textured model. A `Task`'s output is processed by OpenDroneMap.
310-
- `ProcessingNode`: An instance usually running on a separate VM, or on a separate machine which accepts aerial images, runs OpenDroneMap and returns the processed results (orthophoto, georeferenced model, etc.). Each node communicates with WebODM via a lightweight API such as [node-OpenDroneMap](https://www.github.com/pierotofy/node-OpenDroneMap). WebODM manages the distribution of `Task` to different `ProcessingNode` instances.
311-
- `ImageUpload`: aerial images.
312-
- `Mission`: A flight path and other information (overlap %, angle, ...) associated with a particular `Task`.
313-
314-
## Getting Help
315-
316-
We have several channels of communication for people to ask questions and to get involved with the community:
317-
318-
- [OpenDroneMap Community Forum](http://community.opendronemap.org/c/webodm)
319-
- [Report Issues](https://github.com/OpenDroneMap/WebODM/issues)
320-
321-
We also have a [Gitter Chat](https://gitter.im/OpenDroneMap/web-development), but the preferred way to communicate is via the [OpenDroneMap Community Forum](http://community.opendronemap.org/c/webodm).
322-
341+
Should all work without errors.

docker-compose.ssl-manual.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This configuration adds the volumes necessary for SSL manual setup
2+
version: '2'
3+
services:
4+
webapp:
5+
volumes:
6+
- ${WO_SSL_KEY}:/webodm/nginx/ssl/key.pem
7+
- ${WO_SSL_CERT}:/webodm/nginx/ssl/cert.pem

docker-compose.ssl.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This configuration adds support for SSL
2+
version: '2'
3+
volumes:
4+
letsencrypt:
5+
driver: local
6+
services:
7+
webapp:
8+
ports:
9+
- "${WO_SSL_INSECURE_PORT_REDIRECT}:8080"
10+
volumes:
11+
- letsencrypt:/webodm/nginx/letsencrypt
12+
environment:
13+
- WO_SSL
14+
- WO_SSL_KEY

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ services:
1919
container_name: webapp
2020
entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /bin/bash -c \"/webodm/wait-for-it.sh db:5432 -- /webodm/start.sh\""
2121
volumes:
22-
- appmedia:/webodm/app/media
22+
- ${WO_MEDIA_DIR}:/webodm/app/media
2323
ports:
24-
- "8000:8000"
24+
- "${WO_PORT}:8000"
2525
depends_on:
2626
- db
27+
environment:
28+
- WO_PORT
29+
- WO_HOST
30+
- WO_DEBUG
2731
restart: on-failure:10

nginx/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ssl/
2+
letsencrypt/
3+
*.conf

nginx/crontab

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Automatically renew the SSL certificate (if needed)
2+
0 0 1 * * root source /webodm/.cronenv; bash -c "/webodm/nginx/letsencrypt-autogen.sh"
3+
4+
# An empty line is required at the end of this file for a valid cron file.

0 commit comments

Comments
 (0)