-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from hashtopolis/bug/windows-path
Adding test framework, fix for window paths and fix for preprocessors
- Loading branch information
Showing
32 changed files
with
2,607 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM mcr.microsoft.com/windows-cssc/python3.7.2server:ltsc2022 | ||
# Nano image doesn't work because some API are not available | ||
|
||
# TODO: Support for USER_CMD_PRE and POST? | ||
# TODO: Create a vscode user? | ||
# TODO: OpenCL/Nvidia? | ||
|
||
WORKDIR C:/App/ | ||
|
||
# Installing python requirements | ||
COPY requirements.txt C:/App/ | ||
COPY requirements-tests.txt C:/App/ | ||
RUN pip3 install -r requirements.txt -r requirements-tests.txt | ||
|
||
# Fix for host.docker.internal not working | ||
COPY .devcontainer/windows/entrypoint.ps1 C:/ | ||
COPY .devcontainer/windows/fix-hosts.ps1 C:/ | ||
|
||
# Setting entrypoint | ||
ENTRYPOINT "C:\entrypoint.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3" | ||
services: | ||
hashtopolis-agent-windows: | ||
container_name: hashtopolis_agent_windows | ||
build: | ||
context: ../.. | ||
dockerfile: .devcontainer/windows/Dockerfile | ||
volumes: | ||
- ../..:C:\App\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
powershell C:\fix-hosts.ps1 | ||
cmd /c ping -t localhost > $null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Source https://github.com/docker/for-win/issues/1976 | ||
# Credits https://github.com/brunnotelma | ||
$hostsFile = "C:\Windows\System32\drivers\etc\hosts" | ||
|
||
try { | ||
$DnsEntries = @("host.docker.internal", "gateway.docker.internal") | ||
# Tries resolving names for Docker | ||
foreach ($Entry in $DnsEntries) { | ||
# If any of the names are not resolved, throws an exception | ||
Resolve-DnsName -Name $Entry -ErrorAction Stop | ||
} | ||
|
||
# If it passes, means that DNS is already configured | ||
Write-Host("DNS settings are already configured.") | ||
} catch { | ||
# Gets the gateway IP address, that is the Host's IP address in the Docker network | ||
$ip = (ipconfig | where-object {$_ -match "Default Gateway"} | foreach-object{$_.Split(":")[1]}).Trim() | ||
# Read the current content from Hosts file | ||
$src = [System.IO.File]::ReadAllLines($hostsFile) | ||
# Add the a new line after the content | ||
$lines = $src += "" | ||
|
||
# Check the hosts file and write it in if its not there... | ||
if((cat $hostsFile | Select-String -Pattern "host.docker.internal") -And (cat $hostsFile | Select-String -Pattern "gateway.docker.internal")) { | ||
For ($i=0; $i -le $lines.length; $i++) { | ||
if ($lines[$i].Contains("host.docker.internal")) | ||
{ | ||
$lines[$i] = ("{0} host.docker.internal" -f $ip) | ||
$lines[$i+1] = ("{0} gateway.docker.internal" -f $ip) | ||
break | ||
} | ||
} | ||
} else { | ||
$lines = $lines += "# Added by Docker for Windows" | ||
$lines = $lines += ("{0} host.docker.internal" -f $ip) | ||
$lines = $lines += ("{0} gateway.docker.internal" -f $ip) | ||
$lines = $lines += "# End of section" | ||
} | ||
# Writes the new content to the Hosts file | ||
[System.IO.File]::WriteAllLines($hostsFile, [string[]]$lines) | ||
|
||
Write-Host("New DNS settings written successfully.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
*.iml | ||
*.exe | ||
7zr | ||
*.log | ||
*.json | ||
!/tests/*.json | ||
crackers | ||
preprocessors | ||
prince | ||
files | ||
hashlists | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Current File", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.