From e4d1fe31036d2ef4cce9a17a647b12a9e3ffc67c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 1 Jan 2021 20:50:01 +0100 Subject: work on mdb package --- debian/etc/taler-mdb.conf | 43 ++++++++++++ debian/etc/taler-mdb.conf~ | 168 +++++++++++++++++++++++++++++++++++++++++++++ debian/taler-mdb.install | 1 + debian/taler-mdb.postinst | 15 ++++ 4 files changed, 227 insertions(+) create mode 100644 debian/etc/taler-mdb.conf create mode 100644 debian/etc/taler-mdb.conf~ diff --git a/debian/etc/taler-mdb.conf b/debian/etc/taler-mdb.conf new file mode 100644 index 0000000..80d1514 --- /dev/null +++ b/debian/etc/taler-mdb.conf @@ -0,0 +1,43 @@ +# This is a reference configuration. Adjust to your needs! + +[taler] +# Which currency do we use? Must match products at the end! +CURRENCY = KUDOS + +[taler-mdb] +# Where is our backend? +BACKEND-BASE-URL = http://backend.demo.taler.net/ + +# Secret key to talk to *all* instances we use. +BACKEND-AUTHORIZATION = ApiKey Sandbox + +# Message to diplay after purchase is completed, +fulfillment-msg = Enjoy your ${PRODUCT_DESCRIPTION} + +# Name of the UART where the MDB connector is reachable. +UART_DEVICE = /dev/ttyAMA0 + +# Name of the framebuffer to use for the QR code. +FRAMEBUFFER_DEVICE = /dev/fb1 + +# Name of the backlight file for the framebuffer +FRAMEBUFFER_BACKLIGHT = /sys/class/backlight/soc:backlight/brightness + +# ESSID for open WLAN to offer to clients. +ESSID = snack + +#Products +#If sold out is enabled, products with description "empty" will be registered as sold out. + +# Use different "product-" section names for the various products. +[product-sample] +# Text to show to the user +description = sample-text +# How much to charge +price = KUDOS:0.1 +# MDB bus number +number = 31 + +# Optional: use another instance +# instance = http://backend.test.taler.net/instances/foo/ +# NOTE: authorization key of that instance MUST match the one from [taler-mdb]! diff --git a/debian/etc/taler-mdb.conf~ b/debian/etc/taler-mdb.conf~ new file mode 100644 index 0000000..f7add87 --- /dev/null +++ b/debian/etc/taler-mdb.conf~ @@ -0,0 +1,168 @@ +[taler] +currency = TESTKUDOS + +[taler-mdb] +backend-base-url = http://backend.test.taler.net/ +backend-authorization = ApiKey Sandbox +# Message to diplay after purchase is completed, +fulfillment-msg = Enjoy your ${PRODUCT_DESCRIPTION} + +# Name of the UART where the MDB connector is reachable. +UART_DEVICE = /dev/ttyAMA0 + +# Name of the framebuffer to use for the QR code. +FRAMEBUFFER_DEVICE = /dev/fb1 +# Name of the backlight file for the framebuffer +FRAMEBUFFER_BACKLIGHT = /sys/class/backlight/soc:backlight/brightness + +ESSID = snack + +#Products +#If sold out is enabled, products with description "empty" will be registered as sold out. + +#machine number 55 +[product-21] +description = empty +price = EUR:0.0 +number = 46 +# instance = http://backend.test.taler.net/instances/foo/ +# NOTE: authorization key MUST match the one from [taler-mdb]! + +#machine number 54 +[product-20] +description = empty +price = EUR:0.0 +number = 45 + +#machine number 53 +[product-19] +description = Hackerspace Passport +price = EUR:1.0 +number = 44 + +#machine number 52 +[product-18] +description = T-Shirt M +price = EUR:5.0 +number = 43 + +#machine number 51 +[product-17] +description = T-Shirt S +price = EUR:5.0 +number = 42 + +#machine number 50 +[product-16] +description = Electronic Kit +price = EUR:10.0 +number = 41 + +#machine number 45 +[product-15] +description = Snickers +price = EUR:0.3 +number = 36 + +#machine number 44 +[product-14] +description = Electronic Kit +price = EUR:7.0 +number = 35 + +#machine number 43 +[product-13] +description = empty +price = EUR:0.0 +key = d +number = 34 + +#machine number 42 +[product-12] +description = Screwdriver +price = EUR:15.0 +key = h +number = 33 + +#machine number 41 +[product-11] +description = Twix +price = EUR:0.3 +key = j +number = 32 + +#machine number 40 +[product-10] +description = Mars +price = EUR:0.3 +key = k +number = 31 + +#machine number 34 +[product-9] +description = Book GRM - Brainfuck +price = EUR:25.0 +key = l +number = 25 + +#machine number 30 +[product-8] +description = Ruler +price = EUR:10.0 +key = w +number = 21 + +#machine number 25 +[product-7] +description = NFC TAG +price = EUR:1.0 +key = e +number = 16 + +#machine number 24 +[product-6] +description = Knive +price = EUR:25.0 +key = r +number = 15 + +#machine number 23 +[product-5] +description = Electronic Kit +price = EUR:5.0 +key = t +number = 14 + +#machine number 22 +[product-4] +description = empty +price = EUR:0.0 +key = z +number = 13 + +#machine number 21 +[product-3] +description = empty +price = EUR:0.0 +key = u +number = 12 + +#machine number 20 +[product-2] +description = Gummy bears +price = EUR:0.3 +key = i +number = 11 + +#machine number 14 +[product-1] +description = Sword +price = EUR:0.05 +number = 5 + +#machine number 10 +[product-0] +description = Umbrella +price = EUR:10.0 +key = p +number = 1 diff --git a/debian/taler-mdb.install b/debian/taler-mdb.install index 4a24865..bb53ad9 100644 --- a/debian/taler-mdb.install +++ b/debian/taler-mdb.install @@ -1,2 +1,3 @@ usr/bin/ usr/lib/*/taler/*.so +debian/etc/* etc/ diff --git a/debian/taler-mdb.postinst b/debian/taler-mdb.postinst index c11f836..c08fb2f 100644 --- a/debian/taler-mdb.postinst +++ b/debian/taler-mdb.postinst @@ -13,6 +13,21 @@ case "${1}" in db_stop +cat > "/etc/systemd/system/taler-mdb.service" <