Here is a step-by-step guide to install the Go programming language, clone the geoip repository, and generate the geoip.dat
file using the provided configuration.
- Update the package list:
sudo apt-get update
- Install Git:
sudo apt-get install git
- Verify Git installation:
git --version
- Download the Go tarball:
curl -sLo go.tar.gz https://go.dev/dl/go1.22.3.linux-amd64.tar.gz
- Extract the tarball to
/usr/local
:sudo tar -C /usr/local -xzf go.tar.gz
- Remove the tarball:
rm go.tar.gz
- Set the PATH environment variable:
export PATH=$PATH:/usr/local/go/bin
- Verify Go installation:
go version
- Clone the repository:
git clone https://github.com/us254/geoip.git
- Navigate to the geoip directory:
cd geoip
- Remove the existing
config.json
file:rm -f config.json
- Download the updated
config.json
file:wget https://raw.githubusercontent.com/us254/geoip/master/config.json
- Run the Go program:
go run .
The config.json
file should contain the following code:
{
"input": [
{
"type": "text",
"action": "add",
"args": {
"name": "ir",
"uri": "https://raw.githubusercontent.com/us254/geoip/master/k/IRip.txt",
"onlyIPType": "ipv4"
}
}
],
"output": [
{
"type": "v2rayGeoIPDat",
"action": "output",
"args": {
"outputName": "geoip.dat",
"wantedList": [
"ir"
]
}
}
]
}
-
Update System and Install Git:
sudo apt-get update sudo apt-get install git git --version
-
Install Go Programming Language:
curl -sLo go.tar.gz https://go.dev/dl/go1.20.5.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go.tar.gz rm go.tar.gz export PATH=$PATH:/usr/local/go/bin go version
-
Clone geoip Repository:
git clone https://github.com/us254/geoip.git cd geoip
-
Update Configuration File:
rm -f config.json wget https://raw.githubusercontent.com/us254/geoip/master/config.json
-
Generate
geoip.dat
:go run .
# Update System and Install Git
sudo apt-get update
sudo apt-get install git
git --version
# Install Go Programming Language
curl -sLo go.tar.gz https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go.tar.gz
rm go.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
# Clone geoip Repository
git clone https://github.com/us254/geoip.git
cd geoip
# Update Configuration File
rm -f config.json
wget https://raw.githubusercontent.com/us254/geoip/master/config.json
# Generate geoip.dat
go run .
By following these steps, you can install the Go programming language, clone the geoip repository, update the configuration file, and generate the geoip.dat
file.