EN version added
This commit is contained in:
parent
9e8550920c
commit
c258c81798
|
@ -0,0 +1,84 @@
|
|||
<?php $page_title = "edbrz9 - Ressources"; ?>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT']."/assets/php/header.php"); ?>
|
||||
|
||||
<nav>
|
||||
<section id="left-nav">
|
||||
<a href="/">
|
||||
<span class="byl-icon-home"></span>
|
||||
</a>
|
||||
<a href="/ressources">
|
||||
<span>/ressources</span>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="right-nav">
|
||||
<a href="../">FR</a> /
|
||||
<a href="" class="islang">ENG</a>
|
||||
</section>
|
||||
|
||||
</nav>
|
||||
|
||||
<main id="root" class="ref-result-page">
|
||||
|
||||
<!--
|
||||
<nav class="big">
|
||||
<rnav v-bind:tag="tags.arts">Arts</rnav>
|
||||
<rnav v-bind:tag="tags.tech">Tech</rnav>
|
||||
<rnav v-bind:tag="tags.afk">AFK</rnav>
|
||||
<rnav v-bind:tag="tags.science">Science</rnav>
|
||||
</nav>
|
||||
-->
|
||||
|
||||
<nav class="second">
|
||||
<rnav v-bind:tag="tags.selfhost">Self-Hosting</rnav>
|
||||
<rnav v-bind:tag="tags.web">Web</rnav>
|
||||
<!--
|
||||
<rnav v-bind:tag="tags.selfhost">Auto-hébergement</rnav>
|
||||
<rnav v-bind:tag="tags.music">Musique</rnav>
|
||||
<rnav v-bind:tag="tags.creativity">Créativité</rnav>
|
||||
<rnav v-bind:tag="tags.mental">Santée Mentale</rnav>
|
||||
<rnav v-bind:tag="tags.web">Web</rnav>
|
||||
<rnav v-bind:tag="tags.privacy">Données Personnelles</rnav>
|
||||
<rnav v-bind:tag="tags.zet">Esprit Critique</rnav>
|
||||
-->
|
||||
</nav>
|
||||
|
||||
<section class="refresult">
|
||||
<!--
|
||||
<ritem v-bind:tags="[tags.code, tags.css]" v-bind:fresh="isFresh" ref="ritems">CSS Reffs</ritem>
|
||||
|
||||
<ritem v-bind:tags="[tags.arts, tags.cinema]" v-bind:fresh="isFresh" ref="ritems">Idées sur le cinéma</ritem>
|
||||
|
||||
<ritem v-bind:tags="[tags.arts, tags.cinema]" v-bind:fresh="isFresh" ref="ritems">QI</ritem>
|
||||
|
||||
<ritem v-bind:tags="[tags.tech, tags.web, tags.privacy]" v-bind:fresh="isFresh" ref="ritems">Le problème avec les CDN</ritem>
|
||||
|
||||
<ritem v-bind:tags="[
|
||||
tags.arts,
|
||||
tags.cinema,
|
||||
tags.music,
|
||||
tags.creativity,
|
||||
tags.tech
|
||||
]" v-bind:fresh="isFresh" ref="ritems">
|
||||
|
||||
<a href="">Everything is a Remix</a>
|
||||
<blockquote>
|
||||
Une super série en trois parties qui parle aussi bien de cinéma, de musique que de technologie.
|
||||
</blockquote>
|
||||
</ritem>
|
||||
-->
|
||||
|
||||
<ritem v-bind:tags="[
|
||||
tags.tech,
|
||||
tags.selfhost,
|
||||
tags.web
|
||||
]" v-bind:fresh="isFresh" ref="ritems">
|
||||
|
||||
<a href="https://ed.brz9.dev/ressources/git-static-site/">Creating and maintaining a site with git</a>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
|
||||
<?php include($_SERVER['DOCUMENT_ROOT']."/assets/php/footer.php"); ?>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<?php $page_title = "edbrz9 - Creating and maintaining a site with git"; ?>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT']."/assets/php/header.php"); ?>
|
||||
|
||||
<nav>
|
||||
<section id="left-nav">
|
||||
<a href="/">
|
||||
<span class="byl-icon-home"></span>
|
||||
</a>
|
||||
<a href="../ressources">
|
||||
<span>/ressources</span>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="right-nav">
|
||||
<a href="" class="islang">FR</a> /
|
||||
<a href="ENG/">ENG</a>
|
||||
</section>
|
||||
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<article>
|
||||
|
||||
<h1>Creating and maintaining a site with git</h1>
|
||||
|
||||
<p>In this post, I will show you how to manage a simple static site with a git repository. I will mention <a href="https://yunohost.org/#/" target="_blank"></a> but needless to say that you can apply this approach on any other server.</p>
|
||||
|
||||
<h2>The root</h2>
|
||||
|
||||
<p>If you're already running your own server (with nginx, apache, lighthttpd...) you may dismiss this step.</p>
|
||||
|
||||
<p>With Yunohost, if you don't want to get your hands too dirty with nginx configuration, we'll have to install a "sandbox", an empty app that will become the root of our site.</p>
|
||||
|
||||
<p>When I first installed Yunohost, this app was available from the interface but it seems that it is no longer the case. You will have to copy and paste this link in the "Install custom app" form at the bottom of the installation page.</p>
|
||||
|
||||
<a href="https://github.com/YunoHost-Apps/multi_webapp_ynh" target="_blank">https://github.com/YunoHost-Apps/multi_webapp_ynh</a>
|
||||
|
||||
<h2>Gitea</h2>
|
||||
|
||||
<p>Unless you already have a gitea server running, you will need to install one.</p>
|
||||
|
||||
<p>In order to create hooks on server side, you'll have to add a line to /opt/gitea/custom/conf/app.ini :</p>
|
||||
|
||||
<pre><code>[security]
|
||||
|
||||
DISABLE_GIT_HOOKS = false
|
||||
</code></pre>
|
||||
|
||||
<p><a href="https://docs.gitea.io/en-us/config-cheat-sheet/">(complete list of options)</a></p>
|
||||
|
||||
<p>Remember to restart gitea</p>
|
||||
|
||||
<pre><code>$ yunohost service restart gitea</code></pre>
|
||||
|
||||
<p>Vous pourrez maintenant créer un post-receive hook sur votre dépot.</p>
|
||||
<p>You'll then be able to create a post-receive hook on your repository.</p>
|
||||
|
||||
<pre><code>#!/bin/sh
|
||||
|
||||
TARGET=/var/www/webapp_user/domain.tld_/
|
||||
|
||||
git --work-tree=$TARGET clean -fd
|
||||
|
||||
git --work-tree=$TARGET checkout --force</code></pre>
|
||||
|
||||
<p>Finally, don't forget to give acces to gitea on the server:</p>
|
||||
|
||||
<pre><code>$ chown gitea:gitea /var/www/webapp_user/domain.tld_/</code></pre>
|
||||
|
||||
<p>Now everytime you'll run a git push on your client to the repository, git will take cade of updating your site.</p>
|
||||
|
||||
<h2>Size issue</h2>
|
||||
|
||||
<p>If you need big files (audio/video) or if you're pushing a lot of files at once, you might be limited by some default settings.</p>
|
||||
|
||||
<p>You can fix that by increasing git's postBuffer size:</p>
|
||||
|
||||
<pre><code>$ git config --global http.postBuffer 400000000</code></pre>
|
||||
|
||||
<p>This will raise it to 50MB (versus 1MB by default).</p>
|
||||
|
||||
<p><a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer">(documentation)</a></p>
|
||||
|
||||
<p>If you encounter the following error:</p>
|
||||
|
||||
<pre><code>error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413</code></pre>
|
||||
|
||||
<p>You can increase the limit by editing /etc/nginx/conf.d/git.domain.tld.d/gitea.conf (on the server this time)</p>
|
||||
|
||||
<pre><code>client_max_body_size 50M;</code></pre>
|
||||
|
||||
<p>Then restart nginx:</p>
|
||||
|
||||
<pre><code>$ yunohost service restart nginx</code></pre>
|
||||
|
||||
<p><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size">(documentation)</a></p>
|
||||
|
||||
<h2>Autoindex / basic file server</h2>
|
||||
|
||||
<p>Si vous voulez pouvoir vous consulter l'arborescence de votre serveur depuis n'importe quel navigateur, vous pouvez activer l'autoindex en modifiant le fichier /etc/nginx/conf.d/domain.tld.d/webapp_domain.tld_.conf</p>
|
||||
|
||||
<p>If you want to be able to browse the whole file system of your domain from any web browser, you can edit /etc/nginx/conf.d/domain.tld.d/webapp_domain.tld_.conf</p>
|
||||
|
||||
<pre><code>location / {
|
||||
autoindex on;
|
||||
alias /path/to/root/ ;
|
||||
}</code></pre>
|
||||
|
||||
<p>Attention cependant, tout le monde pourra voir ce que vous avez sur votre serveur. En ce qui concerne les fichiers statiques (CSS, JS, police d'écriture...) utilisés sur les pages publiées, tout le monde peut déjà les voir, d'une manière contournée.</p>
|
||||
|
||||
<p>Be carfull though as everybody will be able to access it.</p>
|
||||
|
||||
<p>The only issue that comes to mind, regarding this visibility, would be if you were to store "hard-coded" passwords in text file, but it's a liabily that you should avoid in any case.</p>
|
||||
|
||||
<p>I use the autoindex to easily find font files or some javascript libraries.</p>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
|
||||
|
||||
<?php include($_SERVER['DOCUMENT_ROOT']."/assets/php/footer.php"); ?>
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<h1>Créer et maintenir à jour un site avec git</h1>
|
||||
|
||||
<p>Dans ce billet, je vais présenter une manière de gérer un site web statique via un dépôt git. Je ferais certaines références à Yunohost mais il va sans dire que cette approche peut se décliner sur n'importe quel serveur.</p>
|
||||
<p>Dans ce billet, je vais présenter une manière de gérer un site web statique via un dépôt git. Je ferais certaines références à <a href="https://yunohost.org/#/" target="_blank"></a> mais il va sans dire que cette approche peut se décliner sur n'importe quel serveur.</p>
|
||||
|
||||
<h2>La racine</h2>
|
||||
|
||||
|
@ -39,9 +39,9 @@
|
|||
<h2>Gitea</h2>
|
||||
|
||||
|
||||
<p>Si ce n'est pas déjà fait, on va commencer par installer un serveur Gitea.</p>
|
||||
<p>Si ce n'est pas déjà fait, on va commencer par installer un serveur Gitea (disponible sur YunoHost).</p>
|
||||
|
||||
<p>Pour pouvoir créer des hook côté serveur, il va d'abord falloir rajouter une ligne au fichier /opt/gitea/custom/conf/app.ini :</p>
|
||||
<p>Pour pouvoir créer des hooks côté serveur, il va d'abord falloir rajouter une ligne au fichier /opt/gitea/custom/conf/app.ini :</p>
|
||||
|
||||
<pre><code>[security]
|
||||
|
||||
|
@ -90,7 +90,7 @@ git --work-tree=$TARGET checkout --force</code></pre>
|
|||
|
||||
<pre><code>client_max_body_size 50M;</code></pre>
|
||||
|
||||
Puis redémarrer nginx avec la commande:
|
||||
<p>Puis redémarrer nginx avec la commande:</p>
|
||||
|
||||
<pre><code>$ yunohost service restart nginx</code></pre>
|
||||
|
||||
|
@ -105,7 +105,7 @@ Puis redémarrer nginx avec la commande:
|
|||
alias /path/to/root/ ;
|
||||
}</code></pre>
|
||||
|
||||
<p>Attention cependant, tout le monde pourra voir ce que vous avez sur votre serveur. En ce qui concerne les fichiers statiques (CSS, JS, police d'écriture...) utilisés sur les pages publiées, tout le monde peut déjà les voir, d'une manière contournée.</p>
|
||||
<p>Attention cependant, tout le monde pourra voir ce que vous avez sur votre serveur.</p>
|
||||
|
||||
<p>Le seul cas qui me vienne à l'esprit dans lequel cette visibilité pourrait poser problème est si vous avez des mots de passe écrit "en dur" dans un fichier mais c'est une très mauvaise pratique à éviter dans tous les cas.</p>
|
||||
|
||||
|
|
|
@ -31,9 +31,8 @@
|
|||
-->
|
||||
|
||||
<nav class="second">
|
||||
<rnav v-bind:tag="tags.selfhost">Auto-hébergement</rnav>
|
||||
<rnav v-bind:tag="tags.web">Web</rnav>
|
||||
<rnav v-bind:tag="tags.selfhost">Auto-hébergement</rnav>
|
||||
<rnav v-bind:tag="tags.web">Web</rnav>
|
||||
<!--
|
||||
<rnav v-bind:tag="tags.selfhost">Auto-hébergement</rnav>
|
||||
<rnav v-bind:tag="tags.music">Musique</rnav>
|
||||
|
|
Loading…
Reference in New Issue