The server hosts the filing index and admin area and runs the indexing service.
To build and test:
./gradlew buildAs standalone application: Receives jobs from an SQS queue, processes them, published the result assets to S3, and pushes notification to another SQS queue.
As AWS Lambda function: Can be manually invoked for individual generations. Publishes result assets to S3 and includes result details in invocation response.
To install dependencies:
pip install -r requirements-dev.txtTo run unit tests:
pytest processor_testsTo run code style tests:
flake8 .To run typing tests:
mypy .To prepare taxonomy packages:
- Create
./dev/taxonomy_packagesdirectory. - Place taxonomy packages in the directory.
To avoid the need to maintain an authenticated application or area of the filing index,
support operations can be performed within the AWS console by invoking the frc-codex-support
Lambda function.
The preferred method to run any part of the UK iXBRL Viewer is using Docker Compose.
To configure secrets for the server and processor, add them in a frc-codex-server.secrets file in the root directory. Example:
COMPANIES_HOUSE_REST_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
COMPANIES_HOUSE_STREAM_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXIf desired, add ./dev/compose-local.yml (untracked) to customize Docker compose configuration.
Example ./dev/compose-local.yml:
services:
postgres:
volumes:
# Persists the database data in the tmp directory between startups
- ./tmp/postgres:/var/lib/postgresql/dataTo build images and compose services:
./dev/env-setup.shOr, to build images and compose services separately, use ./dev/env-build.sh and ./dev/env-compose.sh respectively.
You can attach to the composed Docker container within IntelliJ for debugging:
- Create a "Remote JVM Debug" run configuration in IntelliJ.
- Select "Attach to remote JVM" for debugger mode.
- Enter "localhost" for host.
- Enter "8180" for port (should match the port configured in JAVA_TOOL_OPTIONS).
- Compose your docker environment
- Run the "Remote JVM Debug" configuration in IntelliJ.
- A successful attachment will show "Connected to the target VM (...)" or similar.
All commands should be run from repository root.
- Install npm. Instructions can be found here: https://www.npmjs.com/get-npm
- Install the dependencies for puppeteer by running:
npm install. - Start the docker containers by running:
SEEDED=true ./dev/env-setup.sh - Run the tests by running:
npm run test.
An admin area exists at /admin for managing the filing index.
This area is not intended to be used in a production environment.
Instead, it is meant to be enabled in development and staging environments for testing and debugging purposes.
This feature is disabled by default and can be enabled with ADMIN_ENABLED.
Rudimentary "authentication" for the admin area can be enabled by setting ADMIN_KEY.
This will require a user to first navigate to /admin/login/{ADMIN_KEY} to gain access to the admin features.
Warning
This authentication is not secure and should not be used in a production environment.