Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ El desplegament de la Demo s'ha automatitzat amb l'execució de dues comandes i
Des del directori de l'usuari instal·lador:

```bash
wget -q -O install_docker.sh https://raw.githubusercontent.com/rafatecno1/django-aula/refs/heads/master/docker/install_docker.sh && \
wget -q -O install_docker.sh https://raw.githubusercontent.com/ctrl-alt-d/django-aula/refs/heads/master/docker/install_docker.sh && \
chmod +x install_docker.sh && \
sudo ./install_docker.sh
```
Expand All @@ -78,7 +78,7 @@ Es recomana crear un subdirectori dins el directori de l'usuari instal·lador pe

```bash
mkdir demo-djau-docker && cd demo-djau-docker && \
wget -q -O install_quick_demo_docker.sh https://raw.githubusercontent.com/rafatecno1/django-aula/refs/heads/master/docker/install_quick_demo_docker.sh && \
wget -q -O install_quick_demo_docker.sh https://raw.githubusercontent.com/ctrl-alt-d/django-aula/refs/heads/master/docker/install_quick_demo_docker.sh && \
chmod +x install_quick_demo_docker.sh && \
bash ./install_quick_demo_docker.sh
```
Expand Down
2 changes: 1 addition & 1 deletion docker/build-dev/docker-compose.demo.manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
restart: always

web:
image: rafatecno1/django-aula:demo
image: django_aula:latest
container_name: demo_web
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.demo.automatica.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
restart: always

web:
image: rafatecno1/django-aula:demo
image: django_aula:latest
container_name: demo_web
# build:
# context: .
Expand Down
2 changes: 1 addition & 1 deletion docker/install_quick_demo_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# --- 1. Informació del repositori ---

REPO="rafatecno1/django-aula"
REPO="ctrl-alt-d/django-aula"
BRANCA="master"
URL_BASE="https://raw.githubusercontent.com/${REPO}/refs/heads/${BRANCA}/docker"

Expand Down
7 changes: 0 additions & 7 deletions docs/USER_MANUAL/demo/construccio_imatge_demo_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,11 @@ El projecte fa servir l'arxiu `Makefile` com a capa d'abstracció. Aixó signifi

La següent comanda clonarà el repositori i crearà una carpeta anomenada `django-aula`.

```bash
git clone https://github.com/rafatecno1/django-aula.git demo-django-aula
cd demo-django-aula
```

> En el repositori oficial aniria així:
```bash
git clone https://github.com/ctrl-alt-d/django-aula.git django-aula
cd django-aula
```


Dins el repositori trobarem el directori `docker` que conté tots els arxius relacionats amb aquest entorn. Haurem de copiar els que necessitem al directori arrel del projecte clonat.

<a name="id212"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/USER_MANUAL/demo/install_demo_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cd demo-djau-docker
Un cop creat el directori on s'instal·larà la Demo només caldrà descarregar el script automatitzat d'instal·lació. Amb la comanda següent no només es descarrega l'arxiu sinó que començarà a executar-se automàticament:

```bash
wget -q -O install_quick_demo_docker.sh https://raw.githubusercontent.com/rafatecno1/django-aula/refs/heads/master/docker/install_quick_demo_docker.sh && chmod +x install_quick_demo_docker.sh && bash ./install_quick_demo_docker.sh
wget -q -O install_quick_demo_docker.sh https://raw.githubusercontent.com/ctrl-alt-d/django-aula/refs/heads/master/docker/install_quick_demo_docker.sh && chmod +x install_quick_demo_docker.sh && bash ./install_quick_demo_docker.sh
```

<a name="id2"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/USER_MANUAL/demo/install_entorn_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Cal tenir en commpte que **És un pas obligatori per dur a terme qualsevol opera
<a name="id2"></a>
## 2. Procés automatitzat d'Instal·lació de l'entorn Docker (Recomanat)

Per instal·lar l'entorn de Docker no cal crear cap directori expressament. Podem fer-ho a l'arrel del directori del nostre usuari perqué només caldrà descarregar-se un scriipt que executarà tot el procés d'instal·lació i preparació del sistema.
Per instal·lar l'entorn de Docker no cal crear cap directori expressament. Podem fer-ho a l'arrel del directori del nostre usuari perquè només caldrà descarregar-se un script que executarà tot el procés d'instal·lació i preparació del sistema.

La instrucció a executar per descarregar i executar el script d'instal·lació automatitzada és:

```bash
wget -q -O install_docker.sh https://raw.githubusercontent.com/rafatecno1/django-aula/refs/heads/master/docker/install_docker.sh && chmod +x install_docker.sh && sudo ./install_docker.sh
wget -q -O install_docker.sh https://raw.githubusercontent.com/ctrl-alt-d/django-aula/refs/heads/master/docker/install_docker.sh && chmod +x install_docker.sh && sudo ./install_docker.sh
```

