> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ar/althyeh/overleaf-toolkit/redis.md).

# Redis

### تفعيل مصادقة كلمة المرور

إذا كنت تستخدم خدمة Redis خارجية وتحتاج إلى توفير كلمة مرور، فيمكنك القيام بذلك عن طريق تعيين `OVERLEAF_REDIS_PASS` و `REDIS_PASSWORD` متغيرات البيئة في **config/variables.env** الملف وتشغيل `bin/up -d` الأمر لإعادة إنشاء **sharelatex** الحاوية.

إذا كنت تشغّل مثيلًا محليًا من Redis، فستحتاج إلى تهيئة **redis** الخدمة لتبدأ مع مصادقة كلمة المرور. بعد ضبط متغيرات البيئة أعلاه، ستحتاج أيضًا إلى إكمال هذه الخطوات الإضافية:

أنشئ **docker-compose.override.yml** ملفًا في **الدليل config/** الدليل بالمحتوى التالي:

{% code title="config/docker-compose.override.yml" %}

```yaml
الخدمات:
    redis:
        الأمر: "redis-server --requirepass <YOUR-PASSWORD>"
```

{% endcode %}

{% hint style="warning" %}
إذا كانت ميزة الثبات AOF مفعلة، فستحتاج إلى إضافة `--appendonly yes` إلى `الأمر`.
{% endhint %}

نفّذ `bin/up -d` لإعادة إنشاء الحاويات.

### تفعيل الثبات باستخدام ملف الإلحاق فقط

(الأصل: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/redis#enabling-append-only-file-persistence>)

يوفّر ثبات Redis AOF (ملف الإلحاق فقط) طريقةً قوية لضمان ديمومة البيانات عبر تسجيل كل عملية كتابة يتلقاها الخادم. وعلى عكس لقطات RDB التي تلتقط نسخًا لحظية من مجموعة البيانات لديك، يحتفظ AOF بسجل كامل لجميع التغييرات التي أُجريت على بياناتك.

{% hint style="info" %}
تعطيل RDB اختياري. يُنصح عمومًا باستخدام طريقتَي الثبات معًا. قبل إجراء أي تغييرات في بيئة الإنتاج، راجع المزايا والعيوب عند تشغيل AOF وRDB معًا.
{% endhint %}

يمكنك قراءة المزيد حول تفعيل ثبات AOF في Redis هنا: <https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/#how-i-can-switch-to-aof-if-im-currently-using-dumprdb-snapshotsarrow-up-right>

1. جدول نافذة صيانة للترقية.
2. أوقف المثيل باستخدام `bin/stop` وقم بإنشاء نسخة احتياطية من **الدليل config/** و **data/** المجلدات.
3. نفّذ `bin/up` لبدء المثيل
4. نفّذ الأمر `docker exec -it redis sh`
5. نفّذ الأمر `redis-cli` لفتح واجهة سطر أوامر Redis
6. في redis-cli، نفّذ الأمر `config set appendonly yes`
7. الآن ستحتاج إلى الانتظار حتى تنتهي إعادة كتابة AOF من حفظ البيانات بشكل دائم. يمكنك القيام بذلك بكتابة `INFO persistence` في redis-cli والانتظار حتى يصبح `aof_rewrite_in_progress` و `aof_rewrite_scheduled` أن يكون `0`، والتحقق من أن `aof_last_bgrewrite_status` هو `ok`.
8. اخرج من redis-cli بكتابة `exit` وضغط مفتاح الإدخال
9. اخرج من حاوية redis بكتابة `exit` وضغط مفتاح الإدخال
10. نفّذ الأمر `ls ./data/redis` وتأكد من أنه يمكنك رؤية **appendonly.aof** الملف
11. حرّر **config/overleaf.rc** الملف وغيّر `REDIS_AOF_PERSISTENCE` متغير البيئة من `false` إلى `true`
12. نفّذ `bin/up -d` وتأكد من أن التطبيق يعمل (محرر المشروع ولوحة السجل يعملان بشكل صحيح).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/ar/althyeh/overleaf-toolkit/redis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
