Skip to content

Commit 0dfa9cc

Browse files
committed
[spcgeonode] integrate in main geonode repo
1 parent a1b125d commit 0dfa9cc

38 files changed

+1647
-0
lines changed

.circleci/config.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
version: 2
2+
3+
jobs:
4+
build:
5+
machine: true
6+
steps:
7+
8+
- checkout
9+
10+
- run:
11+
name: Install Docker Compose
12+
command: |
13+
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
14+
sudo chmod +x /usr/local/bin/docker-compose
15+
16+
- run:
17+
name: Build and start the stack
18+
command: docker-compose -f docker-compose.yml up -d --build
19+
working_directory: scripts/spcgeonode/
20+
21+
- run:
22+
name: Wait for everything to start...
23+
command: |
24+
n=1
25+
m=60
26+
until [ $n -gt $m ]
27+
do
28+
echo "Waiting 60 seconds..."
29+
sleep 60
30+
DJANGO_STATUS=$(docker inspect --format="{{json .State.Health.Status}}" spcgeonode_django_1)
31+
GEOSERVER_STATUS=$(docker inspect --format="{{json .State.Health.Status}}" spcgeonode_geoserver_1)
32+
echo "Waited $n min (out of $m min)"
33+
echo "Django: $DJANGO_STATUS"
34+
echo "Geoserver: $GEOSERVER_STATUS"
35+
if [[ $DJANGO_STATUS == '"healthy"' ]] && [[ $GEOSERVER_STATUS == '"healthy"' ]]; then
36+
break
37+
fi
38+
echo "Not healthy yet..."
39+
docker ps
40+
n=$[$n+1]
41+
done
42+
[[ $DJANGO_STATUS == '"healthy"' ]] && [[ $GEOSERVER_STATUS == '"healthy"' ]];
43+
44+
- run:
45+
name: Show state (debug)
46+
command: docker ps
47+
when: always
48+
49+
- run:
50+
name: Geoserver logs (debug)
51+
command: docker logs spcgeonode_geoserver_1 --tail 500
52+
when: always
53+
54+
- run:
55+
name: Django logs (debug)
56+
command: docker logs spcgeonode_django_1 --tail 500
57+
when: always
58+
59+
# - run: Run the Geonode integration test suite # TODO : reenable this if we manage to have them pass
60+
# - run: docker-compose -f docker-compose.yml exec postgres psql -U postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity;"
61+
# - run: docker-compose -f docker-compose.yml exec postgres psql -U postgres -c "CREATE DATABASE test_postgres WITH TEMPLATE postgres;"
62+
# - run: docker-compose -f docker-compose.yml exec django python manage.py test geonode.tests.integration
63+
64+
workflows:
65+
version: 2
66+
commit:
67+
jobs:
68+
- build
69+
nightly:
70+
triggers:
71+
- schedule:
72+
cron: "0 0 * * *"
73+
filters:
74+
branches:
75+
only:
76+
- spcgeonode-release
77+
jobs:
78+
- build

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ geonode/static/node_modules
77
docs
88
.coverage
99
.celerybeat-*
10+
11+
scripts/spcgeonode/_volume_*

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ geonode\.tests\.bdd\.e2e\.test_login/
8484

8585
/celerybeat.pid
8686
/celerybeat-schedule
87+
88+
scripts/spcgeonode/_volume_*

_secrets/admin_password

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
duper

_secrets/admin_username

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
super

_secrets/rclone.backup.conf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
############################################
2+
# Example using Amazon S3
3+
############################################
4+
5+
# To configure backups using Amazon S3, replace the following variables :
6+
#
7+
# The Access Key for your account :
8+
# YOUR_S3_ACCESS_KEY_HERE
9+
# The Secret Key for your account :
10+
# YOUR_S3_SECRET_KEY_HERE
11+
# The Amazon Region you want to use (looks like us-east-1, eu-west-1, ap-southeast-2, etc) :
12+
# YOUR_S3_REGION_HERE
13+
# The name of the bucket (if it doesn't exist, it will be created):
14+
# THE_NAME_OF_YOUR_BUCKET_HERE
15+
#
16+
# Note that it may be a good idea to enable versionning on the Amazon Bucket, as rclone will just mirror the current directory state.
17+
18+
19+
[spcgeonode_base]
20+
type = s3
21+
acl = private
22+
access_key_id = YOUR_S3_ACCESS_KEY_HERE
23+
secret_access_key = YOUR_S3_SECRET_KEY_HERE
24+
region = YOUR_S3_REGION_HERE
25+
env_auth = false
26+
27+
[spcgeonode]
28+
type = alias
29+
remote = spcgeonode_base:THE_NAME_OF_YOUR_BUCKET_HERE
30+
31+
# TODO : add some other examples (FTP, dropbox...)

scripts/spcgeonode/.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.pyc
2+
Thumbs.db
3+
_volume_*
4+
_service_*
5+
*~
6+
celerybeat-schedule
7+
celeryev.pid

scripts/spcgeonode/.env

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
##############################################################
2+
# #
3+
# SPCgeonode Settings #
4+
# #
5+
# The defauts settings are suited for testing on localhost. #
6+
# If you're deploying SPCgeonode for production, you need to #
7+
# adapt the following settings #
8+
# #
9+
# DO NOT FORGET to also modify values in _secrets ! #
10+
# #
11+
##############################################################
12+
13+
# Name of the setup (you only need to change this if you run several instances of the stack)
14+
COMPOSE_PROJECT_NAME=spcgeonode
15+
16+
# IP or domain name and port where the server can be reached on HTTPS (leave HOST empty if you want to use HTTP only)
17+
HTTPS_HOST=
18+
HTTPS_PORT=443
19+
20+
# IP or domain name and port where the server can be reached on HTTP (leave HOST empty if you want to use HTTPS only)
21+
HTTP_HOST=127.0.0.1
22+
HTTP_PORT=80
23+
24+
# Email where alters should be sent. This will be used by let's encrypt and as the django admin email.
25+
ADMIN_EMAIL=[email protected]
26+
27+
# Let's Encrypt certificates for https encryption. You must have a domain name as HTTPS_HOST (doesn't work
28+
# with an ip) and it must be reachable from the outside. This can be one of the following :
29+
# disabled : we do not get a certificate at all (a placeholder certificate will be used)
30+
# staging : we get staging certificates (are invalid, but allow to test the process completely and have much higher limit rates)
31+
# production : we get a normal certificate (default)
32+
LETSENCRYPT_MODE=disabled
33+
34+
# Choose from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
35+
TIME_ZONE=Pacific/Fiji
36+
37+
# Whether users should be able to create accounts themselves
38+
REGISTRATION_OPEN=True

scripts/spcgeonode/CHANGELOG.md

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Changelog
2+
3+
## Version 2.x
4+
5+
### 2.10rc4.0
6+
7+
- adopted Geonode's versions number (with an additionnal level for subreleases)
8+
- moved the setup to the main Geonode repo under `scripts/spcgeonode`, this makes it easier to use as developement setup for Geonode
9+
- use CirclCI (mostly to avoid interfering with existing travis setup)
10+
11+
## Version 0.1.x (Geonode 2.10)
12+
13+
**WARNING** YOU CANNOT UPGRADE FROM 0.0.x to 0.1.x
14+
YOU NEED TO DO A FRESH INSTALL AND MANUALLY TRANSFER THE DATA
15+
16+
### 0.1.1
17+
18+
- improved nginx config (gzip and expiration header)
19+
20+
### 0.1.0
21+
22+
- targetting future 2.10
23+
- removed elastic search container (it was unused anyways)
24+
- removed postgres login hack and using instead Geonode-Geoserver OAuth mecanism
25+
- prebuilt geodatadir used again and master password procedure simplified
26+
- added django healthcheck
27+
- if https is enabled, force redirection to https host (as geonode doesn't support multiple domain names/relative installs)
28+
- django secret generated automatically
29+
30+
## Version 0.0.x (Geonode 2.6)
31+
32+
### 0.0.25
33+
34+
- undo admin users disabled again
35+
- revert using 2.6.x branch (because of side effect - login taking ages)
36+
37+
### 0.0.24
38+
39+
- use Geonode's Geoserver .war build instead of starting from vanilla
40+
- fix thumbnail generation (uses a custom release of Geonode)
41+
- django admin users are again disabled on restart (so we can keep only 1 superuser)
42+
- added travis integration test (try to deploy django then tries to create an user, upload a layer, get the thumbnail and get a tile of the layer)
43+
- changed rclone configuration (you must now provide rclone conf file)
44+
- removed syncthings
45+
- make http(s) ports parametrable in case a port is already busy
46+
47+
### 0.0.23
48+
49+
- various fixes (broken pip dependencies, wrong fix for geoserver proxy, ssl certificate refreshing)
50+
51+
### 0.0.22
52+
53+
- siteurl set using HTTPS_HOST or HTTP_HOST (instead of "/" which isn't supported)
54+
55+
### 0.0.21
56+
57+
- use custom build of geonode (with some fixes not upstreamed yet)
58+
59+
### 0.0.18
60+
61+
- geoserver master password reset is cleaner (programmatically reset the password from initial datadir before first launch)
62+
- support empty HTTP_HOST or HTTPS_HOST
63+
- geosever 2.12.1 => 2.12.2
64+
- cleaned up env vars
65+
- upgrade should work
66+
67+
### 0.0.17
68+
69+
- improve nginx<->letsencrypt (nginx can work without letsencrypt service)
70+
71+
### 0.0.16
72+
73+
- put django in main directory (so it's more clear for deploy builds)
74+
75+
### 0.0.15
76+
77+
- removed rancher template from repo
78+
- removed entryponts and command from django image to prevent what looks like a bug in rancher where empty entrypoint in docker-compose isn't taken into account
79+
80+
### 0.0.11
81+
82+
- added a second backup service using RClone (the idea is to test both syncthings and rclone then choose one)
83+
84+
### 0.0.10
85+
86+
- we don't rely on an initial geodatadir anymore, instead we start from scratch, launch geoserver once, then do our modifications
87+
- added a backup service using Syncthings
88+
89+
### 0.0.9
90+
91+
- fix bug with rancher resolver on rancher
92+
93+
### 0.0.8
94+
95+
- allow to disable/test let's encrypt using env variables
96+
- we use geonode users/groups table directly for geoserver's authentication
97+
98+
### 0.0.7
99+
100+
- have ssl working online
101+
- use env variables / secrets where applicable
102+
- publish on git and autobuild images
103+
- make docker deploy work again

0 commit comments

Comments
 (0)