First version with notes

This commit is contained in:
Vyn 2025-06-12 11:59:23 +02:00
parent cb91e02327
commit 86aef1608b
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
45 changed files with 7075 additions and 0 deletions

5
dist/notes/index.html vendored Normal file
View file

@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="description" content="Evalyte"><meta name="viewport" content="width=device-width"><!--<link rel="icon" type="image/svg+xml" href="/favicon.svg" />--><meta name="generator" content="Astro v5.9.2"><title>Evalyte - Notes</title><script defer src="https://umami.evalyte.net/script.js" data-website-id="4fd77337-0f39-4eac-b19b-c09ebf8c8db3"></script><style>@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Regular.ttf);font-weight:400}@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Bold.ttf);font-weight:700}:root{--primary: #5d9eda;--secondary: #b1d0ee;--background: #282c34;--pane: #21252b;--surface: #31353f;--surface2: #51555f;--text: #d1d1d1;--headline: #ffffff;--hint: #797979;color:var(--text);--default-gap: 16px}a{text-decoration:none;color:var(--secondary)}nav>a{color:var(--text)}body{margin:0;min-height:100vh;display:flex;flex-direction:column}html{margin:0;font-family:system-ui,sans-serif;background:var(--background)}main{flex:1}header{background:var(--pane)}header>div{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:2rem;margin:auto;padding:16px;font-family:Comfortaa;font-weight:700;font-size:1rem;@media (min-width: 1200px){width:1200px}}nav{display:flex;flex-direction:row;align-items:center;gap:2rem}#logo{font-size:2rem;color:var(--primary);text-wrap:nowrap}h1,h2,h3,h4{font-family:Comfortaa;font-weight:400;color:var(--headline);padding:0}h1{color:var(--primary);font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.25rem}code{font-family:Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace}code:not(pre>code){background-color:#21252b;font-size:.9rem;padding:0 4px;border-radius:4px}.astro-code{padding:16px;max-width:80vw}pre{background-color:#21252b!important}.markdown-alert-title{margin-bottom:8px}footer{color:var(--hint);text-align:center;margin-bottom:16px}
h4[data-astro-cid-dohjnao5]{color:var(--secondary);text-align:center}p[data-astro-cid-dohjnao5]{color:var(--text)}.card[data-astro-cid-dohjnao5]{border:1px solid var(--surface2);background:var(--surface);transition-duration:.5s;&:hover{box-shadow:inset 0 0 100px 100px #6464641a}padding-left:16px;padding-right:16px;border-radius:8px;display:flex;flex-direction:row;align-items:start;gap:16px}.date[data-astro-cid-dohjnao5]{margin-left:auto;align-self:end;color:var(--hint);margin-bottom:8px}main[data-astro-cid-mejek24l]{margin:auto;padding:32px;width:800px;max-width:calc(100% - 2rem);display:flex;flex-direction:column;align-items:center}#description[data-astro-cid-mejek24l]{text-align:center;margin-top:32px;margin-bottom:32px}#applications[data-astro-cid-mejek24l]{padding:32px;display:flex;flex-direction:column;width:100%;gap:16px}
</style></head> <body> <header> <div> <a href="/" id="logo">&gt; _</a> <nav> <a href="https://code.evalyte.net" target="_blank">Repositories</a> <!--<a href="/devlog">Devlog</a>--> <a href="/notes">Notes</a> <!--<a href="/utilities">Utilities</a>--> <!--<a href="/services">Services</a>--> <a href="/about">About</a> </nav> </div> </header> <main data-astro-cid-mejek24l> <h1 data-astro-cid-mejek24l>Notes</h1> <p id="description" data-astro-cid-mejek24l>
Random things that might be useful.
</p> <section id="applications" data-astro-cid-mejek24l> <a href="/notes/selfhost-forgejo-with-podman-without-quadlet" class="card" data-astro-cid-dohjnao5> <h4 data-astro-cid-dohjnao5>Selfhost Forgejo with Podman without Quadlet</h4> <div class="date" data-astro-cid-dohjnao5>6/11/2025</div> </a> <a href="/notes/quick-sort-algorithm" class="card" data-astro-cid-dohjnao5> <h4 data-astro-cid-dohjnao5>Quick Sort algorithm</h4> <div class="date" data-astro-cid-dohjnao5>2/1/2021</div> </a> </section> </main> <footer>© 2024 Evalyte</footer> </body></html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="description" content="Evalyte"><meta name="viewport" content="width=device-width"><!--<link rel="icon" type="image/svg+xml" href="/favicon.svg" />--><meta name="generator" content="Astro v5.9.2"><title>undefined - Evalyte</title><script defer src="https://umami.evalyte.net/script.js" data-website-id="4fd77337-0f39-4eac-b19b-c09ebf8c8db3"></script><style>@media (prefers-color-scheme: dark){.markdown-alert{--color-border-default: #30363d;--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-success-fg: #3fb950;--color-success-emphasis: #238636}}@media (prefers-color-scheme: light){.markdown-alert{--color-border-default: #d0d7de;--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-danger-fg: #d1242f;--color-danger-emphasis: #cf222e;--color-attention-fg: #9a6700;--color-attention-emphasis: #9a6700;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-success-fg: #1a7f37;--color-success-emphasis: #1f883d}}.markdown-alert{border-left:.25em solid var(--borderColor-default, var(--color-border-default));color:inherit;margin-bottom:16px;padding:.5rem 1em}.markdown-alert>:last-child{margin-bottom:0!important}.markdown-alert .markdown-alert-title{align-items:center;display:flex;font-size:14px;font-weight:500;line-height:1}.markdown-alert .markdown-alert-title svg.octicon{margin-right:8px!important;margin-right:var(--base-size-8,8px)!important;fill:currentColor}.markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis,var(--color-accent-emphasis))}.markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--color-accent-fg);color:var(--fgColor-accent,var(--color-accent-fg))}.markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis,var(--color-success-emphasis))}.markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--color-success-fg);color:var(--fgColor-success,var(--color-success-fg))}.markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis,var(--color-done-emphasis))}.markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--color-done-fg);color:var(--fgColor-done,var(--color-done-fg))}.markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis,var(--color-attention-emphasis))}.markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--color-attention-fg);color:var(--fgColor-attention,var(--color-attention-fg))}.markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis,var(--color-danger-emphasis))}.markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--color-danger-fg);color:var(--fgColor-danger,var(--color-danger-fg))}main[data-astro-cid-hhdr4bp3]{padding:32px;display:flex;flex-direction:column;align-items:center;margin:auto;max-width:1200px;gap:32px}
@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Regular.ttf);font-weight:400}@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Bold.ttf);font-weight:700}:root{--primary: #5d9eda;--secondary: #b1d0ee;--background: #282c34;--pane: #21252b;--surface: #31353f;--surface2: #51555f;--text: #d1d1d1;--headline: #ffffff;--hint: #797979;color:var(--text);--default-gap: 16px}a{text-decoration:none;color:var(--secondary)}nav>a{color:var(--text)}body{margin:0;min-height:100vh;display:flex;flex-direction:column}html{margin:0;font-family:system-ui,sans-serif;background:var(--background)}main{flex:1}header{background:var(--pane)}header>div{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:2rem;margin:auto;padding:16px;font-family:Comfortaa;font-weight:700;font-size:1rem;@media (min-width: 1200px){width:1200px}}nav{display:flex;flex-direction:row;align-items:center;gap:2rem}#logo{font-size:2rem;color:var(--primary);text-wrap:nowrap}h1,h2,h3,h4{font-family:Comfortaa;font-weight:400;color:var(--headline);padding:0}h1{color:var(--primary);font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.25rem}code{font-family:Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace}code:not(pre>code){background-color:#21252b;font-size:.9rem;padding:0 4px;border-radius:4px}.astro-code{padding:16px;max-width:80vw}pre{background-color:#21252b!important}.markdown-alert-title{margin-bottom:8px}footer{color:var(--hint);text-align:center;margin-bottom:16px}
</style></head> <body> <header> <div> <a href="/" id="logo">&gt; _</a> <nav> <a href="https://code.evalyte.net" target="_blank">Repositories</a> <!--<a href="/devlog">Devlog</a>--> <a href="/notes">Notes</a> <!--<a href="/utilities">Utilities</a>--> <!--<a href="/services">Services</a>--> <a href="/about">About</a> </nav> </div> </header> <main data-astro-cid-hhdr4bp3> <div style="display:flex;flex-direction:column;gap:var(--default-gap);justify-content:center;align-items:start"> <div style="display:flex;flex-direction:column;gap:var(--default-gap);justify-content:center;align-items:start"> <h1 data-astro-cid-hhdr4bp3>Quick Sort algorithm</h1> </div> <div style="flex:1"> <p data-astro-cid-hhdr4bp3> <p>To explain the Quick Sort algorithm, lets take a simple example:</p>
<p>We have an array of number (integer) in random order, but we want them in ascending order, so we have to sort them, here comes the Quick Sort algorithm.</p>
<p><em>Note: The range of the numbers and the length of the array have no importance for the algorithm itself, but it will have a performance cost.</em></p>
<h2 id="algorithm">Algorithm</h2>
<p>Select a number, called “pivot”, chosen arbritrary from the array itself, put all the numbers lower than the pivot before it and all the numbers greater after it, split the current partition into 2 new partitions (the ones before and after the pivot), and repeat the procedure for each partition until there is no partition left (when the array length is 1).</p>
<p>The Quick Sort algorithm steps are:</p>
<ul>
<li>Select a pivot value from the partition and move it at the end of the partition (P, the pivot value).</li>
<li>Remember the start index of the current partition (S, the start index).</li>
<li>for each element (E), if E is lower or equal than P, then swap value E with the value at index S, then increment S.</li>
<li>Use the pivot P to divide the partition into 2 new partitions.</li>
<li>Repeat the algorithm for the 2 newly created partitions until there is no partition left.</li>
</ul>
<h2 id="implementation">Implementation</h2>
<h4 id="go">Go</h4>
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="go"><code><span class="line"><span style="color:#F97583">func</span><span style="color:#B392F0"> Swap</span><span style="color:#E1E4E8">(</span><span style="color:#FFAB70">partition</span><span style="color:#E1E4E8"> []</span><span style="color:#F97583">int</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">i</span><span style="color:#F97583"> int</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">j</span><span style="color:#F97583"> int</span><span style="color:#E1E4E8">) {</span></span>
<span class="line"><span style="color:#E1E4E8"> partition[i], partition[j] </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> partition[j], partition[i]</span></span>
<span class="line"><span style="color:#E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">func</span><span style="color:#B392F0"> QuickSort</span><span style="color:#E1E4E8">(</span><span style="color:#FFAB70">partition</span><span style="color:#E1E4E8"> []</span><span style="color:#F97583">int</span><span style="color:#E1E4E8">) {</span></span>
<span class="line"><span style="color:#B392F0"> Swap</span><span style="color:#E1E4E8">(partition, </span><span style="color:#B392F0">len</span><span style="color:#E1E4E8">(partition) </span><span style="color:#F97583">/</span><span style="color:#79B8FF"> 2</span><span style="color:#E1E4E8">, </span><span style="color:#B392F0">len</span><span style="color:#E1E4E8">(partition) </span><span style="color:#F97583">-</span><span style="color:#79B8FF"> 1</span><span style="color:#E1E4E8">) </span><span style="color:#6A737D">// Select the pivot from the middle (arbitrary) of the partition and swap it with the last element</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E1E4E8"> startIndex </span><span style="color:#F97583">:=</span><span style="color:#79B8FF"> 0</span></span>
<span class="line"><span style="color:#E1E4E8"> pivot </span><span style="color:#F97583">:=</span><span style="color:#E1E4E8"> partition[</span><span style="color:#B392F0">len</span><span style="color:#E1E4E8">(partition) </span><span style="color:#F97583">-</span><span style="color:#79B8FF"> 1</span><span style="color:#E1E4E8">] </span><span style="color:#6A737D">// Since we already swapped the pivot, we get the value directly from the end of the partition</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583"> for</span><span style="color:#E1E4E8"> i </span><span style="color:#F97583">:=</span><span style="color:#E1E4E8"> startIndex; i </span><span style="color:#F97583">&#x3C;</span><span style="color:#B392F0"> len</span><span style="color:#E1E4E8">(partition); i</span><span style="color:#F97583">++</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583"> if</span><span style="color:#E1E4E8"> partition[i] </span><span style="color:#F97583">&#x3C;=</span><span style="color:#E1E4E8"> pivot {</span></span>
<span class="line"><span style="color:#B392F0"> Swap</span><span style="color:#E1E4E8">(partition, i, startIndex)</span></span>
<span class="line"><span style="color:#E1E4E8"> startIndex</span><span style="color:#F97583">++</span></span>
<span class="line"><span style="color:#E1E4E8"> }</span></span>
<span class="line"><span style="color:#E1E4E8"> }</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D"> // startIndex now point at the first element of the values greater or equal than the pivot</span></span>
<span class="line"><span style="color:#F97583"> if</span><span style="color:#E1E4E8"> startIndex </span><span style="color:#F97583">></span><span style="color:#79B8FF"> 1</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#B392F0"> QuickSort</span><span style="color:#E1E4E8">(partition[:startIndex </span><span style="color:#F97583">-</span><span style="color:#79B8FF"> 1</span><span style="color:#E1E4E8">])</span></span>
<span class="line"><span style="color:#E1E4E8"> }</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583"> if</span><span style="color:#B392F0"> len</span><span style="color:#E1E4E8">(partition) </span><span style="color:#F97583">-</span><span style="color:#E1E4E8"> startIndex </span><span style="color:#F97583">></span><span style="color:#79B8FF"> 1</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#B392F0"> QuickSort</span><span style="color:#E1E4E8">(partition[startIndex:])</span></span>
<span class="line"><span style="color:#E1E4E8"> }</span></span>
<span class="line"><span style="color:#E1E4E8">}</span></span></code></pre>
<h2 id="performance-speed">Performance (speed)</h2>
<p>Average: O(n*log(n))<br>
Best case: O(n*log(n))<br>
Worst case: O(n²)</p>
<h2 id="sources">Sources</h2>
<p><a href="https://fr.wikipedia.org/wiki/Tri_rapide">https://fr.wikipedia.org/wiki/Tri_rapide</a> (fr)<br>
<a href="https://en.wikipedia.org/wiki/Quicksort">https://en.wikipedia.org/wiki/Quicksort</a> (en)<br>
My experience.</p> </p> </div> </div> </main> <footer>© 2024 Evalyte</footer> </body></html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="description" content="Evalyte"><meta name="viewport" content="width=device-width"><!--<link rel="icon" type="image/svg+xml" href="/favicon.svg" />--><meta name="generator" content="Astro v5.9.2"><title>undefined - Evalyte</title><script defer src="https://umami.evalyte.net/script.js" data-website-id="4fd77337-0f39-4eac-b19b-c09ebf8c8db3"></script><style>@media (prefers-color-scheme: dark){.markdown-alert{--color-border-default: #30363d;--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-success-fg: #3fb950;--color-success-emphasis: #238636}}@media (prefers-color-scheme: light){.markdown-alert{--color-border-default: #d0d7de;--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-danger-fg: #d1242f;--color-danger-emphasis: #cf222e;--color-attention-fg: #9a6700;--color-attention-emphasis: #9a6700;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-success-fg: #1a7f37;--color-success-emphasis: #1f883d}}.markdown-alert{border-left:.25em solid var(--borderColor-default, var(--color-border-default));color:inherit;margin-bottom:16px;padding:.5rem 1em}.markdown-alert>:last-child{margin-bottom:0!important}.markdown-alert .markdown-alert-title{align-items:center;display:flex;font-size:14px;font-weight:500;line-height:1}.markdown-alert .markdown-alert-title svg.octicon{margin-right:8px!important;margin-right:var(--base-size-8,8px)!important;fill:currentColor}.markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis,var(--color-accent-emphasis))}.markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--color-accent-fg);color:var(--fgColor-accent,var(--color-accent-fg))}.markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis,var(--color-success-emphasis))}.markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--color-success-fg);color:var(--fgColor-success,var(--color-success-fg))}.markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis,var(--color-done-emphasis))}.markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--color-done-fg);color:var(--fgColor-done,var(--color-done-fg))}.markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis,var(--color-attention-emphasis))}.markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--color-attention-fg);color:var(--fgColor-attention,var(--color-attention-fg))}.markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis,var(--color-danger-emphasis))}.markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--color-danger-fg);color:var(--fgColor-danger,var(--color-danger-fg))}main[data-astro-cid-hhdr4bp3]{padding:32px;display:flex;flex-direction:column;align-items:center;margin:auto;max-width:1200px;gap:32px}
@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Regular.ttf);font-weight:400}@font-face{font-family:Comfortaa;src:url(/fonts/Comfortaa-Bold.ttf);font-weight:700}:root{--primary: #5d9eda;--secondary: #b1d0ee;--background: #282c34;--pane: #21252b;--surface: #31353f;--surface2: #51555f;--text: #d1d1d1;--headline: #ffffff;--hint: #797979;color:var(--text);--default-gap: 16px}a{text-decoration:none;color:var(--secondary)}nav>a{color:var(--text)}body{margin:0;min-height:100vh;display:flex;flex-direction:column}html{margin:0;font-family:system-ui,sans-serif;background:var(--background)}main{flex:1}header{background:var(--pane)}header>div{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:2rem;margin:auto;padding:16px;font-family:Comfortaa;font-weight:700;font-size:1rem;@media (min-width: 1200px){width:1200px}}nav{display:flex;flex-direction:row;align-items:center;gap:2rem}#logo{font-size:2rem;color:var(--primary);text-wrap:nowrap}h1,h2,h3,h4{font-family:Comfortaa;font-weight:400;color:var(--headline);padding:0}h1{color:var(--primary);font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.25rem}code{font-family:Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace}code:not(pre>code){background-color:#21252b;font-size:.9rem;padding:0 4px;border-radius:4px}.astro-code{padding:16px;max-width:80vw}pre{background-color:#21252b!important}.markdown-alert-title{margin-bottom:8px}footer{color:var(--hint);text-align:center;margin-bottom:16px}
</style></head> <body> <header> <div> <a href="/" id="logo">&gt; _</a> <nav> <a href="https://code.evalyte.net" target="_blank">Repositories</a> <!--<a href="/devlog">Devlog</a>--> <a href="/notes">Notes</a> <!--<a href="/utilities">Utilities</a>--> <!--<a href="/services">Services</a>--> <a href="/about">About</a> </nav> </div> </header> <main data-astro-cid-hhdr4bp3> <div style="display:flex;flex-direction:column;gap:var(--default-gap);justify-content:center;align-items:start"> <div style="display:flex;flex-direction:column;gap:var(--default-gap);justify-content:center;align-items:start"> <h1 data-astro-cid-hhdr4bp3>Selfhost Forgejo with Podman without Quadlet</h1> </div> <div style="flex:1"> <p data-astro-cid-hhdr4bp3> <p>When self-hosting Forgejo, <a href="https://forgejo.org/docs/latest/admin/installation/">the official documentation</a>
provides the steps for binary, Docker and Podman.</p>
<p>However the provided steps for installing with Podman use Quadlet, and if youre out of luck and
Quadlet isnt available in your environment you have to use the Podman CLI, but your lose some nice
things that Quadlet has, especially restart on boot.</p>
<p>Unfortunatly the Forgejo documentation doesnt tell us how to but its easily deductible from the
Quadlet/Systemd config file they provide</p>
<h3 id="script">Script</h3>
<div class="markdown-alert markdown-alert-note" dir="auto">
<p class="markdown-alert-title" dir="auto"><svg class="octicon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>NOTE</p>
<p>You might need to modify some values in the script below for your use case</p>
</div>
<p>First, create a directory named <code>forgejo-volume</code>, then create the <code>data</code> and <code>conf</code> directories
inside it so you have <code>forgejo-volume/data</code> and <code>forgejo-volume/conf</code></p>
<p>Then the command is:</p>
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="bash"><code><span class="line"><span style="color:#B392F0">podman</span><span style="color:#9ECBFF"> run</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> --name</span><span style="color:#9ECBFF"> forgejo</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> --restart=always</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> --userns=keep-id:uid=1000,gid=1000</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> -p</span><span style="color:#9ECBFF"> 3000:3000</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> -p</span><span style="color:#9ECBFF"> 2222:2222</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> -v</span><span style="color:#9ECBFF"> ./forgejo-volume/data:/var/lib/gitea</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#79B8FF"> -v</span><span style="color:#9ECBFF"> ./forgejo-volume/conf:/etc/gitea</span><span style="color:#79B8FF"> \</span></span>
<span class="line"><span style="color:#9ECBFF"> codeberg.org/forgejo/forgejo:11-rootless</span></span></code></pre>
<p>Some explanation:</p>
<ul>
<li><code>--restart=always</code> allows us to restart the container on boot, you need to tell systemd to do it
with <code>systemctl --user enable podman-restart.service</code></li>
<li><code>--userns=keep-id:uid=1000,gid=1000</code> allows us to keep the permissions for the volume while
using 1000 for the UID and GID inside the container (because we are using the rootless version)</li>
<li><code>-p 3000:3000</code> Forgejo will listen on port 3000</li>
<li><code>-p 2222:2222</code> Forgejo will accept SSH through port 2222</li>
<li>the two following <code>-v</code> parameters map the volume to the directories inside the container</li>
</ul> </p> </div> </div> </main> <footer>© 2024 Evalyte</footer> </body></html>