Follow the Architecture documentation.
A guide how to setup the project with devcontainers can be found here.
The project executable can be run via command line make sihl
and shows the information of the executable.
- Create a
.env
file and set the environment variableECON_PACKAGE_REGISTRY_READ_TOKEN
to the value stored in 1Password or in the GitLab CI/CD variables. - Migrate root database with
make sihl migrate.root
- Seed root database
make sihl seed.root
- Migrate tenant database with
make sihl migrate.tenant
- Seed tenant database
make sihl seed.tenant
- Run development server
make dev
- See
pool/database/seed/seed_user.ml
for default users ormake sihl user.admin engineering@econ.uzh.ch admin_secret
to generate one
make install
- to install all the dependencies. Under the hood,dune
is used for package management.make sihl migrate.root
- runs all migrations for root databasemake sihl seed.root
- runs all seeds with development data for root database (usemake seed.root.clean
for a clean restart)make sihl migrate.tenant
- runs all migrations for tenant databasesmake sihl seed.tenant
- runs all seeds with development data for tenant database (usemake seed.tenant.clean
for a clean restart)make dev
- runs build in watch mode and the web application on port3016
(default). You typically have that process running in one shell. Changing code will recompile and restart the server automatically. Changing JS code that is not embedded in.ml
files (libraries) requires restarting the server.make test
to run all tests. This requires a running MariaDB instance for integration tests.make sihl
runs the executable and shows the list of commandsmake sihl <ARGS>
runs the executable with the provided arguments
For completeness, these environment files are handled with priority from SIHL.
.env
: Stores the environment for your local development.env.test
: Stores the environment used when running tests (e.g. withmake test
)
- Update
CHANGELOG.md
and document changes made. Ensure the version to be releases has a header matching the version, follow previous releases. - Commit your changes.
- Release version using
yarn version
. - Push changes and Git tag.
Run make build
to build the pool-tool project. This builds .ml
files using dune
.
When testing the production environment, you need to update the csrf cookie key (default __HOST-csrf
).
This can be done with adding the optional argument cookie_key
to the csrf middleware.
(* NOTE: the middleware might have additional arguments defined *)
Sihl.Web.Middleware.csrf ~cookie_key:"csrf" ()
__Host-
prefix: Cookies with names starting with__Host-
must be set with thesecure
flag, must be from a secure page (HTTPS), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be/
.
Source: https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Set-Cookie
Alternatively, these options simulate a similar production environment (without CHECK_CSRF
):
QUEUE_FORCE_ASYNC=true EMAIL_BYPASS_INTERCEPT=true SMTP_SENDER=noreply@uast.uzh.ch SMTP_HOST=uzhxchange.uzh.ch SMTP_USERNAME=noreply@uast.uzh.ch SMTP_PORT=5587 SMTP_START_TLS=true SMTP_PASSWORD=<password> make dev
Use this until new SMTP method is supported is resolved:
SMTP_HOST=smtp.uzh.ch SMTP_PORT=25 SMTP_SENDER=info@uast.uzh.ch SMTP_START_TLS=true EMAIL_BYPASS_INTERCEPT=true make dev