DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#51 2007-05-18 19:53:45

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

WildSioux wrote:

I am surprised I have made it this far.

congrats! now, do this:

Code:

telnet <ip>
cd /mnt/HD_a2/fun_plug.d/etc
mv lighttpd.conf-sample lighttpd.conf

This renames the sample config file. It should work for now, you can customize it later. Then, using windows explorer or whatever, create a "www" directory on the first volume (next to "fun_plug.d"). Inside the www directory, create another two directories: "pages" and "logs". Copy your web pages to the "pages" directory and surf to "http://<ip>:8080/".

If you got that working, read this: http://www.tldp.org/LDP/intro-linux/html/index.html (especially chapters 2 and 3). Find out how you can change permissions such that you can edit the config file from your windows host. Have fun!

PS: You need to restart lighttpd after you changed/renamed the config file: "killall lighttpd" and "sh /mnt/HD_a2/fun_plug.d/start/lighttpd.sh"

Last edited by fonz (2007-05-18 19:57:00)

Offline

 

#52 2007-05-18 22:43:02

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: Updated fun_plug

fonz wrote:

congrats! now, do this:

Code:

telnet <ip>
cd /mnt/HD_a2/fun_plug.d/etc
mv lighttpd.conf-sample lighttpd.conf

This renames the sample config file. It should work for now, you can customize it later. Then, using windows explorer or whatever, create a "www" directory on the first volume (next to "fun_plug.d"). Inside the www directory, create another two directories: "pages" and "logs". Copy your web pages to the "pages" directory and surf to "http://<ip>:8080/".

Thanks, all of that worked.  But I can't surf to http://<ip>:8080/

When I do the sh command for lighttpd, I get this...

/ # sh /mnt/HD_a2/fun_plug.d/start/lighttpd.sh
Starting lighttpd...
/ #

It shows that and nothing seems to happen.  It could be that I don't have my web pages published to a domain name yet.

EDIT:  I just tried surfing to "http://<ip>:8080/" and it works now!

I think I may be getting somewhere.  Now I just need to get all of this published to a domain and see if it really works.

My friend has a domain that is hosted by yahoo.  If he can somehow cancel the hosting service with yahoo but keep the domain, can I host it for him using this DNS323 lighttpd?

Last edited by WildSioux (2007-05-19 00:03:24)

Offline

 

#53 2007-05-21 01:35:53

drak0
Member
Registered: 2007-05-20
Posts: 20

Re: Updated fun_plug

thx for the fun plug... it works perfectly!  I'm glad you included unfs3 smile

Offline

 

#54 2007-05-21 23:26:52

DNS-323 Talker
Member
Registered: 2007-05-21
Posts: 245

Re: Updated fun_plug

Wildsioux...my 323 arrives on Wed...I am SO looking forward to getting a web server set up and your Q&A with the gurus here is going to be VERY useful to me.  Thanks to all.  I'm sure I'll have a few questions about it, but I think it will go very much smoother thanks to this info. 

Funny...when I ordered the 323 I was thinking that a web server was all I wanted to add to its features and I'd be completely happy w/the feature set for my needs.  Didn't have to have it, but it would be a nice bonus to share some pictures w/my family off and on again...now it looks like I'll have that.  Excellent!!


DNS-323 w/two Seagate 500 GB RAID1
Fonz's Fun_Plug- Don't DNS-323 without it!

Offline

 

#55 2007-05-23 08:20:32

Focher
Member
Registered: 2007-05-23
Posts: 35

Re: Updated fun_plug

Is there a technical obstacle to adding PHP support on the DNS-323? Is lighttpd capable of supporting PHP? I think I saw that AsteriskNOW does it, but I cannot say that I have checked too deeply.

I ask because if there is no technical obstacle that can already be identified, I will give it a go to try and get it working.

Offline

 

#56 2007-05-23 14:51:28

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: Updated fun_plug

First, Thanks to everyone in this thread who helped me get this fun_plug installed and lighttpd installed.  I understand a little better now how this linux stuff works.

Now, I am trying to access the test webpage I have setup from work.  I can see it fine at home by using this:  "http://<ip>:8080/"  But what the heck do I use away from home?  I have tried that and also putting in my WAN address from www.whatismyip.com.  But nothing works.

