From 69df07499b11aafce4a0197a932a4b9fb1af891b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Wed, 20 Jul 2022 11:57:06 +0200 Subject: [PATCH] 1.17 breaking changes episode 2 --- .../2022-06-26-1.17-breaking-episode-2.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 content/blog/2022-06-26-1.17-breaking-episode-2.md diff --git a/content/blog/2022-06-26-1.17-breaking-episode-2.md b/content/blog/2022-06-26-1.17-breaking-episode-2.md new file mode 100644 index 0000000..5fc8439 --- /dev/null +++ b/content/blog/2022-06-26-1.17-breaking-episode-2.md @@ -0,0 +1,34 @@ ++++ +title = "1.17 breaking changes episode 2: preserving a custom gitconfig" +date = 2022-07-20 +description = "The location of the gitconfig file used by Gitea moved twice, here is a guide to sort out why and how to deal with it." +[taxonomies] +tags = ['hostea', 'gitea', 'troubleshoot', 'problem', 'tutorial'] + +[extra] +author = 'dachary' ++++ + +On June 21st, 2022 1.17.0-rc1 was published and the location of the gitconfig file moved to a new location, [which required manual intervention](2022-06-23-1.17-breaking-episode-1). This change impacted a large number of Gitea installations because the docker image tag **latest** [was set to 1.17.0-rc1](https://mastodon.online/@hostea/108514134565401798) by accident. As a result, about 10,000 pulls per hour from the docker hub got the release candidate instead of the expected stable version. + +Unfortunately moving the git home directory in 1.17.0-rc1 was implemented in way that created a security problem. The [fix that was merged in Gitea](https://github.com/go-gitea/gitea/pull/20114) to fix it requires moving the gitconfig file and was released July 19th, 2022 in 1.17.0-rc2. + +This would have been a minor inconvenience if it only has an impact on adventurous people trying the release candidate in a test environment. But since all Gitea production installations based on the **latest** tag were inadvertently upgraded to 1.17.0-rc1, the admins who moved their custom .gitconfig will need to move it one more time when upgrading to 1.17.0-rc2. + +In 1.17.0-rc2, a custom .gitconfig must be moved manually to the [new git home directory](https://docs.gitea.io/en-us/config-cheat-sheet/#git-git) as follows: + +* Figure out the directory where `$HOME/.gitconfig` must be moved by [running the doctor](https://hostea.org/blog/gentle-introduction-to-the-doctor/): + +```shell +$ gitea --work-path /app/gitea -c /data/gitea/conf/app.ini doctor +[1] Check paths and basic configuration + - [I] Configuration File Path: "/data/gitea/conf/app.ini" + - [I] Repository Root Path: "/data/git/repositories" + - [I] Data Root Path: "/data/gitea" + - [I] Custom File Root Path: "/data/gitea" + - [I] Work directory: "/app/gitea" + - [I] Log Root Path: "/data/gitea/log" +OK +``` + +* Copy the `$HOME/.gitconfig` file to the **Data Root Path**/home (which is `/data/gitea/home` in the example above).