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

Missing docker-compose-joplin-only.yml file #3

Closed
tpbraini opened this issue Apr 30, 2022 · 12 comments
Closed

Missing docker-compose-joplin-only.yml file #3

tpbraini opened this issue Apr 30, 2022 · 12 comments

Comments

@tpbraini
Copy link

Any hints for Joplin only configuration.

Leaving away...

-joplin nginx viewweb
-certbot

...doesn*t work for me,

joplin-vieweb-django-joplin-vieweb-1 | Configuring endpoint tcp:port=8001:interface=127.0.0.1
joplin-vieweb-django-joplin-vieweb-1 | Listening on TCP address 127.0.0.1:8001
^CGracefully stopping... (press Ctrl+C again to force)

@kestr31
Copy link

kestr31 commented Apr 30, 2022

  • That's similar with my initial purpose
    • Since I use external proxy manager, I had to configure like that
  • As suggested in the document, disabling nginx & certbot container helped
  • Moreover, if you use external proxy manager to be connected to localhost, localhost must be added to ORIGINS

  • Following is a working sample of docker-compose I'm currently using. I hope this can help:
version: '3.4'

x-common-variables: &common-variables
   ORIGINS: "'domain.com', 'ext_ip', 'localhost'"

services:
  django-joplin-vieweb:
    image: gri38/django-joplin-vieweb:latest
    depends_on:
      - joplin-terminal-xapi
    environment:
       <<: *common-variables
    restart: unless-stopped
    volumes:
      - joplin:/root/.config/joplin:ro
      - joplin-vieweb:/root/.config/joplin-vieweb
      - certbot_www:/var/www/certbot/:ro
    networks:
      - YOUR-NETWORK
    ports:
      - <PORT_TO_PROXY_MNGR>:8000

  joplin-terminal-xapi:
    image: gri38/joplin-terminal-xapi:latest
    restart: unless-stopped
    volumes:
      - joplin:/root/.config/joplin
    networks:
      - YOUR-NETWORK

#  joplin-vieweb-certbot:
#    image: gri38/joplin-vieweb-certbot:latest
#    restart: unless-stopped
#    environment:
#       <<: *common-variables
#    depends_on:
#      - joplin-vieweb-nginx
#    volumes:
#      - certbot_www:/var/www/certbot/:rw
#      - certbot_conf:/etc/letsencrypt/:rw

#  joplin-vieweb-nginx:
#    image: gri38/joplin-vieweb-nginx:latest
#    restart: unless-stopped
#    ports:
#      - 80:80
#      - 443:443
#    environment:
#       <<: *common-variables
#    volumes:
#      - certbot_www:/var/www/certbot/:ro
#      - certbot_conf:/etc/letsencrypt/:ro
#    networks:
#      - YOUR-NETWORK

volumes:
  joplin:
  joplin-vieweb:
  certbot_www:
  certbot_conf:

networks:
  YOUR-NETWORK:
    external: true

@tpbraini
Copy link
Author

Thanks for you reply.
My YML look quite similar.

I just want to use it in my local network.
Running it in a Proxmox container.

It always stucks on "Listening to TCP adress...."

@kestr31
Copy link

kestr31 commented May 1, 2022

I think that it's not a problem of joplin vieweb.

I just tested another configuration by adding server's local ip in ORIGIN so that it can be added in ALLOWED_HOSTS

For example, if I wan't to connect to http://192.168.178.162:port/joplin, I set ORIGIN like:

x-common-variables: &common-variables
   ORIGINS: "''192.168.178.162`'"

After then, I could access Joplin-vieweb in local network.

If HTTP request was not handed to django-joplin-vieweb container, You might attempted to connect to wrong adress. For example, by http://ip:port, not by http://ip:port/admin or http://ip:port/joplin. I also made this mistake at the first time.

@gri38
Copy link
Contributor

gri38 commented May 1, 2022

Hello.

I'm glad you use the project.
I added the docker-compose file without certbot stuff.

@kestr31 you were right.
2 differences:

  1. I write the ORIGINS like that:
