Skip to content

Commit 06a261d

Browse files
committed
refactor: Update terminology from 'services' to 'adapters' and standardize configuration comments
1 parent d507a4a commit 06a261d

7 files changed

Lines changed: 35 additions & 32 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ app
5353
│   ├── dao # Data Access Objects. Contains different classes to interact with database.
5454
│   └── models # Package contains different models for ORMs.
5555
├── __main__.py # Startup script. Starts uvicorn.
56-
├── services # Package for different external services such as rabbit or redis etc.
56+
├── adapters # Package for different external adapters such as rabbit or redis etc.
5757
├── settings.py # Main configuration settings for project.
5858
├── static # Static content.
5959
├── tests # Tests for project.
60-
└── web # Package contains web server. Handlers, startup config.
60+
└── controller # Package contains controller server. Handlers, startup config.
6161
├── api # Package with all handlers.
6262
│   └── router.py # Main router.
6363
├── application.py # FastAPI application configuration.

deploy/docker/docker-compose.prometheus.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ services:
33
image: ${PROMETHEUS_IMAGE}
44
container_name: prometheus
55
command:
6-
- --web.console.templates=/etc/prometheus/consoles
7-
- --web.console.libraries=/etc/prometheus/console_libraries
6+
- --controller.console.templates=/etc/prometheus/consoles
7+
- --controller.console.libraries=/etc/prometheus/console_libraries
88
- --storage.tsdb.retention.time=1h
99
- --config.file=/etc/prometheus/prometheus-config.yaml
1010
- --storage.tsdb.path=/prometheus
11-
- --web.enable-lifecycle
12-
- --web.route-prefix=/
13-
- --web.enable-otlp-receiver
11+
- --controller.enable-lifecycle
12+
- --controller.route-prefix=/
13+
- --controller.enable-otlp-receiver
1414
- --enable-feature=exemplar-storage
1515
volumes:
1616
- ./src/prometheus/prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml

deploy/docker/docker-compose.traefik.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ services:
1313
# Use the traefik-public network (declared below)
1414
- traefik.docker.network=traefik-public
1515
# Define the port inside of the Docker service to use
16-
- traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080
17-
# Make Traefik use this domain (from an environment variable) in HTTP
16+
- traefik.http.adapters.traefik-dashboard.loadbalancer.server.port=8080
17+
# Make Traefik use this services (from an environment variable) in HTTP
1818
- traefik.http.routers.traefik-dashboard-http.entrypoints=http
1919
- traefik.http.routers.traefik-dashboard-http.rule=Host(`traefik.${DOMAIN?Variable not set}`)
2020
# traefik-https the actual router using HTTPS
@@ -23,7 +23,7 @@ services:
2323
- traefik.http.routers.traefik-dashboard-https.tls=true
2424
# Use the "le" (Let's Encrypt) resolver created below
2525
- traefik.http.routers.traefik-dashboard-https.tls.certresolver=le
26-
# Use the special Traefik service api@internal with the web UI/Dashboard
26+
# Use the special Traefik service api@internal with the controller UI/Dashboard
2727
- traefik.http.routers.traefik-dashboard-https.service=api@internal
2828
# https-redirect middleware to redirect HTTP to HTTPS
2929
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
@@ -36,14 +36,14 @@ services:
3636
# Enable HTTP Basic auth, using the middleware created above
3737
- traefik.http.routers.traefik-dashboard-https.middlewares=admin-auth
3838
volumes:
39-
# Add Docker as a mounted volume, so that Traefik can read the labels of other services
39+
# Add Docker as a mounted volume, so that Traefik can read the labels of other adapters
4040
- /var/run/docker.sock:/var/run/docker.sock:ro
4141
# Mount the volume to store the certificates
4242
- traefik-public-certificates:/certificates
4343
command:
44-
# Enable Docker in Traefik, so that it reads labels from Docker services
44+
# Enable Docker in Traefik, so that it reads labels from Docker adapters
4545
- --providers.docker
46-
# Do not expose all Docker services, only the ones explicitly exposed
46+
# Do not expose all Docker adapters, only the ones explicitly exposed
4747
- --providers.docker.exposedbydefault=false
4848
# Create an entrypoint "http" listening on port 80
4949
- --entrypoints.http.address=:80
@@ -72,6 +72,6 @@ volumes:
7272

7373
networks:
7474
# Use the previously created public network "traefik-public", shared with other
75-
# services that need to be publicly available via this Traefik
75+
# adapters that need to be publicly available via this Traefik
7676
traefik-public:
7777
external: true

deploy/grafana/grafana.ini

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ protocol = http
4242
# The http port to use
4343
http_port = 3000
4444

45-
# The public facing domain name used to access grafana from a browser
45+
# The public facing services name used to access grafana from a browser
4646
domain = localhost
4747

48-
# Redirect to correct domain if host header does not match domain
48+
# Redirect to correct services if host header does not match services
4949
# Prevents DNS rebinding attacks
5050
;enforce_domain = false
5151

@@ -56,7 +56,7 @@ root_url = %(protocol)s://%(domain)s/grafana/
5656
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
5757
serve_from_sub_path = true
5858

59-
# Log web requests
59+
# Log controller requests
6060
;router_logging = false
6161

6262
# the path relative working path
@@ -217,10 +217,10 @@ serve_from_sub_path = true
217217
# only a GET request to https://grafana.com to get the latest versions.
218218
;check_for_plugin_updates = true
219219

