Changeset 11237
- Timestamp:
- 08/19/08 14:54:47 (5 months ago)
- Location:
- branches/remote-services/ebox
- Files:
-
- 10 modified
-
debian/dirs (modified) (1 diff)
-
src/EBox/RemoteServices.pm (modified) (6 diffs)
-
src/EBox/RemoteServices/Auth.pm (modified) (1 diff)
-
src/EBox/RemoteServices/Makefile.am (modified) (1 diff)
-
src/EBox/RemoteServices/Model/Subscription.pm (modified) (1 diff)
-
src/EBox/RemoteServices/Server/JobReceiver.pm (modified) (1 diff)
-
src/EBox/RemoteServices/Server/t/jobReceiver.t (modified) (1 diff)
-
src/EBox/RemoteServices/Subscription.pm (modified) (1 diff)
-
src/EBox/RemoteServices/WSDispatcher.pm (modified) (1 diff)
-
src/libexec/ebox-runnerd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/remote-services/ebox/debian/dirs
r10308 r11237 1 1 var/lib/ebox/ 2 2 var/lib/ebox/conf 3 var/lib/ebox/conf/remoteservices 3 4 var/lib/ebox/tmp 4 5 var/lib/ebox/log -
branches/remote-services/ebox/src/EBox/RemoteServices.pm
r10813 r11237 28 28 use warnings; 29 29 30 use Error qw(:try); 31 30 32 # eBox uses 33 use EBox::Config; 34 use EBox::Exceptions::Internal; 31 35 use EBox::Gettext; 36 use EBox::Global; 37 use EBox::Sudo; 38 39 # Constants 40 use constant SERV_DIR => EBox::Config::conf() . 'remoteservices/'; 41 use constant CA_DIR => SERV_DIR . 'ssl-ca/'; 42 use constant SUBS_DIR => SERV_DIR . 'subscription/'; 43 use constant WS_DISPATCHER => __PACKAGE__ . '::WSDispatcher'; 32 44 33 45 # Group: Protected methods … … 75 87 # Method: _regenConfig 76 88 # 77 # Regenerate the configuration for the events89 # Regenerate the configuration for the remote services module 78 90 # 79 91 # Overrides: … … 81 93 # <EBox::Module::_regenConfig> 82 94 # 83 # Exceptions:84 #85 # <EBox::Exceptions::External> - if no event watcher and event86 # dispatcher are enabled87 #88 95 sub _regenConfig 89 96 { … … 91 98 my ($self) = @_; 92 99 100 $self->_confSOAPService(); 101 93 102 return; 94 103 } … … 103 112 sub _stopService 104 113 { 105 106 114 107 115 } … … 204 212 } 205 213 214 # Group: Private methods 215 216 # Configure the SOAP server 217 # 218 # if subscribed 219 # 1. Write soap-loc.mas template 220 # 2. Write the SSLCACertificatePath directory 221 # 3. Add include in ebox-apache configuration 222 # else 223 # 1. Remove SSLCACertificatePath directory 224 # 2. Remove include in ebox-apache configuration 225 # 226 sub _confSOAPService 227 { 228 my ($self) = @_; 229 230 my $confFile = SERV_DIR . 'soap-loc.conf'; 231 my $apacheMod = EBox::Global->modInstance('apache'); 232 if ($self->eBoxSubscribed()) { 233 my @tmplParams = ( 234 (soapHandler => WS_DISPATCHER), 235 (domainName => $self->_confKeys()->{domain}), 236 (allowedPrefix => $self->_allowedPrefix()), 237 (caPath => CA_DIR)); 238 $self->writeConfFile( $confFile, 'remoteservices/soap-loc.mas', 239 \@tmplParams); 240 unless ( -d CA_DIR ) { 241 mkdir(CA_DIR); 242 } 243 my $caLinkPath = $self->_caLinkPath(); 244 unless ( -l $caLinkPath ) { 245 symlink($self->_caCertPath(), $caLinkPath ); 246 } 247 $apacheMod->addInclude($confFile); 248 } else { 249 unlink($confFile); 250 # Remove CA_DIR 251 opendir(my $dir, CA_DIR); 252 while(my $file = readdir($dir)) { 253 # Check if it is a symbolic link file to remove it 254 next unless (-l CA_DIR . $file); 255 unlink(CA_DIR . $file); 256 } 257 closedir($dir); 258 try { 259 $apacheMod->removeInclude($confFile); 260 } catch EBox::Exceptions::Internal with { 261 # Do nothing if it's already remove 262 ; 263 }; 264 } 265 $apacheMod->save(); 266 267 } 268 269 # Return the allowed prefix to send jobs 270 sub _allowedPrefix 271 { 272 my ($self) = @_; 273 274 my $mmProxy = $self->_confKeys()->{managementProxy}; 275 # Return only the prefix 276 my ($prefix) = $mmProxy =~ m:^(.*?)[0-9]*\.:; 277 return $prefix; 278 } 279 280 # Return the given configuration file from the control center 281 sub _confKeys 282 { 283 my ($self) = @_; 284 285 unless ( defined($self->{confFile}) ) { 286 my $confDir = SUBS_DIR . $self->eBoxCommonName(); 287 $self->{confFile} = (<$confDir/*.conf>)[0]; 288 } 289 unless ( defined($self->{confKeys}) ) { 290 $self->{confKeys} = EBox::Config::configKeysFromFile($self->{confFile}); 291 } 292 return $self->{confKeys}; 293 } 294 295 # Return the CA cert path 296 sub _caCertPath 297 { 298 my ($self) = @_; 299 300 return SUBS_DIR . $self->eBoxCommonName() . '/cacert.pem'; 301 302 } 303 304 # Return the link name for the CA certificate in the given format 305 # hashValue.0 - hash value is the output from openssl ciphering 306 sub _caLinkPath 307 { 308 my ($self) = @_; 309 310 my $caCertPath = $self->_caCertPath(); 311 my $hashRet = EBox::Sudo::command("openssl x509 -hash -noout -in $caCertPath"); 312 313 my $hashValue = $hashRet->[0]; 314 chomp($hashValue); 315 return CA_DIR . "${hashValue}.0"; 316 317 } 318 206 319 1; -
branches/remote-services/ebox/src/EBox/RemoteServices/Auth.pm
r11098 r11237 36 36 37 37 # Constants 38 use constant SERV_SUBDIR => 'remote -services';38 use constant SERV_SUBDIR => 'remoteservices/subscription'; 39 39 40 40 # Group: Public methods -
branches/remote-services/ebox/src/EBox/RemoteServices/Makefile.am
r11199 r11237 4 4 5 5 mods = Alerts.pm Auth.pm Base.pm Backup.pm ProxyBackup.pm SOAPClient.pm \ 6 Subscription.pm 6 Subscription.pm WSDispatcher.pm 7 7 8 8 nobase_perl_DATA = $(mods) -
branches/remote-services/ebox/src/EBox/RemoteServices/Model/Subscription.pm
r11141 r11237 152 152 $self->SUPER::setTypedRow($id, $paramsRef, %optParams); 153 153 154 # Mark RemoteServices module as changed 155 $self->{gconfmodule}->setAsChanged(); 156 154 157 $self->{gconfmodule}->st_set_bool('subscribed', not $subs); 155 158 -
branches/remote-services/ebox/src/EBox/RemoteServices/Server/JobReceiver.pm
r11232 r11237 36 36 use File::Slurp; 37 37 38 use constant JOBS_DIR => EBox::Config::conf() . 'remote -services/jobs/';38 use constant JOBS_DIR => EBox::Config::conf() . 'remoteservices/jobs/'; 39 39 use constant INCOMING_DIR => JOBS_DIR . 'incoming/'; 40 40 -
branches/remote-services/ebox/src/EBox/RemoteServices/Server/t/jobReceiver.t
r11233 r11237 47 47 script => qq{#!/bin/bash\necho "\$@"}, 48 48 arguments => $args); 49 my $jobDirPath = EBox::Config::conf() . "remote -services/jobs/$jobId/";49 my $jobDirPath = EBox::Config::conf() . "remoteservices/jobs/$jobId/"; 50 50 my $cmd = new Test::Cmd( 51 51 prog => "${jobDirPath}script", -
branches/remote-services/ebox/src/EBox/RemoteServices/Subscription.pm
r10813 r11237 40 40 # Constants 41 41 use constant { 42 SERV_SUBDIR => 'remote -services',42 SERV_SUBDIR => 'remoteservices/subscription', 43 43 SERV_CONF_FILE => '78remoteservices.conf', 44 44 }; -
branches/remote-services/ebox/src/EBox/RemoteServices/WSDispatcher.pm
r11199 r11237 30 30 31 31 my $server = SOAP::Transport::HTTP::Apache 32 -> dispatch_to('EBox::RemoteServices::Server::JobReceiver::runJob'); 32 ->dispatch_with( 33 { 'urn:EBox/Services/Jobs' => 'EBox::RemoteServices::Server::JobReceiver' } 34 ); 33 35 34 36 # Method: handler -
branches/remote-services/ebox/src/libexec/ebox-runnerd
r11233 r11237 7 7 use POSIX qw(SIG_IGN SIGHUP); 8 8 9 use constant JOBS_DIR => EBox::Config::conf() . 'remote -services/jobs/';9 use constant JOBS_DIR => EBox::Config::conf() . 'remoteservices/jobs/'; 10 10 use constant INCOMING_DIR => JOBS_DIR . 'incoming/'; 11 11 use constant OUTCOMING_DIR => JOBS_DIR . 'outcoming/';
