Closed yohanyflores closed 4 years ago
Thanks a lot :+1: I'll rework the long overdue Dockerfile and CI this evening as well. Enjoy!
Hey there, I added some changes to the Go code and the Dockerfile. Would you mind testing the latest docker image to see if everything works as expected for you? Maybe I missed something re-writing the Go code.
Also what's at the path /conf
or /app/conf
? I see you return a constant, what should be returned here? Do you have a link on the configuration settings / environment variables Stackedit reads? I would be happy to add them. Thanks!
Hi :), thanks for asking me.
Regarding the golang code, I don't understand what the rootUrl
variable does. Since if this variable is different from ""
or "/"
, errors appear.
The Dockerfile is wired to /html/static
and /html/dist
so any value of rootUrl
other than ""
or "/"
causes the files in path
variable not to be served correctly. It should not be used to build the path
variable. This is wrong path = rootURL +"/dist/xxxxxxx "
.
In addition to tests performed, it seems that stackedit cannot be executed in a folder or context other than the root (I seemed to see that it is wired to /
). Unless changes are made to the static files or the route handles it correctly without interfering with other applications.
In relation to /conf
, the server must build a JSON, using the environment variables that you already defined: DROPBOX_APP_KEY, GITHUB_CLIENT_ID, WORDPRESS_CLIENT_ID, etc.
Yeah oops! I fixed it now (locally), but indeed Stackedit does not seem friendly to run with a different root URL. I am trying to debug what routes are missing, as I would really like not to have a subdomain just for Stackedit personnally 😄
I've added also the json response of all the Stackedit related environment variables.
Hi again,
It finally works, you can now set ROOT_URL=stackedit
for example, and you could then access it from http://localhost:8000/stackedit without issue.
It also returns a JSON value from the environment variables at /conf
as you mentioned in your TODO.
Happy stackediting!
Wow .... Already perform the tests and it works perfectly. Thank you.
The only problem is that stackedit asks for resources outside of ROOT_URL=/stackedit/
, such as:
http://localhost:8002/static/css/app.5eefa31cb301f3c2eb7a6ca9f02b8b12.css
and not as expected
http://localhost:8002/stackedit/static/css/app.5eefa31cb301f3c2eb7a6ca9f02b8b12.css
This can be a problem, when using a reverse proxy. As is my case, I can only modify the assigned context, /stackedit/
.
But if you use this server directly you would have no problem.
Indeed, I am trying to fix it as it works locally but not with a reverse proxy.
I'm still a bit confused why though, is it URL values in the generated Javascript? I could do some ugly replace all for all relative URLs adding ROOT_URL
in front if that's the case.
More routing options, based on the original server https://github.com/benweet/stackedit/blob/master/server/index.js