2 Commit-ok 5db8ef1241 ... a923377be9

Szerző SHA1 Üzenet Dátum
  hiesoftrd a923377be9 actualizar 1 éve
  hiesoftrd 5db8ef1241 actualizar 1 éve

BIN
frontend/public/android-chrome-192x192.jpg


BIN
frontend/public/apple-touch-icon.jpg


BIN
frontend/public/favicon-16x16.jpg


BIN
frontend/public/favicon-32x32.jpg


BIN
frontend/public/favicon.ico


BIN
frontend/public/import-contatos.xlsx


+ 0 - 28
frontend/public/index.html

@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<title>Atendechat</title>
-		<link
-			rel="stylesheet"
-			href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
-		/>
-		<link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" />
-		<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
-		<link rel=”shortcut icon” href=”%PUBLIC_URL%/favicon.ico”>
-		<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
-		<meta name="theme-color" content="#000000" />
-		<meta
-			name="viewport"
-			content="minimum-scale=1, initial-scale=1, width=device-width"
-		/>
-		<!-- Issue workaround for React v16. -->
-		<script>
-			// See https://github.com/facebook/react/issues/20829#issuecomment-802088260
-			if (!crossOriginIsolated) SharedArrayBuffer = ArrayBuffer;
-		</script>
-	</head>
-	<body>
-		<noscript>You need to enable JavaScript to run this app.</noscript>
-		<div id="root"></div>
-	</body>
-</html>

+ 0 - 20
frontend/public/manifest.json

@@ -1,20 +0,0 @@
-{
-	"short_name": "Atendechat",
-	"name": "Atendechat",
-	"icons": [
-		{
-			"src": "favicon.ico",
-			"sizes": "64x64 32x32 24x24 16x16",
-			"type": "image/x-icon"
-		},
-		{
-			"src": "/android-chrome-192x192.png",
-			"sizes": "192x192",
-			"type": "image/png"
-		}
-	],
-	"start_url": ".",
-	"display": "standalone",
-	"theme_color": "#000000",
-	"background_color": "#ffffff"
-}

BIN
frontend/public/mstile-150x150.jpg


+ 196 - 0
instalador/README.md

