Commit e7a62817 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Mise en place du .ENV en cours

 - Version "Oscar Docker PROD" en cours
parent 3db7b04c
Loading
Loading
Loading
Loading
Loading
+76 −11
Original line number Diff line number Diff line
@@ -8,22 +8,80 @@
# 1. SERVICES TIERS

## Serveur ElasticSearch
SERVICE_ELASTIC_ADDR="localhost:9200"
SERVICE_ELASTIC_ADDR="oscar_ripley_prod_elasticsearch"


## Serveur Gearman
SERVICE_GEARMAN_ADDR="localhost"
SERVICE_GEARMAN_ADDR="oscar_ripley_prod_gearman"


## Base de données POSTGRESQL
SERVICE_POSTGRESQL_HOST="localhost"
SERVICE_POSTGRESQL_USER="oscar"
SERVICE_POSTGRESQL_PASS="azerty"
SERVICE_POSTGRESQL_HOST="xxx"
SERVICE_POSTGRESQL_USER="xxx"
SERVICE_POSTGRESQL_PASS=""
SERVICE_POSTGRESQL_PORT=5432
SERVICE_POSTGRESQL_BASE="oscar_caen_prod_202409"
SERVICE_POSTGRESQL_BASE="oscar_db"


## ACCES LDAP (Unicaen APP)
### Accès au serveur
SERVICE_LDAP_HOST="xxx"
SERVICE_LDAP_PORT=389
SERVICE_LDAP_USERNAME='uid=oscar,ou=system,dc=unicaen,dc=fr'
SERVICE_LDAP_PASSWORD='xxx'
SERVICE_LDAP_BASE_DN='ou=people,dc=unicaen,dc=fr'
SERVICE_LDAP_BIND_REQUIRES_DN='ou=people,dc=unicaen,dc=fr'
SERVICE_LDAP_ACCOUNT_FILTER_FORMAT='(&(objectClass=posixAccount)(supannAliasLogin=%s))'

### DN
SERVICE_LDAP_DN_UTILISATEURS_BASE_DN="ou=people,dc=unicaen,dc=fr"
SERVICE_LDAP_DN_UTILISATEURS_DESACTIVES_BASE_DN="ou=deactivated,dc=unicaen,dc=fr"
SERVICE_LDAP_DN_GROUPS_BASE_DN="ou=groups,dc=unicaen,dc=fr"
SERVICE_LDAP_DN_STRUCTURES_BASE_DN="ou=structures,dc=unicaen,dc=fr"

### Filtres
SERVICE_LDAP_FILTERS_LOGIN_FILTER="supannAliasLogin=%s)"
SERVICE_LDAP_FILTERS_UTILISATEUR_STD_FILTER="(uid=p*)(&(uid=e*)(eduPersonAffiliation=student)))"
SERVICE_LDAP_FILTERS_CN_FILTER="(cn=%s)"
SERVICE_LDAP_FILTERS_NAME_FILTER="(cn=%s*)"
SERVICE_LDAP_FILTERS_UID_FILTER="(uid=%s)"
SERVICE_LDAP_FILTERS_NO_INDIVIDU_FILTER="(supannEmpId=%08s)"
SERVICE_LDAP_FILTERS_AFFECTATION_FILTER="(uid=*)(eduPersonOrgUnitDN=%s))"
SERVICE_LDAP_FILTERS_AFFECTATION_CSTRUCT_FILTER="(uid=*)(|(ucbnSousStructure=%s;*)(supannAffectation=%s;*)))"
SERVICE_LDAP_FILTERS_LOGIN_OR_NAME_FILTER="(supannAliasLogin=%s)(cn=%s*))"
SERVICE_LDAP_FILTERS_MEMBERSHIP_FILTER="(memberOf=%s)"
SERVICE_LDAP_FILTERS_AFFECTATION_ORG_UNIT_FILTER="(eduPersonOrgUnitDN=%s)"
SERVICE_LDAP_FILTERS_AFFECTATION_ORG_UNIT_PRIMARY_FILTER="(eduPersonPrimaryOrgUnitDN=%s)"
SERVICE_LDAP_FILTERS_ROLE_FILTER="(supannRoleEntite=[role={SUPANN}%s][type={SUPANN}%s][code=%s]*)"
SERVICE_LDAP_FILTERS_PROF_STRUCTURE="(eduPersonAffiliation=teacher)(eduPersonOrgUnitDN=%s))"
SERVICE_LDAP_FILTERS_FILTER_STRUCTURE_DN="%s)"
SERVICE_LDAP_FILTERS_FILTER_STRUCTURE_CODE_ENTITE="(supannCodeEntite=%s)"
SERVICE_LDAP_FILTERS_FILTER_STRUCTURE_CODE_ENTITE_PARENT="(supannCodeEntiteParent=%s)"

## AUTHENTIFICATION (Unicaen AUTH)
### Local
UNICAEN_AUTH_LOCAL_ENABLED=true
UNICAEN_AUTH_LOCAL_ORDER=2
UNICAEN_AUTH_LOCAL_DESCRIPTION="Utilisez ce formulaire avec un compte LDAP ou Local"
UNICAEN_AUTH_LOCAL_DB_ENABLED=true
UNICAEN_AUTH_LOCAL_LDAP_ENABLED=true

### CAS
UNICAEN_AUTH_CAS_ENABLED=true
UNICAEN_AUTH_CAS_CONNECTION_HOST="cas.unicaen.fr"
UNICAEN_AUTH_CAS_CONNECTION_PORT=443
UNICAEN_AUTH_CAS_CONNECTION_VERSION="2.0"
UNICAEN_AUTH_CAS_CONNECTION_URI=""
UNICAEN_AUTH_CAS_CONNECTION_DEBUG=false

### Divers
UNICAEN_AUTH_USURPATIONS="[\"bouvry\",\"fery\"]"


## Accès dépenses (SIFAC)
SERVICE_SPENT_HOST="localhost"
SERVICE_SPENT_USER="oscar"
SERVICE_SPENT_PASS="azerty"
SERVICE_SPENT_PASS="xxxx"
SERVICE_SPENT_SID="oscar"
SERVICE_SPENT_PORT=5432
SERVICE_SPENT_QUERY=""
@@ -49,7 +107,8 @@ NOTIFICATIONS_FIXED='["Mer8","Lun20"]'
# 3. GENERAL

## URL Publique (utilisée pour créer des URL absolues dans les messages/notifications)
OSCAR_URL="http://localhost"
OSCAR_URL="http://localhost:8888"
OSCAR_APP_NAME="LASCAR"


########################################################################################################################
@@ -57,9 +116,10 @@ OSCAR_URL="http://localhost"

MAILER_TRANSPORT_TYPE="file"
MAILER_TRANSPORT_FILE_PATH="./data/mails"
MAILER_FROM='["oscar-bot@unicaen.fr" : "Oscar BOT"]'
MAILER_FROM_MAIL="oscar-bot@unicaen.fr"
MAILER_FROM_NAME="Oscar BOT"
MAILER_SEND=true
MAILER_SEND_EXCEPTION=true
MAILER_SEND_EXCEPTION="[]"
MAILER_SUBJECT_PREFIX="[OSCAR DEMO]"
MAILER_TEMPLATE="./modules/Oscar/view/mail.html"
MAILER_ADMINISTRATORS='["stephane.bouvry@unicaen.fr"]'
@@ -83,5 +143,10 @@ LGO_STDOUT_ENABLED=true
VITE_MODE="prod"
VITE_SRC="./ui"
VITE_DEST="./public/js/oscar/vite/dist"
VITE_URL_DEV="http://localhost:5173"
VITE_URL_DEV="http://test:5173"
VITE_URL_PROD="/js/oscar/vite/dist"

