Flask based website to display University of Miami geodesylab volcano displacement timeseries data.
| Location | Role |
|---|---|
$MINSAR_HOME/tools/VolcDef_web (this repo) |
Where you edit code in development (e.g. under minsar/tools/VolcDef_web). |
/var/www/VolcDef_web |
What Apache/WSGI actually runs (web.wsgi, volcdef_web/app.py, web_env). |
Changes made in the MinSAR repo are not live until you deploy them to /var/www/VolcDef_web, for example:
# Example: sync Python package (adjust host/user as needed)
sudo rsync -a --delete /path/to/minsar/tools/VolcDef_web/volcdef_web/ /var/www/VolcDef_web/volcdef_web/
sudo systemctl reload apache2Or maintain /var/www/VolcDef_web as a git clone / git pull of VolcDef_web and pull on the server after merging changes from the minsar copy.
c## Installation
- Go to
/var/www/and clone the repository (on a new server you may need your private and public key in ~/.ssh for git to work)
git clone git@github.com:geodesymiami/VolcDef_web
git clone git@github.com:geodesymiami/webconfig
(preferred), or if cloned into the $MINSAR_HOME/tools directory create a symbolic link:
sudo ln -s /home/exouser/code/minsar/tools/VolcDef_web /var/www
- Install the required packages into a virtual environment (first adjust ownership):
USER=exouser
sudo chown -R $USER:$USER /var/www/VolcDef_web
python -m venv web_env
source web_env/bin/activate
pip install -r requirements.txt
-
Make sure the MAPBOX_ACCESS_TOKEN is set in
mapbox_access_token.env(orcp ~/accounts/mapbox_access_token.env .). -
Volcano list (production)
The app uses/var/www/webconfig/volcanoes_volcdef.json(if not available sibling../webconfig/volcanoes_volcdef.json, thenWEBCONFIG_DIR/volcanoes_volcdef.json. Seevolcdef_web/app.py(get_volcanoes_json_path).SetEnv WEBCONFIG_DIR /var/www/webconfigis set involcdef_web.conf. -
Run the website
cd volcdef_web/
python run.py
- Check whether website is running using
curl -s http://127.0.0.1:5001
or open website at the given address (chrome/safari)
127.0.0.1:5001
-
On the remote server, configure Apache by copying volcdef_web.conf to /etc/apache2/sites-available/ (
sudo cp volcdef_web.conf /etc/apache2/sites-available/)((Ubuntu,/etc/httpd/conf.dfor Alma/RedHat) (usevolcdef_web.conf_jetstreamis /data/HDFEOS5 lives on server running Apache). -
Start Apache using:
sudo a2ensite volcdef_web.conf
sudo systemctl restart apache2
- Check for errors using:
sudo tail -20 /var/log/apache2/error.log
If you see a Traceback, then python could not properly run your web.wsgi or app.py.
To update the volcano allowlist/metadata, go to /var/www/webconfig and git pull, or regenerate:
cd /var/www/VolcDef_web/volcdef_web
python3 make_volcdef_volcanoes_json.py --outdir /var/www/webconfig
sudo systemctl restart apache2/api/volcanoes expands each HDF5EOS volcano entry by scanning
/data/HDF5EOS/<Volcano>/ for subdirs starting with miaplpy, mintpy, sarvey, dolphin, opera, or egms.
- Preferred
volcdef_linkin Excel/JSON:http://HOST/data/HDF5EOS/Fernandina/ - Also accepted:
.../Fernandina/miaplpy,.../mintpy/overlay.html, etc. (volcano folder is parsed from the URL) - New product folders appear on the map without editing Excel (cache TTL ~60s; set
VOLCDEF_EXPAND_CACHE_TTL) - Optional offline materialize:
python3 make_volcdef_volcanoes_json.py --outdir /var/www/webconfig --expand-hdf5eos /data/HDF5EOS
One Excel/JSON row per volcano is enough; multi-product rows for the same folder are merged and re-expanded from disk.