Replace OpenUpload with Download Ticket Service
This commit is contained in:
parent
92c9d19e42
commit
c3430611cc
|
@ -14,14 +14,16 @@ BuildArch: noarch
|
|||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
|
||||
Requires: ipasserelle-base >= 0.1-14
|
||||
Requires: smeserver-lemonldap-ng >= 0.2.10
|
||||
Requires: smeserver-openupload
|
||||
Requires: smeserver-lemonldap-ng >= 0.2.11
|
||||
Requires: smeserver-dl
|
||||
Requires: smeserver-tt-rss
|
||||
Requires: smeserver-pydio
|
||||
Requires: smeserver-ooo-headless
|
||||
Requires: smeserver-dokuwiki
|
||||
Requires: dokuwiki-plugins
|
||||
|
||||
Obsoletes: openupload
|
||||
|
||||
BuildRequires: e-smith-devtools
|
||||
|
||||
%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",{
|
||||
type => 'domain',
|
||||
Content => 'Primary',
|
||||
Description => "OpenUpload",
|
||||
Description => "Download Ticket Service",
|
||||
Nameservers => 'internet',
|
||||
TemplatePath => 'WebAppVirtualHost',
|
||||
DocumentRoot => '/usr/share/openupload/www',
|
||||
DocumentRoot => '/usr/share/dl',
|
||||
Removable => 'yes',
|
||||
Authentication => 'LemonLDAP'
|
||||
});
|
||||
|
@ -48,6 +48,32 @@ if (!$vhost){
|
|||
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");
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue