début du script install

This commit is contained in:
Valentin 2024-02-23 14:28:42 +01:00
parent a392013b48
commit ab7c90e05b
4 changed files with 71 additions and 0 deletions

View File

@ -2,3 +2,30 @@
Deployment [**D**ebian](https://www.debian.org/) (os) + [**C**addy](https://caddyserver.com/) (webserver) + [**D**irectus](https://directus.io/) (cms) + [**N**uxt](https://nuxt.com/) (front).
## Installation
On a fresh install a root user
1. Upgrade
`apt update && apt upgrade`
2. Install git
`apt install git`
3. Download and make the instal script executable
`git clone https://figureslibres.io/gitea/valentin_le_moign/deployment-dcdn.git`
`cd deployment-dcdn`
`chmod u+x install.sh`
4. Launch the script
`bash install.sh`
## Ref
[Debian Web Server](https://figureslibres.io/gogs/bachir/debian-web-server)

42
install.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/bash
echo "Deployment Debian + Caddy + Directus + Nuxt"
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
#
# USER
#
echo "Create user"
read -p "Enter username: " username
if id "$username" &>/dev/null; then
echo "User '$username' already exists."
exit 1
fi
echo "Generate and store the password somewhere safe"
read -s -p "Enter password: " password
echo
sudo useradd -m "$username"
echo "$username:$password" | chpasswd
usermod -aG sudo $username
echo "User '$username' created with password successfully."
#
# SSH
#
echo "Setup SSH"
touch /etc/ssh/sshd_config.d/custom.conf
echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf
echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf
systemctl reload ssh

1
utils/export-content.sh Normal file
View File

@ -0,0 +1 @@
#!/bin/bash

1
utils/upgrade.sh Normal file
View File

@ -0,0 +1 @@
#!/bin/bash