portfolio_server/README.md

55 lines
1.8 KiB
Markdown

# Serveur de portfolio de [coh@bit](https://cohabit.fr)
Sert les portfofolio (site static) depuis la branche `main` de
`https://git.cohabit.fr/[user]/.portfolio/`.
> [!NOTE]
>
> La racine par default est `'/dist'` et la page par default `/dist/index.html`
> (mode power user).
>
> Si `/dist/index.html` n'existe pas la racine devient `'/'` et la page par
> defaut `/README.md` (mode
> [WYSIWYG](https://fr.wikipedia.org/wiki/What_you_see_is_what_you_get) user).
Une rediection html peut être utilisée pour "changer la racine" ou rediriger
vers un site externe.
```html
<meta http-equiv="refresh" content="0;URL=${destination}" />
```
> [!IMPORTANT]
>
> Chaque utilisateur (cohabit) se voit attribuer le sous domaine
> `https://[user_subdomain].portfolio.cohabit.fr`.
>
> Chaque portfolio et donc isolé et ne (peut) partager aucune information
> (cookie, scripts, xss, ...) avec les autres portfolios et domaines de
> [cohabit](https://cohabit.fr).
Formats :
- `user` : `${firstname}.${lastname}`
- `user_subdomain` : `${firstname}-${lastname}`
## Usage
1. Cloner le repo.
1. Lancer le serveur.
- Executer `deno task start` //Serveur sur le port 8000 par default.
- Ou, executer `PORT=7000 deno task start` //Spécifier le port d'écoute
désiré.
- Ou, utiliser le service définit dans
[`@cohabit/server_config/portfolio_server`](https://git.cohabit.fr/cohabit/server_config/src/branch/main/portfolio_server/systemd).
## Contribution
1. Install [deno](https://deno.land).
1. Follow
[deno convention](https://docs.deno.com/runtime/manual/references/contributing/style_guide).
1. Follow
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
1. Follow [sermver](https://semver.org/lang/fr/).
1. Run and check `deno task check` before any commit.