Compare commits
1 Commits
feat/nonro
...
doc_readon
Author | SHA1 | Date | |
---|---|---|---|
3a46451271 |
10
Makefile
10
Makefile
@ -21,11 +21,11 @@ docker-run:
|
|||||||
fake-sms:latest
|
fake-sms:latest
|
||||||
|
|
||||||
docker-release:
|
docker-release:
|
||||||
docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:latest
|
docker tag fake-sms:latest cadoles/fake-sms:latest
|
||||||
docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
|
docker tag fake-sms:latest cadoles/fake-sms:$(DOCKER_DATE_TAG)
|
||||||
docker login reg.cadoles.com
|
docker login
|
||||||
docker push reg.cadoles.com/cadoles/fake-sms:latest
|
docker push cadoles/fake-sms:latest
|
||||||
docker push reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
|
docker push cadoles/fake-sms:$(DOCKER_DATE_TAG)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -v -race ./...
|
go test -v -race ./...
|
||||||
|
12
README.md
12
README.md
@ -51,12 +51,20 @@ La configuration de FakeSMTP peut être personnalisée via des variables d'envir
|
|||||||
Les valeurs des variables d'environnement surchargent les valeurs présentes dans le fichier de configuration.
|
Les valeurs des variables d'environnement surchargent les valeurs présentes dans le fichier de configuration.
|
||||||
|
|
||||||
| Variable | Correspondance dans le fichier de configuration |
|
| Variable | Correspondance dans le fichier de configuration |
|
||||||
|--------|-----------------------------------------------|
|
| -------------------------- | ----------------------------------------------- |
|
||||||
| `FAKESMS_HTTP_ADDRESS` | `http.address` |
|
| `FAKESMS_HTTP_ADDRESS` | `http.address` |
|
||||||
| `FAKESMS_HTTP_TEMPLATEDIR` | `http.templateDir` |
|
| `FAKESMS_HTTP_TEMPLATEDIR` | `http.templateDir` |
|
||||||
| `FAKESMS_HTTP_PUBLICDIR` | `http.publicDir` |
|
| `FAKESMS_HTTP_PUBLICDIR` | `http.publicDir` |
|
||||||
| `FAKESMS_POWOW_API_KEY` | `powow.apiKey` |
|
| `FAKESMS_POWOW_API_KEY` | `powow.apiKey` |
|
||||||
|
|
||||||
|
### Lancer en mode read-only
|
||||||
|
|
||||||
|
Pour lancer le conteneur en mode read-only, la variable `FAKESMTP_DATA_PATH` doit être définie et un volume doit être créé à cet emplacement. Exemple avec docker :
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -it --rm -p 3000:3000 --env FAKESMS_DATA_PATH='/app/data/fakesms.db' --read-only -v $(pwd)/data:/app/data cadoles/fake-sms
|
||||||
|
```
|
||||||
|
|
||||||
## Mocks
|
## Mocks
|
||||||
|
|
||||||
### Iroquois/Powow
|
### Iroquois/Powow
|
||||||
@ -66,7 +74,7 @@ Un mock de l'API Powow est disponible via l'URL `http://<fake_sms_host>/api/v1/m
|
|||||||
Les commandes suivantes sont implémentées:
|
Les commandes suivantes sont implémentées:
|
||||||
|
|
||||||
| Commande | Documentation officiele | Notes |
|
| Commande | Documentation officiele | Notes |
|
||||||
|--------|-----------------------|-----------|
|
| ----------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------- |
|
||||||
| `TransactionalSms.Send` | https://powow4.iroquois.fr/user/docs/api/#send-transactional-sms | La définition des modèles de SMS s'effectue via la configuration. |
|
| `TransactionalSms.Send` | https://powow4.iroquois.fr/user/docs/api/#send-transactional-sms | La définition des modèles de SMS s'effectue via la configuration. |
|
||||||
|
|
||||||
Un exemple d'appel à l'API est disponible dans le fichier [`misc/powow.http`](./misc/powow.http).
|
Un exemple d'appel à l'API est disponible dans le fichier [`misc/powow.http`](./misc/powow.http).
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
FROM reg.cadoles.com/dh/library/golang:1.22-alpine AS build
|
FROM golang:1.17 AS build
|
||||||
|
|
||||||
ARG HTTP_PROXY=
|
ARG HTTP_PROXY=
|
||||||
ARG HTTPS_PROXY=
|
ARG HTTPS_PROXY=
|
||||||
ARG http_proxy=
|
ARG http_proxy=
|
||||||
ARG https_proxy=
|
ARG https_proxy=
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache build-base git bash curl python3 nodejs npm
|
RUN apt-get update && apt-get install -y build-essential git bash curl python2
|
||||||
|
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
&& apt-get install -y nodejs
|
||||||
|
|
||||||
COPY . /src
|
COPY . /src
|
||||||
|
|
||||||
@ -13,22 +16,19 @@ WORKDIR /src
|
|||||||
|
|
||||||
RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml
|
RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml
|
||||||
|
|
||||||
RUN go install github.com/krishicks/yaml-patch/cmd/yaml-patch@v0.0.10
|
RUN go get github.com/krishicks/yaml-patch/cmd/yaml-patch
|
||||||
|
|
||||||
RUN npm install \
|
RUN npm install \
|
||||||
&& make vendor \
|
&& make vendor \
|
||||||
&& echo "---" > ./misc/release/config-patch.yml \
|
&& echo "---" > ./misc/release/config-patch.yml \
|
||||||
&& make ARCH_TARGETS=amd64 release
|
&& make ARCH_TARGETS=amd64 release
|
||||||
|
|
||||||
|
|
||||||
FROM busybox
|
FROM busybox
|
||||||
|
|
||||||
RUN adduser -D -h /app sms
|
|
||||||
|
|
||||||
COPY --from=build /src/release/fake-sms-linux-amd64 /app
|
COPY --from=build /src/release/fake-sms-linux-amd64 /app
|
||||||
RUN chown -R sms:sms /app
|
|
||||||
|
|
||||||
USER sms
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
CMD ["bin/fake-sms", "--config", "config.yml"]
|
CMD ["bin/fake-sms", "--config", "config.yml"]
|
Reference in New Issue
Block a user