Skip to content

Commit

Permalink
feat: remove clamav 🧹 (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
totakoko authored Oct 27, 2023
1 parent 43a7ae4 commit 907a85c
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 111 deletions.
1 change: 0 additions & 1 deletion .infra/.env_server
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ MNA_TDB_SMTP_AUTH_PASS={{ vault[env_type].MNA_TDB_SMTP_AUTH_PASS }}
MNA_TDB_API_ENTREPRISE_KEY={{ vault[env_type].MNA_TDB_API_ENTREPRISE_KEY }}
SENTRY_DSN={{ vault.SERVER_SENTRY_DSN }}
MNA_TDB_IS_OFFLINE=false
MNA_TDB_CLAMAV_URI=clamav:3310
TDB_MNA_CATALOG_ENDPOINT_URL={{ vault.TDB_MNA_CATALOG_ENDPOINT_URL }}
TDB_TABLES_CORRESPONDANCES_ENDPOINT_URL={{ vault.TDB_TABLES_CORRESPONDANCES_ENDPOINT_URL }}
TDB_MNA_REFERENTIEL_ENDPOINT_URL={{ vault.TDB_MNA_REFERENTIEL_ENDPOINT_URL }}
Expand Down
18 changes: 0 additions & 18 deletions .infra/docker-compose.preview-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,6 @@ services:
labels:
- autoheal=true

clamav:
<<: *default
image: clamav/clamav:latest
container_name: tdb_clamav
deploy:
resources:
limits:
memory: 2g
volumes:
- /opt/app/data/clamav:/var/lib/clamav
healthcheck:
test: ["CMD", "/usr/local/bin/clamdcheck.sh"]
interval: 60s
retries: 3
start_period: 6m
labels:
- autoheal=true

smtp:
<<: *default
image: axllent/mailpit:v1.5.5
Expand Down
22 changes: 0 additions & 22 deletions .infra/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,3 @@ services:
fluentd-address: localhost:24224
tag: docker.json.tdb.{{env_type}}.metabase
fluentd-async: "true"

clamav:
<<: *default
image: clamav/clamav:latest
deploy:
<<: *deploy-default
resources:
limits:
memory: 2g
healthcheck:
test: ["CMD", "/usr/local/bin/clamdcheck.sh"]
interval: 60s
retries: 3
start_period: 6m
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: docker.json.tdb.{{env_type}}.clamav
fluentd-async: "true"
volumes:
- /opt/app/data/clamav:/var/lib/clamav
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ services:
retries: 12
start_period: 10s

clamav:
image: clamav/clamav:latest
restart: unless-stopped
healthcheck:
test: ["CMD", "/usr/local/bin/clamdcheck.sh"]
interval: 60s
retries: 3
start_period: 6m
ports:
- 3310:3310
volumes:
- tdb_clamav_data:/var/lib/clamav

smtp:
image: axllent/mailpit:v1.5.5
restart: unless-stopped
Expand All @@ -46,6 +33,3 @@ volumes:
tdb_smtp_data:
driver: local
name: tdb_smtp_data
tdb_clamav_data:
driver: local
name: tdb_clamav_data
3 changes: 1 addition & 2 deletions docs/infrastructure/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ flowchart TB
P-->S["fa:fa-layer-group Server"]
P-->U["fa:fa-layer-group UI"]
P-->M
S-->C["Clamav"]
S-->D["MongoDB"]
M["Metabase"]-->D["MongoDB"]
Pro["Processor"]-->D["MongoDB"]
Expand Down Expand Up @@ -96,7 +95,7 @@ sequenceDiagram
```

- Les modifications des services Proxy, Server, Processor et UI se font sans interruption.
- **Cependant, les modifications des services MongoDB et Clamav se traduisent par une interruption de service.**
- **Cependant, la modification du service MongoDB se traduit par une interruption de service.**

### Avec Migration

Expand Down
44 changes: 0 additions & 44 deletions server/src/common/services/clamav.ts

This file was deleted.

3 changes: 0 additions & 3 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ const config = {
pass: env.get("MNA_TDB_SMTP_AUTH_PASS").asString(),
},
},
clamav: {
uri: env.get("MNA_TDB_CLAMAV_URI").default("127.0.0.1:3310").asString(),
},
ovhStorage: {
username: env.get("MNA_TDB_OVH_STORAGE_USERNAME").required().asString(),
password: env.get("MNA_TDB_OVH_STORAGE_PASSWORD").required().asString(),
Expand Down
5 changes: 0 additions & 5 deletions server/src/services.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import config from "@/config";

import { createClamav } from "./common/services/clamav";
import { createMailerService } from "./common/services/mailer/mailer";

export let mailer: ReturnType<typeof createMailerService>; // eslint-disable-line import/no-mutable-exports
export let clamav: ReturnType<typeof createClamav>; // eslint-disable-line import/no-mutable-exports

const createGlobalServices = () => {
// Hack pour rendre ces services globaux
// On pourra passer par un singleton global plus tard (pour rester dans la mouvance des actions)
mailer = createMailerService();
clamav = createClamav(config.clamav.uri);
};

export default createGlobalServices;

0 comments on commit 907a85c

Please sign in to comment.