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

feat: Fix improper renderering of context #71

Merged
merged 1 commit into from
Feb 23, 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
4 changes: 4 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ WORKDIR /app

COPY . .

# This is necessary to fix "dubious ownership" issues you can encounter
# when scanning local repos
RUN git config --global safe.directory '*'

# Exports
ENV SECRETMAGPIE_LISTEN_ADDR=0.0.0.0:8080
ENV SM_COMMAND "docker run punksecurity/secret-magpie --"
Expand Down
20 changes: 15 additions & 5 deletions template.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,26 @@
<span class"orange">${data.secret}</span>
</p>
<p>
<span><span class="orange">Context: </span><code>${data.context.split('\\n').join('</br>')}</code></span>
<span><span class="orange">Context: </span><code id="context-code"></code></span>
</p>
<p>
<span class="orange">Extra Context: </span>
<code>
${data.extra_context.split('\n').join('</br>')}
</code>
<code id="extra-context-code"></code>
</p>
`;

let context = eGui.querySelector("#context-code");
let extra_context = eGui.querySelector("#context-code");

for (let line of data.context.split('\n')) {
context.appendChild(document.createTextNode(line));
context.appendChild(document.createElement('br'));
}

for (let line of data.extra_context.split('\n')) {
extra_context.appendChild(document.createTextNode(line));
extra_context.appendChild(document.createElement('br'));
}
}

getGui() {
Expand Down Expand Up @@ -869,7 +880,6 @@
background-color: #1d2024;
cursor: pointer;
}

</style>
</head>

Expand Down
Loading