Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove datadir submodule, replace by minimal copy required for Gateway tests #71

Merged
merged 1 commit into from
Nov 3, 2023
Merged
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
6 changes: 2 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[submodule "datadir"]
path = datadir
url = https://github.com/georchestra/datadir.git
branch = master


1 change: 0 additions & 1 deletion datadir
Submodule datadir deleted from 4ed87c
1 change: 1 addition & 0 deletions datadir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
59 changes: 59 additions & 0 deletions datadir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# geOrchestra default datadir

This repository contains the default configuration files for geOrchestra modules, and can be used as a reference to build your own "geOrchestra datadir". We call this a "datadir" for the similarity with the well-known GeoServer and GeoNetwork datadirs, but this directory is not meant to host geographic data.

At startup, geOrchestra applications running inside a servlet container having the extra `georchestra.datadir` parameter, will initialize themselves with the configuration contained in the directory that this parameters points to.

Debian packages already come with their own version of the datadir, but the WARs we provide don't.
That is the reason why this directory is provided here.


## Usage

In order to use this datadir:
* simply clone this repository (typically in `/etc/georchestra` but it might be elsewhere)
* **checkout the branch matching your geOrchestra version** (eventually prefixed with `docker-` if you use [official docker images](https://hub.docker.com/u/georchestra))
* customize the different configuration files (see below)
* launch your servlet container with an extra parameter, typically `georchestra.datadir=/etc/georchestra`

For instance, with tomcat, you may create a `${CATALINA_HOME}/bin/setenv.sh` file with:
```
export CATALINA_OPTS="${CATALINA_OPTS} -Dgeorchestra.datadir="/etc/georchestra"
```

Note that if you are developing, and running the servlet container with the Maven embedded Jetty server, by default, the datadir will be set to `/etc/georchestra/`, and you only need to launch `mvn jetty:run`. If you need to point to another location, say `/etc/anotherlocation/`, you will have to pass it to Jetty: `mvn -Dgeorchestra.datadir=/etc/anotherlocation jetty:run`.

## 3-steps editing

Before using this datadir, you should at least change the default FQDN (`georchestra-127-0-1-1.traefik.me`) for yours.
This can be done very easily with eg:
```
cd /etc/georchestra
find ./ -type f -exec sed -i 's/georchestra-127-0-1-1.traefik.me/my.fqdn/' {} \;
```
...where `my.fqdn` is your server's FQDN.


Next thing to do, for security, is changing the password of the `geoserver_privileged_user`, that is internally used by several geOrchestra modules:
```
cd /etc/georchestra
find ./ -type f -exec sed -i 's/gerlsSnFd6SmM/'$(pwgen 16 1)'/' {} \;
```
Remember to change it in your LDAP too !


Finally, you should head to [ReCAPTCHA](https://www.google.com/recaptcha/) and get an account for your service.
Once you're done, fill in the public and private keys in the [console/console.properties](console/console.properties) file.

**Restart your tomcat or jetty services when done with datadir editing**.


## Notes

There are plenty of other configuration options available, so feel free to browse the sub-folders of this repository and read the comments to make your mind.

We do recommend that you:
* change your SDI logo, with [header/logo.png](header/logo.png)
* update the viewer config with [mapfishapp/js/GEOR_custom.js](mapfishapp/js/GEOR_custom.js)
* translate the console ([console/templates](console/templates)) and extractor ([extractorapp/templates](extractorapp/templates)) email templates to your language, and change the default language in [default.properties](./default.properties).

20 changes: 20 additions & 0 deletions datadir/console/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Console

## Instructions to create a minimalistic GeoJSON file

`ogr2ogr` is a great tool, it allows at the same time to:
* convert from one format (here shapefile) to geojson
* filter out useless attributes (thus reducing the file size)
* reproject from the source SRS to the target SRS (EPSG:4326)

Exemple:
```
ogr2ogr -f geojson -s_srs EPSG:3857 -t_srs EPSG:4326 -select INSEE_COM,NOM_COM_M,INSEE_DEP cities.geojson cities.shp
```

The resulting geojson file is then imported into [mapshaper](https://mapshaper.org/), in order to reduce its complexity while retaining the shapes and topology.

Optionally, [geojson-precision](https://github.com/jczaplew/geojson-precision) can be applied on top, to further reduce the file size:
```
geojson-precision -p 4 cities.geojson final.geojson
```
362 changes: 362 additions & 0 deletions datadir/console/cities.geojson

Large diffs are not rendered by default.

Loading