{"id":44315525,"url":"https://github.com/fccn/nau-course-certificate","last_synced_at":"2026-02-11T05:08:06.962Z","repository":{"id":41394189,"uuid":"362395707","full_name":"fccn/nau-course-certificate","owner":"fccn","description":"Prints course certificates to PDF and digital sign them. Additionally convert them to PNG.","archived":false,"fork":false,"pushed_at":"2025-11-10T21:40:19.000Z","size":247,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-10T23:26:52.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Mako","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-04-28T08:33:50.000Z","updated_at":"2025-11-10T21:40:23.000Z","dependencies_parsed_at":"2023-11-08T11:31:36.578Z","dependency_job_id":"58919e8b-8d23-4429-9c7a-e1ff491e36b5","html_url":"https://github.com/fccn/nau-course-certificate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fccn/nau-course-certificate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fnau-course-certificate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fnau-course-certificate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fnau-course-certificate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fnau-course-certificate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fccn","download_url":"https://codeload.github.com/fccn/nau-course-certificate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fnau-course-certificate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"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":[],"created_at":"2026-02-11T05:08:06.445Z","updated_at":"2026-02-11T05:08:06.951Z","avatar_url":"https://github.com/fccn.png","language":"Mako","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAU Course Certificate\n\nThis repository contains the source code of the NAU Course Certificate application. \nThis should be installed as a docker container.\n\nFor development proposes you can run using flask (recomended), uwsgi or uwsgi inside of a docker container.\n\n## Python\nTested using the Python version `3.11.8`.\n\n## Virtual environment\n\n```bash\nvirtualenv venv --python=python3\nsource venv/bin/activate\npython -m pip install -r requirements.txt --upgrade\n```\n\n## Development server\n\nRun development server as:\n\n```bash\nFLASK_ENV=development flask run\n```\n\nAlternatively using uwsgi:\n\n```bash\nuwsgi uwsgi.ini\n```\n\nUsing docker:\n\n```bash\ndocker-compose build \u0026\u0026 docker-compose up\n```\n\n## Local development\n\nChange the certificate template on openedx LMS on https://lms.dev.nau.fccn.pt/admin/certificates/certificatetemplate/2/change/ with content [nau_base_certificate.mako](nau_base_certificate.mako). And change location of this app to localhost:5000 like is documented on template.\n\nOpen a certificate, like this: https://lms.dev.nau.fccn.pt/certificates/4d1d8ad2bcea43b7bac918ca328183b9\nClick on \"Print certificate\" button or go to http://localhost:5000/attachment/certificates/4d1d8ad2bcea43b7bac918ca328183b9\n\nAfter each download delete the generated file for next test:\n```bash\nAWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYY s3cmd --host 10.0.12.62 --host-bucket nau-development-certificates --no-ssl rm -rf \"s3://nau-development-certificates/certificates/4d1d8ad2bcea43b7bac918ca328183b9/\"\n```\n\n## Upgrade dependencies\n\nOn a virtual environment, install `pip-upgrader` and run it.\n```\npython -m pip install pip-upgrader\npip-upgrade\n```\n\n## Release\n\nCreate a new tag naming vx.x.x example v2.0.0.\n\n```bash\ngit tag vx.x.x\ngit push --tags\n```\n\nThe Github actions would update the latest docker image and generate multiple tags depending on the tag naming. Like \"2\", \"2.0\" and \"2.0.0\".\n\n## DEV\nChange the certificate template on openedx LMS on https://lms.dev.nau.fccn.pt/admin/certificates/certificatetemplate/2/change/ with content [nau_base_certificate.mako](nau_base_certificate.mako).\n\nTODO....\n\n## STAGE\n\nChange the certificate template on openedx LMS on https://lms.stage.nau.fccn.pt/admin/certificates/certificatetemplate/35/change/ with content [nau_base_certificate.mako](nau_base_certificate.mako).\n\nVerify if the certificate is ok on the preview: https://lms.stage.nau.fccn.pt/certificates/user/367/course/course-v1:CNCS+CC101+2018_T1?preview=honor\n\nDelete previous cached certificate.\n```bash\nAWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY s3cmd --host 10.0.12.62 --host-bucket nau-stage-certificates --no-ssl rm -rf \"s3://nau-stage-certificates/certificates/0f371aa73c8246d19bb784e819d5f806/\"\n```\n\nView on local development server http://localhost:5000/inline/certificates/0f371aa73c8246d19bb784e819d5f806\n\nView on STAGE https://lms.stage.nau.fccn.pt/certificates/0f371aa73c8246d19bb784e819d5f806\n\n\n## Digital signature\nTo digital sign PDFs of course certificates it is need to have a certificate (public and key) to be used during the digital signature process.\nFor development proposes there is a digital signature that already is been created on folder `./digital_signature_dev`. With the following procedure:\n\nReference: https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/\n\nCreate certificate authority, when asked enter pass phrase for the CA key, like: \"1234\".\n```bash\nopenssl genrsa -des3 -out NAU_DEV_CA.key 4096\n```\n\nGenerate a root certificate, for 20 years. When asked enter pass phrase for the CA key, like: \"1234\".\n```bash\nopenssl req -x509 -new -nodes -key NAU_DEV_CA.key -sha256 -days 7300 -out NAU_DEV_ROOT.pem\n```\n\nInsert this info when asked\n  Country Name (2 letter code) [AU]:PT\n  State or Province Name (full name) [Some-State]:Lisboa\n  Locality Name (eg, city) []:Lisboa\n  Organization Name (eg, company) [Internet Widgits Pty Ltd]:FCT\n  Organizational Unit Name (eg, section) []:FCCN\n  Common Name (e.g. server FQDN or YOUR name) []:NAU DEV Digital signature\n  Email Address []:ajuda@nau.edu.pt\n\nCreating CA-Signed Certificates:\nCreate private key\n```bash\nopenssl genrsa -out sign-pdf.dev.nau.fccn.pt.key 4096\n```\n\nCreate CSR:\n```bash\nopenssl req -new -key sign-pdf.dev.nau.fccn.pt.key -out sign-pdf.dev.nau.fccn.pt.csr -subj \"/C=PT/ST=Lisboa/L=Lisboa/O=Fundação para a Ciência e a Tecnologia/OU=FCT/CN=sign-pdf.dev.nau.fccn.pt\"\n```\n\nCreate file sign-pdf.dev.nau.fccn.pt.ext\n```bash\necho \\\n\"\nauthorityKeyIdentifier=keyid,issuer\nbasicConstraints=CA:FALSE\nkeyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment\nsubjectAltName = @alt_names\n\n[alt_names]\nDNS.1 = dev.nau.fccn.pt\n\" \u003e sign-pdf.dev.nau.fccn.pt.ext\n```\n\nCreate the certificate for 5 years\n```bash\nopenssl x509 -req -in sign-pdf.dev.nau.fccn.pt.csr -CA NAU_DEV_ROOT.pem -CAkey NAU_DEV_CA.key -CAcreateserial -out sign-pdf.dev.nau.fccn.pt.crt -days 1825 -sha256 -extfile sign-pdf.dev.nau.fccn.pt.ext\n```\n\nGenerate .p12 file with private key, public certificate and root public certificate. \nInsert a new password: 1234\n```bash\nopenssl pkcs12 -export -out sign-pdf.dev.nau.fccn.pt.p12 -inkey sign-pdf.dev.nau.fccn.pt.key -in sign-pdf.dev.nau.fccn.pt.crt -certfile NAU_DEV_ROOT.pem\n```\n\n## STAGE\n\nDelete old print of certificate and then download it a new one on pt-pt language.\n\n```bash\nAWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY s3cmd --host 10.0.12.62 --host-bucket nau-stage-certificates --no-ssl rm -rf \"s3://nau-stage-certificates/certificates/8f7276c174194d36bc5063d90967b766/\"\n\ncurl -v https://course-certificate.stage.nau.fccn.pt/attachment/certificates/8f7276c174194d36bc5063d90967b766?language=pt-pt --output nau_stage_course_certificate_example.pdf\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffccn%2Fnau-course-certificate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffccn%2Fnau-course-certificate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffccn%2Fnau-course-certificate/lists"}