summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSefa Eyeoglu2019-06-06 18:13:17 +0200
committerSefa Eyeoglu2019-06-06 18:13:17 +0200
commit6a952a6f6526f728fb4cfa09754ec192c3a4c682 (patch)
tree8ef4679ffa48d92f6b1449da15cac75d70ea72f2
parent016e23d95e1ef8f878c58ae57728cd1e6b3b144d (diff)
downloadaur-6a952a6f6526f728fb4cfa09754ec192c3a4c682.tar.gz
upgpkg: gaia-hub 2.5.3-2
Fix default storage folder permissions
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD31
-rw-r--r--config.json2
-rw-r--r--service (renamed from gaia-hub.service)13
-rw-r--r--sysusers1
-rw-r--r--tmpfiles1
6 files changed, 38 insertions, 24 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0e25fceddf98..4d88694a6601 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = gaia-hub
pkgdesc = A decentralized high-performance storage system
pkgver = 2.5.3
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/blockstack/gaia
arch = any
license = MIT
@@ -9,14 +9,20 @@ pkgbase = gaia-hub
makedepends = npm
makedepends = node-gyp
makedepends = make
+ makedepends = typescript
+ makedepends = ts-node
depends = nodejs
optdepends = nginx: utilize provided example configs
source = gaia-hub::git+https://github.com/blockstack/gaia.git#tag=v2.5.3
- source = gaia-hub.service
source = config.json
+ source = service
+ source = sysusers
+ source = tmpfiles
sha512sums = SKIP
- sha512sums = 26297bc8e85b7577922442dc904597d7087e52e1204580a7c1ede516de9b9947e6e1640f28aa4bc03851c466bc9953dd256c39ac7f429db62ea9ba662eb14a0f
- sha512sums = 19a037b067cd254cf7c06b517b6a696804f9a559fa6689ca65478f963d3dfc28a03598ecc9c3cede60699dd29b691cefeea2b98e283fcca443cc8eb4dc17aad7
+ sha512sums = 54c7b8e5cec9930f09541b8a5ea62971693206cc19b33f94301a9a27e4a61865f235000a30d62e93f4c399654abac0e8f7f4ee388f982f873eaffea0a011ccbd
+ sha512sums = 9932bc1cad558cf86f107b3069e81d4034d6c3fced6d94af899da25b7309806efcc2d2a52572a3b755c893278fd440ac6ee6b723fb8ce736bd51968096138736
+ sha512sums = 34c7aee63c3dc87f608019489441be0fc06299fc802d1b5d587f92f7d6c515daa384911458f7bef7db8c927e4c960052567e7b176e70e882a604776ff3b82257
+ sha512sums = a71bae7d8f0e449a4bc9ea97d5f3db71c2e3511a25f6004f047b0fb2847f3490487acaf9bc9ea58b3fb71405c5172745543b3348e463a11d049e49d2ea2f7d0a
pkgname = gaia-hub
diff --git a/PKGBUILD b/PKGBUILD
index 5a7514011255..bbf8a3039741 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,6 +16,8 @@ makedepends=(
"npm"
"node-gyp"
"make"
+ "typescript"
+ "ts-node"
)
optdepends=(
"nginx: utilize provided example configs"
@@ -23,12 +25,16 @@ optdepends=(
source=(
"${pkgname}::git+https://github.com/blockstack/gaia.git#tag=v${pkgver}"
- "gaia-hub.service"
"config.json"
+ "service"
+ "sysusers"
+ "tmpfiles"
)
sha512sums=('SKIP'
- '26297bc8e85b7577922442dc904597d7087e52e1204580a7c1ede516de9b9947e6e1640f28aa4bc03851c466bc9953dd256c39ac7f429db62ea9ba662eb14a0f'
- '19a037b067cd254cf7c06b517b6a696804f9a559fa6689ca65478f963d3dfc28a03598ecc9c3cede60699dd29b691cefeea2b98e283fcca443cc8eb4dc17aad7')
+ '54c7b8e5cec9930f09541b8a5ea62971693206cc19b33f94301a9a27e4a61865f235000a30d62e93f4c399654abac0e8f7f4ee388f982f873eaffea0a011ccbd'
+ '9932bc1cad558cf86f107b3069e81d4034d6c3fced6d94af899da25b7309806efcc2d2a52572a3b755c893278fd440ac6ee6b723fb8ce736bd51968096138736'
+ '34c7aee63c3dc87f608019489441be0fc06299fc802d1b5d587f92f7d6c515daa384911458f7bef7db8c927e4c960052567e7b176e70e882a604776ff3b82257'
+ 'a71bae7d8f0e449a4bc9ea97d5f3db71c2e3511a25f6004f047b0fb2847f3490487acaf9bc9ea58b3fb71405c5172745543b3348e463a11d049e49d2ea2f7d0a')
prepare() {
cd "$srcdir/$pkgname/hub"
@@ -36,6 +42,8 @@ prepare() {
}
build() {
+ export NODE_ENV="production"
+
cd "$srcdir/$pkgname/hub"
npm run build
}
@@ -43,25 +51,36 @@ build() {
package() {
cd "$srcdir/$pkgname/hub"
- export NODE_ENV="production"
- install -d "${pkgdir}/etc/gaia/hub" "${pkgdir}/usr/lib/node_modules/gaia-hub" "${pkgdir}/usr/bin" "${pkgdir}/srv/gaia/hub"
+ install -d "${pkgdir}/etc/gaia/hub" "${pkgdir}/usr/lib/node_modules/gaia-hub" "${pkgdir}/usr/bin"
+ # Install data
cp -r "lib" "node_modules" "${pkgdir}/usr/lib/node_modules/gaia-hub/"
chmod 755 "${pkgdir}/usr/lib/node_modules/gaia-hub/lib/index.js"
+ # link executable
ln -s "/usr/lib/node_modules/gaia-hub/lib/index.js" "${pkgdir}/usr/bin/gaia-hub"
+ # install custom default config
install -Dm 644 "${srcdir}/config.json" "${pkgdir}/usr/lib/node_modules/gaia-hub/config.json"
ln -s "/usr/lib/node_modules/gaia-hub/config.json" "${pkgdir}/etc/gaia/hub/config.json"
+ # install examples
install -Dm 644 "nginx.conf" "${pkgdir}/usr/share/doc/gaia/hub/nginx.conf.example"
for file in etc/*.json; do
install -m 644 "$file" "${pkgdir}/usr/share/doc/gaia/hub/"
done
+ # install documentation and license
install -Dm 644 "README.md" "${pkgdir}/usr/share/doc/gaia/hub/README.md"
install -Dm 644 "CHANGELOG.md" "${pkgdir}/usr/share/doc/gaia/hub/CHANGELOG.md"
install -Dm 644 "../LICENSE" "${pkgdir}/usr/share/licenses/gaia/LICENSE"
- install -Dm 644 "${srcdir}/gaia-hub.service" "${pkgdir}/usr/lib/systemd/system/gaia-hub.service"
+ # Install sysusers
+ install -Dm644 "$srcdir/sysusers" "$pkgdir/usr/lib/sysusers.d/${pkgname}.conf"
+
+ # Install tmpfiles
+ install -Dm644 "$srcdir/tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/${pkgname}.conf"
+
+ # install service
+ install -Dm 644 "${srcdir}/service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
}
diff --git a/config.json b/config.json
index e47c4b8186ba..91e9982c55ab 100644
--- a/config.json
+++ b/config.json
@@ -7,7 +7,7 @@
"cacheControl": "public, max-age=1",
"pageSize": 20,
"diskSettings": {
- "storageRootDirectory": "/srv/gaia/hub"
+ "storageRootDirectory": "/srv/gaia"
},
"awsCredentials": {
"accessKeyId": "",
diff --git a/gaia-hub.service b/service
index 800fcbd8c2c0..543497839a16 100644
--- a/gaia-hub.service
+++ b/service
@@ -5,24 +5,11 @@ Wants=network-online.target
[Service]
Type=simple
-DynamicUser=true
User=gaia
Group=gaia
WorkingDirectory=/usr/lib/node_modules/gaia-hub
Environment=NODE_ENV="production"
ExecStart=/usr/bin/gaia-hub
-# Hardening options
-CapabilityBoundingSet=
-AmbientCapabilities=
-NoNewPrivileges=true
-ProtectHome=true
-ProtectSystem=full
-ProtectKernelTunables=true
-ProtectKernelModules=true
-ProtectControlGroups=true
-PrivateTmp=true
-LockPersonality=true
-
[Install]
WantedBy=multi-user.target
diff --git a/sysusers b/sysusers
new file mode 100644
index 000000000000..6a707299848e
--- /dev/null
+++ b/sysusers
@@ -0,0 +1 @@
+u gaia - "Gaia Hub user"
diff --git a/tmpfiles b/tmpfiles
new file mode 100644
index 000000000000..51d8d9425dd5
--- /dev/null
+++ b/tmpfiles
@@ -0,0 +1 @@
+d /srv/gaia 0700 gaia gaia -