feat(article): conf serveur +
feat(config): noopener norefer on links + fix(style): larger wrapper for editorial content + fix(structure): add assets folder in src
@ -1,14 +1,15 @@
|
||||
|
||||
export default new Map([
|
||||
["src/content/fragments/en/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/buttons.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fbuttons.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/after-effects-expressions.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fafter-effects-expressions.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/video-compression.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fvideo-compression.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/buttons.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fbuttons.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")]]);
|
||||
["src/content/fragments/en/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/configuration-serveur.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fconfiguration-serveur.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")]]);
|
||||
|
@ -2,6 +2,7 @@ import { defineConfig } from 'astro/config'
|
||||
|
||||
import mdx from '@astrojs/mdx'
|
||||
import sitemap from '@astrojs/sitemap'
|
||||
import rehypeExternalLinks from 'rehype-external-links'
|
||||
|
||||
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'
|
||||
import expressiveCode from 'astro-expressive-code'
|
||||
@ -15,6 +16,9 @@ export default defineConfig({
|
||||
domains: ['assets.nardu.in'],
|
||||
remotePatterns: [{ protocol: 'https' }]
|
||||
},
|
||||
markdown: {
|
||||
rehypePlugins: [[rehypeExternalLinks, { rel: ['noopener noreferer'] }]]
|
||||
},
|
||||
integrations: [
|
||||
expressiveCode({
|
||||
theme: 'one-dark-pro',
|
||||
|
@ -17,6 +17,7 @@
|
||||
"@expressive-code/plugin-line-numbers": "^0.40.1",
|
||||
"astro": "5.1.8",
|
||||
"astro-expressive-code": "^0.40.1",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"sharp": "^0.33.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 953 B |
Before Width: | Height: | Size: 821 B After Width: | Height: | Size: 821 B |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { Picture } from 'astro:assets'
|
||||
import SocialRel from '../components/SocialRel.astro'
|
||||
import fight from '../images/fight-fascism.webp'
|
||||
import fight from '../assets/images/fight-fascism.webp'
|
||||
---
|
||||
|
||||
<footer class='footer wrapper flow' role='contentinfo'>
|
||||
|
@ -9,9 +9,16 @@ type: articles
|
||||
createdAt: '2025-01-28T22:20:00.000Z'
|
||||
---
|
||||
|
||||
import { Picture } from 'astro:assets'
|
||||
import coolifySettings from '@assets/images/articles/configuration-serveur/coolify-admin-settings.jpg'
|
||||
import coolifyNewRessource from '@assets/images/articles/configuration-serveur/coolify-new-ressource.jpg'
|
||||
import coolifyConfRessource from '@assets/images/articles/configuration-serveur/coolify-conf-ressource.jpg'
|
||||
|
||||
## Mon mémo perso.
|
||||
|
||||
Cet article est l'extension d'un fichier « pense-bête » que j'utilise depuis toujours quand je créé un nouveau serveur, généralement un <abbr lang="en" title="Virtual Private Server">VPS</abbr>, généralment sous debian (ou fedora).
|
||||
Cet article est l'extension d'un fichier « pense-bête » que j'utilise depuis toujours quand je crée un nouveau serveur. Généralement un <abbr lang="en" title="Virtual Private Server">VPS</abbr>, généralement sous debian ou fedora.
|
||||
|
||||
Si vous voulez tester des trucs, voici [un lien de parrainage](https://hetzner.cloud/?ref=Jl7yPFuoBGDM) chez l'hébergeur allemand [Hetzner](https://hetzner.cloud) pour récupérer 20€ de crédit (et 10€ pour moi si vous y restez). [Conditions de l'offre.](https://www.hetzner.com/legal/referrals)
|
||||
|
||||
> Notez bien que je ne suis ni administrateur système ni expert en sécurité.
|
||||
|
||||
@ -25,13 +32,13 @@ Se connecter en root via ssh puis…
|
||||
|
||||
Parfois il manque la configuration des [locales](https://www.tecmint.com/set-system-locales-in-linux/) et ça cause des erreurs.
|
||||
|
||||
```bash
|
||||
```bash {"Debian":4} {"Fedora":6}
|
||||
# affiche la conf actuelle
|
||||
locale
|
||||
|
||||
# debian
|
||||
+
|
||||
nano /etc/default/locale
|
||||
# fedora
|
||||
+
|
||||
nano /etc/locale.conf
|
||||
|
||||
# compléter ces lignes si besoin
|
||||
@ -42,11 +49,11 @@ LC_ALL=en_US.UTF-8
|
||||
|
||||
#### Mettre à jour le système
|
||||
|
||||
```bash
|
||||
# debian
|
||||
```bash {"Debian":1} {"Fedora":4}
|
||||
+
|
||||
apt update
|
||||
apt dist-upgrade
|
||||
# fedora
|
||||
+
|
||||
dnf check-update
|
||||
dnf upgrade
|
||||
```
|
||||
@ -55,25 +62,25 @@ dnf upgrade
|
||||
|
||||
- Ajouter et renseigner un nouvel utilisateur.
|
||||
- Ajouter l'utilisateur aux "sudoers".
|
||||
- Ajouter sa clé ssh à l'utilisateur.
|
||||
- Ajouter sa clé ssh locale à l'utilisateur distant.
|
||||
|
||||
```bash
|
||||
```bash {"Debian":3} {"Fedora":5} {"En local":8} {"Sur le serveur":13}
|
||||
adduser USERNAME
|
||||
|
||||
# debian
|
||||
+
|
||||
usermod -aG sudo USERNAME
|
||||
# fedora
|
||||
+
|
||||
usermod -aG wheel USERNAME
|
||||
|
||||
# si pas encore de clé ssh EN LOCAL
|
||||
+
|
||||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "mail@domain.tld"
|
||||
# copier la clé publique
|
||||
# afficher puis copier la clé publique
|
||||
cat ~/.ssh/id_ed25519.pub
|
||||
|
||||
# sur le serveur
|
||||
+
|
||||
su USERNAME
|
||||
mkdir ~/.ssh
|
||||
# coller la clé publique
|
||||
# coller la clé publique dans ce fichier
|
||||
nano authorized_keys
|
||||
```
|
||||
|
||||
@ -156,26 +163,26 @@ firewall-cmd --reload
|
||||
[Crowdsec](https://doc.crowdsec.net/docs/getting_started/install_crowdsec/) est un système de sécurité qui détecte et bloque les connexions malveillantes.
|
||||
|
||||
- Installer crowdsec.
|
||||
- Installer un "<span lang="en">bouncer</span>"
|
||||
- Activer des scenarios
|
||||
- Installer un "<span lang="en">bouncer</span>".
|
||||
- Activer des [scenarios](https://doc.crowdsec.net/docs/next/cscli/cscli_scenarios_install) (facultatif).
|
||||
|
||||
```bash
|
||||
```bash {"Debian":3} {"Fedora":6}
|
||||
curl -s https://install.crowdsec.net | sudo sh
|
||||
|
||||
# debian
|
||||
+
|
||||
apt install crowdsec
|
||||
apt install crowdsec-firewall-bouncer-iptables
|
||||
# fedora
|
||||
+
|
||||
dnf install crowdsec
|
||||
dnf install crowdsec-firewall-bouncer-nftables
|
||||
```
|
||||
|
||||
## Conf web
|
||||
|
||||
**Partie encore en cours de rédaction.**
|
||||
|
||||
### Serveur web
|
||||
|
||||
J'utilisais généralement [OpenLiteSpeed](https://openlitespeed.org/) pour avoir une interface graphique, mais j'ai changé pour [Coolify](https://coolify.io) depuis quelques années.
|
||||
|
||||
#### Coolify
|
||||
|
||||
[Documentation.](https://coolify.io/docs/installation)
|
||||
@ -184,15 +191,87 @@ dnf install crowdsec-firewall-bouncer-nftables
|
||||
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
|
||||
```
|
||||
|
||||
> Crowdsec et Coolify utilisent tous les deux le port 8080 par défaut. Il faut le changer pour un des deux (plus facile à [faire pour Crowdsec.](https://support.crowdsec.net/hc/en-gb/articles/10831013001234--Security-Engine-How-to-change-the-default-port))
|
||||
|
||||
<details class="flow">
|
||||
<summary>Procédure détaillée</summary>
|
||||
|
||||
Il faut éditer deux fichiers:
|
||||
|
||||
```yaml title="/etc/crowdsec/config.yaml" "8080"
|
||||
api:
|
||||
server:
|
||||
listen_uri: 127.0.0.1:8080
|
||||
```
|
||||
|
||||
```yaml title="/etc/crowdsec/local_api_credentials.yaml" "8080"
|
||||
url: http://127.0.0.1:8080
|
||||
```
|
||||
|
||||
Puis charger la nouvelle configuration :
|
||||
|
||||
```bash
|
||||
service crowdsec reload
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
##### Configuration
|
||||
|
||||
Une fois installé (suivre les instructions du script), on peut paramétrer Coolify avec un nom de domaine, généralement un sous-domaine du style `coolify.domaine.tld`
|
||||
|
||||
<Picture
|
||||
src={coolifySettings}
|
||||
formats={['avif', 'webp']}
|
||||
alt="Instance's domain field inside settings"
|
||||
/>
|
||||
|
||||
##### Ajouter une ressource
|
||||
|
||||
Dans coolify, les « ressources » correspondent à un site ou service web :
|
||||
|
||||
- site statique
|
||||
- webapp
|
||||
- base de données
|
||||
- image docker
|
||||
- etc.
|
||||
|
||||
Afin d'héberger un site ou une webapp « maison », il faudra avant tout que le code soit disponible sur une forge git. Soit en public soit en ayant paramétré une clé de déploiement au préalable.
|
||||
|
||||
<Picture src={coolifyNewRessource} formats={['avif', 'webp']} alt='' />
|
||||
|
||||
##### Configurer la ressource
|
||||
|
||||
Coolify va essayer de déterminer des [options par défaut](https://github.com/coollabsio/coolify-examples/) selon le dépôt git. Il ne restera plus qu'à ajuster les paramètres de la ressource :
|
||||
|
||||
- url du projet
|
||||
- commande d'installation des paquets
|
||||
- commande de construction du projet
|
||||
- commande de démarrage
|
||||
- variables d'environnement
|
||||
- <span lang='en'>webhooks</span>
|
||||
- etc.
|
||||
|
||||
<Picture src={coolifyConfRessource} formats={['avif', 'webp']} alt='' />
|
||||
|
||||
#### OpenLiteSpeed
|
||||
|
||||
[Documentation.](https://docs.openlitespeed.org/#CentOS_6_7_8_Debian_7_8_9_10_Ubuntu_1404_1604_1804_2004)
|
||||
Plus vraiment utilisé pour de nouveaux projets et moins évident à prendre en main. Mais puissant malgré tout !
|
||||
|
||||
[Documentation.](https://docs.openlitespeed.org/installation/repo/)
|
||||
|
||||
```bash
|
||||
wget -O - https://repo.litespeed.sh | sudo bash
|
||||
apt-get install openlitespeed
|
||||
```
|
||||
|
||||
Récupérer le mot de passe admin `cat /usr/local/lsws/adminpasswd`
|
||||
|
||||
### Outils
|
||||
|
||||
Selon les besoins du projet :
|
||||
|
||||
- git
|
||||
- [nvm](https://github.com/nvm-sh/nvm#install--update-script)
|
||||
- [yarn](https://classic.yarnpkg.com/en/docs/getting-started)/[pnpm](https://pnpm.io/installation)/[bun](https://bun.sh/)
|
||||
- [acme.sh](https://github.com/acmesh-official/acme.sh) ([tuto complet](https://www.nardu.in/fragments/acme-sh-tls-cert/))
|
||||
- [acme.sh](https://github.com/acmesh-official/acme.sh) ([tuto complet](/fragments/acme-sh-tls-cert/))
|
@ -56,7 +56,7 @@ h4,
|
||||
|
||||
h5,
|
||||
.h5 {
|
||||
font-size: var(--size-1);
|
||||
font-size: var(--size-0);
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,9 @@ body {
|
||||
max-inline-size: 100%;
|
||||
}
|
||||
|
||||
:where(details) {
|
||||
:where(summary) {
|
||||
padding: var(--space-3xs);
|
||||
background-color: var(--color-light-grey);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
grid-column: wrapper;
|
||||
}
|
||||
|
||||
.wrapper:has(article.editorial) {
|
||||
--content-width: 70rem;
|
||||
}
|
||||
|
||||
/* set full width content to full grid */
|
||||
.wrapper.full-width {
|
||||
/* calculate inline padding based on available space minus content space to align full-width content with wrapper content */
|
||||
|
@ -6,7 +6,8 @@
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@components/*": ["src/components/*"],
|
||||
"@layouts/*": ["src/layouts/*"]
|
||||
"@layouts/*": ["src/layouts/*"],
|
||||
"@assets/*": ["src/assets/*"]
|
||||
},
|
||||
"strictNullChecks": true,
|
||||
"plugins": [
|
||||
|