Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
e5cf334
Update README to explain new vs. old viewer repos
jimallman Sep 9, 2022
586a3aa
Updated requirements files and tracking
jimallman Sep 9, 2022
442c0ac
Update pip-installation instructions in README
jimallman Sep 9, 2022
645ded7
Initial Pyramid project from cookiecutter
jimallman Sep 9, 2022
dd04efd
Update pinned modules after cookiecutter
jimallman Sep 9, 2022
ef1c77d
Merge branch 'master' of github.com:OpenTreeOfLife/opentree
jimallman Sep 13, 2022
ee3bb6f
Prepare to migrate static assets and main layout
jimallman Sep 13, 2022
2160bce
Copy all static assets and main/layout template
jimallman Sep 13, 2022
a492c38
More jinja template cleanup
jimallman Sep 17, 2022
6a8df68
Clean up jinja (template) formatting
jimallman Oct 20, 2022
12a1004
Migration opentreewebapputil to an internal module
jimallman Oct 20, 2022
4c2be3c
Convert main layout template (til page render)
jimallman Nov 14, 2022
e357650
More progress on main layout template
jimallman Nov 14, 2022
aa2813a
Fix banner hover-text to allow simple HTML
jimallman Nov 21, 2022
82056d6
Proper code for dev-site banner and details
jimallman Nov 21, 2022
f13d66f
Correct current branch and Pyramid link
jimallman Nov 21, 2022
9805bc2
Migrate private subdir and example config
jimallman Dec 5, 2022
827422e
Fix reading of our app-specific config file(s)
jimallman Dec 5, 2022
575a404
Fix footer and taxon-search context list
jimallman Dec 13, 2022
9216bee
Commit accumulated tweaks from local testing.
jimallman Sep 12, 2023
5fdc77d
Fix JS locations; clean up initial view Python
jimallman Oct 1, 2023
1c2ad97
Add fallback method for config object
jimallman Oct 10, 2023
856ed16
Rename main content area
jimallman Oct 10, 2023
2f11260
Numerous fixes for main synth-tree view
jimallman Oct 10, 2023
06c0948
Fix URL for spinner.gif ("loading" graphic)
jimallman Oct 10, 2023
7cd16db
Fix initial tree view! and remove log chatter
jimallman Oct 17, 2023
5c01b3a
Match conforming synth-tree URLs from web2py
jimallman Oct 22, 2023
66b135f
Update taxonomy-browsing CGI script for python3
jimallman Oct 22, 2023
548b70d
Add test query-string (optional) and fix output.
jimallman Oct 22, 2023
72fc2f1
Disable test query-string by default
jimallman Oct 22, 2023
35935e4
Gently redirect root URL to default tree view
jimallman Oct 23, 2023
5a3d5c9
Fix static image URL
jimallman Oct 23, 2023
cda31f4
Disable PhyloPic features for now.
jimallman Oct 30, 2023
72c7b6d
Re-order About routes to reflect nav menu order
jimallman Nov 14, 2023
f8cf7ee
Migrate old About templates from web2py (ongoing)
jimallman Nov 14, 2023
8fc9cc7
Implement page setup for About pages (ongoing)
jimallman Nov 14, 2023
37350fd
Add Privacy page; fix default /about (via redirect)
jimallman Nov 20, 2023
6fe12f2
Migrate About/Licenses page
jimallman Nov 20, 2023
3ec4910
Migrate and enable the Developer Resources page
jimallman Nov 21, 2023
8c45e64
Restore Contact page
jimallman Nov 21, 2023
2427765
Removing unused About pages (from web2py)
jimallman Nov 21, 2023
0b2ad4b
Finish the About > References page (lotsa logic)
jimallman Nov 22, 2023
6cece3a
Steal latest phylesystem info from devtree
jimallman Dec 10, 2023
908072f
Adding D3 support file
jimallman Dec 10, 2023
01f01c9
Full conversion of stats and Progress page
jimallman Dec 10, 2023
e03000a
Fix for missing synthesis markers
jimallman Dec 11, 2023
9ec2e8c
Use proper JSON boolean values (vs 'true','false')
jimallman Dec 11, 2023
770f780
Add markdown module for Pyramid stuff
jimallman Dec 12, 2023
55df073
Convert synth-release and taxo-version pages
jimallman Dec 13, 2023
45c772c
Remove duplicate auth function
jimallman Dec 18, 2023
1f1ec22
Add authomatic for OAuth2 support
jimallman Dec 19, 2023
16a62d4
Add gunicorn to requirements (supports local HTTPS)
jimallman Mar 25, 2024
b2bd431
Working OAuth login! (works on local apache)
jimallman Apr 2, 2024
0d7e967
Add login_required view decorator
jimallman Apr 8, 2024
71f478f
Add logging support and more OAuth logic
jimallman Apr 30, 2024
71e7bec
Add login functionality and OAuth round trip
jimallman Apr 30, 2024
680893f
Refactor plugin_localcomments as Jinja2 macro
jimallman Apr 30, 2024
5faf2eb
Adding pyramid_retry to complete OAuth handshake
jimallman May 13, 2024
f71ab4a
Add placeholders for local-comments functionality
jimallman May 14, 2024
f628f41
Rough breakdown of comments, w/ markup (ongoing)
jimallman May 14, 2024
a38ee13
Updated login-logout URL to bounce back here.
jimallman May 14, 2024
6548020
Add more support for authenticated-user data
jimallman May 21, 2024
cd8d5d8
Add auth checks
jimallman Jun 11, 2024
7abc05d
Converting comments for Pyramid (ongoing)
jimallman Jun 11, 2024
d56d4a5
Read local comments with proper auth
jimallman Jul 2, 2024
12063e1
Refactor and test new-comment features
jimallman Jul 9, 2024
cf03dcb
Stick to standard `session.auth_user`
jimallman Jul 9, 2024
1dc885b
Ongoing fixes to comment tools
jimallman Jul 16, 2024
6286d0b
Issue/comments cleanup (ongoing)
jimallman Jul 22, 2024
fb55477
More comment cleanup and refactoring
jimallman Jul 23, 2024
fabf9da
More progress on comment rendering
jimallman Jul 30, 2024
17d5623
More refactoring of comments display
jimallman Aug 13, 2024
17aeb84
More complete setting of feedback vars
jimallman Aug 19, 2024
06d4695
Fix (typo) for "floating" feedback replies
jimallman Aug 27, 2024
25991fb
Refactoring for single-comment AJAX response
jimallman Aug 27, 2024
46dd336
Update to pyramid error message
jimallman Aug 29, 2024
f6d622a
Update date handling for python3
jimallman Aug 30, 2024
caba1bc
Update pip requirements for pyzt (time zone support)
jimallman Aug 30, 2024
15c102f
Round "- hours ago" to nearest hour (no decimal!)
jimallman Aug 30, 2024
6a25f27
Local comments embedded on all site pages (ongoing)
jimallman Sep 25, 2024
28de362
Debugging mis-routed login/comments path
jimallman Jan 14, 2025
2e9ec99
Force dev system to use HTTPS
jimallman Apr 6, 2025
a095102
Use a WebOb subrequest for local-comments fetch
jimallman Apr 6, 2025
f01d741
Add URL to Github comments, even if "not used"
jimallman Apr 6, 2025
f179376
Add a utility template for just one comment
jimallman Apr 6, 2025
9e32511
Clean up excessive log messages
jimallman Apr 6, 2025
e1c9c9f
Refactored comment subrequest to use env vars
jimallman Apr 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.class
tmp
*.tmp
venv/
backup/
smasher/tax/gbif
smasher/tax/ncbi
Expand All @@ -22,3 +23,4 @@ smasher/lib/json-simple-1.1.1.jar
deploy/setup/CONFIG
webapp/static/statistics/
lint/
private/
68 changes: 24 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
opentree
========
webapp-tree-viewer
==================

This is the repository for the Open Tree of Life web applications, one of many subsystems making up the Open Tree of Life project code.
This is the repository for the Open Tree of Life synthetic-tree viewer, one of many subsystems making up the Open Tree of Life project code. Previously, this was bundled in a common repo with the study-curation app, but we're breaking these apart as part of our conversion from web2py to Pyramid.

For Open Tree of Life documentation, see [the germinator repository's wiki](https://github.com/OpenTreeOfLife/germinator/wiki). The 'deployment system' and web API documentation sources that formerly resided in this repository now live in the [germinator repository](https://github.com/OpenTreeOfLife/germinator).
For Open Tree of Life documentation, see [the germinator repository's wiki](https://github.com/OpenTreeOfLife/germinator/wiki).

The following instructions have not been reviewed in a long time. For local installation a better place to start might be [this wiki page](https://github.com/OpenTreeOfLife/opentree/wiki/Installing-a-local-curator-and-tree-browser-test-server).

Installation
============
See the phylografter instructions for
more details about using web2py.

**TBD - pending changes in converting from web2py to the Pyramid framework.**

We strongly recommend using a virtual environment to manage the version of
Python and installed modules. We're currently running opentree with Python
Expand All @@ -36,8 +36,25 @@ The included **requirements.txt** file lists known-good versions of all the requ
python modules for opentree, plus a few convenience modules. To [install these modules
using pip](http://www.pip-installer.org/en/latest/cookbook.html#requirements-files),

The file **requirements.in** captures our intentions, typically following the
latest version of each module unless frozen to address bugs or incompatibilities.

<pre>
# create a python3 venv inside the top-level folder
cd ~/repos/webapp-tree-viewer
export VENV="$(pwd)/venv"
python3 -m venv $VENV

# install the pinned set of known-good modules
pip install -r requirements.txt

# OR during development, try to update these using `requirements.in`
pip install -r requirements.in

# capture the resulting versions for production deploymentsl
$VENV/bin/pip freeze -r requirements.in > requirements.txt
# capture and save the full dependency tree for all modules
$VENV/bin/pipdeptree > pipdeptree.out
</pre>

The contents of the webapp subdirectory are a web2py application. Make a symbolic
Expand Down Expand Up @@ -136,44 +153,7 @@ http://www.web2py.com/examples/default/download MTH used version 2.4.2 of web2py
Subdirectories
--------------

mockup
: JAR's hand-written html that mock up the design of the site.

smasher
: construction of synthetic taxonomy. See https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy for details

webapp/controllers
: python code executed by web2py when a URL is successfully mapped to a controller.

webapp/modules
: python code that can be imported and used by the webpp, but is not exposed as controller

webapp/models
: code that describes the database structure used by the web app

webapp/views
: templates for the page content that is rendered in response to a query. The view is typically specific to a few controllers in the web app

webapp/static
: static content to be returned by the web app. Contains css, images and js subdirectories for commonly used items.

webapp/private
: the location to be used for storing installation-specific configuration information.

webapp/cron
: directory that stores commands to be executed periodically by the web2py framework when the app is running.

webapp/databases
: the location of the database files used by web2py.

webapp/languages
: web2py code for internationalization

webapp/cache, webapp/databases, webapp/errors, webapp/sessions, webapp/uploads
: directories used by web2py to store content associated with user's activities. Content here should not need to be committed to version control.

curator/*
: similar subdirectories to those in webapp/* above
**TBD - pending changes in converting from web2py to the Pyramid framework.**

Acknowledgements
----------------
Expand Down
2 changes: 1 addition & 1 deletion curator/views/study/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ <h4 title="Click to show mapping options" style="margin-top: 0;">
{{ pass }}
{{ except: }}
<option selected="selected">ERROR loading context values</option>
{{ pass }}
{{ pass }}
</select>
<div style="text-align: center; margin: 0 0 1em;">
<button class="btn btn-small Xbtn-info"
Expand Down
141 changes: 141 additions & 0 deletions pipdeptree.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
Authomatic==1.2.1
bleach==5.0.1
- six [required: >=1.9.0, installed: 1.16.0]
- webencodings [required: Any, installed: 0.5.1]
configparser==5.3.0
cookiecutter==2.1.1
- binaryornot [required: >=0.4.4, installed: 0.4.4]
- chardet [required: >=3.0.2, installed: 5.0.0]
- click [required: >=7.0,<9.0.0, installed: 8.1.3]
- Jinja2 [required: >=2.7,<4.0.0, installed: 3.1.2]
- MarkupSafe [required: >=2.0, installed: 2.1.1]
- jinja2-time [required: >=0.2.0, installed: 0.2.0]
- arrow [required: Any, installed: 0.15.8]
- python-dateutil [required: Any, installed: 2.2]
- six [required: Any, installed: 1.16.0]
- jinja2 [required: Any, installed: 3.1.2]
- MarkupSafe [required: >=2.0, installed: 2.1.1]
- python-slugify [required: >=4.0.0, installed: 6.1.2]
- text-unidecode [required: >=1.3, installed: 1.3]
- pyyaml [required: >=5.3.1, installed: 6.0]
- requests [required: >=2.23.0, installed: 2.28.1]
- certifi [required: >=2017.4.17, installed: 2022.6.15.1]
- charset-normalizer [required: >=2,<3, installed: 2.1.1]
- idna [required: >=2.5,<4, installed: 3.3]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.12]
locket==0.1.1
Markdown==3.5.1
- importlib-metadata [required: >=4.4, installed: 7.0.0]
- zipp [required: >=0.5, installed: 3.17.0]
pip==23.3.1
pipdeptree==2.3.1
pytest-cov==3.0.0
- coverage [required: >=5.2.1, installed: 6.4.4]
- pytest [required: >=4.6, installed: 7.1.3]
- attrs [required: >=19.2.0, installed: 22.1.0]
- iniconfig [required: Any, installed: 1.1.1]
- packaging [required: Any, installed: 21.3]
- pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9]
- pluggy [required: >=0.12,<2.0, installed: 1.0.0]
- py [required: >=1.8.2, installed: 1.11.0]
- tomli [required: >=1.0.0, installed: 2.0.1]
python-jwt==3.3.0
- jwcrypto [required: >=0.8, installed: 0.9.1]
- cryptography [required: >=2.3, installed: 38.0.1]
- cffi [required: >=1.12, installed: 1.15.1]
- pycparser [required: Any, installed: 2.21]
- deprecated [required: Any, installed: 1.2.13]
- wrapt [required: >=1.10,<2, installed: 1.14.1]
- six [required: Any, installed: 1.16.0]
synthetic-tree-viewer==0.0
- plaster-pastedeploy [required: Any, installed: 0.7]
- PasteDeploy [required: >=2.0, installed: 2.1.1]
- setuptools [required: Any, installed: 60.10.0]
- plaster [required: >=0.5, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- pyramid [required: Any, installed: 2.0]
- hupper [required: >=1.5, installed: 1.10.3]
- plaster [required: Any, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- plaster-pastedeploy [required: Any, installed: 0.7]
- PasteDeploy [required: >=2.0, installed: 2.1.1]
- setuptools [required: Any, installed: 60.10.0]
- plaster [required: >=0.5, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- setuptools [required: Any, installed: 60.10.0]
- translationstring [required: >=0.4, installed: 1.4]
- venusian [required: >=1.0, installed: 3.0.0]
- webob [required: >=1.8.3, installed: 1.8.7]
- zope.deprecation [required: >=3.5.0, installed: 4.4.0]
- setuptools [required: Any, installed: 60.10.0]
- zope.interface [required: >=3.8.0, installed: 5.4.0]
- setuptools [required: Any, installed: 60.10.0]
- pyramid-debugtoolbar [required: Any, installed: 4.9]
- Pygments [required: Any, installed: 2.13.0]
- pyramid [required: >=1.4, installed: 2.0]
- hupper [required: >=1.5, installed: 1.10.3]
- plaster [required: Any, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- plaster-pastedeploy [required: Any, installed: 0.7]
- PasteDeploy [required: >=2.0, installed: 2.1.1]
- setuptools [required: Any, installed: 60.10.0]
- plaster [required: >=0.5, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- setuptools [required: Any, installed: 60.10.0]
- translationstring [required: >=0.4, installed: 1.4]
- venusian [required: >=1.0, installed: 3.0.0]
- webob [required: >=1.8.3, installed: 1.8.7]
- zope.deprecation [required: >=3.5.0, installed: 4.4.0]
- setuptools [required: Any, installed: 60.10.0]
- zope.interface [required: >=3.8.0, installed: 5.4.0]
- setuptools [required: Any, installed: 60.10.0]
- pyramid-mako [required: >=0.3.1, installed: 1.1.0]
- Mako [required: >=1.1.0, installed: 1.2.2]
- MarkupSafe [required: >=0.9.2, installed: 2.1.1]
- pyramid [required: Any, installed: 2.0]
- hupper [required: >=1.5, installed: 1.10.3]
- plaster [required: Any, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- plaster-pastedeploy [required: Any, installed: 0.7]
- PasteDeploy [required: >=2.0, installed: 2.1.1]
- setuptools [required: Any, installed: 60.10.0]
- plaster [required: >=0.5, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- setuptools [required: Any, installed: 60.10.0]
- translationstring [required: >=0.4, installed: 1.4]
- venusian [required: >=1.0, installed: 3.0.0]
- webob [required: >=1.8.3, installed: 1.8.7]
- zope.deprecation [required: >=3.5.0, installed: 4.4.0]
- setuptools [required: Any, installed: 60.10.0]
- zope.interface [required: >=3.8.0, installed: 5.4.0]
- setuptools [required: Any, installed: 60.10.0]
- repoze.lru [required: Any, installed: 0.7]
- pyramid-jinja2 [required: Any, installed: 2.10]
- jinja2 [required: >=2.5.0,!=2.11.2,!=2.11.1,!=2.11.0, installed: 3.1.2]
- MarkupSafe [required: >=2.0, installed: 2.1.1]
- markupsafe [required: Any, installed: 2.1.1]
- pyramid [required: >=1.3.0, installed: 2.0]
- hupper [required: >=1.5, installed: 1.10.3]
- plaster [required: Any, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- plaster-pastedeploy [required: Any, installed: 0.7]
- PasteDeploy [required: >=2.0, installed: 2.1.1]
- setuptools [required: Any, installed: 60.10.0]
- plaster [required: >=0.5, installed: 1.0]
- setuptools [required: Any, installed: 60.10.0]
- setuptools [required: Any, installed: 60.10.0]
- translationstring [required: >=0.4, installed: 1.4]
- venusian [required: >=1.0, installed: 3.0.0]
- webob [required: >=1.8.3, installed: 1.8.7]
- zope.deprecation [required: >=3.5.0, installed: 4.4.0]
- setuptools [required: Any, installed: 60.10.0]
- zope.interface [required: >=3.8.0, installed: 5.4.0]
- setuptools [required: Any, installed: 60.10.0]
- zope.deprecation [required: Any, installed: 4.4.0]
- setuptools [required: Any, installed: 60.10.0]
- waitress [required: Any, installed: 2.1.2]
WebTest==3.0.0
- beautifulsoup4 [required: Any, installed: 4.11.1]
- soupsieve [required: >1.2, installed: 2.3.2.post1]
- waitress [required: >=0.8.5, installed: 2.1.2]
- WebOb [required: >=1.2, installed: 1.8.7]
62 changes: 62 additions & 0 deletions private/config.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copy this file to "config" (and replace tokens below) to make it active
#
# DO NOT CHANGE the formatting of assignment lines (removing spaces, etc) in
# this file! The 'config.example' files are used by our deployment scripts to
# build the final config for each web2py app. Changes here might keep it
# from being built properly.
[security]
secure_sessions_with_HTTPS = false

# paths for the study/status page (DEPRECATED)
[paths]
#nexsonsdir = /usr/share/open-tree/avatol_nexsons
#study_to_status_script = /usr/share/open-tree/avatol_nexsons/nexson2treemach/study_nexson_to_status_html.py

[apis]
# Settings for a registered app on GitHub, for example on devtree:
# <https://github.com/settings/apps/open-tree-tree-explorer-dev>
github_app_id = YOUR_APP_ID_HERE
github_client_id = YOUR_CLIENT_ID_HERE
github_redirect_uri = YOUR_REDIRECT_URI_HERE
# DON'T INCLUDE 'github_client_secret' value here. For better security, this is
# loaded from a separate file and added to config data on-the-fly.
#
# github_app_installation_id can be found from the installing organization's page, e.g.
# <https://github.com/organizations/OpenTreeOfLife/settings/installations>
# (the installation ID is in the URL of the Configure button here)
github_app_installation_id = YOUR_APP_INSTALLATION_ID_HERE

# List public-facing base URL for treemachine and taxomachine services
# (NOTE that these are used by both server- and client-side code)
[domains]
treemachine = http://opentree.myserver.org
taxomachine = http://opentree.myserver.org
oti = http://opentree.myserver.org
opentree_api = http://opentree.myserver.org
collections_api_base_url = https://devapi.opentreeoflife.org
favorites_api_base_url = https://devapi.opentreeoflife.org
# Cached versions of some APIs will speed up repeated calls (see below).
# These use a simple web2py cache implemented in phylesystem-api
CACHED_treemachine = https://opentree.myserver.org/cached
CACHED_taxomachine = https://opentree.myserver.org/cached
CACHED_oti = https://opentree.myserver.org/cached

# Building on the URLs above, complete the public-facing URL for all methods
# (again, these should work from both server- and client-side code)
#
# NOTE: In our example setup, all service methods are proxied through Apache as
# URLs within the main opentree site. So we assume that partial paths '/db/data/'
# are handled in the ProxyPass statement.
[method_urls]
getDraftTreeID_url = {CACHED_treemachine_domain}/v3/tree_of_life/about
getSyntheticTree_url = {CACHED_treemachine_domain}/v3/tree_of_life/subtree
getDraftSubtree_url = {treemachine_domain}/v3/tree_of_life/subtree
doTNRSForAutocomplete_url = {taxomachine_domain}/v3/tnrs/autocomplete_name
getContextsJSON_url = {CACHED_taxomachine_domain}/v3/tnrs/contexts
getSynthesisSourceList_url = {CACHED_treemachine_domain}/v3/tree_of_life/about
findAllStudies_url = {CACHED_oti_domain}/v3/studies/find_studies
singlePropertySearchForStudies_url = {oti_domain}/v3/studies/find_studies
singlePropertySearchForTrees_url = {oti_domain}/v3/studies/find_trees
getTaxonInfo_url = {taxomachine_domain}/v3/taxonomy/taxon_info
# Include one phylesystem-api method to download NexSON from Bibliographic References page
API_load_study_GET_url = {opentree_api_domain}/v3/study/{STUDY_ID}
16 changes: 16 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
requests
python-dateutil==2.2
locket==0.1.1
bleach
jwcrypto==0.9.1
python_jwt
pyramid==2.0
pipdeptree
cookiecutter
ConfigParser
markdown
authomatic
uvicorn
prettydate
pytz
pyramid_retry
Loading