Skip to content

cartologic/pygeoapi-auth-deployment

Repository files navigation

pygeoapi-auth

Providing authentication and authorization for the vanilla pygeoapi. It does this by placing the pygeoapi behind a Caddy reverse proxy, which handles forward authentication and authorization with Authelia.

This project is a Dockerized application, and Docker Compose is used for the orchestration of the multiple services. The application's configuration is found in the docker-compose.yml and Caddyfile files.

Pre-requisites

  • Docker and Docker Compose installed on your machine.
  • Permission to edit /etc/hosts file.

Steps for Deployment

  1. Edit /etc/hosts File: Add the following entries to your /etc/hosts file:
127.0.0.1       pygeoapi.local
127.0.0.1       app.pygeoapi.local

This step is necessary to resolve the local domains used in the Caddyfile or Nginx.

  1. Start the Services :

    • Using Caddy

      1. Run the Services with Docker: From the root directory of the project, start all the services using Docker Compose with the following command:

        docker-compose up -d
    • Using Nginx

    1. Generate Self-Signed Certificates:

      [!IMPORTANT] You must generate self-signed certificates for the local domains before starting the services.

    Follow the provided instructions in README.md to generate self-signed certificates for the local domains or use your own certificates.

    1. Run the Services with Docker: From the root directory of the project, start all the services using Docker Compose with the following command:

      docker compose -f "docker-compose-nginx.yml" up -d

This command pulls the necessary Docker images and starts the services defined in docker-compose.yml (for Caddy) or docker-compose-nginx.yml (for Nginx).

Testing Scenarios

For testing the deployment, you can use the following users and endpoints.

Users:

  • User 1: yharby, Password: cartologic
  • User 2: francbartoli, Password: francbartoli

Endpoints:

Please note that the password and user groups have been hashed for security reasons. The hashed passwords provided in the users_database.yml file are cartologic for yharby and francbartoli for francbartoli.

This project is inspired by the fastgeoapi

About

Providing authentication and authorization for the vanilla pygeoapi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published