Skip to content

Commit 51470d8

Browse files
author
afabiani
committed
- First commit
0 parents  commit 51470d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+13084
-0
lines changed

.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
# env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.coverage
40+
.coverage.*
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*,cover
45+
46+
# Django stuff:
47+
*.log
48+
celerybeat-schedule.*
49+
50+
# Sphinx documentation
51+
docs/_build/
52+
53+
# PyBuilder
54+
target/
55+
56+
# Downstream Project
57+
downloaded/
58+
uploaded/
59+
static_root/
60+
development.db
61+
development.db-journal
62+
local_settings.py
63+
64+
.idea/
65+
66+
/.vscode/settings.json

.override_dev_env.sample

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
export DEBUG=True
2+
3+
export SECRET_KEY="myv-y4#7j-d*p-__@j#*3z@!y24fz8%^z2v6atuy4bo9vqr1_a"
4+
5+
export SITEURL=http://localhost:8000/
6+
export ALLOWED_HOSTS="['localhost',]"
7+
8+
export GEONODE_INSTANCE_NAME=geonode
9+
export DJANGO_SETTINGS_MODULE=ingcmz_geonode.settings
10+
export GEONODE_DATABASE=geonode
11+
export GEONODE_DATABASE_PASSWORD=geonode
12+
export GEONODE_GEODATABASE=geonode_data
13+
export GEONODE_GEODATABASE_PASSWORD=geonode_data
14+
15+
export DATABASE_URL=postgres://geonode:geonode@localhost:5432/ingcmz_geonode
16+
export GEODATABASE_URL=postgis://geonode:geonode@localhost:5432/ingcmz_geonode_data
17+
export DEFAULT_BACKEND_DATASTORE=datastore
18+
19+
export GEOSERVER_WEB_UI_LOCATION=http://localhost:8080/geoserver/
20+
export GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/
21+
export GEOSERVER_LOCATION=http://localhost:8080/geoserver/
22+
export GEOSERVER_ADMIN_USER=admin
23+
export GEOSERVER_ADMIN_PASSWORD=geoserver
24+
25+
export OGC_REQUEST_TIMEOUT=30
26+
export OGC_REQUEST_MAX_RETRIES=1
27+
export OGC_REQUEST_BACKOFF_FACTOR=0.3
28+
export OGC_REQUEST_POOL_MAXSIZE=10
29+
export OGC_REQUEST_POOL_CONNECTIONS=10
30+
31+
export DEFAULT_BACKEND_UPLOADER=geonode.importer
32+
export TIME_ENABLED=True
33+
export MOSAIC_ENABLED=False
34+
35+
export ADMIN_PASSWORD=admin
36+
export ADMIN_EMAIL=admin@localhost
37+
38+
export EMAIL_ENABLE=False
39+
export DJANGO_EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
40+
export DJANGO_EMAIL_HOST=localhost
41+
export DJANGO_EMAIL_PORT=25
42+
export DJANGO_EMAIL_HOST_USER=
43+
export DJANGO_EMAIL_HOST_PASSWORD=
44+
export DJANGO_EMAIL_USE_TLS=False
45+
export DEFAULT_FROM_EMAIL="GeoNode <[email protected]>"
46+
47+
export LOCKDOWN_GEONODE=False
48+
export CORS_ORIGIN_ALLOW_ALL=True
49+
export SESSION_EXPIRED_CONTROL_ENABLED=True
50+
export DEFAULT_ANONYMOUS_VIEW_PERMISSION=True
51+
export DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=True
52+
53+
export ACCOUNT_OPEN_SIGNUP=True
54+
export ACCOUNT_EMAIL_REQUIRED=True
55+
export ACCOUNT_APPROVAL_REQUIRED=False
56+
export ACCOUNT_CONFIRM_EMAIL_ON_GET=True
57+
export ACCOUNT_EMAIL_VERIFICATION='optional'
58+
export ACCOUNT_EMAIL_CONFIRMATION_EMAIL=False
59+
export ACCOUNT_EMAIL_CONFIRMATION_REQUIRED=False
60+
61+
export OAUTH2_API_KEY=
62+
export OAUTH2_CLIENT_ID=Jrchz2oPY3akmzndmgUTYrs9gczlgoV20YPSvqaV
63+
export OAUTH2_CLIENT_SECRET=rCnp5txobUo83EpQEblM8fVj3QT5zb5qRfxNsuPzCqZaiRyIoxM4jdgMiZKFfePBHYXCLd7B8NlkfDBY9HKeIQPcy5Cp08KQNpRHQbjpLItDHv12GvkSeXp6OxaUETv3
64+
65+
export API_LOCKDOWN=False
66+
export TASTYPIE_APIKEY=
67+
68+
export CACHE_BUSTING_STATIC_ENABLED=False
69+
export CACHE_BUSTING_MEDIA_ENABLED=False
70+
71+
export MAX_DOCUMENT_SIZE=2
72+
export CLIENT_RESULTS_LIMIT=5
73+
export API_LIMIT_PER_PAGE=1000
74+
export ALLOWED_DOCUMENT_TYPES="['doc', 'docx', 'gif', 'jpg', 'jpeg', 'ods', 'odt', 'odp', 'pdf', 'png','ppt', 'pptx', 'rar', 'sld', 'tif', 'tiff', 'txt', 'xls', 'xlsx', 'xml', 'zip', 'gz', 'qml']"
75+
76+
export GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
77+
export MAPBOX_ACCESS_TOKEN=
78+
export BING_API_KEY=
79+
export GOOGLE_API_KEY=
80+
81+
export MONITORING_ENABLED=True
82+
export MONITORING_DATA_TTL=365
83+
export USER_ANALYTICS_ENABLED=True
84+
export USER_ANALYTICS_GZIP=False
85+
export MONITORING_SERVICE_NAME=local-geonode
86+
export MONITORING_HOST_NAME=geonode
87+
88+
export MODIFY_TOPICCATEGORY=True
89+
export AVATAR_GRAVATAR_SSL=True
90+
export EXIF_ENABLED=False
91+
export CREATE_LAYER=False
92+
export FAVORITE_ENABLED=False

Dockerfile

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM python:3.7.6-stretch
2+
MAINTAINER GeoNode development team
3+
4+
RUN mkdir -p /usr/src/ingcmz_geonode
5+
6+
# Enable postgresql-client-11.2
7+
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
8+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
9+
10+
11+
# This section is borrowed from the official Django image but adds GDAL and others
12+
RUN apt-get update && apt-get install -y \
13+
gcc \
14+
zip \
15+
gettext \
16+
postgresql-client-11 libpq-dev \
17+
sqlite3 \
18+
python3-gdal python3-psycopg2 \
19+
python3-pil python3-lxml \
20+
python3-dev libgdal-dev \
21+
libmemcached-dev libsasl2-dev zlib1g-dev \
22+
python3-pylibmc \
23+
uwsgi uwsgi-plugin-python3 \
24+
--no-install-recommends && rm -rf /var/lib/apt/lists/*
25+
26+
27+
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
28+
RUN apt-get update && apt-get install -y geoip-bin
29+
30+
# add bower and grunt command
31+
COPY . /usr/src/ingcmz_geonode/
32+
WORKDIR /usr/src/ingcmz_geonode
33+
34+
RUN apt-get update && apt-get -y install cron
35+
COPY monitoring-cron /etc/cron.d/monitoring-cron
36+
RUN chmod 0644 /etc/cron.d/monitoring-cron
37+
RUN crontab /etc/cron.d/monitoring-cron
38+
RUN touch /var/log/cron.log
39+
RUN service cron start
40+
41+
COPY wait-for-databases.sh /usr/bin/wait-for-databases
42+
RUN chmod +x /usr/bin/wait-for-databases
43+
RUN chmod +x /usr/src/ingcmz_geonode/tasks.py \
44+
&& chmod +x /usr/src/ingcmz_geonode/entrypoint.sh
45+
46+
# Upgrade pip
47+
RUN pip install pip==20.1
48+
49+
# app-specific requirements
50+
RUN pip install --upgrade --no-cache-dir --src /usr/src -r requirements.txt
51+
RUN pip install --upgrade -e .
52+
53+
# Install pygdal (after requirements for numpy 1.16)
54+
RUN pip install pygdal==$(gdal-config --version).*
55+
56+
ENTRYPOINT service cron restart && /usr/src/ingcmz_geonode/entrypoint.sh

Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
up:
2+
# bring up the services
3+
docker-compose up -d
4+
5+
build:
6+
docker-compose build django
7+
docker-compose build celery
8+
9+
sync:
10+
# set up the database tablea
11+
docker-compose run django python manage.py makemigrations --noinput
12+
docker-compose exec django python manage.py migrate account --noinput
13+
docker-compose run django python manage.py migrate --noinput
14+
15+
wait:
16+
sleep 5
17+
18+
logs:
19+
docker-compose logs --follow
20+
21+
down:
22+
docker-compose down
23+
24+
test:
25+
docker-compose run django python manage.py test --failfast
26+
27+
reset: down up wait sync
28+
29+
hardreset: pull build reset

0 commit comments

Comments
 (0)