Skip to content

Commit

Permalink
chore: removed unused services + general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Jul 24, 2022
1 parent c345ce8 commit 32362a5
Show file tree
Hide file tree
Showing 28 changed files with 205 additions and 340 deletions.
30 changes: 1 addition & 29 deletions etc/limiters.json
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
[
{
"name": "default",
"allowedStatus": "active",
"limits": [
{
"path": "/fonoster.projects.v1beta1.Projects/CreateProject",
"resource": "Project",
"limit": 1
},
{
"path": "/fonoster.domains.v1beta1.Domains/CreateDomain",
"resource": "Domain",
"limit": 5
},
{
"path": "/fonoster.agents.v1beta1.Agents/CreateAgent",
"resource": "Agent",
"limit": 20
},
{
"path": "/fonoster.callmanager.v1beta1.CallManager/Call",
"resource": "Call",
"limit": 150,
"timeUnit": "month"
}
]
}
]
[]
29 changes: 29 additions & 0 deletions etc/limiters_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"name": "default",
"allowedStatus": "active",
"limits": [
{
"path": "/fonoster.projects.v1beta1.Projects/CreateProject",
"resource": "Project",
"limit": 1
},
{
"path": "/fonoster.domains.v1beta1.Domains/CreateDomain",
"resource": "Domain",
"limit": 5
},
{
"path": "/fonoster.agents.v1beta1.Agents/CreateAgent",
"resource": "Agent",
"limit": 20
},
{
"path": "/fonoster.callmanager.v1beta1.CallManager/Call",
"resource": "Call",
"limit": 150,
"timeUnit": "month"
}
]
}
]
2 changes: 1 addition & 1 deletion operator/compose/00_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
version: '3'

networks:
fonoster:
Expand Down
143 changes: 91 additions & 52 deletions operator/compose/01_api.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# API Services

version: '3.7'
version: '3'

services:

apiserver:
image: fonoster/traefik:${COMPOSE_PROJECT_VERSION}
command:
# - "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.internal.address=:${HTTP_PORT}"
- "--entrypoints.websecure.address=:${HTTPS_PORT}"
# - --log.level=DEBUG
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.internal.address=:${HTTP_PORT}
- --entrypoints.websecure.address=:${HTTPS_PORT}
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
fonoster:
aliases:
Expand All @@ -26,10 +26,10 @@ services:
file: api-common.yml
service: common
labels:
- "traefik.enable=true"
- "traefik.http.routers.auth.entrypoints=internal,websecure"
- "traefik.http.routers.auth.rule=PathPrefix(`/fonoster.auth.v1beta1.Auth`)"
- "traefik.http.services.auth.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.auth.entrypoints=internal,websecure
- traefik.http.routers.auth.rule=PathPrefix(`/fonoster.auth.v1beta1.Auth`)
- traefik.http.services.auth.loadbalancer.server.scheme=h2c
volumes:
- ${CONFIG}/rbac.json:/home/fonoster/rbac.json

Expand All @@ -39,10 +39,10 @@ services:
file: api-common.yml
service: common
labels:
- "traefik.enable=true"
- "traefik.http.routers.limiter.entrypoints=internal,websecure"
- "traefik.http.routers.limiter.rule=PathPrefix(`/fonoster.auth.v1beta1.Limiter`)"
- "traefik.http.services.limiter.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.limiter.entrypoints=internal,websecure
- traefik.http.routers.limiter.rule=PathPrefix(`/fonoster.auth.v1beta1.Limiter`)
- traefik.http.services.limiter.loadbalancer.server.scheme=h2c
volumes:
- ${CONFIG}/limiters.json:/home/fonoster/limiters.json

Expand All @@ -52,95 +52,134 @@ services:
file: api-common.yml
service: common
labels:
- "traefik.enable=true"
- "traefik.http.routers.monitor.entrypoints=internal,websecure"
- "traefik.http.routers.monitor.rule=PathPrefix(`/fonoster.monitor.v1beta1`)"
- "traefik.http.services.monitor.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.monitor.entrypoints=internal,websecure
- traefik.http.routers.monitor.rule=PathPrefix(`/fonoster.monitor.v1beta1`)
- traefik.http.services.monitor.loadbalancer.server.scheme=h2c

users:
image: fonoster/users:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
labels:
- "traefik.enable=true"
- "traefik.http.routers.users.entrypoints=internal,websecure"
- "traefik.http.routers.users.rule=PathPrefix(`/fonoster.users.v1beta1`)"
- "traefik.http.services.users.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.users.entrypoints=internal,websecure
- traefik.http.routers.users.rule=PathPrefix(`/fonoster.users.v1beta1`)
- traefik.http.services.users.loadbalancer.server.scheme=h2c

