DirectSlave/GO 3 - public beta

roman_m

Verified User
Original DirectSlave thread: http://forum.directadmin.com/showthread.php?t=43924

UPDATE: login form is vulnerable to XSS attack.
Please apply this fix ASAP -- https://directslave.com/download/directslave-3.2-login-XSS-HOTFIX.tar.gz
(see https://directslave.com/download)

DirectSlave Updated to version 3.2-Advanced!

All versions in one place -- https://directslave.com/

Web interface demo available -- https://directslave.com:2224 demo:demo123

For updating, see this post http://forum.directadmin.com/showthread.php?t=54992&page=2&p=289070#post289070

Hi everybody!

A long time ago in a galaxy far far away ...
I was released a DirectSlave software. Many of forum users helped me a lot to debug and improve DS and bring this software to really corporate production level.

But now, it's time for something new!

So, I proudly introduce you a new DirectSlave/GO (GO - because it's writen in GoLang and setup is easy as 1.. 2.. 3.. GO!):

+ Binary!
+ Rock solid
+ Statically linked
+ Cross-platform
+ TLS 1.2 and HTTP/2 onboard
+ /CMD_EMAIL_POP support
+ Less memory footprint (can be used on tiny virtual instances with < 512Mb RAM)
+ Less CPU usage
+ A lot of improvements in speed
+ No more dependencies / perl modules
+ Setup is easy as 1.. 2.. 3.. GO!
+ Available for Linux i386/x32_64/arm & FreeBSD i386/amd64 (all in single archive distribution).

Download it here -- https://regme.in/download/directslave-3.0.2-beta-all.tar.gz

First time installing: see README
Updating from 2.x: see UPDATING

Also, feel free to contact me.

Have a nice expirience with brand new DirectSlave/GO!

1.. 2.. 3.. GO!
 
Last edited:

roman_m

Verified User
Feel free to use it, but remember - this is a beta, so in kind of any bugs all the reports are welcome!
 

Hosting Kernel

Verified User
Hi,

Just installed it on Ubuntu 16.04.

run /usr/local/directslave/bin/directslave --check everything is OK

After create test.com domain on DA for testing, only /etc/named/secondary/named.conf file created, there is no test.com.db zone file.

error.log
Code:
2017/07/07 19:16:51 DEBUG: &{Method:POST URL:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com Proto:HTTP/1.0 ProtoMajor:1 ProtoMinor:0 Header:map[Authorization:[Basic YWRtaW46R2lARHV5NzI3NQ==] Content-Length:[867]] Body:0xc420019f40 GetBody:<nil> ContentLength:867 TransferEncoding:[] Close:true Host: Form:map[action:[rawsave] domain:[test.com]] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:104.207.135.112:52941 RequestURI:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc4200e7980}
2017/07/07 19:16:51 DEBUG: &{Method:POST URL:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com Proto:HTTP/1.0 ProtoMajor:1 ProtoMinor:0 Header:map[Authorization:[Basic YWRtaW46R2lARHV5NzI3NQ==] Content-Length:[1356]] Body:0xc4201803c0 GetBody:<nil> ContentLength:1356 TransferEncoding:[] Close:true Host: Form:map[domain:[test.com] action:[rawsave]] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:104.207.135.112:60540 RequestURI:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc4200e7e90}
2017/07/07 19:16:57 exit status 1
action.log
Code:
2017/07/07 19:16:50 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:50 Checking test.com from 104.207.135.112
2017/07/07 19:16:50 Domain test.com not exists
2017/07/07 19:16:50 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:50 Checking test.com from 104.207.135.112
2017/07/07 19:16:50 Domain test.com not exists
2017/07/07 19:16:51 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:51 Domain test.com added with primary 104.207.135.112
2017/07/07 19:16:51 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:51 Reloaded test.com from master 104.207.135.112
2017/07/07 19:16:57 RNDC queue triggered with 2 events
2017/07/07 19:16:57 RNDC output:
access.log
Code:
2017/07/07 19:16:50 [104.207.135.112] "GET /CMD_API_DNS_ADMIN?action=exists&domain=test.com HTTP/1.0"
2017/07/07 19:16:50 [104.207.135.112] "GET /CMD_API_DNS_ADMIN?action=exists&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
 

DhoTjai

Verified User
CentOS 7:
Trying to run directslave --password, but I am getting:

DEBUG: Running as root (0), dropping privileges to 25:25
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x596ca4]

goroutine 1 [running]:
log.(*Logger).Output(0x0, 0x2, 0xc4200422d0, 0x41, 0x0, 0x0)
/usr/local/go/src/log/log.go:149 +0x54
log.(*Logger).Fatal(0x0, 0xc4200379a0, 0x1, 0x1)
/usr/local/go/src/log/log.go:188 +0x6a
main.UpdatePasswordFile()
/export/store/Project/home/golang/directslave/directslave.go:860 +0x247
main.RunWithOption(0x7fffa6eff793, 0xa)
/export/store/Project/home/golang/directslave/directslave.go:283 +0x22f
main.main()
/export/store/Project/home/golang/directslave/directslave.go:98 +0xfd
 
Last edited:

DhoTjai

Verified User
CentOS 7:
Trying to run directslave --password, but I am getting:

DEBUG: Running as root (0), dropping privileges to 25:25
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x596ca4]

