Giter Site home page Giter Site logo

Comments (24)

montharon avatar montharon commented on May 2, 2024 1

@ssddanbrown Many, many thanks to you Dan! Now it works like a charme ;)
The only thing that I figured out that it's not possible to export a page as PDF file.

The auto-generated URL looks like this:
http://192.168.0.12/docs/books/book01/page/page01/export/pdf

Cheers,
montharon

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

Hi,
Sorry for combing back to this late. If I'm honest I'm a little wary of this one. Allowing subdirectory placement of BookStack has the side effect of making it easy to have all the app files within publicly accessible space thus opening it up to all kinds of possible security issues.

I'm sure there's ways around this with careful apache/nginx/other config editing but it would make things too easy to get wrong. At the moment the set-up somewhat forces you to have a more secure structure or at least makes you think about it.

I understand that it would make things easier for using on shared web services but these days decent VPS solutions are becoming very affordable so this is becoming less of an issue.

This is definitely technically possible to do, It's just my gut feeling is against it.

I will leave this issue open for discussion though so potential solutions/reasoning's can be added.

from bookstack.

tpetrauskas avatar tpetrauskas commented on May 2, 2024

This would be definitely a security flow. The server administrator could use Apache2 aliases for that functionality (as phpMyAdmin is using by default).

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

Running into issues with a dockerised container, and nginx reverse proxy to put it on a sub directory. Loads but all the CSS / JS is pointing at the wrong place, and navigating anywhere breaks.

Tried with and without the rewrite rules, but doesn't seem to have any effect, any ideas?

upstream bookstack { server 127.0.0.1:8050; }
server {
  location    /docs/ {

    rewrite           ^/docs/$ http://bookstack/docs/ permanent;
    rewrite           ^/docs/(.*) /$1 break;
    proxy_pass  http://bookstack/docs/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $remote_addr;
  }
}

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@poppahorse Yeah, Pretty much all links and assets are referenced as root relative. Need to go over all links and covert them to be app relative.

Since you've shown a good use case of using BookStack in a subdomain securely (Proxying to a docker container) I'll remove the 'Open to discussion' label and mark this as something to be done.

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

Awesome thanks! I know this issue is an oldie, and dont want to sound pushy, but any idea of a rough timeline? 😛

Got 4 projects lined up that I'd love to use bookstack for, 2 of them fairly imminent 😃

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@poppahorse I was looking to do a bit of BookStack bug-bash session this weekend. If I have enough time I'll include this within the bug-bash.

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

thanks, that would be great! for the prompt responses 👍

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

Okay this should now be possible as of v0.11.1 that was just released. I'll add the process to the docs soon but, in general, you need to re-write the requests like in the example nginx config above and set the APP_URL param in the .env file to your full path.

There were quite a few areas in the app that were updated to allow this so there's a good chance I've missed a few changes. If you come across any links or redirects that don't include the extra path component just open a new issue.

@poppahorse I tested using pretty much the same nginx config as you posted but I proxied to another Nginx site. I have not yet tested it proxying to docker but I'm hoping it shouldn't be any different.

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

thanks @ssddanbrown much appreciated on the quick turnaround, I will hopefully have time to have a play with this later today, will let you know how it goes.

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

So I have discovered a few places where the baseUrl is required, I made a PR for the initial login one, but how would you prefer the others? In here?

Also how does it save / store the Application name field and settings like primary color? Managed to get 2 copies up and running at:

http://domain/docs/project
http://domain/docs/project2

But despite them having their own database, they seem to share those settings. Any ideas? :)

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@poppahorse List any additional url's in the comments of the pull request. I'll go through this weekend and send out another bugfix release to implement them.

Application settings are saved in the database and are also cached. Could the cache be shared across both in your setup? By default it's stored in the application storage folder unless you've set up memcached or redis.

from bookstack.

chorsnell avatar chorsnell commented on May 2, 2024

Will do on the other URLs, thanks :)

And cool, that makes sense re: cache. I will have a play!

from bookstack.

montharon avatar montharon commented on May 2, 2024

I'm currently also struggling the get BookStack running on my RaspberryPi.
I have other different webfolders (for instance baikal, grav, mediawiki) running on my NGINX server.
Therefore, I will have to use BookStack in it's separate subfolder on my public root.
I have tried various configurations of my NGINX default config to get BookStack running and I also did change the .env setting to http://192.168.0.12/subfolder, but without any luck ;(

@poppahorse
Do you have a running version of your NGINX config for me ;)
I just wanted to have BookStack running in its own subfolder, for instance /bookstack
and redirect all incoming request on that url to /bookstack/public

Is there already a version that can be installed in a subfolder?
I have cloned the latest release from github...

Many thanks and advance and @ssddanbrown keep up the great work!
montharon

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@montharon Thanks!

I do not recommend installing BookStack within an actual subfolder as it can expose a lot of files which should not be publically accessible. The latest version (v0.11.1) allows you to install BookStack on a URL sub-path (Such as http://domain.com/bookstack) but this should be done via proxying.

I will update the docs with this soon but for now I have created a gist with the nginx config I used to test this. This can be found here. I have commented it up so hopefully you can follow it okay. Will take a little nginx experience. Give me a shout if you have any issues.

from bookstack.

montharon avatar montharon commented on May 2, 2024

@ssddanbrown
Many, many thanks for your quick reply!

According to your suggested gist I changed my config to the following:

My NGINX default config

Unfortunately this does not work either, since every request is automatically redirected to
192.168.0.12/login

Any suggestions?

Many thanks in advance,
montharon

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@montharon Have you set the APP_URL param in the BookStack .env file to be your desired url? I forgot to mention that in my post above.

from bookstack.

montharon avatar montharon commented on May 2, 2024

@ssddanbrown
I have set the APP_URL in the .env file to
http://192.168.0.12/bs

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@montharon Okay, It might not be to do with your setup then, Could be #166 at play here. Planning to send another bugfix release out tomorrow to cover that.

from bookstack.

montharon avatar montharon commented on May 2, 2024

@ssddanbrown Wow, that's good news! Your support and work is much appreciated!

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

@montharon I've just published a new release. Give that a try and let me know how it goes.

from bookstack.

ssddanbrown avatar ssddanbrown commented on May 2, 2024

Hey @montharon, Glad its now working. That PDF export link looks correct & PDF exports are working okay for me, What's the issue you're getting? Info about viewing error output can be found here.

from bookstack.

montharon avatar montharon commented on May 2, 2024

@ssddanbrown Hmmmm, set the debugging to true in the .env file and exported a page...
No errors, but a blank page and nothing to download.
Checked the naravel.log also, but found nothing special or unexpected...

from bookstack.

minecraftchest1 avatar minecraftchest1 commented on May 2, 2024

I have just installed BookStack on my pi with a symlink from /opt/BookStack/public to /var/www/html/bookstack. I was able to access the long page, but then I got a ERR_TOO_MANY_REDIRECTS error.
image

from bookstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.