Skip to content

Commit

Permalink
Move deployment to new domain
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfriedrich committed Jan 9, 2024
1 parent a229f82 commit 7dc6dd0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,32 @@

This is a very simple web viewer that displays cloud-optimized GeoTIFFs on an OpenLayers-powered web map.

It is publicly deployed at https://phenocube.org/wasserbilanz/
It is publicly deployed at https://wasserbilanz.eo2cube.org/


## Installation

On your device, clone this repo and execute:

1. `npm install`
2. `npm run build -- --base=/wasserbilanz/`
3. `scp -i /path/to/privatekey -r dist/* eocube@phenocube.org:/var/www/wasserbilanz/`
4. `scp -i /path/to/privatekey -r data/* eocube@phenocube.org:/data/indexed_data/eocube/wasserbilanz/`
2. `npm run build`
3. `scp -i /path/to/privatekey -r dist/* eocube@eo2cube.org:/var/www/wasserbilanz/`
4. `scp -i /path/to/privatekey -r data/* eocube@eo2cube.org:/var/www/wasserbilanz/data`

(Make sure the folders exist on the server beforehand.)

On the server, in `/etc/nginx/sites-enabled/default.conf` add:
On the server, in `/etc/caddy/Caddyfile` add:

```
location /wasserbilanz/data {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Range';
return 200;
}
add_header 'Access-Control-Allow-Origin' '*';
alias /data/indexed_data/eocube/wasserbilanz;
autoindex on;
}
location /wasserbilanz {
alias /var/www/wasserbilanz;
index index.html;
wasserbilanz.eo2cube.org {
root * /var/www/wasserbilanz
file_server
}
```

And execute `sudo service nginx reload`.
And execute `docker exec -w /etc/caddy caddy caddy reload`.

If Caddy doesn't find the files, verify that `/var/www` is mounted into the `caddy` Docker container (i.e. it is listed in the `volumes` section of `/home/eocube/Docker/proxy/docker-compose.yml`).

*Ready to serve!*

Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for(var i = 160; i<=180; i++) {
source: new GeoTIFF({
sources: [
{
url: 'https://phenocube.org/wasserbilanz/data/doy'+i+'-cog-georef.tif',
url: 'data/doy'+i+'-cog-georef.tif',
nodata: -9999,
min: 20,
max: 100
Expand Down

0 comments on commit 7dc6dd0

Please sign in to comment.