Skip to content

Commit 6e719cd

Browse files
committed
Updated README
1 parent 00c0d53 commit 6e719cd

2 files changed

Lines changed: 49 additions & 3 deletions

File tree

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ This is an intentionally very simple service for storing files as there is cross
88
requirements with ETD. Work needs to be done to review and potentially consolidate the two
99
projects.
1010

11-
## Configuration
11+
## Setting up the service
1212

13-
Application configuration can be found in `application.yml`. Some of these properties
13+
### Configuration
14+
15+
Application configuration can be found in `src/main/resources/application.yml`. Some of these properties
1416
can be overridden at deployment time using environment variables.
1517

1618
| Environment variable | Default | Description |
@@ -27,6 +29,51 @@ can be overridden at deployment time using environment variables.
2729
| SHARPNESS_THRESHOLD | 60 | Threshold, in %, an image's sharpness must meet to pass quality check |
2830
| SPRING_PROFILES_ACTIVE | `development` | Only needs to be set to "development" when running in docker with [localstack](https://github.com/localstack) for a mock local AWS environment |
2931

32+
### Installation
33+
34+
This repository is private, you will need access to UKForeignOffice to access it.
35+
36+
```bash
37+
git clone https://github.com/UKForeignOffice/document-upload.git
38+
39+
cd document-upload
40+
```
41+
42+
#### Local development
43+
44+
In `Dockerfile`, change the image to `cimg/openjdk:17.0.11`.
45+
46+
In `docker-compose.yml`, change the `clamav` service `image: clamav/clamav:1.4.3`.
47+
In `docker-compose.yml`, add to the `clamav` service `platform: linux/amd64`.
48+
49+
```bash
50+
./gradlew clean build
51+
```
52+
53+
## Using the service
54+
55+
### Run
56+
57+
```bash
58+
docker compose up --build
59+
```
60+
61+
### Endpoints
62+
63+
1. `GET` `/v1/files/{id}` - Get a file by id
64+
65+
```bash
66+
curl http://localhost:9000/v1/files/4ec76a9f310e0ee531.jpg
67+
```
68+
69+
2. `POST` `/v1/files` - Scans and stores the files for viruses
70+
71+
```bash
72+
curl -X POST -F \
73+
"files=@/path/to/file/4ec76a9f310e0ee531.jpg" \
74+
http://localhost:9000/v1/files
75+
```
76+
3077
## AntiVirus
3178

3279
Scanning inbound files for viruses is supported by integration with ClamAV. An example

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ services:
99
build: .
1010
ports:
1111
- 9000:9000
12-

0 commit comments

Comments
 (0)