Skip to content

Latest commit

 

History

460 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Catalog API

open-catalog-api logo

License

Open Catalog API is a RESTful API for public software catalogs. It powers national open source catalogs for public administrations:

Requirements

Development

To start developing:

  1. Clone the repo

  2. Build and start the containers

    docker compose up

Docker Compose will bring up the app and PostgreSQL containers.

Wait until the Docker logs explicitly say the API is up and you can use its endpoints at http://localhost:3000/v1/.

Configuration

You can configure the API with environment variables:

  • DATABASE_DSN: the URI used to connect to the database, fe postgres://user:password@host:5432/dbname. Supports PostgreSQL and SQLite.

  • PASETO_KEY (optional): Base64 encoded 32 bytes key used to check the PASETO authentication tokens. You can generate a key and a token with the built-in subcommand:

    open-catalog-api token create

    Pass --key to use an existing key, --sub to identify the caller, and --expiry to set a custom duration (default: 1 year, 0 = never expires).

    If not set, the API will run in read only mode.

  • ENVIRONMENT (optional): possible values test, development, production. Default production.

  • MAX_REQUESTS (optional): number of requests per minute after which responses will be ratelimited. Default: no limit.

  • TRUSTED_PROXIES (optional): comma separated list of addresses or CIDRs of the reverse proxies in front of the API, fe 10.0.0.0/8,192.168.1.7. The X-Forwarded-For header is trusted only on requests coming from these addresses, and its first entry is the client the rate limit counts. Leave it empty when the API is exposed directly: the header is then ignored and the client is the peer of the connection. Default: empty.

Contributing

This project exists also thanks to your contributions! Here is a list of people who already contributed to this repository:

License

Copyright © 2022-present Presidenza del Consiglio dei Ministri

The source code is released under the AGPL version 3.

About

REST API for public administration Open Source catalogs

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages