Skip to content

Commit

Permalink
Update pkgs & README
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Feb 4, 2024
1 parent 8ae3828 commit 6f2548e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Usage

1. Install the extension from the [marketplace](https://marketplace.visualstudio.com/items?itemName=tomatocake.pterodactyl-vsc) or as VSIX by building it yourself, or by downloading it from the [releases page](https://github.com/DEVTomatoCake/Pterodactyl-vsc/releases).
1. Install the extension from the [marketplace](https://marketplace.visualstudio.com/items?itemName=TomatoCake.pterodactyl-vsc) or as VSIX by building it yourself, or by downloading it from the [releases page](https://github.com/DEVTomatoCake/Pterodactyl-vsc/releases).
2. Open the command palette (default: `Ctrl + Shift + P`) and run `Pterodactyl: Connect to server`.
3. Enter the panel URL and your client (not application) API key from Account Settings -> API Credentials.
4. Select the server you want to edit the files of.
Expand All @@ -13,15 +13,15 @@
- `pterodactyl-vsc.panelUrl`: The URL of the Pterodactyl panel.
- `pterodactyl-vsc.serverId`: Server ID of the server you want to edit the files of, found in the URL of the server's page.
- `pterodactyl-vsc.apiKey`: Client API key of the server you want to edit the files of.
- `pterodactyl-vsc.proxyUrl`: The proxy URL used to circumvent CORS blocking requests to the panel. Leave it at the default value unless you know what you're doing. See [CORS Proxy](#cors-proxy) for more information.
- `pterodactyl-vsc.proxyUrl`: The proxy URL used to circumvent CORS blocking `fetch` requests to the panel. Leave it at the default value unless you know what you're doing. See [CORS Proxy](#cors-proxy) for more information.

## CORS Proxy

By default the extension uses the proxy URL `https://pterodactyl-vsc.tomatocake.workers.dev/?url=`.
The proxy was created by me to circumvent CORS blocking requests to the panel.

There are several options available if you don't want to use the default proxy:
1. Use your own proxy using the following [Cloudflare worker](https://workers.cloudflare.com) code:
1. Use your own proxy using the following worker code, e.g. by using [Cloudflare Workers](https://workers.cloudflare.com) code:
```js
export default {
async fetch(request) {
Expand Down
57 changes: 35 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"categories": [
"Other"
],
"qna": false,
"activationEvents": [
"onFileSystem:pterodactyl"
],
Expand Down Expand Up @@ -110,8 +111,8 @@
"sideload-win": "npx serve --cors -l 5000 --ssl-cert %userprofile%\\certs\\localhost.pem --ssl-key %userprofile%\\certs\\localhost-key.pem"
},
"devDependencies": {
"@types/node": "^20.11.13",
"@types/vscode": "^1.85.0",
"@types/node": "^20.11.16",
"@types/vscode": "^1.86.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vscode/vsce": "^2.23.0",
Expand Down

0 comments on commit 6f2548e

Please sign in to comment.