Skip to content

add the posibility of specifying a url prefix#143

Merged
DarrenOfficial merged 1 commit into
DarrenOfficial:masterfrom
jjguti:feature/add-url-prefix
May 28, 2022
Merged

add the posibility of specifying a url prefix#143
DarrenOfficial merged 1 commit into
DarrenOfficial:masterfrom
jjguti:feature/add-url-prefix

Conversation

@jjguti

@jjguti jjguti commented Mar 17, 2020

Copy link
Copy Markdown
Contributor

this commit implements a prefix for urls, which allows easily deploying
dpaste into a "subdirectory". It adds a url_prefix to be read by default
from the environment which makes it especially suitable for using for
docker containers. For example, running

docker run -e PREFIX_URL=dpaste/ -p 8000:8000 barttc/dpaste

will make dpaste available on

http://localhost:8000/dpaste/

instead of the default http://localhost:8000

This is specially useful if you want to proxy dpaste from another host
and let it live in a sub-url. Without this commit all urls would be
incorrectly generated in this case.

@DarrenOfficial

Copy link
Copy Markdown
Owner

Thank you for your work.

I tested this, it doesn't work

steps that I did

git clone -b "feature/add-url-prefix" https://github.com/jjguti/dpaste.git jjguti

docker build -t dpaste:jjguti .
docker run -e PREFIX_URL=dpaste/ -p 8000:8000 dpaste:jjguti

The URL still only accessible at the root domain

@jjguti

jjguti commented May 27, 2022

Copy link
Copy Markdown
Contributor Author

Hi Darren,

I double checked and apparently I mixed up the name of the environment variable, it should be URL_PREFIX and not PREFIX_URL. to run you should use:

docker run -e URL_PREFIX=dpaste/ -p 8000:8000 dpaste:jjguti

@DarrenOfficial

Copy link
Copy Markdown
Owner

Hello jjguti,

I just tested it, it works.
If you can rebase this, I would gladly push it to main.

this commit implements a prefix for urls, which allows easily deploying
dpaste into a "subdirectory". It adds a url_prefix to be read by default
from the environment which makes it especially suitable for using for
docker containers. For example, running

docker run -e PREFIX_URL=dpaste/ -p 8000:8000 barttc/dpaste

will make dpaste available on

http://localhost:8000/dpaste/

instead of the default http://localhost:8000

This is specially useful if you want to proxy dpaste from another host
and let it live in a sub-url. Without this commit all urls would be
incorrectly generated in this case.
@jjguti jjguti force-pushed the feature/add-url-prefix branch from 9cb633e to 8344864 Compare May 27, 2022 21:13
@jjguti

jjguti commented May 27, 2022

Copy link
Copy Markdown
Contributor Author

Hi,

rebased now.

@DarrenOfficial DarrenOfficial merged commit 5510329 into DarrenOfficial:master May 28, 2022
DarrenOfficial added a commit that referenced this pull request May 29, 2022
DarrenOfficial added a commit that referenced this pull request May 29, 2022
DarrenOfficial added a commit that referenced this pull request May 29, 2022
* Revert "Revert "add the posibility of specifying a url prefix (#143)" (#205)"

* mysql client
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

Successfully merging this pull request may close these issues.

2 participants