Am I supposed to forward the port 8080 in my router settings?  And how would I change the "http://<ip>...to something else like "www.myweb.com" for example?

Thanks

Offline

 

#57 2007-05-23 15:05:18

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

WildSioux wrote:

I can see it fine at home by using this:  "http://<ip>:8080/"  But what the heck do I use away from home? (...)
Am I supposed to forward the port 8080 in my router settings?

Yes...

WildSioux wrote:

And how would I change the "http://<ip>...to something else like "www.myweb.com" for example?

dyndns.

I'm glad you made it this far. These questions, however, are completely unrelated to the fun_plug. They are not even related to the DNS-323. Please start reading the fucking manuals.

Offline

 

#58 2007-05-23 15:14:43

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

Focher wrote:

Is there a technical obstacle to adding PHP support on the DNS-323? Is lighttpd capable of supporting PHP?

You need to compile PHP with fast-cgi support. It works well with lighttpd.

Offline

 

#59 2007-05-23 17:43:27

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: Updated fun_plug

fonz wrote:

Yes...

Thanks

dyndns.

I'm glad you made it this far. These questions, however, are completely unrelated to the fun_plug. They are not even related to the DNS-323. Please start reading the fucking manuals.

Thanks, just didn't know where to look.  The fun_plug runs the lighttpd server does it not.  No need for the attitude...

Offline

 

#60 2007-05-24 10:20:55

Kyorei
New member
Registered: 2007-05-24
Posts: 4

Re: Updated fun_plug

Hello all,

im a unix newbie, but learning fast - the DNS-323 is proving to be a fun learning tool. 

Fonz- you use busybox 1.5.0 - does this have to be specifically complied for the DNS?  (1.5.1 is out and i was thinking about trying to get this to work, just for fun) 

also - i note that there is an old version of busybox in the /bin dir (on the flash, i assume) - this would be the basic tool set that the box uses in its standard configuration, right?  i note all the fun_plug mods ive seen include and use a newer version of busybox loaded on the HDD.  is there any reason for not just updating the /bin version of busybox, rather than have a separate version stored on the hard drive?  other than space restrictions, is there any other reason for not updating the code on the flash?  for eg moving dropbear onto flash and modifiying /etc/rc.sh, so that ssh is available even if the drives are swapped...

ive been playing around with rsync (using your fun_plug kit) to backup files on my windows box.  tho im not running it as a daemon, but via ssh.  i read somewhere that there is a persitent problem using rsync over ssh under cygwin that causes it to hang sometimes.   someone suggested Unison as an alternative - and i wondered what the steps would be to get this running on the DNS323.  would the unison source have to be compiled to specifically run on the dns?  heres where my unix newness shows, and a bit of help understanding what is the method for and limitations of getting various things to run on the DNS would be great.

if the answers to these questions are obvious, please be patient with me - i'm figuring it all out as i go.

thanks,

K

Last edited by Kyorei (2007-05-24 10:22:38)

Offline

 

#61 2007-05-24 10:25:47

DNS-323 Talker
Member
Registered: 2007-05-21
Posts: 245

Re: Updated fun_plug

Kyorei...if you're a newbie, I'm a zygote...damn, back to feeling way stupid all over again...  sad


DNS-323 w/two Seagate 500 GB RAID1
Fonz's Fun_Plug- Don't DNS-323 without it!

Offline

 

#62 2007-05-24 11:33:02

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

Kyorei wrote:

you use busybox 1.5.0 - does this have to be specifically complied for the DNS?  (1.5.1 is out and i was thinking about trying to get this to work, just for fun)

Yes. The DNS can only run programs compiled for the ARM architecture that are either statically linked (i.e. they don't depend on any library files) or dynamically linked against the libs shipped with the box. My funplug is dynamically linked, and compiled using the cross-compilation toolchain from D-Link (i.e. I'm compiling on an i386, producing binaries that run on arm). The fw103-scripts and funplug-source packages on my site contain all my build scripts.

Kyorei wrote:

