pptp-server/0040755000567100000120000000000007701233270013032 5ustar jcameronwheelpptp-server/images/0040775000567100000120000000000007701233300014273 5ustar jcameronwheelpptp-server/images/icon.gif0100664000567100000120000000247707701233270015727 0ustar jcameronwheelGIF89a00vvv^^^֢~~~nnnrrrjjjbbb666fffZZZNNN:::zzzVVVBBBJJJ¦FFFҾRRR222>>>ⶶRRV... ***FFN"""&&&,00   ³Ñ׹  Ғ  l\"UOع#ۨ2pAH7@? (~K1H JX"+[r)ѣ\hk;w jtP 881caÇ=Ox C*0fdT'D$ѠsviVTd|!C 7pб %@&ZWoḦ >rXC6Z9 5(!<z8€t&B >ztp98Æy! D79 !| 2Ǖ+aC \N \Ev6ķ ?ge%\>Gap *B|x)\BC UA(B!d"܉)p - . Hbr&Ô?IaIBp9Yr>_-Pf Fd">ޠ77$.~tBI&Tihx'ye裕j 6C4hbV6 ç8@j*x_:Q&?*0X%$;DɟhjCK7PFޥXϒj@vf - 0 & y>pfκv10o ѫ- Q3hy誜v (Da1B/p )'|,R*/8< 04A+| Kv@RS @!*\3l`]!28@ c B',oBA  wV}K7GyKWn;pptp-server/images/conf.gif0100664000567100000120000000247707701233270015724 0ustar jcameronwheelGIF89a00vvv^^^֢~~~nnnrrrjjjbbb666fffZZZNNN:::zzzVVVBBBJJJ¦FFFҾRRR222>>>ⶶRRV... ***FFN"""&&&,00   ³Ñ׹  Ғ  l\"UOع#ۨ2pAH7@? (~K1H JX"+[r)ѣ\hk;w jtP 881caÇ=Ox C*0fdT'D$ѠsviVTd|!C 7pб %@&ZWoḦ >rXC6Z9 5(!<z8€t&B >ztp98Æy! D79 !| 2Ǖ+aC \N \Ev6ķ ?ge%\>Gap *B|x)\BC UA(B!d"܉)p - . Hbr&Ô?IaIBp9Yr>_-Pf Fd">ޠ77$.~tBI&Tihx'ye裕j 6C4hbV6 ç8@j*x_:Q&?*0X%$;DɟhjCK7PFޥXϒj@vf - 0 & y>pfκv10o ѫ- Q3hy誜v (Da1B/p )'|,R*/8< 04A+| Kv@RS @!*\3l`]!28@ c B',oBA  wV}K7GyKWn;pptp-server/images/options.gif0100664000567100000120000000405107701233270016460 0ustar jcameronwheelGIF89a00 B>>RNZbbb62.rnv2B.*. zzz&""¾~~~ 6.2 ""ƾBBF. ZV^ JFF>2&.κ²Rnjj>::" & vvzNJR.&*JJJ¾⦦"&ھfbj^ZZ2.*zzֲ:JF rrz2.2Ҋ*&&"&"* 666ƚjfl~~ ζžNFNRRR. NJJ " &B>BnjrΆ&&bZ\F>::22FFBF~zvrv*"*" ʶƦޮ "ںŠrnz.*26.6>:>NJV.&.2..2.6,00 H*\ȰÇ#JHE06Yƍö@+<6G [6e linT"% ԡIȶmpԉUHm&+GAgHfÉ7}I-8p_8HdՒ2ʆ w 7bMl>CT`A ŃrVS rUԒv2~i9_).^ /l(ui #eL݈$s_RB :aئ<؄'ˆ .QJ^gGG Ev3I W RXtp"Wg\RKg'ETCфQts x})xN6&#D,D H&D (Ѝ6dqS)"5fC 4FF'T!Cf6z\EXu %toev*)Q"yD`A`6GA`z4IOp21hI64`,@qtf6W貍vі`Jm :LJ@A7iXCea@`U0MkIfc 6Sİ ,j*(2Ƙ(b ZbL-Q3A^kVH /Tqa`i)HcI+E'tC QԑEΚDtх0EtRby04 M84c<|OdD^Z;pL%P gD!p0B`]s3W]!ZRAl`cAP`@ScMC L-'(r u|9b7G8b hOv GppB3 MHh$o $pH&H! A!4NJT+Apta0C:\AWP!V/d@P hh > ĞwpHHȀ1!Px = 6 h$DH8 !yD9@CT+b0EK4XG,MDD0̱ 2BhE1Pr Xz:t\ yD`XG@ܑ"6B8(WL-Kx]l( !4 H =1$|a,  ɘ#!LB`/R | rBFSlFP`"A8Ea.6Ll6'Cw @z;pptp-server/images/secrets.gif0100644000567100000120000000336207701233270016437 0ustar jcameronwheelGIF89a00~~2rrVn~ҪZZZ666j*"^R:"ʞRBf6*޺&"Z>&&.ZR⾪>:~^BjB>^Z6n.6Ҷ>Bʚڮ>&bz>.B..2:jjjҒ22> 6Fzjfj^V^.*.fb.҂N~NN22ֲRβ⪦j.**F">v~枦VZ^N>>zβƮbʒ*"ª :62 ־Ⲧr>NB>&z&:JJ&jR JB:62N>溾z^޾jZRz::rN:Ƣ^NJFFF.J:BJ*"ζv2jfB2JJ²"6::::6B6fBj²..ƾN*nbbbʺvzzvvF:^6>ƾrfJ V>F"""FB>N~6J.>NNN: Fr":"BB>:Ʋ.j~zzbbN2*궪v&&޾FF>*f"ʲ*nƾ2FB6BFJƾ޾‚"2BN޲Ǝ""&^62J::J2^^^b2&>¾¶΢΢¾ FFF*N&! ,00 H"<Ӭ@40D4Hɓ Tiɗ0)68˘8Mf\n}9p-.&zىM'jjA?}1qRS fwU5X@ު2ox:u)MoT&OWwi^\@%T7 U%`; v"i4Hv\EqkmG18H=$glWI+དྷpo7).0oBx %<0{NwyXsFzPj_>>VVVvvv..."""fffJJJ222 򚚚&&&666BBBjjj^^^RRR***:::nnnzzzFFFNNNbbbrrr~~~ZZZFFNRRV,009@ E(@=)3A:2<8B<8>6'=+)>691A+<) Ѡ4*B%2.Ø 4%2>"A".̰mp|7()nz PE10:uvCI#$, 2À rCf )_DXxPТ ,L|( f ɣ"TZ/XL0kv6ƞP` E X40@,z0DGEXn[0-Xcb)*B/bF &NF,h4kW V|Ia8# 6#<bp .oB <0ϡAF#4{w&$h~,    F`w5n NGh7/('| ֧0*`l)!x GY'0z4:™l-' ' -P#7"M:`HW>^lcG en*m9}j6+%fx|Bj%!'xIl~0% }p~; <>><<<:::888666222000...,,,***(((&&&"""ggi  ,AH*GdYH22 3'8xQƎ @@A6bQaJpIM) @R%Pl:,i -a*Z,xCmXĢ| +9x"aC64Q .aʨ©p( 'AzƄNH6a# .HGSt:ȏhxC@$ I):dE{Z`Ca@+PIHE1@P6[ (Ad_̇C 2}1AQ$Ȅ2 )`GHPLJmhC"% v|OT4UdP'lpc 7#PTLZpt#Vq% R8ҕSpiA@;pptp-server/lang/0040775000567100000120000000000007701233270013755 5ustar jcameronwheelpptp-server/lang/ca0100755000567100000120000001456607701233270014275 0ustar jcameronwheelindex_title=Servidor VPN PPTP index_version=PoPToP versi $1 index_epptpd=El servidor $1 PPTP PoPToP no s'ha trobat al sistema o b no s el programa correcte. Pot ser que no estigui installat o que la configuraci del mdul sigui incorrecta. index_econfig=No s'ha trobat al sistema el fitxer $1 de configuraci del servidor PPTP. Pot ser que la configuraci del mdul sigui incorrecta. index_stop=Atura el servidor PPTP index_stopdesc=Fes clic sobre aquest bot per tancar el procs PPTP servidor en execuci, de manera que no s'accepti cap nova connexi. Tot i aix, les connexions VPN existents romandran actives. index_start=Inicia el servidor PPTP index_startdesc=Fes clic sobre aquest bot per iniciar el procs PPTP servidor de manera que pugui rebre connexions VPN dels clients. index_apply=Aplica la Configuraci index_applydesc=Fes clic sobre aquest bot per aplicar les opcions actuals del servidor PPTP aturant i reiniciant el procs PPTP servidor. Els canvis de les opcions PPP i els comptes PPP s'aplicaran sempre a qualsevol nova connexi. index_return=a l'ndex de mduls index_epppd=El programa servidor PPP $1 no est installat. PPTP en depn per poder operar. conf_title=Opcions del Servidor PPTP conf_header=Configuraci del servidor PPTP conf_speed=Velocitat en bauds del PPP conf_baud=bps conf_listen=Escolta l'adrea conf_all=Totes les adreces conf_localip=Adreces IP per al final de connexi del servidor conf_remoteip=Adreces IP per assignar als clients conf_ipxnets=Xarxes IPX a allotjar conf_from=De conf_to=a conf_option=Fitxer d'opcions PPP conf_mode0=Configuraci global conf_mode1=Valors especfics de PPTP conf_mode2=Fitxer personalitzat conf_ipdesc=Les adreces IP de tots dos rangs es poden introduir com una sola adrea (com 192.168.1.1) o com un rang (com 192.168.2.32-64) conf_err=No he pogut desar les opcions del servidor conf_espeed=Hi falta la velocitat en bauds o b s incorrecta conf_elisten=Hi falta l'adrea a escoltar o b s invlida conf_eoption=Hi falta el fitxer d'opcions PPP personalitzat o b sembla invlid conf_elocalip='$1' no s una adrea IP ni un rang local vlid conf_eremoteip='$1' no s una adrea IP ni un rang remot vlid conf_efrom=Hi falta l'adrea origen de la xarxa IPX o b s invlida conf_eto=Hi falta l'adrea de destinaci de la xarxa IPX o b s invlida options_title=Opcions del PPP options_desc0=Les opcions PPP a sota de $1 s'apliquen a TOTES les connexions d'entrada rebudes pel sistema, incloent-hi les trucades per mdem. options_desc1=Les opcions PPP a sota de $1 s'apliquennoms a totes les connexions PPTP. options_desc2=Seran utilitzades per qualsevol nova connexi que s'estableixi desprs de desar aquestformulari. options_header=Opcions de connexi PPP options_proxyarp=Crea entrada ARP de proxy options_lock=Bloqueja el fitxer de dispositiu PTY options_auth=Demana autenticaci options_auth0=No, per evite IPs encaminades options_auth1=Mai options_auth2=Sempre options_login=Fes tamb autenticaci Unix options_pap=Autenticaci PAP options_chap=Autenticaci CHAP options_req=Cal utilitzar options_all=Es pot utilitzar options_ref=No es pot utilitzar options_name=Nom del servidor per a l'autenticaci options_hn=Nom de host real options_mtu=Mida mxima dels paquets enviats options_mru=Mida mxima dels paquets rebuts options_err=No he pogut desar les opcions PPP options_emtu=Hi falta la mida mxima dels paquets enviats o b s invlida options_emru=Hi falta la mida mxima dels paquets rebuts b s invlida options_ename=Hi falta el nom del servidor per a l'autenticaci o b s invlid options_version=PPPd versi $1 options_msdesc=Les opcions de sota activen el mtode d'autenticaci MS-CHAP i el xifratge MPPE, que s l'emprat per defecte pels clients VPN de Windows. No obstant, MPPE necessita suport tant al dimoni PPP com al kernel del sistema operatiu. options_mschap=Autenticaci MS-CHAP options_mschap-v2=Autenticaci MS-CHAP versi 2 options_chapms=$options_mschap options_chapms-v2=$options_mschap-v2 secrets_title=Comptes PPP secrets_return=a l'ndex secrets_none=Encara no s'ha creat cap compte PPP. secrets_enopfile=El fitxer de contrasenyes PPP $1 no existeix. Pot ser que el PPP no estigui installat, o b que la configuraci del mdul sigui incorrecta. secrets_table=Comptes PPP de $1 secrets_user=Usuari secrets_ips=Adreces IP secrets_uany=Qualsevol secrets_sany=Qualsevol secrets_create=Crea un nou compte PPP secrets_desc=Els comptes PPP llistats en aquesta pgina es treuen del fitxer $1, que s'utilitza per a l'autenticaci $3. Noms es mostren les del teu servidor $2, no els comptes per fer connexions cap a l'exterior. edit_secret_etitle=Edici de Compte PPP edit_secret_ctitle=Creaci de Compte PPP edit_secret_acc=Compte PPP edit_secret_user=Usuari edit_secret_serv=Servidor edit_secret_sany=Qualsevol edit_secret_uany=Qualsevol edit_secret_pass=Contrasenya edit_secret_none=Cap edit_secret_ffile=Del fitxer edit_secret_leave=No ho canvis edit_secret_setto=Estableix a edit_secret_vaddr=Adreces Vlides edit_secret_aany=Permet-les totes edit_secret_anone=No en permetis cap edit_secret_alist=Permet les llistades edit_secret_sav=Desa edit_secret_del=Suprimeix edit_secret_return=a la llista de comptes save_secret_esave=No he pogut desar el compte save_secret_enoip='$1' no s una adrea vlida stop_err=No he pogut aturar el servidor PPTP stop_egone=Ja no est en execuci start_err=No he pogut iniciar el servidor PPTP apply_err=No he pogut reiniciar el servidor PPTP conns_title=Connexions Actives conns_desc=Aquesta pgina mostra les connexions PPTP actualment actives al servidor. Per desconnectar-ne una per la fora, fes clic sobre el nom de la seva interfcie. conns_iface=Interfcie PPP conns_client=Adrea del client conns_stime=Connectat des de conns_local=Adrea VPN del servidor conns_remote=Adrea VPN del client conns_none=No hi ha cap connexi PPTP activa en aquests moments. conns_unknown=Desconegut disc_err=No he pogut desconnectar disc_egone=La connexi ja no s activa disc_ekill=El procs ja no est en execuci log_secret_create=He creat el compte PPP $1 log_secret_modify=He modificat el compte PPP $1 log_secret_delete=He suprimit el compte PPP $1 log_conf=He modificat les opcions del servidor PPTP log_options=He modificat les opcions PPP log_disc=He desconnectat el client $1 log_start=He iniciat el servidor PPTP log_stop=He aturat el servidor PPTP log_apply=He aplicat la configuraci del servidor PPTP pptp-server/lang/en0100664000567100000120000001337507701233270014310 0ustar jcameronwheelindex_title=PPTP VPN Server index_version=PoPToP version $1 index_epptpd=The PoPToP PPTP server $1 was not found on your system, or is not the right program. Maybe it is not installed, or your module configuration is incorrect. index_econfig=The PPTP server configuration file $1 was not found on your system. Maybe your module configuration is incorrect. index_stop=Stop PPTP server index_stopdesc=Click this button to shut down the running PPTP server process, so that no new connections will be accepted. Existing VPN connections will remain active though. index_start=Start PPTP server index_startdesc=Click this button to start up the PPTP server process so that it can receive VPN connections from clients. index_apply=Apply Configuration index_applydesc=Click this button to apply the current PPTP server options by stopping and re-starting the PPTP server process. Changes to the PPP options and PPP accounts will be always apply to any new connections index_return=module index index_epppd=The PPP server program $1 is not installed on your system. The PPTP depends upon it to operate. conf_title=PPTP Server Options conf_header=PPTP server configuration conf_speed=PPP baud rate conf_baud=bps conf_listen=Listen on address conf_all=All addresses conf_localip=IP addresses for server end of connection conf_remoteip=IP addresses to allocate to clients conf_ipxnets=IPX networks to allocate conf_from=From conf_to=to conf_option=PPP options file conf_mode0=Global settings conf_mode1=PPTP-specific settings conf_mode2=Custom file conf_ipdesc=IP address in both ranges can be entered either singly (like 192.168.1.1) or as ranges (like 192.168.2.32-64) conf_err=Failed to save server options conf_espeed=Missing or invalid baud rate conf_elisten=Missing or invalid address to listen on conf_eoption=Missing or invalid-looking custom PPP options file conf_elocalip='$1' is not a valid local IP address or range conf_eremoteip='$1' is not a valid remote IP address or range conf_efrom=Missing or invalid IPX network from address conf_eto=Missing or invalid IPX network to address options_title=PPP Options options_desc0=The PPP options below from $1 apply to ALL incoming connections received by your system, including those to dialup modems. options_desc1=The PPP options below from $1 apply only to all PPTP connections. options_desc2=They will be used by any new connections established after this form is saved. options_header=PPP connection options options_proxyarp=Create proxy ARP entry? options_lock=Lock PTY device file? options_auth=Require authentication? options_auth0=No, but prevent routed IPs options_auth1=Never options_auth2=Always options_login=Also do unix authentication? options_pap=PAP authentication options_chap=CHAP authentication options_req=Must be used options_all=May be used options_ref=Cannot be used options_name=Server name for authentication options_hn=Real hostname options_mtu=Maximum sending packet size options_mru=Maximum receiving packet size options_err=Failed to save PPP options options_emtu=Missing or invalid maximum sending packet size options_emru=Missing or invalid maximum receiving packet size options_ename=Missing or invalid server name for authentication options_version=PPPd version $1 options_msdesc=The options below enable the MS-CHAP authentication method and MPPE encryption, used by default by Windows VPN clients. However, MPPE requires support in both the PPP daemon and operating system kernel. options_mschap=MS-CHAP authentication options_mschap-v2=MS-CHAP version 2 authentication options_chapms=$options_mschap options_chapms-v2=$options_mschap-v2 secrets_title=PPP Accounts secrets_return=index secrets_none=No PPP accounts have been created yet. secrets_enopfile=The PPP passwords file $1 does not exist on your system. Maybe PPP is not installed, or your module configuration is incorrect. secrets_table=PPP accounts for $1 secrets_user=Username secrets_ips=IP addresses secrets_uany=ANY secrets_sany=ANY secrets_create=Create new PPP account secrets_desc=The PPP accounts listed on this page are taken from the file $1, which is used for $3 authentication. Only those for your server $2 are shown, not accounts for making outgoing connections. edit_secret_etitle=Edit PPP Account edit_secret_ctitle=Create PPP Account edit_secret_acc=PPP Account edit_secret_user=Username edit_secret_serv=Server edit_secret_sany=Any edit_secret_uany=Any edit_secret_pass=Password edit_secret_none=None edit_secret_ffile=From file edit_secret_leave=Leave unchanged edit_secret_setto=Set to edit_secret_vaddr=Valid Addresses edit_secret_aany=Allow any edit_secret_anone=Allow none edit_secret_alist=Allow listed.. edit_secret_save=Save edit_secret_del=Delete edit_secret_return=account list save_secret_esave=Failed to save account save_secret_enoip='$1' is not a valid address stop_err=Failed to stop PPTP server stop_egone=No longer running start_err=Failed to start PPTP server apply_err=Failed to re-start PPTP server conns_title=Active Connections conns_desc=This page lists the currently active PPTP connections to your server. To forcibly disconnect one, click on its interface name. conns_iface=PPP interface conns_client=Client address conns_stime=Connected since conns_local=Server VPN address conns_remote=Client VPN address conns_none=No PPTP connections appear to be active at this time. conns_unknown=Unknown disc_err=Failed to disconnect disc_egone=Connections is no longer active disc_ekill=Process is no longer running log_secret_create=Created PPP account $1 log_secret_modify=Modified PPP account $1 log_secret_delete=Deleted PPP account $1 log_conf=Modified PPTP server options log_options=Modifed PPP options log_disc=Disconnected client $1 log_start=Started PPTP server log_stop=Stopped PPTP server log_apply=Applied PPTP server configuration pptp-server/edit_conf.cgi0100775000567100000120000000556707701233270015467 0ustar jcameronwheel#!/usr/local/bin/perl # edit_conf.cgi # Display PPTP server options require './pptp-server-lib.pl'; &header($text{'conf_title'}, "", "conf"); print "
\n"; # Show actual options $conf = &get_config(); print "
\n"; print "\n"; print "\n"; print "
$text{'conf_header'}
\n"; # Maximum PPP speed $speed = &find_conf("speed", $conf); print "\n", $speed, $text{'conf_baud'}; # Listen address $listen = &find_conf("listen", $conf); print "\n", $listen; # PPP options file $option = &find_conf("option", $conf); $mode = $option eq $options_pptp ? 1 : $option ? 2 : 0; print "\n", $mode == 2 ? $option : "", &file_chooser_button("option"); # Local IP ranges &ip_table("localip"); # Remote IP ranges &ip_table("remoteip"); # IPX networks $ipxnets = &find_conf("ipxnets", $conf); ($from, $to) = split(/-/, $ipxnets); print "\n"; print "
$text{'conf_speed'} \n"; printf " %s\n", $speed ? "" : "checked", $text{'default'}; printf "\n", $speed ? "checked" : ""; printf " %s$text{'conf_listen'} \n"; printf " %s\n", $listen ? "" : "checked", $text{'conf_all'}; printf "\n", $listen ? "checked" : ""; printf "
$text{'conf_option'} \n"; printf " %s\n", $mode == 0 ? "checked" : "", $text{'conf_mode0'}; printf " %s\n", $mode == 1 ? "checked" : "", $text{'conf_mode1'}; printf " %s\n", $mode == 2 ? "checked" : "", $text{'conf_mode2'}; printf " %s
$text{'conf_ipxnets'} \n"; printf " %s\n", $ipxnets ? "" : "checked", $text{'conf_all'}; printf "\n", $ipxnets ? "checked" : ""; printf "%s \n", $text{'conf_from'}, $from; printf "%s \n", $text{'conf_to'}, $from; print "
\n"; print "
\n"; print "
\n"; &footer("", $text{'index_return'}); sub ip_table { local @ips = split(/,/, &find_conf($_[0], $conf)); print " ",$text{'conf_'.$_[0]}, " \n"; print "\n"; print "\n"; if ($_[0] eq "localip") { print "$text{'conf_ipdesc'}\n"; } print "\n"; } pptp-server/module.info0100664000567100000120000000036207701233277015203 0ustar jcameronwheelcategory=net longdesc=Set up your system as a PPTP server so that Linux or Windows VPN clients can connect. os_support=*-linux freebsd desc=PPTP VPN Server name=PPTPd depends=proc net pptp-client 1.100 version=1.100 desc_ca=Servidor VPN PPTP pptp-server/help/0040775000567100000120000000000007701233270013764 5ustar jcameronwheelpptp-server/help/options.html0100664000567100000120000000172307701233270016345 0ustar jcameronwheel
PPP Options
Because the PPTP protocol uses PPP internally to actually transport data, the PPP daemon's configuration effects how it behaves. The options on this page determine if authentication is required or not, and if so what forms of authentication are accepted. CHAP is recommended, as it is the defacto standard for PPTP. However, once authentication is activated you must set up logins for clients on the PPP Accounts page.

