From 26a1419f61dadaba9f6df64fa84c17e4fba7f6d5 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 18 Jan 2024 18:53:42 +0100 Subject: [PATCH] Replace fontawesome-pro with fontawesome-free for public use Signed-off-by: Knut Ahlers --- .dockerignore | 6 ++++++ .npmrc | 2 -- Makefile | 7 ++++--- README.md | 6 +++--- frontend/components/accountsSidebar.vue | 2 +- frontend/style.scss | 8 ++++---- package-lock.json | 9 +++++---- package.json | 2 +- 8 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 .dockerignore delete mode 100644 .npmrc diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a0fa113 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +accounting +node_modules +pkg/frontend/assets/app.* +pkg/frontend/assets/*.ttf +pkg/frontend/assets/*.woff2 +test.db diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 52d5ff0..0000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -@fortawesome:registry=https://npm.fontawesome.com/ -//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} diff --git a/Makefile b/Makefile index 6be1007..8a9f65a 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,10 @@ PORT := 5000 default: build +build: export CGO_ENABLED=0 build: frontend go build \ - -ldflags "-X main.version=$(shell git describe --tags --always || echo dev)" \ + -ldflags "-s -w -X main.version=$(shell git describe --tags --always || echo dev)" \ -mod=readonly \ -trimpath @@ -14,7 +15,7 @@ frontend: node_modules node ci/build.mjs node_modules: - vault2env --key secret/jenkins/fontawesome -- npm ci --include=dev + npm ci --include=dev run: frontend - envrun -- go run . --listen=:$(PORT) + go run . --listen=:$(PORT) diff --git a/README.md b/README.md index 1f940b4..8f664da 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,12 @@ In short: Maybe. Longer version: This software started as a system to do **my** ## How to run it? -For local testing just clone the repo, ensure you got a fairly new `nodejs` (including NPM) and `go` toolchain installed, adjust `node_modules` and `run` targets in the `Makefile` and +For local testing just clone the repo, ensure you got a fairly new `nodejs` (including NPM) and `go` toolchain installed and ```console -# make run FONTAWESOME_NPM_AUTH_TOKEN=your-fa-pro-token +# make run ``` then go to http://localhost:5000/ and try it. -To really host it, `make build` it (you need to find a way to get your FA Pro Token into the build and most likely you will need to edit the `node_modules` target in the `Makefile`), put it on your server and let it run. (It's a binary so probably use systemd to run it and an nginx as proxy in front of it doing auth-stuff…) +To really host it, `make build` it, put it on your server and let it run. (It's a binary so probably use systemd to run it and an nginx as proxy in front of it doing auth-stuff…) diff --git a/frontend/components/accountsSidebar.vue b/frontend/components/accountsSidebar.vue index 43f0dfb..d49c304 100644 --- a/frontend/components/accountsSidebar.vue +++ b/frontend/components/accountsSidebar.vue @@ -43,7 +43,7 @@
  • - Tracking + Tracking {{ formatNumber(trackingSum) }} € diff --git a/frontend/style.scss b/frontend/style.scss index 5b7b470..a136823 100644 --- a/frontend/style.scss +++ b/frontend/style.scss @@ -4,10 +4,10 @@ $web-font-path: ''; @import "../node_modules/bootstrap/dist/css/bootstrap.css"; @import "lato"; -$fa-font-path: "../node_modules/@fortawesome/fontawesome-pro/webfonts"; -@import "../node_modules/@fortawesome/fontawesome-pro/scss/fontawesome.scss"; -@import "../node_modules/@fortawesome/fontawesome-pro/scss/solid.scss"; -@import "../node_modules/@fortawesome/fontawesome-pro/scss/brands.scss"; +$fa-font-path: "../node_modules/@fortawesome/fontawesome-free/webfonts"; +@import "../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss"; +@import "../node_modules/@fortawesome/fontawesome-free/scss/solid.scss"; +@import "../node_modules/@fortawesome/fontawesome-free/scss/brands.scss"; .minimized-column { width: 0.1%; diff --git a/package-lock.json b/package-lock.json index 458161f..6575efc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "accounting", "dependencies": { - "@fortawesome/fontawesome-pro": "^6.4.2", + "@fortawesome/fontawesome-free": "^6.4.2", "bootstrap": "^5.3.2", "vue": "^3.4.14", "vue-router": "^4.2.5" @@ -819,10 +819,11 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fortawesome/fontawesome-pro": { + "node_modules/@fortawesome/fontawesome-free": { "version": "6.5.1", - "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/6.5.1/fontawesome-pro-6.5.1.tgz", - "integrity": "sha512-XLi5HOQ3XLNtM9UhrCyT5jEj0RHkx5GfzKDmUPpVTea4C/Ekj5plOYVAp9dUWgH+NWo3IrVpwhsnhIFh/FZPgA==", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.1.tgz", + "integrity": "sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw==", + "hasInstallScript": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 7544255..d8e5e7b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "name": "accounting", "private": true, "dependencies": { - "@fortawesome/fontawesome-pro": "^6.4.2", + "@fortawesome/fontawesome-free": "^6.4.2", "bootstrap": "^5.3.2", "vue": "^3.4.14", "vue-router": "^4.2.5"