OpenWrt Forum Archive

Topic: Is there luci-app's for vpnc and/or ser2net out there?

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

Does anybody know if there exist any configuration gui (luci-app) for vpnc or ser2net?
Or maybe someone out there are currently developing it?

If someone have any good links or information howto do this, please post?
Else I will start at: http://luci.subsignal.org/trac/wiki/Documentation  smile

Cheers
-Anders

(Last edited by carlberg on 11 Feb 2012, 16:07)

Hi,

Now I have a gui for ser2net, created in Lua/Luci mvc etc..
The configuration is loaded and saved in the cbi standard format (config sections with options).
I can add multiple configurations, to listen to more then one dev...etc..

but, I have one problem...   neutral
The ser2net (same goes for vpnc) service has a other config file format, and I have been trying to use the hooks in luci to tigger on save and then write the ser2net config file in this specific file format.
But for some reason is not my on_save function triggered.
I have tested using on_commit, and it is triggerd, but it don't seem to contain the new values that are stored, only default values.

Anyone have any experience with this?
(no luck with Google)

...or maybe I should have an other approach to this?

Cheers
-Anders

(Last edited by carlberg on 12 Feb 2012, 09:25)

little progress,

Now I atleast get the event triggerd on: on_parse, on_before_commit, on_after_commit. (syntax problem)
But I cant find out how to read the set values..
I can read the fields (name etc) but not the actual values that is set and stored....

I have google and found this: http://home.martin.cc/luci
but: local val = fld:formvalue(sid)  gives null (or nil).

Running out of ideas... neutral

EDIT:
Please help. (not needed anymore)


Sovled it:
you have to use: m.uci not m or just uci.
And then I will just write it to disk!  smile

Left todo:
do some testing and then post it...

Regards
-Anders

(Last edited by carlberg on 13 Feb 2012, 00:45)

Tested and it all works.

Change my approch abit,
I am using luci cbi model and let it creates a normal /etc/config/ser2net config file.
And then I added a service /etc/init.d/ser2net that first reads the cbi config (using cbi standalone tool) and creates a temporary file /tmp/ser2net.conf to be used by the process /bin/ser2net when it starts.

This means that the binary still uses the file as it is expected, and the luci-ser2net gets real simple.
Maybe it comes a day when the ser2net developers decide to start using cbi format or other format, when it is easy fix to just change the start script.

Clean and simple.

(now I will do the same thing for vpnc)

You can download them here:

Ser2Net - Serial to Network Proxy: http://www.stonednet.com/openwrt_ser2net-luci.zip
(supports multiple config, and it all seem to work good)

VPNC - Easy VPNC: http://www.stonednet.com/openwrt_vpnc-luci.zip
(have not tested all combinations of configuration)

I could'nt find how to create a real packages, but these zip files contains the luci-gui and the /etc/init.d/ scripts.
Maybe someone can help me to create real packages or even get them into the source of luci.

Cheers
-Anders

(Last edited by carlberg on 23 Feb 2012, 21:01)

good work! Writing LuCI pages and init scripts to wrap services is always a fun adventure.

Good idea to implement the vpnc settings into the luci-gui.
I will use it when/if you post the link.
/Per/

per.strandh wrote:

Good idea to implement the vpnc settings into the luci-gui.
I will use it when/if you post the link.
/Per/

Now the links are there.. Have fun.

Haven't found any gui for gnokii either or smsd....
Well.. I made my own "smsd" service... gnokii_smsreader and then I use cron to read the files and act on the sms that arrives.
Could'nt find any good way to trigger when the sms arrives, like a file watcher or such... any ideas?

Regards
-Anders

carlberg wrote:

Tested and it all works.

...

VPNC - Easy VPNC: http://www.stonednet.com/openwrt_vpnc-luci.zip
(have not tested all combinations of configuration)

I could'nt find how to create a real packages, but these zip files contains the luci-gui and the /etc/init.d/ scripts.
Maybe someone can help me to create real packages or even get them into the source of luci.

Cheers
-Anders

