Skip to content
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

Regex Scanner Added to graph-updater service #171

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env")

GRAPHQL_HOST: str = Field("127.0.0.1")
GRAPHQL_HOST: str = Field("0.0.0.0")
GRAPHQL_PORT: int = Field(4000)

DB_HOST: str = Field("http://127.0.0.1:8529")
Expand Down
2 changes: 1 addition & 1 deletion api/src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def close(self) -> bool:
return True

def _key_safe_url(self, url: str) -> str:
return url.replace("://", "-").replace("/", "-")
return url.replace("://", "-").replace("/", "-").replace("{","(").replace("}",")")

def insert_endpoint(self, endpoint):
endpoint_dict = strawberry.asdict(endpoint)
Expand Down
76 changes: 76 additions & 0 deletions architecture.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Direction: left
k8s{
NATS : NATS {
EventsUpdate : {
shape : queue
}
EndpointScanner\.githubEndpoints : {
shape : queue
}
EndpointScanner\.webEndpoints : {
shape : queue
}
EndpointScanner\.containerEndpoints : {
shape : queue
}
}
CronJob : {
shape : image
icon : https://icons.terrastruct.com/essentials%2F033-repeat.svg
}
GraphUpdater : Graph Updater {
shape : image
icon : https://icons.terrastruct.com/azure%2FManagement%20and%20Governance%20Service%20Color%2FResource%20Graph%20Explorer.svg
}
API : {

}
ArangoDB : {

}
scanner1 : {}
scanner2 : {}
scanner3 : {}
UI : UI Server {
shape : image
icon : https://icons.terrastruct.com/dev%2Freact.svg
}
}
PhacDnsRepo : PHAC DNS Repo {
shape : image
icon : https://icons.terrastruct.com/dev%2Fgithub.svg
}
ServiceRepo: Service Git Repo{
shape : image
icon : https://icons.terrastruct.com/dev%2Fgithub.svg
}
Client Browser {
shape : image
icon : https://icons.terrastruct.com/tech%2Fbrowser-2.svg
# near : bottom-left
}
k8s.CronJob <- PhacDnsRepo : scan periodically
k8s.CronJob -> k8s.NATS.EventsUpdate : pub
k8s.GraphUpdater <- ServiceRepo : 1. extract referencing endpoints
k8s.GraphUpdater -> k8s.NATS.EventsUpdate : sub
# k8s.GraphUpdater <- k8s.NATS.EventsUpdate : sub
k8s.GraphUpdater -> k8s.API : update
k8s.GraphUpdater -> k8s.NATS.EndpointScanner\.githubEndpoints : pub
k8s.GraphUpdater -> k8s.NATS.EndpointScanner\.webEndpoints : pub
k8s.GraphUpdater -> k8s.NATS.EndpointScanner\.containerEndpoints : pub
k8s.scanner1 -> k8s.NATS.EndpointScanner\.githubEndpoints : sub
k8s.scanner2 -> k8s.NATS.EndpointScanner\.webEndpoints : sub
k8s.scanner3 -> k8s.NATS.EndpointScanner\.containerEndpoints : sub
# k8s.scanner1 <- k8s.NATS.EndpointScanner\.githubEndpoints : sub
# k8s.scanner2 <- k8s.NATS.EndpointScanner\.webEndpoints : sub
# k8s.scanner3 <- k8s.NATS.EndpointScanner\.containerEndpoints : sub
k8s.scanner1 -> k8s.API : update
k8s.scanner2 -> k8s.API : update
k8s.scanner3 -> k8s.API : update
# k8s.Scanners -> k8s.API : update
k8s.API <- k8s.ArangoDB : Read
k8s.API -> k8s.ArangoDB : Write

k8s.UI <- k8s.API : Read

Client Browser -> k8s.UI
1 change: 1 addition & 0 deletions graph-updater/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV NODE_ENV production
WORKDIR /app

#RUN apk --no-cache add curl=8.5.0-r0
RUN apk add --no-cache git curl

COPY package*.json ./

Expand Down
Loading