ajout de trucs
This commit is contained in:
parent
724ef50568
commit
fcf0998212
11
README.md
11
README.md
|
|
@ -1,2 +1,13 @@
|
||||||
Deployment [**D**ebian](https://www.debian.org/) (os) + [**D**ocker](https://www.docker.com/) (containerization) + [**C**addy](https://caddyserver.com/) (webserver) + [**D**irectus](https://directus.io/) (cms) + [**N**uxt](https://nuxt.com/) (static front).
|
Deployment [**D**ebian](https://www.debian.org/) (os) + [**D**ocker](https://www.docker.com/) (containerization) + [**C**addy](https://caddyserver.com/) (webserver) + [**D**irectus](https://directus.io/) (cms) + [**N**uxt](https://nuxt.com/) (static front).
|
||||||
|
|
||||||
|
Installation
|
||||||
|
|
||||||
|
On a fresh install as root user using
|
||||||
|
|
||||||
|
sudo passwd root
|
||||||
|
|
||||||
|
su - root
|
||||||
|
|
||||||
|
Upgrade
|
||||||
|
|
||||||
|
apt update && apt upgrade -y
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir /home/$username/cms.$DOMAIN_NAME
|
||||||
|
cp assets/directus.docker-compose.yml /home/$username/cms.$DOMAIN_NAME/docker-compose.yml
|
||||||
|
cp assets/.env.example /home/$username/cms.$DOMAIN_NAME/.env
|
||||||
|
cd /home/$username/cms.$DOMAIN_NAME
|
||||||
|
docker compose up -d
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo -e "${PURPLE}${BOLD}Enter the domain name of the website${RESET}"
|
||||||
|
read DOMAIN_NAME
|
||||||
|
|
||||||
|
if [[ -z "$ip" ]]; then
|
||||||
|
ip=$(hostname -I | cut -d' ' -f1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${PURPLE}${BOLD}Configure the ${DOMAIN_NAME} DNS ZONE as the following${RESET}"
|
||||||
|
echo -e "${BLUE}Domain : ${DOMAIN_NAME} | Type : A | Target : ${ip}${RESET}"
|
||||||
|
echo -e "${BLUE}Domain : cms.${DOMAIN_NAME} | Type : A | Target : ${ip}${RESET}"
|
||||||
|
echo -e "${BLUE}Domain : www.${DOMAIN_NAME} | Type : A | Target : ${ip}${RESET}"
|
||||||
|
echo -e "${PURPLE}${BOLD}Press any key when done${RESET}"
|
||||||
|
read
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SET URL
|
||||||
|
echo -e "${PURPLE}${BOLD}Set url ? (y/N) ${RESET}"
|
||||||
|
read answer
|
||||||
|
if [[ "$answer" == "y" ]]; then
|
||||||
|
. bin/add-site/set_url.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# INSTALL DIRECTUS
|
||||||
|
echo -e "${PURPLE}${BOLD}Install Directus ? (y/N) ${RESET}"
|
||||||
|
read answer
|
||||||
|
if [[ "$answer" == "y" ]]; then
|
||||||
|
. bin/add-site/install_directus.sh
|
||||||
|
fi
|
||||||
|
|
@ -32,3 +32,21 @@ read answer
|
||||||
if [[ "$answer" == "y" ]]; then
|
if [[ "$answer" == "y" ]]; then
|
||||||
. bin/first-install/setup_firewall_fail2ban.sh
|
. bin/first-install/setup_firewall_fail2ban.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if Docker is installed
|
||||||
|
if ! command -v docker &> /dev/null; then
|
||||||
|
echo "Docker is not installed."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Docker is installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if a Caddy container is running
|
||||||
|
if docker ps --filter "ancestor=caddy" --format '{{.Names}}' | grep -q .; then
|
||||||
|
echo "A Caddy container is running."
|
||||||
|
else
|
||||||
|
mkdir /home/$username/caddy
|
||||||
|
cp assets/caddy.docker-compose.yml /home/$username/caddy/docker-compose.yml
|
||||||
|
cd /home/$username/caddy
|
||||||
|
docker compose up -d
|
||||||
|
fi
|
||||||
|
|
@ -6,3 +6,5 @@ ORANGE='\033[33m'
|
||||||
BLUE='\033[34m'
|
BLUE='\033[34m'
|
||||||
BOLD='\033[1m'
|
BOLD='\033[1m'
|
||||||
RESET='\033[0m'
|
RESET='\033[0m'
|
||||||
|
|
||||||
|
DOMAIN_NAME=""
|
||||||
|
|
@ -12,3 +12,7 @@ fi
|
||||||
# First install, root only
|
# First install, root only
|
||||||
echo -e "${PURPLE}${BOLD}First server installation${RESET}"
|
echo -e "${PURPLE}${BOLD}First server installation${RESET}"
|
||||||
. bin/first_install.sh
|
. bin/first_install.sh
|
||||||
|
|
||||||
|
# Install website
|
||||||
|
echo -e "${PURPLE}${BOLD}Install website${RESET}"
|
||||||
|
. bin/add_site.sh
|
||||||
Loading…
Reference in New Issue