also - i note that there is an old version of busybox in the /bin dir (on the flash, i assume) - this would be the basic tool set that the box uses in its standard configuration, right?  i note all the fun_plug mods ive seen include and use a newer version of busybox loaded on the HDD.  is there any reason for not just updating the /bin version of busybox, rather than have a separate version stored on the hard drive?  other than space restrictions, is there any other reason for not updating the code on the flash?  for eg moving dropbear onto flash and modifiying /etc/rc.sh, so that ssh is available even if the drives are swapped...

I'd love to write my own stuff to the flash, but I fear what happens if I make a mistake... Danger is that the box becomes unusable, and the warranty is void, too.

Kyorei wrote:

ive been playing around with rsync (using your fun_plug kit) to backup files on my windows box.  tho im not running it as a daemon, but via ssh.  i read somewhere that there is a persitent problem using rsync over ssh under cygwin that causes it to hang sometimes.   someone suggested Unison as an alternative - and i wondered what the steps would be to get this running on the DNS323. would the unison source have to be compiled to specifically run on the dns?

If unison is a script (or several scripts), you need the interpreter (python, perl, whatever). If it's a C++ program, compiling it for the DNS might become really hard. If it's a nicely written C program, it might be as simple as cross-compiling busybox...

Offline

 

#63 2007-07-15 17:49:35

WingedStone
Member
Registered: 2007-07-09
Posts: 5

Re: Updated fun_plug

fonz wrote:

AJ wrote:

Thanks fonz - The change appeared to have worked until I rebooted (via the GUI). Prior to the reboot I was able to login as root via SSH and all appeared okay.

It seems, the "root" line is removed from /etc/shadow on reboot. I guess that's another safety measure like the chmod orgy reported by radiusweb. someguy reported that he can change root password with an earlier busybox binary, however, i don't know if that changes passwd or shadow and if it survives reboots.

a work-around that probably works would be to store the "root" line from shadow in a separate file (e.g. in /mnt/HD_a2/fun_plug.d/etc/shadow.root) and then make the fun_plug script append this to /etc/shadow on boot.it's not ideal, though.

not ideal, probably insecure but it works (at least I'm using it for time being):

/mnt/HD_a2/fun_plug.d/start/shadow.sh :

Code:

#!/bin/sh
USERS=root
FUN_SHADOW=${ETCDIR}/shadow
SHADOWLOG=${LOGDIR}/shadow.log

[ -f ${FUN_SHADOW} ] || {
    echo "no shadow found (searched at ${FUN_SHADOW}" >> ${SHADOWLOG}
    exit 1
}
    
for FUNNY_USER in $USERS; do 
    { grep $FUNNY_USER /etc/shadow && echo user $FUNNY_USER already present in /etc/shadow >> ${SHADOWLOG}; } ||
    { grep $FUNNY_USER $FUN_SHADOW >> /etc/shadow && echo user $FUNNY_USER added to /etc/shadow >> ${SHADOWLOG}; } ||
    echo failed to add user $FUNNY_USER to /etc/shadow >> ${SHADOWLOG}
done

Last edited by WingedStone (2007-07-15 17:53:49)

Offline

 

#64 2007-07-15 21:19:17

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

someguy wrote:

I've now reverted to your 2007.04.06, and passwd works fine again (w/ fw 1.03).

I'm not sure why it doesn't work with recent busybox versions. However, I found it works when using the passwd program source from busybox 1.4.1. They were using getspnam in 1.4.1, and changed to getspnam_r to save memory.

Offline

 

#65 2007-07-19 23:42:21

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

WingedStone wrote:

not ideal, probably insecure but it works (at least I'm using it for time being):

It seems, the elegant solution it just around the corner. I've fixed the passwd program in busybox, and cyboc seems to have found the commands to write changed passwd files to flash. See http://dns323.kood.org/forum/t750-Remov … tions.html

Offline

 

#66 2007-07-20 17:23:57

iaw4
New member
Registered: 2007-07-19
Posts: 2

Re: Updated fun_plug

dear fonz---thanks for putting this up.  I just grabbed it.  I am a seasoned linux user, but not a seasoned DNS user.  the telnet works wonderful, but has *no* password protection whatsoever.  I tried to give root a password (with "# passwd"), but it seems to make no difference.  /etc/passwd is not updated.  /etc/shadow does not contain root.  I gave admin and my user name a password, but because the telnet is root login by default, it doesn't matter.  does everyone leave their system entirely open?  couldn't be...  how do you passwd protect telnet?

/iaw

Offline

 

#67 2007-07-20 17:25:51

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: Updated fun_plug

stop telnet and use ssh/dropbear


First user to fun_plug the dns-323.

Offline

 

#68 2007-07-20 17:45:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

iaw4 wrote:

telnet works wonderful, but has *no* password protection whatsoever.

That's right. And there's no other way, because you want root access, but root has no password.

iaw4 wrote:

I tried to give root a password (with "# passwd"), but it seems to make no difference.  /etc/passwd is not updated.  /etc/shadow does not contain root.  I gave admin and my user name a password, but because the telnet is root login by default, it doesn't matter.  does everyone leave their system entirely open?

There are actually two problems: a) passwd doesn't work correctly for root, b) passwd doesn't update flash memory (changed password doesn't survive reboots).

Workarounds for both are described right here in this thread (didn't see it!?) - start reading here:
http://dns323.kood.org/forum/p2993-2007 … html#p2993

Also,
a) is solved in the current 0.3-testing-3 funplug on my site (see ChangeLog).
b) is almost solved, see http://dns323.kood.org/forum/t750-Remov … tions.html

Once you have a root password set, it's easy to either
a) change the telnet script to run login instead of sh
b) enable ssh and disable telnet like KRH suggested.