## DOCKER
DOCKER_OSCAR_PORT=8888
PROXY=""
OSCAR_SRC=./
 No newline at end of file
+5 −1
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@

## Documentation

[Documentation technique](doc/index.md)
[Changelog](./CHANGELOG.md) : Historique des changements (depuis Octobre 2024)

[Documentation technique](doc/index.md) : Toutes la documentation pour installer, mettre à jour et configurer Oscar

[Note de Développement](./dev/README.md) : Travaux en cours / Notes techniques

+28 −4
Original line number Diff line number Diff line
<?php

$config = array(
    'modules' => array(

@@ -42,12 +43,35 @@ $config = array(
    ),
);

if (PHP_SAPI == 'cli') {
    unset($config['modules'][array_search('BjyAuthorize', $config['modules'])]);
////////////////////////////////////////////////////////////////////////
/// CONFIGURATION .env
$envFile = realpath(__DIR__ . '/../');
$de = \Dotenv\Dotenv::createImmutable(__DIR__.'/../');
$de->load();

if(! function_exists('dotEnv') ){
    function dotEnv(string $varname, bool $isJson = false)
    {
        $value = $_SERVER[$varname];
        if( $isJson ){
            $value = json_encode($value, true);
        }
        return $value;

if( getenv('APPLICATION_ENV') == 'development' ){
    $config['modules'][] = 'Laminas\DeveloperTools';
    }
    function dotEnvRequired( string $varname, bool $isJson = false ): mixed
    {
        if( !array_key_exists($varname, $_SERVER) ) {
            throw new RuntimeException(sprintf("La variable d'environnement '$varname' n'existe pas"));
        }
        return dotEnv($varname, $isJson);
    }
}

////////////////////////////////////////////////////////////////////////
///
if (PHP_SAPI == 'cli') {
    unset($config['modules'][array_search('BjyAuthorize', $config['modules'])]);
}

return $config;
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ Bienvenue dans la **Documentation technique** du projet **O.S.C.A.R**.

## Installation et maintenance

S'adresse aux gestionnaires d'application souhaitant installer et configurer une instance d'oscar.
>Cette documentation s'adresse aux gestionnaires d'application souhaitant installer et configurer une instance d'oscar.

### Installation de base

+2 −7
Original line number Diff line number Diff line
@@ -224,10 +224,6 @@ composer install --prefer-dist

Composer se chargera d'installer les dépendances PHP tel de définies dans le fichier `composer.json`.

Sous Ubuntu il est possible que ce paquet bcmath bloque, dans ce cas, ajouter cette commande
```
apt install php8.2*-bcmath
```


## Gestionnaire de tâche (via Gearman)
@@ -528,7 +524,6 @@ ln -s ../path/to/oscar/public oscar
S'assurer que les dossiers :

 - `./data/`
 - Le dossier choisi pour l'index Lucene (si c'est l'indexeur choisi)
 - Le dossier de stockage des documents
 - Le dossier de log `./logs`  
 - Le fichier de log `./logs/oscar.log`
@@ -718,7 +713,7 @@ Pour les copies de développement/préprod, l'option `usurpation_allowed_usernam
permet de s'identifier à la place d'un utilisateur.

On utilise l'identifiant `compte=compteusurpation` où `compte` correspond à
l'identifiant principale (qui doit figurer dans le tableau `usurpation_allowed_usernames`),
l'identifiant principal (qui doit figurer dans le tableau `usurpation_allowed_usernames`),
et `compteusurpation` correspond au compte usurpé. Le mot de passe est celui de `compte`.

Cette option n'est pas compatible avec l'identification CAS.
@@ -739,7 +734,7 @@ dédié en utilisant l'utilitaire en ligne de commande.
Rendez-vous à la racine de l'application :

```bash
cd /var/oscar_path
cd /var/oscar
```

Puis on commence par créer un compte d'autentification :
Loading