The options at the bottom of the page can be used to enable the MPPE encryption and MS-CHAP authentication protocols used by default by Windows clients. MPPE adds security to PPTP connections, but requires that both the PPP daemon and the operating system kernel support it. PPPd versions 2.4.2 and above have native MPPE support, while a patch exists for older versions. However, the actual configuration file options differ between these two PPPd versions. This module will always use the correct options though.


pptp-server/help/intro.html0100664000567100000120000000144707701233270016010 0ustar jcameronwheel
PPTP VPN Server
This module allows you to set up the PoPToP server so that your system can accept PPTP connections from clients. On the main page are icons for setting general PPTP server options (such as the IP addresses to assign to clients), for setting PPP options (such as the type of authentication used), for editing PPP accounts used to authenticate clients, and for viewing any active PPTP sessions.

Also on the main page are buttons for stopping or starting the PPTP server. When it is running, an Apply Configuration button is also shown to activate the current PPTP server options for new connections. Any changes to the PPP options or accounts will immediately apply to all new connections established from then on, without the need to hit this button.


pptp-server/help/conf.html0100664000567100000120000000077307701233270015603 0ustar jcameronwheel
PPTP Server Options
The options on this page effect the master PPTP server process, which accepts network connections from clients and then starts a PPP daemon to handle them. The most important are the IP addresses for the client and server ends of the connection. The server address can be set to a single IP (like 192.168.1.1), but the client addresses should be a range or ranges big enough to handle all the simultanous clients that you expect (such as 192.168.1.100-200).


