Skip to content

Commit

Permalink
Rename project (#32)
Browse files Browse the repository at this point in the history
* add the template

* rename

* add the template

* clarify and add content to close #17

* add icons for #12

* changes for rTS migration

* rename back
  • Loading branch information
PipeItToDevNull authored Dec 8, 2024
1 parent ad686ae commit 5a05481
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 28 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
node_modules
uploads
*.log
.env
.env
template.json

61 changes: 44 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <your-resource-group> --location eastus2
az deployment group create --resource-group <your-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"
Expand All @@ -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 <your-resource-group> --location eastus2
az deployment group create --resource-group <your-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
Binary file modified swa/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion swa/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
-->
<title>BSOD Debug-o-tron</title>
<title>WebDBG</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file added swa/public/logo128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed swa/public/logo192.png
Binary file not shown.
Binary file added swa/public/logo256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified swa/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions swa/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"short_name": "BSOD Debug-o-tron",
"short_name": "WebDBG",
"name": "Web based dmp file processor",
"icons": [
{
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion swa/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const FileUpload = () => {
</div>
</div>
<div id="content">
{!error && !responseData && <p>{loading ? 'Processing...' : 'Upload your .dmp file or provide a download link above'}</p>}
{!error && !responseData && <p>{loading ? 'Processing...' : 'Upload your .dmp file or a .zip file containing multiple .dmp files directly or via a direct link.'}</p>}
{error && <p style={{ color: 'red' }}>{error}</p>}
{responseData && (
<>{renderJsonToHtml(JSON.parse(responseData))}</>
Expand Down
1 change: 1 addition & 0 deletions swa/src/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Footer = () => {
return (
<footer>
<p>Find the source for this project <a id="repo_url" href="#">on GitHub</a></p>
<p style={{fontSize: `.75em`}}><a href="https://www.flaticon.com/free-icons/dmp" title="dmp icons">Dmp icons created by PixelX - Flaticon</a></p>
</footer>
);
};
Expand Down
1 change: 0 additions & 1 deletion swa/src/logo.svg

This file was deleted.

7 changes: 3 additions & 4 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -21,5 +21,4 @@
}
}
]
}

}
25 changes: 25 additions & 0 deletions template.json.example
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}

0 comments on commit 5a05481

Please sign in to comment.