jams-react-client: fix react-error-overlay

Change-Id: I56736e0c0d643b1bcd56f93a8bd2af2143d8fe88
2 files changed
tree: 2c9b477bc87b16b16b186e028c8fb7dc59422e58
  1. .gradle/
  2. ad-connector/
  3. api-doc/
  4. authentication-module/
  5. compile-libs/
  6. datastore/
  7. extras/
  8. jami-dht/
  9. jami-nameserver/
  10. jams-ca/
  11. jams-common/
  12. jams-launcher/
  13. jams-react-client/
  14. jams-server/
  15. ldap-connector/
  16. userguide/
  17. .dockerignore
  18. .gitignore
  19. .gitmodules
  20. .gitreview
  21. build-doc.sh
  22. Dockerfile
  23. generate-versions.py
  24. java.properties
  25. pom.xml
  26. README.md
README.md

JAMS (Jami Account Management Server)

Requirements

  • JDK 11+
  • maven

Building from source

Clone the contents of this repository and run

mvn clean package

This will create a distribution folder called jams in the root folder. You can then launch the server by running

cd jams
java -jar jams-launcher.jar

If you want to start the server with an SSL certificate and on a port different from 8080, then run:

java -jar jams-launcher.jar 8443 server.pem server.key

Where the pem and key files are a pem encoded certificate and key.

How to generate server.pem and server.key pair

In order to generate a pair of pem and key use the following command using openssl

openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout server.key -out server.pem

Generate documentation

To generate the documentation you will need apidoc installed on your system. This can be completed by running npm install -g apidoc, if for some reason that does not work, you can clone their project from : https://github.com/apidoc/apidoc and install it from source.

To build the documentation, enter the jams-server directory and simply run:

apidoc -i src/ -o doc/

You can then open doc/index.html. Click on 1.0.0 in the top right corner if the doc doesn't appear.

Pre-commit hook

The extras folder contains a pre-commit hook that formats every js file in jams-react-client. To enable it, run:

cp extras/scripts/pre-commit .git/hooks
chmod +x .git/hooks/pre-commit

Development Docker container

A development environment with react hot reloading can be created using:

docker build -f Dockerfile -t jams:dev --target dev .
docker run -it -p 3000:3000 -p 8080:8080 \
    -v $(pwd)/jams-react-client/src:/app/jams-react-client/src \
    -v $(pwd)/jams-react-client/public:/app/jams-react-client/public \
    --rm jams:dev

Note: It is possible that after 15 minutes, the user's token expires, the server will answer with a "You are not authentified" and forget to put the CORS headers, thus the browser will refuse to read the response. In this case, you will need to restart the server.

Generate jams with Docker

The following commands will generate the userguide and the jars needed:

docker build -f Dockerfile -t jams:latest --target prod . \
    && CONTAINER=$(docker create jams:latest) \
    && docker cp $CONTAINER:/app/jams/. jams \
    && docker cp $CONTAINER:/app/versions.json . \
    && docker rm -v $CONTAINER \
    && cd jams \
    && java -jar jams-launcher.jar

About jams-server/src/main/java/net/jami/jams/server/filters

The files in the filters folder are prefixed "A", "B", "C" and "D" so that the order of execution of the filters are right (jakarta registers filters in alphabetical order).