220-
# Google Analytics universal tracking code, only enabled if you specify an id here
220+
# Google Analytics universal tracking code, only enabled if you specify an dummy_id here
221221
;google_analytics_ua_id =
222222

223-
# Google Tag Manager ID, only enabled if you specify an id here
223+
# Google Tag Manager ID, only enabled if you specify an dummy_id here
224224
;google_tag_manager_id =
225225

226226
# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set
@@ -353,7 +353,7 @@ serve_from_sub_path = true
353353
# Allow non admin users to create organizations
354354
;allow_org_create = true
355355

356-
# Set to true to automatically assign new users to the default organization (id 1)
356+
# Set to true to automatically assign new users to the default organization (dummy_id 1)
357357
;auto_assign_org = true
358358

359359
# Set this value to automatically add new users to the provided organization (if auto_assign_org above is set to true)
@@ -504,8 +504,8 @@ org_role = Admin
504504
;client_id = some_client_id
505505
;client_secret = some_client_secret
506506
;scopes = openid email profile
507-
;auth_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
508-
;token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
507+
;auth_url = https://login.microsoftonline.com/<tenant-dummy_id>/oauth2/v2.0/authorize
508+
;token_url = https://login.microsoftonline.com/<tenant-dummy_id>/oauth2/v2.0/token
509509
;allowed_domains =
510510
;allowed_groups =
511511
;role_attribute_strict = false
@@ -518,9 +518,9 @@ org_role = Admin
518518
;client_id = some_id
519519
;client_secret = some_secret
520520
;scopes = openid profile email groups
521-
;auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
522-
;token_url = https://<tenant-id>.okta.com/oauth2/v1/token
523-
;api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
521+
;auth_url = https://<tenant-dummy_id>.okta.com/oauth2/v1/authorize
522+
;token_url = https://<tenant-dummy_id>.okta.com/oauth2/v1/token
523+
;api_url = https://<tenant-dummy_id>.okta.com/oauth2/v1/userinfo
524524
;allowed_domains =
525525
;allowed_groups =
526526
;role_attribute_path =
@@ -617,7 +617,7 @@ org_role = Admin
617617
;cloud = AzureCloud
618618

619619
# Specifies whether Grafana hosted in Azure service with Managed Identity configured (e.g. Azure Virtual Machines instance)
620-
# If enabled, the managed identity can be used for authentication of Grafana in Azure services
620+
# If enabled, the managed identity can be used for authentication of Grafana in Azure adapters
621621
# Disabled by default, needs to be explicitly enabled
622622
;managed_identity_enabled = false
623623

docker-compose.override.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22

3-
# Local services are available on their ports, but also available on:
3+
# Local adapters are available on their ports, but also available on:
44
# http://api.localhost.myapp.com: backend
55
# etc. To enable it, update .env, set:
66
# DOMAIN=localhost.myapp.com
@@ -13,11 +13,11 @@ services:
1313
- "8090:8080"
1414
# Duplicate the command from docker-compose.yml to add --api.insecure=true
1515
command:
16-
# Enable Docker in Traefik, so that it reads labels from Docker services
16+
# Enable Docker in Traefik, so that it reads labels from Docker adapters
1717
- --providers.docker
18-
# Add a constraint to only use services with the label for this stack
18+
# Add a constraint to only use adapters with the label for this stack
1919
- --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`)
20-
# Do not expose all Docker services, only the ones explicitly exposed
20+
# Do not expose all Docker adapters, only the ones explicitly exposed
2121
- --providers.docker.exposedbydefault=false
2222
# Create an entrypoint "http" listening on port 80
2323
- --entrypoints.http.address=:80

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- traefik.docker.network=traefik-public
1616
- traefik.constraint-label=traefik-public
1717

18-
- traefik.http.services.${TRAEFIK_STACK_NAME?Variable not set}-api.loadbalancer.server.port=8000
18+
- traefik.http.adapters.${TRAEFIK_STACK_NAME?Variable not set}-api.loadbalancer.server.port=8000
1919

2020
- traefik.http.routers.${TRAEFIK_STACK_NAME?Variable not set}-api-http.rule=Host(`api.${TRAEFIK_DOMAIN?Variable not set}`)
2121
- traefik.http.routers.${TRAEFIK_STACK_NAME?Variable not set}-api-http.entrypoints=http
@@ -92,7 +92,7 @@ services:
9292
- traefik.docker.network=traefik-public
9393
- traefik.constraint-label=traefik-public
9494

95-
- traefik.http.services.${TRAEFIK_STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080
95+
- traefik.http.adapters.${TRAEFIK_STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080
9696

9797
- traefik.http.routers.${TRAEFIK_STACK_NAME?Variable not set}-adminer-http.rule=Host(`adminer.${TRAEFIK_DOMAIN?Variable not set}`)
9898
- traefik.http.routers.${TRAEFIK_STACK_NAME?Variable not set}-adminer-http.entrypoints=http

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ lint.ignore = [
8484
"ERA001",
8585
"PLR0913",
8686
"N803",
87+
"N805",
8788
"N815",
8889
"UP046",
90+
"FBT001",
91+
"FBT002",
8992
]
9093
exclude = [
9194
"app/db/migrations",

0 commit comments

Comments
 (0)