diff --git a/.gitignore b/.gitignore index 3ea2fcd..3f0c30d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ node_modules uploads *.log -.env \ No newline at end of file +.env +template.json + diff --git a/README.md b/README.md index 4fa9087..87050a9 100755 --- a/README.md +++ b/README.md @@ -1,16 +1,53 @@ -# BSOD-API -A basic API to injest `.dmp` files and return analyzed text. +# WebDBG +A React Static Web App (SWA) frontend with a containerized Javascript API backend that injests `.dmp` files and returns analyzed text. + +## Public Site +This project is hosted publicly on a best effort basis at https://webdbg.rtech.support as a service by the [r/Techsupport Discord Server](https://rtech.support/discord). ## Components -- [bsod-api](https://github.com/PipeItToDevNull/bsod-api) - - Frontend SWA in react - - Backend API written in JS that sends and recieves results from the Windows SDK. +- [WebDBG](https://github.com/r-Techsupport/WebDBG) + - Frontend SWA in react. + - Backend API written in JS that sends and recieves results from the Windows SDK container. - [WinDebug-Container](https://github.com/PipeItToDevNull/WinDebug-Container) - - The base container for the API + - The base container for the API. - Windows Core 2022 image containing Windows SDK with only Debugging Tools installed. +- [Debug-Dmps](https://github.com/PipeItToDevNull/Debug-Dmps) + - The current PowerShell based backend processor. + - There is an [open issue](https://github.com/r-Techsupport/WebDBG/issues/13) to rewrite the backend in JS. + +## SWA +Configure the SWA by copying `env.example` to `.env` and configuring appropriately. +- The `REACT_APP_API_URL` must not end in a trailing slash + +### Local development +From inside the `swa` directory run `npm start` to launch the development server. + +### Azure deployment method +Configure the Azure deployment by copying `template.json.example` to `template.json` and configuring appropriately. + +```bash +az group create --name --location eastus2 +az deployment group create --resource-group --template-file template.json +``` +Once deployed, the SWA will now be pointed at your repo and is waiting for a build to be submitted. You must create and configure your own GithubAction and repository secrets and variables for this portion of the deployment. + +The following Secrets and Variables must be configured under the "Actions" context: +- AZURE_STATIC_WEB_APPS_API_TOKEN +- REACT_APP_API_URL +- REACT_APP_REPO_URL +- REACT_APP_SITE_NAME ## API -### Usage +### Local development +On a Windows host with Docker installed and using Windows containers execute the following from inside the `api` directory to build and launch the [WinDebug-Container](https://github.com/PipeItToDevNull/WinDebug-Container) based API. + +```bash +docker build -t api . ; docker run --rm -it -p 3000:3000 api +``` + +Once launched use `REACT_APP_API_URL=http://localhost:3000` in your `.env` and launch your local development SWA. + +### PUT endpoint usage With a file ```bash curl.exe -X PUT http://localhost:3000/analyze-dmp -F "dmpFile=@path/to/test.dmp" @@ -20,13 +57,3 @@ With a URL ```bash curl -X PUT http://localhost:3000/analyze-dmp -F "url=http://example.com/file.dmp" ``` -## SWA -### Azure deployment method -```bash -az group create --name --location eastus2 -az deployment group create --resource-group --template-file template.json -``` -Once deployed, the SWA will now be pointed at your repo and is waiting for a build to be submitted. You must create and configure your own GithubAction for this portion of the deployment. - -## Notes -- The `REACT_APP_API_URL` must not end in a trailing slash \ No newline at end of file diff --git a/swa/public/favicon.ico b/swa/public/favicon.ico index a11777c..8dc72c0 100644 Binary files a/swa/public/favicon.ico and b/swa/public/favicon.ico differ diff --git a/swa/public/index.html b/swa/public/index.html index 70e2f9e..70e296b 100644 --- a/swa/public/index.html +++ b/swa/public/index.html @@ -24,7 +24,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - BSOD Debug-o-tron + WebDBG diff --git a/swa/public/logo128.png b/swa/public/logo128.png new file mode 100644 index 0000000..2e68b9f Binary files /dev/null and b/swa/public/logo128.png differ diff --git a/swa/public/logo192.png b/swa/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/swa/public/logo192.png and /dev/null differ diff --git a/swa/public/logo256.png b/swa/public/logo256.png new file mode 100644 index 0000000..f679552 Binary files /dev/null and b/swa/public/logo256.png differ diff --git a/swa/public/logo512.png b/swa/public/logo512.png index a4e47a6..c27d7b6 100644 Binary files a/swa/public/logo512.png and b/swa/public/logo512.png differ diff --git a/swa/public/manifest.json b/swa/public/manifest.json index d0c982f..a15ab6c 100644 --- a/swa/public/manifest.json +++ b/swa/public/manifest.json @@ -1,5 +1,5 @@ { - "short_name": "BSOD Debug-o-tron", + "short_name": "WebDBG", "name": "Web based dmp file processor", "icons": [ { @@ -8,9 +8,14 @@ "type": "image/x-icon" }, { - "src": "logo192.png", + "src": "logo128.png", "type": "image/png", - "sizes": "192x192" + "sizes": "128x128" + }, + { + "src": "logo256.png", + "type": "image/png", + "sizes": "256x256" }, { "src": "logo512.png", diff --git a/swa/src/App.js b/swa/src/App.js index 1826e07..b51e10d 100644 --- a/swa/src/App.js +++ b/swa/src/App.js @@ -183,7 +183,7 @@ const FileUpload = () => {
- {!error && !responseData &&

{loading ? 'Processing...' : 'Upload your .dmp file or provide a download link above'}

} + {!error && !responseData &&

{loading ? 'Processing...' : 'Upload your .dmp file or a .zip file containing multiple .dmp files directly or via a direct link.'}

} {error &&

{error}

} {responseData && ( <>{renderJsonToHtml(JSON.parse(responseData))} diff --git a/swa/src/footer.js b/swa/src/footer.js index 795afc7..49b7890 100644 --- a/swa/src/footer.js +++ b/swa/src/footer.js @@ -9,6 +9,7 @@ const Footer = () => { return ( ); }; diff --git a/swa/src/logo.svg b/swa/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/swa/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/template.json b/template.json index 2063c64..f386057 100644 --- a/template.json +++ b/template.json @@ -5,10 +5,10 @@ { "type": "Microsoft.Web/staticSites", "apiVersion": "2022-09-01", - "name": "bsod-swa", + "name": "WebDBG", "location": "East US 2", "properties": { - "repositoryUrl": "https://github.com/PipeItToDevNull/bsod-api", + "repositoryUrl": "https://github.com/r-Techsupport/WebDBG", "branch": "main", "buildProperties": { "appLocation": "/swa", @@ -21,5 +21,4 @@ } } ] - } - \ No newline at end of file +} diff --git a/template.json.example b/template.json.example new file mode 100644 index 0000000..a4924cc --- /dev/null +++ b/template.json.example @@ -0,0 +1,25 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.Web/staticSites", + "apiVersion": "2022-09-01", + "name": "SWA NAME", + "location": "East US 2", + "properties": { + "repositoryUrl": "REPO URL", + "branch": "main", + "buildProperties": { + "appLocation": "/swa", + "outputLocation": "build" + } + }, + "sku": { + "name": "Free", + "tier": "Free" + } + } + ] + } + \ No newline at end of file