Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused #60

Open
gibro opened this issue Dec 19, 2022 · 17 comments
Open

Connection refused #60

gibro opened this issue Dec 19, 2022 · 17 comments

Comments

@gibro
Copy link

gibro commented Dec 19, 2022

Hi Andreas,

my Moodle is at https://igmetall-moodle.de my Etherpad is at https://pad.igmetall-moodle.de. The pads are created, so I assume a connection is made and it's not the API.

However, I can't access the pads in Moodle, only directly via the link. I don't know where the error is. I have set up .igmetall-moodle.com as the cookie domain. The server URL is https://pad.igmetall-moodle.de/.

What am I doing wrong?

Beste Guido

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

Hi Guido,

there might be a problem with the cookie domain you have set in the plugin settings.
As your Moodle page is not a subdomain you should try to remove the leading dot ".".
I hope that helps.

Best regards
Andreas

@gibro
Copy link
Author

gibro commented Dec 19, 2022

Now i get the Message: Could not get api version

@gibro
Copy link
Author

gibro commented Dec 19, 2022

Sorry, it's still connection refused. Here my settings in Moodle:
Server URL: https://pad.igmetall-moodle.de/
Sicherheit ignorieren: not checked
API key: copied from APIkey.txt
API-Version: 1.2
Name for all etherpads: igm
Cookie Domain: igmetall-moodle.de
Session validity: 10800
HTTPS forwarding: not checked
Verify HTTPS certificate: not checked
Allow write access for guests?: not checked
Responsive iFrame: not checked
Minimum width: 400
Copy pad link: checked
Delete group pads in: 1 hour

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

Hi Guido,

are you sure you only changed the cookie domain and not the Etherpad url? The error "Could not get api version" has nothing to do with your cookie setting. Please check this url again and also your API key.

Andreas

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

Connection refused means, your Moodle server can't connect the Etherpad server.
This seems to be a network issue.
Andreas

@gibro
Copy link
Author

gibro commented Dec 19, 2022

The API Key is checked and it is exactly the same like in APIkey.txt without any blanks.
The Etherpad URL is the one, that i write above:
Server URL: https://pad.igmetall-moodle.de/

And the error message is not longer Could not get api version

Hi Guido,

are you sure you only changed the cookie domain and not the Etherpad url? The error "Could not get api version" has nothing to do with your cookie setting. Please check this url again and also your API key.

Andreas

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

What ip address does your Moodle server try to connect?

@gibro
Copy link
Author

gibro commented Dec 19, 2022

Where can i find this information?

What ip address does your Moodle server try to connect?

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

I don't know how your Moodle server is set up. Maybe you start a shell on your Moodle server and try to connect the Etherpad server by using curl and the Etherpad url. That should tell you the ip and also whether or not your Moodle server can connect the Etherpad server.

@gibro
Copy link
Author

gibro commented Dec 19, 2022

$ curl etherpad.uber-space
curl: (6) Could not resolve host: etherpad.uber-space
igmoodle@dedivirt1796:
$ curl -v pad.igmetall-moodle.de

  • Trying 185.26.156.49:80...
  • Connected to pad.igmetall-moodle.de (185.26.156.49) port 80 (#0)

GET / HTTP/1.1
Host: pad.igmetall-moodle.de
User-Agent: curl/7.74.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 301 Moved Permanently
    < Server: nginx
    < Date: Mon, 19 Dec 2022 10:44:28 GMT
    < Content-Type: text/html
    < Content-Length: 162
    < Connection: keep-alive
    < Location: https://pad.igmetall-moodle.de/
    <
<title>301 Moved Permanently</title>

301 Moved Permanently


nginx * Connection #0 to host pad.igmetall-moodle.de left intact

What does it means?

@gibro
Copy link
Author

gibro commented Dec 19, 2022

My Firefox reports

For your protection, pad.igmetall-moodle.de does not allow Firefox to display this page if it is embedded in another page. To view the page, it must be opened in a new tab.

@gibro
Copy link
Author

gibro commented Dec 19, 2022

I suspect it's the URL. I installed the Etherpad on a different server, like my Moodle installation. Pads installed by the plugin can be accessed at https://pad.igmetall-moodle.de/p/g.C8ldjICim6Y40BxE$igm but not at https://etherpad.uber.space/p/g.C8ldjICim6Y40BxE%24igm

How can I set the domain so that the pads can also be accessed via etherpad.uber.space?

@grabs
Copy link
Collaborator

grabs commented Dec 19, 2022

It is not easy to understand your problem without knowing your setup.
If you can open the url "https://pad.igmetall-moodle.de" in your browser then Moodle must be able too. Otherwise your setup is wrong.
You have to understand, that your Etherpad server is connected from both, your browser and Moodle as well, using the same url.

@gibro
Copy link
Author

gibro commented Dec 19, 2022

I tried a lot of things today. From my moodleserver I was able to ping the IP 185.26.156.49 today. wget and curl were also successful. And still the etherpad is not displayed inside the pugin. The etherpad itself is on a different server, is that a problem? My firefox sees a security problem with the embedded page:

"For your protection, pad.igmetall-moodle.de does not allow Firefox to display this page if it is embedded in another page. To view the page, it must be opened in a new tab."

If I then open the iframe in a new page there are no problems.

Many greetings
Guido

@gibro
Copy link
Author

gibro commented Dec 19, 2022

Can i setup up anything in settings.json of Etherpad to allow embedding? What information do you need to be able to help?

@gibro
Copy link
Author

gibro commented Dec 20, 2022

I've added Content-Security-Policy and now i can display the embedded Etherpads on other Webseite without Problems, but on Moodle i get es error Message like:

An error occurred
If the problem persists, please send this error message to your webmaster:
SecurityError: Blocked a frame with origin "https://pad.igmetall-moodle.de" from accessing a cross-origin frame.
at unknown at line -1
ErrorId: SqimbnTgr6DhygBKBm1a
Unhandled Promise rejection
URL: https://pad.igmetall-moodle.de/p/g.FTUGYqUMjVTWb0JF$igm
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Do you know what it means?

Best
Guido

@gibro
Copy link
Author

gibro commented Dec 21, 2022

Hi Andreas,

the problem has been solved. In order to be able to embed etherpads, my hoster had to set the X-Frame Options to allowed. After that, the Etherpad could be embedded everywhere, even via the Moodle plugin.

Many greetings
Guido

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants