Skip to content

Commit 51a7cd7

Browse files
committed
Merge branch 'master' of github.com:natcap/data.naturalcapitalproject.stanford.edu into bugfix/64-enable-multiclipping
Conflicts: src/ckanext-natcap/ckanext/natcap/templates/home/robots.txt
2 parents a4ee783 + 41343cf commit 51a7cd7

32 files changed

+1492
-440
lines changed

.env.example

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# Stamen script settings
2+
GITHUB_USER=natcap
3+
GITHUB_REPO=data.naturalcapitalproject.stanford.edu
4+
GITHUB_BRANCH=master
5+
16
# Host Ports
2-
CKAN_PORT_HOST=5000
7+
CKAN_PORT_HOST=8443
38
NGINX_PORT_HOST=81
49
NGINX_SSLPORT_HOST=8443
510

@@ -35,8 +40,7 @@ CKAN_VERSION=2.10.0
3540
CKAN_SITE_ID=default
3641
CKAN_SITE_URL=https://localhost:8443
3742
#CKAN_SITE_URL=https://data.naturalcapitalproject.stanford.edu:8443 # used for prod docker-compose cluster
38-
CKAN_PORT=5000
39-
CKAN_PORT_HOST=5000
43+
CKAN_PORT=8443
4044
CKAN__CACHE_EXPIRES=300 # expire cache after 5min
4145
CKAN__CACHE_ENABLED=True
4246
CKAN___BEAKER__SESSION__SECRET=CHANGE_ME
@@ -53,7 +57,7 @@ CKAN_SMTP_USER=user
5357
CKAN_SMTP_PASSWORD=pass
5458
CKAN_SMTP_MAIL_FROM=ckan@localhost
5559
TZ=UTC
56-
CKAN___LICENSES_GROUP_URL=file:///usr/lib/python3.10/site-packages/ckanext/natcap/public/opendefinition-org-all-licenses.json
60+
CKAN___LICENSES_GROUP_URL=file:///srv/app/src/ckanext-natcap/ckanext/natcap/public/opendefinition-org-all-licenses.json
5761

5862
# Solr
5963
SOLR_IMAGE_VERSION=2.10-solr9
@@ -68,16 +72,17 @@ TEST_CKAN_REDIS_URL=redis://redis:6379/1
6872
# Datapusher
6973
DATAPUSHER_VERSION=0.0.20
7074
CKAN_DATAPUSHER_URL=http://datapusher:8800
71-
CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000
75+
CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:8443
7276
DATAPUSHER_REWRITE_RESOURCES=True
73-
DATAPUSHER_REWRITE_URL=http://ckan:5000
77+
DATAPUSHER_REWRITE_URL=http://ckan:8443
7478

7579
# NGINX
7680
NGINX_PORT=80
7781
NGINX_SSLPORT=443
7882

7983
# Extensions
80-
CKAN__PLUGINS="googleanalytics envvars natcap tracking or_facet image_view text_view datatables_view recline_view datastore datapusher spatial_metadata spatial_query stats activity scheming_datasets"
84+
# NOTE: PLUGIN ORDER MATTERS! BE CAREFUL
85+
CKAN__PLUGINS="or_facet googleanalytics envvars natcap tracking image_view text_view datatables_view datastore datapusher mappreview spatial_metadata spatial_query stats activity zipexpand sitemap"
8186
CKAN__HARVEST__MQ__TYPE=redis
8287
CKAN__HARVEST__MQ__HOSTNAME=redis
8388
CKAN__HARVEST__MQ__PORT=6379
@@ -108,14 +113,15 @@ CKAN__AUTH__CREATE_USER_VIA_WEB=false
108113
# Anon users cannot view user details
109114
CKAN__AUTH__PUBLIC_USER_DETAILS=false
110115

111-
# Add ckanext.scheming schemas here
112-
CKAN___SCHEMING__DATASET_SCHEMAS="ckanext.natcap:natcap_dataset_schema.yml"
113-
114116
# Config for or_facet, allow OR logic for facets
115117
CKANEXT__OR_FACET__OPTIONAL="extras_sources_res_formats extras_placenames tags"
116118

117-
CKAN___GOOGLEANALYTICS__ID="" # The tracking id, could be from GA4
118-
CKAN___GOOGLEANALYTICS__ACCOUNT="" # our GA account name, from the upper-right of the GA panel
119+
CKANEXT__MAPPREVIEW__MAPBOX_API_KEY="FIXME"
120+
CKANEXT__MAPPREVIEW__MAPBOX_STYLE="mapbox://styles/FIXME"
121+
CKANEXT__MAPPREVIEW__TITILER_URL="https://titiler-897938321824.us-west1.run.app"
122+
123+
CKAN___GOOGLEANALYTICS__ID="G-3EBTM23KV6" # The tracking id, could be from GA4. Google says this is not a secret.
124+
CKAN___GOOGLEANALYTICS__ACCOUNT="data.naturalcapitalproject.stanford.edu" # our GA account name, from the upper-right of the GA panel
119125
#CKANEXT__GOOGLEANALYTICS_USERNAME="" # README says this is required, but I'm not seeing it in the source code and I don't want to provide it. Doesn't appear to be needed.
120126
#CKANEXT__GOOGLEANALYTICS_PASSWORD="" # README says this is required, but I'm not seeing it in the source code and I don't want to provide it. Doesn't appear to be needed.
121127

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ local/*
1212
env310
1313
*~
1414
venv
15+
node_modules

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
.PHONY: deploy deploy-staging sync-on-prod
1+
.PHONY: deploy deploy-staging sync-on-prod fetch-nginx-config
22

33
GIT_DIR := /opt/ckan-catalog/data.naturalcapitalproject.stanford.edu
44
CKAN_PROD_URL := https://data.naturalcapitalproject.stanford.edu
5+
GCLOUD_COMMON_ARGS := --project=sdss-natcap-gef-ckan --zone=us-central1-a
6+
RESTART_DOCKER_CMD := sudo sh -c 'cd $(GIT_DIR) && git pull && docker compose build && docker compose down && docker compose up --detach --remove-orphans'
7+
PROD_VM_NAME := ckan-2
8+
STAGING_VM_NAME := ckan-staging
59

610
# Building happens first, while the cluster is still up, because it can take a while.
711
# This way we minimize catalog downtime.
812
deploy:
913
git log origin/master..HEAD > /dev/null || (echo "There are unpushed commits. git push and re-run."; exit 1)
10-
gcloud compute ssh --zone "us-central1-a" "ckan-1" --project "sdss-natcap-gef-ckan" \
11-
--command="sudo sh -c 'cd $(GIT_DIR) && git pull && docker compose build && docker compose down && docker compose up --detach --remove-orphans'"
14+
gcloud compute ssh $(GCLOUD_COMMON_ARGS) $(PROD_VM_NAME) --command="$(RESTART_DOCKER_CMD)"
1215

1316
deploy-staging:
14-
gcloud compute ssh --zone "us-central1-a" "ckan-staging" --project "sdss-natcap-gef-ckan" \
15-
--command="sudo sh -c 'cd $(GIT_DIR) && git pull && docker compose build && docker compose down && docker compose up --detach --remove-orphans'"
17+
gcloud compute ssh $(GCLOUD_COMMON_ARGS) $(STAGING_VM_NAME) --command="$(RESTART_DOCKER_CMD)"
1618

1719
sync-on-prod:
1820
SYNC_SRC_URL=$(CKAN_PROD_URL) SYNC_DST_URL=$(CKAN_PROD_URL) python api-scripts/sync-datasets.py
21+
22+
fetch-nginx-config:
23+
gcloud compute scp $(GCLOUD_COMMON_ARGS) $(PROD_VM_NAME):/etc/nginx/ckan-proxy.conf host-nginx/etc.nginx.ckan-proxy.conf
24+
gcloud compute scp $(GCLOUD_COMMON_ARGS) $(PROD_VM_NAME):/etc/nginx/sites-enabled/ckan host-nginx/etc.nginx.sites-available.ckan
25+
gcloud compute scp $(GCLOUD_COMMON_ARGS) $(PROD_VM_NAME):/etc/nginx/nginx.conf host-nginx/etc.nginx.nginx.conf
26+
gcloud compute scp $(GCLOUD_COMMON_ARGS) $(PROD_VM_NAME):/etc/nginx/throttle-bots.conf host-nginx/etc.nginx.throttle-bots.conf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
env313

0 commit comments

Comments
 (0)