-
Notifications
You must be signed in to change notification settings - Fork 1
113 https #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
KarimRahoMekdad
wants to merge
3
commits into
main
Choose a base branch
from
113-https
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
113 https #146
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # This is an example of .env file whith the variables it must contain | ||
|
|
||
| ADMIN_NAME="xxxxxx" | ||
| ADMIN_PASSWORD="$2b$10$xxxxxxxxxxx" | ||
| JWT_SECRET="xxxxxxx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| import { defuFn } from 'C:/Users/karim/Documents/Stage_UR/ProjetMilestone/Unitystation-MillstoneSteam/node_modules/defu/dist/defu.mjs' | ||
|
|
||
| import fs from 'fs' | ||
| require('dotenv').config() | ||
|
|
||
| const httpsConfig = { | ||
| server: { | ||
| https: { | ||
| key: fs.readFileSync(process.env.KEY_PATH), | ||
| cert: fs.readFileSync(process.env.CERT_PATH) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const inlineConfig = {} | ||
|
|
||
|
|
||
|
|
||
| export default defuFn(inlineConfig, httpConfig) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| milestone.unionrolistes.fr localhost 127.0.0.1 { | ||
| reverse_proxy app:3000 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Définition des couleurs pour les messages | ||
| GREEN="\e[32m" | ||
| YELLOW="\e[33m" | ||
| RED="\e[31m" | ||
| RESET="\e[0m" | ||
|
|
||
| echo -e "${GREEN}🔹 Activation de HTTPS sur Apache (Debian) 🔹${RESET}" | ||
|
|
||
| # Vérifier si l'utilisateur est root | ||
| if [[ $EUID -ne 0 ]]; then | ||
| echo -e "${RED}❌ Ce script doit être exécuté en tant que root.${RESET}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Demander le nom de domaine | ||
| read -p "🔹 Entrez le nom de domaine (ex: monsite.com) : " DOMAIN | ||
|
|
||
| if [[ -z "$DOMAIN" ]]; then | ||
| echo -e "${RED}❌ Aucun domaine saisi. Script annulé.${RESET}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Vérifier et installer Certbot si absent | ||
| if ! command -v certbot &> /dev/null; then | ||
| echo -e "${YELLOW}🛠️ Installation de Certbot...${RESET}" | ||
| apt update && apt install -y certbot python3-certbot-apache | ||
| else | ||
| echo -e "${GREEN}✅ Certbot est déjà installé.${RESET}" | ||
| fi | ||
|
|
||
| # Générer le certificat SSL avec Certbot | ||
| echo -e "${YELLOW}🔹 Obtention du certificat SSL pour $DOMAIN...${RESET}" | ||
| certbot --apache -d "$DOMAIN" | ||
|
|
||
| if [[ $? -ne 0 ]]; then | ||
| echo -e "${RED}❌ Échec de la génération du certificat. Vérifiez que votre domaine pointe bien vers ce serveur.${RESET}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo -e "${GREEN}✅ Certificat SSL installé avec succès !${RESET}" | ||
|
|
||
| # Vérifier si le renouvellement automatique est actif | ||
| echo -e "${YELLOW}🔹 Vérification du renouvellement automatique...${RESET}" | ||
| if systemctl list-timers | grep -q certbot; then | ||
| echo -e "${GREEN}✅ Le renouvellement automatique du certificat SSL est actif.${RESET}" | ||
| else | ||
| echo -e "${RED}❌ Le renouvellement automatique n'est pas activé ! Ajoutons-le...${RESET}" | ||
| systemctl enable certbot.timer | ||
| systemctl start certbot.timer | ||
| echo -e "${GREEN}✅ Le renouvellement automatique est maintenant activé.${RESET}" | ||
| fi | ||
|
|
||
| # Redémarrer Apache pour appliquer les changements | ||
| echo -e "${YELLOW}🔄 Redémarrage d'Apache...${RESET}" | ||
| systemctl restart apache2 | ||
|
|
||
| echo -e "${GREEN}🎉 HTTPS activé et renouvellement automatique configuré pour $DOMAIN ! ${RESET}" | ||
| echo -e "${GREEN}🔗 Testez votre site en HTTPS : https://$DOMAIN ${RESET}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faut un chemin relatif. actuelement ca ne fonctionnera que sur ta machine