خادم المحتوى Calibre¶
يسمح لك خادم المحتوى في calibre بالوصول إلى مكتبات calibre الخاصة بك وقراءة الكتب مباشرة في متصفح على هاتفك المحمول المفضل أو جهازك اللوحي. ونتيجة لذلك، لا تحتاج إلى تثبيت أي تطبيقات مخصصة لقراءة/إدارة الكتب على هاتفك. ما عليك سوى استخدام المتصفح. يقوم الخادم بتنزيل الكتاب الذي تقرأه وتخزينه في ذاكرة تخزين مؤقت غير متصلة بالإنترنت حتى تتمكن من قراءته حتى عندما لا يكون هناك اتصال بالإنترنت.
لبدء تشغيل الخادم، انقر على زر الاتصال/المشاركة واختر بدء خادم المحتوى. قد تتلقى رسالة من جدار حماية جهاز الكمبيوتر الخاص بك أو برنامج مكافحة الفيروسات يسألك عما إذا كان من المقبول السماح بالوصول إلى calibre.exe. انقر على زر السماح أو موافق. ثم افتح متصفحًا (يفضل Chrome أو Firefox) في جهاز الكمبيوتر الخاص بك واكتب العنوان التالي:
سيؤدي هذا إلى فتح صفحة في المتصفح تعرض لك مكتبات calibre الخاصة بك، انقر على أي منها وتصفح الكتب الموجودة فيها. انقر على كتاب، وسيعرض لك جميع البيانات الوصفية حول الكتاب، بالإضافة إلى أزرار لـ القراءة و التنزيل للكتاب. انقر على زر القراءة لبدء قراءة الكتاب.
ملاحظة
العنوان المستخدم أعلاه http://127.0.0.1:8080 سيعمل فقط على الكمبيوتر الذي يشغل calibre. للوصول إلى الخادم من أجهزة كمبيوتر/هواتف/أجهزة لوحية/إلخ أخرى، ستحتاج إلى القيام ببعض العمل الإضافي، كما هو موضح في القسم التالي.
الوصول إلى خادم المحتوى من أجهزة أخرى¶
هناك نوعان من الوصول عن بعد إلى الجهاز ستحتاج إليهما عادةً. النوع الأول والأبسط هو من داخل شبكتك المنزلية. إذا كنت تشغل calibre على جهاز كمبيوتر في شبكتك المنزلية وقمت أيضًا بتوصيل أجهزتك الأخرى بنفس الشبكة المنزلية، فستتمكن بسهولة من الوصول إلى الخادم على تلك الأجهزة.
الوصول إلى الخادم من الأجهزة الموجودة على شبكتك المنزلية¶
بعد بدء تشغيل الخادم في calibre كما هو موضح أعلاه، انقر على زر الاتصال/المشاركة مرة أخرى. بدلاً من إجراء بدء خادم المحتوى، يجب أن ترى إجراء إيقاف خادم المحتوى بدلاً من ذلك. على يمين هذا الإجراء ستظهر قائمة بعنوان IP ورقم منفذ. تبدو هذه كـ مجموعة من الأرقام مفصولة بنقاط. على سبيل المثال:
Stop Content server [192.168.1.5, port 8080]
تخبرك هذه الأرقام بالعنوان الذي يجب استخدامه للاتصال بالخادم في أجهزتك. باتباع المثال أعلاه، يصبح العنوان:
http://192.168.1.5:8080
الجزء الأول من العنوان هو دائمًا http:// الجزء التالي هو عنوان IP، وهو الأرقام قبل الفاصلة، وأخيرًا لدينا رقم المنفذ الذي يجب إضافته إلى عنوان IP بنقطتين (:). إذا كنت محظوظًا، فهذا كل ما تحتاجه وستكون تنظر إلى مكتبات calibre على جهازك. إذا لم يكن الأمر كذلك، فتابع القراءة.
استكشاف أخطاء اتصال الشبكة المنزلية وإصلاحها¶
إذا لم تتمكن من الوصول إلى الخادم من جهازك، فجرب الخطوات التالية:
تحقق من أن الخادم قيد التشغيل عن طريق فتح العنوان
http://127.0.0.1:8080في متصفح يعمل على نفس الكمبيوتر الذي يشغل الخادم.تحقق من أن جدار الحماية/مكافحة الفيروسات الخاص بك يسمح بالاتصالات بجهاز الكمبيوتر الخاص بك على المنفذ
8080ولبرنامج calibre. أسهل طريقة لـ إزالة جدار الحماية/مكافحة الفيروسات كمصدر للمشاكل هي إيقاف تشغيلهما مؤقتًا ثم محاولة الاتصال. يجب عليك أولاً فصل الاتصال بالإنترنت، قبل إيقاف تشغيل جدار الحماية، للحفاظ على جهاز الكمبيوتر الخاص بك آمنًا.تحقق من أن جهازك وجهاز الكمبيوتر الخاص بك على نفس الشبكة. هذا يعني أنهما يجب أن يكونا متصلين بنفس جهاز التوجيه اللاسلكي. على وجه الخصوص، لا ينبغي لأي منهما استخدام اتصال خلوي أو اتصال Wi-Fi مباشر مقدم من مزود خدمة الإنترنت.
إذا كان لديك إعداد شبكة غير قياسي، فقد يكون عنوان IP المعروض في قائمة الاتصال/المشاركة غير صحيح. في هذه الحالة، سيتعين عليك معرفة ما هو عنوان IP الصحيح الذي يجب استخدامه بنفسك. لسوء الحظ، نظرًا للتنوع اللانهائي في تكوينات الشبكة الممكنة، لا يمكننا أن نقدم لك خارطة طريق للقيام بذلك.
If you have set up a username and password, first try it without that to see if it is causing issues. Some e-ink devices have browsers that do not handle authentication. You can sometimes workaround this by including the username and password in the URL, for example:
http://username:password@192.168.1.2:8080.إذا واجهتك مشكلة، يمكنك دائمًا طلب المساعدة في منتديات مستخدمي calibre.
الوصول إلى الخادم من أي مكان على الإنترنت¶
تحذير
قبل القيام بذلك، يجب عليك تشغيل حماية اسم المستخدم/كلمة المرور في الخادم، وإلا سيتمكن أي شخص في العالم من الوصول إلى كتبك. انتقل إلى التفضيلات → المشاركة → المشاركة عبر الشبكة وقم بتمكين خيار طلب اسم المستخدم وكلمة المرور للوصول إلى خادم المحتوى.
بينما تختلف التفاصيل الخاصة بإعداد الوصول إلى الإنترنت اعتمادًا على تكوين الشبكة ونوع الكمبيوتر الذي تستخدمه، فإن المخطط الأساسي هو كما يلي.
اكتشف عنوان IP الخارجي للكمبيوتر الذي ستقوم بتشغيل الخادم عليه. يمكنك القيام بذلك عن طريق زيارة موقع ما هو عنوان IP الخاص بي في متصفح يعمل على الكمبيوتر.
إذا كان الكمبيوتر خلف جهاز توجيه، قم بتمكين إعادة توجيه المنفذ على جهاز التوجيه لـ إعادة توجيه المنفذ
8080(أو أي منفذ تختاره لتشغيل خادم محتوى calibre عليه) إلى الكمبيوتر.تأكد من السماح لخادم calibre بالمرور عبر أي جدران حماية/برامج مكافحة فيروسات على جهاز الكمبيوتر الخاص بك.
الآن يجب أن تكون قادرًا على الوصول إلى الخادم على أي جهاز متصل بالإنترنت باستخدام عنوان IP الذي وجدته في الخطوة الأولى. على سبيل المثال، إذا كان عنوان IP الذي وجدته هو
123.123.123.123والمنفذ الذي تستخدمه لخادم calibre هو8080، يصبح العنوان الذي يجب استخدامه على جهازك:http://123.123.123.123:8080.اختياريًا، استخدم خدمة مثل no-ip لإعداد عنوان سهل التذكر لاستخدامه بدلاً من عنوان IP الذي وجدته في الخطوة الأولى.
ملاحظة
For maximum security, you should also enable HTTPS on the Content server. You can either do so directly in the server by providing the path to the HTTPS certificate to use in the advanced configuration options for the server, or you can set up a reverse proxy as described below, to use an existing HTTPS setup.
واجهة الخادم¶
The server interface is a simplified version of the main calibre interface, optimised for use with touch screens. The home screen shows you books you are currently reading as well as allowing you to choose a calibre library you want to browse. The server in calibre gives you access to all your libraries, not just a single one, as before.
قائمة الكتب¶
قائمة كتب الخادم هي شبكة بسيطة من الأغلفة. انقر على غلاف لرؤية البيانات الوصفية المفصلة للكتاب، أو لقراءة الكتاب. إذا كنت تفضل قائمة أكثر تفصيلاً، يمكنك تغيير العرض الافتراضي بالنقر على النقاط الثلاث العمودية في الزاوية اليمنى العليا.
يجب أن يكون فرز وبحث قائمة الكتب مألوفًا لمستخدمي calibre. يمكن الوصول إليهما بالنقر على أيقوناتهما في المنطقة العلوية اليمنى. كلاهما يعملان تمامًا بنفس الطريقة كما هو الحال في برنامج calibre الرئيسي. تسمح صفحة البحث حتى بإنشاء استعلامات بحث بالنقر على المؤلفين/العلامات/إلخ، تمامًا كما يمكنك استخدام متصفح العلامات في البرنامج الرئيسي.
ميزة محبوبة جدًا في البرنامج الرئيسي، المكتبات الافتراضية موجودة في واجهة الخادم أيضًا. انقر على النقاط العمودية الثلاث في الزاوية اليمنى العليا لاختيار مكتبة افتراضية.
عارض الكتب¶
يمكنك قراءة أي كتاب في مكتبة calibre الخاصة بك بمجرد النقر عليه ثم النقر على زر قراءة. عارض الكتب بسيط للغاية في التشغيل. يمكنك النقر والتمرير لتقليب الصفحات. التمرير لأعلى/لأسفل يتخطى الفصول. النقر على الربع العلوي من الشاشة يمنحك عناصر التحكم التفصيلية وتفضيلات العارض.
إذا تركت خادم المحتوى يعمل، يمكنك حتى فتح نفس الكتاب على أجهزة متعددة وسيتذكر موضع القراءة الأخير. إذا لم يفعل ذلك، يمكنك فرض المزامنة بالنقر في الربع العلوي واختيار مزامنة.
Searching book contents in OPDS applications¶
When full text indexing is enabled for a library, its OPDS catalog offers a catalog entry titled Search book contents. Open this entry and use the application's search control to find books by words and phrases inside them, using calibre's existing full text index. Each feed has a single search link, so clients do not have to choose between multiple search links. Results contain the normal book information and download links. A book is listed once even if more than one of its formats matches. Only books available to the current user are searched.
The original search continues to search book metadata. Content search uses
the same SQLite full text query syntax as calibre's full text search window.
It searches the text indexed so far; books still waiting to be indexed will
not appear yet. The content search entry is absent when indexing is disabled.
Both OPDS 1 and OPDS 2 catalogs support content search, through the normal
search URL with full_text=y added to its query parameters.
Reading comics in OPDS applications¶
Applications that support OPDS 2.0 and the Readium Divina format can read CBZ comics one
page at a time, without downloading the entire archive. Connect the application
to the server's /opds catalog. OPDS 2.0 applications request the JSON catalog
using Accept: application/opds+json.
Comic entries link to a Divina manifest. The server lists pages only when the application opens that manifest, using the same page order as calibre's comic conversion. Each page offers its original image format, including AVIF and JPEG XL, and alternate formats the server can produce. GIF pages, which may be animated, are only offered in their original format. The application chooses an image format it supports from those links. JPEG is offered as the default for AVIF and JPEG XL pages when conversion is available.
For manga, a ComicInfo.xml file with Manga set to YesAndRightToLeft
tells the application to use right-to-left reading direction. The file can be
in the root of the archive or in the folder containing the page images. Page
images remain in their original order. The reading direction is only given in
the comic manifest, not in OPDS feeds, as finding it requires opening the
archive.
The normal username/password and library restrictions apply to manifests and page images. Complete archive downloads remain available. This feature supports CBZ archives; CBR and CB7 comics can still be downloaded as complete files.
دعم المتصفح¶
يستخدم خادم calibre الجديد الكثير من ميزات HTML 5 و CSS 3 المتقدمة. وعلى هذا النحو، فإنه يتطلب متصفحًا حديثًا للاستخدام. لقد تم اختباره على Android Chrome و iOS Safari بالإضافة إلى Chrome و Firefox على سطح المكتب.
يهتم الخادم باستخدام الوظائف التي تم توحيدها بالفعل أو هي قيد التوحيد. وبالتالي، إذا لم يعمل حاليًا مع متصفحك المفضل، فمن المحتمل أن يعمل بمجرد أن يتم تحديث هذا المتصفح.
إذا كنت تستخدم متصفحًا قديمًا جدًا أو محدودًا أو لا تحب تشغيل JavaScript، يمكنك استخدام عرض الجوال، ببساطة عن طريق إضافة /mobile إلى عنوان الخادم.
ملاحظة
على نظام iOS، تسمح Apple بمحرك متصفح واحد فقط، لذا فإن Firefox و Chrome وSafari هي كلها في الواقع نفس المتصفح من الداخل. تتطلب واجهة الخادم الجديدة نظام iOS 10.3.2 أو أحدث. على نظام Android، تم اختبار الخادم مع Chrome الإصدار 58 والإصدارات الأحدث.
تمكين الدعم دون اتصال¶
The server has full support for offline mode, you can open a book and once it is loaded, continue reading it offline. However, typical browsers require the use of HTTPS connections to enable offline mode (service workers). So setup HTTPS support as described above. Scroll to the bottom of the home page and you will see a message about the status of offline mode.
Alternately, you can open a book and keep the browser tab open. As long as the tab stays open you can continue reading the book, even when offline.
إدارة حسابات المستخدمين من سطر الأوامر فقط¶
يحتوي برنامج calibre على قسم جيد في التفضيلات للسماح لك بإدارة حسابات المستخدمين للخادم. ومع ذلك، إذا كنت ترغب في تشغيل الخادم المستقل ولا يمكنك تشغيل برنامج calibre الرئيسي على نفس الكمبيوتر/حساب المستخدم، يمكنك أيضًا إدارة المستخدمين باستخدام سطر الأوامر فقط.
يمكنك إدارة حسابات المستخدمين باستخدام خيار --manage-users لبرنامج calibre-server المستقل. لنفترض أنك تريد تخزين قاعدة بيانات المستخدم في المجلد /srv/calibre، ثم تقوم بإنشائها بتشغيل:
calibre-server --userdb /srv/calibre/users.sqlite --manage-users
Just follow the prompts to create user accounts, set their permissions, etc. Once you are done, you can run the server as:
calibre-server --userdb /srv/calibre/users.sqlite --enable-auth
سيستخدم حسابات المستخدمين التي أنشأتها في الخطوة السابقة.
Syncing reading progress with KOReader¶
The Content server can act as a progress sync server for the KOReader e-book reader, so that devices running KOReader
can sync your reading position in books with each other. In KOReader, go to
Tools → Progress sync → Custom sync server and enter the address of
the Content server followed by /kosync, for example:
http://192.168.1.2:8080/kosync
If you are Using a URL prefix, include it before /kosync.
Then use Login with the username and password of a user account on
the Content server. Accounts cannot be created from KOReader, they are managed
by calibre as described above. Users that are only allowed read access cannot
sync their reading positions. If user accounts are not enabled on the server,
any username and password can be used, but reading positions can only be synced
from devices that are allowed to make changes without authentication, see the
Allow un-authenticated local connections to make changes and
Allow un-authenticated connections from specific IP addresses to make changes
options. Reading positions synced while user accounts are not enabled are kept
separate from those of user accounts. The reading positions of each user are
stored separately in the user database of the server.
By default, KOReader identifies books by a checksum of the book file. The Content server can change the metadata embedded in books when they are downloaded, so copies of a book downloaded at different times can have different checksums. Once KOReader has synced with the server, it remembers the checksums of downloaded books and of the library files they were created from, so that all copies of the same format of a book share one reading position. Different formats of a book have separate reading positions, as positions in one format cannot be used in another. Copies downloaded before KOReader first synced with the server, or obtained other than by downloading them from the server, are not recognized. If reading positions do not sync for such copies, set Document matching method in the KOReader progress sync settings to Filename on all devices and keep the file names of books the same.
دمج خادم محتوى calibre في خوادم أخرى¶
Here, we will show you how to integrate the calibre Content server into another server. The most common reason for this is to make use of SSL or to serve the calibre library as part of a larger site. The basic technique is to run the calibre server and set up a reverse proxy to it from the main server.
الوكيل العكسي هو عندما يقبل خادمك العادي الطلبات الواردة ويمررها إلى خادم calibre. ثم يقرأ الاستجابة من خادم calibre ويعيد توجيهها إلى العميل. هذا يعني أنه يمكنك ببساطة تشغيل خادم calibre كالمعتاد دون محاولة دمجه عن كثب مع خادمك الرئيسي.
استخدام مضيف افتراضي كامل¶
أبسط تكوين هو تخصيص مضيف افتراضي كامل لخادم calibre. في هذه الحالة، قم بتشغيل خادم calibre كـ:
calibre-server
الآن قم بإعداد المضيف الافتراضي في خادمك الرئيسي، على سبيل المثال، لـ nginx:
http {
client_max_body_size 64M; # needed to upload large books
}
server {
listen [::]:80;
server_name myserver.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
أو، لـ Apache:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<VirtualHost *:80>
ServerName myserver.example.com
AllowEncodedSlashes On
ProxyPreserveHost On
ProxyPass "/" "http://localhost:8080/"
</VirtualHost>
استخدام بادئة URL¶
إذا كنت لا ترغب في تخصيص مضيف افتراضي كامل لـ calibre، يمكنك جعله يستخدم بادئة URL. ابدأ تشغيل خادم calibre كـ:
calibre-server --url-prefix /calibre --port 8080
المعلمة الرئيسية هنا هي --url-prefix /calibre. هذا يجعل خادم المحتوى يقوم بتقديم جميع عناوين URL التي تبدأ بـ /calibre. لرؤية هذا عمليًا، قم بزيارة http://localhost:8080/calibre في متصفحك. يجب أن ترى موقع خادم المحتوى العادي، ولكن الآن سيعمل تحت /calibre.
مع nginx، التكوين المطلوب هو:
http {
client_max_body_size 64M; # needed to upload large books
}
proxy_set_header X-Forwarded-For $remote_addr;
location /calibre/ {
proxy_buffering off;
proxy_pass http://127.0.0.1:8080$request_uri;
}
location /calibre {
# we need a trailing slash for the Application Cache to work
rewrite /calibre /calibre/ permanent;
}
بالنسبة لـ Apache، قم أولاً بتمكين وحدات الوكيل في Apache، عن طريق إضافة ما يلي إلى httpd.conf:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ستختلف الطريقة الدقيقة لتمكين وحدات الوكيل اعتمادًا على تثبيت Apache الخاص بك. بمجرد تمكين وحدات الوكيل، أضف القواعد التالية إلى httpd.conf (أو إذا كنت تستخدم مضيفات افتراضية إلى ملف التكوين للمضيف الافتراضي المعني):
AllowEncodedSlashes On
RewriteEngine on
RewriteRule ^/calibre/(.*) http://127.0.0.1:8080/calibre/$1 [proxy]
RedirectMatch permanent ^/calibre$ /calibre/
هذا كل شيء، ستتمكن الآن من الوصول إلى خادم محتوى calibre تحت عنوان URL /calibre في خادمك الرئيسي. القواعد المذكورة أعلاه تمرر جميع الطلبات تحت /calibre إلى خادم calibre الذي يعمل على المنفذ 8080 وبفضل خيار --url-prefix أعلاه، يتعامل خادم calibre معها بشفافية.
ملاحظة
عند استخدام وكيل عكسي، يجب أن تخبر خادم محتوى calibre بأن يستمع فقط على المضيف المحلي، باستخدام --listen-on 127.0.0.1. بهذه الطريقة، سيستمع الخادم فقط للاتصالات القادمة من نفس الكمبيوتر، أي من الوكيل العكسي.
ملاحظة
If you have set up SSL for your main server, you should tell the calibre
server to use basic authentication instead of digest authentication, as it
is faster. To do so, pass the --auth-mode=basic option to
calibre-server.
إنشاء خدمة لخادم calibre على نظام Linux حديث¶
يمكنك بسهولة إنشاء خدمة لتشغيل calibre عند الإقلاع على نظام Linux حديث يعتمد على (systemd <https://www.freedesktop.org/wiki/Software/systemd/>). ما عليك سوى إنشاء الملف /etc/systemd/system/calibre-server.service بالمحتويات الموضحة أدناه:
[Unit]
Description=calibre Content server
After=network.target
[Service]
Type=simple
User=mylinuxuser
Group=mylinuxgroup
ExecStart=/opt/calibre/calibre-server "/path/to/calibre library folder"
[Install]
WantedBy=multi-user.target
غيّر mylinuxuser و mylinuxgroup إلى أي مستخدم ومجموعة تريد أن يعمل الخادم بها. يجب أن يكون هذا هو نفس المستخدم والمجموعة اللذين يملكان الملفات في مجلد مكتبة calibre. لاحظ أنه ليس من الجيد عمومًا تشغيل الخادم كجذر. قم أيضًا بتغيير المسار إلى مجلد مكتبة calibre ليناسب نظامك. يمكنك إضافة مكتبات متعددة إذا لزم الأمر. راجع المساعدة لأمر calibre-server.
الآن قم بتشغيل:
sudo systemctl start calibre-server
لبدء تشغيل الخادم. تحقق من حالته باستخدام:
sudo systemctl status calibre-server
لجعله يبدأ عند الإقلاع، قم بتشغيل:
sudo systemctl enable calibre-server
ملاحظة
لا يحتاج خادم calibre إلى خادم X قيد التشغيل، ولكنه يحتاج إلى مكتبات X مثبتة حيث ترتبط بعض المكونات التي يستخدمها بها.
ملاحظة
يدعم خادم calibre أيضًا تفعيل مقبس systemd، لذا يمكنك استخدام ذلك، إذا لزم الأمر، أيضًا.
