Initial commit

tags/0.2.0 0.2.0
Daniel Berteaud 13 years ago
commit 52854b630f
  1. 8
      createlinks
  2. 54
      ipasserelle-telephony.spec
  3. 19
      root/etc/e-smith/db/configuration/migrate/LemonLDAPSOAPAccessFreePBX
  4. 4
      root/etc/e-smith/templates.metadata/etc/lemonldap-ng/lemonldap-ng-fpbx.ini
  5. 2
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/UserManagerVirtualHost/51FreePBX
  6. 8
      root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/20LoadModule80mod_perl
  7. 19
      root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/25LemonLDAPHandler
  8. 28
      root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/95FreePBXsso
  9. 9
      root/etc/e-smith/templates/etc/lemonldap-ng/lemonldap-ng-fpbx.ini/05All
  10. 11
      root/var/lib/lemonldap-ng/handler/MyFpbxHandler.pm

@ -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,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…
Cancel
Save