<a name="id3"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/install_djau_automatic_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ També clona el repositori de Django-Aula i instal·la altres eines administrati
Des del directori del compte d'usuari creat amb permisos `sudo` cal executar la següent instrucció, que descarregarà i executarà, només, el script `install_djau.sh`.

```bash
wget -q -O install_djau.sh https://raw.githubusercontent.com/rafatecno1/django-aula/refs/heads/master/install_djau.sh && chmod +x install_djau.sh && sudo ./install_djau.sh
wget -q -O install_djau.sh https://raw.githubusercontent.com/ctrl-alt-d/django-aula/refs/heads/master/install_djau.sh && chmod +x install_djau.sh && sudo ./install_djau.sh
```

#### Execució de `install_djau.sh`
Expand Down
26 changes: 12 additions & 14 deletions install_djau.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ clear

# 1. Definició de variables
# Repositori i branca per la clonació
REPO_URL="https://github.com/rafatecno1/django-aula.git"
GIT_BRANCH="master"
#REPO_URL="https://github.com/ctrl-alt-d/django-aula.git" # repositori del projecte
#GIT_BRANCH="master" @ Si es vol instal·lar una branca concreta. Exemple: "feat/upgrade-bootstrap"
REPO_URL="https://github.com/ctrl-alt-d/django-aula.git" # repositori del projecte
GIT_BRANCH="master" # Si es vol instal·lar una branca concreta. Exemple: "feat/upgrade-bootstrap"

# Definició de sistema d'inicialització de processos del Sistema Operatiiu (SysVinit vs Systemd)
IS_SYSTEMD=0 # Per defecte, assumim que no és systemd (Devuan, etc.)
# Definició de sistema d'inicialització de processos del Sistema Operatiu (SysVinit vs Systemd)
IS_SYSTEMD=0 # Per defecte, assumim que no és systemd (Debian, etc.)

if command -v systemctl >/dev/null 2>&1; then
# La comanda systemctl s'ha trobat: és un sistema amb systemd (Debian, Ubuntu o derivats)
Expand Down Expand Up @@ -68,7 +66,7 @@ rm "$FUNCTIONS_FILE"
if [ $? -ne 0 ]; then
echo -e "${C_ERROR}❌ ADVERTÈNCIA:Per alguna raó desconeguda no s'ha pogut eliminar l'arxiu temporal de funcions${RESET} ${C_INFO} '$FUNCTIONS_FILE'${RESET} ${${C_ERROR}}. Caldria fer-ho manualment.${RESET}"
else
echo -e "${C_EXITO}❌ Un cop importat el contingut de la l'arxiu temporal de funcions s'ha proceit a la seva automàtica eliminació.${RESET}"
echo -e "${C_EXITO}❌ Un cop importat el contingut de la l'arxiu temporal de funcions s'ha procedit a la seva automàtica eliminació.${RESET}"
fi

echo -e "\n\n"
Expand Down Expand Up @@ -548,7 +546,7 @@ sleep 3


# -------------------------------------------------------------------------------------------------
# CREACIÓ DE L'ARxiu config_vars.sh AMB LES VARIABLES COMUNS PER LA INSTAL·LACIÓ DE L'APLICACIÓ
# CREACIÓ DE L'ARXIU config_vars.sh AMB LES VARIABLES COMUNS PER LA INSTAL·LACIÓ DE L'APLICACIÓ
# -------------------------------------------------------------------------------------------------

SETUP_DIR="$FULL_PATH/setup_djau"
Expand Down Expand Up @@ -579,17 +577,17 @@ echo -e "${C_CAPITULO}--- 5. INICI DE LA CONFIGURACIÓ ESPECÍFICA DE DJANGO-AUL
echo -e "${C_CAPITULO}=============================================================${RESET}"
echo -e "\n"

echo -e "--- A partir d'ara, l'usuari ${C_INFO}'$APP_USER'${RESET} executarà autmáticamente l'script ${C_INFO}setup_djau.sh${RESET}."
echo -e "--- A partir d'ara, l'usuari ${C_INFO}'$APP_USER'${RESET} executarà automàticament l'script ${C_INFO}setup_djau.sh${RESET}."
echo -e " Aquest script es troba a ${C_INFO}'$SETUP_DIR'${RESET}."
echo -e "\n"

# Transferint l'execució a l'script de configuració de Django-Aula DINS el repositori i branca clonats
cd "$SETUP_DIR"
chmod +x setup_djau.sh
chmod +x setup_apache.sh
chmod +x setup_cron.sh
chmod +x functions.sh
chown "$APP_USER":"$APP_USER" functions.sh
#chmod +x setup_djau.sh
#chmod +x setup_apache.sh
#chmod +x setup_cron.sh
#chmod +x functions.sh
#chown "$APP_USER":"$APP_USER" functions.sh

