Skip to content

Commit d9f2618

Browse files
authored
Merge pull request #6300 from Countly/ar2rsawseen/next
MongoDB based offline geocoder
2 parents 6450540 + 4c1c131 commit d9f2618

24 files changed

+852
-1249
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ jobs:
161161

162162
- name: Copy code
163163
shell: bash
164-
run: cp -rf ./* /opt/countly
164+
run: |
165+
cp -rf ./* /opt/countly
166+
cp ./bin/docker/postinstall.sh /etc/my_init.d
165167
166168
- name: Remove plugin tests
167169
shell: bash

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 25.xx
2+
Dependencies:
3+
- Remove SQLite
4+
15
## Version 25.03.6
26
Enterprise Features:
37
- [journey_engine] Publish toggle is converted into button and rearranged

Dockerfile-api

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN apt-get update && \
3232
cd /usr/src && \
3333
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz && \
3434
tar -xf Python-3.8.12.tar.xz && \
35-
apt-get install -y build-essential sudo zlib1g-dev libssl3 libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev && \
35+
apt-get install -y build-essential sudo zlib1g-dev libssl3 libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev && \
3636
cd Python-3.8.12 && \
3737
./configure --enable-optimizations --enable-shared && \
3838
make && \
@@ -44,7 +44,6 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
4444
dpkg -i /tmp/tini.deb && \
4545
\
4646
# modify standard distribution
47-
apt-get update && apt-get install -y sqlite3 && \
4847
./bin/docker/modify.sh && \
4948
\
5049
# preinstall
@@ -58,7 +57,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
5857
\
5958
# cleanup & chown
6059
npm remove -y --no-save mocha nyc should supertest && \
61-
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 wget && \
60+
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip wget && \
6261
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
6362
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
6463
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \

Dockerfile-centos-api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN curl -s -L -o /tmp/tini.rpm "https://github.com/krallin/tini/releases/downlo
4646
yum install -y epel-release && \
4747
yum install -y pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc && \
4848
yum install -y https://pkgs.sysadmins.ws/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \
49-
yum install -y wget openssl-devel make git libsqlite* sqlite unzip bzip2 && \
49+
yum install -y wget openssl-devel make git unzip bzip2 && \
5050
# modify standard distribution
5151
./bin/docker/modify.sh && \
5252
\

Dockerfile-centos-frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN curl -s -L -o /tmp/tini.rpm "https://github.com/krallin/tini/releases/downlo
4444
yum install -y epel-release && \
4545
yum install -y pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc && \
4646
yum install -y https://pkgs.sysadmins.ws/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \
47-
yum install -y wget openssl-devel make git sqlite libsqlite* unzip bzip2 && \
47+
yum install -y wget openssl-devel make git unzip bzip2 && \
4848
# modify standard distribution
4949
./bin/docker/modify.sh && \
5050
\

Dockerfile-core

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
2929
apt-get update && \
3030
apt-get install -y \
3131
# standard
32-
build-essential libkrb5-dev git sqlite3 wget sudo \
32+
build-essential libkrb5-dev git wget sudo \
3333
# nginx
3434
nginx \
3535
# puppeteer
@@ -76,7 +76,7 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
7676
chown -R countly:countly /opt/countly && \
7777
# cleanup
7878
npm remove -y --no-save mocha nyc should supertest && \
79-
apt-get remove -y build-essential libkrb5-dev sqlite3 wget \
79+
apt-get remove -y build-essential libkrb5-dev wget \
8080
gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools && \
8181
apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
8282
apt-get clean && \

Dockerfile-frontend

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN apt-get update && \
2828
cd /usr/src && \
2929
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz && \
3030
tar -xf Python-3.8.12.tar.xz && \
31-
apt-get install -y build-essential sudo zlib1g-dev libssl3 libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev && \
31+
apt-get install -y build-essential sudo zlib1g-dev libssl3 libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev && \
3232
cd Python-3.8.12 && \
3333
./configure --enable-optimizations --enable-shared && \
3434
make && \
@@ -40,7 +40,6 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
4040
dpkg -i /tmp/tini.deb && \
4141
\
4242
# modify standard distribution
43-
apt-get update && apt-get install -y sqlite3 && \
4443
./bin/docker/modify.sh && \
4544
\
4645
# preinstall
@@ -56,7 +55,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
5655
\
5756
# cleanup & chown
5857
npm remove -y --no-save mocha nyc should supertest puppeteer && \
59-
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 wget && \
58+
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip wget && \
6059
apt-get autoremove -y && \
6160
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
6261
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \

api/parts/data/usage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var usage = {},
88
common = require('./../../utils/common.js'),
99
geoip = require('geoip-lite'),
10-
geocoder = require('offline-geocoder')(),
10+
geocoder = require('./../../../bin/offline-geocoder/src/index.js')(),
1111
log = require('../../utils/log.js')('api:usage'),
1212
async = require('async'),
1313
plugins = require('../../../plugins/pluginManager.js'),

bin/countly.install_rhel.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1414
bash "$DIR/scripts/logo.sh";
1515

1616
# prerequisite per release
17-
sudo dnf install -y wget openssl-devel make git sqlite unzip bzip2
17+
sudo dnf install -y wget openssl-devel make git unzip bzip2
1818

1919
sudo dnf install -y python3-pip
2020
sudo pip3 install pip --upgrade
@@ -87,7 +87,7 @@ sudo systemctl start sendmail > /dev/null || echo "sendmail service does not exi
8787

8888
#install npm modules
8989
npm config set prefix "$DIR/../.local/"
90-
( cd "$DIR/.."; npm install argon2; npm install sqlite3 --build-from-source; npm install; )
90+
( cd "$DIR/.."; npm install argon2; npm install; )
9191

9292
#install numactl
9393
sudo dnf install -y numactl
@@ -156,6 +156,8 @@ node "$DIR/scripts/install_plugins"
156156

157157
#load city data into database
158158
nodejs "$DIR/scripts/loadCitiesInDb.js"
159+
nodejs "$DIR/offline-geocoder/scripts/download_geonames_data.js"
160+
nodejs "$DIR/offline-geocoder/scripts/import_geonames_mongodb.js"
159161

160162
#get web sdk
161163
sudo countly update sdk-web

bin/countly.install_travis.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
1919
#update package index
2020
apt-get update
2121

22-
apt-get install -y build-essential git sqlite3 unzip shellcheck
22+
apt-get install -y build-essential git unzip shellcheck
2323

2424
if apt-cache pkgnames | grep -q python-software-properties; then
2525
apt-get install -y python-software-properties
@@ -116,6 +116,8 @@ bash "$DIR/scripts/countly.install.plugins.sh"
116116

117117
#load city data into database
118118
nodejs "$DIR/scripts/loadCitiesInDb.js"
119+
nodejs "$DIR/offline-geocoder/scripts/download_geonames_data.js"
120+
nodejs "$DIR/offline-geocoder/scripts/import_geonames_mongodb.js"
119121

120122
#compile scripts for production
121123
countly task dist-all

0 commit comments

Comments
 (0)