Skip to content

Commit

Permalink
fix: improve server stability
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Mar 17, 2024
1 parent cd72391 commit 099d717
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
##
DOCKER_HOST_ADDRESS=
GRPC_ALLOW_INSECURE=true
REDIS_HOST=redis
LOGS_LEVEL=info
LOGS_DRIVER_HOST=fluent
LOGS_AGGREGRATOR_HOST=elasticsearch
Expand Down Expand Up @@ -36,7 +35,6 @@ APISERVER_ROUTR_DEFAULT_PEER_SECRET=changeme
APISERVER_ASTERISK_ARI_INTERNAL_URL=http://asterisk:8088
APISERVER_ASTERISK_ARI_USERNAME=ari
APISERVER_ASTERISK_ARI_SECRET=changeme
APISERVER_ASTERISK_RECORDINGS_PATH=/etc/fonoster/recordings
APISERVER_VAULT_ADDR=http://vault:8200
APISERVER_VAULT_TOKEN=changeme
APISERVER_VAULT_UNSEAL_KEY=changeme
Expand Down
5 changes: 2 additions & 3 deletions asterisk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
FROM alpine:3.19
FROM alpine:3.18
LABEL maintainer="Pedro Sanders <psanders@fonoster.com>"

COPY asterisk/config /etc/asterisk/
COPY asterisk/run.sh /

RUN apk add --no-cache --update tini asterisk asterisk-speex asterisk-curl nodejs npm git \
&& npm install -g @fonoster/dispatcher@0.4.18 \
&& npm install -g @fonoster/dispatcher \
&& chmod +x /run.sh \
&& apk del --purge npm git


ENTRYPOINT ["tini", "-v", "--"]
CMD ["/run.sh"]

Expand Down
2 changes: 1 addition & 1 deletion compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:

redis:
ports:
- 6379:6379
- 127.0.0.1:6379:6379

vault:
ports:
Expand Down
7 changes: 5 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ services:
APISERVER_ASTERISK_ARI_INTERNAL_URL: ${APISERVER_ASTERISK_ARI_INTERNAL_URL}
APISERVER_ASTERISK_ARI_USERNAME: ${APISERVER_ASTERISK_ARI_USERNAME}
APISERVER_ASTERISK_ARI_SECRET: ${APISERVER_ASTERISK_ARI_SECRET}
APISERVER_ASTERISK_RECORDINGS_PATH: ${APISERVER_ASTERISK_RECORDINGS_PATH}
APISERVER_VAULT_ADDR: ${APISERVER_VAULT_ADDR}
APISERVER_VAULT_TOKEN: ${APISERVER_VAULT_TOKEN}
APISERVER_S3_SERVER_HOST: ${APISERVER_S3_SERVER_HOST}
Expand All @@ -65,6 +64,8 @@ services:
ports:
- 50052:50052
- 4000:4000
expose:
- 6445
volumes:
- ./etc/monitor.patch.js:/service/node_modules/@fonoster/monitor/dist/service/monitor.js:ro
- ./etc/config:/home/fonoster/.fonoster/config:ro
Expand Down Expand Up @@ -133,6 +134,7 @@ services:
restart: unless-stopped
environment:
APISERVER_RBAC_CONFIG: "/root/.fonoster/rbac.json"
APISEERVER_ENDPOINT: ${APISERVER_ENDPOINT}
ARI_PROXY_URL: ${ASTERISK_ARI_PROXY_URL}
ARI_USERNAME: ${ASTERISK_ARI_USERNAME}
ARI_SECRET: ${ASTERISK_ARI_SECRET}
Expand All @@ -145,6 +147,7 @@ services:
LOGS_LEVEL: ${LOGS_LEVEL}
LOGS_DRIVER_HOST: ${LOGS_DRIVER_HOST}
LOGS_TRANSPORT: ${LOGS_TRANSPORT}
GRPC_ALLOW_INSECURE: true
expose:
- 6060
- 8088
Expand Down Expand Up @@ -186,7 +189,7 @@ services:
- ./etc/fluent.conf:/fluentd/etc/fluent.conf:ro

elasticsearch:
image: elasticsearch:7.17.18
image: elasticsearch:7.16.3
restart: unless-stopped
platform: linux/x86_64
environment:
Expand Down
1 change: 0 additions & 1 deletion mods/apiserver/etc/service_envs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"APISERVER_ASTERISK_ARI_INTERNAL_URL",
"APISERVER_ASTERISK_ARI_USERNAME",
"APISERVER_ASTERISK_ARI_SECRET",
"APISERVER_ASTERISK_RECORDINGS_PATH",
"APISERVER_AUTOPILOT_URL",
"APISERVER_ENDPOINT",
"APISERVER_ROUTR_API_HOST",
Expand Down
4 changes: 2 additions & 2 deletions mods/dispatcher/src/utils/upload_recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { APISERVER_RECORDINGS_PATH } from "../envs";
import { RECORDINGS_PATH } from "../envs";
import { getLogger } from "@fonoster/logger";
import Auth from "@fonoster/auth";
import Storage from "@fonoster/storage";
Expand All @@ -42,6 +42,6 @@ export const uploadRecording = async (
await storage.uploadObject({
// TODO: Place bucket name on a constant
bucket: "recordings",
filename: `${APISERVER_RECORDINGS_PATH}/${filename}`
filename: `${RECORDINGS_PATH}/${filename}`
});
};

0 comments on commit 099d717

Please sign in to comment.