{"id":19816981,"url":"https://github.com/geoadmin/service-qrcode","last_synced_at":"2026-03-08T00:32:08.125Z","repository":{"id":38193357,"uuid":"274847105","full_name":"geoadmin/service-qrcode","owner":"geoadmin","description":"Create a QR code image from an URL","archived":false,"fork":false,"pushed_at":"2026-02-10T12:34:15.000Z","size":277,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":14,"default_branch":"develop","last_synced_at":"2026-02-10T13:10:07.356Z","etag":null,"topics":["managed-by-tf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geoadmin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-25T06:44:22.000Z","updated_at":"2026-02-10T06:54:56.000Z","dependencies_parsed_at":"2023-01-16T18:01:10.543Z","dependency_job_id":"4aa785ff-df9f-4929-b352-141e10ff20f2","html_url":"https://github.com/geoadmin/service-qrcode","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/geoadmin/service-qrcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoadmin%2Fservice-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoadmin%2Fservice-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoadmin%2Fservice-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoadmin%2Fservice-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoadmin","download_url":"https://codeload.github.com/geoadmin/service-qrcode/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoadmin%2Fservice-qrcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30238865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:30:53.000Z","status":"ssl_error","status_checked_at":"2026-03-08T00:30:44.061Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["managed-by-tf"],"created_at":"2024-11-12T10:11:19.911Z","updated_at":"2026-03-08T00:32:08.080Z","avatar_url":"https://github.com/geoadmin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# service-qrcode\n\n| Branch | Status |\n|--------|-----------|\n| develop | ![Build Status](https://codebuild.eu-central-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiNUppejZ0dTc0b0lIcVFmQ0dOUFdmNmZiY0NaMktubG5jSWJaa0R3aHN2cnlqZHlHUkNZVGhia3NCTDBad0lOQ0FaMDNOWXFtSnRPZytwamdJNmVscVpJPSIsIml2UGFyYW1ldGVyU3BlYyI6IkdHNzU0UlZnWDZBSFJuNGEiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=develop) |\n| master | ![Build Status](https://codebuild.eu-central-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiNUppejZ0dTc0b0lIcVFmQ0dOUFdmNmZiY0NaMktubG5jSWJaa0R3aHN2cnlqZHlHUkNZVGhia3NCTDBad0lOQ0FaMDNOWXFtSnRPZytwamdJNmVscVpJPSIsIml2UGFyYW1ldGVyU3BlYyI6IkdHNzU0UlZnWDZBSFJuNGEiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master) |\n\n## Table of content\n\n- [Table of content](#table-of-content)\n- [Description](#description)\n- [Dependencies](#dependencies)\n- [Service API](#service-api)\n  - [Staging Environments](#staging-environments)\n  - [checker GET](#checker-get)\n  - [generate GET](#generate-get)\n- [Versioning](#versioning)\n- [Local Development](#local-development)\n  - [Make Dependencies](#make-dependencies)\n  - [Setting up to work](#setting-up-to-work)\n  - [Linting and formatting your work](#linting-and-formatting-your-work)\n  - [Test your work](#test-your-work)\n  - [Docker helpers](#docker-helpers)\n- [Deployment](#deployment)\n  - [Deployment configuration](#deployment-configuration)\n\n## Description\n\nA simple REST Microservice that returns a QR code from a given URL, using Flask and Gunicorn, with docker containers as a mean of deployment.\n\n## Dependencies\n\nThis service doesn't have any external dependencies.\n\n## Service API\n\nThis service has two endpoints that are summarized below\n\n- [checker GET](#checker-get)\n- [generate GET](#generate-get)\n\nA detailed descriptions of the endpoints can be found in the [OpenAPI Spec](openapi.yaml).\n\n### Staging Environments\n\n| Environments | URL |\n|--------------|-----|\n| DEV          | [https://sys-map.dev.bgdi.ch/api/qrcode/](https://ssys-map.dev.bgdi.ch/api/qrcode/)  |\n| INT          | [https://sys-map.int.bgdi.ch/api/qrcode/](https://sys-map.int.bgdi.ch/api/qrcode/)  |\n| PROD         | [https://map.geo.admin.ch/api/qrcode/](https://map.geo.admin.ch/api/qrcode/) |\n\n### checker GET\n\nThis is a simple route meant to test if the server is up.\n\n| Path | Method | Argument | Response Type |\n|------|--------|----------|---------------|\n| /checker | GET | - | application/json |\n\n### generate GET\n\nThis route takes an url in the json payload, check if the hostname and domain are part of allowed names and domains, then\ncreate a QR Code from that URL and return it in a json answer.\n\n| Path | Method | Argument | Response Type |\n|------|--------|----------|---------------|\n| /generate | GET | url: unencoded URL to be QR coded | image/png |\n\n## Versioning\n\nThis service uses [SemVer](https://semver.org/) as versioning scheme. The versioning is automatically handled by `.github/workflows/main.yml` file.\n\nSee also [Git Flow - Versioning](https://github.com/geoadmin/doc-guidelines/blob/master/GIT_FLOW.md#versioning) for more information on the versioning guidelines.\n\n## Local Development\n\n### Make Dependencies\n\nThe **Make** targets assume you have **python3.7**, **pipenv**, **bash**, **curl**, **tar**, **docker** and **docker-compose** installed.\n\n### Setting up to work\n\nFirst, you'll need to clone the repo\n\n    git clone git@github.com:geoadmin/service-qrcode.git\n\nThen, you can run the `dev` target to ensure you have everything needed to develop, test and serve locally\n\n    make dev\n\nThat's it, you're ready to work.\n\n### Linting and formatting your work\n\nIn order to have a consistent code style the code should be formatted using `yapf`. Also to avoid syntax errors and non\npythonic idioms code, the project uses the `pylint` linter. Both formatting and linter can be manually run using the\nfollowing command:\n\n    make format-lint\n\n**Formatting and linting should be at best integrated inside the IDE, for this look at\n[Integrate yapf and pylint into IDE](https://github.com/geoadmin/doc-guidelines/blob/master/PYTHON.md#yapf-and-pylint-ide-integration)**\n\n### Test your work\n\nTesting if what you developed work is made simple. You have four targets at your disposal. **test, serve, gunicornserve, dockerrun**\n\n    make test\n\nThis command run the integration and unit tests.\n\n    make serve\n\nThis will serve the application through Flask without any wsgi in front.\n\n    make gunicornserve\n\nThis will serve the application with the Gunicorn layer in front of the application. It also add the route prefix `/api/qrcode`.\n\n    make dockerrun\n\nThis will serve the application with the wsgi server, inside a container.\n\n### Docker helpers\n\nFrom each github PR that is merged into `master` or into `develop`, one Docker image is built and pushed on AWS ECR with the following tag:\n\n- `vX.X.X` for tags on master\n- `vX.X.X-beta.X` for tags on develop\n\nEach image contains the following metadata:\n\n- author\n- git.branch\n- git.hash\n- git.dirty\n- version\n\nThese metadata can be read with the following command\n\n```bash\nmake dockerlogin\ndocker pull 974517877189.dkr.ecr.eu-central-1.amazonaws.com/service-qrcode:develop.latest\n\n# NOTE: jq is only used for pretty printing the json output,\n# you can install it with `apt install jq` or simply enter the command without it\ndocker image inspect --format='{{json .Config.Labels}}' 974517877189.dkr.ecr.eu-central-1.amazonaws.com/service-qrcode:develop.latest | jq\n```\n\nYou can also check these metadata on a running container as follows\n\n```bash\ndocker ps --format=\"table {{.ID}}\\t{{.Image}}\\t{{.Labels}}\"\n```\n\nTo build a local docker image tagged as `service-qrcode:local-${USER}-${GIT_HASH_SHORT}` you can\nuse\n\n```bash\nmake dockerbuild\n```\n\nTo push the image on the ECR repository use the following two commands\n\n```bash\nmake dockerlogin\nmake dockerpush\n```\n\n## Deployment\n\nThis service is to be deployed to the Kubernetes cluster. See [geoadmin/infra-kubernetes/services/service-qrcode](https://github.com/geoadmin/infra-kubernetes/tree/master/services/service-qrcode#readme)\n\n### Deployment configuration\n\nThe service is configured by Environment Variable:\n\n| Env         | Default               | Description                            |\n|-------------|-----------------------|----------------------------------------|\n| LOGGING_CFG | `logging-cfg-local.yml` | Logging configuration file           |\n| ALLOWED_DOMAINS | `.*` | Comma separated list of regex that are allowed as domain in Origin header |\n| CACHE_CONTROL | `public, max-age=31536000` | Cache Control header value of the GET /generate endpoint |\n| CACHE_CONTROL_4XX | `public, max-age=3600` | Cache Control header for 4XX responses |\n| GUNICORN_KEEPALIVE | `2` | The [`keepalive`](https://docs.gunicorn.org/en/stable/settings.html#keepalive) setting passed to gunicorn. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoadmin%2Fservice-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoadmin%2Fservice-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoadmin%2Fservice-qrcode/lists"}