With a little extra work, you can even run ssh with public-key-auth. In that case you don't even need to set a root password...

Offline

 

#69 2007-07-22 16:08:05

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

Well, I've uploaded funplug-0.3.

SSH should work much better in this release than in 0.2:
- when logging in, fun_plug.d/etc/profile will be read, setting all the usual funplug environment variables
- the new script "store-passwd.sh" can be used to store passwords to the flash (see README.txt for the details)
- the new script "change-homedir.sh" can be used to move home directories to the disk (allowing use of .ssh/ directories)

php, imagemagick and ruby are available as add-on packages that can be installed using the "funpkg.sh" script.

Other changes include:
- new versions of busybox, portmap, dns323-utils
- zlib and pcre support in lighttpd
- added file, ldd and ldconfig commands

Have fun.

Offline

 

#70 2007-07-22 16:40:23

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: Updated fun_plug

SBINDIR=${FUNPLUGDIR}/bin
can you change that to
SBINDIR=${FUNPLUGDIR}/sbin
then i will be happy smile


First user to fun_plug the dns-323.

Offline

 

#71 2007-07-22 16:48:14

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

KRH wrote:

SBINDIR=${FUNPLUGDIR}/bin
can you change that to
SBINDIR=${FUNPLUGDIR}/sbin
then i will be happy smile

All the binaries are installed to bin/, so it's not "wrong". Admittedly, the directory layout is a bit non-standard, but the whole /mnt/HD_a2/fun_plug.d/ thing is pretty non-standard, and e.g. doesn't allow you to install stuff on the second disk. Is there a specific reason you ask for a separate sbin/?

Offline

 

#72 2007-07-22 16:51:19

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: Updated fun_plug

when i compile whit --prefix=/mnt/HD_a2/fun_plug.d/ some files like to be putted in sbin only thing.


First user to fun_plug the dns-323.

Offline

 

#73 2007-07-22 16:57:54

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

KRH wrote:

when i compile whit --prefix=/mnt/HD_a2/fun_plug.d/ some files like to be putted in sbin only thing.

Right, but normally that's just a small inconvenience, and not a real problem. This is from my lighttpd build script:

Code:

./configure \
    --config-cache \
    --host=arm-linux \
    --prefix=${CPREFIX} --sysconfdir=${ETCDIR} \
    --libdir=${LIBDIR}/${P} \
    --bindir=${BINDIR} \
    --sbindir=${SBINDIR} \
    ...

I'll think about sbin/ for 0.4 :-)

Offline

 

#74 2007-07-22 17:00:35

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: Updated fun_plug

thats fine for me smile

when are we getting us a irc chan to chat in smile


First user to fun_plug the dns-323.

Offline

 

#75 2007-07-22 17:06:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated fun_plug

KRH wrote:

when are we getting us a irc chan to chat in smile

Great idea. #funplug on freenode.org?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB