Skip to content

Commit

Permalink
add: gitleaks (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
notdodo authored Sep 21, 2024
1 parent 9ddfa75 commit cdb3426
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Gitleaks
on:
pull_request:

jobs:
gitleaks:
uses: notdodo/github-actions/.github/workflows/[email protected]
28 changes: 14 additions & 14 deletions pulumi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,6 @@
),
)

bot_webhook_gw = apigatewayv2.Api(
f"{RESOURCES_PREFIX}-webhook",
protocol_type="HTTP",
route_key="POST /erfiume_bot",
target=bot_lambda.arn,
)
lambda_.Permission(
f"{RESOURCES_PREFIX}-lambda-bot-api-gateway",
action="lambda:InvokeFunction",
function=bot_lambda.arn,
principal="apigateway.amazonaws.com",
source_arn=bot_webhook_gw.execution_arn.apply(lambda arn: f"{arn}/*/*"),
)

cloudwatch.LogGroup(
f"{RESOURCES_PREFIX}-fetcher",
log_group_class="STANDARD",
Expand All @@ -246,6 +232,20 @@
)

if pulumi.get_stack() == "production":
bot_webhook_gw = apigatewayv2.Api(
f"{RESOURCES_PREFIX}-webhook",
protocol_type="HTTP",
route_key="POST /erfiume_bot",
target=bot_lambda.arn,
)
lambda_.Permission(
f"{RESOURCES_PREFIX}-lambda-bot-api-gateway",
action="lambda:InvokeFunction",
function=bot_lambda.arn,
principal="apigateway.amazonaws.com",
source_arn=bot_webhook_gw.execution_arn.apply(lambda arn: f"{arn}/*/*"),
)

Webhook(
f"{RESOURCES_PREFIX}-apigateway-registration",
token=pulumi.Config().require_secret("telegram-bot-token"),
Expand Down
5 changes: 1 addition & 4 deletions pulumi/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
Expand All @@ -8,9 +6,8 @@ services:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
- SERVICE="dynamodb"
- EAGER_SERVICE_LOADING=1
- DEBUG=${DEBUG:-0}
- DEBUG=${DEBUG:-1}
- PERSISTENCE=${PERSISTENCE:-0}
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
Expand Down

0 comments on commit cdb3426

Please sign in to comment.