pptp-server/help/options.ca.html0100755000567100000120000000204507701233270016726 0ustar jcameronwheel
Opcions PPP
Com que el protocol PPTP utilitza PPP internament per al transport de dades, la configuraci del dimoni PPP influeix en el seu comportament. Les opcions d'aquesta pgina determinen si cal autenticaci o no, i si s aix, quines formes d'autenticaci estan acceptades. Recomanem CHAP perqu s l'estndard de facto per a PPTP. No obstant, un cop l'autenticaci estigui activada, has d'establir noms d'usuari pels clients a la pgina de Comptes PPP.

Les opcions del peu de la pgina es poden emprar per a activar el xifratge MPPE i els protocols d'autenticaci MS-CHAP utilitzats per defecte pels clients Windows. MPPE afegeix seguretat a les connexions PPTP, per requereix que tant el dimoni PPP com el kernel del sistema operatiu ho suportin. Les versions 2.4.2 de PPPd en amunt tenen suport natiu de MPPE; hi ha un peda per a versions ms antigues. No obstant, les opcions del fitxer de configuraci varien entre aquestes dues versions de PPPd. Tot i aix, aquest mdul utilitzar sempre les opcions correctes.


pptp-server/help/secrets.html0100664000567100000120000000126007701233270016316 0ustar jcameronwheel
PPP Accounts
This page lists accounts used by your PPTP server for authentication clients. Only those in the PPP secrets file whose server name matches your system's hostname (or the hostname set on the PPP Options page) are shown, as they are the only ones that will be used for authentication. This means that any other PPP secrets (such as for a dial-out or ADSL connection) will not be shown or touched.

