Running a Lean instance on a server is always a potential security risk.
Therefore, this project uses Bubblewrap to run the instance in a container.
You can avoid using bubblewrap by using development mode or by providing NO_BWRAP=true to production mode. In that case, the Lean server will
run without any container on your server.
Depending on the GDPR and laws applying to your server, you will need to provide the following information:
client/config/config.tsx,serverCountry: where your server is located.client/config/config.tsx,contactDetails: used in privacy policy & impressumclient/config/config.tsx,impressum: further legal notes
if contactDetails or impressum are not null, you will see an item Impressum in
the dropdown menu containing that information.
Further, you might need to add the impressum manually to index.html
for people with javascript disabled!
The project is initially designed to run on Ubuntu 22 LTS.
Other OS or distributions have not been tested. PRs to the repo to improve the installation on other distributions are always welcome!
On a running system, you might already have these installed, if not:
- Install NPM: official instructions
- Install Git:
sudo apt-get install git - (optional) Install Bubblewrap:
sudo apt-get install bubblewrap
- Clone this repo:
note that
git clone --recurse-submodules https://github.com/leanprover-community/lean4web.git--recurse-submodulesis needed to load the predefined projects inProjects/. (on an existing clone, you can callgit submodule initandgit submodule update) - Navigate into the cloned repository
cd lean4web - Install dependencies
npm install
- Start the project in development mode
npm start - Go to http://localhost:3000
- Compile the project
npm run build - Start the server
npm run prod - To disable the bubblewrap containers, start the server with
NO_BWRAP=true npm run prod - Start the client seperately, for example with
and open http://localhost:3000
npm run start:client - To set the locations of SSL certificates, use the following environment variables:
SSL_CRT_FILE=/path/to/crt_file.cer SSL_KEY_FILE=/path/to/private_ssl_key.pem npm run prod
You can run any lean project through the webeditor by cloning them to the Projects/ folder. See Adding Projects for further instructions.
The following environment variables can be used to modify the server
For example for npm start, npm start:client.
| name | values | default | description |
|---|---|---|---|
| (none) |
For example for npm start, npm run production, npm run start:server.
| name | values | default | description |
|---|---|---|---|
NO_BWRAP |
true, false |
false |
to disable to use of bubblewrap in production mode. This means Lean runs without any container on your system, which imposes a security risk! |
GITHUB_ACTIONS |
true ,false |
false |
is set by github actions to change the verbosity of some server output |
NODE_ENV |
development, production |
||
PROJECTS_BASE_PATH |
string | Projects |
relative path from the root of this repo to the folder where the Lean projects are located. |
PORT |
number | 8080 or 443 |
sets the port for the backend server |
SSL_CRT_FILE |
string | "" |
recuired to serve https |
SSL_KEY_FILE |
string | "" |
recuired to serve https |