forked from AlexeyKupershtokh/clickhouse-maxmind-geoip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5ffe17d
Showing
16 changed files
with
724 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 @@ | ||
FROM yandex/clickhouse-server | ||
|
||
RUN apt-get update \ | ||
&& apt-get install --yes --no-install-recommends \ | ||
unzip \ | ||
&& rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/var/cache/debconf \ | ||
/tmp/* \ | ||
&& apt-get clean | ||
|
||
# download MaxMind GeoLite2 databases | ||
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip /tmp | ||
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip /tmp | ||
#ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip /tmp | ||
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip -O /tmp/GeoLite2-City-CSV.zip --no-check-certificate | ||
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip -O /tmp/GeoLite2-Country-CSV.zip --no-check-certificate | ||
RUN wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip -O /tmp/GeoLite2-ASN-CSV.zip --no-check-certificate | ||
|
||
RUN unzip /tmp/GeoLite2-City-CSV.zip -d /tmp | ||
RUN unzip /tmp/GeoLite2-Country-CSV.zip -d /tmp | ||
RUN unzip /tmp/GeoLite2-ASN-CSV.zip -d /tmp | ||
|
||
RUN mv /tmp/*/* /etc/clickhouse-server/ | ||
|
||
ADD clickhouse /etc/clickhouse-server | ||
|
||
RUN pwd | ||
RUN ls -la | ||
RUN ls -la /etc/clickhouse-server | ||
RUN ls -la /tmp | ||
|
||
RUN cat /etc/clickhouse-server/GeoLite2-City-Locations-en.csv | sed 's/'"'"'/\\'"'"'/g' > /etc/clickhouse-server/GeoLite2-City-Locations-en-fixed.csv |
Large diffs are not rendered by default.
Oops, something went wrong.
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,34 @@ | ||
<?xml version="1.0"?> | ||
<dictionaries> | ||
<dictionary> | ||
<name>geoip_asn_blocks_ipv4</name> | ||
<source> | ||
<file> | ||
<path>/etc/clickhouse-server/GeoLite2-ASN-Blocks-IPv4.csv</path> | ||
<format>CSVWithNames</format> | ||
</file> | ||
</source> | ||
<lifetime>300</lifetime> | ||
<layout> | ||
<ip_trie/> | ||
</layout> | ||
<structure> | ||
<key> | ||
<attribute> | ||
<name>prefix</name> | ||
<type>String</type> | ||
</attribute> | ||
</key> | ||
<attribute> | ||
<name>autonomous_system_number</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>autonomous_system_organization</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
</structure> | ||
</dictionary> | ||
</dictionaries> |
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,34 @@ | ||
<?xml version="1.0"?> | ||
<dictionaries> | ||
<dictionary> | ||
<name>geoip_asn_blocks_ipv6</name> | ||
<source> | ||
<file> | ||
<path>/etc/clickhouse-server/GeoLite2-ASN-Blocks-IPv6.csv</path> | ||
<format>CSVWithNames</format> | ||
</file> | ||
</source> | ||
<lifetime>300</lifetime> | ||
<layout> | ||
<ip_trie/> | ||
</layout> | ||
<structure> | ||
<key> | ||
<attribute> | ||
<name>prefix</name> | ||
<type>String</type> | ||
</attribute> | ||
</key> | ||
<attribute> | ||
<name>autonomous_system_number</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>autonomous_system_organization</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
</structure> | ||
</dictionary> | ||
</dictionaries> |
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,69 @@ | ||
<?xml version="1.0"?> | ||
<dictionaries> | ||
<dictionary> | ||
<name>geoip_city_blocks_ipv4</name> | ||
<source> | ||
<file> | ||
<path>/etc/clickhouse-server/GeoLite2-City-Blocks-IPv4.csv</path> | ||
<format>CSVWithNames</format> | ||
</file> | ||
</source> | ||
<lifetime>300</lifetime> | ||
<layout> | ||
<ip_trie/> | ||
</layout> | ||
<structure> | ||
<key> | ||
<attribute> | ||
<name>prefix</name> | ||
<type>String</type> | ||
</attribute> | ||
</key> | ||
<attribute> | ||
<name>geoname_id</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>registered_country_geoname_id</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>represented_country_geoname_id</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>is_anonymous_proxy</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>is_satellite_provider</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>postal_code</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>latitude</name> | ||
<type>Float32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>longitude</name> | ||
<type>Float32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>accuracy_radius</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
</structure> | ||
</dictionary> | ||
</dictionaries> |
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,69 @@ | ||
<?xml version="1.0"?> | ||
<dictionaries> | ||
<dictionary> | ||
<name>geoip_city_blocks_ipv6</name> | ||
<source> | ||
<file> | ||
<path>/etc/clickhouse-server/GeoLite2-City-Blocks-IPv6.csv</path> | ||
<format>CSVWithNames</format> | ||
</file> | ||
</source> | ||
<lifetime>300</lifetime> | ||
<layout> | ||
<ip_trie/> | ||
</layout> | ||
<structure> | ||
<key> | ||
<attribute> | ||
<name>prefix</name> | ||
<type>String</type> | ||
</attribute> | ||
</key> | ||
<attribute> | ||
<name>geoname_id</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>registered_country_geoname_id</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>represented_country_geoname_id</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>is_anonymous_proxy</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>is_satellite_provider</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>postal_code</name> | ||
<type>String</type> | ||
<null_value>?</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>latitude</name> | ||
<type>Float32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>longitude</name> | ||
<type>Float32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
<attribute> | ||
<name>accuracy_radius</name> | ||
<type>UInt32</type> | ||
<null_value>0</null_value> | ||
</attribute> | ||
</structure> | ||
</dictionary> | ||
</dictionaries> |
Oops, something went wrong.