diff options
author | Javier Torres | 2017-02-03 18:11:48 +0100 |
---|---|---|
committer | Javier Torres | 2017-02-03 18:11:48 +0100 |
commit | 7af9e61132079e14d2558d29126691fa29c733a2 (patch) | |
tree | fd9c04ebad05e95d1a6d9e921882c2a0cf30356f | |
download | aur-7af9e61132079e14d2558d29126691fa29c733a2.tar.gz |
First version
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 51 | ||||
-rw-r--r-- | carto-sql-api.service | 10 | ||||
-rw-r--r-- | configuration.patch | 22 |
4 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..040645b36619 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +# Generated by mksrcinfo v8 +# Fri Feb 3 17:11:43 UTC 2017 +pkgbase = carto-sql-api + pkgdesc = Provides a node.js based API for running SQL queries against CARTO + pkgver = 1.43.1.r6.c4e6f3c + pkgrel = 1 + url = https://github.com/CartoDB/CartoDB-SQL-API + arch = x86_64 + license = BSD + makedepends = git + makedepends = npm + depends = zip + depends = gdal + depends = nodejs + depends = postgis + depends = redis + backup = etc/carto/sql-api.conf + source = git+https://github.com/CartoDB/CartoDB-SQL-API.git + source = configuration.patch + source = carto-sql-api.service + sha256sums = SKIP + sha256sums = 438218458f657b10ce4127b8dbb9fef20cec4d1b5e40e338e6eeebf283b7c5d3 + sha256sums = 4f3bf2b93ebd355951d64865fe6919b0ad85584073a334b092d7e78b56c6795d + +pkgname = carto-sql-api + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a9f72407ce48 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: Javier Torres <jtorres@carto.com> +pkgname=carto-sql-api +pkgver=1.43.1.r6.c4e6f3c +pkgrel=1 +pkgdesc="Provides a node.js based API for running SQL queries against CARTO" +arch=('x86_64') +url="https://github.com/CartoDB/CartoDB-SQL-API" +license=('BSD') +groups=() +depends=('zip' 'gdal' 'nodejs' 'postgis' 'redis') +makedepends=('git' 'npm') +provides=() +conflicts=() +replaces=() +backup=('etc/carto/sql-api.conf') +options=() +install= +source=('git+https://github.com/CartoDB/CartoDB-SQL-API.git' + 'configuration.patch' + 'carto-sql-api.service') +noextract=() +sha256sums=('SKIP' + '438218458f657b10ce4127b8dbb9fef20cec4d1b5e40e338e6eeebf283b7c5d3' + '4f3bf2b93ebd355951d64865fe6919b0ad85584073a334b092d7e78b56c6795d') + +pkgver() { + cd "$srcdir/CartoDB-SQL-API" + printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" +} + +prepare() { + cd "$srcdir/CartoDB-SQL-API" + patch -p1 < "$srcdir/configuration.patch" +} + +build() { + cd "$srcdir/CartoDB-SQL-API" + npm install +} + +package() { + cd "$srcdir/CartoDB-SQL-API" + mkdir -p "$pkgdir/opt/carto/sql-api" + cp -ar app app.js batch node_modules package.json "$pkgdir/opt/carto/sql-api" + + install -Dm0644 "$srcdir/carto-sql-api.service" "$pkgdir/usr/lib/systemd/system/carto-sql-api.service" + install -Dm0644 config/environments/development.js.example "$pkgdir/etc/carto/sql-api.conf" + install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + mkdir -p "$pkgdir/var/log/carto/sql-api" +} diff --git a/carto-sql-api.service b/carto-sql-api.service new file mode 100644 index 000000000000..1cd252ec4a78 --- /dev/null +++ b/carto-sql-api.service @@ -0,0 +1,10 @@ +[Unit] +Description=CARTO SQL API +After=syslog.target network.target + +[Service] +Type=simple +ExecStart=/usr/bin/node /opt/carto/sql-api/app.js -c /etc/carto/sql-api.conf + +[Install] +WantedBy=multi-user.target diff --git a/configuration.patch b/configuration.patch new file mode 100644 index 000000000000..1d7ce53e6da7 --- /dev/null +++ b/configuration.patch @@ -0,0 +1,22 @@ +diff --git a/config/environments/development.js.example b/config/environments/development.js.example +index 0e2bce8..b4a6105 100644 +--- a/config/environments/development.js.example ++++ b/config/environments/development.js.example +@@ -8,7 +8,7 @@ module.exports.useProfiler = true; + module.exports.log_format = '[:date] :remote-addr :method :req[Host]:url :status :response-time ms -> :res[Content-Type] (:res[X-SQLAPI-Profiler])'; + // If log_filename is given logs will be written there, in append mode. Otherwise stdout is used (default). + // Log file will be re-opened on receiving the HUP signal +-module.exports.log_filename = 'logs/cartodb-sql-api.log'; ++module.exports.log_filename = '/var/log/carto/sql-api/carto-sql-api.log'; + // Regular expression pattern to extract username + // from hostname. Must have a single grabbing block. + module.exports.user_from_host = '^(.*)\\.localhost'; +@@ -31,7 +31,7 @@ module.exports.db_port = '5432'; + module.exports.db_batch_port = '5432'; + module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours + module.exports.batch_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds +-module.exports.batch_log_filename = 'logs/batch-queries.log'; ++module.exports.batch_log_filename = '/var/log/carto/sql-api/batch-queries.log'; + // Max number of queued jobs a user can have at a given time + module.exports.batch_max_queued_jobs = 64; + // Capacity strategy to use. |