Compare commits

...

3 Commits

Author SHA1 Message Date
Aljaž Starc
f244b63804 Merge branch 'patch/rework' into 'master'
restructure stuff, add logging, use node 20

See merge request aljaxus/upn-qr!7
2023-10-23 20:57:00 +00:00
Aljaž Starc
548ddc98e7 Fix build-oci 2023-10-23 22:55:33 +02:00
Aljaž Starc
5323504a87 restructure stuff, add logging, use node 20 2023-10-23 22:54:08 +02:00
12 changed files with 18 additions and 20 deletions

View File

@@ -1,9 +1,9 @@
build-oci:
stage: build
image: registry.gitplac.si/cts/build-oci:1.0.3
image: registry.gitplac.si/cts/build-oci:1.2.2
script: [ "/build.sh" ]
variables:
CTS_BUILD_DOCKERFILE: Dockerfile
CTS_BUILD_DOCKERFILE: dockerfile
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:

View File

@@ -1,10 +0,0 @@
FROM node:14
WORKDIR /var/src
COPY src/package.json src/yarn.lock /var/src/
RUN yarn install
COPY src /var/src
CMD [ "yarn", "run", "start" ]

View File

@@ -5,16 +5,16 @@ services:
image: node:14
build:
context: ./
dockerfile: Dockerfile
dockerfile: dockerfile
command: ["yarn", "run", "dev"]
environment:
ENV: development
NODE_ENV: development
volumes:
- ./src:/var/src
- /var/src/node_modules
- ./:/app
- /app/node_modules
ports:
- 8080:80
- 80:80
healthcheck:
test: ["CMD", "curl", "-sSG", "http://localhost/healthcheck"]
interval: 30s

11
dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM node:20-alpine
WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn install
COPY public/ views/ /app/
COPY index.js /app/
CMD [ "yarn", "run", "start" ]

View File

@@ -19,6 +19,7 @@ app.get('/healthcheck', (req, res) => res.send({ ok: true, pod: process.env.POD_
app.get('/form', (req, res) => res.render('form', { q: req.query }))
app.get('/api/qrcode', async (req, res) => {
console.log(`/api/qrcode "${req.query['client_name']}" "${req.query['client_address']}" "${req.query['client_city']}" "${req.query['amount']}" "${req.query['payment_purpose']}" "${req.query['iban']}" "${req.query['reference']}" "${req.query['issuer_name']}" "${req.query['issuer_address']}" "${req.query['issuer_city']}"`)
const errors = []
function check (name, rgxp) {

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -49,10 +49,6 @@ section div {
The application does not keep any long-term logs.
</p>
</section>
<section>
<h1>Terms of usage</h1>
<p>Because The Bank Association of Slovenia <a href="https://www.gov.si/zbirke/storitve/vkljucitev-v-izdajanje-upn-s-kodo-qr/" target="_blank">prohibits</a> the printing and use of UPN-QR codes on bills by any unauthorized party, you must be <a href="https://www.upn-qr.si/sl/registracija-izdajatelja">authorized</a> in order to use this application to generate a QR code and print it.</p>
</section>
<section>
<h1 id="maker"><a href="#maker">&#128279;</a> Form maker</h1>
<span>Fill in the fields with reciever's bank information and leave empty the ones that user has to fill out.</span>