@@ -0,0 +1,196 @@
+# HieChat
+
+HieChat es una empresa de distribución White Label que cuenta con una solución de atención al cliente por WhatsApp que aumenta la productividad y organización del equipo.
+
+## 🚀 Começando
+
+El repositorio de HieChat tiene 3 carpetas importantes:
+- backend
+- frontend
+- instalador
+
+El backend está hecho en Express y tiene toda la estructura organizada dentro de esta carpeta para poder ser aplicada en el entorno del cliente. La carpeta frontend contiene todo el marco React.js que administra toda la interacción del usuario con el sistema.
+
+La carpeta del instalador dentro de este repositorio es una copia del instalador utilizado para que los clientes del sistema puedan clonarlo dentro de la carpeta de inicio de sus servidores y continuar con la instalación automática de todas las dependencias del proyecto.
+
+Enlace al repositorio de instalación actualizado:
+- [Instalador](http://hiegit.hiesoft.net/esterlin/HIECHAT/src/master/instalador)
+
+Consulte **[Implantação](#-implanta%C3%A7%C3%A3o)** para saber como implantar el proyeto.
+
+### 📋 Pré-requisitos
+
+```
+- Node.js v20.x
+- Postgres (release)
+- Npm ( latest )
+- Docker (bionic stable)
+- Redis
+```
+
+### 🔧 instalación
+
+Para iniciar la instalación del proyecto, debe tener todas las herramientas necesarias disponibles para su uso.
+
+#### Redis
+```
+- su - root
+- docker run --name redis-${instancia_add} -p ${redis_port}:6379 --restart always --detach redis redis-server --requirepass ${root_password}
+```
+
+#### Postgres
+```
+- sudo su - postgres
+- createdb ${instancia_add};
+- psql
+- CREATE USER ${instancia_add} SUPERUSER INHERIT CREATEDB CREATEROLE;
+- ALTER USER ${instancia_add} PASSWORD '${root_password}';
+```
+
+#### .env backend
+```
+NODE_ENV=
+BACKEND_URL=${backend_url}
+FRONTEND_URL=${frontend_url}
+PROXY_PORT=443
+PORT=${backend_port}
+
+DB_DIALECT=postgres
+DB_HOST=localhost
+DB_PORT=5432
+DB_USER=${instancia_add}
+DB_PASS=${mysql_root_password}
+DB_NAME=${instancia_add}
+
+JWT_SECRET=${jwt_secret}
+JWT_REFRESH_SECRET=${jwt_refresh_secret}
+
+REDIS_URI=redis://:${mysql_root_password}@127.0.0.1:${redis_port}
+REDIS_OPT_LIMITER_MAX=1
+REGIS_OPT_LIMITER_DURATION=3000
+
+USER_LIMIT=${max_user}
+CONNECTIONS_LIMIT=${max_whats}
+CLOSED_SEND_BY_ME=true
+
+GERENCIANET_SANDBOX=false
+GERENCIANET_CLIENT_ID=Client_Id_Gerencianet
+GERENCIANET_CLIENT_SECRET=Client_Secret_Gerencianet
+GERENCIANET_PIX_CERT=certificado-Gerencianet
+GERENCIANET_PIX_KEY=chave pix gerencianet
+
+# EMAIL
+ MAIL_HOST="smtp.gmail.com"
+ MAIL_USER="seu@gmail.com"
+ MAIL_PASS="SuaSenha"
+ MAIL_FROM="seu@gmail.com"
+ MAIL_PORT="465"
+
+```
+
+#### .env frontend
+```
+REACT_APP_BACKEND_URL=${backend_url}
+REACT_APP_HOURS_CLOSE_TICKETS_AUTO = 24
+```
+
+#### Instalando dependencias
+```
+cd backend/
+npm install --force
+cd frontend/
+npm install --force
+```
+
+### Ejecutándose localmente
+```
+cd backend/
+npm run watch
+npm start
+
+cd frontend/
+npm start
+```
+
+## ⚙️ Ejecutando las pruebas
+
+//
+
+### 🔩 Analizar pruebas de extremo a extremo
+
+//
+
+## 📦 Despliegue en producción
+
+Para una correcta implementación, es necesario actualizar el código fuente de la aplicación y recrear los archivos en la carpeta dist/.
+
+Atención: es necesario acceder utilizando el usuario de deploy
+
+```
+su - deploy
+```
+
+```
+cd /home/deploy/${empresa_atualizar}
+pm2 stop ${empresa_atualizar}-frontend
+git pull
+cd /home/deploy/${empresa_atualizar}/frontend
+npm install
+rm -rf build
+npm run build
+pm2 start ${empresa_atualizar}-frontend
+pm2 save
+```
+
+```
+cd /home/deploy/${empresa_atualizar}
+pm2 stop ${empresa_atualizar}-backend
+git pull
+cd /home/deploy/${empresa_atualizar}/backend
+npm install
+npm update -f
+npm install @types/fs-extra
+rm -rf dist 
+npm run build
+npx sequelize db:migrate
+npx sequelize db:migrate
+npx sequelize db:seed
+pm2 start ${empresa_atualizar}-backend
+pm2 save 
+```
+
+## 🛠️ Instalacion desde el instalador
+
+echo "Set disable_coredump false" >> /etc/sudo.conf
+sudo apt update && sudo apt upgrade
+sudo apt install -y git && sudo apt install -y curl && sudo apt install -y wget && sudo apt install -y npm
+sudo npm i -g pm2
+
+git clone http://hiegit.hiesoft.net/esterlin/HIECHAT.git && chmod -R 777 HIECHAT && cd HIECHAT/instalador && ./install_primaria
+
+cd /home/deploy/hiesoft/frontend/
+
+
+npx restart all
+## 🛠️ Construído com
+
+
+* [Express](https://expressjs.com/pt-br/) - O framework backend usado
+* [React](https://react.dev/) - Framework frontend usado
+* [NPM](https://www.npmjs.com/) - Gerenciador de dependências
+
+## 🖇️ Colaborando
+
+//
+
+## 📌 Versión
+
+Versión 6.0.0
+
+## 📄 Licencia
+
+Este projeto está bajo licencia
+
+⌨️ com ❤️ por [HieChat](https://hiechat.net) 😊
+
+Todos los direchos reservados a https://hiechat.net

+ 3 - 0
instalador/config

@@ -0,0 +1,3 @@
+deploy_password=
+mysql_root_password=
+db_pass=3PDTleNftG3hfREtysleqHx61bgyKO89z2wIQ2Guw7M=

+ 73 - 0
instalador/install_instancia

@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# reset shell colors
+tput init
+
+# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$PROJECT_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+
+# required imports
+source "${PROJECT_ROOT}"/variables/manifest.sh
+source "${PROJECT_ROOT}"/utils/manifest.sh
+source "${PROJECT_ROOT}"/lib/manifest.sh
+
+# user configs file
+if [[ ! -e "${PROJECT_ROOT}"/config ]]; then
+  cat << EOF > "${PROJECT_ROOT}"/config
+deploy_password=${deploy_password}
+mysql_root_password=${mysql_root_password}
+db_pass=${db_pass}
+EOF
+fi
+
+# this file has passwords
+sudo su - root <<EOF
+chown root:root "${PROJECT_ROOT}"/config
+chmod 700 "${PROJECT_ROOT}"/config
+EOF
+source "${PROJECT_ROOT}"/config
+
+# interactive CLI
+inquiry_options
+
+# dependencies related
+#system_update
+#system_node_install
+#system_pm2_install
+#system_docker_install
+#system_puppeteer_dependencies
+#system_snapd_install
+#system_nginx_install
+#system_certbot_install
+
+# system config
+#system_create_user
+
+# backend related
+system_git_clone
+backend_set_env
+backend_redis_create
+backend_node_dependencies
+backend_node_build
+backend_db_migrate
+backend_db_seed
+backend_start_pm2
+backend_nginx_setup
+
+# frontend related
+frontend_set_env
+frontend_node_dependencies
+frontend_node_build
+frontend_start_pm2
+frontend_nginx_setup
+
+# network related
+#system_nginx_conf
+system_nginx_restart
+system_certbot_setup

+ 73 - 0
instalador/install_primaria

@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# reset shell colors
+tput init
+
+# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$PROJECT_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+
+# required imports
+source "${PROJECT_ROOT}"/variables/manifest.sh
+source "${PROJECT_ROOT}"/utils/manifest.sh
+source "${PROJECT_ROOT}"/lib/manifest.sh
+
+# user configs file
+if [[ ! -e "${PROJECT_ROOT}"/config ]]; then
+  cat << EOF > "${PROJECT_ROOT}"/config
+deploy_password=${deploy_password}
+mysql_root_password=${mysql_root_password}
+db_pass=${db_pass}
+EOF
+fi
+
+# this file has passwords
+sudo su - root <<EOF
+chown root:root "${PROJECT_ROOT}"/config
+chmod 700 "${PROJECT_ROOT}"/config
+EOF
+source "${PROJECT_ROOT}"/config
+
+# interactive CLI
+inquiry_options
+
+# dependencies related
+system_update
+system_node_install
+system_pm2_install
+system_docker_install
+system_puppeteer_dependencies
+system_snapd_install
+system_nginx_install
+system_certbot_install
+
+# system config
+system_create_user
+
+# backend related
+system_git_clone
+backend_set_env
+backend_redis_create
+backend_node_dependencies
+backend_node_build
+backend_db_migrate
+backend_db_seed
+backend_start_pm2
+backend_nginx_setup
+
+# frontend related
+frontend_set_env
+frontend_node_dependencies
+frontend_node_build
+frontend_start_pm2
+frontend_nginx_setup
+
+# network related
+system_nginx_conf
+system_nginx_restart
+system_certbot_setup

+ 256 - 0
instalador/lib/_backend.sh

@@ -0,0 +1,256 @@
+#!/bin/bash
+#
+# functions for setting up app backend
+#######################################
+# creates REDIS db using docker
+# Arguments:
+#   None
+#######################################
+backend_redis_create() {
+  print_banner
+  printf "${WHITE} 💻 Criando Redis & Banco Postgres...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  usermod -aG docker deploy
+  docker run --name redis-${instancia_add} -p ${redis_port}:6379 --restart always --detach redis redis-server --requirepass ${mysql_root_password}
+  
+  sleep 2
+  sudo su - postgres
+  createdb ${instancia_add};
+  psql
+  CREATE USER ${instancia_add} SUPERUSER INHERIT CREATEDB CREATEROLE;
+  ALTER USER ${instancia_add} PASSWORD '${mysql_root_password}';
+  \q
+  exit
+EOF
+
+sleep 2
+
+}
+
+#######################################
+# sets environment variable for backend.
+# Arguments:
+#   None
+#######################################
+backend_set_env() {
+  print_banner
+  printf "${WHITE} 💻 Configurando variáveis de ambiente (backend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  # ensure idempotency
+  backend_url=$(echo "${backend_url/https:\/\/}")
+  backend_url=${backend_url%%/*}
+  backend_url=https://$backend_url
+
+  # ensure idempotency
+  frontend_url=$(echo "${frontend_url/https:\/\/}")
+  frontend_url=${frontend_url%%/*}
+  frontend_url=https://$frontend_url
+
+sudo su - deploy << EOF
+  cat <<[-]EOF > /home/deploy/${instancia_add}/backend/.env
+NODE_ENV=
+BACKEND_URL=${backend_url}
+FRONTEND_URL=${frontend_url}
+PROXY_PORT=443
+PORT=${backend_port}
+
+DB_DIALECT=postgres
+DB_HOST=localhost
+DB_PORT=5432
+DB_USER=${instancia_add}
+DB_PASS=${mysql_root_password}
+DB_NAME=${instancia_add}
+
+JWT_SECRET=${jwt_secret}
+JWT_REFRESH_SECRET=${jwt_refresh_secret}
+
+REDIS_URI=redis://:${mysql_root_password}@127.0.0.1:${redis_port}
+REDIS_OPT_LIMITER_MAX=1
+REGIS_OPT_LIMITER_DURATION=3000
+
+USER_LIMIT=${max_user}
+CONNECTIONS_LIMIT=${max_whats}
+CLOSED_SEND_BY_ME=true
+
+[-]EOF
+EOF
+
+  sleep 2
+}
+
+#######################################
+# installs node.js dependencies
+# Arguments:
+#   None
+#######################################
+backend_node_dependencies() {
+  print_banner
+  printf "${WHITE} 💻 Instalando dependências do backend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/backend
+  npm install --force
+EOF
+
+  sleep 2
+}
+
+#######################################
+# compiles backend code
+# Arguments:
+#   None
+#######################################
+backend_node_build() {
+  print_banner
+  printf "${WHITE} 💻 Compilando o código do backend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/backend
+  npm run build
+EOF
+
+  sleep 2
+}
+
+#######################################
+# updates frontend code
+# Arguments:
+#   None
+#######################################
+backend_update() {
+  print_banner
+  printf "${WHITE} 💻 Atualizando o backend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${empresa_atualizar}
+  pm2 stop ${empresa_atualizar}-backend
+  git pull
+  cd /home/deploy/${empresa_atualizar}/backend
+  npm install
+  npm update -f
+  npm install @types/fs-extra
+  rm -rf dist 
+  npm run build
+  npx sequelize db:migrate
+  npx sequelize db:migrate
+  npx sequelize db:seed
+  pm2 start ${empresa_atualizar}-backend
+  pm2 save 
+EOF
+
+  sleep 2
+}
+
+#######################################
+# runs db migrate
+# Arguments:
+#   None
+#######################################
+backend_db_migrate() {
+  print_banner
+  printf "${WHITE} 💻 Executando db:migrate...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/backend
+  npx sequelize db:migrate
+EOF
+
+  sleep 2
+}
+
+#######################################
+# runs db seed
+# Arguments:
+#   None
+#######################################
+backend_db_seed() {
+  print_banner
+  printf "${WHITE} 💻 Executando db:seed...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/backend
+  npx sequelize db:seed:all
+EOF
+
+  sleep 2
+}
+
+#######################################
+# starts backend using pm2 in 
+# production mode.
+# Arguments:
+#   None
+#######################################
+backend_start_pm2() {
+  print_banner
+  printf "${WHITE} 💻 Iniciando pm2 (backend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/backend
+  pm2 start dist/server.js --name ${instancia_add}-backend
+EOF
+
+  sleep 2
+}
+
+#######################################
+# updates frontend code
+# Arguments:
+#   None
+#######################################
+backend_nginx_setup() {
+  print_banner
+  printf "${WHITE} 💻 Configurando nginx (backend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  backend_hostname=$(echo "${backend_url/https:\/\/}")
+
+sudo su - root << EOF
+cat > /etc/nginx/sites-available/${instancia_add}-backend << 'END'
+server {
+  server_name $backend_hostname;
+  location / {
+    proxy_pass http://127.0.0.1:${backend_port};
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade \$http_upgrade;
+    proxy_set_header Connection 'upgrade';
+    proxy_set_header Host \$host;
+    proxy_set_header X-Real-IP \$remote_addr;
+    proxy_set_header X-Forwarded-Proto \$scheme;
+    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+    proxy_cache_bypass \$http_upgrade;
+  }
+}
+END
+ln -s /etc/nginx/sites-available/${instancia_add}-backend /etc/nginx/sites-enabled
+EOF
+
+  sleep 2
+}

+ 182 - 0
instalador/lib/_frontend.sh

@@ -0,0 +1,182 @@
+#!/bin/bash
+# 
+# functions for setting up app frontend
+
+#######################################
+# installed node packages
+# Arguments:
+#   None
+#######################################
+frontend_node_dependencies() {
+  print_banner
+  printf "${WHITE} 💻 Instalando dependências do frontend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/frontend
+  npm install --force
+EOF
+
+  sleep 2
+}
+
+#######################################
+# compiles frontend code
+# Arguments:
+#   None
+#######################################
+frontend_node_build() {
+  print_banner
+  printf "${WHITE} 💻 Compilando o código do frontend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/frontend
+  npm run build
+EOF
+
+  sleep 2
+}
+
+#######################################
+# updates frontend code
+# Arguments:
+#   None
+#######################################
+frontend_update() {
+  print_banner
+  printf "${WHITE} 💻 Atualizando o frontend...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${empresa_atualizar}
+  pm2 stop ${empresa_atualizar}-frontend
+  git pull
+  cd /home/deploy/${empresa_atualizar}/frontend
+  npm install
+  rm -rf build
+  npm run build
+  pm2 start ${empresa_atualizar}-frontend
+  pm2 save
+EOF
+
+  sleep 2
+}
+
+
+#######################################
+# sets frontend environment variables
+# Arguments:
+#   None
+#######################################
+frontend_set_env() {
+  print_banner
+  printf "${WHITE} 💻 Configurando variáveis de ambiente (frontend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  # ensure idempotency
+  backend_url=$(echo "${backend_url/https:\/\/}")
+  backend_url=${backend_url%%/*}
+  backend_url=https://$backend_url
+
+sudo su - deploy << EOF
+  cat <<[-]EOF > /home/deploy/${instancia_add}/frontend/.env
+REACT_APP_BACKEND_URL=${backend_url}
+REACT_APP_HOURS_CLOSE_TICKETS_AUTO = 24
+[-]EOF
+EOF
+
+  sleep 2
+
+sudo su - deploy << EOF
+  cat <<[-]EOF > /home/deploy/${instancia_add}/frontend/server.js
+//simple express server to run frontend production build;
+const express = require("express");
+const path = require("path");
+const app = express();
+app.use(express.static(path.join(__dirname, "build")));
+app.get("/*", function (req, res) {
+	res.sendFile(path.join(__dirname, "build", "index.html"));
+});
+app.listen(${frontend_port});
+
+[-]EOF
+EOF
+
+  sleep 2
+}
+
+#######################################
+# starts pm2 for frontend
+# Arguments:
+#   None
+#######################################
+frontend_start_pm2() {
+  print_banner
+  printf "${WHITE} 💻 Iniciando pm2 (frontend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  cd /home/deploy/${instancia_add}/frontend
+  pm2 start server.js --name ${instancia_add}-frontend
+  pm2 save
+EOF
+
+ sleep 2
+  
+  sudo su - root <<EOF
+   pm2 startup
+  sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u deploy --hp /home/deploy
+EOF
+  sleep 2
+}
+
+#######################################
+# sets up nginx for frontend
+# Arguments:
+#   None
+#######################################
+frontend_nginx_setup() {
+  print_banner
+  printf "${WHITE} 💻 Configurando nginx (frontend)...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  frontend_hostname=$(echo "${frontend_url/https:\/\/}")
+
+sudo su - root << EOF
+
+cat > /etc/nginx/sites-available/${instancia_add}-frontend << 'END'
+server {
+  server_name $frontend_hostname;
+
+  location / {
+    proxy_pass http://127.0.0.1:${frontend_port};
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade \$http_upgrade;
+    proxy_set_header Connection 'upgrade';
+    proxy_set_header Host \$host;
+    proxy_set_header X-Real-IP \$remote_addr;
+    proxy_set_header X-Forwarded-Proto \$scheme;
+    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+    proxy_cache_bypass \$http_upgrade;
+  }
+}
+END
+
+ln -s /etc/nginx/sites-available/${instancia_add}-frontend /etc/nginx/sites-enabled
+EOF
+
+  sleep 2
+}

+ 244 - 0
instalador/lib/_inquiry.sh

@@ -0,0 +1,244 @@
+#!/bin/bash
+
+get_mysql_root_password() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese la contraseña para el usuario de implementación y base de datos (no utilice caracteres especiales):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " mysql_root_password
+}
+
+get_link_git() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingresa el link de HIEGIT del Atendechat que deseas instalar:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " link_git
+}
+
+get_instancia_add() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese un nombre para la Instancia/Compañía que se instalará (No utilice espacios ni caracteres especiales, utilice letras minúsculas); ):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " instancia_add
+}
+
+get_max_whats() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingresa el número de conexiones/WhatsApps que ${instancia_add} puede registrar:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " max_whats
+}
+
+get_max_user() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el número de usuarios/asistentes que ${instancia_add} puede registrar:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " max_user
+}
+
+get_frontend_url() {
+  
+  print_banner
+  printf "${WHITE} 💻 Introduzca el dominio FRONTEND/PANEL para el ${instancia_add}:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " frontend_url
+}
+
+get_backend_url() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el dominio BACKEND/API para el ${instancia_add}:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " backend_url
+}
+
+get_frontend_port() {
+  
+  print_banner
+  printf "${WHITE} 💻 Introduzca el puerto FRONTEND para el ${instancia_add}; Ex: 3000 A 3999 ${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " frontend_port
+}
+
+
+get_backend_port() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el puerto BACKEND para esta instancia; Ex: 4000 A 4999 ${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " backend_port
+}
+
+get_redis_port() {
+  
+  print_banner
+  printf "${WHITE} 💻 Introduzca el puerto REDIS/MSG SCHEDULING para el ${instancia_add}; Ex: 5000 A 5999 ${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " redis_port
+}
+
+get_empresa_delete() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el nombre de la Instancia/Compañía que será Eliminada (Ingrese el mismo nombre que cuando la instaló):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " empresa_delete
+}
+
+get_empresa_atualizar() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el nombre de la Instancia/Compañía que desea Actualizar (Ingrese el mismo nombre que cuando realizó la instalación):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " empresa_atualizar
+}
+
+get_empresa_bloquear() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el nombre de la Instancia/Compañía que desea bloquear (Ingrese el mismo nombre que tenía cuando la instaló):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " empresa_bloquear
+}
+
+get_empresa_desbloquear() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el nombre de la Instancia/Compañía que desea desbloquear (Ingrese el mismo nombre que cuando realizó la instalación):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " empresa_desbloquear
+}
+
+get_empresa_dominio() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingresa el nombre de la Instancia/Compañía para la cual deseas Cambiar los Dominios (Ten en cuenta que para cambiar los dominios necesitas ingresar ambos, incluso si solo vas a cambiar 1):${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " empresa_dominio
+}
+
+get_alter_frontend_url() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el dominio NUEVO FRONTEND/PANEL para el ${empresa_dominio}:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " alter_frontend_url
+}
+
+get_alter_backend_url() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el NUEVO dominio BACKEND/API para el ${empresa_dominio}:${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " alter_backend_url
+}
+
+get_alter_frontend_port() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el puerto FRONTEND de la Instancia/Empresa ${empresa_dominio}; El puerto debe ser el mismo que el proporcionado durante la instalación.${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " alter_frontend_port
+}
+
+
+get_alter_backend_port() {
+  
+  print_banner
+  printf "${WHITE} 💻 Ingrese el puerto BACKEND de la Instancia/Compañía ${empresa_dominio}; El puerto debe ser el mismo que el proporcionado durante la instalación. ${GRAY_LIGHT}"
+  printf "\n\n"
+  read -p "> " alter_backend_port
+}
+
+
+get_urls() {
+  get_mysql_root_password
+  get_link_git
+  get_instancia_add
+  get_max_whats
+  get_max_user
+  get_frontend_url
+  get_backend_url
+  get_frontend_port
+  get_backend_port
+  get_redis_port
+}
+
+software_update() {
+  get_empresa_atualizar
+  frontend_update
+  backend_update
+}
+
+software_delete() {
+  get_empresa_delete
+  deletar_tudo
+}
+
+software_bloquear() {
+  get_empresa_bloquear
+  configurar_bloqueio
+}
+
+software_desbloquear() {
+  get_empresa_desbloquear
+  configurar_desbloqueio
+}
+
+software_dominio() {
+  get_empresa_dominio
+  get_alter_frontend_url
+  get_alter_backend_url
+  get_alter_frontend_port
+  get_alter_backend_port
+  configurar_dominio
+}
+
+inquiry_options() {
+  
+  print_banner
+  printf "${WHITE} 💻 Bienvenido a HieChat Manager, ¡seleccione la siguiente acción a continuación!${GRAY_LIGHT}"
+  printf "\n\n"
+  printf "   [0] Instalar HieChat\n"
+  printf "   [1] Atualizar HieChat\n"
+  printf "   [2] Eliminat HieChat\n"
+  printf "   [3] Bloquear HieChat\n"
+  printf "   [4] Desbloquear HieChat\n"
+  printf "   [5] Modificar. dominio HieChat\n"
+  printf "\n"
+  read -p "> " option
+
+  case "${option}" in
+    0) get_urls ;;
+
+    1) 
+      software_update 
+      exit
+      ;;
+
+    2) 
+      software_delete 
+      exit
+      ;;
+    3) 
+      software_bloquear 
+      exit
+      ;;
+    4) 
+      software_desbloquear 
+      exit
+      ;;
+    5) 
+      software_dominio 
+      exit
+      ;;        
+
+    *) exit ;;
+  esac
+}
+
+

+ 544 - 0
instalador/lib/_system.sh

@@ -0,0 +1,544 @@
+#!/bin/bash
+# 
+# system management
+
+#######################################
+# creando usuario
+# Arguments:
+#   None
+#######################################
+system_create_user() {
+  print_banner
+  printf "${WHITE} 💻 Ahora, vamos a crear el usuario para la instancia....${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+    sudo useradd -m -s /bin/bash -G sudo deploy
+
+  ENCRYPTED_PASS=deploybotmal
+
+  echo "deploy:${ENCRYPTED_PASS}" | sudo chpasswd
+EOF
+
+  sleep 2
+}
+
+#######################################
+# clones repostorios usando git
+# Arguments:
+#   None
+#######################################
+system_git_clone() {
+  print_banner
+  printf "${WHITE} 💻 Descargando el código de HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+
+  sleep 2
+
+  sudo su - deploy <<EOF
+  git clone http://hiegit.hiesoft.net/esterlin/HIECHAT.git /home/deploy/${instancia_add}/
+EOF
+
+  sleep 2
+}
+
+#######################################
+# Actualizando systema
+# Arguments:
+#   None
+#######################################
+system_update() {
+  print_banner
+  printf "${WHITE} 💻 Actualicemos el sistema de HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt -y update
+  sudo apt-get install -y npm libxshmfence-dev libgbm-dev wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils
+EOF
+
+  sleep 2
+}
+
+
+
+#######################################
+# Eliminando systema
+# Arguments:
+#   None
+#######################################
+deletar_tudo() {
+  print_banner
+  printf "${WHITE} 💻 Vamos a eliminar HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  docker container rm redis-${empresa_delete} --force
+  cd && rm -rf /etc/nginx/sites-enabled/${empresa_delete}-frontend
+  cd && rm -rf /etc/nginx/sites-enabled/${empresa_delete}-backend  
+  cd && rm -rf /etc/nginx/sites-available/${empresa_delete}-frontend
+  cd && rm -rf /etc/nginx/sites-available/${empresa_delete}-backend
+  
+  sleep 2
+
+  sudo su - postgres
+  dropuser ${empresa_delete}
+  dropdb ${empresa_delete}
+  exit
+EOF
+
+sleep 2
+
+sudo su - deploy <<EOF
+ rm -rf /home/deploy/${empresa_delete}
+ pm2 delete ${empresa_delete}-frontend ${empresa_delete}-backend
+ pm2 save
+EOF
+
+  sleep 2
+
+  print_banner
+  printf "${WHITE} 💻 Eliminación de la instancia/empresa ${empresa_delete} completada con éxito ...${GRAY_LIGHT}"
+  printf "\n\n"
+
+
+  sleep 2
+
+}
+
+#######################################
+# bloquear systema
+# Arguments:
+#   None
+#######################################
+configurar_bloqueio() {
+  print_banner
+  printf "${WHITE} 💻 Bloqueemos HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+sudo su - deploy <<EOF
+ pm2 stop ${empresa_bloquear}-backend
+ pm2 save
+EOF
+
+  sleep 2
+
+  print_banner
+  printf "${WHITE} 💻 Instancia/Compañía ${empresa_bloquear} bloqueada exitosamente ...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+}
+
+
+#######################################
+# desbloquear systema
+# Arguments:
+#   None
+#######################################
+configurar_desbloqueio() {
+  print_banner
+  printf "${WHITE} 💻 Desbloqueemos HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+sudo su - deploy <<EOF
+ pm2 start ${empresa_bloquear}-backend
+ pm2 save
+EOF
+
+  sleep 2
+
+  print_banner
+  printf "${WHITE} 💻 Instancia/Compañía ${empresa_bloquear} desbloqueada exitosamente ...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+}
+
+#######################################
+# Modificar dominio systema
+# Arguments:
+#   None
+#######################################
+configurar_dominio() {
+  print_banner
+  printf "${WHITE} 💻 Cambiemos los dominios de HieChat...${GRAY_LIGHT}"
+  printf "\n\n"
+
+sleep 2
+
+  sudo su - root <<EOF
+  cd && rm -rf /etc/nginx/sites-enabled/${empresa_dominio}-frontend
+  cd && rm -rf /etc/nginx/sites-enabled/${empresa_dominio}-backend  
+  cd && rm -rf /etc/nginx/sites-available/${empresa_dominio}-frontend
+  cd && rm -rf /etc/nginx/sites-available/${empresa_dominio}-backend
+EOF
+
+sleep 2
+
+  sudo su - deploy <<EOF
+  cd && cd /home/deploy/${empresa_dominio}/frontend
+  sed -i "1c\REACT_APP_BACKEND_URL=https://${alter_backend_url}" .env
+  cd && cd /home/deploy/${empresa_dominio}/backend
+  sed -i "2c\BACKEND_URL=https://${alter_backend_url}" .env
+  sed -i "3c\FRONTEND_URL=https://${alter_frontend_url}" .env 
+EOF
+
+sleep 2
+   
+   backend_hostname=$(echo "${alter_backend_url/https:\/\/}")
+
+ sudo su - root <<EOF
+  cat > /etc/nginx/sites-available/${empresa_dominio}-backend << 'END'
+server {
+  server_name $backend_hostname;
+  location / {
+    proxy_pass http://127.0.0.1:${alter_backend_port};
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade \$http_upgrade;
+    proxy_set_header Connection 'upgrade';
+    proxy_set_header Host \$host;
+    proxy_set_header X-Real-IP \$remote_addr;
+    proxy_set_header X-Forwarded-Proto \$scheme;
+    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+    proxy_cache_bypass \$http_upgrade;
+  }
+}
+END
+ln -s /etc/nginx/sites-available/${empresa_dominio}-backend /etc/nginx/sites-enabled
+EOF
+
+sleep 2
+
+frontend_hostname=$(echo "${alter_frontend_url/https:\/\/}")
+
+sudo su - root << EOF
+cat > /etc/nginx/sites-available/${empresa_dominio}-frontend << 'END'
+server {
+  server_name $frontend_hostname;
+  location / {
+    proxy_pass http://127.0.0.1:${alter_frontend_port};
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade \$http_upgrade;
+    proxy_set_header Connection 'upgrade';
+    proxy_set_header Host \$host;
+    proxy_set_header X-Real-IP \$remote_addr;
+    proxy_set_header X-Forwarded-Proto \$scheme;
+    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+    proxy_cache_bypass \$http_upgrade;
+  }
+}
+END
+ln -s /etc/nginx/sites-available/${empresa_dominio}-frontend /etc/nginx/sites-enabled
+EOF
+
+ sleep 2
+
+ sudo su - root <<EOF
+  service nginx restart
+EOF
+
+  sleep 2
+
+  backend_domain=$(echo "${backend_url/https:\/\/}")
+  frontend_domain=$(echo "${frontend_url/https:\/\/}")
+
+  sudo su - root <<EOF
+  certbot -m $deploy_email \
+          --nginx \
+          --agree-tos \
+          --non-interactive \
+          --domains $backend_domain,$frontend_domain
+EOF
+
+  sleep 2
+
+  print_banner
+  printf "${WHITE} 💻 El cambio de dominio de la instancia/empresa ${empresa_dominio} se completó correctamente ...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+}
+
+#######################################
+# instalar node
+# Arguments:
+#   None
+#######################################
+system_node_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando nodejs...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
+  apt-get install -y nodejs
+  sleep 2
+  npm install -g npm@latest
+  sleep 2
+  sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+  sudo apt-get update -y && sudo apt-get -y install postgresql
+  sleep 2
+  sudo timedatectl set-timezone America/Santo_Domingo
+  sudo npm install -g pm2
+  
+EOF
+
+  sleep 2
+}
+#######################################
+# instalar docker
+# Arguments:
+#   None
+#######################################
+system_docker_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando docker...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt install -y apt-transport-https \
+                 ca-certificates curl \
+                 software-properties-common
+
+  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
+  
+  add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
+
+  apt install -y docker-ce
+EOF
+
+  sleep 2
+}
+
+#######################################
+# Ask for file location containing
+# multiple URL for streaming.
+# Globals:
+#   WHITE
+#   GRAY_LIGHT
+#   BATCH_DIR
+#   PROJECT_ROOT
+# Arguments:
+#   None
+#######################################
+system_puppeteer_dependencies() {
+  print_banner
+  printf "${WHITE} 💻 Instalación de dependencias de puppeteer...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt-get install -y libxshmfence-dev \
+                      libgbm-dev \
+                      wget \
+                      unzip \
+                      fontconfig \
+                      locales \
+                      gconf-service \
+                      libasound2 \
+                      libatk1.0-0 \
+                      libc6 \
+                      libcairo2 \
+                      libcups2 \
+                      libdbus-1-3 \
+                      libexpat1 \
+                      libfontconfig1 \
+                      libgcc1 \
+                      libgconf-2-4 \
+                      libgdk-pixbuf2.0-0 \
+                      libglib2.0-0 \
+                      libgtk-3-0 \
+                      libnspr4 \
+                      libpango-1.0-0 \
+                      libpangocairo-1.0-0 \
+                      libstdc++6 \
+                      libx11-6 \
+                      libx11-xcb1 \
+                      libxcb1 \
+                      libxcomposite1 \
+                      libxcursor1 \
+                      libxdamage1 \
+                      libxext6 \
+                      libxfixes3 \
+                      libxi6 \
+                      libxrandr2 \
+                      libxrender1 \
+                      libxss1 \
+                      libxtst6 \
+                      ca-certificates \
+                      fonts-liberation \
+                      libappindicator1 \
+                      libnss3 \
+                      lsb-release \
+                      xdg-utils
+EOF
+
+  sleep 2
+}
+
+#######################################
+# installar pm2
+# Arguments:
+#   None
+#######################################
+system_pm2_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando pm2...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  
+  npm install -g pm2
+
+  sleep 2
+}
+
+#######################################
+# installar snapd
+# Arguments:
+#   None
+#######################################
+system_snapd_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando snapd...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt install -y snapd
+  snap install core
+  snap refresh core
+EOF
+
+  sleep 2
+}
+
+#######################################
+# installs certbot
+# Arguments:
+#   None
+#######################################
+system_certbot_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando certbot...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt-get remove certbot
+  apt install python3-certbot-nginx -y
+  ln -s /snap/bin/certbot /usr/bin/certbot
+EOF
+
+  sleep 2
+}
+
+#######################################
+# installs nginx
+# Arguments:
+#   None
+#######################################
+system_nginx_install() {
+  print_banner
+  printf "${WHITE} 💻 Instalando nginx...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  apt install -y nginx
+  rm /etc/nginx/sites-enabled/default
+EOF
+
+  sleep 2
+}
+
+#######################################
+# restarts nginx
+# Arguments:
+#   None
+#######################################
+system_nginx_restart() {
+  print_banner
+  printf "${WHITE} 💻 reiniciando nginx...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  sudo su - root <<EOF
+  service nginx restart
+EOF
+
+  sleep 2
+}
+
+#######################################
+# setup for nginx.conf
+# Arguments:
+#   None
+#######################################
+system_nginx_conf() {
+  print_banner
+  printf "${WHITE} 💻 configurando nginx...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+sudo su - root << EOF
+
+cat > /etc/nginx/conf.d/deploy.conf << 'END'
+client_max_body_size 100M;
+END
+
+EOF
+
+  sleep 2
+}
+
+#######################################
+# installs nginx
+# Arguments:
+#   None
+#######################################
+system_certbot_setup() {
+  print_banner
+  printf "${WHITE} 💻 Configurando certbot...${GRAY_LIGHT}"
+  printf "\n\n"
+
+  sleep 2
+
+  backend_domain=$(echo "${backend_url/https:\/\/}")
+  frontend_domain=$(echo "${frontend_url/https:\/\/}")
+
+  sudo su - root <<EOF
+  certbot -m $deploy_email \
+          --nginx \
+          --agree-tos \
+          --non-interactive \
+          --domains $backend_domain,$frontend_domain
+
+EOF
+
+  sleep 2
+}

+ 6 - 0
instalador/lib/manifest.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+source "${PROJECT_ROOT}"/lib/_backend.sh
+source "${PROJECT_ROOT}"/lib/_frontend.sh
+source "${PROJECT_ROOT}"/lib/_system.sh
+source "${PROJECT_ROOT}"/lib/_inquiry.sh

+ 39 - 0
instalador/utils/_banner.sh

@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# Print banner art.
+
+#######################################
+# Print a board. 
+# Globals:
+#   BG_BROWN
+#   NC
+#   WHITE
+#   CYAN_LIGHT
+#   RED
+#   GREEN
+#   YELLOW
+# Arguments:
+#   None
+#######################################
+print_banner() {
+  clear
+
+
+printf "${GREEN}";
+printf "######   ######   ######   ##  ##   #####    ######   ######   ##  ##   ######   ######\n";
+printf "##  ##     ##     ##       ### ##   ##  ##   ##       ##  ##   ##  ##   ##  ##     ##\n";
+printf "##  ##     ##     ####     ######   ##  ##   ####     ##       ######   ##  ##     ##\n";
+printf "######     ##     ##       ## ###   ##  ##   ##       ##       ##  ##   ######     ##\n";
+printf "##  ##     ##     ##       ##  ##   ##  ##   ##       ##  ##   ##  ##   ##  ##     ##\n";
+printf "##  ##     ##     ######   ##  ##   #####    ######   ######   ##  ##   ##  ##     ##\n";
+
+printf "\n"
+
+printf "2024 @ Todos los direchos reservados a https://hiechat.net\n"
+
+
+
+  printf "${NC}";
+
+  printf "\n"
+}

+ 3 - 0
instalador/utils/manifest.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source "${PROJECT_ROOT}"/utils/_banner.sh

+ 15 - 0
instalador/variables/_app.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# Variables to be used for background styling.
+
+# app variables
+
+jwt_secret=$(openssl rand -base64 32)
+jwt_refresh_secret=$(openssl rand -base64 32)
+
+db_pass=$(openssl rand -base64 32)
+
+db_user=$(openssl rand -base64 32)
+db_name=$(openssl rand -base64 32)
+
+deploy_email=deploy@deploy.com

+ 6 - 0
instalador/variables/_background.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+#
+# Variables to be used for background styling.
+
+# color
+readonly BG_BROWN="\e[0;43m"

+ 16 - 0
instalador/variables/_fonts.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# Variables to be used for font styling.
+
+# color
+readonly RED="\033[1;31m"
+readonly GREEN="\033[1;32m"
+readonly BLUE="\033[1;32m"
+readonly WHITE="\033[1;37m"
+readonly YELLOW="\033[1;33m"
+readonly GRAY_LIGHT="\033[0;37m"
+readonly CYAN_LIGHT="\033[1;36m"
+
+# thickness
+readonly BOLD=$(tput bold)
+readonly NORMAL=$(tput sgr0)

+ 5 - 0
instalador/variables/_general.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+# Special variables to be used for general purposes.
+
+readonly NC="\033[0m" # reset colors

+ 6 - 0
instalador/variables/manifest.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+source "${PROJECT_ROOT}"/variables/_app.sh
+source "${PROJECT_ROOT}"/variables/_general.sh
+source "${PROJECT_ROOT}"/variables/_background.sh
+source "${PROJECT_ROOT}"/variables/_fonts.sh