When editing an account, you may enter a list of IP addresses that it can be assigned. This allows a different static IP to be assigned to individual users, instead of one being chosen randomly from the range set on the PPTP Server Options page.


pptp-server/help/conns.html0100664000567100000120000000030407701233270015764 0ustar jcameronwheel
Active Connections
This page just lists PPTP connections currently connected to your server. A connection can be forcibly closed by clicking on its PPP interface name.


pptp-server/help/secrets.ca.html0100755000567100000120000000136507701233270016707 0ustar jcameronwheel
Comptes PPP
Aquesta pgina llista els comptes utilitzats pel servidor PPTP per a autenticar els clients. Noms es mostren aquells del fitxer de secrets PPP el servidor dels quals coincideix amb el teu nom de host (o el nom de host posat a la pgina d'Opcions PPP), ja que sn els nics que es faran servir per a l'autenticaci. Aix vol dir que els altres secrets PPP (per exemple, els d'una connexi sortint o una connexi ADSL) ni es mostraran ni es tocaran per res.

En editar un compte, has d'introduir una llista d'Adreces IP a les quals pot sser assignat. Aix permet que s'assigni una IP esttica a un usuari determinat, en lloc de triar-ne una a l'atzar del rang establert a la pgina d'Opcions del Servidor PPTP.


pptp-server/help/conns.ca.html0100755000567100000120000000033107701233270016347 0ustar jcameronwheel
Connexions Actives
Aquesta pgina llista les connexions PPTP actualment connectades al servidor. Les connexions es poden tancar per fora fent clic sobre el nom de la seva interfcie PPP.


pptp-server/help/conf.ca.html0100755000567100000120000000105307701233270016156 0ustar jcameronwheel
Opcions del Servidor PPTP
Les opcions d'aquesta pgina tenen efecte sobre el procs servidor PPTP mestre, que accepta connexions de xarxa dels clients i llavors inicia un dimoni PPP per gestionar-los. Les ms importants sn les adreces IP per als extrems client i servidor de la connexi. L'adrea del servidor es pot establir a una sola adrea IP (com 192.168.1.1), per les adreces dels clients haurien de ser un rang o rangs prou grans com per gestionar tots els clients simultanis previstos (com ara 192.168.1.100-200).


pptp-server/help/intro.ca.html0100755000567100000120000000160107701233270016363 0ustar jcameronwheel
Servidor VPN PPTP
Aquest mdul permet configurar el servidor PoPToP per tal que el sistema pugui acceptar connexions PPTP de clients. A la pgina principal hi han icones per establir opcions generals del servidor PPTP (com ara les adreces IP per assignar als clients), per establir opcions PPP (com ara el tipus d'autenticaci emprat), per editar els comptes PPP utilitzats per autenticar els clients, i per visualitzar totes les connexions PPTP actives.

A la pgina principal tamb hi ha botons per iniciar o aturar el servidor PPTP. Quan est en execuci, tamb es mostra el bot Aplica la Configuraci per fer actives les opcions actuals del servidor PPTP a les noves connexions. Tots els canvis als comptes o opcions PPP s'aplicaran immediatament a totes les noves connexions establertes a partir de llavors, sense necessitat de prmer aquest bot.


pptp-server/index.cgi0100775000567100000120000000472207701233270014634 0ustar jcameronwheel#!/usr/local/bin/perl # index.cgi # Display the current PPTP configuration require './pptp-server-lib.pl'; # Check if it is installed if (!&has_command($config{'pptpd'}) || ($out = `$config{'pptpd'} -v 2>&1`) !~ /PoPToP\s+v?(\S+)/i) { &header($text{'index_title'}, "intro", undef, 1, 1); print "
\n"; print "

",&text('index_epptpd', "$config{'pptpd'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; if ($out) { print &text('index_ver', "$config{'pptpd'} -v"),"\n"; print "

$out
\n"; } } else { # Show the title and version $vers = $1; &header($text{'index_title'}, "", "intro", 1, 1, 0, &help_search_link("pptp", "man", "doc"), undef, undef, &text('index_version', $vers)); print "
\n"; if (!-r $config{'file'}) { # Check for the config file print "

",&text('index_econfig', "$config{'file'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; } elsif (!&has_command("pppd")) { # Check for PPPd print "

",&text('index_epppd', "pppd"),"

\n"; } else { # Show table of options @links = ( "edit_conf.cgi", "edit_options.cgi", "list_secrets.cgi", "list_conns.cgi" ); @images = ( "images/conf.gif", "images/options.gif", "images/secrets.gif", "images/conns.gif" ); @titles = ( $text{'conf_title'}, $text{'options_title'}, $text{'secrets_title'}, $text{'conns_title'} ); &icons_table(\@links, \@titles, \@images); # Start or stop/apply buttons print "


\n"; print "\n"; $pid = &get_pptpd_pid(); if ($pid && kill(0, $pid)) { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } else { print "\n"; print "\n"; print "\n"; } print "
$text{'index_applydesc'}
$text{'index_stopdesc'}
$text{'index_startdesc'}
\n"; } } print "
\n"; &footer("/", $text{'index'}); sub ip_table { local @ips = split(/,/, &find($_[0], $conf)); print " ",$text{'index_'.$_[0]}, " \n"; print "\n"; print " \n"; } pptp-server/config.info0100664000567100000120000000061507701233270015155 0ustar jcameronwheelline2=System configuration,11 pptpd=Full path to PPTP daemon program,0 file=PPTP configuration file,0 pid_file=Full path to PPTP PID file,0 pap_file=PPP accounts file,0 ppp_options=Default PPP options file,0 pptp_ppp_options=PPTP PPP options file,3,Default (/etc/ppp/options.pptp) start_cmd=Command to start PPTP daemon,3,Just run program stop_cmd=Command to stop PPTP daemon,3,Just kill program pptp-server/config0100664000567100000120000000017107701233270014220 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options pptp-server/list_secrets.cgi0100775000567100000120000000363507701233270016232 0ustar jcameronwheel#!/usr/local/bin/perl # list_secrets.cgi # Displays a list of all PAP secrets require './pptp-server-lib.pl'; &header($text{'secrets_title'}, "", "secrets"); print "
\n"; if (!-r $config{'pap_file'}) { print "

", &text('secrets_enopfile', $config{'pap_file'}, "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; print "


\n"; &footer("/", $text{'secrets_return'}); exit; } # Get the system's hostname for selecting PPP accounts $host = &get_ppp_hostname(); print &text('secrets_desc', "$config{'pap_file'}", "$host", $config{'pap_file'} =~ /pap-secrets/ ? "PAP" : "CHAP"),"

\n"; @sec = grep { $_->{'server'} eq $host } &list_secrets(); if (@sec) { print "$text{'secrets_create'}
\n"; print "\n"; print "\n"; print "
",&text('secrets_table', "$hostname"), "
\n"; print " ", " ", " ", "\n"; for($i=0; $i<@sec; $i++) { if ($i%2 == 0) { print "\n"; } $s = $sec[$i]; printf "\n", $s->{'client'} ? &html_escape($s->{'client'}) : $text{'secrets_uany'}; @i = @{$s->{'ips'}}; printf "\n", $i[0] eq "*" || $i[0] eq "" ? $text{'edit_secret_aany'}: $i[0] eq "-" ? $text{'edit_secret_anone'} : &html_escape(join(" ", @i)); if ($i%2 == 1) { print "\n"; } } print "
", $text{'secrets_user'}, "", $text{'secrets_ips'}, "", $text{'secrets_user'}, "", $text{'secrets_ips'}, "
". "%s%s
\n"; } else { print "$text{'secrets_none'}

\n"; } print "$text{'secrets_create'}

\n"; print "


\n"; &footer("", $text{'secrets_return'}); pptp-server/secrets-lib.pl0100664000567100000120000000313307701233270015602 0ustar jcameronwheel# secrets-lib.pl # Common functions for editing a PPP users file # list_secrets() sub list_secrets { local(@rv, $line, $_); open(SEC, $config{'pap_file'}); $line = 0; while() { chop; s/^#.*$//g; @w = &split_words($_); if (@w >= 3) { local(%sec, @ips); $sec{'client'} = $w[0]; $sec{'server'} = $w[1]; $sec{'secret'} = $w[2]; @ips = @w[3..$#w]; $sec{'ips'} = \@ips; $sec{'line'} = $line; $sec{'index'} = scalar(@rv); push(@rv, \%sec); } $line++; } close(SEC); return @rv; } # create_secret(&secret) sub create_secret { open(SEC, ">>$config{'pap_file'}"); print SEC &join_words($_[0]->{'client'}, $_[0]->{'server'}, $_[0]->{'secret'}, @{$_[0]->{'ips'}}),"\n"; close(SEC); } # change_secret(&secret) sub change_secret { &replace_file_line($config{'pap_file'}, $_[0]->{'line'}, &join_words($_[0]->{'client'}, $_[0]->{'server'}, $_[0]->{'secret'}, @{$_[0]->{'ips'}})."\n"); } # delete_secret(&secret) sub delete_secret { &replace_file_line($config{'pap_file'}, $_[0]->{'line'}); } # split_words(string) sub split_words { local($s, @w); $s = $_[0]; while($s =~ /^\s*([^"\s]+|"([^"]*)")(.*)$/) { push(@w, defined($2) ? $2 : $1); $s = $3; } return @w; } sub join_words { local(@w, $w); foreach $w (@_) { if ($w =~ /^\S+$/) { push(@w, $w); } else { push(@w, "\"$w\""); } } return join(" ", @w); } # opt_crypt(password) # Returns the given password, crypted if the user has configured it sub opt_crypt { if ($config{'encrypt_pass'}) { local($salt); srand(time()); $salt = chr(int(rand(26))+65).chr(int(rand(26))+65); return crypt($_[0], $salt); } return $_[0]; } pptp-server/edit_secret.cgi0100755000567100000120000000557207701233270016021 0ustar jcameronwheel#!/usr/local/bin/perl # edit_secret.cgi # Displays a form for editing or creating a pap secret require './pptp-server-lib.pl'; if (@ARGV) { $idx = $ARGV[0]; &header($text{'edit_secret_etitle'}, ""); @seclist = &list_secrets(); %sec = %{$seclist[$idx]}; } else { &header($text{'edit_secret_ctitle'}, ""); } print "
\n"; print "
\n"; if (%sec) { print "\n"; } print "\n"; print "\n"; print "
",$text{'edit_secret_acc'},"
\n"; print "\n"; printf "\n"; print "\n"; printf "\n"; @ips = @{$sec{'ips'}}; print "\n"; printf "\n", @ips && $ips[0] ne "-" && $ips[0] ne "*" ? join("\n", @ips) : ""; print "
", $text{'edit_secret_user'}, " ", %sec && !$sec{'client'} ? "checked" : ""; print $text{'edit_secret_uany'}, "\n"; printf " ", %sec && !$sec{'client'} ? "" : "checked"; print "
", $text{'edit_secret_pass'}, " ", %sec && $sec{'secret'} eq "" ? "checked" : ""; print $text{'edit_secret_none'}, "
\n"; printf " ", $sec{'secret'} =~ /^@(.*)$/ ? "checked" : ""; print $text{'edit_secret_ffile'}; printf "\n", $sec{'secret'} =~ /^@(.*)$/ ? $1 : ""; print &file_chooser_button("pass_file", 0); print "
\n"; if (%sec) { printf " ", $sec{'secret'} !~ /^(@.*|)$/ ? "checked" : ""; print $text{'edit_secret_leave'}, "
\n"; } printf " ", %sec ? "" : "checked"; print $text{'edit_secret_setto'}, "\n"; print "
", $text{'edit_secret_vaddr'}, " ", $ips[0] eq "*" || !@ips ? "checked" : ""; print $text{'edit_secret_aany'}, "
\n"; printf " ", $ips[0] eq "-" ? "checked" : ""; print $text{'edit_secret_anone'}, "
\n"; printf " ", @ips && $ips[0] ne "-" && $ips[0] ne "*" ? "checked" : ""; print $text{'edit_secret_alist'}, "
\n"; printf "
\n"; print "\n"; if (%sec) { print "\n"; } print "
\n"; print "\n"; print "
\n"; print "
\n"; &footer("list_secrets.cgi", $text{'edit_secret_return'}); pptp-server/save_secret.cgi0100755000567100000120000000257407701233270016031 0ustar jcameronwheel#!/usr/local/bin/perl # save_secret.cgi # Update the secrets file to add or change a secret require './pptp-server-lib.pl'; &ReadParse(); $whatfailed = $text{'save_secret_esave'}; &lock_file($config{'pap_file'}); if (defined($in{'idx'})) { @seclist = &list_secrets(); %sec = %{$seclist[$in{'idx'}]}; if ($in{'delete'}) { &delete_secret(\%sec); &unlock_file($config{'pap_file'}); &webmin_log("delete", "secret", $sec{'client'}, \%sec); &redirect("list_secrets.cgi"); exit; } } if ($in{'client_def'}) { $sec{'client'} = ""; } else { $sec{'client'} = $in{'client'}; } $sec{'server'} = &get_ppp_hostname(); if ($in{'pass_mode'} == 0) { $sec{'secret'} = ""; } elsif ($in{'pass_mode'} == 1) { $sec{'secret'} = "\@$in{'pass_file'}"; } elsif ($in{'pass_mode'} == 3) { $sec{'secret'} = &opt_crypt($in{'pass_text'}); } if ($in{'ips_mode'} == 0) { $sec{'ips'} = [ "*" ]; } elsif ($in{'ips_mode'} == 1) { $sec{'ips'} = [ "-" ]; } elsif ($in{'ips_mode'} == 2) { @ips = split(/\s+/, $in{'ips'}); foreach $ip (@ips) { if (!gethostbyname($ip)) { &error(&text('save_secret_enoip', $ip)); } } $sec{'ips'} = \@ips; } if (defined($in{'idx'})) { &change_secret(\%sec); } else { &create_secret(\%sec); } &unlock_file($config{'pap_file'}); delete($sec{'secret'}); &webmin_log(defined($in{'idx'}) ? "modify" : "create", "secret", $sec{'client'}, \%sec); &redirect("list_secrets.cgi"); pptp-server/start.cgi0100775000567100000120000000055607701233270014663 0ustar jcameronwheel#!/usr/local/bin/perl # start.cgi # Start up the PPTP server require './pptp-server-lib.pl'; &error_setup($text{'start_err'}); $cmd = $config{'start_cmd'} || $config{'pptpd'}; $temp = &tempname(); $rv = &system_logged("$cmd >$temp 2>&1 $out"); } &webmin_log("start"); &redirect(""); pptp-server/stop.cgi0100775000567100000120000000063407701233270014510 0ustar jcameronwheel#!/usr/local/bin/perl # stop.cgi # Shut down the PPTP server require './pptp-server-lib.pl'; &error_setup($text{'stop_err'}); if ($config{'stop_cmd'}) { $out = &backquote_logged("$config{'stop_cmd'} 2>&1 $out") if ($?); } else { $pid = &get_pptpd_pid(); if (!$pid || !&kill_logged('TERM', $pid)) { &error($text{'stop_egone'}); } } &webmin_log("stop"); &redirect(""); pptp-server/apply.cgi0100775000567100000120000000121707701233270014646 0ustar jcameronwheel#!/usr/local/bin/perl # apply.cgi # Shut down and re-start the PPTP server require './pptp-server-lib.pl'; &error_setup($text{'apply_err'}); # Stop first if ($config{'stop_cmd'}) { $out = &backquote_logged("$config{'stop_cmd'} 2>&1 $out") if ($?); } else { $pid = &get_pptpd_pid(); if (!$pid || !&kill_logged('TERM', $pid)) { &error($text{'stop_egone'}); } } # Re-start $cmd = $config{'start_cmd'} || $config{'pptpd'}; $temp = &tempname(); $rv = &system_logged("$cmd >$temp 2>&1 $out"); } &webmin_log("apply"); &redirect(""); pptp-server/config-open-linux0100664000567100000120000000030507701233270016313 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options start_cmd=/etc/rc.d/init.d/pptpd start stop_cmd=/etc/rc.d/init.d/pptpd stop pptp-server/edit_options.cgi0100775000567100000120000001062307701233270016222 0ustar jcameronwheel#!/usr/local/bin/perl # edit_options.cgi # XXX +chap options? require './pptp-server-lib.pl'; $out = `pppd --help 2>&1`; if ($out =~ /version\s+(\S+)/i) { $vers = $1; } &header($text{'options_title'}, "", "options", 0, 0, 0, undef, undef, undef, &text('options_version', $vers)); print "
\n"; $conf = &get_config(); $option = &find_conf("option", $conf); $option ||= $config{'ppp_options'}; @opts = &parse_ppp_options($option); if ($option eq $config{'ppp_options'}) { print &text('options_desc0', "$option"),"\n"; } else { print &text('options_desc1', "$option"),"\n"; } print "$text{'options_desc2'}

