-
Sign in or register for an account on Github
-
Fork Gluetun to your account.
-
Install Git
-
Clone the repository either with https or ssh:
# HTTPS git clone https://github.com/yourusername/gluetun.git # or SSH git clone git@github.com:yourusername/gluetun.git
-
Go to the newly cloned
gluetun
directory
Since Gluetun is for now tightly coupled with Linux's unix
& syscall
Go packages, you can develop it using one of the two options below:
The development Docker container for VSCode is pre-configured for Gluetun and works on OSX, Linux and Windows.
- Install the following:
- Make sure the following exist and are accessible by Docker:
~/.ssh
directory~/.gitconfig
file (can be empty)
- Open the command palette in VS Code (CTRL+SHIFT+P).
- Select
Remote-Containers: Open Folder in Container...
and choose the Gluetun project directory.
More information is available at the development container readme
-
Install Go
-
Download the dependencies
go mod download
-
Install golangci-lint
-
You might want to use an IDE such as VSCode with the Go extension
-
You might want to install Docker to build and run the image.
Decide on a branch name for the feature you want to add, and then create that branch:
git checkout -b mybranchname
You can now start modifying the code and git commit your changes incrementally.
Before committing each commit, make sure the following passes:
# Linting
golangci-lint run
# Tests
go test ./...
💁 If you are new to Git and commits, you should read:
To commit changes for example:
# Stage all new and changed files
git add .
# Commit the staged files
git commit -m "description of my changes"
You can also do this through IDE such as VS Code source control.
💡 Want to add a VPN provider? ➡️ Add a provider - this is a detailed step-by-step guide.
💡 Want to understand the project structure? ➡️ Project structure
-
Build the image with:
docker build -t qmcgaw/gluetun .
-
Run it with:
docker run -it --rm --cap-add=NET_ADMIN --device /dev/net/run \ -e VPN_SERVICE_PROVIDER=someprovider \ -e VPN_TYPE=openvpn \ -e OPENVPN_USER=test -e OPENVPN_PASSWORD=test \ -p 8000:8000/tcp \ qmcgaw/gluetun
-
Push your new branch to your forked repository:
git push -u origin mybranchname
-
I will most likely leave feedback as comments on the pull request, which you would have to address in order to get your work merged in the base repository. And also feel free to ask any question there!