Replace OpenUpload with Download Ticket Service

tags/0.2.7_el5 0.2.7_el5
Daniel Berteaud 11 years ago
parent 92c9d19e42
commit c3430611cc
  1. 6
      ipasserelle-webapps.spec
  2. 0
      root/etc/e-smith/db/configuration/defaults/dl/AliasOnPrimary
  3. 0
      root/etc/e-smith/db/configuration/defaults/dl/Authentication
  4. 4
      root/etc/e-smith/db/configuration/migrate/90Dl
  5. 30
      root/etc/e-smith/events/actions/ipasserelle-webapps-init-domains
  6. 39
      root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/035dl
  7. 32
      root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/035openupload

@ -14,14 +14,16 @@ BuildArch: noarch
BuildRoot: /var/tmp/%{name}-%{version} BuildRoot: /var/tmp/%{name}-%{version}
Requires: ipasserelle-base >= 0.1-14 Requires: ipasserelle-base >= 0.1-14
Requires: smeserver-lemonldap-ng >= 0.2.10 Requires: smeserver-lemonldap-ng >= 0.2.11
Requires: smeserver-openupload Requires: smeserver-dl
Requires: smeserver-tt-rss Requires: smeserver-tt-rss
Requires: smeserver-pydio Requires: smeserver-pydio
Requires: smeserver-ooo-headless Requires: smeserver-ooo-headless
Requires: smeserver-dokuwiki Requires: smeserver-dokuwiki
Requires: dokuwiki-plugins Requires: dokuwiki-plugins
Obsoletes: openupload
BuildRequires: e-smith-devtools BuildRequires: e-smith-devtools
%description %description

@ -0,0 +1,4 @@
{
my $uri = "https://upload.$DomainName/";
$DB->set_prop('dl', 'Uri', $uri);
}

@ -36,10 +36,10 @@ if (!$vhost){
$d->new_record("upload.$domain",{ $d->new_record("upload.$domain",{
type => 'domain', type => 'domain',
Content => 'Primary', Content => 'Primary',
Description => "OpenUpload", Description => "Download Ticket Service",
Nameservers => 'internet', Nameservers => 'internet',
TemplatePath => 'WebAppVirtualHost', TemplatePath => 'WebAppVirtualHost',
DocumentRoot => '/usr/share/openupload/www', DocumentRoot => '/usr/share/dl',
Removable => 'yes', Removable => 'yes',
Authentication => 'LemonLDAP' Authentication => 'LemonLDAP'
}); });
@ -48,6 +48,32 @@ if (!$vhost){
die "Failed to create domain upload.$domain\n"; die "Failed to create domain upload.$domain\n";
} }
} }
elsif (($vhost->prop('DocumentRoot') || '/usr/share/openupload/www') eq '/usr/share/openupload/www'){
$d->set_prop("upload.$domain", 'DocumentRoot', '/usr/share/dl');
$d->set_prop("upload.$domain", 'Description', 'DL');
unless ( system("/sbin/e-smith/signal-event", "domain-modify", "upload.$domain") == 0 ){
die "Failed to update domain upload.$domain\n";
}
}
$vhost = $d->get("uploadapi.$domain");
if (!$vhost){
$d->new_record("uploadapi.$domain",{
type => 'domain',
Content => 'Primary',
Description => "Download Ticket Service API",
Nameservers => 'internet',
TemplatePath => 'WebAppVirtualHost',
DocumentRoot => '/usr/share/dl',
Removable => 'yes',
Authentication => 'LemonLDAPBasic'
});
unless ( system("/sbin/e-smith/signal-event", "domain-create", "uploadapi.$domain") == 0 ){
die "Failed to create domain uploadapi.$domain\n";
}
}
$vhost = $d->get("rss.$domain"); $vhost = $d->get("rss.$domain");

@ -0,0 +1,39 @@
{
# Delete OpenUpload
if ( defined($conf->{'applicationList'}->{'010apps'}->{'openupload'}) ){
delete $conf->{'exportedHeaders'}->{"upload.$domain"};
delete $conf->{'locationRules'}->{"upload.$domain"};
delete $conf->{'applicationList'}->{'010apps'}->{'openupload'};
delete $conf->{'vhostOptions'}->{"upload.$domain"};
}
$conf->{'exportedHeaders'}->{"upload.$domain"} = {
'Auth-User' => '$uid',
'User-Email' => '$mail'
} unless ($conf->{'exportedHeaders'}->{"upload.$domain"});
$conf->{'locationRules'}->{"upload.$domain"} = {
'(?#10Auth)^/(admin|rest)\\.php' => '$groups =~ /\\badmins\\b/',
'default' => 'unprotect'
} unless ($conf->{'locationRules'}->{"upload.$domain"});
$conf->{'applicationList'}->{'010apps'}->{'dl'} = {
'options' => {
'logo' => 'dl.png',
'name' => 'Fichiers temporaires',
'description' => 'Service d\'hébergement de fichiers temporaires',
'uri' => "https://upload.$domain",
'display' => 'auto'
},
'type' => 'application'
} unless ($conf->{'applicationList'}->{'010apps'}->{'dl'});
$conf->{'vhostOptions'}->{"upload.$domain"} = {
'vhostAliases' => "uploadapi.$domain",
} unless ($conf->{'vhostOptions'}->{"upload.$domain"});
$OUT = '';
}

@ -1,32 +0,0 @@
{
$conf->{'exportedHeaders'}->{"upload.$domain"} = {
'Auth-User' => '$uid',
} unless ($conf->{'exportedHeaders'}->{"upload.$domain"});
$conf->{'locationRules'}->{"upload.$domain"} = {
'(?#21login)(a|action)=login' => "logout_app https://upload.$domain/",
'(?#13unprotect_captcha)^/plugins/captcha\\.php' => 'unprotect',
'(?#14unprotect_index)^/index\\.php$' => 'unprotect',
'(?#12unprotect_templates)^/templates/' => 'unprotect',
'(?#20logout)(a|action)=logout' => "logout_app https://auth.$domain",
'(?#10unprotect_dl)(a|action)=[dgr]' => 'unprotect',
'(?#01deny_double_action)(a|action)=.*(a|action)=.*' => 'deny',
'default' => '$groups =~ /\\b(equipe|admins)\\b/'
} unless ($conf->{'locationRules'}->{"upload.$domain"});
$conf->{'applicationList'}->{'010apps'}->{'openupload'} = {
'options' => {
'logo' => 'openupload.png',
'name' => 'Fichiers temporaires',
'description' => 'Service d\'hébergement de fichiers temporaires',
'uri' => "https://upload.$domain",
'display' => 'auto'
},
'type' => 'application'
} unless ($conf->{'applicationList'}->{'010apps'}->{'openupload'});
$OUT = '';
}
Loading…
Cancel
Save