projects:
image: fonoster/projects:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
labels:
- "traefik.enable=true"
- "traefik.http.routers.projects.entrypoints=internal,websecure"
- "traefik.http.routers.projects.rule=PathPrefix(`/fonoster.projects.v1beta1`)"
- "traefik.http.services.projects.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.projects.entrypoints=internal,websecure
- traefik.http.routers.projects.rule=PathPrefix(`/fonoster.projects.v1beta1`)
- traefik.http.services.projects.loadbalancer.server.scheme=h2c

agents:
image: fonoster/agents:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- SIPPROXY_HOST
- SIPPROXY_API_PORT
- SIPPROXY_API_USERNAME
- SIPPROXY_API_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.agents.entrypoints=internal,websecure"
- "traefik.http.routers.agents.rule=PathPrefix(`/fonoster.agents.v1beta1`)"
- "traefik.http.services.agents.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.agents.entrypoints=internal,websecure
- traefik.http.routers.agents.rule=PathPrefix(`/fonoster.agents.v1beta1`)
- traefik.http.services.agents.loadbalancer.server.scheme=h2c

domains:
image: fonoster/domains:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- GLOBAL_SIP_DOMAIN
- SIPPROXY_HOST
- SIPPROXY_API_PORT
- SIPPROXY_API_USERNAME
- SIPPROXY_API_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.domains.entrypoints=internal,websecure"
- "traefik.http.routers.domains.rule=PathPrefix(`/fonoster.domains.v1beta1`)"
- "traefik.http.services.domains.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.domains.entrypoints=internal,websecure
- traefik.http.routers.domains.rule=PathPrefix(`/fonoster.domains.v1beta1`)
- traefik.http.services.domains.loadbalancer.server.scheme=h2c

numbers:
image: fonoster/numbers:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- VOICE_URL
- MS_ENDPOINT
- SIPPROXY_HOST
- SIPPROXY_API_PORT
- SIPPROXY_API_USERNAME
- SIPPROXY_API_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.numbers.entrypoints=internal,websecure"
- "traefik.http.routers.numbers.rule=PathPrefix(`/fonoster.numbers.v1beta1`)"
- "traefik.http.services.numbers.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.numbers.entrypoints=internal,websecure
- traefik.http.routers.numbers.rule=PathPrefix(`/fonoster.numbers.v1beta1`)
- traefik.http.services.numbers.loadbalancer.server.scheme=h2c

providers:
image: fonoster/providers:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- SIPPROXY_HOST
- SIPPROXY_API_PORT
- SIPPROXY_API_USERNAME
- SIPPROXY_API_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.providers.entrypoints=internal,websecure"
- "traefik.http.routers.providers.rule=PathPrefix(`/fonoster.providers.v1beta1`)"
- "traefik.http.services.providers.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.providers.entrypoints=internal,websecure
- traefik.http.routers.providers.rule=PathPrefix(`/fonoster.providers.v1beta1`)
- traefik.http.services.providers.loadbalancer.server.scheme=h2c

storage:
image: fonoster/storage:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- FS_HOST
- FS_PORT
- FS_USERNAME
- FS_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.storage.entrypoints=internal,websecure"
- "traefik.http.routers.storage.rule=PathPrefix(`/fonoster.storage.v1beta1`)"
- "traefik.http.services.storage.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.storage.entrypoints=internal,websecure
- traefik.http.routers.storage.rule=PathPrefix(`/fonoster.storage.v1beta1`)
- traefik.http.services.storage.loadbalancer.server.scheme=h2c

callmanager:
image: fonoster/callmanager:${COMPOSE_PROJECT_VERSION}
extends:
file: api-common.yml
service: common
environment:
- MS_ARI_INTERNAL_URL
- MS_TRUNK
- MS_CONTEXT
- MS_EXTENSION
- MS_ARI_USERNAME
- MS_ARI_SECRET
- SIPPROXY_HOST
- SIPPROXY_API_PORT
- SIPPROXY_API_USERNAME
- SIPPROXY_API_SECRET
labels:
- "traefik.enable=true"
- "traefik.http.routers.callmanager.entrypoints=internal,websecure"
- "traefik.http.routers.callmanager.rule=PathPrefix(`/fonoster.callmanager.v1beta1`)"
- "traefik.http.services.callmanager.loadbalancer.server.scheme=h2c"
- traefik.enable=true
- traefik.http.routers.callmanager.entrypoints=internal,websecure
- traefik.http.routers.callmanager.rule=PathPrefix(`/fonoster.callmanager.v1beta1`)
- traefik.http.services.callmanager.loadbalancer.server.scheme=h2c
36 changes: 19 additions & 17 deletions operator/compose/02_sipnet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
version: '3'

