Skip to content

Commit

Permalink
README tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel authored Nov 5, 2021
1 parent 833ac2a commit 7ec93a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/library-scripts \
#
# Remove the OPENVPN_CONFIG variable since we don't neeed it after is written to a file
&& echo "unset OPENVPN_CONFIG" | tee -a /etc/bash.bashrc > /etc/profile.d/unset-openvpn-config.sh \
&& echo 'OPENVPN_CONFIG=""' >> /etc/environment \
&& echo "unset OPENVPN_CONFIG" | tee -a /etc/bash.bashrc > /etc/profile.d/999-unset-openvpn-config.sh \
&& if [ -d "/etc/zsh" ]; then echo "unset OPENVPN_CONFIG" >> /etc/zsh/zshenv; fi
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# Using the OpenVPN client from Codespaces
# Using the OpenVPN client from GitHub Codespaces

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.

# Using the sample

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`.
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:

```
<ca>
-----BEGIN CERTIFICATE-----
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
...
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
...
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN CERTIFICATE-----
uQltvbIPFv69jSPNotypuUQqRAyLC+gBTVDxN3zC3WPeKMR6vJTh0lxC6GPhkHC
...
-----END CERTIFICATE-----
</key>
```
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.
3. Create a Codespaces user secret called `OPENVPN_CONFIG` and place the contents of the file in it.
4. Assign this secret to either this repository or your own fork of it.
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`.

0 comments on commit 7ec93a6

Please sign in to comment.