-
Notifications
You must be signed in to change notification settings - Fork 0
feat: controller cash #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: traffic_filtering
Are you sure you want to change the base?
Changes from all commits
ba37df1
2481316
39b69df
ca2c218
704553e
6a607e3
b503dae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| SERVER_HOST=localhost | ||
| SERVER_PORT=50051 | ||
| MAX_MESSAGE_SIZE=4194304 | ||
| MAX_MESSAGE_SIZE=4194304 | ||
| REDIS_PASSWORD=mysecretpassword | ||
| REDIS_USER=myuser | ||
| REDIS_USER_PASSWORD=myuserpassword | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,5 @@ | ||
| load("@rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
|
||
| go_binary( | ||
| name = "grpc_server", | ||
| embed = [":grpc_server_lib"], | ||
| visibility = ["//visibility:public"], | ||
| data = [ | ||
| "//internal/service/config", | ||
| ], | ||
|
Comment on lines
-7
to
-9
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. почему убрали? |
||
| ) | ||
|
|
||
| go_library( | ||
| name = "grpc_server_lib", | ||
| srcs = ["main.go"], | ||
|
|
@@ -19,9 +10,17 @@ go_library( | |
| "//internal/grpcserver", | ||
| "//internal/manager", | ||
| "//internal/service/service", | ||
| "//internal/service/storage", | ||
| "//pkg/proto/admin_service:admin_service_go_proto", | ||
| "//pkg/proto/communication:communication_go_proto", | ||
| "@org_golang_google_grpc//:go_default_library", | ||
| "@org_golang_google_grpc//reflection", | ||
| "@com_github_subosito_gotenv//:go_default_library", | ||
| ], | ||
| ) | ||
|
|
||
| go_binary( | ||
| name = "grpc_server", | ||
| embed = [":grpc_server_lib"], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| version: '3.9' | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis:latest | ||
| container_name: redis_container | ||
| environment: | ||
| - REDIS_PASSWORD=${REDIS_PASSWORD} | ||
| - REDIS_USER=${REDIS_USER} | ||
| - REDIS_USER_PASSWORD=${REDIS_USER_PASSWORD} | ||
| ports: | ||
| - "6379:6379" | ||
| volumes: | ||
| - ./redisdata:/data | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| cpus: '0.50' | ||
| memory: 512M | ||
| reservations: | ||
| cpus: '0.25' | ||
| memory: 256M | ||
| command: > | ||
| sh -c ' | ||
| mkdir -p /usr/local/etc/redis && | ||
| echo "bind 0.0.0.0" > /usr/local/etc/redis/redis.conf && | ||
| echo "requirepass $REDIS_PASSWORD" >> /usr/local/etc/redis/redis.conf && | ||
| echo "appendonly yes" >> /usr/local/etc/redis/redis.conf && | ||
| echo "appendfsync everysec" >> /usr/local/etc/redis/redis.conf && | ||
| echo "user default on nopass ~* +@all" > /usr/local/etc/redis/users.acl && | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. почему? и сразу нормальный контракт взаимодействия описать |
||
| echo "user $REDIS_USER on >$REDIS_USER_PASSWORD ~* +@all" >> /usr/local/etc/redis/users.acl && | ||
| redis-server /usr/local/etc/redis/redis.conf --aclfile /usr/local/etc/redis/users.acl | ||
| ' | ||
| healthcheck: | ||
| test: ["CMD", "redis-cli", "-a", "$REDIS_PASSWORD", "ping"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 5 | ||
| restart: unless-stopped | ||
| tty: true | ||
| stdin_open: true | ||
|
|
||
| controller: | ||
| build: | ||
| dockerfile: Dockerfile.controller | ||
| environment: | ||
| - REDIS_ADDR=redis:6379 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а почему оно не в .env??? |
||
| depends_on: | ||
| - redis | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему контроллер при обращаениях к БД не использует креды?
давайте их или уберем или будет нормальный запросы делать с кредами смысл делать креды а потом default on nopass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я подумал, что убрать креды -- плохая мысль -- работаем по паролю но честно по паролю