forum Can this site also be used offline?
Started by Elementary
tune

people_alt 42 followers

Elementary

Hi all. Sorry if this has been asked before, but I was wondering: Is it possible to also have this entire thing offline, without having to connect to the internet?

I tried the site a bit and really liked what I saw, but after the many, many, MANY privacy scandals and data breaches around the world, even from huge companies like Facebook which have their own compliance and IT security departments, I rather prefer to have everything locally on my computer.

There is the github page with the code, I know, and I tried to run that locally in a Virtualbox Ubuntu 19.04 machine using Docker, but without much luck. First off, it gives me a lot of messages that the IP address is not valid, since it's running inside docker, it's seen as if I'm accessing it "from the outside". But second, the site is the same as here - asking me to login and trying to connect to the internet to do so. Now, I don't mind paying the subscription (if that's the concern), but for my needs, I require something that, ideally, can work without ever accessing the internet. Is this possible with Notebook.ai? I've tried to find tutorials or documentation, but so far without much luck.

Any help is greatly appreciated.

@andrew health_and_safety flash_onAdmin

Hey!

Since the site is open source, it's entirely possible to run offline – with the caveat that it's a bit of an installation process I only really recommend to developers or tech-savvy enthusiasts that don't mind getting their feet wet. After getting the Ruby on Rails application running, there's also several dependent services you need in order to fully replicate every feature around the site. You can skip whatever features you're not using, though.

For image uploads, you'll want an account on Amazon AWS and your own S3 bucket, as well as ImageMagick running on your machine. For document analysis, you'll want an integration account with IBM's Watson library and a task manager like Sidekiq for making sure background jobs get executed. You'll (probably) also want some kind of database backups, monitoring, and other standard devops tools, but if it's just you on the server you can (probably) skip monitoring and just do backups. Luckily, this is all surprisingly straightforward to set up, you'll just want to look at costs for your expected use (it should be reasonably low/cheap, though).

I haven't used Docker to set up the project, but some contributors have. Personally, I recommend skipping it and installing the dependencies manually. There aren't a lot of them (mostly just Ruby and Sqlite for the main site) and that gives you a bit more understanding of how the stack works, also.

For your question though, one thing I'd recommend is to make sure you're running the server bound to IP 0.0.0.0. By default, running rails server binds to 127.0.0.1, which only accepts connections from that address – the computer running the server. However, by running rails server -b 0.0.0.0, you bind to 0.0.0.0 which is a special IP that is basically "any IP", which should let you connect to that server from other computers. I have to do this, for example, when I test things in Windows – I run a server on my Linux laptop and connect to it with that computer's internal IP from my Windows desktop. Since you're running it in a VM, you'll want to use the VM's IP and you'll also want to double check your VM software's networking config to ensure you can bridge that connection and access the VM from your host.

I'm happy to help you get this set up, but since this is inherently a pretty technical discussion at this point, would you mind opening an issue on Github so I can assist there and have it available to any other developers having the same issue in the future? :)

Elementary

Hi there, @andrew (Our Supreme Lord and Overseer)

Thank you so much for replying. After writing my post, I did continue to try a bit on my own, and I just about managed to create a user and give it premium privileges. However, after that I couldn't get the image upload to work without an internet connection. Thanks for your kind offer to help set this up, but I think this is a bit too advanced for my skill level, even with your guidance.
Have a great day, and perhaps until next time :)

@andrew health_and_safety flash_onAdmin

No worries!

For the record, image uploads work by uploading to private buckets on Amazon AWS (a common place for most websites to store user-uploaded content), so in order to get it working offline you'd need to rewrite that section of code to, for example, save to a folder on your computer instead. It may be advanced, but just wanted to let you know in case you ever did want to end up tackling it. :)