Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nextcloud Notify Push
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eduardo Trujillo
Nextcloud Notify Push
Commits
c5fca94f
Commit
c5fca94f
authored
4 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
improve setup with self signed certificates
parent
1abba612
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/SelfTest.php
+5
-5
5 additions, 5 deletions
lib/SelfTest.php
lib/SetupWizard.php
+1
-1
1 addition, 1 deletion
lib/SetupWizard.php
with
6 additions
and
6 deletions
lib/SelfTest.php
+
5
−
5
View file @
c5fca94f
...
...
@@ -73,7 +73,7 @@ class SelfTest {
$this
->
config
->
setAppValue
(
'notify_push'
,
'cookie'
,
(
string
)
$this
->
cookie
);
try
{
$retrievedCookie
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/cookie'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]])
->
getBody
();
$retrievedCookie
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/cookie'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
])
->
getBody
();
}
catch
(
\Exception
$e
)
{
$msg
=
$e
->
getMessage
();
$output
->
writeln
(
"<error>🗴 can't connect to push server:
$msg
</error>"
);
...
...
@@ -90,7 +90,7 @@ class SelfTest {
// test if the push server can load storage mappings from the db
[
$storageId
,
$count
]
=
$this
->
getStorageIdForTest
();
try
{
$retrievedCount
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/mapping/'
.
$storageId
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]])
->
getBody
();
$retrievedCount
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/mapping/'
.
$storageId
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
])
->
getBody
();
}
catch
(
\Exception
$e
)
{
$msg
=
$e
->
getMessage
();
$output
->
writeln
(
"<error>🗴 can't connect to push server:
$msg
</error>"
);
...
...
@@ -106,7 +106,7 @@ class SelfTest {
// test if the push server can reach nextcloud by having it request the cookie
try
{
$retrievedCookie
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/reverse_cookie'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]])
->
getBody
();
$retrievedCookie
=
(
int
)
$this
->
client
->
get
(
$server
.
'/test/reverse_cookie'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
])
->
getBody
();
}
catch
(
\Exception
$e
)
{
$msg
=
$e
->
getMessage
();
$output
->
writeln
(
"<error>🗴 can't connect to push server:
$msg
</error>"
);
...
...
@@ -122,7 +122,7 @@ class SelfTest {
// test that the push server is a trusted proxy
try
{
$remote
=
$this
->
client
->
get
(
$server
.
'/test/remote/1.2.3.4'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]])
->
getBody
();
$remote
=
$this
->
client
->
get
(
$server
.
'/test/remote/1.2.3.4'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
])
->
getBody
();
}
catch
(
\Exception
$e
)
{
$msg
=
$e
->
getMessage
();
$output
->
writeln
(
"<error>🗴 can't connect to push server:
$msg
</error>"
);
...
...
@@ -140,7 +140,7 @@ class SelfTest {
// test that the binary is up to date
try
{
$this
->
queue
->
getConnection
()
->
del
(
"notify_push_version"
);
$response
=
$this
->
client
->
post
(
$server
.
'/test/version'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]]);
$response
=
$this
->
client
->
post
(
$server
.
'/test/version'
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
]);
if
(
$response
===
"error"
)
{
$output
->
writeln
(
"<error>🗴 failed to get binary version, check the push server output for more information</error>"
);
return
1
;
...
...
This diff is collapsed.
Click to expand it.
lib/SetupWizard.php
+
1
−
1
View file @
c5fca94f
...
...
@@ -157,7 +157,7 @@ class SetupWizard {
public
function
isBinaryRunningBehindProxy
():
bool
{
try
{
$result
=
$this
->
client
->
get
(
$this
->
getProxiedBase
()
.
"/test/cookie"
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]]);
$result
=
$this
->
client
->
get
(
$this
->
getProxiedBase
()
.
"/test/cookie"
,
[
'nextcloud'
=>
[
'allow_local_address'
=>
true
]
,
'verify'
=>
false
]);
return
is_numeric
(
$result
->
getBody
());
}
catch
(
\Exception
$e
)
{
return
false
;
...
...
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