From 86c6ef41f9a91c3682736010399a3a532a472771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Thu, 23 Jun 2022 17:04:20 +0000 Subject: [PATCH] new deploy: 2022-06-23T17:04:20+00:00 --- blog/1-17-breaking-episode-1/index.html | 328 ++++++++++++++++++++++++ blog/atom.xml | 38 ++- blog/index.html | 37 +++ search_index.en.js | 2 +- sitemap.xml | 4 + tags/gitea/atom.xml | 38 ++- tags/gitea/index.html | 28 ++ tags/hostea/atom.xml | 38 ++- tags/hostea/index.html | 28 ++ tags/index.html | 12 +- tags/problem/atom.xml | 38 ++- tags/problem/index.html | 28 ++ tags/troubleshoot/atom.xml | 38 ++- tags/troubleshoot/index.html | 28 ++ tags/tutorial/atom.xml | 38 ++- tags/tutorial/index.html | 28 ++ 16 files changed, 737 insertions(+), 14 deletions(-) create mode 100644 blog/1-17-breaking-episode-1/index.html diff --git a/blog/1-17-breaking-episode-1/index.html b/blog/1-17-breaking-episode-1/index.html new file mode 100644 index 0000000..ca3e161 --- /dev/null +++ b/blog/1-17-breaking-episode-1/index.html @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.17 breaking changes episode 1: preserving a custom gitconfig | Hostea: Managed Gitea Hosting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ + +
+

1.17 breaking changes episode 1: preserving a custom gitconfig

+ + + +
+

Before version 1.17, when Gitea needed to change the git configuration, it modified the $HOME/.gitconfig file. For instance it would set core.quotePath to false:

+
[core]
+	quotePath = false
+
+

When installing Gitea from docker or rootless or even from binary this $HOME/.gitconfig file belongs to a user that is dedicated to Gitea and not used by anyone else.

+

However, if an Gitea installation was done differently and $HOME/.gitconfig has been customized because it is shared by a user or another application, there is a good chance that manual modifications were done such as:

+
[user]
+	name = Jane Doe
+	email = jane@doe.com
+
+

It is also possible that the file was modified manually by the Gitea admin for other reasons. In both there is a potential for breakage when upgrading to Gitea >= 1.17 because the location of the file changed. It must be moved manually to the new location as follows:

+ +
$ 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 Repository Root Path (which is /data/git/repositories in the example above).
  • +
+

The reason why this breaking change was introduced is to workaround a rare problem impacting Gitea installations relying on networked volumes.

+ +
+
+
+ + +
+ + +
+ + +
+ + diff --git a/blog/atom.xml b/blog/atom.xml index 4b9270d..cd1317b 100644 --- a/blog/atom.xml +++ b/blog/atom.xml @@ -4,8 +4,44 @@ Zola - 2022-06-14T00:00:00+00:00 + 2022-06-22T00:00:00+00:00 https://hostea.org/blog/atom.xml + + 1.17 breaking changes episode 1: preserving a custom gitconfig + 2022-06-22T00:00:00+00:00 + 2022-06-22T00:00:00+00:00 + + https://hostea.org/blog/1-17-breaking-episode-1/ + <p>Before version 1.17, when Gitea needed to change the <a href="https://git-scm.com/docs/git-config">git configuration</a>, it modified the <code>$HOME/.gitconfig</code> file. For instance it would <a href="https://github.com/go-gitea/gitea/blob/release/v1.16/modules/git/git.go#L174-L177">set core.quotePath to false</a>:</p> +<pre data-lang="ini" style="background-color:#2b303b;color:#c0c5ce;" class="language-ini "><code class="language-ini" data-lang="ini"><span style="color:#b48ead;">[core] +</span><span> </span><span style="color:#bf616a;">quotePath </span><span>= </span><span style="color:#d08770;">false +</span></code></pre> +<p>When installing Gitea <a href="https://docs.gitea.io/en-us/install-with-docker/">from docker</a> or <a href="https://docs.gitea.io/en-us/install-with-docker-rootless/">rootless</a> or even <a href="https://docs.gitea.io/en-us/install-from-binary/">from binary</a> this <code>$HOME/.gitconfig</code> file belongs to a user that is <a href="https://docs.gitea.io/en-us/install-from-binary/#prepare-environment">dedicated to Gitea</a> and not used by anyone else.</p> +<p>However, if an Gitea installation was done differently and <code>$HOME/.gitconfig</code> has been customized because it is shared by a user or another application, there is a good chance that manual modifications were done such as:</p> +<pre data-lang="ini" style="background-color:#2b303b;color:#c0c5ce;" class="language-ini "><code class="language-ini" data-lang="ini"><span style="color:#b48ead;">[user] +</span><span> </span><span style="color:#bf616a;">name </span><span>= Jane Doe +</span><span> </span><span style="color:#bf616a;">email </span><span>= jane</span><span style="color:#b48ead;">@doe</span><span>.com +</span></code></pre> +<p>It is also possible that the file was modified manually by the Gitea admin for other reasons. In both there is a <strong>potential for breakage when upgrading to Gitea &gt;= 1.17 because the location of the file changed</strong>. It must be moved manually to the new location as follows:</p> +<ul> +<li>Figure out the directory where <code>$HOME/.gitconfig</code> must be moved by <a href="https://hostea.org/blog/gentle-introduction-to-the-doctor/">running the doctor</a>:</li> +</ul> +<pre data-lang="shell" style="background-color:#2b303b;color:#c0c5ce;" class="language-shell "><code class="language-shell" data-lang="shell"><span>$ gitea --work-path /app/gitea -c /data/gitea/conf/app.ini doctor +</span><span>[1] Check paths and basic configuration +</span><span> - [I] Configuration File Path: &quot;/data/gitea/conf/app.ini&quot; +</span><span> - [I] Repository Root Path: &quot;/data/git/repositories&quot; +</span><span> - [I] Data Root Path: &quot;/data/gitea&quot; +</span><span> - [I] Custom File Root Path: &quot;/data/gitea&quot; +</span><span> - [I] Work directory: &quot;/app/gitea&quot; +</span><span> - [I] Log Root Path: &quot;/data/gitea/log&quot; +</span><span>OK +</span></code></pre> +<ul> +<li>Copy the <code>$HOME/.gitconfig</code> file to the <strong>Repository Root Path</strong> (which is <code>/data/git/repositories</code> in the example above).</li> +</ul> +<p>The reason why this breaking change was introduced is to workaround <a href="https://hostea.org/blog/unsafe-repository-is-owned-by-someone-else/">a rare problem</a> impacting Gitea installations relying on networked volumes.</p> + + [tutorial] A gentle introduction to the gitea doctor 2022-06-14T00:00:00+00:00 diff --git a/blog/index.html b/blog/index.html index edf21a6..1152734 100644 --- a/blog/index.html +++ b/blog/index.html @@ -203,6 +203,43 @@