Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Commit 7ec93a6

Browse files
authored
README tweak
1 parent 833ac2a commit 7ec93a6

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.devcontainer/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update \
77
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/library-scripts \
88
#
99
# Remove the OPENVPN_CONFIG variable since we don't neeed it after is written to a file
10-
&& echo "unset OPENVPN_CONFIG" | tee -a /etc/bash.bashrc > /etc/profile.d/unset-openvpn-config.sh \
10+
&& echo 'OPENVPN_CONFIG=""' >> /etc/environment \
11+
&& echo "unset OPENVPN_CONFIG" | tee -a /etc/bash.bashrc > /etc/profile.d/999-unset-openvpn-config.sh \
1112
&& if [ -d "/etc/zsh" ]; then echo "unset OPENVPN_CONFIG" >> /etc/zsh/zshenv; fi

README.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
1-
# Using the OpenVPN client from Codespaces
1+
# Using the OpenVPN client from GitHub Codespaces
2+
3+
GitHub Codespaces provides a useful environment for development that is separated from your local machine. This provides some nice security benifits due to the fact that the codespace has no direct route to your machine or the network it is sitting in. However, you may have a resource you need to access that is in a private network. This sample illustrates how to set up the OpenVPN (v2) client in a codespace to connect into a OpenVPN capable VPN gateway.
4+
5+
# Using the sample
6+
7+
1. Your VPN admistrator should be able to provide you with an OpenVPN configuraion file. This particular sample is assuming you are using certificate based authentication to access the VPN. We'll call this file `vpnconfig.ovpn`.
8+
2. Work with your administrator to place any needed certificates or keys in the `vpnconfig.ovpn` file. You can tell if the certificates and keys are in the file by looking for the following:
9+
10+
```
11+
<ca>
12+
-----BEGIN CERTIFICATE-----
13+
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
14+
...
15+
-----END CERTIFICATE-----
16+
</ca>
17+
18+
<cert>
19+
-----BEGIN CERTIFICATE-----
20+
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
21+
...
22+
-----END CERTIFICATE-----
23+
</cert>
24+
25+
<key>
26+
-----BEGIN CERTIFICATE-----
27+
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
28+
...
29+
-----END CERTIFICATE-----
30+
</key>
31+
32+
```
33+
34+
For example, see [here](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-openvpn-clients#linux) for information on setting up config file for a connection to an Azure VPN Gateway. You can skip the steps that install the client and use the GUI.
35+
3. Create a Codespaces user secret called `OPENVPN_CONFIG` and place the contents of the file in it.
36+
4. Assign this secret to either this repository or your own fork of it.
37+
5. Create a codespace - after its started, you should be connected to your VPN. If you aren't you can manually run `.devcontainer/start-openvpn.sh` to try again and logs can be found in `.devcontainer/openvpn-tmp/openvpn.log`.
38+
39+
240

0 commit comments

Comments
 (0)