goroutine 1 [running]:
log.(*Logger).Output(0x0, 0x2, 0xc4200422d0, 0x41, 0x0, 0x0)
/usr/local/go/src/log/log.go:149 +0x54
log.(*Logger).Fatal(0x0, 0xc4200379a0, 0x1, 0x1)
/usr/local/go/src/log/log.go:188 +0x6a
main.UpdatePasswordFile()
/export/store/Project/home/golang/directslave/directslave.go:860 +0x247
main.RunWithOption(0x7fffa6eff793, 0xa)
/export/store/Project/home/golang/directslave/directslave.go:283 +0x22f
main.main()
/export/store/Project/home/golang/directslave/directslave.go:98 +0xfd
path to rndc was wrong, changed the path to rndc and it's working now
 

DhoTjai

Verified User
Hi,

Just installed it on Ubuntu 16.04.

run /usr/local/directslave/bin/directslave --check everything is OK

After create test.com domain on DA for testing, only /etc/named/secondary/named.conf file created, there is no test.com.db zone file.

error.log
Code:
2017/07/07 19:16:51 DEBUG: &{Method:POST URL:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com Proto:HTTP/1.0 ProtoMajor:1 ProtoMinor:0 Header:map[Authorization:[Basic YWRtaW46R2lARHV5NzI3NQ==] Content-Length:[867]] Body:0xc420019f40 GetBody:<nil> ContentLength:867 TransferEncoding:[] Close:true Host: Form:map[action:[rawsave] domain:[test.com]] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:104.207.135.112:52941 RequestURI:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc4200e7980}
2017/07/07 19:16:51 DEBUG: &{Method:POST URL:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com Proto:HTTP/1.0 ProtoMajor:1 ProtoMinor:0 Header:map[Authorization:[Basic YWRtaW46R2lARHV5NzI3NQ==] Content-Length:[1356]] Body:0xc4201803c0 GetBody:<nil> ContentLength:1356 TransferEncoding:[] Close:true Host: Form:map[domain:[test.com] action:[rawsave]] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:104.207.135.112:60540 RequestURI:/CMD_API_DNS_ADMIN?action=rawsave&domain=test.com TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc4200e7e90}
2017/07/07 19:16:57 exit status 1
action.log
Code:
2017/07/07 19:16:50 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:50 Checking test.com from 104.207.135.112
2017/07/07 19:16:50 Domain test.com not exists
2017/07/07 19:16:50 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:50 Checking test.com from 104.207.135.112
2017/07/07 19:16:50 Domain test.com not exists
2017/07/07 19:16:51 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:51 Domain test.com added with primary 104.207.135.112
2017/07/07 19:16:51 Authorization passed for admin from 104.207.135.112
2017/07/07 19:16:51 Reloaded test.com from master 104.207.135.112
2017/07/07 19:16:57 RNDC queue triggered with 2 events
2017/07/07 19:16:57 RNDC output:
access.log
Code:
2017/07/07 19:16:50 [104.207.135.112] "GET /CMD_API_DNS_ADMIN?action=exists&domain=test.com HTTP/1.0"
2017/07/07 19:16:50 [104.207.135.112] "GET /CMD_API_DNS_ADMIN?action=exists&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
2017/07/07 19:16:51 [104.207.135.112] "POST /CMD_API_DNS_ADMIN?action=rawsave&domain=test.com HTTP/1.0"
I am not sure if this will help, but I added allow-transfer and allow-notify in /etc/bind/named.conf.options (directadmin server) and pointed to the IP address of the slave.

allow-transfer { 1.2.3.4; };
allow-notify { 1.2.3.4; };
notify yes;


Is your named-workdir /etc/named/secondary ? Make sure bind/named has access to directory /etc/named/secondary/.
 
Last edited:

Hosting Kernel