x-common-variables: &common-variables
   ORIGINS: "'localhost', '192.168.21.1'"
  1. I didn't add
networks:
  YOUR-NETWORK:
    external: true

Do you think it's required ? It worked without for me...

But it won't work directly because the django CSRF_TRUSTED_ORIGINS are built from origins like that:
"https://" + origin

So trusted origins will be, in my example:
https://localhost
https://192.168.21.1
And it should be, I think:
http://localhost
http://192.168.21.1
Another way it may fail: if you access with a port, let say 8080, the origin would be
http://192.168.21.1:8080, which is not in trusted origin (:8080 is not !)

@tpbraini couls you please explin your conf.
For testing purpose I can publish an image dedicated to you config.

I think the solution should be to set the origins like that:
For internal access:

x-common-variables: &common-variables
   ORIGINS: "'http://localhost:1234', 'http://192.168.21.1:1234'"

For external access:

x-common-variables: &common-variables
   ORIGINS: "'https://domain:1234', 'https://11.22.33.44:1234'"

But usually for extrenal access it will be the standard https port, not written in url, so we should configure like that:

x-common-variables: &common-variables
   ORIGINS: "'https://domain', 'https://11.22.33.44'"

Let me know about yuor conf, I'll implement the parse of scheme://address[:port]

@gri38
Copy link
Contributor

gri38 commented May 1, 2022

Hi @kestr31 & @tpbraini

I tried some changes: could you try please to use:

  • the docker compose file here
  • and you change it:
    • set your port in <PORT-TO-YOUR-PROXY>
    • adapt the ORIGINS (the change is I added http:// to the origins). If you use a specific port, for instance if you access with http://192.168.21.1:8000/joplin, you should set the port in the ORIGINS.
    • Change the image tag for django-joplin-vieweb:
services:
  django-joplin-vieweb:
    image: gri38/django-joplin-vieweb:2.0.2-4

It works for me, but I still have issues with settings (get conf fails: I'll have a look to that but for the moment let me know if it's better for you).

If it works for you, I'll test in my prod environnement (with the certbot containers) and I'll fix the remaining issue with settings, and I'll release the 2.0.2.

Thanks for your beta testing !

@matbgn
Copy link

matbgn commented May 2, 2022

Works like a charm many thanks !

@matbgn
Copy link

matbgn commented May 2, 2022

Just a side note on the over hand, could you add the e2ee config in your custom settings part?

Synchronisation target: Nextcloud (5)
Starting synchronisation...
Deleted remote items: 1.
Created local items: 8. Deleted remote items: 2. Fetched items: 8/50.
(...)
Created local items: 260. Deleted remote items: 2. Fetched items: 261/261. Completed: 02/05/2022 11:35 (102s)
Downloading resources...
/!\ Your password is needed to decrypt some of your data. Type `:e2ee decrypt` to set it.

Again, kudos for your amazing job till there! 😍

@gri38
Copy link
Contributor

gri38 commented May 2, 2022

Hi @matbgn
Glad it worked for you.
What did you test: docker-compose.yml or docker-compose-joplin-only.yaml ?
And if you used docker-compose-joplin-only.yaml: with django-joplin-vieweb image :latest or 2.0.2-4 ?

About e2ee, I opens a new issue: #6

@matbgn
Copy link

matbgn commented May 2, 2022

docker-compose-joplin-only.yaml with django-joplin-vieweb 2.0.2-4 image unfortunately the latest didn't worked for me as I tried also.

Thanks for the issue I will document it ;-)

@gri38
Copy link
Contributor

gri38 commented May 2, 2022

Ok thanks for the trials.
I'll commit the 2.0.2.-4 as 2.0 and 2.0.2 and latest when I'll tested in my env.
It also seems the 2.0.2-4 breaks the setting save (at least with -joplin-only docker file): does it still work for you ?

@matbgn
Copy link

matbgn commented May 2, 2022

Everything work perfectly for me till e2ee issue

@gri38 gri38 closed this as completed in bc44702 May 2, 2022
@tpbraini
Copy link
Author

tpbraini commented May 3, 2022

Works fine for me as well.
Thank you for your efforts!

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

4 participants