Giter VIP home page Giter VIP logo

docker-sopds's Introduction

https://github.com/ichbinkirgiz/sopds

Introduction

Dockerfile to build a Simple OPDS server docker image. http://www.sopds.ru

Installation

Pull the latest version of the image from the docker.

docker pull ghcr.io/zveronline/sopds

Alternately you can build the image yourself.

docker build -t ghcr.io/zveronline/sopds https://github.com/zveronline/docker-sopds.git

Quick Start

Run the image

docker run --name sopds -d \
   --volume /path/to/library:/library:ro \
   --publish 8001:8001 \
   ghcr.io/zveronline/sopds

This will start the sopds server and you should now be able to browse the content on port 8081.

docker run --name sopds -d \
   --volume /path/to/library:/library:ro \
   --volume /path/to/database:/var/lib/pgsql \
   --publish 8001:8001 \
   ghcr.io/zveronline/sopds

Also you can store postgresql database on external storage.

docker run --name sopds -d \
   --volume /path/to/library:/library:ro \
   --env 'DB_USER=sopds' \
   --env 'DB_NAME=sopds' \
   --env 'DB_PASS=sopds' \
   --env 'DB_HOST=""' \
   --env 'DB_PORT=""' \
   --env 'EXT_DB=True' \
   --publish 8001:8001 \
   ghcr.io/zveronline/sopds

Create superuser

By default the superuser will be created with predefined name "admin" and password "admin". But you can manage it via appropriate environmental variables:

docker run --name sopds -d \
   --volume /path/to/library:/library:ro \
   --volume /path/to/database:/var/lib/pgsql \
   --env 'SOPDS_SU_NAME="your_name_for_superuser"' \
   --env 'SOPDS_SU_EMAIL='"your_mail_for_superuser@your_domain"' \
   --env 'SOPDS_SU_PASS="your_password_for_superuser"' \
   --publish 8001:8001 \
   ghcr.io/zveronline/sopds

Scan library

docker exec -ti sopds bash
python3 manage.py sopds_util setconf SOPDS_SCAN_START_DIRECTLY True

docker-sopds's People

Contributors

a0s avatar masterhome avatar petervoronov avatar sonaton avatar zveronline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-sopds's Issues

WSGI

а возможно настроить что бы это работало через wsgi?
то есть, у меня это выглядело так :

<VirtualHost *:8001>
    ServerAdmin bravo.123@localhost
    DocumentRoot "/opt/sopds"
    ServerName sopds-apache
    ServerAlias sopds-apache.local
    ErrorLog "/var/log/httpd/sopds-apach.local-error_log"
    CustomLog "/var/log/httpd/sopds-apache.local-access_log" common
   WSGIApplicationGroup %{GLOBAL}
   WSGIScriptAlias / /opt/sopds/sopds/wsgi.py
   WSGIDaemonProcess sopds processes=3 threads=15 python-path=/opt/sopds/
   WSGIProcessGroup sopds
   WSGIScriptReloading On
   WSGIPassAuthorization On

   <Directory "/opt/sopds/sopds/">
      Require all granted
   </Directory>

   <Directory "/opt/sopds/static/">
      Require all granted
   </Directory>

   Alias   /static    "/opt/sopds/static"


</VirtualHost>


а как это настроить с докером мне не понятно ..

telegram bot not working (no answers)

thanks for your work, I didn't find any mention of this error
logs sopds/opds_catalog/log/sopds_telebot.log
after setting up in logs

/sopds/opds_catalog/management/commands/sopds_telebot.py:348: TelegramDeprecationWarning: RegexHandler is deprecated. See https://git.io/fxJuV for more info
  download_handler = RegexHandler('^/download\d+$',self.downloadBooks)
