This is an attempt to build a desktop app for Sefaria. It's an experimental work in progress. You're welcome to test and contribute.
Currently only supported on Linux.
First sign in to GitHub. Then go to here, and download the AppImage (At the bottom of the page in Artifacts section). It's around 2.8 GB.
Unzip it using unzip command.
Make it executable and run it:
chmod +x ./Sefaria-Desktop-Unofficial-x86_64.AppImage
./Sefaria-Desktop-Unofficial-x86_64.AppImageThe first time you run it, it copies the Sefaria database to
~/Sefaria-Desktop-Unofficial.
After that wait for a minute or two until the server is up.
When you see:
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Open your browser and go to http://127.0.0.1:8000
This repository packages Sefaria-Project which contains the source code for the Sefaria website, and all its dependencies including:
- python3.8 and its packages
- node packages
- MongoDB daemon
- Redis server
- Restored Sefaria database
and some other required binaries and their libraries into a self contained AppImage.
It's an executable that doesn't have any dependencies to run on a Linux system
(Other than FUSE that AppImage needs and is
available on most systems, except for docker. You can run it like this if FUSE not
available: Sefaria-Desktop-Unofficial-x86_64.AppImage --appimage-extract-and-run).
The workflow builds this package inside a docker container that has Sefaria installed in it. It's on our other repository, Sefaria-Container-Unofficial.
Now that we have a working AppImage it's trivial to wrap it inside an electron app that displays the port 8000. In fact I've done that and build the electron for Linux (I've lost the working version on my disk, have to write it again). At the moment I don't use Windows or Mac and haven't build for them or test on them.
Please open an issue if you've encountered any errors when running this program. All suggestions and PRs are appreciated.
This project is meant to assemble a team of volunteers to work on this until we have a working desktop app for Windows, Mac and Linux, as it's been long overdue.
- Check for any web requests to internet (for example web fonts) and pack those in the AppImage to make it fully self contained.
- I've tried to upload the AppImage to the GitHub Releases, But it doesn't allow files larger than 2 GB.
- The start up time for the server is around 2 minutes and unacceptable. Profile
it to see why it takes so long. Investigate using Gunicorn. Also tried
manage.py runserver --skip-checksbut since we're shipping with an older version of Django, it's not supported. - Currently we're packaging python3.8 with the AppImage per Sefaria's Recommendation. Work with Sefaria to fix the bugs and move to a recent version.
- MongoDB needs to write to the database directory, for journaling and what not.
That's the reason we first
write the database
to
~/Sefaria-Desktop-Unofficial. But since we're using the db readonly, this is not an elegant solution, ideally the db should stay in the AppImage. I think recent versions of MongoDB removed the--nojournaloption. - Should we have a GUI or just ship this as a server?
- Investigate more efficient solutions that don't depend on Redis and MongoDB, and directly serve with electron.
- If some Windows users experiment with running this on WSL, that would be interesting. Mac people as well.
- Check the icon and desktop integration. (I'm on i3wm, can't see).
- See whether we can query the api locally like this
- This and this contain great guidelines for making a professional AppImage, abide by them.
- Make the AppImage updatable
- Investigate the copyright implications of bundling binaries with AppImages.
