Repository navigation
Expand file tree
/
Copy pathserverk.yml
More file actions
396 lines (387 loc) · 13.9 KB
/
Copy pathserverk.yml
File metadata and controls
396 lines (387 loc) · 13.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# yaml-language-server: $schema=./serverk.schema.json
schemaVersion: serverk.gg/v1
kind: BotPackage
metadata:
id: bot-python
name:
ar: بوت بايثون
en: Python bot
description:
ar: اربط ريبو GitHub أو ارفع كود بوتك، ونتعرف على طريقة تشغيله تلقائيًا. أضف متغيراتك، وانشر بضغطة واحدة، ونثبّت المكتبات من requirements.txt في بيئة خاصة ببوتك، وتابع كل ما يطبعه لحظة بلحظة.
en: Link a GitHub repository or upload your bot's code, and we work out how to run it. Add your variables, deploy in one click, and we install the dependencies from requirements.txt into an environment of its own while you follow everything it prints, live.
tagline:
ar: أي بوت بـ Python، مع requirements.txt أو uv أو Poetry أو Pipfile، يُنشر من GitHub أو ملف zip
en: Any Python bot, with requirements.txt, uv, Poetry or Pipfile, deployed from GitHub or a zip
logo: assets/logo.webp
banner: assets/banner.webp
resources:
minMemoryMb: 512
recommendedMemoryMb: 1024
minDiskMb: 2048
container:
image: serverkgg/bot-python
runtime:
platform: linux
installBudgetMinutes: 15
bootBudgetMinutes: 15
shmMb: 64
pidsLimit: 256
ports:
- key: web
containerPort: 8080
protocol: tcp
web: true
hostRange:
default: 31000
min: 31000
max: 31999
activeWhen:
- variable: BOT_WEB
values:
- "on"
- key: port1
containerPort: 29000
protocol: tcp+udp
mirror: true
name:
ar: المنفذ 1
en: Port 1
hint:
ar: يستقبل TCP و UDP على الرقم نفسه، دون شهادة. ويقرأ بوتك رقمه من SERVERK_PORT_1.
en: Takes TCP and UDP on the same number, with no certificate. Your bot reads the number from SERVERK_PORT_1.
hostRange:
default: 29000
min: 29000
max: 29999
activeWhen:
- variable: BOT_PORT_1
values:
- "on"
- key: port2
containerPort: 30000
protocol: tcp+udp
mirror: true
name:
ar: المنفذ 2
en: Port 2
hint:
ar: يستقبل TCP و UDP على الرقم نفسه، دون شهادة. ويقرأ بوتك رقمه من SERVERK_PORT_2.
en: Takes TCP and UDP on the same number, with no certificate. Your bot reads the number from SERVERK_PORT_2.
hostRange:
default: 30000
min: 30000
max: 30999
activeWhen:
- variable: BOT_PORT_2
values:
- "on"
environment:
vault: true
backup:
except:
- "**/.venv/**"
- "**/__pycache__/**"
- .serverk/cache/**
- .serverk/history/**
- .serverk/snapshots/**
- .cache/**
- logs/**
- "**/*.log"
reset:
keep: []
files:
protected:
- .serverk/**
notable:
- match: requirements.txt
label:
ar: المكتبات
en: Requirements
icon: box
color: "#3776ab"
restart: true
note:
ar: المكتبات التي يحتاجها بوتك. نثبّت ما تغيّر منها تلقائيًا في كل نشر. حدّد الإصدارات بـ == حتى لا يتغيّر شيء فجأة.
en: The libraries your bot needs. We install whatever changed on every deploy. Pin versions with == so nothing changes unexpectedly.
- match: pyproject.toml
label:
ar: ملف المشروع
en: Project file
icon: box
color: "#3776ab"
restart: true
note:
ar: إذا لم يوجد requirements.txt ولا ملف قفل ولا Pipfile، نثبّت مشروعك من هنا بـ uv في كل نشر.
en: Without a requirements.txt, a lockfile or a Pipfile, we install your project from here with uv on every deploy.
- match: .env
label:
ar: المتغيرات
en: Environment
icon: settings
color: "#e0a458"
note:
ar: مكان المتغيرات صفحة المتغيرات في إعدادات بوتك، وليس هذا الملف. ما تضيفه هناك يصل إلى بوتك بالاسم نفسه، وتُحفظ القيم الحساسة مشفّرة.
en: Variables belong in your bot's settings, not here. Whatever you add there reaches your bot under the same name, and sensitive values are stored encrypted.
- match: serverk.json
label:
ar: إعدادات Serverk
en: Serverk settings
icon: settings
color: "#4cc9f0"
restart: true
note:
ar: وقت التشغيل والمنصة وأمر التثبيت وأمر التشغيل لبوتك. إذا وُجد الملف، نعتمد عليه بدلًا مما نكتشفه من الكود.
en: Your bot's runtime, platform, and install and start commands. When the file is there, it wins over what we detect from the code.
- match: .venv
label:
ar: بيئة بايثون
en: Python environment
icon: puzzle
color: "#ffd43b"
note:
ar: المكتبات المثبّتة لبوتك. لا تحتاج إلى تعديلها، وإذا تلفت فأعد تثبيتها من صفحة بوتك.
en: The libraries installed for your bot. You never need to touch them, and if they break, reinstall them from your bot's page.
guideTags:
- id: start
name:
ar: ابدأ من هنا
en: Start here
- id: deploy
name:
ar: النشر
en: Deploy
- id: tokens
name:
ar: التوكن والمتغيرات
en: Tokens and variables
- id: troubleshoot
name:
ar: حل المشاكل
en: Troubleshooting
guides:
- id: getting-started
title:
ar: شغّل بوتك أول مرة
en: Run your bot for the first time
summary:
ar: من صفحة واحدة إلى أول سطر يطبعه بوتك، خطوة بخطوة.
en: From one page to the first line your bot prints, step by step.
tags:
- start
surfaces:
- overview
bodyPath:
ar: guides/getting-started/ar.md
en: guides/getting-started/en.md
- id: environment-variables
title:
ar: أضف التوكن والمتغيرات
en: Add the token and your variables
summary:
ar: أين يوضع التوكن، وكيف يصل كل متغير إلى بوتك بالاسم نفسه.
en: Where the token goes, and how every variable reaches your bot under its own name.
tags:
- tokens
- start
surfaces:
- overview
- console
bodyPath:
ar: guides/environment-variables/ar.md
en: guides/environment-variables/en.md
- id: moving-in
title:
ar: انقل بوتك من استضافة أخرى
en: Move your bot in from another host
summary:
ar: من Replit و Discloud و Railway و Heroku واستضافات Pterodactyl و VPS، ما تحضره معك وما يتغيّر هنا.
en: From Replit, Discloud, Railway, Heroku, a Pterodactyl host or a VPS, what to bring and what changes here.
tags:
- start
- deploy
surfaces:
- overview
- files
bodyPath:
ar: guides/moving-in/ar.md
en: guides/moving-in/en.md
- id: connect-github
title:
ar: اربط بوتك بريبو GitHub
en: Link your bot to a GitHub repository
summary:
ar: كل push على الفرع ينشر بوتك تلقائيًا، والريبو الخاص مدعوم دون توكن.
en: Every push to the branch deploys your bot, and private repositories work without a token.
tags:
- deploy
surfaces:
- overview
- panel
bodyPath:
ar: guides/connect-github/ar.md
en: guides/connect-github/en.md
- id: deploy-button
title:
ar: أضف زر النشر إلى ريبو بوتك
en: Add a deploy button to your repository
summary:
ar: زر في README يفتح صفحة النشر على ريبو بوتك، لأي ريبو عام على GitHub.
en: A README button that opens the deploy page on your bot's repository, for any public GitHub repository.
tags:
- deploy
surfaces:
- overview
bodyPath:
ar: guides/deploy-button/ar.md
en: guides/deploy-button/en.md
- id: deployments
title:
ar: النشرات واسترجاع نشر سابق
en: Deployments and rolling back
summary:
ar: ما يحدث في كل نشر، وكيف ترجّع بوتك إلى آخر نشر كان شغّالًا.
en: What happens in each deployment, and how to roll your bot back to the last deployment that worked.
tags:
- deploy
surfaces:
- overview
- console
bodyPath:
ar: guides/deployments/ar.md
en: guides/deployments/en.md
- id: upload-zip
title:
ar: ارفع كود بوتك دون ريبو
en: Upload your bot's code without a repository
summary:
ar: ارفع مجلد بوتك أو ملف zip، وانشر إصدارًا جديدًا كلما عدّلت.
en: Upload your bot folder or a zip, and ship a new version whenever you change it.
tags:
- deploy
surfaces:
- files
- overview
bodyPath:
ar: guides/upload-zip/ar.md
en: guides/upload-zip/en.md
- id: upload-rules
title:
ar: قواعد رفع الكود
en: Upload rules
summary:
ar: المجلد أو ملف zip، والحدود، والمجلد الذي يغلّف الملفات، والملفات المخفية، وماذا يحدث لملف .env.
en: A folder or a zip, the limits, the folder around your files, hidden files, and what happens to .env.
tags:
- deploy
surfaces:
- files
- overview
bodyPath:
ar: guides/upload-rules/ar.md
en: guides/upload-rules/en.md
- id: project-shapes
title:
ar: كيف نثبّت مشروع بايثون ونشغّله
en: How we install and start a Python project
summary:
ar: requirements.txt و uv و Poetry و PDM و Pipfile، وإصدار بايثون، وترتيب أمر التشغيل حتى python -m، وأمر ما قبل النشر.
en: requirements.txt, uv, Poetry, PDM and Pipfile, the Python version, the start order down to python -m, and the pre-deploy command.
tags:
- deploy
surfaces:
- overview
- console
bodyPath:
ar: guides/project-shapes/ar.md
en: guides/project-shapes/en.md
- id: data-and-backups
title:
ar: بيانات بوتك والنسخ الاحتياطية
en: Your bot's data and backups
summary:
ar: ما يستبدله النشر والرفع واسترجاع نشر سابق أو نسخة احتياطية والريسيت من ملفات بوتك، وأين تحفظ بياناته لتبقى.
en: What a deployment, an upload, a rollback, a restore and a reset each replace in your bot folder, and where to keep your data so it stays.
tags:
- deploy
surfaces:
- backups
- files
- overview
bodyPath:
ar: guides/data-and-backups/ar.md
en: guides/data-and-backups/en.md
- id: web-address
title:
ar: عنوان الويب والمنافذ لبوتك
en: Your bot's web address and ports
summary:
ar: فعّل لبوتك عنوان HTTPS ومنفذين لـ TCP و UDP، لاستقبال الـ webhook من تيليقرام وتفاعلات ديسكورد وتقديم صفحاتك.
en: Turn on an HTTPS address and two TCP and UDP ports for your bot, for Telegram webhooks, Discord interactions and your own pages.
tags:
- deploy
surfaces:
- overview
- console
bodyPath:
ar: guides/web-address/ar.md
en: guides/web-address/en.md
- id: discord-token
title:
ar: توكن بوت ديسكورد والـ Intents والصلاحيات
en: Your Discord bot's token, intents and permissions
summary:
ar: من Developer Portal إلى التوكن في متغيرات بوتك، ثم الـ Intents التي يطلبها كودك، ورابط الإضافة والصلاحيات.
en: From the Developer Portal to the token in your variables, then the intents your code asks for, the invite link and the permissions.
tags:
- tokens
surfaces:
- overview
- panel
bodyPath:
ar: guides/discord-token/ar.md
en: guides/discord-token/en.md
- id: telegram-token
title:
ar: أين تجد توكن بوت تيليقرام
en: Where to find your Telegram bot token
summary:
ar: أنشئ بوتك من BotFather وأضف التوكن إلى متغيراته خلال دقيقة.
en: Create your bot with BotFather and put its token in your variables in a minute.
tags:
- tokens
surfaces:
- overview
- panel
bodyPath:
ar: guides/telegram-token/ar.md
en: guides/telegram-token/en.md
- id: read-the-logs
title:
ar: اقرأ الكونسول وافهم ما حدث
en: Read the console and work out what happened
summary:
ar: معنى سطور serverk، وكيف تجد سبب الخطأ عندما يفشل النشر أو يتعطّل بوتك.
en: What the serverk lines mean, and how to find the cause when a deployment fails or your bot crashes.
tags:
- troubleshoot
surfaces:
- console
- overview
bodyPath:
ar: guides/read-the-logs/ar.md
en: guides/read-the-logs/en.md
- id: errors
title:
ar: أخطاء بوتك وحلولها
en: Your bot's errors and how to fix them
summary:
ar: السطر الذي تطبعه المكتبة لكل سبب نعرفه، وما تفعله لتصلحه.
en: The line the library prints for every cause we name, and what to do to fix it.
tags:
- troubleshoot
surfaces:
- console
- overview
bodyPath:
ar: guides/errors/ar.md
en: guides/errors/en.md