Projet Protocoles de sécurité GL4
I have tried sooo many variations that I have conflicts when starting docker containers, that's why I need to delete the containers and volumes each time :
docker rm $(docker ps -a -q)docker volume rm $(docker volume ls -q)
After that :
-
Start the authentication services
docker-compose up ldap phpldapadmin database adminer
- phpLDAPAdmin (LDAP management) will be available at
https://localhost:8081 - adminer (PostgreSQL management) will be available at
http://localhost:8082
- phpLDAPAdmin (LDAP management) will be available at
-
Create your first user by accessing phpLDAPAdmin at
https://localhost:8081- login with DN:
cn=admin,dc=insat,dc=comPassword:adminpwd - create a
Generic : Posix Groupindc=insat,dc=comnamedUsers - create a
Generic : User Accountwith a GID NumberUsers
- login with DN:
-
NGINX reverse-proxy
We are using NGINX as a reverse proxy so we can have a unique endpoint for our app and API. Else, we would have to open two endpoints : one for the app, the other for the API.
docker-compose up --build -d nginx
NGINX will auto restart until you have started the app and API below.
-
Run the API
The database will be automatically set-up thanks to Flask Migrate and any future modification brought to models will be automatically applied when the API is restarted.
You might wait some time before the database get updated after starting the API :
docker-compose up --build -d api
For development, go to
http://localhost:5000to access the API documentation -
Run the web app
# Expect several minutes for first launch (npm install) docker-compose up --build -d appℹ️ If you want to add a NPM package, just stop & re-launch
docker-compose up app.Open the app at
http://localhost:8080
generate authority key :
openssl genrsa -out AUTH_key -des3 4092generate the certificate for the authority
openssl req -new -x509 -days 3650 -key AUTH_key -out AUTH_cert