/usr/local/lib/python3.10/site-packages/telegram/ext/regexhandler.py:135: TelegramDeprecationWarning: message_updates is deprecated. See https://git.io/fxJuV for more info
  super().__init__(
/usr/local/lib/python3.10/site-packages/telegram/ext/regexhandler.py:135: TelegramDeprecationWarning: channel_post_updates is deprecated. See https://git.io/fxJuV for more info
  super().__init__(
/usr/local/lib/python3.10/site-packages/telegram/ext/regexhandler.py:135: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info
  super().__init__(
/sopds/opds_catalog/management/commands/sopds_telebot.py:355: TelegramDeprecationWarning: The argument `clean` of `start_polling` is deprecated. Please use `drop_pending_updates` instead.
  updater.start_polling(clean=True)
2022-03-25 19:15:08,421 INFO     Scheduler started

after send /start to bot

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/dispatcher.py", line 555, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/handler.py", line 198, in handle_update
    return self.callback(update, context)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 30, in wrapper
    result =  func(self, bot, update)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 40, in wrapper
    return func(self, bot, update)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 109, in startCommand
    bot.sendMessage(chat_id=update.message.chat_id, text=_("%(subtitle)s\nHello %(username)s! To search for a book, enter part of her title or author:")%
AttributeError: 'Update' object has no attribute 'sendMessage'

after sending book name

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/dispatcher.py", line 555, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/handler.py", line 198, in handle_update
    return self.callback(update, context)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 30, in wrapper
    result =  func(self, bot, update)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 40, in wrapper
    return func(self, bot, update)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 190, in getBooks
    query=update.message.text
AttributeError: 'CallbackContext' object has no attribute 'message'

after sending /start with SOPDS_TELEBOT_AUTH=True

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/dispatcher.py", line 555, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.10/site-packages/telegram/ext/handler.py", line 198, in handle_update
    return self.callback(update, context)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 30, in wrapper
    result =  func(self, bot, update)
  File "/sopds/opds_catalog/management/commands/sopds_telebot.py", line 45, in wrapper
    query = update.message if update.message else update.callback_query.message
AttributeError: 'CallbackContext' object has no attribute 'message'

By default, sqlite is used, not postresql

Hi! I'm used this image in TrueNas Scale. By default, sqlite is used, not postresql. You need to replace copy path for settings.py in docker file: "COPY configs/settings.py ." replace with "COPY configs/settings.py ./sopds"
ЗЫ. Извини за кривой английский :)

Read Online

Не работает у меня ссылка Read Online, так как там подставляется адрес HTTPS:// а у меня он HTTP:// ну и соответственно omnireader.ru на это ругается, ну и зря из интерфейса выпилили скачивание в fb2.zip , его все читалки умеют, а трафик в разы меньше.
Пишу сюда, по тому что на https://github.com/ichbinkirgiz/sopds , писать некуда, я так понимаю что это его исправления ..

/sopds folder empty after container run

Привет!
Устанавливаю docker-sopds:latest на NAS Synology - контейнер запускается, sopds-сервер запускается по указанному 8001 порту.

В созданном каталоге /sopds на сервере видны только:
--/data
--setconf

В чем может быть причина, что остальные файлы контейнера не видны в /sopds ?

Непосредственно в контейнере докера


~# docker exec -i -t sopds ls -alF /
total 4
drwxr-xr-x    1 root     root           174 Jun  1 11:00 ./
drwxr-xr-x    1 root     root           174 Jun  1 11:00 ../
-rwxr-xr-x    1 root     root             0 Jun  1 10:59 .dockerenv*
drwxr-xr-x    1 root     root           870 Jun  1 07:09 bin/
drwxr-xr-x    5 root     root           340 Jun  1 11:00 dev/
drwxr-xr-x    1 root     root           842 Jun  1 10:59 etc/
drwxr-xr-x    1 root     root             0 Nov 11  2022 home/
drwxr-xr-x    1 root     root           410 Feb  4 03:23 lib/
drwxr-xr-x    1 postgres postgres       962 May 30 15:07 library/
drwxr-xr-x    1 root     root            28 Nov 11  2022 media/
drwxr-xr-x    1 root     root             0 Nov 11  2022 mnt/
drwxr-xr-x    1 root     root             0 Nov 11  2022 opt/
dr-xr-xr-x  834 root     root             0 Jun  1 11:00 proc/
drwx------    1 root     root             0 Nov 11  2022 root/
drwxr-xr-x    1 root     root            20 Jun  1 11:00 run/
drwxr-xr-x    1 root     root           800 Nov 11  2022 sbin/
drwxr-xr-x    1 root     root           438 Jun  1 07:09 sopds/
drwxr-xr-x    1 root     root             0 Nov 11  2022 srv/
-rwxr-xr-x    1 root     root          1913 Jun  1 07:08 start.sh*
dr-xr-xr-x   12 root     root             0 Jun  1 11:00 sys/
drwxrwxrwt    1 root     root             0 Feb  4 03:23 tmp/
drwxr-xr-x    1 root     root            60 Jun  1 07:09 usr/
drwxr-xr-x    1 root     root            86 Feb  4 03:23 var/

telegram bot code isn't compatible with the new library version

Hello! Thank you for your work.

It looks like in the latest version of the image the python-telegram-bot library has been updated to 20.3, but the bot code in the sopds is using the old syntax (e.g. "Filters" instead of "filters" in import and "RegexHandler" which was removed from the new version of the library).
So, telegram bot in the image can't start. And, I guess, there are some other differences.
I tried to fix that in the sopds_telebot.py, but it's beyond my skill :)

I think the easiest way to fix that would be to roll back the library version to the old one.

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.