🚀Bumped version to v0.1.3
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nicolai Ort 2021-02-08 17:38:42 +01:00
parent b6296b8d97
commit 6a14232889
5 changed files with 449 additions and 449 deletions

View File

@ -1,155 +1,155 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [v0.1.2](https://git.odit.services/lfk/document-server/compare/v0.1.2...v0.1.2)
- Merge pull request 'Load more stuff from env feature/16-env_vars' (#17) from feature/16-env_vars into dev [`bc4d16e`](https://git.odit.services/lfk/document-server/commit/bc4d16e6f8959ed35d7e87647de84584cdfddd7b)
- Added new env vars to config [`3bb322e`](https://git.odit.services/lfk/document-server/commit/3bb322ede5db15a147c0d7a8db2a68ccb7fa2112)
- Added new env vars to readme [`b77bb3a`](https://git.odit.services/lfk/document-server/commit/b77bb3ad9dba9d73c2c81215ba57936192155a9a)
- Now loading interpolation vars from config/env [`b4ebae2`](https://git.odit.services/lfk/document-server/commit/b4ebae283b472b2f0c6e28caed49b30edb119585)
- 🧾New changelog file version [CI SKIP] [skip ci] [`a306009`](https://git.odit.services/lfk/document-server/commit/a30600943d01116b99e946cb705a16d0372b5095)
#### [v0.1.2](https://git.odit.services/lfk/document-server/compare/v0.1.1...v0.1.2)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.2 - Hotfix release' (#15) from dev into main [`123cf8a`](https://git.odit.services/lfk/document-server/commit/123cf8ad48a45fa10dcd5208215a6e525f31115a)
- 🧾New changelog file version [CI SKIP] [skip ci] [`22b1e00`](https://git.odit.services/lfk/document-server/commit/22b1e0097efc865de9cc150cb0d0b99bf789b519)
- 🚀Bumped version to v0.1.2 [`7e507d4`](https://git.odit.services/lfk/document-server/commit/7e507d4cc415877ac0b25503dc0ff9ecdceabf42)
- PAtch: Copy locales [`f7dfd6d`](https://git.odit.services/lfk/document-server/commit/f7dfd6d0c3c69881338bc1f66d5d33ae9abff628)
#### [v0.1.1](https://git.odit.services/lfk/document-server/compare/v0.1.0...v0.1.1)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.1 - Hotfix release' (#12) from dev into main [`cbff307`](https://git.odit.services/lfk/document-server/commit/cbff3074d10110dbb64dda1ed516d2a18402eeca)
- 🧾New changelog file version [CI SKIP] [skip ci] [`4fca5af`](https://git.odit.services/lfk/document-server/commit/4fca5afdfa15d3260ac28c1feb89d50221b1f03f)
- Updated dockerfile & build for dockerized puppeteer [`ea8028d`](https://git.odit.services/lfk/document-server/commit/ea8028dfd54861335e9752334db335ad21e75cf2)
- 📖New license file version [CI SKIP] [skip ci] [`8d4e7a1`](https://git.odit.services/lfk/document-server/commit/8d4e7a16d1ebae6976ec183b761ca3e6a8946629)
- Revert "Now only using our mirror to build" [`fe0f45e`](https://git.odit.services/lfk/document-server/commit/fe0f45ea92099a65d998e342ef885af39d06915f)
- Now only using our mirror to build [`b07c5a9`](https://git.odit.services/lfk/document-server/commit/b07c5a96f2a670f2279a6575b03f9c553b59e0a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`9755e43`](https://git.odit.services/lfk/document-server/commit/9755e437c2b68c09e9b0ffa47c6bc1729e6bee14)
- 🧾New changelog file version [CI SKIP] [skip ci] [`603a814`](https://git.odit.services/lfk/document-server/commit/603a814ad4783c0b29c1f6a1db638f269b29f775)
- Switched to using our mirrored images for buildi [`dba765c`](https://git.odit.services/lfk/document-server/commit/dba765cb017998ad636f3f91fb00a8a277d3b225)
- 🚀Bumped version to v0.1.1 [`d1b07f3`](https://git.odit.services/lfk/document-server/commit/d1b07f39fd7e3c282a631924bf45367e866e667a)
- Pinned alpine version [`6ab3946`](https://git.odit.services/lfk/document-server/commit/6ab3946c31a7716d1c42fb217b0a0f7be8172dba)
#### v0.1.0
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.0 - Contract generation' (#11) from dev into main [`bc2b6fa`](https://git.odit.services/lfk/document-server/commit/bc2b6fadd912f275bc05be29c6fbd87367d617df)
- 📖New license file version [CI SKIP] [skip ci] [`ee19efa`](https://git.odit.services/lfk/document-server/commit/ee19efa0e63f21a10fed1cf24beb16118bbe6cde)
- 🚀Bumped version to v0.0.2 [`de432c4`](https://git.odit.services/lfk/document-server/commit/de432c448129a8acb36fef6b40ef920eeb2f7887)
- First working (TM) template code [`a9e3360`](https://git.odit.services/lfk/document-server/commit/a9e3360ee258e4d48c8dbe3a55468409bb6ee0f7)
- Working Styleing [`c617c40`](https://git.odit.services/lfk/document-server/commit/c617c40e9d7e03382f647eafde9ff458db3c6c15)
- Removed base64 image [`e401d0e`](https://git.odit.services/lfk/document-server/commit/e401d0ec7219e88fbb277b2dcf456a22dae0d1e5)
- Updated the contract template to use external css [`6121b1e`](https://git.odit.services/lfk/document-server/commit/6121b1e3bfcf6fc9f88e0589205044c59859b4a7)
- Sorted locales [`1962499`](https://git.odit.services/lfk/document-server/commit/1962499d18685347302fd7d8491c6e3e7a355fcb)
- Switched to puppeteer for pdf generation [`5afd26e`](https://git.odit.services/lfk/document-server/commit/5afd26ea22cff3b8a339cf658ed37d2053db24ba)
- Added a coupple of real replacement strings to the sponsoring template [`041c0ed`](https://git.odit.services/lfk/document-server/commit/041c0ed6bbe5f8645e4e96b57c02d4e45b445402)
- Added automatic img to base64 conversion [`42443af`](https://git.odit.services/lfk/document-server/commit/42443af734ccc9ce202aec045a07775f4a054b92)
- Added i18n strings [`e345c36`](https://git.odit.services/lfk/document-server/commit/e345c36dd0b03f276259521aebf423853a81a04d)
- first working pdf generation from class 🎉 [`3af76a5`](https://git.odit.services/lfk/document-server/commit/3af76a53e3156bdc2d1d3ade6ff940db9d7b24b5)
- Added a bunch of english and german translations 🌎 [`784d7c6`](https://git.odit.services/lfk/document-server/commit/784d7c656fd2dfc726722459f3ccb7612021b882)
- Added translations using i18next [`75eb925`](https://git.odit.services/lfk/document-server/commit/75eb9252672883f7b6f89a812a37d2b96f9f626e)
- Switched to handlebars for templateing [`4acf3e3`](https://git.odit.services/lfk/document-server/commit/4acf3e39ce55c0ad9e697cf9598569ec1c1dcb44)
- Moved pdf creatior initialization to new function [`47a05fa`](https://git.odit.services/lfk/document-server/commit/47a05facb33c178e9bf3f99c25049abc010361c4)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f3de80a`](https://git.odit.services/lfk/document-server/commit/f3de80af78c96bd697715a30dee7cae6806f9f9f)
- 🚀Bumped version to v0.1.0 [`6a42fe3`](https://git.odit.services/lfk/document-server/commit/6a42fe37d053a6a00005e3c5781edfcefe61183e)
- Merge pull request 'Sponsoring contract generation feature/5-sponsoring_contracts' (#10) from feature/5-sponsoring_contracts into dev [`84259d3`](https://git.odit.services/lfk/document-server/commit/84259d37d42234e1be75f3a5c95f4b442a9e5844)
- Added optimization args [`140fda1`](https://git.odit.services/lfk/document-server/commit/140fda11cc88cb93218116d4cbdbf13c014a659d)
- Added first parts of template [`13776d1`](https://git.odit.services/lfk/document-server/commit/13776d1ecb2db03f19dd0c01a930d4c98222cf6b)
- Added pdf merging for big requests (over 100 runners) [`785544c`](https://git.odit.services/lfk/document-server/commit/785544ca16cd4907a378eb2d48e4269778e3dccc)
- Fixed file broken in merge [`c07c6ae`](https://git.odit.services/lfk/document-server/commit/c07c6aeeab70589a4e1ddf025a07bde96c68ef6e)
- Now with workin i18n-ally config🥳 [`7c3813b`](https://git.odit.services/lfk/document-server/commit/7c3813b94d06ca38b83db90b7f9fba6c33716a05)
- Now with workin i18n-ally config🥳 [`b4232e5`](https://git.odit.services/lfk/document-server/commit/b4232e51e084f491d1a7fb4f929327e88f3b4c00)
- Now accepting arrays for sponsoring contract generation [`f833ae2`](https://git.odit.services/lfk/document-server/commit/f833ae222e68b7df9b8f8a8ec7ce17d679a9710f)
- Added full interpolation support to the i18n [`f755f4f`](https://git.odit.services/lfk/document-server/commit/f755f4f9fb1463af6bec3cf73b7fabf95ef3fb2e)
- Added option to generate empty sponsoring contracts [`1ced0e3`](https://git.odit.services/lfk/document-server/commit/1ced0e317544217599a42c6b270c9136dc73676d)
- Added translation sorting secript [`1e67672`](https://git.odit.services/lfk/document-server/commit/1e67672ef0d28f94a50b0377cca8e8ff2a87e983)
- Removed the example data from the fill-in fields [`5e12525`](https://git.odit.services/lfk/document-server/commit/5e1252545b7eafeee6c3a1d67567d00e5d615d85)
- Edited html template [`d58453f`](https://git.odit.services/lfk/document-server/commit/d58453faf9840037c583e029c41ef1b31a0bafa8)
- PDF Creator now accepts single instances of class [`78205ee`](https://git.odit.services/lfk/document-server/commit/78205ee8c7659ae0dc2e4a184554b042251d9271)
- PDF Creator now accepts single instances of class [`ba7cedd`](https://git.odit.services/lfk/document-server/commit/ba7cedd187dbc51a53ba169889d8e0ca22a97b5d)
- Updated template for i18n [`a596188`](https://git.odit.services/lfk/document-server/commit/a596188c00444c285565eecbb1f0bc668bb4706c)
- Parellized the chunks [`e92820e`](https://git.odit.services/lfk/document-server/commit/e92820e12f289b4fd28b4ebc985b5b711777fc35)
- Fixed the controller not waiting for initialization [`ee8ba99`](https://git.odit.services/lfk/document-server/commit/ee8ba99cc7778f89a8bb99400c7d1cf1a12898f7)
- Implemented language selection by query param [`6f81566`](https://git.odit.services/lfk/document-server/commit/6f81566cb82a0801a20523a7177996ea40cb3968)
- Added comments [`cd51e78`](https://git.odit.services/lfk/document-server/commit/cd51e78282278cae6cb86bd0c9616746612a97e3)
- Added example locales [`1969769`](https://git.odit.services/lfk/document-server/commit/19697692bcb6c0c1c978918916caccd95a8f2035)
- Fixed data validation problem [`bd6ec62`](https://git.odit.services/lfk/document-server/commit/bd6ec6215d362325c510611e4545b7643b918200)
- Removed fullname from groups (to be renabled later) [`388d8a2`](https://git.odit.services/lfk/document-server/commit/388d8a2dc6ee06d39e621e1e45ae595dae587483)
- Updated comments [`119102a`](https://git.odit.services/lfk/document-server/commit/119102aef8f43a68f537e7542c2f2cd3b41cd28e)
- Updated readme for handlebars [`05e4718`](https://git.odit.services/lfk/document-server/commit/05e471878f2321a1873b21730ae85ad6b8af5766)
- Updated readme [`f69e777`](https://git.odit.services/lfk/document-server/commit/f69e7779e42f18df7ec3ccb1cdf9dcf7fa845ee6)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f4a34dd`](https://git.odit.services/lfk/document-server/commit/f4a34dd36b57bd122a650f2de4ea8e00816276ed)
- Typos [`95b882a`](https://git.odit.services/lfk/document-server/commit/95b882aceded275ad89446ad92a10cf36b166ab7)
- Added sentence about large requests to the /contracts openapi description [`4773a5f`](https://git.odit.services/lfk/document-server/commit/4773a5f18c866b6e9d50b421d7917416860cb6b5)
- Removed puppeteer args [`06dedc0`](https://git.odit.services/lfk/document-server/commit/06dedc0797b649f3fa8934f0d774ccae2b062849)
- Expanded max request body size to 500mb [`4f191dc`](https://git.odit.services/lfk/document-server/commit/4f191dcb52cd727e34770ab4304937cd1e7e480d)
- Now awaiting language change [`c07319b`](https://git.odit.services/lfk/document-server/commit/c07319b250db9452f6122e797b6059151031e2a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`42d6c40`](https://git.odit.services/lfk/document-server/commit/42d6c40d0c673f39c27e3d5a6484f01a4da77266)
- Formatting [`2d0b7ce`](https://git.odit.services/lfk/document-server/commit/2d0b7ce79ed47d4827096a2bbccfe3bbcd061810)
- Removed useless await [`4cd437b`](https://git.odit.services/lfk/document-server/commit/4cd437b6afe40e4c09027c0e2004a1130bc51870)
- Updated comments [`cf9cd29`](https://git.odit.services/lfk/document-server/commit/cf9cd298b638012e079be0a04d1b48efea20026f)
- Merge pull request 'Patch 0.0.2' (#9) from dev into main [`4585a83`](https://git.odit.services/lfk/document-server/commit/4585a83838b80552160c9d9e5be0af891eae39c8)
- Merge pull request 'Basic documentation feature/6-documentation' (#8) from feature/6-documentation into dev [`73915da`](https://git.odit.services/lfk/document-server/commit/73915da20321940e22145b4c5d830b9f700be566)
- 📖New license file version [CI SKIP] [skip ci] [`465efe0`](https://git.odit.services/lfk/document-server/commit/465efe03000ecc00d14479ac38710ffdba2cafb5)
- Typos [`68e34a9`](https://git.odit.services/lfk/document-server/commit/68e34a9054a195545b0bd10ce888f7274854fae6)
- Merge pull request 'Implemented the basics for templateing feature/3-pdf_templateing' (#4) from feature/3-pdf_templateing into dev [`15f1641`](https://git.odit.services/lfk/document-server/commit/15f16415c0ac5012df8126c8df6bd4da93ad0a20)
- Merge pull request 'Implemented the basic request classes feature/1-input_classes' (#2) from feature/1-input_classes into dev [`b5e79e5`](https://git.odit.services/lfk/document-server/commit/b5e79e51ef5d751a67e7a1763809ece91a7627f2)
- Added openapi viewers [`6435c8a`](https://git.odit.services/lfk/document-server/commit/6435c8a88e2ea3f4417ad5d8be9a07b9c043b41b)
- 📖New license file version [CI SKIP] [skip ci] [`d493e74`](https://git.odit.services/lfk/document-server/commit/d493e74bf39bc85de842ac7cd3e3d37ba8797a04)
- Initial commit [`0908bcd`](https://git.odit.services/lfk/document-server/commit/0908bcd63529b44463bc57ad7d6b8785564e4ddc)
- Added address class and errors [`d291cf0`](https://git.odit.services/lfk/document-server/commit/d291cf0d1bf375e96fda822543d5ceb29dc67010)
- Added drone file [`48d7cad`](https://git.odit.services/lfk/document-server/commit/48d7cad9f37485656cfb1c70abef158b5dd8d847)
- Added the donation classes [`1d73e4e`](https://git.odit.services/lfk/document-server/commit/1d73e4ed9ccb3dfb7709cb89957ed5bbcefad870)
- Added openapi related classes [`9d62225`](https://git.odit.services/lfk/document-server/commit/9d6222547811fd3c94b91496d9917b7df5115fc6)
- Added a bs example template [`f726a6e`](https://git.odit.services/lfk/document-server/commit/f726a6e699575b839d332c15e61c9008fe996fa9)
- Added a basic donor class [`cfa65e8`](https://git.odit.services/lfk/document-server/commit/cfa65e83cafcefbd6261a99ab7a4eaf099665a81)
- Added input class for contract generation [`63f9523`](https://git.odit.services/lfk/document-server/commit/63f952376698c3561754bfb206a64c58c1ae86f1)
- Initialized package [`b0427a6`](https://git.odit.services/lfk/document-server/commit/b0427a6d810656096c467881a302eef244f86d29)
- Added a simplified runnergroup class [`e29c17a`](https://git.odit.services/lfk/document-server/commit/e29c17a29a6ee84944f8d67d7b6f3c4292763c10)
- Resolved fun issues with promises [`4617f2c`](https://git.odit.services/lfk/document-server/commit/4617f2c5bdcb29534b46865ebe21d15e2b1cd72f)
- Added a runnercard class [`cb7325b`](https://git.odit.services/lfk/document-server/commit/cb7325bbf906b405955bd81e199abae5edc27d91)
- Added a basic readme [`df94b1b`](https://git.odit.services/lfk/document-server/commit/df94b1b750922989d870546150ff8d9ff8af4102)
- Added base app [`915ff92`](https://git.odit.services/lfk/document-server/commit/915ff92418a2859c11e0ce58b79220fb5ea06c7f)
- Added vscode workspace config [`ae466b4`](https://git.odit.services/lfk/document-server/commit/ae466b4d7e5b67c5cd1bc440214f477d15f768a2)
- Created a pdf class that takes care of the pdf wrapping [`7d5b575`](https://git.odit.services/lfk/document-server/commit/7d5b5750ad78fd979cb1b647d8b318a84513532a)
- Added editor and stageing infos to the README [`56b7227`](https://git.odit.services/lfk/document-server/commit/56b72275aca57b227c775c4a61e91fd03471f987)
- Added dockerfile and docker-compose [`b9d4cc3`](https://git.odit.services/lfk/document-server/commit/b9d4cc36199b8f0090d555e961a3454bf35f4bd6)
- Added loaders [`57afbd4`](https://git.odit.services/lfk/document-server/commit/57afbd4b6c48cf641b69a2fcbb28783ff84e1cfd)
- Added a certificaterunner class [`d08bdfd`](https://git.odit.services/lfk/document-server/commit/d08bdfd961f4128981b969cf149df7397a257193)
- Added a template section to the readme [`8141269`](https://git.odit.services/lfk/document-server/commit/8141269dd99f03b33019e5a8f4a010954c4fc44a)
- Created a barebones pdf controller [`64bd1ff`](https://git.odit.services/lfk/document-server/commit/64bd1ffc3ad8459c13154e2cd9a568f27baa2bf2)
- Moved distance to the main runner object [`1d1fa50`](https://git.odit.services/lfk/document-server/commit/1d1fa50327927328ce77af33c1abbf994df9ac8b)
- Added tsconfig [`e1f0378`](https://git.odit.services/lfk/document-server/commit/e1f03788dbdddcb1cb138556c1fed4da9ca104a8)
- Added basic dependencies [`43bb728`](https://git.odit.services/lfk/document-server/commit/43bb728d0d8b75239f1db765071d28a839300102)
- Added typeing to the buffer and stream conversion [`3fb8be2`](https://git.odit.services/lfk/document-server/commit/3fb8be22b74204accabed8a8c8fb5161c5ad7504)
- Added basic dependencies [`d450cea`](https://git.odit.services/lfk/document-server/commit/d450ceac74959bdfb694f9b12fb1fd14ff85b598)
- Added release-it config [`185e66f`](https://git.odit.services/lfk/document-server/commit/185e66fb5b2e4330233ff2e74101c4447c317b5a)
- Added config class [`278c563`](https://git.odit.services/lfk/document-server/commit/278c56386b0e9079a71d3339b40d08f046255a3e)
- Added Barebones pdf creator class [`557cc26`](https://git.odit.services/lfk/document-server/commit/557cc26f281da0b47621dff667435a788c42c103)
- Added a simple status controller [`1d62e7f`](https://git.odit.services/lfk/document-server/commit/1d62e7f14c8d6219607ed6ecf774ae152e362cc1)
- Added errorhandler middleware [`6539fd7`](https://git.odit.services/lfk/document-server/commit/6539fd785568971330639fb7055827417424c81a)
- Runners now use the runnergroup class instead of strings [`aae4f50`](https://git.odit.services/lfk/document-server/commit/aae4f507eafbfd51cd9972cf0fac4c5afafbb45a)
- Added files to gitignore [`66134c0`](https://git.odit.services/lfk/document-server/commit/66134c0e1e5dce2ebd9eae3f88a6ad893bad0283)
- Switched to the splitted functions [`3ca38ab`](https://git.odit.services/lfk/document-server/commit/3ca38abe9359e436fe0f80400ad0308ad9d64a4f)
- Cleaned up openapi stuff [`4efb629`](https://git.odit.services/lfk/document-server/commit/4efb62921bced79c817499b48bbc55b05e6371e5)
- Updated apidoc viewer settings [`36396af`](https://git.odit.services/lfk/document-server/commit/36396af50a1f7d1842effbd24e08a8d34946a375)
- Updated apidoc viewer settings [`4d45e0f`](https://git.odit.services/lfk/document-server/commit/4d45e0f80d5721c91de0b25334d040448d92e01d)
- 🧾New changelog file version [CI SKIP] [skip ci] [`8f250f7`](https://git.odit.services/lfk/document-server/commit/8f250f747a95feb246b1698a7c9be9ee19a1be12)
- Added missing dependencies [`c2d7141`](https://git.odit.services/lfk/document-server/commit/c2d714116e02bb4c2ff6501ba32417cd998e2f3e)
- Added license export and release scripts [`0c4e5a1`](https://git.odit.services/lfk/document-server/commit/0c4e5a182c91b99a657c83f2c24f4cfaae1ef48d)
- Added build script [`cbc421c`](https://git.odit.services/lfk/document-server/commit/cbc421cd838b6c874fbe50556350edeb08a7b882)
- Added dev script [`814b564`](https://git.odit.services/lfk/document-server/commit/814b564752aa95ed2c034a9a98c800b43452bf88)
- Adjusted template font styleing [`2c7b025`](https://git.odit.services/lfk/document-server/commit/2c7b0254ec7e49c31f8f33eed334ab4156052fb6)
- Added html-pdf package [`a7d4001`](https://git.odit.services/lfk/document-server/commit/a7d4001ad992d60e2af69e9bbed53366bc0a46d3)
- Added PDFs to gitignore [`9f3758d`](https://git.odit.services/lfk/document-server/commit/9f3758de39ef1d5b591a24868eb683caa742f694)
- Added version to config [`b1747f6`](https://git.odit.services/lfk/document-server/commit/b1747f6374c029e1e9c3a87584ea54b9d3714d92)
- fixed license-exporter call [`83c4bd6`](https://git.odit.services/lfk/document-server/commit/83c4bd62cbbb13ae33a790baa45cc15a77d99e41)
- Added version to config [`cff7011`](https://git.odit.services/lfk/document-server/commit/cff70110fde72c7fede0625872acdc0666703fa1)
- Added openapi dependency [`94e5e51`](https://git.odit.services/lfk/document-server/commit/94e5e51f8d421ea7fd64ded2281b89ff4a252b29)
- Added templates folder [`8a30265`](https://git.odit.services/lfk/document-server/commit/8a30265fc600dad17f584f95dd51db976945d4c5)
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [v0.1.2](https://git.odit.services/lfk/document-server/compare/v0.1.2...v0.1.2)
- Merge pull request 'Load more stuff from env feature/16-env_vars' (#17) from feature/16-env_vars into dev [`bc4d16e`](https://git.odit.services/lfk/document-server/commit/bc4d16e6f8959ed35d7e87647de84584cdfddd7b)
- Added new env vars to config [`3bb322e`](https://git.odit.services/lfk/document-server/commit/3bb322ede5db15a147c0d7a8db2a68ccb7fa2112)
- Added new env vars to readme [`b77bb3a`](https://git.odit.services/lfk/document-server/commit/b77bb3ad9dba9d73c2c81215ba57936192155a9a)
- Now loading interpolation vars from config/env [`b4ebae2`](https://git.odit.services/lfk/document-server/commit/b4ebae283b472b2f0c6e28caed49b30edb119585)
- 🧾New changelog file version [CI SKIP] [skip ci] [`a306009`](https://git.odit.services/lfk/document-server/commit/a30600943d01116b99e946cb705a16d0372b5095)
#### [v0.1.2](https://git.odit.services/lfk/document-server/compare/v0.1.1...v0.1.2)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.2 - Hotfix release' (#15) from dev into main [`123cf8a`](https://git.odit.services/lfk/document-server/commit/123cf8ad48a45fa10dcd5208215a6e525f31115a)
- 🧾New changelog file version [CI SKIP] [skip ci] [`22b1e00`](https://git.odit.services/lfk/document-server/commit/22b1e0097efc865de9cc150cb0d0b99bf789b519)
- 🚀Bumped version to v0.1.2 [`7e507d4`](https://git.odit.services/lfk/document-server/commit/7e507d4cc415877ac0b25503dc0ff9ecdceabf42)
- PAtch: Copy locales [`f7dfd6d`](https://git.odit.services/lfk/document-server/commit/f7dfd6d0c3c69881338bc1f66d5d33ae9abff628)
#### [v0.1.1](https://git.odit.services/lfk/document-server/compare/v0.1.0...v0.1.1)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.1 - Hotfix release' (#12) from dev into main [`cbff307`](https://git.odit.services/lfk/document-server/commit/cbff3074d10110dbb64dda1ed516d2a18402eeca)
- 🧾New changelog file version [CI SKIP] [skip ci] [`4fca5af`](https://git.odit.services/lfk/document-server/commit/4fca5afdfa15d3260ac28c1feb89d50221b1f03f)
- Updated dockerfile & build for dockerized puppeteer [`ea8028d`](https://git.odit.services/lfk/document-server/commit/ea8028dfd54861335e9752334db335ad21e75cf2)
- 📖New license file version [CI SKIP] [skip ci] [`8d4e7a1`](https://git.odit.services/lfk/document-server/commit/8d4e7a16d1ebae6976ec183b761ca3e6a8946629)
- Revert "Now only using our mirror to build" [`fe0f45e`](https://git.odit.services/lfk/document-server/commit/fe0f45ea92099a65d998e342ef885af39d06915f)
- Now only using our mirror to build [`b07c5a9`](https://git.odit.services/lfk/document-server/commit/b07c5a96f2a670f2279a6575b03f9c553b59e0a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`9755e43`](https://git.odit.services/lfk/document-server/commit/9755e437c2b68c09e9b0ffa47c6bc1729e6bee14)
- 🧾New changelog file version [CI SKIP] [skip ci] [`603a814`](https://git.odit.services/lfk/document-server/commit/603a814ad4783c0b29c1f6a1db638f269b29f775)
- Switched to using our mirrored images for buildi [`dba765c`](https://git.odit.services/lfk/document-server/commit/dba765cb017998ad636f3f91fb00a8a277d3b225)
- 🚀Bumped version to v0.1.1 [`d1b07f3`](https://git.odit.services/lfk/document-server/commit/d1b07f39fd7e3c282a631924bf45367e866e667a)
- Pinned alpine version [`6ab3946`](https://git.odit.services/lfk/document-server/commit/6ab3946c31a7716d1c42fb217b0a0f7be8172dba)
#### v0.1.0
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.0 - Contract generation' (#11) from dev into main [`bc2b6fa`](https://git.odit.services/lfk/document-server/commit/bc2b6fadd912f275bc05be29c6fbd87367d617df)
- 📖New license file version [CI SKIP] [skip ci] [`ee19efa`](https://git.odit.services/lfk/document-server/commit/ee19efa0e63f21a10fed1cf24beb16118bbe6cde)
- 🚀Bumped version to v0.0.2 [`de432c4`](https://git.odit.services/lfk/document-server/commit/de432c448129a8acb36fef6b40ef920eeb2f7887)
- First working (TM) template code [`a9e3360`](https://git.odit.services/lfk/document-server/commit/a9e3360ee258e4d48c8dbe3a55468409bb6ee0f7)
- Working Styleing [`c617c40`](https://git.odit.services/lfk/document-server/commit/c617c40e9d7e03382f647eafde9ff458db3c6c15)
- Removed base64 image [`e401d0e`](https://git.odit.services/lfk/document-server/commit/e401d0ec7219e88fbb277b2dcf456a22dae0d1e5)
- Updated the contract template to use external css [`6121b1e`](https://git.odit.services/lfk/document-server/commit/6121b1e3bfcf6fc9f88e0589205044c59859b4a7)
- Sorted locales [`1962499`](https://git.odit.services/lfk/document-server/commit/1962499d18685347302fd7d8491c6e3e7a355fcb)
- Switched to puppeteer for pdf generation [`5afd26e`](https://git.odit.services/lfk/document-server/commit/5afd26ea22cff3b8a339cf658ed37d2053db24ba)
- Added a coupple of real replacement strings to the sponsoring template [`041c0ed`](https://git.odit.services/lfk/document-server/commit/041c0ed6bbe5f8645e4e96b57c02d4e45b445402)
- Added automatic img to base64 conversion [`42443af`](https://git.odit.services/lfk/document-server/commit/42443af734ccc9ce202aec045a07775f4a054b92)
- Added i18n strings [`e345c36`](https://git.odit.services/lfk/document-server/commit/e345c36dd0b03f276259521aebf423853a81a04d)
- first working pdf generation from class 🎉 [`3af76a5`](https://git.odit.services/lfk/document-server/commit/3af76a53e3156bdc2d1d3ade6ff940db9d7b24b5)
- Added a bunch of english and german translations 🌎 [`784d7c6`](https://git.odit.services/lfk/document-server/commit/784d7c656fd2dfc726722459f3ccb7612021b882)
- Added translations using i18next [`75eb925`](https://git.odit.services/lfk/document-server/commit/75eb9252672883f7b6f89a812a37d2b96f9f626e)
- Switched to handlebars for templateing [`4acf3e3`](https://git.odit.services/lfk/document-server/commit/4acf3e39ce55c0ad9e697cf9598569ec1c1dcb44)
- Moved pdf creatior initialization to new function [`47a05fa`](https://git.odit.services/lfk/document-server/commit/47a05facb33c178e9bf3f99c25049abc010361c4)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f3de80a`](https://git.odit.services/lfk/document-server/commit/f3de80af78c96bd697715a30dee7cae6806f9f9f)
- 🚀Bumped version to v0.1.0 [`6a42fe3`](https://git.odit.services/lfk/document-server/commit/6a42fe37d053a6a00005e3c5781edfcefe61183e)
- Merge pull request 'Sponsoring contract generation feature/5-sponsoring_contracts' (#10) from feature/5-sponsoring_contracts into dev [`84259d3`](https://git.odit.services/lfk/document-server/commit/84259d37d42234e1be75f3a5c95f4b442a9e5844)
- Added optimization args [`140fda1`](https://git.odit.services/lfk/document-server/commit/140fda11cc88cb93218116d4cbdbf13c014a659d)
- Added first parts of template [`13776d1`](https://git.odit.services/lfk/document-server/commit/13776d1ecb2db03f19dd0c01a930d4c98222cf6b)
- Added pdf merging for big requests (over 100 runners) [`785544c`](https://git.odit.services/lfk/document-server/commit/785544ca16cd4907a378eb2d48e4269778e3dccc)
- Fixed file broken in merge [`c07c6ae`](https://git.odit.services/lfk/document-server/commit/c07c6aeeab70589a4e1ddf025a07bde96c68ef6e)
- Now with workin i18n-ally config🥳 [`7c3813b`](https://git.odit.services/lfk/document-server/commit/7c3813b94d06ca38b83db90b7f9fba6c33716a05)
- Now with workin i18n-ally config🥳 [`b4232e5`](https://git.odit.services/lfk/document-server/commit/b4232e51e084f491d1a7fb4f929327e88f3b4c00)
- Now accepting arrays for sponsoring contract generation [`f833ae2`](https://git.odit.services/lfk/document-server/commit/f833ae222e68b7df9b8f8a8ec7ce17d679a9710f)
- Added full interpolation support to the i18n [`f755f4f`](https://git.odit.services/lfk/document-server/commit/f755f4f9fb1463af6bec3cf73b7fabf95ef3fb2e)
- Added option to generate empty sponsoring contracts [`1ced0e3`](https://git.odit.services/lfk/document-server/commit/1ced0e317544217599a42c6b270c9136dc73676d)
- Added translation sorting secript [`1e67672`](https://git.odit.services/lfk/document-server/commit/1e67672ef0d28f94a50b0377cca8e8ff2a87e983)
- Removed the example data from the fill-in fields [`5e12525`](https://git.odit.services/lfk/document-server/commit/5e1252545b7eafeee6c3a1d67567d00e5d615d85)
- Edited html template [`d58453f`](https://git.odit.services/lfk/document-server/commit/d58453faf9840037c583e029c41ef1b31a0bafa8)
- PDF Creator now accepts single instances of class [`78205ee`](https://git.odit.services/lfk/document-server/commit/78205ee8c7659ae0dc2e4a184554b042251d9271)
- PDF Creator now accepts single instances of class [`ba7cedd`](https://git.odit.services/lfk/document-server/commit/ba7cedd187dbc51a53ba169889d8e0ca22a97b5d)
- Updated template for i18n [`a596188`](https://git.odit.services/lfk/document-server/commit/a596188c00444c285565eecbb1f0bc668bb4706c)
- Parellized the chunks [`e92820e`](https://git.odit.services/lfk/document-server/commit/e92820e12f289b4fd28b4ebc985b5b711777fc35)
- Fixed the controller not waiting for initialization [`ee8ba99`](https://git.odit.services/lfk/document-server/commit/ee8ba99cc7778f89a8bb99400c7d1cf1a12898f7)
- Implemented language selection by query param [`6f81566`](https://git.odit.services/lfk/document-server/commit/6f81566cb82a0801a20523a7177996ea40cb3968)
- Added comments [`cd51e78`](https://git.odit.services/lfk/document-server/commit/cd51e78282278cae6cb86bd0c9616746612a97e3)
- Added example locales [`1969769`](https://git.odit.services/lfk/document-server/commit/19697692bcb6c0c1c978918916caccd95a8f2035)
- Fixed data validation problem [`bd6ec62`](https://git.odit.services/lfk/document-server/commit/bd6ec6215d362325c510611e4545b7643b918200)
- Removed fullname from groups (to be renabled later) [`388d8a2`](https://git.odit.services/lfk/document-server/commit/388d8a2dc6ee06d39e621e1e45ae595dae587483)
- Updated comments [`119102a`](https://git.odit.services/lfk/document-server/commit/119102aef8f43a68f537e7542c2f2cd3b41cd28e)
- Updated readme for handlebars [`05e4718`](https://git.odit.services/lfk/document-server/commit/05e471878f2321a1873b21730ae85ad6b8af5766)
- Updated readme [`f69e777`](https://git.odit.services/lfk/document-server/commit/f69e7779e42f18df7ec3ccb1cdf9dcf7fa845ee6)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f4a34dd`](https://git.odit.services/lfk/document-server/commit/f4a34dd36b57bd122a650f2de4ea8e00816276ed)
- Typos [`95b882a`](https://git.odit.services/lfk/document-server/commit/95b882aceded275ad89446ad92a10cf36b166ab7)
- Added sentence about large requests to the /contracts openapi description [`4773a5f`](https://git.odit.services/lfk/document-server/commit/4773a5f18c866b6e9d50b421d7917416860cb6b5)
- Removed puppeteer args [`06dedc0`](https://git.odit.services/lfk/document-server/commit/06dedc0797b649f3fa8934f0d774ccae2b062849)
- Expanded max request body size to 500mb [`4f191dc`](https://git.odit.services/lfk/document-server/commit/4f191dcb52cd727e34770ab4304937cd1e7e480d)
- Now awaiting language change [`c07319b`](https://git.odit.services/lfk/document-server/commit/c07319b250db9452f6122e797b6059151031e2a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`42d6c40`](https://git.odit.services/lfk/document-server/commit/42d6c40d0c673f39c27e3d5a6484f01a4da77266)
- Formatting [`2d0b7ce`](https://git.odit.services/lfk/document-server/commit/2d0b7ce79ed47d4827096a2bbccfe3bbcd061810)
- Removed useless await [`4cd437b`](https://git.odit.services/lfk/document-server/commit/4cd437b6afe40e4c09027c0e2004a1130bc51870)
- Updated comments [`cf9cd29`](https://git.odit.services/lfk/document-server/commit/cf9cd298b638012e079be0a04d1b48efea20026f)
- Merge pull request 'Patch 0.0.2' (#9) from dev into main [`4585a83`](https://git.odit.services/lfk/document-server/commit/4585a83838b80552160c9d9e5be0af891eae39c8)
- Merge pull request 'Basic documentation feature/6-documentation' (#8) from feature/6-documentation into dev [`73915da`](https://git.odit.services/lfk/document-server/commit/73915da20321940e22145b4c5d830b9f700be566)
- 📖New license file version [CI SKIP] [skip ci] [`465efe0`](https://git.odit.services/lfk/document-server/commit/465efe03000ecc00d14479ac38710ffdba2cafb5)
- Typos [`68e34a9`](https://git.odit.services/lfk/document-server/commit/68e34a9054a195545b0bd10ce888f7274854fae6)
- Merge pull request 'Implemented the basics for templateing feature/3-pdf_templateing' (#4) from feature/3-pdf_templateing into dev [`15f1641`](https://git.odit.services/lfk/document-server/commit/15f16415c0ac5012df8126c8df6bd4da93ad0a20)
- Merge pull request 'Implemented the basic request classes feature/1-input_classes' (#2) from feature/1-input_classes into dev [`b5e79e5`](https://git.odit.services/lfk/document-server/commit/b5e79e51ef5d751a67e7a1763809ece91a7627f2)
- Added openapi viewers [`6435c8a`](https://git.odit.services/lfk/document-server/commit/6435c8a88e2ea3f4417ad5d8be9a07b9c043b41b)
- 📖New license file version [CI SKIP] [skip ci] [`d493e74`](https://git.odit.services/lfk/document-server/commit/d493e74bf39bc85de842ac7cd3e3d37ba8797a04)
- Initial commit [`0908bcd`](https://git.odit.services/lfk/document-server/commit/0908bcd63529b44463bc57ad7d6b8785564e4ddc)
- Added address class and errors [`d291cf0`](https://git.odit.services/lfk/document-server/commit/d291cf0d1bf375e96fda822543d5ceb29dc67010)
- Added drone file [`48d7cad`](https://git.odit.services/lfk/document-server/commit/48d7cad9f37485656cfb1c70abef158b5dd8d847)
- Added the donation classes [`1d73e4e`](https://git.odit.services/lfk/document-server/commit/1d73e4ed9ccb3dfb7709cb89957ed5bbcefad870)
- Added openapi related classes [`9d62225`](https://git.odit.services/lfk/document-server/commit/9d6222547811fd3c94b91496d9917b7df5115fc6)
- Added a bs example template [`f726a6e`](https://git.odit.services/lfk/document-server/commit/f726a6e699575b839d332c15e61c9008fe996fa9)
- Added a basic donor class [`cfa65e8`](https://git.odit.services/lfk/document-server/commit/cfa65e83cafcefbd6261a99ab7a4eaf099665a81)
- Added input class for contract generation [`63f9523`](https://git.odit.services/lfk/document-server/commit/63f952376698c3561754bfb206a64c58c1ae86f1)
- Initialized package [`b0427a6`](https://git.odit.services/lfk/document-server/commit/b0427a6d810656096c467881a302eef244f86d29)
- Added a simplified runnergroup class [`e29c17a`](https://git.odit.services/lfk/document-server/commit/e29c17a29a6ee84944f8d67d7b6f3c4292763c10)
- Resolved fun issues with promises [`4617f2c`](https://git.odit.services/lfk/document-server/commit/4617f2c5bdcb29534b46865ebe21d15e2b1cd72f)
- Added a runnercard class [`cb7325b`](https://git.odit.services/lfk/document-server/commit/cb7325bbf906b405955bd81e199abae5edc27d91)
- Added a basic readme [`df94b1b`](https://git.odit.services/lfk/document-server/commit/df94b1b750922989d870546150ff8d9ff8af4102)
- Added base app [`915ff92`](https://git.odit.services/lfk/document-server/commit/915ff92418a2859c11e0ce58b79220fb5ea06c7f)
- Added vscode workspace config [`ae466b4`](https://git.odit.services/lfk/document-server/commit/ae466b4d7e5b67c5cd1bc440214f477d15f768a2)
- Created a pdf class that takes care of the pdf wrapping [`7d5b575`](https://git.odit.services/lfk/document-server/commit/7d5b5750ad78fd979cb1b647d8b318a84513532a)
- Added editor and stageing infos to the README [`56b7227`](https://git.odit.services/lfk/document-server/commit/56b72275aca57b227c775c4a61e91fd03471f987)
- Added dockerfile and docker-compose [`b9d4cc3`](https://git.odit.services/lfk/document-server/commit/b9d4cc36199b8f0090d555e961a3454bf35f4bd6)
- Added loaders [`57afbd4`](https://git.odit.services/lfk/document-server/commit/57afbd4b6c48cf641b69a2fcbb28783ff84e1cfd)
- Added a certificaterunner class [`d08bdfd`](https://git.odit.services/lfk/document-server/commit/d08bdfd961f4128981b969cf149df7397a257193)
- Added a template section to the readme [`8141269`](https://git.odit.services/lfk/document-server/commit/8141269dd99f03b33019e5a8f4a010954c4fc44a)
- Created a barebones pdf controller [`64bd1ff`](https://git.odit.services/lfk/document-server/commit/64bd1ffc3ad8459c13154e2cd9a568f27baa2bf2)
- Moved distance to the main runner object [`1d1fa50`](https://git.odit.services/lfk/document-server/commit/1d1fa50327927328ce77af33c1abbf994df9ac8b)
- Added tsconfig [`e1f0378`](https://git.odit.services/lfk/document-server/commit/e1f03788dbdddcb1cb138556c1fed4da9ca104a8)
- Added basic dependencies [`43bb728`](https://git.odit.services/lfk/document-server/commit/43bb728d0d8b75239f1db765071d28a839300102)
- Added typeing to the buffer and stream conversion [`3fb8be2`](https://git.odit.services/lfk/document-server/commit/3fb8be22b74204accabed8a8c8fb5161c5ad7504)
- Added basic dependencies [`d450cea`](https://git.odit.services/lfk/document-server/commit/d450ceac74959bdfb694f9b12fb1fd14ff85b598)
- Added release-it config [`185e66f`](https://git.odit.services/lfk/document-server/commit/185e66fb5b2e4330233ff2e74101c4447c317b5a)
- Added config class [`278c563`](https://git.odit.services/lfk/document-server/commit/278c56386b0e9079a71d3339b40d08f046255a3e)
- Added Barebones pdf creator class [`557cc26`](https://git.odit.services/lfk/document-server/commit/557cc26f281da0b47621dff667435a788c42c103)
- Added a simple status controller [`1d62e7f`](https://git.odit.services/lfk/document-server/commit/1d62e7f14c8d6219607ed6ecf774ae152e362cc1)
- Added errorhandler middleware [`6539fd7`](https://git.odit.services/lfk/document-server/commit/6539fd785568971330639fb7055827417424c81a)
- Runners now use the runnergroup class instead of strings [`aae4f50`](https://git.odit.services/lfk/document-server/commit/aae4f507eafbfd51cd9972cf0fac4c5afafbb45a)
- Added files to gitignore [`66134c0`](https://git.odit.services/lfk/document-server/commit/66134c0e1e5dce2ebd9eae3f88a6ad893bad0283)
- Switched to the splitted functions [`3ca38ab`](https://git.odit.services/lfk/document-server/commit/3ca38abe9359e436fe0f80400ad0308ad9d64a4f)
- Cleaned up openapi stuff [`4efb629`](https://git.odit.services/lfk/document-server/commit/4efb62921bced79c817499b48bbc55b05e6371e5)
- Updated apidoc viewer settings [`36396af`](https://git.odit.services/lfk/document-server/commit/36396af50a1f7d1842effbd24e08a8d34946a375)
- Updated apidoc viewer settings [`4d45e0f`](https://git.odit.services/lfk/document-server/commit/4d45e0f80d5721c91de0b25334d040448d92e01d)
- 🧾New changelog file version [CI SKIP] [skip ci] [`8f250f7`](https://git.odit.services/lfk/document-server/commit/8f250f747a95feb246b1698a7c9be9ee19a1be12)
- Added missing dependencies [`c2d7141`](https://git.odit.services/lfk/document-server/commit/c2d714116e02bb4c2ff6501ba32417cd998e2f3e)
- Added license export and release scripts [`0c4e5a1`](https://git.odit.services/lfk/document-server/commit/0c4e5a182c91b99a657c83f2c24f4cfaae1ef48d)
- Added build script [`cbc421c`](https://git.odit.services/lfk/document-server/commit/cbc421cd838b6c874fbe50556350edeb08a7b882)
- Added dev script [`814b564`](https://git.odit.services/lfk/document-server/commit/814b564752aa95ed2c034a9a98c800b43452bf88)
- Adjusted template font styleing [`2c7b025`](https://git.odit.services/lfk/document-server/commit/2c7b0254ec7e49c31f8f33eed334ab4156052fb6)
- Added html-pdf package [`a7d4001`](https://git.odit.services/lfk/document-server/commit/a7d4001ad992d60e2af69e9bbed53366bc0a46d3)
- Added PDFs to gitignore [`9f3758d`](https://git.odit.services/lfk/document-server/commit/9f3758de39ef1d5b591a24868eb683caa742f694)
- Added version to config [`b1747f6`](https://git.odit.services/lfk/document-server/commit/b1747f6374c029e1e9c3a87584ea54b9d3714d92)
- fixed license-exporter call [`83c4bd6`](https://git.odit.services/lfk/document-server/commit/83c4bd62cbbb13ae33a790baa45cc15a77d99e41)
- Added version to config [`cff7011`](https://git.odit.services/lfk/document-server/commit/cff70110fde72c7fede0625872acdc0666703fa1)
- Added openapi dependency [`94e5e51`](https://git.odit.services/lfk/document-server/commit/94e5e51f8d421ea7fd64ded2281b89ff4a252b29)
- Added templates folder [`8a30265`](https://git.odit.services/lfk/document-server/commit/8a30265fc600dad17f584f95dd51db976945d4c5)

154
README.md
View File

@ -1,78 +1,78 @@
# @lfk/document-server
The document generation server responsible for creating pdfs for sponsoring contracts, certificates and more.
This server doesn't interact with any database and can therefor be deployed on it's own.
The basic generation mechanism makes the templates and routes interchangeable (if you want to expand or modify it).
## Quickstart 🐳
> Use this to run the document server in docker.
1. Clone the repo or copy the docker-compose
2. Run in the folder that contains the docker-compose file: `docker-compose up -d`
3. Visit http://127.0.0.1:4010/docs to check if the server is running
## Dev Setup 🛠
> Local dev setup
1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed)
2. Install Dependencies
```bash
yarn
```
3. Start the server
```bash
yarn dev
```
## ENV Vars
> You can provide them via .env file or docker env vars.
| Name | Type | Default | Description
| - | - | - | -
| APP_PORT | Number | 4010 | The port the backend server listens on. Is optional.
| NODE_ENV | String | dev | The apps env - influences debug info.
| EVENT_NAME | String | "Please set the event name" | The event's name - used to generate pdf text.
| CURRENCY_SYMBOL | String | "€" | The your currency's symbol - used to generate pdf text.
| SPONSORING_RECEIPT_MINIMUM_AMOUNT | String | "10" | The mimimum total donation amount a sponsor has to donate to be able to receive a donation receipt - used to generate pdf text.
## Templates
> The document server uses html templates to generate various pdf documents.
> The templates are stored in src/templates by default.
We provide a set of default templates that we use for the ["Lauf für Kaya!" charity run](https://lauf-fuer-kaya.de).
We use handlebars for templateing utilizing i18next for translation - the i18n string format in the templates is : `{{__ "string"}}`
You can provide your own templates by replacing the ones we provided before compiling the project or by simply mounting your custom templates into the docker container.
The server currently needs the following templates to work:
* sponsoring_contract.html
### Sponsoring Contracts
| Template Data | Type | Optional | Description
| - | - | - | -
| runners | array(Runner) | ❌ | The runner objects. We generate a contract for each runner on a new DIN-A5 page.
## Recommended Editor
[Visual Studio Code](https://code.visualstudio.com/)
### Recommended Extensions
* will be automatically recommended via ./vscode/extensions.json
* we also provide a config for i18n-ally in the .vscode folder
## Staging
### Branches & Tags
* vX.Y.Z: Release tags created from the main branch
* The version numbers follow the semver standard
* A new release tag automaticly triggers the release ci pipeline
* main: Protected "release" branch
* The latest tag of the docker image get's build from this
* New releases get created as tags from this
* dev: Current dev branch for merging the different feature branches and bugfixes
* The dev tag of the docker image get's build from this
* Only push minor changes to this branch!
* To merge a feature branch into this please create a pull request
* feature/xyz: Feature branches - nameing scheme: `feature/issueid-title`
# @lfk/document-server
The document generation server responsible for creating pdfs for sponsoring contracts, certificates and more.
This server doesn't interact with any database and can therefor be deployed on it's own.
The basic generation mechanism makes the templates and routes interchangeable (if you want to expand or modify it).
## Quickstart 🐳
> Use this to run the document server in docker.
1. Clone the repo or copy the docker-compose
2. Run in the folder that contains the docker-compose file: `docker-compose up -d`
3. Visit http://127.0.0.1:4010/docs to check if the server is running
## Dev Setup 🛠
> Local dev setup
1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed)
2. Install Dependencies
```bash
yarn
```
3. Start the server
```bash
yarn dev
```
## ENV Vars
> You can provide them via .env file or docker env vars.
| Name | Type | Default | Description
| - | - | - | -
| APP_PORT | Number | 4010 | The port the backend server listens on. Is optional.
| NODE_ENV | String | dev | The apps env - influences debug info.
| EVENT_NAME | String | "Please set the event name" | The event's name - used to generate pdf text.
| CURRENCY_SYMBOL | String | "€" | The your currency's symbol - used to generate pdf text.
| SPONSORING_RECEIPT_MINIMUM_AMOUNT | String | "10" | The mimimum total donation amount a sponsor has to donate to be able to receive a donation receipt - used to generate pdf text.
## Templates
> The document server uses html templates to generate various pdf documents.
> The templates are stored in src/templates by default.
We provide a set of default templates that we use for the ["Lauf für Kaya!" charity run](https://lauf-fuer-kaya.de).
We use handlebars for templateing utilizing i18next for translation - the i18n string format in the templates is : `{{__ "string"}}`
You can provide your own templates by replacing the ones we provided before compiling the project or by simply mounting your custom templates into the docker container.
The server currently needs the following templates to work:
* sponsoring_contract.html
### Sponsoring Contracts
| Template Data | Type | Optional | Description
| - | - | - | -
| runners | array(Runner) | ❌ | The runner objects. We generate a contract for each runner on a new DIN-A5 page.
## Recommended Editor
[Visual Studio Code](https://code.visualstudio.com/)
### Recommended Extensions
* will be automatically recommended via ./vscode/extensions.json
* we also provide a config for i18n-ally in the .vscode folder
## Staging
### Branches & Tags
* vX.Y.Z: Release tags created from the main branch
* The version numbers follow the semver standard
* A new release tag automaticly triggers the release ci pipeline
* main: Protected "release" branch
* The latest tag of the docker image get's build from this
* New releases get created as tags from this
* dev: Current dev branch for merging the different feature branches and bugfixes
* The dev tag of the docker image get's build from this
* Only push minor changes to this branch!
* To merge a feature branch into this please create a pull request
* feature/xyz: Feature branches - nameing scheme: `feature/issueid-title`
* bugfix/xyz: Branches for bugfixes - nameing scheme:`bugfix/issueid-title`

View File

@ -1,6 +1,6 @@
{
"name": "@odit/lfk-document-server",
"version": "0.1.2",
"version": "0.1.3",
"description": "The document generation server for the LfK! runner system. This generates certificates, sponsoring aggreements and more",
"main": "src/app.ts",
"scripts": {

View File

@ -1,199 +1,199 @@
import axios from 'axios';
import cheerio from "cheerio";
import fs from "fs";
import Handlebars from 'handlebars';
import i18next from "i18next";
import Backend from 'i18next-fs-backend';
import mime from "mime-types";
import path from 'path';
import { PDFDocument } from 'pdf-lib';
import puppeteer from "puppeteer";
import { config } from './config';
import { Runner } from './models/Runner';
import { RunnerGroup } from './models/RunnerGroup';
/**
* This class is responsible for all things pdf creation.
* This uses the html templates from src/templates.
*/
export class PdfCreator {
private templateDir = path.join(__dirname, '/templates');
private browser;
private static interpolations = { eventname: config.eventname, sponsoring_receipt_minimum_amount: config.sponsoring_receipt_minimum_amount, currency_symbol: config.currency_symbol }
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
constructor() {
this.init();
}
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
public async init() {
const minimal_args = [
'--autoplay-policy=user-gesture-required',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-component-update',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-domain-reliability',
'--disable-extensions',
'--disable-features=AudioServiceOutOfProcess',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
'--disable-notifications',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-popup-blocking',
'--disable-print-preview',
'--disable-prompt-on-repost',
'--disable-renderer-backgrounding',
'--disable-speech-api',
'--disable-sync',
'--hide-scrollbars',
'--ignore-gpu-blacklist',
'--metrics-recording-only',
'--mute-audio',
'--no-default-browser-check',
'--no-first-run',
'--no-pings',
'--no-zygote',
'--password-store=basic',
'--use-gl=swiftshader',
'--no-sandbox'
];
await i18next
.use(Backend)
.init({
fallbackLng: 'en',
lng: 'en',
backend: {
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
}
});
await Handlebars.registerHelper('__',
function (str) {
return i18next.t(str, PdfCreator.interpolations).toString();
}
);
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });
}
/**
* Generate sponsoring contract pdfs.
* @param runner The runner you want to generate the contracts for.
* @param locale The locale used for the contracts (default:en)
*/
public async generateSponsoringContract(runners: Runner[], locale: string = "en"): Promise<Buffer> {
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
runners[0] = this.generateEmptyRunner();
}
if (runners.length > 50) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;
for (i = 0, j = runners.length; i < j; i += 50) {
let chunk = runners.slice(i, i + 50);
pdf_promises.push(this.generateSponsoringContract(chunk, locale));
}
const pdfs = await Promise.all(pdf_promises);
return await this.mergePdfs(pdfs);
}
await i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
const template = Handlebars.compile(template_source);
const result = template({ runners })
const pdf = await this.renderPdf(result, { format: "A5", landscape: true });
return pdf
}
/**
* Converts all images in html to base64.
* Works with image files in the template directory or images from urls.
* @param html The html string whoms images shall get replaced.
*/
public async imgToBase64(html): Promise<string> {
const $ = cheerio.load(html)
$('img').each(async (index, element) => {
let imgsrc = $(element).attr("src");
const img_type = mime.lookup(imgsrc);
if (!(img_type.includes("image"))) {
throw new Error("File is not image mime type");
}
let image;
if (imgsrc.startsWith("http")) {
image = (await axios.get(imgsrc)).data;
image = Buffer.from(image).toString('base64');
}
else {
if (imgsrc.startsWith("./")) {
imgsrc = imgsrc.replace("./", "");
}
image = fs.readFileSync(`${this.templateDir}/${imgsrc}`, { encoding: "base64" });
}
image = `data:${img_type};base64,${image}`
$(element).attr("src", image)
})
return $.html();
}
/**
* This method manages the creation of pdfs via puppeteer.
* @param html The HTML that should get rendered.
* @param options Puppeteer PDF option (eg: {format: "A4"})
*/
public async renderPdf(html: string, options): Promise<any> {
html = await this.imgToBase64(html);
let page = await this.browser.newPage();
await page.setContent(html);
const pdf = await page.pdf(options);
await page.close();
return pdf;
}
/**
* Merges multiple pdfs into one.
* @param pdfs The pdfs you want to merge as an buffer array.
* @returns The merged pdf as a buffer.
*/
private async mergePdfs(pdfs: Buffer[]): Promise<Buffer> {
const mergedPdf = await PDFDocument.create();
for (const pdfBuffer of pdfs) {
const pdf = await PDFDocument.load(pdfBuffer);
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
copiedPages.forEach((page) => {
mergedPdf.addPage(page);
});
}
return <Buffer>(await mergedPdf.save());
}
/**
* Generates a new dummy runner with halfspaces for all strings.
* Can be used to generate empty sponsoring contracts.
* @returns A new runner object that apears to be empty.
*/
private generateEmptyRunner(): Runner {
let group = new RunnerGroup();
group.id = 0;
group.name = "";
let runner = new Runner();
runner.id = 0;
runner.firstname = "";
runner.lastname = "";
runner.group = group;
return runner;
}
import axios from 'axios';
import cheerio from "cheerio";
import fs from "fs";
import Handlebars from 'handlebars';
import i18next from "i18next";
import Backend from 'i18next-fs-backend';
import mime from "mime-types";
import path from 'path';
import { PDFDocument } from 'pdf-lib';
import puppeteer from "puppeteer";
import { config } from './config';
import { Runner } from './models/Runner';
import { RunnerGroup } from './models/RunnerGroup';
/**
* This class is responsible for all things pdf creation.
* This uses the html templates from src/templates.
*/
export class PdfCreator {
private templateDir = path.join(__dirname, '/templates');
private browser;
private static interpolations = { eventname: config.eventname, sponsoring_receipt_minimum_amount: config.sponsoring_receipt_minimum_amount, currency_symbol: config.currency_symbol }
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
constructor() {
this.init();
}
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
public async init() {
const minimal_args = [
'--autoplay-policy=user-gesture-required',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-component-update',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-domain-reliability',
'--disable-extensions',
'--disable-features=AudioServiceOutOfProcess',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
'--disable-notifications',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-popup-blocking',
'--disable-print-preview',
'--disable-prompt-on-repost',
'--disable-renderer-backgrounding',
'--disable-speech-api',
'--disable-sync',
'--hide-scrollbars',
'--ignore-gpu-blacklist',
'--metrics-recording-only',
'--mute-audio',
'--no-default-browser-check',
'--no-first-run',
'--no-pings',
'--no-zygote',
'--password-store=basic',
'--use-gl=swiftshader',
'--no-sandbox'
];
await i18next
.use(Backend)
.init({
fallbackLng: 'en',
lng: 'en',
backend: {
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
}
});
await Handlebars.registerHelper('__',
function (str) {
return i18next.t(str, PdfCreator.interpolations).toString();
}
);
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });
}
/**
* Generate sponsoring contract pdfs.
* @param runner The runner you want to generate the contracts for.
* @param locale The locale used for the contracts (default:en)
*/
public async generateSponsoringContract(runners: Runner[], locale: string = "en"): Promise<Buffer> {
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
runners[0] = this.generateEmptyRunner();
}
if (runners.length > 50) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;
for (i = 0, j = runners.length; i < j; i += 50) {
let chunk = runners.slice(i, i + 50);
pdf_promises.push(this.generateSponsoringContract(chunk, locale));
}
const pdfs = await Promise.all(pdf_promises);
return await this.mergePdfs(pdfs);
}
await i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
const template = Handlebars.compile(template_source);
const result = template({ runners })
const pdf = await this.renderPdf(result, { format: "A5", landscape: true });
return pdf
}
/**
* Converts all images in html to base64.
* Works with image files in the template directory or images from urls.
* @param html The html string whoms images shall get replaced.
*/
public async imgToBase64(html): Promise<string> {
const $ = cheerio.load(html)
$('img').each(async (index, element) => {
let imgsrc = $(element).attr("src");
const img_type = mime.lookup(imgsrc);
if (!(img_type.includes("image"))) {
throw new Error("File is not image mime type");
}
let image;
if (imgsrc.startsWith("http")) {
image = (await axios.get(imgsrc)).data;
image = Buffer.from(image).toString('base64');
}
else {
if (imgsrc.startsWith("./")) {
imgsrc = imgsrc.replace("./", "");
}
image = fs.readFileSync(`${this.templateDir}/${imgsrc}`, { encoding: "base64" });
}
image = `data:${img_type};base64,${image}`
$(element).attr("src", image)
})
return $.html();
}
/**
* This method manages the creation of pdfs via puppeteer.
* @param html The HTML that should get rendered.
* @param options Puppeteer PDF option (eg: {format: "A4"})
*/
public async renderPdf(html: string, options): Promise<any> {
html = await this.imgToBase64(html);
let page = await this.browser.newPage();
await page.setContent(html);
const pdf = await page.pdf(options);
await page.close();
return pdf;
}
/**
* Merges multiple pdfs into one.
* @param pdfs The pdfs you want to merge as an buffer array.
* @returns The merged pdf as a buffer.
*/
private async mergePdfs(pdfs: Buffer[]): Promise<Buffer> {
const mergedPdf = await PDFDocument.create();
for (const pdfBuffer of pdfs) {
const pdf = await PDFDocument.load(pdfBuffer);
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
copiedPages.forEach((page) => {
mergedPdf.addPage(page);
});
}
return <Buffer>(await mergedPdf.save());
}
/**
* Generates a new dummy runner with halfspaces for all strings.
* Can be used to generate empty sponsoring contracts.
* @returns A new runner object that apears to be empty.
*/
private generateEmptyRunner(): Runner {
let group = new RunnerGroup();
group.id = 0;
group.name = "";
let runner = new Runner();
runner.id = 0;
runner.firstname = "";
runner.lastname = "";
runner.group = group;
return runner;
}
}

View File

@ -1,19 +1,19 @@
import { config as configDotenv } from 'dotenv';
configDotenv();
export const config = {
internal_port: parseInt(process.env.APP_PORT) || 4010,
development: process.env.NODE_ENV === "production",
version: process.env.VERSION || require('../package.json').version,
eventname: process.env.EVENT_NAME || "Please set the event name",
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10"
}
let errors = 0
if (typeof config.internal_port !== "number") {
errors++
}
if (typeof config.development !== "boolean") {
errors++
}
import { config as configDotenv } from 'dotenv';
configDotenv();
export const config = {
internal_port: parseInt(process.env.APP_PORT) || 4010,
development: process.env.NODE_ENV === "production",
version: process.env.VERSION || require('../package.json').version,
eventname: process.env.EVENT_NAME || "Please set the event name",
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10"
}
let errors = 0
if (typeof config.internal_port !== "number") {
errors++
}
if (typeof config.development !== "boolean") {
errors++
}
export let e = errors