-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: set GHCS domain name and port visibility
- Loading branch information
Showing
4 changed files
with
63 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node | ||
{ | ||
"name": "Node.js", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bookworm", | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [5173, 1317, 26657, 26656], | ||
"portsAttributes": { | ||
"5173": { | ||
"label": "UI", | ||
"onAutoForward": "openBrowser" | ||
}, | ||
"1317": { | ||
"label": "API", | ||
"onAutoForward": "silent" | ||
}, | ||
"26657": { | ||
"label": "RPC", | ||
"onAutoForward": "silent" | ||
}, | ||
"26656": { | ||
"label": "P2P", | ||
"onAutoForward": "silent" | ||
} | ||
}, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "bash /workspaces/dapp-offer-up/make_ports_public.sh 26657 5173 1317", | ||
"postStartCommand": "yarn install", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
} | ||
} |
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,19 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
# Function to change port visibility to public | ||
change_port_visibility() { | ||
local port=$1 | ||
gh codespace ports visibility $port:public -c $CODESPACE_NAME | ||
} | ||
|
||
# Check if at least one port is provided | ||
if [ $# -eq 0 ]; then | ||
echo "Usage: $0 <port1> [port2 ... portN]" | ||
exit 1 | ||
fi | ||
|
||
# Loop through each provided port and change its visibility to public | ||
for port in "$@"; do | ||
change_port_visibility $port | ||
done |
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