get-website-package #9

Merged
jem merged 42 commits from get-website-package into main 2026-04-28 10:01:28 +00:00
Owner
  • Added get Website Package Method where a pre build website package can be pulled from a forgejo repo
    • build the website on server you have to set build-website = true (default value: false) in config.edn
  • Added traefik basic auth
    • To use set use-basic-auth = true in config.edn and basic-auth-user and basic-auth-password in auth.edn
- Added get Website Package Method where a pre build website package can be pulled from a forgejo repo - build the website on server you have to set build-website = true (default value: false) in config.edn - Added traefik basic auth - To use set use-basic-auth = true in config.edn and basic-auth-user and basic-auth-password in auth.edn
vop added 38 commits 2026-04-15 13:47:30 +00:00
jem requested changes 2026-04-17 07:01:35 +00:00
Dismissed
@ -2,3 +2,2 @@
mkdir $BUILDDIR
mkdir $SOURCEDIR
# TODO:
Owner

TODO ?

TODO ?
Author
Owner

forgot to remove it

forgot to remove it
vop marked this conversation as resolved
@ -14,3 +19,1 @@
touch $HASHFILEDIR/$hashfilename
currentHash=$( cat $HASHFILEDIR/$hashfilename )
newHash=$( get-hash-data )
touch ${HASHFILEDIR}/${datefilename} $HASHFILEDIR/$hashfilename
Owner

pls use ${}

pls use ${}
Author
Owner

done

done
vop marked this conversation as resolved
@ -20,0 +22,4 @@
currentDate=$( cat ${HASHFILEDIR}/${datefilename} )
newDate=$( get-date )
echo "Local package date: $(date -d "$currentDate"), Remote package date: $(date -d "$newDate")"
if [[ $(date -d "$currentDate" +%s) -ge $(date -d "$newDate" +%s) ]] && [[ -n "$currentDate" ]] then
Owner

what happens if

  1. there is no package in repo?
  2. there is no date stored on a new webserver?
what happens if 1. there is no package in repo? 2. there is no date stored on a new webserver?
Author
Owner
  1. The script will fail when fetching the package file download url

  2. The latest packed will be downloaded

1. The script will fail when fetching the package file download url 2. The latest packed will be downloaded
vop marked this conversation as resolved
@ -24,0 +23,4 @@
::web/redirects
::web/build-website
::web/use-basic-auth
::web/basic-auth-secret]))
Owner

secrets may not be contained in config!

secrets may not be contained in config!
Author
Owner

This is not the secret itself but the secrets name, i used the naming from c4k-common for consistency but it's confusing, maybe we should change it in c4k-common aswell

This is not the secret itself but the secrets name, i used the naming from c4k-common for consistency but it's confusing, maybe we should change it in c4k-common aswell
Author
Owner

addendum: in c4k-common the ingress module checks whether there is a value for the key basic-auth-secret in the config (which, as far as i see, is the name for the secret) and applies basic-auth if there is a value

addendum: in c4k-common the ingress module checks whether there is a value for the key basic-auth-secret in the config (which, as far as i see, is the name for the secret) and applies basic-auth if there is a value
vop marked this conversation as resolved
@ -48,2 +53,3 @@
:average-rate 20
:burst-rate 40}))
:burst-rate 40
:use-basic-auth false}))
Owner

:use-basic-auth maybe redundant - might be calculated soly by presence or absence of auth elements?

What is the build-website default ?

:use-basic-auth maybe redundant - might be calculated soly by presence or absence of auth elements? What is the build-website default ?
Author
Owner

I tried to do this, but i failed at finding a way to set a config key value based on the presence of auth elements (which is needed for the ingress-module to configure for basic-auth )

I tried to do this, but i failed at finding a way to set a config key value based on the presence of auth elements (which is needed for the ingress-module to configure for basic-auth )
vop marked this conversation as resolved
@ -64,6 +79,16 @@
(str/replace % value-to-partly-match value-to-inplace) %)
col))
(defn-spec generate-fogejo-api-package-baseurl string?
Owner

maybe all the build stuff is worth an new namespace ?

maybe all the build stuff is worth an new namespace ?
Author
Owner

i thought we where planning to replace to build stuff by pulling packages and building the website on repo?

i thought we where planning to replace to build stuff by pulling packages and building the website on repo?
vop marked this conversation as resolved
@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: BASIC_AUTH_NAME
Owner

the name should be calculated and not configured (for safety & comfort).

the name should be calculated and not configured (for safety & comfort).
Author
Owner

done

done
vop marked this conversation as resolved
@ -9,3 +9,3 @@
GITREPOURL: REPOURL
GITCOMMITURL: COMMITURL
GITCOMMITURL: COMMITURL
Owner

why we need this ?

why we need this ?
Author
Owner

It is from the old mode, where the website is build on the web server and is used to check whether the current deployed commit hash is different from the commit hash on the repo server as far as i know

It is from the old mode, where the website is build on the web server and is used to check whether the current deployed commit hash is different from the commit hash on the repo server as far as i know
vop marked this conversation as resolved
jem approved these changes 2026-04-28 10:01:20 +00:00
jem merged commit 8331722f01 into main 2026-04-28 10:01:28 +00:00
jem deleted branch get-website-package 2026-04-28 10:01:28 +00:00
jem referenced this pull request from a commit 2026-04-28 10:01:29 +00:00
Sign in to join this conversation.
No reviewers
jem
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
meissa/c4k-website!9
No description provided.