\n"; print "

\n"; print "\n"; print "\n"; print "
$text{'options_header'}
\n"; $lock = &find("lock", \@opts); print "\n"; printf "\n", $lock ? "" : "checked", $text{'no'}; $proxy = &find("proxyarp", \@opts); print "\n"; printf "\n", $proxy ? "" : "checked", $text{'no'}; $mtu = &find("mtu", \@opts); printf "\n"; $mru = &find("mru", \@opts); printf "\n"; print "\n"; $auth = &find("auth", \@opts); $noauth = &find("noauth", \@opts); print "\n"; printf "\n", $auth ? "checked" : "", $text{'options_auth2'}; &auth_input("pap"); &auth_input("chap"); $login = &find("login", \@opts); print "\n"; printf "\n", $login ? "" : "checked", $text{'no'}; $name = &find("name", \@opts); printf "\n"; print "\n"; print "\n"; &foreign_require("pptp-client", "pptp-client-lib.pl"); if (&pptp_client::mppe_support() == 1) { # Show new-style MS-CHAP options &auth_input("mschap"); &auth_input("mschap-v2"); } else { # Show old-style MS-CHAP option &auth_input("chapms"); &auth_input("chapms-v2"); } # Show general MPPE options &pptp_client::mppe_options_form(\@opts); print "
$text{'options_lock'} %s\n", $lock ? "checked" : "", $text{'yes'}; printf " %s$text{'options_proxyarp'} %s\n", $proxy ? "checked" : "", $text{'yes'}; printf " %s
$text{'options_mtu'} \n"; printf " %s\n", $mtu ? "" : "checked", $text{'default'}; printf "\n", $mtu ? "checked" : ""; print " bytes$text{'options_mru'} \n"; printf " %s\n", $mru ? "" : "checked", $text{'default'}; printf "\n", $mru ? "checked" : ""; print " bytes

