summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD51
-rw-r--r--carto-tiler.service10
-rw-r--r--configuration.patch40
4 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a18590c7b0e7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+# Generated by mksrcinfo v8
+# Fri Feb 3 17:12:49 UTC 2017
+pkgbase = carto-tiler
+ pkgdesc = CARTO Maps API tiler. It extends Windshaft with some extra functionality
+ pkgver = 2.87.1.r13.34424e71
+ pkgrel = 1
+ url = https://github.com/CartoDB/Windshaft-cartodb
+ arch = x86_64
+ license = BSD
+ makedepends = git
+ makedepends = npm
+ makedepends = boost
+ depends = mapnik
+ depends = nodejs
+ depends = pango
+ depends = redis
+ backup = etc/carto/tiler.conf
+ source = git+https://github.com/CartoDB/Windshaft-cartodb.git#branch=node-v6
+ source = configuration.patch
+ source = carto-tiler.service
+ sha256sums = SKIP
+ sha256sums = 86dc381424fe5b1babeac830b0bcab8bc8d582b66026145124ccec5478139922
+ sha256sums = e0a7912e260c6dfc1e0fe42fde7f01d1f2dbbab17587d1cfb43b75277745dfa7
+
+pkgname = carto-tiler
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..324197b37b8a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Javier Torres <jtorres@carto.com>
+pkgname=carto-tiler
+pkgver=2.87.1.r13.34424e71
+pkgrel=1
+pkgdesc="CARTO Maps API tiler. It extends Windshaft with some extra functionality"
+arch=('x86_64')
+url="https://github.com/CartoDB/Windshaft-cartodb"
+license=('BSD')
+groups=()
+depends=('mapnik' 'nodejs' 'pango' 'redis')
+makedepends=('git' 'npm' 'boost')
+provides=()
+conflicts=()
+replaces=()
+backup=('etc/carto/tiler.conf')
+options=()
+install=
+source=('git+https://github.com/CartoDB/Windshaft-cartodb.git#branch=node-v6'
+ 'configuration.patch'
+ 'carto-tiler.service')
+noextract=()
+sha256sums=('SKIP'
+ '86dc381424fe5b1babeac830b0bcab8bc8d582b66026145124ccec5478139922'
+ 'e0a7912e260c6dfc1e0fe42fde7f01d1f2dbbab17587d1cfb43b75277745dfa7')
+
+pkgver() {
+ cd "$srcdir/Windshaft-cartodb"
+ printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
+}
+
+prepare() {
+ cd "$srcdir/Windshaft-cartodb"
+ patch -p1 < "$srcdir/configuration.patch"
+}
+
+build() {
+ cd "$srcdir/Windshaft-cartodb"
+ npm install
+}
+
+package() {
+ cd "$srcdir/Windshaft-cartodb"
+ mkdir -p "$pkgdir/opt/carto/tiler"
+ cp -ar app.js assets lib node_modules package.json "$pkgdir/opt/carto/tiler"
+
+ install -Dm0644 "$srcdir/carto-tiler.service" "$pkgdir/usr/lib/systemd/system/carto-tiler.service"
+ install -Dm0644 config/environments/development.js.example "$pkgdir/etc/carto/tiler.conf"
+ install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ mkdir -p "$pkgdir/var/log/carto/tiler"
+}
diff --git a/carto-tiler.service b/carto-tiler.service
new file mode 100644
index 000000000000..28c7a49ddbf2
--- /dev/null
+++ b/carto-tiler.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=CARTO Tiler
+After=syslog.target network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/node /opt/carto/tiler/app.js -c /etc/carto/tiler.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/configuration.patch b/configuration.patch
new file mode 100644
index 000000000000..f296e7837177
--- /dev/null
+++ b/configuration.patch
@@ -0,0 +1,40 @@
+diff --git a/config/environments/development.js.example b/config/environments/development.js.example
+index 6800d4c6..e814f8cc 100644
+--- a/config/environments/development.js.example
++++ b/config/environments/development.js.example
+@@ -34,8 +34,8 @@ var config = {
+ // 2. {{=it.user}}: will use the username as extraced from `user_from_host` or `base_url_detached`.
+ // 3. {{=it.port}}: will use the `port` from this very same configuration file.
+ ,resources_url_templates: {
+- http: 'http://{{=it.user}}.localhost.lan:{{=it.port}}/api/v1/map',
+- https: 'http://localhost.lan:{{=it.port}}/user/{{=it.user}}/api/v1/map'
++ http: 'http://{{=it.user}}.localhost:{{=it.port}}/api/v1/map',
++ https: 'http://localhost:{{=it.port}}/user/{{=it.user}}/api/v1/map'
+ }
+
+ // Maximum number of connections for one process
+@@ -56,7 +56,7 @@ var config = {
+ // 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
+- ,log_filename: undefined
++ ,log_filename: '/var/log/carto/tiler/node-windshaft.log'
+ // Templated database username for authorized user
+ // Supported labels: 'user_id' (read from redis)
+ ,postgres_auth_user: 'development_cartodb_user_<%= user_id %>'
+@@ -228,13 +228,13 @@ var config = {
+ // where the SQL API is running, it will use a custom Host header to specify the username.
+ endpoint: 'http://127.0.0.1:8080/api/v2/sql/job',
+ // the template to use for adding the host header in the batch api requests
+- hostHeaderTemplate: '{{=it.username}}.localhost.lan'
++ hostHeaderTemplate: '{{=it.username}}.localhost'
+ },
+ logger: {
+ // If filename is given logs comming from analysis client will be written
+ // there, in append mode. Otherwise 'log_filename' is used. Otherwise stdout is used (default).
+ // Log file will be re-opened on receiving the HUP signal
+- filename: '/tmp/analysis.log'
++ filename: '/var/log/carto/tiler/analysis.log'
+ },
+ // Define max execution time in ms for analyses or tags
+ // If analysis or tag are not found in redis this values will be used as default.