Verified User
I am not sure if this will help, but I added allow-transfer and allow-notify in /etc/bind/named.conf.options (directadmin server) and pointed to the IP address of the slave.

allow-transfer { 1.2.3.4; };
allow-notify { 1.2.3.4; };
notify yes;


Is your named-workdir /etc/named/secondary ? Make sure bind/named has access to directory /etc/named/secondary/.
I update DA config and re-check the bind permission OK, but still no .db zone file in named-workdir.
 

DhoTjai

Verified User
Thanks, I'll create centos 7 install to test. Did you use "yum install bind9" to install bind your centos ?
I did:
yum install bind
firewall-cmd --permanent --zone=public --add-port=2222/tcp
firewall-cmd --permanent --zone=public --add-port=53/udp
firewall-cmd --reload
chown -R named:named /usr/local/directslave
chown -R named:named /var/named

I put the slaves in /var/named directory
Code:
named_workdir   /var/named/slaves
named_conf      /var/named/directslave.inc
rndc_path       /usr/sbin/rndc
 
Last edited:

DhoTjai

Verified User
Hi,

Just installed it on Ubuntu 16.04.

run /usr/local/directslave/bin/directslave --check everything is OK

After create test.com domain on DA for testing, only /etc/named/secondary/named.conf file created, there is no test.com.db zone file.
Change named_workdir (in directslave.conf) to: /var/cache/bind
Restart directslave (and bind9)

See file: /etc/apparmor.d/usr.sbin.named
Code:
  # /etc/bind should be read-only for bind
  # /var/lib/bind is for dynamically updated zone (and journal) files.
  # /var/cache/bind is for slave/stub data, since we're not the origin of it.
  # See /usr/share/doc/bind9/README.Debian.gz
  /etc/bind/* r,
  /var/lib/bind/** rw,
  /var/lib/bind/ rw,
  /var/cache/bind/** lrw,
  /var/cache/bind/ rw,
 
Last edited:

DhoTjai

Verified User
Hi,

How to make directslave auto start after reboot in Ubuntu ?
There are several ways. I have not tested it yet with directslave and already erased the ubuntu test system.

A: crontab
You can use crontab, by adding @reboot /usr/local/directslave --run
1. crontab -e
2. @reboot /usr/local/directslave --run

B: /etc/rc.local
You can edit /etc/rc.local file and add /usr/local/directslave --run

c: Upstart or systemd
I believe Ubuntu 16.04 use systemd, please look at the example script at https://wiki.ubuntu.com/SystemdForUpstartUsers
The location of the new service file should be in /etc/systemd/system or /lib/systemd/system
 

TomJones

Verified User
Finally getting some time to work on implementing this. Quick, lazy question on the slave server, does anybody have any recommendations on a cheap, reliable (cloud) provider in the US that they like? I have an AWS account, but their hosting services seem to get pricey quickly, IIRC. I've worked with a lot of budget, shared hosts over the years, but most don't allow much/any shell access....
 

DhoTjai

Verified User
Finally getting some time to work on implementing this. Quick, lazy question on the slave server, does anybody have any recommendations on a cheap, reliable (cloud) provider in the US that they like? I have an AWS account, but their hosting services seem to get pricey quickly, IIRC. I've worked with a lot of budget, shared hosts over the years, but most don't allow much/any shell access....
Check lowendbox.com, companies post their offers on that website. You can see the user experiences/reviews on each deal.
 

stefanfr

Verified User
Hello,

I'm trying to install DirectSlave on centos 7.
Everything is working i guess.
Except my *.db files look weird and not like they are on the server with directadmin.

This is how my *.db files right now, this can't be right?
Code:
^@^@^@^B^@^@^@^AY�^U-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@n^@^A^@^F^@^@^@^@8@^@^@^@^A^@^T^Oaquariummanager^Bnl^@^@D^Cns1^Hhostplus^Bnl^@
hostmaster^Oaquariummanager^Bnl^@x:��^@^@8@^@^@^N^P^@^Ru^@^@^AQ�^@^@^@N^@^A^@^B^@^@^@^@^A,^@^@^@^B^@^T^Oaquariummanager^Bnl^@^@^Q^Cns1^Hhostplus^Bnl^@^@^Q^Cns2^Hhostplus^Bnl^@^@^@$^Dmail^Oaquariummanager^Bnl^@^@^@^@1^@^A^@^A^@^@^@^@^A,^@^@^@^A^@^W^Baa^Oaquariummanager^Bnl^@^@^D%a�^C^@^@^@
I've 3 other domains setup and al look somewhat similar.

Does anybody have this same problem and how did they fix it?
There is also no error or what so ever.
 
Top