Compare commits
3 Commits
4faf76a073
...
cceca7f5e1
Author | SHA1 | Date | |
---|---|---|---|
cceca7f5e1 | |||
54d294a8b4 | |||
41291b9200 |
1
.env
1
.env
@ -3,6 +3,7 @@ PRODUCION=false
|
|||||||
APIKEY=lfk
|
APIKEY=lfk
|
||||||
EVENTNAME=Lauf für Kaya! 2025
|
EVENTNAME=Lauf für Kaya! 2025
|
||||||
CURRENCYSYMBOL=€
|
CURRENCYSYMBOL=€
|
||||||
|
GOTENBERG_BASEURL=http://localhost:3001
|
||||||
|
|
||||||
CARD_SUBTITLE=Kaya ist cool
|
CARD_SUBTITLE=Kaya ist cool
|
||||||
CARD_BARCODEFORMAT=ean13
|
CARD_BARCODEFORMAT=ean13
|
||||||
|
@ -10,5 +10,6 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o server
|
|||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /app/server /server
|
COPY --from=builder /app/server /server
|
||||||
|
COPY static /static
|
||||||
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/ca-certificates.crt
|
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/ca-certificates.crt
|
||||||
ENTRYPOINT [ "/server" ]
|
ENTRYPOINT [ "/server" ]
|
@ -1,4 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
|
document-server:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
volumes:
|
||||||
|
- ./docker.env:/.env
|
||||||
gotenberg:
|
gotenberg:
|
||||||
image: gotenberg/gotenberg:8
|
image: gotenberg/gotenberg:8
|
||||||
ports:
|
ports:
|
||||||
|
17
docker.env
Normal file
17
docker.env
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
PORT=3000
|
||||||
|
PRODUCION=false
|
||||||
|
APIKEY=lfk
|
||||||
|
EVENTNAME=Lauf für Kaya! 2025
|
||||||
|
CURRENCYSYMBOL=€
|
||||||
|
GOTENBERG_BASEURL=http://gotenberg:3000
|
||||||
|
|
||||||
|
CARD_SUBTITLE=Kaya ist cool
|
||||||
|
CARD_BARCODEFORMAT=ean13
|
||||||
|
# CARD_BARCODEPREFIX=
|
||||||
|
|
||||||
|
SPONSOING_RECEIPTMINIMUM=10
|
||||||
|
SPONSORING_DISCLAIMER=Kaya ist cool, aber pass auf, dass du nicht zu viel Geld sammelst!
|
||||||
|
SPONSORING_BARCODEFORMAT=code128
|
||||||
|
# SPONSORING_BARCODEPREFIX=
|
||||||
|
|
||||||
|
CERTIFICATE_FOOTER=Kaya ist cool, danke für deine Unterstützung!
|
@ -60,7 +60,7 @@ func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
c.Set(fiber.HeaderContentType, "text/html")
|
c.Set(fiber.HeaderContentType, "text/html")
|
||||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||||
pdf, err := converter.ToPdf(result, "a4", false)
|
pdf, err := converter.ToPdf(result, "a4", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
@ -60,7 +60,7 @@ func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
c.Set(fiber.HeaderContentType, "text/html")
|
c.Set(fiber.HeaderContentType, "text/html")
|
||||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||||
pdf, err := converter.ToPdf(result, "a4", false)
|
pdf, err := converter.ToPdf(result, "a4", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
@ -64,7 +64,7 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||||
pdf, err := converter.ToPdf(result, "a5", true)
|
pdf, err := converter.ToPdf(result, "a5", true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
@ -14,4 +14,5 @@ type Config struct {
|
|||||||
SponsoringBarcodeFormat string `mapstructure:"SPONSORING_BARCODEFORMAT"`
|
SponsoringBarcodeFormat string `mapstructure:"SPONSORING_BARCODEFORMAT"`
|
||||||
SponsoringBarcodePrefix string `mapstructure:"SPONSORING_BARCODEPREFIX"`
|
SponsoringBarcodePrefix string `mapstructure:"SPONSORING_BARCODEPREFIX"`
|
||||||
CertificateFooter string `mapstructure:"CERTIFICATE_FOOTER"`
|
CertificateFooter string `mapstructure:"CERTIFICATE_FOOTER"`
|
||||||
|
GotenbergBaseUrl string `mapstructure:"GOTENBERG_BASEURL"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user