> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/ar/aliadadat/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
services:
    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://overleaf-pro.ayaka.space/on-premises/ar/aliadadat/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.
