Skip to content

Commit

Permalink
Fix naming and script
Browse files Browse the repository at this point in the history
  • Loading branch information
antibagr committed Nov 24, 2023
1 parent a5d7e00 commit 56bb24d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
14 changes: 6 additions & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
ENVIRONMENT=development
DEBUG=true
TEST_SSL_WORKDIR=/home/testssl_user
TEST_SSL_CONTAINER_NAME=testssl.sh
TEST_SSL_COMMANDS_FILE=commands.txt
TEST_SSL_OUTPUT_DIR=results
CLICKHOUSE_HOST=clickhouse
CLICKHOUSE_HOST=clickhouse
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=clickhouse_password
CLICKHOUSE_DB=default
CLICKHOUSE_TABLE_NAME=ssl_check
CLICKHOUSE_DB=default
TEST_SSL_CONTAINER_NAME=testssl.sh
TEST_SSL_WORKDIR=/home/testssl_user
TEST_SSL_OUTPUT_DIR=results
TEST_SSL_COMMANDS_FILE=commands.txt
4 changes: 2 additions & 2 deletions app/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import click

from app.services.service import application_dependencies, ssl_checker_service
from app.services.service import analyze_service, application_dependencies


@click.group()
Expand All @@ -18,7 +18,7 @@ def handle_exit_signal(_sig, _frame) -> t.NoReturn:
@click.command()
def run() -> None:
with application_dependencies():
ssl_checker_service.run()
analyze_service.analyze()


cli.add_command(run)
Expand Down
4 changes: 2 additions & 2 deletions app/services/ssl_checker.py → app/services/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def get(self) -> t.Generator[FQDN, None, None]:

@t.final
@attrs.define(slots=True, frozen=False, kw_only=True)
class SSLCheckerService:
class AnalyzeService:
_data_provider_repo: DataProviderRepositoryInterface
_db: DB

def run(self) -> None:
def analyze(self) -> None:
logger.info("Starting SSL Checker")
for fqdn in self._data_provider_repo.get():
logger.info(f"Adding {fqdn}")
Expand Down
4 changes: 2 additions & 2 deletions app/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from app.lib.testssl import TestSSLContainer, TestSSLJsonParser
from app.repository.db import DB
from app.repository.provider import TestSSLDataProviderRepository
from app.services.ssl_checker import SSLCheckerService
from app.services.analyze import AnalyzeService
from app.settings import settings

# Dependency Layer
Expand Down Expand Up @@ -40,7 +40,7 @@


# Service Layer
ssl_checker_service = SSLCheckerService(
analyze_service = AnalyzeService(
data_provider_repo=data_provider_repo,
db=db,
)
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
container_name: testssl.sh
build:
context: ..
dockerfile: deploy/testssl.Dockerfile
dockerfile: deploy/testssl/Dockerfile
environment:
- MASS_TESTING_MODE=parallel
env_file:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/get_cmd_lines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
while IFS= read -r line || [ -n "$line" ]; do
host=$(echo "$line" | cut -d: -f1)
port=$(echo "$line" | cut -d: -f2)
cmd="MAX_PARALLEL=100 testssl.sh --jsonfile ./results/$host --mode parallel --quiet --protocols --server-defaults --overwrite $host:$port"
cmd="MAX_PARALLEL=100 testssl.sh --jsonfile ./results/${host////_} --mode parallel --quiet --protocols --server-defaults --overwrite $host:$port"

echo "$cmd" >>"$2"
done <"$1"
Expand Down

0 comments on commit 56bb24d

Please sign in to comment.