summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoroCYon2017-03-08 22:42:31 +0100
committerPoroCYon2017-03-08 22:42:31 +0100
commitce0dfe9bdfba2707b1fb45d013bf713e21d64078 (patch)
treebeeab8ac7c1c86109ef57f0234a934b986598bf4
downloadaur-ce0dfe9bdfba2707b1fb45d013bf713e21d64078.tar.gz
add files
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD48
-rw-r--r--fix-relative-file-paths.patch62
-rw-r--r--zifd.install9
-rw-r--r--zifd.service15
5 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..132466a0a1ed
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = zifd
+ pkgdesc = Decentralised BitTorrent index - daemon
+ pkgver = 0.5.0
+ pkgrel = 1
+ url = https://github.com/zif/zif
+ install = zifd.install
+ arch = x86_64
+ arch = i686
+ arch = armv6h
+ groups = zif
+ license = AGPL3
+ makedepends = go
+ makedepends = make
+ optdepends = tor: tunnel traffic through tor
+ optdepends = systemd: service files
+ optdepends = glibc: to make namcap happy
+ conflicts = zifd-git
+ backup = etc/zif/zifd.toml
+ backup = etc/zif/tor/torrc
+ source = https://github.com/zif/zif/archive/v0.5.0.tar.gz
+ source = fix-relative-file-paths.patch
+ source = zifd.install
+ source = zifd.service
+ sha512sums = 22bd4d05f75914be5fbb9abff4f540bda808033a8d2f886d4b1e1b88817fec3f0da918203dc53e98f5c63be12a7b397343c1e4de3722e6d6f38d219d45390bdb
+ sha512sums = fa3214126beec73ed4e7767baa7b8543d3ab52f3ea651ba096c2194db2597d5bce17310d5d11429722c8f03996bd52ee760c35c08c123283e88ccea29b33206b
+ sha512sums = 009bf7dd8fd07d2398ad20e6e4ef6ef3ada3c3524f1688fd425999836aa8fa7b04a51e9ea59f0dafa0cf4d70dc8ee36b3a4c2b4a92d203a79387ba8a6a2848ef
+ sha512sums = 18eddb08fc97c04789ccf1e2c392185c7e87df933b622d48a6f1116d008ceb99274b62c706950107ca48da20022fd267667007d7543f8aafcc00f8fb4f0e8430
+
+pkgname = zifd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3abb1ead7d69
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: PoroCYon <qpspdzpo@pqfonbjmcny.psh>
+# easy-to-break caesar cipher, ^
+# but tends to keep crawlers out
+
+pkgname=zifd
+pkgver=0.5.0
+pkgrel=1
+pkgdesc="Decentralised BitTorrent index - daemon"
+arch=('x86_64' 'i686' 'armv6h')
+url="https://github.com/zif/zif"
+license=('AGPL3')
+depends=()
+makedepends=('go' 'make')
+optdepends=('tor: tunnel traffic through tor'
+ 'systemd: service files'
+ 'glibc: to make namcap happy')
+groups=('zif')
+conflicts=('zifd-git')
+backup=('etc/zif/zifd.toml' 'etc/zif/tor/torrc')
+install=zifd.install
+source=("https://github.com/zif/zif/archive/v$pkgver.tar.gz"
+ "fix-relative-file-paths.patch"
+ "zifd.install"
+ "zifd.service")
+sha512sums=('22bd4d05f75914be5fbb9abff4f540bda808033a8d2f886d4b1e1b88817fec3f0da918203dc53e98f5c63be12a7b397343c1e4de3722e6d6f38d219d45390bdb'
+ 'fa3214126beec73ed4e7767baa7b8543d3ab52f3ea651ba096c2194db2597d5bce17310d5d11429722c8f03996bd52ee760c35c08c123283e88ccea29b33206b'
+ '009bf7dd8fd07d2398ad20e6e4ef6ef3ada3c3524f1688fd425999836aa8fa7b04a51e9ea59f0dafa0cf4d70dc8ee36b3a4c2b4a92d203a79387ba8a6a2848ef'
+ '18eddb08fc97c04789ccf1e2c392185c7e87df933b622d48a6f1116d008ceb99274b62c706950107ca48da20022fd267667007d7543f8aafcc00f8fb4f0e8430')
+
+prepare() {
+ cd "zif-$pkgver"
+ patch -p1 -i "$srcdir/fix-relative-file-paths.patch"
+}
+
+build() {
+ cd "zif-$pkgver"
+ make -j$(nproc)
+}
+
+package() {
+ #cd "zif-$pkgver"
+
+ install -D -m755 ./zif-$pkgver/bin/zifd $pkgdir/usr/bin/zifd
+ install -D -m644 ./zifd.service $pkgdir/usr/lib/systemd/system/zifd.service
+ install -D -m600 ./zif-$pkgver/config/zifd.toml $pkgdir/etc/zif/zifd.toml
+ install -D -m600 ./zif-$pkgver/tor/torrc $pkgdir/etc/zif/tor/torrc
+}
+
diff --git a/fix-relative-file-paths.patch b/fix-relative-file-paths.patch
new file mode 100644
index 000000000000..24102663e174
--- /dev/null
+++ b/fix-relative-file-paths.patch
@@ -0,0 +1,62 @@
+diff --git a/cmd/zifd/main.go b/cmd/zifd/main.go
+index 24cd1fa..e55f332 100644
+--- a/cmd/zifd/main.go
++++ b/cmd/zifd/main.go
+@@ -34,6 +34,7 @@ func SetupLocalPeer(addr string) *zif.LocalPeer {
+ }
+
+ func main() {
++ //os.Chdir("/var/lib/zif")
+
+ log.SetLevel(log.DebugLevel)
+ formatter := new(log.TextFormatter)
+diff --git a/config/zifd.toml b/config/zifd.toml
+index a9346c4..b5c2059 100644
+--- a/config/zifd.toml
++++ b/config/zifd.toml
+@@ -2,21 +2,21 @@
+ zif = "0.0.0.0:5050"
+
+ # http is an API that allows interaction with the daemon
+-http = "127.0.0.1:8080"
++http = "127.0.0.1:8080"
+
+ [database]
+ # Defaults to relative to the binary
+-path = "./data/posts.db"
++path = "/var/lib/zif/data/posts.db"
+
+ [tor]
+-enabled = true
++enabled = false
+ control = 10051
+ socks = 10050
+ # assumes you're using the tor config provided, running in a subfolder
+-cookiePath = "./tor/"
++cookiePath = "/etc/zif/tor/"
+
+ [socks]
+-enabled = true
++enabled = false
+ port = 10050
+
+ [net]
+diff --git a/tor/torrc b/tor/torrc
+index bced57c..f960d4d 100755
+--- a/tor/torrc
++++ b/tor/torrc
+@@ -1,11 +1,11 @@
+ Log notice stderr
+
+ ## The directory for keeping all the keys/etc. By default, we store
+-## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
+-DataDirectory ./
++## things in /etc/zif/tor .
++DataDirectory /etc/zif/tor/
+
+ ControlPort 10051
+ SocksPort 10050
+ CookieAuthentication 1
+ CookieAuthFileGroupReadable 1
+-CookieAuthFile ./cookie
++CookieAuthFile /etc/zif/tor/cookie
diff --git a/zifd.install b/zifd.install
new file mode 100644
index 000000000000..bf42241f1e67
--- /dev/null
+++ b/zifd.install
@@ -0,0 +1,9 @@
+
+post_install() {
+ useradd -c "Zif: Decentralised BitTorrent index" -r -s /usr/bin/nologin zif
+
+ chown -R zif /etc/zif /var/lib/zif
+ chmod 700 /etc/zif /etc/zif/tor /var/lib/zif
+ chmod 600 /etc/zif/tor/*
+}
+
diff --git a/zifd.service b/zifd.service
new file mode 100644
index 000000000000..4ffb7e19b0d8
--- /dev/null
+++ b/zifd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Zif daemon
+After=network-online.target
+
+[Service]
+User=zif
+Type=simple
+LimitNPROC=4
+NonBlocking=false
+ExecStart=/usr/bin/zif
+WorkingDirectory=/var/lib/zif
+
+[Install]
+WantedBy=multi-user.target
+