From eaf06724e47bd3692a3f02a49f2719a4efd9822f Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 08:28:14 +0200 Subject: [PATCH 01/15] added option to override image-version tag --- src/main/cljc/dda/c4k_forgejo/core.cljc | 1 + src/main/cljc/dda/c4k_forgejo/forgejo.cljc | 23 +++++++---- .../cljc/dda/c4k_forgejo/forgejo_test.cljc | 39 +++++++++++++++++-- 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/main/cljc/dda/c4k_forgejo/core.cljc b/src/main/cljc/dda/c4k_forgejo/core.cljc index ef5c407..e190e35 100644 --- a/src/main/cljc/dda/c4k_forgejo/core.cljc +++ b/src/main/cljc/dda/c4k_forgejo/core.cljc @@ -20,6 +20,7 @@ ::forgejo/deploy-federated ::forgejo/default-app-name ::forgejo/service-domain-whitelist + ::forgejo/forgejo-image-version-overwrite ::backup/restic-repository ::mon/mon-cfg])) diff --git a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc index 7d2a5fb..b9de1f8 100644 --- a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc +++ b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc @@ -38,6 +38,7 @@ (s/def ::mailer-port pred/bash-env-string?) (s/def ::service-domain-whitelist domain-list?) (s/def ::service-noreply-address string?) +(s/def ::forgejo-image-version-overwrite string?) (s/def ::mailer-user pred/bash-env-string?) (s/def ::mailer-pw pred/bash-env-string?) (s/def ::issuer pred/letsencrypt-issuer?) @@ -53,7 +54,8 @@ :opt-un [::issuer ::deploy-federated ::default-app-name - ::service-domain-whitelist])) + ::service-domain-whitelist + ::forgejo-image-version-overwrite])) (def rate-limit-config? (s/keys :req-un [::max-rate ::max-concurrent-requests])) @@ -66,8 +68,18 @@ [total] total) -(def federated-image-name "domaindrivenarchitecture/c4k-forgejo-federated:latest") -(def non-federated-image-name "codeberg.org/forgejo/forgejo:1.19") +(def federated-image-name "domaindrivenarchitecture/c4k-forgejo-federated") +(def federated-image-version "latest") +(def non-federated-image-name "codeberg.org/forgejo/forgejo") +(def non-federated-image-version "1.19") + +(defn-spec generate-image-str string? + [config config?] + (let [{:keys [deploy-federated forgejo-image-version-overwrite]} config + deploy-federated-bool (boolean-from-string deploy-federated)] + (if deploy-federated-bool + (str federated-image-name ":" (or forgejo-image-version-overwrite federated-image-version)) + (str non-federated-image-name ":" (or forgejo-image-version-overwrite non-federated-image-version))))) #?(:cljs (defmethod yaml/load-resource :forgejo [resource-name] @@ -158,10 +170,7 @@ deploy-federated-bool (boolean-from-string deploy-federated)] (-> (yaml/load-as-edn "forgejo/deployment.yaml") - (cm/replace-all-matching-values-by-new-value "IMAGE_NAME" - (if deploy-federated-bool - federated-image-name - non-federated-image-name))))) + (cm/replace-all-matching-values-by-new-value "IMAGE_NAME" (generate-image-str config))))) (defn generate-service [] diff --git a/src/test/cljc/dda/c4k_forgejo/forgejo_test.cljc b/src/test/cljc/dda/c4k_forgejo/forgejo_test.cljc index 54a6070..663793c 100644 --- a/src/test/cljc/dda/c4k_forgejo/forgejo_test.cljc +++ b/src/test/cljc/dda/c4k_forgejo/forgejo_test.cljc @@ -12,6 +12,40 @@ (st/instrument `cut/generate-ingress) (st/instrument `cut/generate-secrets) +(deftest should-generate-image-str + (testing "non-federated-image" + (is (= "codeberg.org/forgejo/forgejo:1.19" + (cut/generate-image-str {:fqdn "test.de" + :mailer-from "" + :mailer-host "m.t.de" + :mailer-port "123" + :service-noreply-address "" + :deploy-federated "false"}))) + (is (= "codeberg.org/forgejo/forgejo:1.19.3-0" + (cut/generate-image-str {:fqdn "test.de" + :mailer-from "" + :mailer-host "m.t.de" + :mailer-port "123" + :service-noreply-address "" + :deploy-federated "false" + :forgejo-image-version-overwrite "1.19.3-0"})))) + (testing "federated-image" + (is (= "domaindrivenarchitecture/c4k-forgejo-federated:latest" + (cut/generate-image-str {:fqdn "test.de" + :mailer-from "" + :mailer-host "m.t.de" + :mailer-port "123" + :service-noreply-address "" + :deploy-federated "true"}))) + (is (= "domaindrivenarchitecture/c4k-forgejo-federated:3.2.0" + (cut/generate-image-str {:fqdn "test.de" + :mailer-from "" + :mailer-host "m.t.de" + :mailer-port "123" + :service-noreply-address "" + :deploy-federated "true" + :forgejo-image-version-overwrite "3.2.0"}))))) + (deftest should-generate-appini-env (is (= {:APP_NAME-c1 "", :APP_NAME-c2 "test forgejo", @@ -35,13 +69,12 @@ :FORGEJO__service__NO_REPLY_ADDRESS-c2 "noreply@test.com"} (th/map-diff (cut/generate-appini-env {:default-app-name "" :deploy-federated "false" - :fqdn "test.de" + :fqdn "test.de" :mailer-from "" :mailer-host "m.t.de" :mailer-port "123" :service-domain-whitelist "adb.de" - :service-noreply-address "" - }) + :service-noreply-address ""}) (cut/generate-appini-env {:default-app-name "test forgejo" :deploy-federated "true" :fqdn "test.com" From 49ae63536cd69f8472f288fe530353e23a6d5882 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 10:35:15 +0200 Subject: [PATCH 02/15] Began playbook for forgejo version upgrade --- doc/Playbook_UpgradeFrom1.19To7.0.5.md | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/Playbook_UpgradeFrom1.19To7.0.5.md diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Playbook_UpgradeFrom1.19To7.0.5.md new file mode 100644 index 0000000..089bd2c --- /dev/null +++ b/doc/Playbook_UpgradeFrom1.19To7.0.5.md @@ -0,0 +1,46 @@ +# Playbook Upgrade from 1.19 to 7.0.5 + +## Info: Relevant Breaking Changes: + +* 1.19.3:Current version +* 1.20.1-0: Breaking https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#1-20-1-0 +* 1.21.1-0: https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#1-21-1-0 +* 7.0.0: https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#7-0-0 + +## Preparations + +1. Stop Forgejo Prod: TODO +1. Disable Backup Cron: TODO +1. Scale up Backup-Restore Deployment: TODO +1. Execute Manual Backup: TODO + +### Create 2nd Repo Prod Server + +1. Terraform Preparations for 2nd Server: TODO +1. Install c4k-forgejo Version TODO + with config `"forgejo-image-version-overwrite": "1.19.3-0"` +1. Stop Forgejo Deployment: TODO +1. Scale up Backup-Restore Deployment: TODO +1. Restore Forgejo Backup: See [BackupAndRestore.md](BackupAndRestore.md) +1. Check for `..._INSTALL_LOCK: true` in ConfigMap `forgejo-env` +1. Scale up Forgejo Deployment and check for (startup) problems: TODO + +## Upgrade to 1.20.1-0 + +1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` +1. Adjust configmap: `k edit cm forgejo-env` + 1. Change `FORGEJO__mailer__MAILER_TYPE: smtp+startls` TO `FORGEJO__mailer__PROTOCOL: smtp+starttls` (Missed deprecation from 1.19) +1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` +1. Set version to `1.20.1-0` with `k edit deployment forgejo` +1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` +1. Check for errors + +## Upgrade to 1.21... + +TODO: +2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 +2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[service]` `EMAIL_DOMAIN_WHITELIST` present. Use `[service]` `EMAIL_DOMAIN_ALLOWLIST` instead. This fallback will be/has been removed in 1.21 + +## Post Work + +1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! \ No newline at end of file From 1a82d62bd9291f35b263a58c765789721bc80d38 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 11:53:38 +0200 Subject: [PATCH 03/15] Added forgejo version upgrade to 1.21 in playbook --- doc/Playbook_UpgradeFrom1.19To7.0.5.md | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Playbook_UpgradeFrom1.19To7.0.5.md index 089bd2c..017dddb 100644 --- a/doc/Playbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Playbook_UpgradeFrom1.19To7.0.5.md @@ -29,18 +29,38 @@ 1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` 1. Adjust configmap: `k edit cm forgejo-env` + 1. Remove `FORGEJO__database__CHARSET: utf8` (This was a misconfiguration, since this option only had effect for mysql dbs) 1. Change `FORGEJO__mailer__MAILER_TYPE: smtp+startls` TO `FORGEJO__mailer__PROTOCOL: smtp+starttls` (Missed deprecation from 1.19) + 1. Change `FORGEJO__service__EMAIL_DOMAIN_WHITELIST: repo.test.meissa.de` TO `FORGEJO__service__EMAIL_DOMAIN_ALLOWLIST: repo.test.meissa.de` (Fallback deprecation in 1.21) 1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` 1. Set version to `1.20.1-0` with `k edit deployment forgejo` 1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` 1. Check for errors -## Upgrade to 1.21... +## Upgrade to 1.21.1-0 -TODO: -2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 -2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[service]` `EMAIL_DOMAIN_WHITELIST` present. Use `[service]` `EMAIL_DOMAIN_ALLOWLIST` instead. This fallback will be/has been removed in 1.21 +1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` +1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` +1. Set version to `1.21.1-0` with `k edit deployment forgejo` +1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` +1. Check for errors +1. After upgrading, login as an admin, go to the `/admin` page and click run `Sync missed branches from git data to databases` (`Fehlende Branches aus den Git-Daten in die Datenbank synchronisieren`). If this is not done there will be messages such as `LoadBranches: branch does not exist in the logs`. + +## Upgrade to 7.0.0 + +TODO ## Post Work -1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! \ No newline at end of file +1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! +2. Users should check their ssh keys: if they use rsa keys the minimum length should be 3072 bits! However, shorter keys should still work. + +# Known Errors + +## Error in v1.20.1-0 + +In the logs the following error can be found. This will be resolved automatically with the next upgrade (v1.21). + +``` +2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 +``` \ No newline at end of file From 636ad0715177bb9635d1e9ef6e0e831e01675ebf Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 12:33:37 +0200 Subject: [PATCH 04/15] Added forgejo version upgrade to 7.0.0 in playbook --- doc/Playbook_UpgradeFrom1.19To7.0.5.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Playbook_UpgradeFrom1.19To7.0.5.md index 017dddb..62f6ba3 100644 --- a/doc/Playbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Playbook_UpgradeFrom1.19To7.0.5.md @@ -20,6 +20,7 @@ 1. Install c4k-forgejo Version TODO with config `"forgejo-image-version-overwrite": "1.19.3-0"` 1. Stop Forgejo Deployment: TODO +1. Disable Backup Cron: TODO 1. Scale up Backup-Restore Deployment: TODO 1. Restore Forgejo Backup: See [BackupAndRestore.md](BackupAndRestore.md) 1. Check for `..._INSTALL_LOCK: true` in ConfigMap `forgejo-env` @@ -48,12 +49,21 @@ ## Upgrade to 7.0.0 -TODO +1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` +1. Adjust configmap: `k edit cm forgejo-env` + 1. Change `FORGEJO__oauth2__ENABLE: "true"` TO `FORGEJO__oauth2__ENABLED: "true"` +1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` +1. Set version to `7.0.0` with `k edit deployment forgejo` +1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` +1. Check for errors ## Post Work +1. Switch DNS to new server +1. Reenable Backup Cron: TODO +1. Execute manual Backup: TODO 1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! -2. Users should check their ssh keys: if they use rsa keys the minimum length should be 3072 bits! However, shorter keys should still work. +1. Users should check their ssh keys: if they use rsa keys the minimum length should be 3072 bits! However, shorter keys should still work. # Known Errors @@ -63,4 +73,4 @@ In the logs the following error can be found. This will be resolved automaticall ``` 2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 -``` \ No newline at end of file +``` From 8db0044895a82bba126a9cf48d7479dcbded33fa Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 12:49:43 +0200 Subject: [PATCH 05/15] Added forgejo version upgrade to 7.0.5 in playbook --- doc/Playbook_UpgradeFrom1.19To7.0.5.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Playbook_UpgradeFrom1.19To7.0.5.md index 62f6ba3..290e7e6 100644 --- a/doc/Playbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Playbook_UpgradeFrom1.19To7.0.5.md @@ -57,6 +57,14 @@ 1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` 1. Check for errors +## Upgrade to 7.0.5 (no breaking changes) + +1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` +1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` +1. Set version to `7.0.5` with `k edit deployment forgejo` +1. Scale up Forgejo Deployment: `k scale deployment forgejo --replicas=1` +1. Check for errors + ## Post Work 1. Switch DNS to new server @@ -74,3 +82,7 @@ In the logs the following error can be found. This will be resolved automaticall ``` 2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 ``` + +# TODO: Upgrade from 7.0.5 to 7.0.5-federated + +TODO \ No newline at end of file From c94837a5bfed44934121d6738cd48a0464a8e286 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 12:59:02 +0200 Subject: [PATCH 06/15] Added missing commands into playbook --- doc/Playbook_UpgradeFrom1.19To7.0.5.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Playbook_UpgradeFrom1.19To7.0.5.md index 290e7e6..cc29c85 100644 --- a/doc/Playbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Playbook_UpgradeFrom1.19To7.0.5.md @@ -9,22 +9,22 @@ ## Preparations -1. Stop Forgejo Prod: TODO -1. Disable Backup Cron: TODO -1. Scale up Backup-Restore Deployment: TODO -1. Execute Manual Backup: TODO +1. Stop Forgejo Prod: `k scale deployment forgejo --replicas=0` +1. Disable Backup Cron: `k patch cronjobs forgejo-backup -p '{"spec" : {"suspend" : true }}'` +1. Scale up Backup-Restore Deployment: `kubectl scale deployment backup-restore --replicas=1` +1. Execute Manual Backup: `kubectl exec -it backup-restore-... -- /usr/local/bin/backup.sh` ### Create 2nd Repo Prod Server 1. Terraform Preparations for 2nd Server: TODO 1. Install c4k-forgejo Version TODO with config `"forgejo-image-version-overwrite": "1.19.3-0"` -1. Stop Forgejo Deployment: TODO -1. Disable Backup Cron: TODO -1. Scale up Backup-Restore Deployment: TODO +1. Stop Forgejo Deployment: `k scale deployment forgejo --replicas=0` +1. Disable Backup Cron: `k patch cronjobs forgejo-backup -p '{"spec" : {"suspend" : true }}'` +1. Scale up Backup-Restore Deployment: `kubectl scale deployment backup-restore --replicas=1` 1. Restore Forgejo Backup: See [BackupAndRestore.md](BackupAndRestore.md) 1. Check for `..._INSTALL_LOCK: true` in ConfigMap `forgejo-env` -1. Scale up Forgejo Deployment and check for (startup) problems: TODO +1. Scale up Forgejo Deployment and check for (startup) problems: `k scale deployment forgejo --replicas=1` ## Upgrade to 1.20.1-0 @@ -68,8 +68,9 @@ ## Post Work 1. Switch DNS to new server -1. Reenable Backup Cron: TODO -1. Execute manual Backup: TODO +1. Reenable Backup Cron on new server: `k patch cronjobs forgejo-backup -p '{"spec" : {"suspend" : false }}'` +1. Execute manual Backup on new server: `kubectl exec -it backup-restore-... -- /usr/local/bin/backup.sh` +1. Scale down Backup-Restore Deployment: `kubectl scale deployment backup-restore --replicas=1` 1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! 1. Users should check their ssh keys: if they use rsa keys the minimum length should be 3072 bits! However, shorter keys should still work. From d981dfc15f214c0c835997495b590ef690ccdb28 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 13:36:46 +0200 Subject: [PATCH 07/15] update dependencies --- project.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/project.clj b/project.clj index 8c17fec..3f8fd7f 100644 --- a/project.clj +++ b/project.clj @@ -3,9 +3,9 @@ :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" :url "https://www.apache.org/licenses/LICENSE-2.0.html"} - :dependencies [[org.clojure/clojure "1.11.2" :scope "provided"] - [org.clojure/tools.reader "1.4.1"] - [org.domaindrivenarchitecture/c4k-common-clj "6.2.3"] + :dependencies [[org.clojure/clojure "1.11.3" :scope "provided"] + [org.clojure/tools.reader "1.4.2"] + [org.domaindrivenarchitecture/c4k-common-clj "6.4.1"] [hickory "0.7.1" :exclusions [viebel/codox-klipse-theme]]] :target-path "target/%s/" :source-paths ["src/main/cljc" @@ -23,9 +23,9 @@ :main dda.c4k-forgejo.uberjar :uberjar-name "c4k-forgejo-standalone.jar" :dependencies [[org.clojure/tools.cli "1.1.230"] - [ch.qos.logback/logback-classic "1.5.3" + [ch.qos.logback/logback-classic "1.5.6" :exclusions [com.sun.mail/javax.mail]] - [org.slf4j/jcl-over-slf4j "2.0.12"] + [org.slf4j/jcl-over-slf4j "2.0.13"] [com.github.clj-easy/graal-build-time "1.0.5"]]}} :release-tasks [["test"] ["vcs" "assert-committed"] From e40861f46ffdb7a6f2637f033c16724d0b8ff3af Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 13:41:49 +0200 Subject: [PATCH 08/15] dependency fix --- src/main/cljc/dda/c4k_forgejo/backup.cljc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/cljc/dda/c4k_forgejo/backup.cljc b/src/main/cljc/dda/c4k_forgejo/backup.cljc index 00426e4..19e22be 100644 --- a/src/main/cljc/dda/c4k_forgejo/backup.cljc +++ b/src/main/cljc/dda/c4k_forgejo/backup.cljc @@ -4,12 +4,13 @@ [dda.c4k-common.yaml :as yaml] [dda.c4k-common.base64 :as b64] [dda.c4k-common.common :as cm] + [dda.c4k-common.predicate :as p] #?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]]))) -(s/def ::aws-access-key-id cm/bash-env-string?) -(s/def ::aws-secret-access-key cm/bash-env-string?) -(s/def ::restic-password cm/bash-env-string?) -(s/def ::restic-repository cm/bash-env-string?) +(s/def ::aws-access-key-id p/bash-env-string?) +(s/def ::aws-secret-access-key p/bash-env-string?) +(s/def ::restic-password p/bash-env-string?) +(s/def ::restic-repository p/bash-env-string?) #?(:cljs (defmethod yaml/load-resource :backup [resource-name] From f43c3fd7a7595235a32abaaf232129c1174134f4 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 13:55:59 +0200 Subject: [PATCH 09/15] release: 3.3.0 --- infrastructure/backup/build.py | 2 +- infrastructure/federated/build.py | 2 +- package.json | 2 +- project.clj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infrastructure/backup/build.py b/infrastructure/backup/build.py index e349315..9d094fe 100644 --- a/infrastructure/backup/build.py +++ b/infrastructure/backup/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "c4k-forgejo" MODULE = "backup" PROJECT_ROOT_PATH = "../.." -version = "3.2.3-dev" +version = "3.3.0" @init diff --git a/infrastructure/federated/build.py b/infrastructure/federated/build.py index 84356b6..a57a125 100644 --- a/infrastructure/federated/build.py +++ b/infrastructure/federated/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = 'c4k-forgejo' MODULE = 'federated' PROJECT_ROOT_PATH = '../..' -version = "3.2.3-dev" +version = "3.3.0" @init def initialize(project): diff --git a/package.json b/package.json index 8a22eef..b0b65c1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-forgejo", "description": "Generate c4k yaml for a forgejo deployment.", "author": "meissa GmbH", - "version": "3.2.3-SNAPSHOT", + "version": "3.3.0", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-forgejo#readme", "repository": "https://www.npmjs.com/package/c4k-forgejo", "license": "APACHE2", diff --git a/project.clj b/project.clj index 3f8fd7f..20ae4d7 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-forgejo "3.2.3-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.0" :description "forgejo c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From 3be34862020c295201c666820cff4e79815a0461 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 8 Jul 2024 13:55:59 +0200 Subject: [PATCH 10/15] bump version to: 3.3.1-SNAPSHOT --- infrastructure/backup/build.py | 2 +- infrastructure/federated/build.py | 2 +- package.json | 2 +- project.clj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infrastructure/backup/build.py b/infrastructure/backup/build.py index 9d094fe..b702e1d 100644 --- a/infrastructure/backup/build.py +++ b/infrastructure/backup/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "c4k-forgejo" MODULE = "backup" PROJECT_ROOT_PATH = "../.." -version = "3.3.0" +version = "3.3.1-dev" @init diff --git a/infrastructure/federated/build.py b/infrastructure/federated/build.py index a57a125..3632a3d 100644 --- a/infrastructure/federated/build.py +++ b/infrastructure/federated/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = 'c4k-forgejo' MODULE = 'federated' PROJECT_ROOT_PATH = '../..' -version = "3.3.0" +version = "3.3.1-dev" @init def initialize(project): diff --git a/package.json b/package.json index b0b65c1..bbfcef7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-forgejo", "description": "Generate c4k yaml for a forgejo deployment.", "author": "meissa GmbH", - "version": "3.3.0", + "version": "3.3.1-SNAPSHOT", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-forgejo#readme", "repository": "https://www.npmjs.com/package/c4k-forgejo", "license": "APACHE2", diff --git a/project.clj b/project.clj index 20ae4d7..eac576d 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.0" +(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.1-SNAPSHOT" :description "forgejo c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From 545410767f32888e7e4d9db8b17c26671db73b50 Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 9 Jul 2024 09:05:57 +0200 Subject: [PATCH 11/15] Added runbook todo and disabled forgejo-federated-image-publish --- .gitlab-ci.yml | 13 +++++++------ ...To7.0.5.md => Runbook_UpgradeFrom1.19To7.0.5.md} | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) rename doc/{Playbook_UpgradeFrom1.19To7.0.5.md => Runbook_UpgradeFrom1.19To7.0.5.md} (98%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79ff9ac..a52445c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -123,9 +123,10 @@ forgejo-backup-image-publish: script: - cd infrastructure/backup && pyb image publish -forgejo-federated-image-publish: - <<: *img - <<: *tag_only - stage: image - script: - - cd infrastructure/federated && pyb image publish \ No newline at end of file +# This is currently not needed +#forgejo-federated-image-publish: +# <<: *img +# <<: *tag_only +# stage: image +# script: +# - cd infrastructure/federated && pyb image publish \ No newline at end of file diff --git a/doc/Playbook_UpgradeFrom1.19To7.0.5.md b/doc/Runbook_UpgradeFrom1.19To7.0.5.md similarity index 98% rename from doc/Playbook_UpgradeFrom1.19To7.0.5.md rename to doc/Runbook_UpgradeFrom1.19To7.0.5.md index cc29c85..914f919 100644 --- a/doc/Playbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Runbook_UpgradeFrom1.19To7.0.5.md @@ -59,6 +59,8 @@ ## Upgrade to 7.0.5 (no breaking changes) +TODO: Upgrade to 8.0.0 instead after Release! + 1. Scale down Forgejo Deployment: `k scale deployment forgejo --replicas=0` 1. Delete app.ini: `k exec -it backup-restore-... -- rm /var/backups/gitea/conf/app.ini` 1. Set version to `7.0.5` with `k edit deployment forgejo` @@ -74,9 +76,9 @@ 1. The scope of all access tokens might (invisibly) have changed (in v1.20). Thus, rotate all tokens! 1. Users should check their ssh keys: if they use rsa keys the minimum length should be 3072 bits! However, shorter keys should still work. -# Known Errors +## Known Errors -## Error in v1.20.1-0 +### Error in v1.20.1-0 In the logs the following error can be found. This will be resolved automatically with the next upgrade (v1.21). From 0eafb03ebda2192b8df3ea45c31e506331188229 Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 9 Jul 2024 09:08:02 +0200 Subject: [PATCH 12/15] [Skip-CI] remove deprecated todo --- doc/Runbook_UpgradeFrom1.19To7.0.5.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/Runbook_UpgradeFrom1.19To7.0.5.md b/doc/Runbook_UpgradeFrom1.19To7.0.5.md index 914f919..19ca6c2 100644 --- a/doc/Runbook_UpgradeFrom1.19To7.0.5.md +++ b/doc/Runbook_UpgradeFrom1.19To7.0.5.md @@ -85,7 +85,3 @@ In the logs the following error can be found. This will be resolved automaticall ``` 2024/07/08 08:31:30 ...g/config_provider.go:321:deprecatedSetting() [E] Deprecated fallback `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 ``` - -# TODO: Upgrade from 7.0.5 to 7.0.5-federated - -TODO \ No newline at end of file From 51c1d0e7577b9ddb5c52157773b3ffd8f6618241 Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 9 Jul 2024 09:15:58 +0200 Subject: [PATCH 13/15] release: 3.3.1 --- infrastructure/backup/build.py | 2 +- infrastructure/federated/build.py | 2 +- package.json | 2 +- project.clj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infrastructure/backup/build.py b/infrastructure/backup/build.py index b702e1d..263bcf4 100644 --- a/infrastructure/backup/build.py +++ b/infrastructure/backup/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "c4k-forgejo" MODULE = "backup" PROJECT_ROOT_PATH = "../.." -version = "3.3.1-dev" +version = "3.3.1" @init diff --git a/infrastructure/federated/build.py b/infrastructure/federated/build.py index 3632a3d..a1d0df3 100644 --- a/infrastructure/federated/build.py +++ b/infrastructure/federated/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = 'c4k-forgejo' MODULE = 'federated' PROJECT_ROOT_PATH = '../..' -version = "3.3.1-dev" +version = "3.3.1" @init def initialize(project): diff --git a/package.json b/package.json index bbfcef7..d78d74c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-forgejo", "description": "Generate c4k yaml for a forgejo deployment.", "author": "meissa GmbH", - "version": "3.3.1-SNAPSHOT", + "version": "3.3.1", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-forgejo#readme", "repository": "https://www.npmjs.com/package/c4k-forgejo", "license": "APACHE2", diff --git a/project.clj b/project.clj index eac576d..7ad30ad 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.1-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.1" :description "forgejo c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From c1c15f9eaa27fdfe000e23ddb058933f0e299fce Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 9 Jul 2024 09:15:58 +0200 Subject: [PATCH 14/15] bump version to: 3.3.2-SNAPSHOT --- infrastructure/backup/build.py | 2 +- infrastructure/federated/build.py | 2 +- package.json | 2 +- project.clj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infrastructure/backup/build.py b/infrastructure/backup/build.py index 263bcf4..74f6064 100644 --- a/infrastructure/backup/build.py +++ b/infrastructure/backup/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "c4k-forgejo" MODULE = "backup" PROJECT_ROOT_PATH = "../.." -version = "3.3.1" +version = "3.3.2-dev" @init diff --git a/infrastructure/federated/build.py b/infrastructure/federated/build.py index a1d0df3..7e71d71 100644 --- a/infrastructure/federated/build.py +++ b/infrastructure/federated/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = 'c4k-forgejo' MODULE = 'federated' PROJECT_ROOT_PATH = '../..' -version = "3.3.1" +version = "3.3.2-dev" @init def initialize(project): diff --git a/package.json b/package.json index d78d74c..f0d3614 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-forgejo", "description": "Generate c4k yaml for a forgejo deployment.", "author": "meissa GmbH", - "version": "3.3.1", + "version": "3.3.2-SNAPSHOT", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-forgejo#readme", "repository": "https://www.npmjs.com/package/c4k-forgejo", "license": "APACHE2", diff --git a/project.clj b/project.clj index 7ad30ad..fd8cf63 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.1" +(defproject org.domaindrivenarchitecture/c4k-forgejo "3.3.2-SNAPSHOT" :description "forgejo c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From cf7f77848f2826ace1f541d3a0189db03ae87a13 Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 9 Jul 2024 09:25:24 +0200 Subject: [PATCH 15/15] Added howto setup impressum --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c31e0e0..c596a59 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ After having deployed the yaml-file generated by the c4k-forgejo module you need * The SSH-URL for a repo has the format: "ssh://git@domain:2222/[username]/[repo].git Example: "git clone ssh://git@repo.test.meissa.de:2222/myuser/c4k-forgejo.git" +### Add Impressum + +In order to customize the UI e.g. for adding an Impressum, see the [Forgejo Docs](https://forgejo.org/docs/latest/developer/customization/#adding-links-and-tabs). +The individually needed files have to be added by hand into the directory `/data/gitea/templates/custom/` in the forgejo Pod. Since a PV is mounted under `/data`, these ui customizations are persisted. + ## Development & mirrors Development happens at: https://repo.prod.meissa.de/meissa/c4k-forgejo