echo -e "${C_INFO}ℹ️ **ATENCIÓ:**${RESET} La instal·lació no serà desatesa. Haurà de respondre preguntes per configurar la base de dades i l'aplicatiu."
echo -e "\n"
Expand Down
Empty file modified setup_djau/functions.sh
100644 → 100755
Empty file.
11 changes: 2 additions & 9 deletions setup_djau/setup_apache.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,14 @@ echo -e "${C_CAPITULO}--- 4. AJUST DE PERMISOS DE www-data (WSGI) ---"
echo -e "${C_CAPITULO}===============================================${RESET}"
echo -e "\n"

# 1. www-data ha de poder llegir i executar tots els directoris (X) i arxius (r) dins del VENV ($VENV_PATH) i el projecte ($FULL_PATH).
# Aquest pas és molt important perquè el VENV el va crear l'usuari '$APP_USER'.
chmod -R a+rX "$VENV_PATH"
chmod -R a+rX "$FULL_PATH"
echo -e "${C_EXITO}✅ Permisos de lectura/execució assignats al Venv i codi font.${RESET}"

# 2. Permisos del DIRECTORI DE DADES PRIVADES (Cal Lectura/Escriptura)
# 1. Permisos del DIRECTORI DE DADES PRIVADES (Cal Lectura/Escriptura)
# S'assigna el grup 'www-data' amb permisos de lectura/escriptura (770) al grup.
chown -R "$APP_USER":www-data "$PATH_DADES_PRIVADES"
chmod 770 "$PATH_DADES_PRIVADES"
echo -e "${C_EXITO}✅ Permisos per a dades privades assignats a '$APP_USER':www-data (chmod 770).${RESET}"

# 3. Assignar el grup www-data al projecte
# 2. Assignar el grup www-data al projecte
chown -R "$APP_USER":www-data "$FULL_PATH"
chmod -R g+rx "$FULL_PATH"
echo -e "${C_EXITO}✅️ Grup 'www-data' assignat al directori del projecte.${RESET}"
echo -e "\n\n"

Expand Down
Empty file modified setup_djau/setup_cron.sh
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions setup_djau/setup_djau.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ echo -e "\n"
echo -e "${C_SUBTITULO}--- 3.5 Opcions avançades de configuracó (settings_local.py) ---${RESET}"
echo -e "${C_SUBTITULO}----------------------------------------------------------------${RESET}"

echo -e "${C_INFO}ℹ️ A continuació es poden afegir al fitxer ${NEGRITA}settings_local.py$${RESET}els paràmetres de configuració addicionals (comentats amb el símbol (#).${RESET}"
echo -e "${C_INFO}ℹ️ A continuació es poden afegir al fitxer ${NEGRITA}settings_local.py els paràmetres de configuració addicionals (comentats amb el símbol (#).${RESET}"

echo -e "${C_INFO} Aquests paràmetres inclouen ${NEGRITA}funcionalitats que poden ser clau per l'aplicatiu${RESET}${C_INFO} com ara:${RESET}"
echo -e "${C_INFO} * ${NEGRITA}Llindars d'alerta automàtica${RESET}${C_INFO} (p. ex., faltes d'assistència que generen avisos).${RESET}"
Expand All @@ -364,7 +364,7 @@ echo -e "${C_INFO} ${NEGRITA}Recomanació:${RESET} Generalment, és millor inc
echo -e "\n"

# --- OPCIONS AVANÇADES DE CONFIGURACIÓ ---
read_prompt "⚙️ Voleu afegir les opcions de parametrització avançada , omentades amb el símbol #, a settings_local.py? (per defecte SI) [SI/no]: " ADVANCED_PARAMS_CHOICE "SI"
read_prompt "⚙️ Voleu afegir les opcions de parametrització avançada, comentades amb el símbol #, a settings_local.py? (per defecte SI) [SI/no]: " ADVANCED_PARAMS_CHOICE "SI"
ADVANCED_PARAMS_CHOICE_LOWER=$(echo "$ADVANCED_PARAMS_CHOICE" | tr '[:upper:]' '[:lower:]')

if [[ "$ADVANCED_PARAMS_CHOICE_LOWER" == "s" || "$ADVANCED_PARAMS_CHOICE_LOWER" == "si" ]]; then
Expand Down Expand Up @@ -594,7 +594,7 @@ echo -e "\n"

# 1. Donar permisos d'execució al nou script
cd "$SETUP_DIR"
chmod +x ./test_email.sh
#chmod +x ./test_email.sh

read_prompt "¿Vol executar l'script de prova de correu (./test_email.sh) ara? Per defecte NO. (sí/NO): " TEST_EMAIL_NOW "no"

Expand Down
Empty file modified setup_djau/test_email.sh
100644 → 100755
Empty file.