services:

Expand All @@ -19,7 +19,7 @@ services:
EX_RTP_ENGINE_PORT: ${RTPE_PORT}
# Setting this to true is breaking the routing workflow in Routr
EX_CONVERT_TEL_TO_E164: "false"
JAVA_OPTS: "-XX:NewRatio=2 -Xmx250M"
JAVA_OPTS: -XX:NewRatio=2 -Xmx250M
ports:
- ${SIPPROXY_SIP_PORTS}:${SIPPROXY_SIP_PORTS}
- ${SIPPROXY_SIP_PORT_UDP}:${SIPPROXY_SIP_PORT_UDP}/udp
Expand All @@ -39,12 +39,12 @@ services:
image: fonoster/rtpengine:${COMPOSE_PROJECT_VERSION}
restart: ${RESTART_POLICY}
labels:
- "traefik.enable=true"
- "traefik.http.routers.rtpengine.entrypoints=internal,websecure"
- "traefik.http.routers.rtpengine.rule=PathPrefix(`/ng`)"
- "traefik.http.services.rtpengine.loadbalancer.server.port=8080"
- traefik.enable=true
- traefik.http.routers.rtpengine.entrypoints=internal,websecure
- traefik.http.routers.rtpengine.rule=PathPrefix(`/ng`)
- traefik.http.services.rtpengine.loadbalancer.server.port=8080
# Network hostmode seems to only work in Linux systems
network_mode: "host"
network_mode: host
environment:
# This will fail if network_mode != host
PUBLIC_IP: ${DOCKER_HOST_ADDRESS}
Expand All @@ -55,14 +55,19 @@ services:
mediaserver:
image: fonoster/mediaserver:${COMPOSE_PROJECT_VERSION}
restart: ${RESTART_POLICY}
depends_on:
rtpengine:
condition: 'service_healthy'
sipproxy:
condition: 'service_healthy'
labels:
- "traefik.enable=true"
- "traefik.http.routers.mediaserver.entrypoints=internal,websecure"
- "traefik.http.routers.mediaserver.rule=PathPrefix(`/ari/playbacks`) || PathPrefix(`/ari/channels`) || PathPrefix(`/ari/events`)"
- "traefik.http.services.mediaserver.loadbalancer.server.port=8088"
- "traefik.http.routers.mediaserver.middlewares=basic-auth@docker,session-auth@docker"
- "traefik.http.middlewares.session-auth.forwardauth.address=http://auth:3000/session_auth"
- "traefik.http.middlewares.basic-auth.headers.customrequestheaders.Authorization=Basic ${MS_ARI_AUTHORIZATION}"
- traefik.enable=true
- traefik.http.routers.mediaserver.entrypoints=internal,websecure
- traefik.http.routers.mediaserver.rule=PathPrefix(`/ari/playbacks`) || PathPrefix(`/ari/channels`) || PathPrefix(`/ari/events`)
- traefik.http.services.mediaserver.loadbalancer.server.port=8088
- traefik.http.routers.mediaserver.middlewares=basic-auth@docker,session-auth@docker
- traefik.http.middlewares.session-auth.forwardauth.address=http://auth:3000/session_auth
- traefik.http.middlewares.basic-auth.headers.customrequestheaders.Authorization=Basic ${MS_ARI_AUTHORIZATION}
environment:
APISERVER_ENDPOINT: ${AS_HOST}:${HTTP_PORT}
ALLOW_INSECURE: ${AS_ALLOW_INSECURE}
Expand All @@ -88,9 +93,6 @@ services:
LOGS_DRIVER_HOST: ${LOGS_DRIVER_HOST}
LOGS_DRIVER_PORT: ${LOGS_DRIVER_PORT}
TRACING_ENDPOINT: ${TRACING_ENDPOINT}
# Give asterisk a fake localnet to force it to always advertise its public address
# Deprecated
# LOCALNET: '8.8.8.8'
volumes:
- data1-1:/home/fonoster
# TODO: Update image to add user fonoster
Expand Down
Loading

0 comments on commit 32362a5

Please sign in to comment.