Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Subdirectory deployment #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Strubbl
Copy link
Contributor

@Strubbl Strubbl commented May 21, 2018

Hello,
with the changes in this PR i am able to deploy webtodotxt in a subpath, e.g. https://asdf.nextcloud.example.de/todotxt/

I implemented the changes in a way that the default values are not changed if there were no environment variables given.

This PR is going to fix #24

JFYI:
Now, my docker command to deploy it like that is:

docker create --name $CONTAINERNAME -p 3006:9000 -e SECRET_KEY=supersecret -e AUTH_BACKEND=WebDavAuth -e STORAGE_BACKEND=WebDav -e TODO_FILE_PATH=/remote.php/webdav/todo.txt -e WEBDAV_HOST=https://asdf.nextcloud.example.de -e WEBTODOTXT_STATIC_URL_PATH=/todotxt-static -e WEBTODOTXT_FORCE_ROOT_URL=https://asdf.nextcloud.example.de/todotxt/ strubbl_webtodotxt

My nginx config looks like that:

        location /todotxt-static {                                                                                                                                                                                                                            
          rewrite /todotxt-static(/.*) https://asdf.nextcloud.example.de/todotxt/todotxt-static$1 break;                                                                                                                                                                
        }                                                                                                                                                                                                                                                     
        location /todotxt/ {                                                                                                                                                                                                                                  
          proxy_pass http://127.0.0.1:3006/;                                                                                                                                                                                                                  
          proxy_set_header Host $host;                                                                                                                                                                                                                        
          proxy_set_header X-Real-IP $remote_addr;                                                                                                                                                                                                            
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                                                                                                                                                        
          proxy_set_header X-Scheme $scheme;                                                                                                                                                                                                                  
        }

Strubbl added 2 commits May 21, 2018 21:21
This commit adds the option to override the ROOT_URL with a value from
an environment variable WEBTODOTXT_FORCE_ROOT_URL. It is necessary if
you are using an nginx as frontend and pass the request as proxy to the
docker container - especially when you want to deploy webtodotxt in a
subdirectory.

fix EpocDotFr#24
@Strubbl
Copy link
Contributor Author

Strubbl commented Jun 5, 2018

@EpocDotFr what is your opinion about this PR? Are you going to merge it? Do you want me to change anything?

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

Successfully merging this pull request may close these issues.

Support installation in a subpath
1 participant