diff --git a/.github/workflows/52n-build-4.4.x.yml b/.github/workflows/52n-build-4.4.x.yml new file mode 100644 index 00000000000..3367ec7fe9a --- /dev/null +++ b/.github/workflows/52n-build-4.4.x.yml @@ -0,0 +1,59 @@ +name: "[52n-4.4.x -> 4.4.x] Builds GeoNode Docker Images" + +concurrency: + group: "geonode_build_master" + cancel-in-progress: true + +env: + TITLE: "52°North GeoNode Docker Image" + VENDOR: "52°North GmbH" + AUTHORS: "https://52North.org/" + DESCRIPTION: "Builds and publishes the Docker images GeoNode, GeoServer, Nginx" + LICENSE: "GPL-3.0" + TAG: 4.4.x + +on: + push: + branches: + - "52n-4.4.x" + +jobs: + build_and_push_geonode: + runs-on: ubuntu-22.04 + env: + IMAGE: 52north/geonode + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.IMAGE }} + labels: | + "org.opencontainers.image.authors=${{ env.AUTHORS }}" + "org.opencontainers.image.vendor=${{ env.VENDOR }}" + "org.opencontainers.image.description=${{ env.DESCRIPTION }}" + "org.opencontainers.image.title=${{ env.TITLE }}" + "org.opencontainers.image.licenses=${{ env.LICENSE }}" + tags: | + latest + ${{ env.TAG }} + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN_52N_MASTER }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache + cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max diff --git a/.github/workflows/52n-release.yml b/.github/workflows/52n-release.yml new file mode 100644 index 00000000000..74de5229649 --- /dev/null +++ b/.github/workflows/52n-release.yml @@ -0,0 +1,84 @@ +name: Release GeoNode Docker Images + +concurrency: + group: "geonode_build_release" + cancel-in-progress: true + +env: + TITLE: "52°North GeoNode Docker Image" + VENDOR: "52°North GmbH" + AUTHORS: "https://52North.org/" + DESCRIPTION: "Builds and publishes the Docker images GeoNode, GeoServer, Nginx" + LICENSE: "GPL-3.0" + +on: + push: + tags: + - "*-52n" + +jobs: + build_and_push_geonode: + runs-on: ubuntu-22.04 + env: + IMAGE: 52north/geonode + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Parse semver string + id: semver_parser + uses: booxmedialtd/ws-action-parse-semver@v1 + with: + input_string: "${{github.ref_name}}" + version_extractor_regex: '(.*)-52n' + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + env: + MAJOR_VERSION: ${{ steps.semver_parser.outputs.major }} + MAJOR_MINOR_VERSION: ${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }} + MAJOR_MINOR_PATCH_VERSION: ${{ steps.semver_parser.outputs.fullversion }} + with: + images: ${{ env.IMAGE }} + labels: | + "org.opencontainers.image.authors=${{ env.AUTHORS }}" + "org.opencontainers.image.vendor=${{ env.VENDOR }}" + "org.opencontainers.image.description=${{ env.DESCRIPTION }}" + "org.opencontainers.image.title=${{ env.TITLE }}" + "org.opencontainers.image.licenses=${{ env.LICENSE }}" + tags: | + latest + ${{ env.MAJOR_VERSION }} + ${{ env.MAJOR_MINOR_VERSION }} + ${{ env.MAJOR_MINOR_PATCH_VERSION }} + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN_52N_MASTER }} + - + name: Fail in case fully tagged version already exists + run: | + if docker manifest inspect ${{ env.IMAGE }}:${{ steps.semver_parser.outputs.fullversion }}; then + echo "tag version already exists! Will not override." + exit 1 + fi + - + name: Build and push + if: ${{ !github.event.act }} # skip during local actions testing + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache + cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max + diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml new file mode 100644 index 00000000000..3dbe8fbb583 --- /dev/null +++ b/.github/workflows/dockerhub-description.yml @@ -0,0 +1,23 @@ +name: Update Docker Hub Description +on: + push: + branches: + - 52n-master + paths: + - README_52n.md + - .github/workflows/dockerhub-description.yml +jobs: + dockerHubDescription: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN_52N_MASTER }} + repository: 52north/geonode + short-description: "Geospatial content management system" + readme-filepath: ./README_52n.md + enable-url-completion: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2080d18191d..3cafd54c48a 100644 --- a/.gitignore +++ b/.gitignore @@ -97,4 +97,4 @@ scripts/spcgeonode/_volume_* !hooks/* .env - +.secret diff --git a/README_52n.md b/README_52n.md new file mode 100644 index 00000000000..51f68b028c3 --- /dev/null +++ b/README_52n.md @@ -0,0 +1,38 @@ +# 52°North Fork of GeoNode + +This image is built from a fork of [Geonode](https://github.com/geonode/geonode). +[52°North GmbH](https://52north.org) maintains an own fork of GeoNode in order to make necessary adjustments within projects which are not part of GeoNode core. + +However, we are interested to stay as close to upstream as possible, to benefit from ongoing development, but also to contribute features and fixes we develop in our projects. + + +Starting from version `4` this image is built from branch `52n-` of the [`52north/geonode` repository](https://github.com/52North/geonode/tree/52n-master). +Please note, that GeoNode depends on other components which are also available as Docker images. +These images, however, are maintained, built and published from a [`52north/geonode-docker` repository](https://github.com/52North/geonode-docker). + +> :bulb: **Note:** +> +> Please note that the versioning schema is different from the upstream project. +> All images are released and tagged using the GeoNode version. + + +You can obtain all images from here: + +* [`52north/geonode`](https://hub.docker.com/r/52north/geonode) (this image) +* [`52north/geonode-geoserver`](https://hub.docker.com/r/52north/geonode-geoserver) +* [`52north/geonode-geoserver_data`](https://hub.docker.com/r/52north/geonode-geoserver_data) +* [`52north/geonode-nginx`](https://hub.docker.com/r/52north/geonode-nginx) +* [`52north/geonode-postgis`](https://hub.docker.com/r/52north/geonode-postgis) + +The Dockerfiles can be found under the [`./scripts/docker` folder](https://github.com/52North/geonode/tree/52n-master/scripts/docker). + +The GeoNode Dockerfile can be found under the [`./scripts/docker` folder](https://github.com/52North/geonode/tree/52n-master/scripts/docker). +The Dockerfiles for the dependent components are available at [the geonode-docker repository](https://github.com/52North/geonode-docker). + + +Depending on our current project contexts we merge regularly from upstream, and create new pull requests based on this fork. + +> **Note on version `3` tags** +> +> Images containing a `3.x` version tag were experimental and do have a different code base. +> These image are considered to be removed in the near future. \ No newline at end of file diff --git a/create-envfile.py b/create-envfile.py index db568f88234..88604088ef4 100644 --- a/create-envfile.py +++ b/create-envfile.py @@ -92,9 +92,7 @@ def _get_vals_to_replace(args): _vals_to_replace["letsencrypt_mode"] = ( "disabled" if not _vals_to_replace.get("https_host") - else "staging" - if _jsfile.get("env_type", args.env_type) in ["test"] - else "production" + else "staging" if _jsfile.get("env_type", args.env_type) in ["test"] else "production" ) _vals_to_replace["debug"] = False if _jsfile.get("env_type", args.env_type) in ["prod", "test"] else True _vals_to_replace["email"] = _jsfile.get("email", args.email) diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 3f496a6445b..25563ae684b 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -3,7 +3,7 @@ version: '3.9' # Common Django template for GeoNode and Celery services below x-common-django: &default-common-django - image: geonode/geonode:local + image: 52north/geonode:local build: context: ./ dockerfile: Dockerfile diff --git a/docker-compose-test.yml b/docker-compose-test.yml index 1a162f8cf4f..bb4e2dc8b3e 100644 --- a/docker-compose-test.yml +++ b/docker-compose-test.yml @@ -3,7 +3,7 @@ version: '3.9' # Common Django template for GeoNode and Celery services below x-common-django: &default-common-django - image: geonode/geonode:latest-ubuntu-22.04 + image: 52north/geonode:local build: context: ./ dockerfile: Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index fb0e0190a00..67411d21876 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.9' # Common Django template for GeoNode and Celery services below x-common-django: &default-common-django - image: geonode/geonode:latest-ubuntu-22.04 + image: 52north/geonode:4.4.x build: context: ./ dockerfile: Dockerfile diff --git a/geonode/proxy/tests.py b/geonode/proxy/tests.py index 3b04ec080f4..d34d5ef8e01 100644 --- a/geonode/proxy/tests.py +++ b/geonode/proxy/tests.py @@ -420,3 +420,6 @@ def test_should_return_true_if_files_are_available(self, fexists): link.delete() asset.delete() + + link.delete() + asset.delete() \ No newline at end of file diff --git a/geonode/proxy/utils.py b/geonode/proxy/utils.py index 95bd7232e3a..56f6bf7e8de 100644 --- a/geonode/proxy/utils.py +++ b/geonode/proxy/utils.py @@ -64,4 +64,4 @@ def link_post_save(instance, sender, **kwargs): def link_post_delete(instance, sender, **kwargs): # We reinitialize the registry otherwise we might delete a host requested by another service with the same hostanme - proxy_urls_registry.initialize() + proxy_urls_registry.initialize() \ No newline at end of file diff --git a/geonode/proxy/views.py b/geonode/proxy/views.py index fd593728bee..b872f937f21 100644 --- a/geonode/proxy/views.py +++ b/geonode/proxy/views.py @@ -401,4 +401,4 @@ def service_post_delete(instance, sender, **kwargs): signals.post_save.connect(service_post_save, sender=Service) -signals.post_delete.connect(service_post_delete, sender=Service) +signals.post_delete.connect(service_post_delete, sender=Service) \ No newline at end of file diff --git a/geonode/security/tests.py b/geonode/security/tests.py index 77bee1fcfcc..a9162b7eae0 100644 --- a/geonode/security/tests.py +++ b/geonode/security/tests.py @@ -2670,4 +2670,4 @@ def test_user_can_publish(self): finally: # setting back the owner to admin self.dataset.owner = self.admin - self.dataset.save() + self.dataset.save() \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 94b5c655a11..4d8cf964150 100644 --- a/setup.cfg +++ b/setup.cfg @@ -112,8 +112,8 @@ install_requires = geonode-pinax-notifications==6.0.0.2 # GeoNode org maintained apps. - django-geonode-mapstore-client>=4.0.5,<5.0.0 - geonode-importer>=1.0.2 + django-geonode-mapstore-client>=4.4.0,<5.0.0 + geonode-importer>=1.1.0 django-avatar==8.0.0 geonode-oauth-toolkit==2.2.2.2 geonode-user-messages==2.0.2.2