Maps are defined in QGIS projects that need to be synced to the correct path on the server.
Maps must follow these specifications
This repo is based on the work provided by lizmap.
To get a running version of the repo you can use the following methods:
1). Setup and publishing QGIS Projects
2). Server Deployments
QGIS projects provide the majority of functionality for the applications. It is important to setup an automated way to share these projects. Currently the repository containst projects and these are only updated when they are significant changes. To setup the projects and update them you will need to follow instructions in QGIS Desktop Setup
The instructions below assume you are running docker compose version 1. If you are running
version 2 you will need to replace all instances of docker-compose with docker compose.
-
Make a deployment folder where all source code will be stored
mkdir -p /home/${user}/deployment/map_downloader cd /home/${user}/deployment/map_downloader
-
Clone the
SAGTAandlizmaprepository.git clone [email protected]:kartoza/SAGTA.git git clone [email protected]:3liz/lizmap-docker-compose.git git clone [email protected]:kartoza/lizmap-web-client.git
-
Navigate to the
lizmap-docker-composefolder.cd lizmap-docker-compose -
Generate the configs in the folder.
make configure
-
Remove the test QGIS projects from the repo.
rm -rf ./lizmap/instances/* -
Copy the
docker-compose.ymlfrom theSAGTArepository into this current one.cp -r /home/${user}/deployment/map_downloader/SAGTA/deployment/docker-compose.yml .
-
Copy the
env.examplefrom theSAGTArepository into this folder.cp -r /home/${user}/deployment/map_downloader/SAGTA/deployment/env.example .env -
Adjust the two paths specified in
.envfile to reference the correct paths.Original copied path:
LIZMAP_PROJECTS=/tmp/lizmap/docker-compose/lizmap/instances LIZMAP_DIR=/tmp/lizmap/docker-compose/lizmap
Change them to match the following:
LIZMAP_PROJECTS=/home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/instances LIZMAP_DIR=/home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap
-
Copy the
pluginsfolder from theSAGTAplugin folder into the plugin directory.cp -r /home/${user}/deployment/map_downloader/SAGTA/plugins/qgisserver/* ./lizmap/plugins/
-
Copy the QGIS projects from the QGIS projects from the
SAGTArepository.cp -r /home/${user}/deployment/map_downloader/SAGTA/projects/* ./lizmap/instances/
-
Get the services up by running
docker-compose up -d
Note: The default login credentials are admin:admin.
- Stop the services running to enable the profile tool.
docker-compose stop
- Activate the Profile tool following instructions from profile-plugin
- Access the services from the URL http://localhost
The instance deployed above will have all the plugins available but will use the normal login to the platform. In order to authenticate with the SAGTA domain a few changes are needed. These changes are based on https://github.com/kartoza/lizmap-web-client
-
Make sure the services are not running:
docker-compose stop
-
Open the
docker-compose.ymlfile to make some changes. -
Add the following environment variables to the
lizmapservice in thedocker-compose.ymlCLIENT_ID: add a value here CLIENT_SECRET: add a value here SAGTA_URL: https://sagta.org.za REDIRECT_URI: https://maps.sagta.org.za/ MEMBER_USERNAME: sagta_mapdownloader MEMBER_PASSWORD: add a password here
-
Adjust the volumes section in
lizmapservice in thedocker-compose.yml/home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/lizmap:/www/lizmap/modules/lizmap /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/view/controllers:/www/lizmap/modules/view/controllers
-
Update the repository adding changes from https://github.com/kartoza/lizmap-web-client
cd /home/${user}/deployment/map_downloader/ git clone [email protected]:kartoza/lizmap-web-client.git cd lizmap-web-client cp -r ./lizmap/modules/lizmap/module.xml /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/lizmap/ cp -r ./lizmap/modules/lizmap/classes/sagta.class.php /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/lizmap/classes cp -r ./lizmap/modules/lizmap/templates/user_menu.tpl /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/lizmap/templates/ cp -r ./lizmap/modules/view/controllers/default.classic.php /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/view/controllers/ cp -r ./lizmap/modules/view/controllers/lizMap.classic.php /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/modules/view/controllers/ cp -r ./lizmap/var/config/admin/auth.coord.ini.php /home/${user}/deployment/map_downloader/lizmap-docker-compose/lizmap/var/lizmap-config/admin/
Note: For each new version of lizmap web client we need to update our repository with upstream changes before we continue the update process.
-
Start the services again
cd /home/${user}/deployment/map_downloader/lizmap-docker-compose docker compose up -d
Note: This is still a work in progress.
All manifest are available from sagta-manifests