learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 306 forks source link

CONTENT_ROOT configuration not working. #5487

Closed nobicycle closed 6 years ago

nobicycle commented 6 years ago

Summary

If I set the CONTENT_ROOT, update http://127.0.0.1:8008/update/videos/ runs for 1 second and nothing is updated.

System information

ka_lite-0.17.1. Arch Linux 4.9.33-1 $ pip2 -V pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)

server.log

cat /srv/kalite/.kalite/server.log [sudo] password for adrian: [INFO] [2017-07-24 16:49:50,766] cherrypy.error: [24/Jul/2017:16:49:50] ENGINE Bus STARTED [INFO] [2017-07-24 16:50:24,449] cherrypy.access.140630187525648: 127.0.0.1 - - [24/Jul/2017:16:50:24] "GET /static/images/distributed/favicon.ico HTTP/1.1" 200 946 "http://127.0.0.1:8008/update/videos/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.90 Safari/537.36 Vivaldi/1.91.867.38" [INFO] [2017-07-24 16:50:26,360] kalite: Annotating content for language: en, channel: khan [INFO] [2017-07-24 16:50:26,395] kalite: Annotating content for language: en, channel: khan

This may take several minutes depending on system resources... [INFO] [2017-07-24 16:50:26,399] kalite: Annotation complete for language: en, channel: khan

settings.py

MY_SETTING = 123

CONTENT_ROOT = "/media/esata/MEDIA/Videos/Education/Khan-Academy2" DEBUG = True

Check of permissions

sudo -u kalite2 ls -1l /media/esata/MEDIA/Videos/Education/Khan-Academy2|head -10 total 32257136 -rw-r--r-- 1 adrian adrian 2518 Oct 25 2016 01c12NaUQDw.jpg -rw-r--r-- 1 adrian adrian 1757525 Jun 16 2013 01c12NaUQDw.mp4 -rw-r--r-- 1 adrian adrian 64880 Jun 16 2013 01c12NaUQDw.png -rw-r--r-- 1 adrian adrian 2504 Oct 25 2016 _01wqwsb66E.jpg -rw-r--r-- 1 adrian adrian 2463761 Jun 16 2013 _01wqwsb66E.mp4 -rw-r--r-- 1 adrian adrian 60678 Jun 16 2013 _01wqwsb66E.png -rw-r--r-- 1 adrian adrian 7404963 Jun 16 2013 02gVmoObrjM.mp4 -rw-r--r-- 1 adrian adrian 160541 Jun 23 2013 02gVmoObrjM.png -rw-r--r-- 1 adrian adrian 5452291 Jun 16 2013 02h9yhc7ruc.mp4

KA Lite User

cat /etc/passwd|grep kalite2 kalite2:x:1007:1007::/srv/kalite:/bin/bash

KA Lite Start/Stop

$ sudo -u kalite2 /srv/kalite/.local/bin/kalite stop kalite stopped [adrian@tower nginx]$ sudo -u kalite2 /srv/kalite/.local/bin/kalite start Running 'kalite start' as daemon (system service) Going to daemon mode, logging to /srv/kalite/.kalite/server.log

To access KA Lite from another connected computer, try the following address(es): http://192.168.1.100:8008/

To access KA Lite from this machine, try the following address: http://127.0.0.1:8008/

d204e60a-b7dd-4127-b2fa-01243b6d91ad

benjaoming commented 6 years ago

@nobicycle your settings file isn't quite valid

Normally, you start with an auto-generated file looking like this:

# This is the default location where the kalite command finds its settings
# You can change the below lines to use different default settings or
# you can run kalite <command> --settings=other_module

from kalite.project.settings.base import *

# from kalite.project.settings.dev import *
# from kalite.project.settings.raspberry_pi import *

# Put your custom settings here
# MY_SETTING = 123

Notice the line that says from kalite.project.settings.base import *, below that line is where you should put you custom settings such that they override.

Another thing: Running sudo -u kalite2 doesn't give the correct sub shell with a local user's login environments. To see the problem, try:

you $ sudo -u someuser bash
someuser $ echo $HOME
someuser $ exit

Instead, use sudo su -l someuser -c somecommand

benjaoming commented 6 years ago

If you have further questions, please use our support forum - in case it's a technical issue with KA Lite, we should of course open up an issue on Github.

http://community.learningequality.org/