It really works! Thank you. If you still interested in package create procedure... I think the right way is to contribute you work to upstream: luasrc to LuCI trac, startscript and config - to OpenWrt trac (oops, don't works?). Look how much easier might be the build process, if the files were in the right places:
1. Fetch backfire and do `make menuconfig` for chosen device
2. Update and install feeds:

./scripts/feeds update
./scripts/feeds install -a -p packages
./scripts/feeds install -a -p luci

3. put vpnc stuff to feeds/packages/net/vpnc/files and patch feeds/packages/net/vpnc/Makefile:

Index: Makefile
===================================================================
--- Makefile    (revision 30974)
+++ Makefile    (working copy)
@@ -27,7 +27,7 @@
 endef
 
 define Package/vpnc/description
-    A VPN client compatible with Cisco's EasyVPN equipment.
+    A VPN client compatible with Cisco\'s EasyVPN equipment.
 
     Supports IPSec (ESP) with Mode Configuration and Xauth.  Supports only
     shared-secret IPSec authentication with Xauth, AES (256, 192, 128),
@@ -58,6 +58,10 @@
     install -d -m0700 $(1)/etc/vpnc
     $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vpnc/default.conf $(1)/etc/vpnc/
     $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/vpnc/vpnc-script $(1)/etc/vpnc/
+    $(INSTALL_DIR) $(1)/etc/config
+    $(INSTALL_CONF) ./files/vpnc.config $(1)/etc/config/vpnc
+    $(INSTALL_DIR) $(1)/etc/init.d
+    $(INSTALL_BIN) ./files/vpnc.init  $(1)/etc/init.d/vpnc
 endef
 
 $(eval $(call BuildPackage,vpnc))

4. do make menuconfig and check vpnc and luci. It under
Network -> VPN -> vpnc and
LuCI -> 1. Collections -> luci
5. make
6. put luasrc stuff to build_dir/<target>/luci-0.10.0/applications, find luci-vpnc/:

luci-vpnc/
luci-vpnc/luasrc
luci-vpnc/luasrc/controller
luci-vpnc/luasrc/controller/vpnc.lua
luci-vpnc/luasrc/model
luci-vpnc/luasrc/model/cbi
luci-vpnc/luasrc/model/cbi/vpnc.lua
luci-vpnc/Makefile

cat luci-vpnc/Makefile:

PO = vpnc

include ../../build/config.mk
include ../../build/module.mk

Add line

$(eval $(call application,vpnc,LuCI Support for vpnc))

to feeds/luci/luci/Makefile
7. make menuconfig. Check luci-app-vpnc under
LuCI -> 3. Applications
8. make

Packages are in bin/<target>/packages/

Hi g1itch,

Maybe I will, if someone haven't already done it, was longtime since I was here.
(btw, the download links works now people)

Thanks for the guide.

Cheers
/anders

I have added vpnc, vpnc-scripts and luci-app-vpnc to my Custom OpenWrt Builds. For link see signature.

All my builds are based on trunk!!

(Last edited by written_direcon on 23 Sep 2012, 15:18)

Hi everyone,
I was thinking on developing an vpnc module for LuCI, but it seems that you have some work already done!

I'm really interested on the luci-app-vpnc, but it seems that all the hosting machines with the source code are down. Could you provide me a link with the code you developed?

It would be great to create a new github project with this to be able to evolve it all of us.

Hi, tombatossals.

You can grab UCI patches from my invalid ticket (maybe I'll post it to mailing list later).

And if you send me forum email, I'll attach my somewhat changed luci-app-vpnc to reply.

Hi g1itch, thanks for the reply and the link.

I was developing the luci-app-vpnc with a friend and your code will be great help.

Our approach is similar to yours, saving the configuration to the UCI system and generating the vpnc.conf/default.conf file that understand vpnc from a template.

I'm new to this community so don't know about the development coding standards or the way to send patches to be included to the official repository. Is there any specific reason for your patch to be invalid? Could it be reworked some way so it would be accepted?

Our idea was to send the patch to the trac, and we're developing it on a github repository. Does this seems acceptable?

Please read the ticket comment: they want patches to be submitted to the mailing list. Can you give me the link to your github project?

I tested the luci-app-ser2net, with the latest Luci trunk r9902,  it works well, the only problem is i can't control it in LuCI->system->startup.
It seems all button of ser2net is invalid.

Openwrt trunk i use is also the latest trunk r37909

after using Jiapengli's guide (https://github.com/JiapengLi/OpenWrt-luci-app-ser2net) for adding ser2net functionality to LuCi i do see the service menu with ser2net in it. But after clicking on the menu the following message appears.

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute function dispatcher target for entry '/admin/services/ser2net'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute cbi dispatcher target for entry '/admin/services/ser2net/config'.
The called action terminated with an exception:
/usr/lib/lua/luci/cbi.lua:334: Unable to read UCI data: ser2net
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

I'm using OpenWrt Barrier Breaker r41360 / LuCI Trunk (svn-r10375)

Does anyone have an idea where this is going wrong?

Thanks in advance!

@belleview

Just create a file   "ser2net"  in /etc/config
It can be an empty file. (  cp /dev/null /etc/config/ser2net  )

thx ill try it next week and will give the outcome back here.

The discussion might have continued from here.