commit
52854b630f
10 changed files with 162 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||||
|
#!/usr/bin/perl -w |
||||||
|
|
||||||
|
use esmith::Build::CreateLinks qw(:all); |
||||||
|
|
||||||
|
foreach my $event (qw/bootstrap-console-save webapps-update ipasserelle-update/){ |
||||||
|
templates2events("/etc/lemonldap-ng/lemonldap-ng-fpbx.ini", "$event"); |
||||||
|
} |
||||||
|
|
@ -0,0 +1,54 @@ |
|||||||
|
%define version 0.2.0 |
||||||
|
%define release 1 |
||||||
|
%define name ipasserelle-telephony |
||||||
|
|
||||||
|
|
||||||
|
Summary: Meta-Package to add Toip services to your iPasserelle |
||||||
|
Name: %{name} |
||||||
|
Version: %{version} |
||||||
|
Release: %{release}%{?dist} |
||||||
|
License: GPL |
||||||
|
Group: Networking/Daemons |
||||||
|
Source: %{name}-%{version}.tar.gz |
||||||
|
|
||||||
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
||||||
|
BuildArchitectures: noarch |
||||||
|
BuildRequires: e-smith-devtools |
||||||
|
|
||||||
|
Obsoletes: smeserver-ejabberd |
||||||
|
Provides: smeserver-ejabberd |
||||||
|
|
||||||
|
Requires: ipasserelle-base |
||||||
|
Requires: smeserver-freepbx >= 0.1-32 |
||||||
|
Requires: ipasserelle-userpanel |
||||||
|
|
||||||
|
%description |
||||||
|
Meta package to configure Toip services |
||||||
|
on your iPasserelle. |
||||||
|
|
||||||
|
* Thu Oct 20 2011 Daniel Berteaud <daniel@firewall-services.com> 0.2.0 |
||||||
|
- initial release |
||||||
|
|
||||||
|
|
||||||
|
%prep |
||||||
|
%setup -q -n %{name}-%{version} |
||||||
|
|
||||||
|
%build |
||||||
|
perl createlinks |
||||||
|
|
||||||
|
%install |
||||||
|
/bin/rm -rf $RPM_BUILD_ROOT |
||||||
|
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) |
||||||
|
/bin/rm -f %{name}-%{version}-filelist |
||||||
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
||||||
|
> %{name}-%{version}-filelist |
||||||
|
|
||||||
|
%files -f %{name}-%{version}-filelist |
||||||
|
%defattr(-,root,root) |
||||||
|
|
||||||
|
%clean |
||||||
|
rm -rf $RPM_BUILD_ROOT |
||||||
|
|
||||||
|
%post |
||||||
|
%preun |
||||||
|
|
@ -0,0 +1,19 @@ |
|||||||
|
{ |
||||||
|
|
||||||
|
my $llng = $DB->get("lemonldap") || |
||||||
|
$DB->new_record("lemonldap", { type => "service" }); |
||||||
|
|
||||||
|
my @soapaccess = split(/[;,]/, ($llng->prop('SoapAllowFrom') || '')); |
||||||
|
my $internal = $DB->get('InternalInterface')->prop('IPAddress'); |
||||||
|
push @soapaccess, $internal if (!grep {$internal eq $_} @soapaccess); |
||||||
|
$llng->set_prop('SoapAllowFrom', join(',',@soapaccess)); |
||||||
|
|
||||||
|
# httpd-fpbx handler |
||||||
|
my @reload = split(/[;,]/, ($llng->prop('Reload') || '')); |
||||||
|
my $reloadurl = 'localhost:960=http://localhost:960/lm-reload'; |
||||||
|
push @reload, $reloadurl if (!grep {$reloadurl eq $_} @reload); |
||||||
|
|
||||||
|
$llng->set_prop('Reload', join(',',@reload)); |
||||||
|
|
||||||
|
} |
||||||
|
|
@ -0,0 +1,4 @@ |
|||||||
|
PERMS=0640 |
||||||
|
UID="root" |
||||||
|
GID="asterisk" |
||||||
|
|
@ -0,0 +1,2 @@ |
|||||||
|
RewriteRule ^/freepbx(sso)?(/.*)$ http://localhost:960/freepbxsso$2 [P,L] |
||||||
|
|
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
my $status = $modPerl{status}; |
||||||
|
|
||||||
|
return "# modPerl disabled" unless ($status and $status eq "enabled"); |
||||||
|
|
||||||
|
return "LoadModule perl_module modules/mod_perl.so"; |
||||||
|
} |
||||||
|
|
@ -0,0 +1,19 @@ |
|||||||
|
# Load LemonLDAP::NG Handler |
||||||
|
PerlOptions +GlobalRequest |
||||||
|
PerlRequire /var/lib/lemonldap-ng/handler/MyFpbxHandler.pm |
||||||
|
|
||||||
|
# Common error page and security parameters |
||||||
|
ErrorDocument 403 http://auth.{$DomainName}/?lmError=403 |
||||||
|
ErrorDocument 500 http://auth.{$DomainName}/?lmError=500 |
||||||
|
|
||||||
|
|
||||||
|
# Configuration reload mechanism (only 1 per physical server is |
||||||
|
# needed): choose your URL to avoid restarting Apache when |
||||||
|
# configuration change |
||||||
|
<Location /lm-reload> |
||||||
|
Order deny,allow |
||||||
|
Deny from all |
||||||
|
Allow from localhost |
||||||
|
PerlHeaderParserHandler My::Package->refresh |
||||||
|
</Location> |
||||||
|
|
@ -0,0 +1,28 @@ |
|||||||
|
Alias /freepbxsso /opt/freepbx |
||||||
|
|
||||||
|
<Location /freepbxsso/admin> |
||||||
|
PerlHeaderParserHandler My::Package |
||||||
|
{ |
||||||
|
my @users = split(/\s/, getUsersList("freepbx")); |
||||||
|
foreach my $u (@users){ |
||||||
|
$OUT .= " SetEnvIf Auth-User \"$u\" allow_freepbx\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
order deny,allow |
||||||
|
deny from all |
||||||
|
allow from env=allow_freepbx |
||||||
|
</Location> |
||||||
|
|
||||||
|
<Location /freepbxsso/panel> |
||||||
|
PerlHeaderParserHandler My::Package |
||||||
|
{ |
||||||
|
my @users = split(/\s/, getUsersList("fop")); |
||||||
|
foreach my $u (@users){ |
||||||
|
$OUT .= " SetEnvIf Auth-User \"$u\" allow_fop\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
order deny,allow |
||||||
|
deny from all |
||||||
|
allow from env=allow_fop |
||||||
|
</Location> |
||||||
|
|
@ -0,0 +1,9 @@ |
|||||||
|
[all] |
||||||
|
|
||||||
|
[configuration] |
||||||
|
type = SOAP |
||||||
|
proxy = https://lemonsoap:{$lemonldap{'SoapPassword'};}@soapsso.{$DomainName}/index.pl/config |
||||||
|
proxyOptions = \{ timeout => 5 \} |
||||||
|
localStorage=Cache::FileCache |
||||||
|
localStorageOptions=\{ 'namespace' => 'LemonLDAPngFpbx', 'default_expires_in' => 600, 'directory_umask' => '007', 'cache_root' => '/tmp', 'cache_depth' => 5, \} |
||||||
|
|
@ -0,0 +1,11 @@ |
|||||||
|
package My::Package; |
||||||
|
use Lemonldap::NG::Handler::SharedConf; |
||||||
|
@ISA = qw(Lemonldap::NG::Handler::SharedConf); |
||||||
|
|
||||||
|
__PACKAGE__->init( |
||||||
|
{ |
||||||
|
configStorage => { confFile => '/etc/lemonldap-ng/lemonldap-ng-fpbx.ini' }, |
||||||
|
} |
||||||
|
); |
||||||
|
1; |
||||||
|
|
Loading…
Reference in new issue