mirror of
https://gitplac.si/aljaxus/upn-qr.git
synced 2025-12-18 12:40:58 +00:00
Compare commits
8 Commits
acfa8461e5
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78588bb335 | ||
|
|
201c6be120 | ||
|
|
5b353843ee | ||
|
|
0e8213add7 | ||
|
|
aa243a0513 | ||
|
|
f244b63804 | ||
|
|
548ddc98e7 | ||
|
|
5323504a87 |
@@ -1,9 +1,9 @@
|
|||||||
build-oci:
|
build-oci:
|
||||||
stage: build
|
stage: build
|
||||||
image: registry.gitplac.si/cts/build-oci:1.0.3
|
image: gcr.si/cts/build-oci:1.2.2
|
||||||
script: [ "/build.sh" ]
|
script: [ "/build.sh" ]
|
||||||
variables:
|
variables:
|
||||||
CTS_BUILD_DOCKERFILE: Dockerfile
|
CTS_BUILD_DOCKERFILE: dockerfile
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||||
variables:
|
variables:
|
||||||
|
|||||||
10
Dockerfile
10
Dockerfile
@@ -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" ]
|
|
||||||
@@ -5,16 +5,16 @@ services:
|
|||||||
image: node:14
|
image: node:14
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: Dockerfile
|
dockerfile: dockerfile
|
||||||
command: ["yarn", "run", "dev"]
|
command: ["yarn", "run", "dev"]
|
||||||
environment:
|
environment:
|
||||||
ENV: development
|
ENV: development
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
volumes:
|
volumes:
|
||||||
- ./src:/var/src
|
- ./:/app
|
||||||
- /var/src/node_modules
|
- /app/node_modules
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 80:80
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-sSG", "http://localhost/healthcheck"]
|
test: ["CMD", "curl", "-sSG", "http://localhost/healthcheck"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
12
dockerfile
Normal file
12
dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json yarn.lock /app/
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY public /app/public
|
||||||
|
COPY views /app/views
|
||||||
|
COPY index.js /app/
|
||||||
|
|
||||||
|
CMD [ "yarn", "run", "start" ]
|
||||||
@@ -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('/form', (req, res) => res.render('form', { q: req.query }))
|
||||||
|
|
||||||
app.get('/api/qrcode', async (req, res) => {
|
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 = []
|
const errors = []
|
||||||
|
|
||||||
function check (name, rgxp) {
|
function check (name, rgxp) {
|
||||||
@@ -36,7 +37,7 @@ app.get('/api/qrcode', async (req, res) => {
|
|||||||
check('client_city', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
|
check('client_city', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
|
||||||
check('amount', /^(?=.{11}$)[0]{1,11}[0-9]{0,11}$/)
|
check('amount', /^(?=.{11}$)[0]{1,11}[0-9]{0,11}$/)
|
||||||
check('payment_purpose', /^.{1,42}$/i)
|
check('payment_purpose', /^.{1,42}$/i)
|
||||||
check('iban', /^[A-Z]{2}\d{17}$/)
|
check('iban', /^[A-Z]{2}[A-Z0-9]{17,19}$/)
|
||||||
check('reference', /^[A-Z]{2}[0-9\-]{1,24}$/)
|
check('reference', /^[A-Z]{2}[0-9\-]{1,24}$/)
|
||||||
check('issuer_name', /^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.'\-]{0,31}[A-Z0-9ČŠŽĐ.'])?$/i)
|
check('issuer_name', /^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.'\-]{0,31}[A-Z0-9ČŠŽĐ.'])?$/i)
|
||||||
check('issuer_address', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ\-.]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
|
check('issuer_address', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ\-.]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
|
||||||
@@ -19,7 +19,7 @@ spec:
|
|||||||
- name: upn-qr-registrypull
|
- name: upn-qr-registrypull
|
||||||
containers:
|
containers:
|
||||||
- name: upn-qr-ct
|
- name: upn-qr-ct
|
||||||
image: registry.gitplac.si/aljaxus/upn-qr
|
image: gcr.si/aljaxus/upn-qr
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
- name: POD_NAME
|
- name: POD_NAME
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
@@ -49,10 +49,6 @@ section div {
|
|||||||
The application does not keep any long-term logs.
|
The application does not keep any long-term logs.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</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>
|
<section>
|
||||||
<h1 id="maker"><a href="#maker">🔗</a> Form maker</h1>
|
<h1 id="maker"><a href="#maker">🔗</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>
|
<span>Fill in the fields with reciever's bank information and leave empty the ones that user has to fill out.</span>
|
||||||
@@ -293,11 +289,11 @@ updateQR()
|
|||||||
|
|
||||||
<h5 id="api-qrcode-iban"><a href="#api-qrcode-iban">🔗</a> <code>iban</code></h5>
|
<h5 id="api-qrcode-iban"><a href="#api-qrcode-iban">🔗</a> <code>iban</code></h5>
|
||||||
<div>
|
<div>
|
||||||
<span>Regex: <code>^[A-Z]{2}\d{17}$</code></span>
|
<span>Regex: <code>^[A-Z]{2}[A-Z0-9]{17,19}$</code></span>
|
||||||
<br>
|
<br>
|
||||||
<span>Demo: <a href="https://regex101.com/r/8bXDvh/1">regex101.com/r/8bXDvh/1</a></span>
|
<span>Demo: <a href="https://regex101.com/r/dN0DsH/1">regex101.com/r/dN0DsH/1</a></span>
|
||||||
<br>
|
<br>
|
||||||
<span>Description: Must contain country code (exp. SI56). No spaces allowed. Max length 34 characters</span>
|
<span>Description: Must contain country code (exp. SI56). No spaces allowed. Max length 21 characters</span>
|
||||||
<br>
|
<br>
|
||||||
<span>Example: SI56047500000280672</span>
|
<span>Example: SI56047500000280672</span>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user