Modification jeux de données BDD et Création de la barre de navigation

This commit is contained in:
Nicolas MORIN
2022-01-16 15:17:20 +01:00
parent b84c8a1733
commit 7826207b1f
24 changed files with 10396 additions and 38 deletions
+6 -4
View File
@@ -2,11 +2,13 @@
chemin_script=$(dirname "$0")
mkdir -p /etc/postfix/db
rm -f /etc/postfix/db/postfix.sqlite
mkdir -p /etc/postfix/bdd
rm -f /etc/postfix/bdd/postfix.sqlite
# Création des tables
sqlite3 /etc/postfix/db/postfix.sqlite < "${chemin_script}"/postfix.sql
echo "CREATION TABLES"
sqlite3 /etc/postfix/bdd/postfix.sqlite < "${chemin_script}"/postfix_tables.sql
# Création des données
sqlite3 /etc/postfix/db/postfix.sqlite < "${chemin_script}"/données.sql
echo "CREATION DONNÉES"
sqlite3 /etc/postfix/bdd/postfix.sqlite < "${chemin_script}"/postfix_données.sql
@@ -1,20 +1,21 @@
-- Alias (ne doivent pas apparaître)
INSERT INTO postfix_alias (alias,destination,active) VALUES ("toto","test1",1);
INSERT INTO postfix_alias (alias,destination,active) VALUES ("tata","test2",0);
INSERT INTO postfix_alias (alias,destination,active) VALUES ("titi","test3",1);
-- Alias virtuels
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("toto@toto.fr","comptable@toto.fr",1);
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("toto@toto.fr","medecin@toto.fr",0);
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("toto@toto.fr","supermacher@toto.fr",1);
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("tata@toto.fr","fleuriste@toto.fr",0);
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("tata@toto.fr","coiffeur@toto.fr",0);
INSERT INTO postfix_alias_virtuels (courriel,destination,active) VALUES ("titi@toto.fr","promos@toto.fr",1);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("toto@toto.fr","comptable@toto.fr",1);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("toto@toto.fr","medecin@toto.fr",0);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("toto@toto.fr","supermacher@toto.fr",1);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("tata@toto.fr","fleuriste@toto.fr",0);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("tata@toto.fr","coiffeur@toto.fr",0);
INSERT INTO postfix_alias_virtuels (destination,courriel,active) VALUES ("titi@toto.fr","promos@toto.fr",1);
-- Domaines secondaires
INSERT INTO postfix_domaines (domaine,active,defaut) VALUES ("toto.fr",1,1);
INSERT INTO postfix_domaines (domaine,active) VALUES ("tata.fr",1);
INSERT INTO postfix_domaines (domaine,active) VALUES ("titi.fr",0);
INSERT INTO postfix_domaines (domaine,active,defaut) VALUES ("tata.fr",1,0);
INSERT INTO postfix_domaines (domaine,active,defaut) VALUES ("titi.fr",0,0);
-- Listes noires destinataires
INSERT INTO postfix_liste_noire_destinataires (courriel,action,active) VALUES ("root@mail.exemple.fr","REJECT",1);
@@ -27,5 +28,5 @@ INSERT INTO postfix_liste_noire_expediteurs (courriel,code_retour,message,active
INSERT INTO postfix_liste_noire_expediteurs (courriel,code_retour,message,active) VALUES ("roland@tata.fr",554,"Parle à ma main, ma tête est malade.",1);
-- Listes utilisateurs
INSERT INTO postfix_utilisateurs (utilisateur,mot_de_passe,nom_complet,uid,gid,privilege,active) VALUES ("toto","toto","Alphonse Pastacaisse",5000,5000,"administrateur",1);
INSERT INTO postfix_utilisateurs (utilisateur,mot_de_passe,nom_complet,uid,gid,privilege, active) VALUES ("tata", "tata", "Jonathan Quesquiestjaune", 5000, 5000, "utilisateur", 1);
INSERT INTO postfix_utilisateurs (utilisateur,mot_de_passe,nom_complet,rep_perso,uid,gid,privilege,active) VALUES ("toto@exemple.fr","{SHA512-CRYPT}$6$xWfisyC6fLawFcBr$zLm4hfRfs6Pn0RKArnyWcgliBy6lpnRUkDHfHMkvskShfLiv4pRIU6XC5ry0ysd.DeKhoAiZUfnNdmwIai2k50","Toto
Dupont","exemple.fr/toto/",3000,3000,"administrateur",1)
@@ -6,14 +6,14 @@ CREATE TABLE IF NOT EXISTS postfix_alias (
);
CREATE TABLE IF NOT EXISTS postfix_alias_virtuels (
id INTEGER PRIMARY KEY AUTOINCREMENT,
courriel TEXT NOT NULL,
courriel TEXT NOT NULL UNIQUE,
destination TEXT NOT NULL,
active INTEGER
);
CREATE TABLE IF NOT EXISTS postfix_domaines (
id INTEGER PRIMARY KEY AUTOINCREMENT,
domaine TEXT NOT NULL UNIQUE,
defaut INTEGER UNIQUE,
defaut BOOLEAN NOT NULL CHECK (defaut IN (0, 1)),
active INTEGER
);
CREATE TABLE IF NOT EXISTS postfix_liste_noire_destinataires (
@@ -29,13 +29,15 @@ CREATE TABLE IF NOT EXISTS postfix_liste_noire_expediteurs (
message TEXT NOT NULL,
active INTEGER
);
CREATE TABLE IF NOT EXISTS postfix_utilisateurs (
CREATE TABLE postfix_utilisateurs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
utilisateur TEXT NOT NULL UNIQUE,
mot_de_passe TEXT NOT NULL,
nom_complet TEXT,
rep_perso TEXT NOT NULL,
uid INTEGER NOT NULL,
gid INTEGER NOT NULL,
privilege TEXT NOT NULL,
prefixe TEXT,
active INTEGER
);
);