Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,21 @@ DJANGO_EMAIL_USE_SSL=False
DEFAULT_FROM_EMAIL='{email}' # eg Company <no-reply@company.org>

# Session/Access Control
LOCKDOWN_GEONODE=False
LOCKDOWN_GEONODE=True
CORS_ALLOW_ALL_ORIGINS=True
X_FRAME_OPTIONS="SAMEORIGIN"
SESSION_EXPIRED_CONTROL_ENABLED=True
DEFAULT_ANONYMOUS_VIEW_PERMISSION=True
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=True
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=False

# Users Registration
ACCOUNT_OPEN_SIGNUP=True
ACCOUNT_EMAIL_REQUIRED=True
ACCOUNT_APPROVAL_REQUIRED=False
ACCOUNT_APPROVAL_REQUIRED=True
ACCOUNT_CONFIRM_EMAIL_ON_GET=False
ACCOUNT_EMAIL_VERIFICATION=none
ACCOUNT_EMAIL_CONFIRMATION_EMAIL=False
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED=False
ACCOUNT_EMAIL_CONFIRMATION_EMAIL=True
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED=True
ACCOUNT_AUTHENTICATION_METHOD=username_email
AUTO_ASSIGN_REGISTERED_MEMBERS_TO_REGISTERED_MEMBERS_GROUP_NAME=True

Expand All @@ -175,7 +175,7 @@ GEOIP_PATH=/mnt/volumes/statics/geoip.db

CACHE_BUSTING_STATIC_ENABLED=False

MEMCACHED_ENABLED=False
MEMCACHED_ENABLED=True
MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
MEMCACHED_LOCATION=127.0.0.1:11211
MEMCACHED_LOCK_EXPIRE=3600
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ "master", 2.10.x, 2.6.x, 2.8.x, 3.2.x, 3.3.x, 3.x, 4.x ]
branches: [ "master", "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '38 4 * * 5'
branches: [ "master","develop" ]

jobs:
analyze:
Expand All @@ -44,13 +42,16 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: $
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
paths-ignore: |
**/node_modules/**
**/venv/**


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Vagrantfile
VENV

src/.override_dev_env
src/my_geonode/static/css/site_base.css
src/geoserver
src/celerybeat-schedule
src/hsdc_postgres_db_config.json
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
uwsgi uwsgi-plugin-python3 python3-gdbm python-is-python3 gdal-bin

RUN apt-get install -y devscripts build-essential debhelper pkg-kde-tools sharutils
RUN apt-get install -y nodejs npm
# RUN apt-get install -y nodejs npm
# RUN git clone https://salsa.debian.org/debian-gis-team/proj.git /tmp/proj
# RUN cd /tmp/proj && debuild -i -us -uc -b && dpkg -i ../*.deb

Expand Down Expand Up @@ -73,13 +73,17 @@ RUN chmod +x /usr/bin/celery-cmd
# RUN cd /usr/src/geonode-contribs/geonode-logstash; pip install --upgrade -e . \
# cd /usr/src/geonode-contribs/ldap; pip install --upgrade -e .

# RUN git config --global core.compression 9
# RUN git config --global https.postBuffer 5242880000
# RUN git config --global http.postBuffer 5242880000

RUN pip install --upgrade --src /usr/src -r requirements.txt
RUN pip install --upgrade -e .

# node
WORKDIR /usr/src/my_geonode/my_geonode/static
RUN npm install
RUN npm run tailwind-build
# WORKDIR /usr/src/my_geonode/my_geonode/static
# RUN npm install
# RUN npm run tailwind-build

WORKDIR /usr/src/my_geonode
# Cleanup apt update lists
Expand Down
File renamed without changes.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,21 @@ sh ./paver_dev.sh start
```

## Generate STATIC Assets
You need to have tailwindcss installed golbally.
```shell
npm i -g tailwindcss
```
Watch for changes
```shell
cd src
make tailwind
```

Build tailwind
```bash
# Inside the src folder
cd my_geonode/static
npm install
npm run tailwind-watch
cd src
make tailwind-build
```


37 changes: 19 additions & 18 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ services:
healthcheck:
test: "pg_isready -d postgres -U postgres"
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"
ports:
- "5432:5432"

# Vanilla RabbitMQ service. This is needed by celery
rabbitmq:
Expand All @@ -151,22 +151,23 @@ services:
- rabbitmq:/var/lib/rabbitmq
restart: on-failure

jenkins:
image: jenkins/jenkins:2.164-jdk11
container_name: jenkins4${COMPOSE_PROJECT_NAME}
user: jenkins
ports:
- '${JENKINS_HTTP_PORT}:${JENKINS_HTTP_PORT}'
- '${JENKINS_HTTPS_PORT}:${JENKINS_HTTPS_PORT}'
- '50000:50000'
# network_mode: "host"
volumes:
- jenkins_data:/var/jenkins_home
- backup-restore:/backup_restore
- data:/data
environment:
- 'JENKINS_OPTS=--httpPort=${JENKINS_HTTP_PORT} --httpsPort=${JENKINS_HTTPS_PORT} --prefix=/jenkins'
restart: on-failure
# jenkins:
# image: jenkins/jenkins:2.164-jdk11
# build: ./docker/jenkins/
# container_name: jenkins4${COMPOSE_PROJECT_NAME}
# user: jenkins
# ports:
# - '${JENKINS_HTTP_PORT}:${JENKINS_HTTP_PORT}'
# - '${JENKINS_HTTPS_PORT}:${JENKINS_HTTPS_PORT}'
# - '50000:50000'
# # network_mode: "host"
# volumes:
# - jenkins_data:/var/jenkins_home
# - backup-restore:/backup_restore
# - data:/data
# environment:
# - 'JENKINS_OPTS=--httpPort=${JENKINS_HTTP_PORT} --httpsPort=${JENKINS_HTTPS_PORT} --prefix=/jenkins'
# restart: on-failure

volumes:
jenkins_data:
Expand Down
17 changes: 10 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.9'
# Common Django template for GeoNode and Celery services below
x-common-django:
&default-common-django
image: geonode:local
image: ${COMPOSE_PROJECT_NAME}_django:4.1.x
restart: on-failure
env_file:
- .env
Expand Down Expand Up @@ -43,18 +43,18 @@ services:
# Celery worker that executes celery tasks created by Django.
celery:
<< : *default-common-django
image: geonode:local
image: ${COMPOSE_PROJECT_NAME}_django:4.1.x
container_name: celery4${COMPOSE_PROJECT_NAME}
depends_on:
- django
environment:
- IS_CELERY=True
- IS_CELERY=False
entrypoint: ["/usr/src/my_geonode/entrypoint.sh"]
command: "celery-cmd"

# Nginx is serving django static and media files and proxies to django and geonode
geonode:
image: geonode/nginx:4.0
image: geonode/nginx:1.23.3
build: ./docker/nginx/
container_name: nginx4${COMPOSE_PROJECT_NAME}
environment:
Expand All @@ -75,7 +75,7 @@ services:

# Gets and installs letsencrypt certificates
letsencrypt:
image: geonode/letsencrypt:4.0
image: geonode/letsencrypt:4.1.x
build: ./docker/letsencrypt/
container_name: letsencrypt4${COMPOSE_PROJECT_NAME}
environment:
Expand All @@ -90,6 +90,7 @@ services:
# Geoserver backend
geoserver:
image: geonode/geoserver:2.23.0
build: ./docker/geoserver/
container_name: geoserver4${COMPOSE_PROJECT_NAME}
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8080/geoserver/ows"
Expand All @@ -99,6 +100,8 @@ services:
retries: 10
env_file:
- .env
ports:
- "8080:8080"
volumes:
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
Expand Down Expand Up @@ -137,8 +140,8 @@ services:
healthcheck:
test: "pg_isready -d postgres -U postgres"
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"
ports:
- "5432:5432"

# Vanilla RabbitMQ service. This is needed by celery
rabbitmq:
Expand Down
6 changes: 6 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ test:
reset: down up wait sync

hardreset: pull build reset

tailwind-build:
tailwindcss -c ./my_geonode/static/tailwind.config.js --input ./my_geonode/static/css/tailwind.css --output ./my_geonode/static/css/site_base.css --minify

tailwind:
tailwindcss -c ./my_geonode/static/tailwind.config.js --input ./my_geonode/static/css/tailwind.css --output ./my_geonode/static/css/site_base.css --watch
4 changes: 3 additions & 1 deletion src/geodb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
#DB_CREDENTIAL_FILE = 'D:/iMMAP/code/db_config/hsdc_local_db_config.json'
TIMEZONE = "Asia/Kabul"

os.chdir(r'/home/ubuntu/data/GLOFAS/alerts/')
# FIXME do not use absolute paths
# It gives error in the local environment
# os.chdir(r'/home/ubuntu/data/GLOFAS/alerts/')


def get_db_connection():
Expand Down
2 changes: 1 addition & 1 deletion src/manage.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
. $HOME/.override_env
/usr/local/bin/python /usr/src/my_geonode/manage.py $@
/usr/bin/python /usr/src/my_geonode/manage.py $@
4 changes: 2 additions & 2 deletions src/my_geonode/br/settings_docker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dumpvectordata = yes
dumprasterdata = yes

[fixtures]
apps = contenttypes,auth,people,groups,account,guardian,admin,actstream,announcements,avatar,base,dialogos,documents,geoserver,invitations,pinax_notifications,layers,maps,oauth2_provider,services,harvesting,sites,socialaccount,taggit,tastypie,upload,user_messages,geonode_themes,geoapps,favorite,geonode_client
dumps = contenttypes,auth,people,groups,account,guardian,admin,actstream,announcements,avatar,base,dialogos,documents,geoserver,invitations,pinax_notifications,layers,maps,oauth2_provider,services,harvesting,sites,socialaccount,taggit,tastypie,upload,user_messages,geonode_themes,geoapps,favorite,geonode_client
apps = contenttypes,auth,people,groups,account,guardian,admin,actstream,announcements,avatar,base,documents,geoserver,invitations,pinax_notifications,layers,maps,oauth2_provider,services,harvesting,sites,socialaccount,taggit,tastypie,upload,user_messages,geonode_themes,geoapps,favorite,geonode_client
dumps = contenttypes,auth,people,groups,account,guardian,admin,actstream,announcements,avatar,base,documents,geoserver,invitations,pinax_notifications,layers,maps,oauth2_provider,services,harvesting,sites,socialaccount,taggit,tastypie,upload,user_messages,geonode_themes,geoapps,favorite,geonode_client
4 changes: 2 additions & 2 deletions src/my_geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
LANGUAGE_CODE = os.getenv('LANGUAGE_CODE', "en")

if PROJECT_NAME not in INSTALLED_APPS:
INSTALLED_APPS += (PROJECT_NAME, 'myapp', 'geodb','rangefilter')
INSTALLED_APPS += (PROJECT_NAME, "myapp", "geodb", "rangefilter", "import_export")

# Location of url mappings
ROOT_URLCONF = os.getenv('ROOT_URLCONF', '{}.urls'.format(PROJECT_NAME))
Expand Down Expand Up @@ -314,4 +314,4 @@
# MEDIA_URL="uploaded/"
# MEDIA_ROOT = LOCAL_ROOT + "/uploaded"
# MEDIA_ROOT="/var/www/html/uploaded"
WHITENOISE_MAX_AGE= os.getenv('WHITENOISE_MAX_AGE', "7200")
WHITENOISE_MAX_AGE= os.getenv('WHITENOISE_MAX_AGE', "14400")
3 changes: 1 addition & 2 deletions src/my_geonode/static/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules/*
css/site_base.css
node_modules/*
2 changes: 2 additions & 0 deletions src/my_geonode/static/css/site_base.css

Large diffs are not rendered by default.

Binary file added src/my_geonode/static/img/hsdc-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions src/my_geonode/static/img/immap_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/my_geonode/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="flex items-center mb-16 justify-between">
<div class="flex items-center">
<a href="/">
<img src="{% static 'img/immap_logo.png' %}" class="w-auto h-16" alt="iMMAP LOGO" srcset="">
<img src="{% static 'img/hsdc-logo.png' %}" class="w-auto h-16" alt="iMMAP LOGO" srcset="">
</a>
</div>
<!-- <h1 class="font-extrabold text-[16px] ml-5">
Expand Down
Loading