Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
d06ef07a
Unverified
Commit
d06ef07a
authored
5 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
disable timeout on app install via cli
Signed-off-by:
Arthur Schiwon
<
blizzz@arthur-schiwon.de
>
parent
e2e42d4f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/private/Installer.php
+13
-6
13 additions, 6 deletions
lib/private/Installer.php
lib/private/Server.php
+2
-1
2 additions, 1 deletion
lib/private/Server.php
tests/lib/InstallerTest.php
+8
-4
8 additions, 4 deletions
tests/lib/InstallerTest.php
with
23 additions
and
11 deletions
lib/private/Installer.php
+
13
−
6
View file @
d06ef07a
...
...
@@ -70,6 +70,8 @@ class Installer {
private
$apps
=
null
;
/** @var bool|null - for caching the result of the ready status */
private
$isInstanceReadyForUpdates
=
null
;
/** @var bool */
private
$isCLI
;
/**
* @param AppFetcher $appFetcher
...
...
@@ -78,16 +80,20 @@ class Installer {
* @param ILogger $logger
* @param IConfig $config
*/
public
function
__construct
(
AppFetcher
$appFetcher
,
IClientService
$clientService
,
ITempManager
$tempManager
,
ILogger
$logger
,
IConfig
$config
)
{
public
function
__construct
(
AppFetcher
$appFetcher
,
IClientService
$clientService
,
ITempManager
$tempManager
,
ILogger
$logger
,
IConfig
$config
,
bool
$isCLI
)
{
$this
->
appFetcher
=
$appFetcher
;
$this
->
clientService
=
$clientService
;
$this
->
tempManager
=
$tempManager
;
$this
->
logger
=
$logger
;
$this
->
config
=
$config
;
$this
->
isCLI
=
$isCLI
;
}
/**
...
...
@@ -270,8 +276,9 @@ class Installer {
// Download the release
$tempFile
=
$this
->
tempManager
->
getTemporaryFile
(
'.tar.gz'
);
$timeout
=
$this
->
isCLI
?
0
:
120
;
$client
=
$this
->
clientService
->
newClient
();
$client
->
get
(
$app
[
'releases'
][
0
][
'download'
],
[
'save_to'
=>
$tempFile
,
'timeout'
=>
120
]);
$client
->
get
(
$app
[
'releases'
][
0
][
'download'
],
[
'save_to'
=>
$tempFile
,
'timeout'
=>
$timeout
]);
// Check if the signature actually matches the downloaded content
$certificate
=
openssl_get_publickey
(
$app
[
'certificate'
]);
...
...
This diff is collapsed.
Click to expand it.
lib/private/Server.php
+
2
−
1
View file @
d06ef07a
...
...
@@ -1272,7 +1272,8 @@ class Server extends ServerContainer implements IServerContainer {
$c
->
getHTTPClientService
(),
$c
->
getTempManager
(),
$c
->
getLogger
(),
$c
->
getConfig
()
$c
->
getConfig
(),
\OC
::
$CLI
);
});
...
...
This diff is collapsed.
Click to expand it.
tests/lib/InstallerTest.php
+
8
−
4
View file @
d06ef07a
...
...
@@ -57,7 +57,8 @@ class InstallerTest extends TestCase {
\OC
::
$server
->
getHTTPClientService
(),
\OC
::
$server
->
getTempManager
(),
\OC
::
$server
->
getLogger
(),
$config
$config
,
false
);
$installer
->
removeApp
(
self
::
$appid
);
}
...
...
@@ -68,7 +69,8 @@ class InstallerTest extends TestCase {
$this
->
clientService
,
$this
->
tempManager
,
$this
->
logger
,
$this
->
config
$this
->
config
,
false
);
}
...
...
@@ -78,7 +80,8 @@ class InstallerTest extends TestCase {
\OC
::
$server
->
getHTTPClientService
(),
\OC
::
$server
->
getTempManager
(),
\OC
::
$server
->
getLogger
(),
\OC
::
$server
->
getConfig
()
\OC
::
$server
->
getConfig
(),
false
);
$installer
->
removeApp
(
self
::
$appid
);
\OC
::
$server
->
getConfig
()
->
setSystemValue
(
'appstoreenabled'
,
$this
->
appstore
);
...
...
@@ -101,7 +104,8 @@ class InstallerTest extends TestCase {
\OC
::
$server
->
getHTTPClientService
(),
\OC
::
$server
->
getTempManager
(),
\OC
::
$server
->
getLogger
(),
\OC
::
$server
->
getConfig
()
\OC
::
$server
->
getConfig
(),
false
);
$this
->
assertNull
(
\OC
::
$server
->
getConfig
()
->
getAppValue
(
'testapp'
,
'enabled'
,
null
),
'Check that the app is not listed before installation'
);
$this
->
assertSame
(
'testapp'
,
$installer
->
installApp
(
self
::
$appid
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment