summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorM0Rf302015-06-17 15:31:28 +0200
committerM0Rf302015-06-17 15:31:28 +0200
commitaaa54ffadbf1945bf6d7c46b804a26a7147d54bc (patch)
tree99ddd65ae5882effaf652b4c9f689c32c9bc6626
downloadaur-aaa54ffadbf1945bf6d7c46b804a26a7147d54bc.tar.gz
Initial import
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD49
-rw-r--r--dnschain.service31
3 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e3c9f9e64846
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = dnschain-git
+ pkgdesc = A blockchain-based DNS + HTTP server that fixes HTTPS security, and more!
+ pkgver = 281.1c76070
+ pkgrel = 1
+ url = https://github.com/okTurtles/dnschain
+ arch = any
+ license = MPL
+ depends = coffee-script
+ depends = git
+ depends = nodejs
+ depends = namecoin-core
+ optdepends = bitshares: bdns support
+ optdepends = go-ethereum: ethereum support
+ conflicts = dnschain
+ replaces = dnschain
+ source = dnschain::git+https://github.com/okTurtles/dnschain.git
+ source = dnschain.service
+ md5sums = SKIP
+ md5sums = d06f32b209d12fb3c3f4caf05ed826f9
+
+pkgname = dnschain-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7c204c02d159
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer M0Rf30
+
+pkgname=dnschain-git
+pkgver=281.1c76070
+pkgrel=1
+pkgdesc="A blockchain-based DNS + HTTP server that fixes HTTPS security, and more!"
+arch=(any)
+url="https://github.com/okTurtles/dnschain"
+license=('MPL')
+depends=('coffee-script' 'git' 'nodejs' 'namecoin-core')
+conflicts=('dnschain')
+replaces=('dnschain')
+optdepends=('bitshares: bdns support' 'go-ethereum: ethereum support')
+source=("dnschain::git+https://github.com/okTurtles/dnschain.git"
+ dnschain.service)
+
+build() {
+ cd $srcdir/dnschain
+ export PYTHON=/usr/bin/python2
+ npm install
+}
+
+package() {
+ cd $srcdir/
+
+ # Path for dnschain
+ _npmdir="$pkgdir/usr/lib/node_modules/"
+ mkdir -p $_npmdir
+ cp -r dnschain $_npmdir
+
+ # Copy systemd service
+ mkdir -p $pkgdir/usr/lib/systemd/system
+ cp dnschain.service $pkgdir/usr/lib/systemd/system
+
+ # Cleaning
+ rm -r $_npmdir/dnschain/.git*
+
+ # Main executable
+ mkdir $pkgdir/usr/bin
+ ln -sr $_npmdir/dnschain/bin/dnschain $pkgdir/usr/bin/dnschain
+}
+
+pkgver() {
+ cd $srcdir/dnschain
+ echo $(git rev-list --count master).$(git rev-parse --short master)
+}
+
+md5sums=('SKIP'
+ 'd06f32b209d12fb3c3f4caf05ed826f9')
diff --git a/dnschain.service b/dnschain.service
new file mode 100644
index 000000000000..7084838a84d1
--- /dev/null
+++ b/dnschain.service
@@ -0,0 +1,31 @@
+# Example systemd unit file. Some assembly required.
+
+[Unit]
+Description=dnschain
+After=network.target
+Wants=namecoin.service
+
+[Service]
+ExecStart=/usr/bin/dnschain
+Environment=DNSCHAIN_SYSD_VER=0.0.1
+PermissionsStartOnly=true
+ExecStartPre=sysctl -w net.ipv4.ip_forward=1
+ExecStartPre=iptables -A INPUT -p udp --dport 5333 -j ACCEPT
+ExecStartPre=iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5333
+ExecStopPost=iptables -D INPUT -p udp --dport 5333 -j ACCEPT
+ExecStopPost=iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5333
+User=root
+Group=root
+Restart=always
+RestartSec=5
+WorkingDirectory=/root/
+PrivateTmp=true
+NoNewPrivileges=true
+ReadOnlyDirectories=/etc
+
+# Unfortunately, capabilities are basically worthless because they're designed to restrict root daemons. Instead, we use iptables to listen on privileged ports.
+# Capabilities=cap_net_bind_service+pei
+# SecureBits=keep-caps
+
+[Install]
+WantedBy=multi-user.target