Strapi application used to manage the content of tf.fi.
- yarn
- docker (OR a running postgres database)
The application requires a running postgres database to function. A database can be started by running
docker compose up -d
- Configure .env variables. Configurable variables can be found in .env.example
- Install dependencies by running
yarn
- Start the application in development mode with
yarn develop
To allow for single-sign on with other systems, TF identifies end-users with keycloak.
- Create a keycloak client (or look up the existing strapi client) at keycloak admin console -> Realms -> tf-medlemmar -> clients -> Create client
- Give the client an ID and configure relevant URL:s as follows:
- Root URL: the root of your strapi instance, e.g. https://cms.tf.fi
- Home URL: the root of your frontend client, e.g. https://tf.fi
- Valid redirect URIs & Valid post logout redirect URIs: frontend keycloak callback path, e.g. https://tf.fi/api/auth/callback/keycloak
- Web origins: allowed CORS origins, should have both the frontend and strapi origin, e.g. https://tf.fi & https://cms.tf.fi
- Set Capability config settings:
- Client authentication: On
- Authorization: Off
- Authentication flow: Enable standard flow, disable all other flows.
- Configure credentials:
- Client Authenticator: Client Id and Secret
- Generate Client secret
- Set the recently defined keycloak variables in strapi under Settings -> Providers -> keycloak as follows:
- Enable: true
- Client ID: client ID from keycloak (step 2.)
- Client secret fron keycloak (step 4.2)
- Host URI (Subdomain): URI of the keycloak realm, e.g. id.tf.fi/realms/tf-medlemmar
- The redirect URL to your front-end app: strapi keycloak callback, e.g. https://cms.tf.fi/api/auth/keycloak/callback
- Clone this repository
- Start the application
- Navigate to localhost:1337/admin
- Make the required changes
- Double check that the code changes are ok
- Commit & push the changes, a github workflow will build a new image
- Pull the updated image on the prod system with
docker compose pull
- Start the updated image with
docker compose up -d
The current production settings can be found in config/sync and can be loaded by running
yarn cs import
After updating the settings, the stored configuration can be updated with
yarn cs export