$text{'options_auth'} %s\n", $noauth || $auth ? "" : "checked", $text{'options_auth0'}; printf " %s\n", $noauth ? "checked" : "", $text{'options_auth1'}; printf " %s
$text{'options_login'} %s\n", $login ? "checked" : "", $text{'yes'}; printf " %s
$text{'options_name'} \n"; printf " %s (%s)\n", $name ? "" : "checked", $text{'options_hn'}, &get_system_hostname(); printf "\n", $name ? "checked" : ""; print "

$text{'options_msdesc'}
\n"; print "
\n"; print "
\n"; &footer("", $text{'index_return'}); # auth_input(name) sub auth_input { local $a = $_[0]; local $req = &find("require-$a", \@opts); local $ref = &find("refuse-$a", \@opts); print " ",$text{'options_'.$a}," \n"; printf " %s\n", $req ? "checked" : "", $text{"options_req"}; printf " %s\n", $req || $ref ? "" : "checked", $text{"options_all"}; printf " %s \n", $ref ? "checked" : "", $text{"options_ref"}; } pptp-server/save_options.cgi0100775000567100000120000000504607701233270016236 0ustar jcameronwheel#!/usr/local/bin/perl # save_options.cgi # Save PPP server options require './pptp-server-lib.pl'; &error_setup($text{'options_err'}); &ReadParse(); $conf = &get_config(); $option = &find_conf("option", $conf); $option ||= $config{'ppp_options'}; &lock_file($option); @opts = &parse_ppp_options($option); # Validate inputs $in{'mtu_def'} || $in{'mtu'} =~ /^\d+$/ || &error($text{'options_emtu'}); $in{'mru_def'} || $in{'mru'} =~ /^\d+$/ || &error($text{'options_emru'}); $in{'name_def'} || $in{'name'} =~ /^[A-Za-z0-9\.\-]+$/ || &error($text{'options_ename'}); # Save options &save_ppp_option(\@opts, $option, "proxyarp", $in{'proxyarp'} ? { 'name' => 'proxyarp' } : undef); &save_ppp_option(\@opts, $option, "lock", $in{'lock'} ? { 'name' => 'lock' } : undef); &save_ppp_option(\@opts, $option, "mtu", $in{'mtu_def'} ? undef : { 'name' => 'mtu', 'value' => $in{'mtu'} }); &save_ppp_option(\@opts, $option, "mru", $in{'mru_def'} ? undef : { 'name' => 'mru', 'value' => $in{'mru'} }); if ($in{'auth'} == 0) { &save_ppp_option(\@opts, $option, "auth", undef); &save_ppp_option(\@opts, $option, "noauth", undef); } elsif ($in{'auth'} == 1) { &save_ppp_option(\@opts, $option, "auth", undef); &save_ppp_option(\@opts, $option, "noauth", { 'name' => 'noauth' }); } else { &save_ppp_option(\@opts, $option, "noauth", undef); &save_ppp_option(\@opts, $option, "auth", { 'name' => 'auth' }); } &parse_auth("pap"); &parse_auth("chap"); &save_ppp_option(\@opts, $option, "login", $in{'login'} ? { 'name' => 'login' } : undef); &save_ppp_option(\@opts, $option, "name", $in{'name_def'} ? undef : { 'name' => 'name', 'value' => $in{'name'} }); &foreign_require("pptp-client", "pptp-client-lib.pl"); %pptp_client::in = %in; &pptp_client::parse_mppe_options(\@opts, $option); if (&pptp_client::mppe_support() == 1) { &parse_auth("mschap"); &parse_auth("mschap-v2"); } else { &parse_auth("chapms"); &parse_auth("chapms-v2"); } # All done &flush_file_lines(); &unlock_file($option); &webmin_log("options", undef, undef, \%in); &redirect(""); # parse_auth(name) sub parse_auth { local $a = $_[0]; if ($in{$a} == 2) { &save_ppp_option(\@opts, $option, "require-$a", { 'name' => "require-$a" }); &save_ppp_option(\@opts, $option, "refuse-$a", undef); } elsif ($in{$a} == 1) { &save_ppp_option(\@opts, $option, "require-$a", undef); &save_ppp_option(\@opts, $option, "refuse-$a", undef); } else { &save_ppp_option(\@opts, $option, "require-$a", undef); &save_ppp_option(\@opts, $option, "refuse-$a", { 'name' => "refuse-$a" }); } } pptp-server/save_conf.cgi0100775000567100000120000000301007701233270015455 0ustar jcameronwheel#!/usr/local/bin/perl # save_conf.cgi # Save PPTP server settings require './pptp-server-lib.pl'; &ReadParse(); &error_setup($text{'conf_err'}); # Validate and store inputs &lock_file($config{'file'}); $conf = &get_config(); if ($in{'speed_def'}) { &save_directive($conf, "speed"); } else { $in{'speed'} =~ /^\d+$/ || &error($text{'conf_espeed'}); &save_directive($conf, "speed", $in{'speed'}); } if ($in{'listen_def'}) { &save_directive($conf, "listen"); } else { &check_ipaddress($in{'listen'}) || &error($text{'conf_elisten'}); &save_directive($conf, "listen", $in{'listen'}); } if ($in{'mode'} == 0) { &save_directive($conf, "option"); } elsif ($in{'mode'} == 1) { &save_directive($conf, "option", $options_pptp); } else { $in{'option'} =~ /^\/\S+$/ || &error($text{'conf_eoption'}); &save_directive($conf, "option", $in{'option'}); } &save_ip_table("localip"); &save_ip_table("remoteip"); if ($in{'ipxnets_def'}) { &save_directive($conf, "ipxnets"); } else { $in{'from'} =~ /^[A-F0-9]+$/ || &error($text{'conf_efrom'}); $in{'to'} =~ /^[A-F0-9]+$/ || &error($text{'conf_eto'}); &save_directive($conf, "ipxnets", $in{'from'}."-".$in{'to'}); } &flush_file_lines(); &unlock_file($config{'file'}); &webmin_log("conf"); &redirect(""); # save_ip_table(name) sub save_ip_table { local @ips = split(/\s+/, $in{$_[0]}); foreach $i (@ips) { &check_ipaddress($i) || $i =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)-(\d+)$/ || &error(&text('conf_e'.$_[0], $i)); } &save_directive($conf, $_[0], @ips ? join(",", @ips) : undef); } pptp-server/disc.cgi0100775000567100000120000000071707701233270014447 0ustar jcameronwheel#!/usr/local/bin/perl # disc.cgi # Disconnect a VPN connection require './pptp-server-lib.pl'; &ReadParse(); &error_setup($text{'disc_err'}); @conns = &list_connections(); ($conn) = grep { $_->[3] eq $in{'iface'} } @conns; $conn || &error($text{'disc_egone'}); &kill_logged('TERM', $conn->[0]) || &error($text{'disc_ekill'}); &kill_logged('TERM', $conn->[1]); sleep(2); # wait for it to quit &webmin_log("disc", undef, $conn->[2]); &redirect("list_conns.cgi"); pptp-server/list_conns.cgi0100775000567100000120000000176107701233270015700 0ustar jcameronwheel#!/usr/local/bin/perl # list_conns.cgi # List all active connections require './pptp-server-lib.pl'; &header($text{'conns_title'}, "", "conns"); print "
\n"; @conns = &list_connections(); if (@conns) { print "
$text{'conns_desc'}

\n"; print "\n"; print " ", " ", " ", " ", "\n"; foreach $c (@conns) { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
$text{'conns_iface'}$text{'conns_client'}$text{'conns_stime'}$text{'conns_local'}$text{'conns_remote'}
$c->[3]", "$c->[2]",$c->[6] || $text{'conns_unknown'},"$c->[4]$c->[5]
\n"; } else { print "
$text{'conns_none'}

\n"; } print "


\n"; &footer("", $text{'index_return'}); pptp-server/config-mandrake-linux0100664000567100000120000000030507701233270017134 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options start_cmd=/etc/rc.d/init.d/pptpd start stop_cmd=/etc/rc.d/init.d/pptpd stop pptp-server/config-debian-linux0100664000567100000120000000034307701233270016576 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options pptp_ppp_options=/etc/ppp/pptpd-options start_cmd=/etc/init.d/pptpd start stop_cmd=/etc/init.d/pptpd stop pptp-server/config-united-linux0100664000567100000120000000027307701233270016646 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options start_cmd=/etc/init.d/pptpd start stop_cmd=/etc/init.d/pptpd stop pptp-server/config-suse-linux0100664000567100000120000000027307701233270016335 0ustar jcameronwheelpptpd=pptpd file=/etc/pptpd.conf pid_file=/var/run/pptpd.pid pap_file=/etc/ppp/chap-secrets ppp_options=/etc/ppp/options start_cmd=/etc/init.d/pptpd start stop_cmd=/etc/init.d/pptpd stop pptp-server/pptp-server-lib.pl0100664000567100000120000000776707701233270016442 0ustar jcameronwheel# pptp-lib.pl # Common functions for PPTP configuration # XXX help pages do '../web-lib.pl'; &init_config(); do 'secrets-lib.pl'; $options_pptp = $config{'pptp_ppp_options'} || "/etc/ppp/options.pptp"; # get_config() # Returns the PPTP configuration sub get_config { local @rv; local $lnum = 0; open(FILE, $config{'file'}); while() { s/\r|\n//g; if (/^\s*(#?)\s*(\S+)\s*(\S*)\s*$/) { push(@rv, { 'name' => $2, 'value' => $3, 'enabled' => !$1, 'line' => $lnum, 'index' => scalar(@rv) }); } $lnum++; } close(FILE); return \@rv; } # find_conf(name, &config) sub find_conf { local $c; foreach $c (@{$_[1]}) { if (lc($c->{'name'}) eq lc($_[0]) && $c->{'enabled'}) { return $c->{'value'}; } } return undef; } # save_directive(&config, name, [value]) sub save_directive { local $lref = &read_file_lines($config{'file'}); local ($old) = grep { lc($_->{'name'}) eq lc($_[1]) } @{$_[0]}; if ($old) { if (defined($_[2])) { # Can just update old one $lref->[$old->{'line'}] = "$_[1]\t$_[2]"; } elsif ($old->{'enabled'}) { # Comment out old one $lref->[$old->{'line'}] = "#$old->{'name'}\t$old->{'value'}"; } } elsif (defined($_[2])) { # Add to end of file push(@$lref, "$_[1]\t$_[2]"); } } # get_pptpd_pid() # Returns the PID of the running PPTP server process sub get_pptpd_pid { open(PID, $config{'pid_file'}) || return undef; local $pid = ; $pid = int($pid); close(PID); return $pid; } # get_ppp_hostname() # Returns the hostname that this server uses for authentication sub get_ppp_hostname { local $conf = &get_config(); local $option = &find_conf("option", $conf); $option ||= $config{'ppp_options'}; local @opts = &parse_ppp_options($option); local $name = &find("name", \@opts); return $name ? $name->{'value'} : &get_system_hostname(1); } # parse_ppp_options(file) sub parse_ppp_options { local @rv; local $lnum = 0; open(OPTS, $_[0]); while() { s/\r|\n//g; s/#.*$//g; if (/^([0-9\.]+):([0-9\.]+)/) { push(@rv, { 'local' => $1, 'remote' => $2, 'file' => $_[0], 'line' => $lnum, 'index' => scalar(@rv) }); } elsif (/^(\S+)\s*(.*)/) { push(@rv, { 'name' => $1, 'value' => $2, 'file' => $_[0], 'line' => $lnum, 'index' => scalar(@rv) }); } $lnum++; } close(OPTS); return @rv; } # find(name, &config) sub find { local @rv = grep { lc($_->{'name'}) eq lc($_[0]) } @{$_[1]}; return wantarray ? @rv : $rv[0]; } # save_ppp_option(&config, file, &old|name, &new) sub save_ppp_option { local $ol = ref($_[2]) || !defined($_[2]) ? $_[2] : &find($_[2], $_[0]); local $nw = $_[3]; local $lref = &read_file_lines($_[1]); local $line; if ($nw) { if ($nw->{'local'}) { $line = $nw->{'local'}.":".$nw->{'remote'}; } else { $line = $nw->{'name'}; $line .= " $nw->{'value'}" if ($nw->{'value'} ne ""); } } if ($ol && $nw) { $lref->[$ol->{'line'}] = $line; } elsif ($ol) { splice(@$lref, $ol->{'line'}, 1); local $c; foreach $c (@{$_[0]}) { $c->{'line'}-- if ($c->{'line'} > $ol->{'line'}); } } elsif ($nw) { push(@$lref, $line); } } # list_connections() # Returns a list of active PPTP connections by checking the process list. # Each element of the list is an array containing the PPP PID, PPTP PID, # client IP, interface, local IP and remote IP and start time sub list_connections { local @rv; &foreign_require("proc", "proc-lib.pl"); &foreign_require("net", "net-lib.pl"); local @procs = &proc::list_processes(); local @ifaces = &net::active_interfaces(); foreach $p (@procs) { if ($p->{'args'} =~ /pptpd\s*\[([0-9\.]+)/) { # Found a PPTP connection process .. get the child PPP proc local $rip = $1; local ($ppp) = grep { $_->{'ppid'} == $p->{'pid'} } @procs; if ($ppp && $ppp->{'args'} =~ /([0-9\.]+):([0-9\.]+)/) { # Find the matching interface local ($iface) = grep { $_->{'address'} eq $1 } @ifaces; if ($iface) { push(@rv, [ $ppp->{'pid'}, $p->{'pid'}, $rip, $iface->{'fullname'}, $1, $iface->{'ptp'} || $2, $ppp->{'_stime'} ] ); } } } } return @rv; } 1; pptp-server/log_parser.pl0100644000567100000120000000073707701233270015530 0ustar jcameronwheel# log_parser.pl # Functions for parsing this module's logs do 'pptp-server-lib.pl'; # parse_webmin_log(user, script, action, type, object, ¶ms) # Converts logged information from this module into human-readable form sub parse_webmin_log { local ($user, $script, $action, $type, $object, $p) = @_; $object = "".&html_escape($object).""; if ($type eq 'secret') { return &text('log_secret_'.$action, $object); } else { return &text('log_'.$action, $object); } } pptp-server/config.info.ca0100755000567100000120000000070307701233270015536 0ustar jcameronwheelline2=Configuraci del sistema,11 pptpd=Cam complet del programa dimoni PPTP,0 file=Fitxer de configuraci PPTP,0 pid_file=Cam complet del fitxer de PID de PPTP,0 pap_file=Fitxer de comptes PPP,0 ppp_options=Fitxer d'opcions PPP per defecte,0 pptp_ppp_options=Fitxer d'opcions PPP de PPTP,3,Defecte (/etc/ppp/options.pptp) start_cmd=Ordre per iniciar el dimoni PPTP,3,Executa el programa stop_cmd=Ordre per aturar el dimoni PPTP,3,Mata el programa