fix
This commit is contained in:
parent
a607143392
commit
c4b20e21a7
@ -429,9 +429,9 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"%%bash\n",
|
"%%bash\n",
|
||||||
"docker pull redis:latest\n",
|
"docker pull gitea/gitea:1.22\n",
|
||||||
"docker tag redis:latest $REGISTRY_HOST/redis:latest\n",
|
"docker tag gitea/gitea:1.22 $REGISTRY_HOST/gitea/gitea:1.22\n",
|
||||||
"docker push $REGISTRY_HOST/redis:latest"
|
"docker push $REGISTRY_HOST/gitea/gitea:1.22"
|
||||||
],
|
],
|
||||||
"display_name": ".venv"
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
|
|||||||
194
k8s/gitea.yaml
194
k8s/gitea.yaml
@ -13,7 +13,7 @@ spec:
|
|||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 20Gi
|
storage: 10Gi
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@ -32,7 +32,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: gitea
|
- name: gitea
|
||||||
image: gitea/gitea:1.22
|
image: $REGISTRY_HOST/gitea/gitea:1.22
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000 # HTTP
|
- containerPort: 3000 # HTTP
|
||||||
- containerPort: 22 # SSH
|
- containerPort: 22 # SSH
|
||||||
@ -70,100 +70,96 @@ spec:
|
|||||||
targetPort: 22
|
targetPort: 22
|
||||||
nodePort: 30022
|
nodePort: 30022
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
---
|
# ---
|
||||||
kind: Ingress
|
# kind: Ingress
|
||||||
apiVersion: networking.k8s.io/v1
|
# apiVersion: networking.k8s.io/v1
|
||||||
metadata:
|
# metadata:
|
||||||
name: gitea
|
# name: gitea
|
||||||
namespace: gitea
|
# namespace: gitea
|
||||||
annotations:
|
# annotations:
|
||||||
cert-manager.io/cluster-issuer: letsencrypt
|
# cert-manager.io/cluster-issuer: google-public-ca
|
||||||
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
# nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
||||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
# nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||||
nginx.ingress.kubernetes.io/server-snippet: |
|
# spec:
|
||||||
if ($http_user_agent ~* "ClaudeBot") {
|
# ingressClassName: public
|
||||||
return 403;
|
# tls:
|
||||||
}
|
# - hosts:
|
||||||
spec:
|
# - git.kultmost.spiritofweb.ru
|
||||||
ingressClassName: public
|
# secretName: git-tls-cert
|
||||||
tls:
|
# rules:
|
||||||
- hosts:
|
# - host: git.kultmost.spiritofweb.ru
|
||||||
- git.spiritofweb.ru
|
# http:
|
||||||
secretName: git-tls-cert
|
# paths:
|
||||||
rules:
|
# - path: /
|
||||||
- host: git.spiritofweb.ru
|
# pathType: Prefix
|
||||||
http:
|
# backend:
|
||||||
paths:
|
# service:
|
||||||
- path: /
|
# name: gitea-ssh
|
||||||
pathType: Prefix
|
# port:
|
||||||
backend:
|
# number: 80
|
||||||
service:
|
# - path: /robots.txt
|
||||||
name: gitea-ssh
|
# pathType: Exact
|
||||||
port:
|
# backend:
|
||||||
number: 80
|
# service:
|
||||||
- path: /robots.txt
|
# name: robots-static-svc
|
||||||
pathType: Exact
|
# port:
|
||||||
backend:
|
# number: 80
|
||||||
service:
|
# ---
|
||||||
name: robots-static-svc
|
# apiVersion: v1
|
||||||
port:
|
# kind: ConfigMap
|
||||||
number: 80
|
# metadata:
|
||||||
---
|
# name: gitearobotscm
|
||||||
apiVersion: v1
|
# namespace: gitea
|
||||||
kind: ConfigMap
|
# data:
|
||||||
metadata:
|
# robots.txt: |
|
||||||
name: gitearobotscm
|
# User-agent: *
|
||||||
namespace: gitea
|
# Disallow: /
|
||||||
data:
|
# ---
|
||||||
robots.txt: |
|
# apiVersion: apps/v1
|
||||||
User-agent: *
|
# kind: Deployment
|
||||||
Disallow: /
|
# metadata:
|
||||||
---
|
# name: robots-static
|
||||||
apiVersion: apps/v1
|
# namespace: gitea
|
||||||
kind: Deployment
|
# spec:
|
||||||
metadata:
|
# replicas: 1
|
||||||
name: robots-static
|
# selector:
|
||||||
namespace: gitea
|
# matchLabels:
|
||||||
spec:
|
# app: robots-static
|
||||||
replicas: 1
|
# template:
|
||||||
selector:
|
# metadata:
|
||||||
matchLabels:
|
# labels:
|
||||||
app: robots-static
|
# app: robots-static
|
||||||
template:
|
# spec:
|
||||||
metadata:
|
# containers:
|
||||||
labels:
|
# - name: nginx
|
||||||
app: robots-static
|
# image: nginx:alpine
|
||||||
spec:
|
# ports:
|
||||||
containers:
|
# - containerPort: 80
|
||||||
- name: nginx
|
# volumeMounts:
|
||||||
image: nginx:alpine
|
# - name: robots
|
||||||
ports:
|
# mountPath: /usr/share/nginx/html
|
||||||
- containerPort: 80
|
# volumes:
|
||||||
volumeMounts:
|
# - name: robots
|
||||||
- name: robots
|
# configMap:
|
||||||
mountPath: /usr/share/nginx/html
|
# name: gitearobotscm
|
||||||
volumes:
|
# ---
|
||||||
- name: robots
|
# apiVersion: v1
|
||||||
configMap:
|
# kind: Service
|
||||||
name: gitearobotscm
|
# metadata:
|
||||||
---
|
# name: robots-static-svc
|
||||||
apiVersion: v1
|
# namespace: gitea
|
||||||
kind: Service
|
# spec:
|
||||||
metadata:
|
# selector:
|
||||||
name: robots-static-svc
|
# app: robots-static
|
||||||
namespace: gitea
|
# ports:
|
||||||
spec:
|
# - port: 80
|
||||||
selector:
|
# targetPort: 80
|
||||||
app: robots-static
|
# ---
|
||||||
ports:
|
# apiVersion: v1
|
||||||
- port: 80
|
# kind: Secret
|
||||||
targetPort: 80
|
# metadata:
|
||||||
---
|
# name: ssh-creds
|
||||||
apiVersion: v1
|
# type: Opaque
|
||||||
kind: Secret
|
# stringData:
|
||||||
metadata:
|
# username: "root"
|
||||||
name: ssh-creds
|
# password: "$ROOT_PASS"
|
||||||
type: Opaque
|
|
||||||
stringData:
|
|
||||||
username: "root"
|
|
||||||
password: "$ROOT_PASS"
|
|
||||||
|
|||||||
@ -3491,7 +3491,7 @@
|
|||||||
" \"serviceSocial\": payload.serviceSocial,\n",
|
" \"serviceSocial\": payload.serviceSocial,\n",
|
||||||
" \"userSocial\": payload.userSocial,\n",
|
" \"userSocial\": payload.userSocial,\n",
|
||||||
" \"short_desc\": safe_strip(payload.short_desc) if payload.short_desc else None,\n",
|
" \"short_desc\": safe_strip(payload.short_desc) if payload.short_desc else None,\n",
|
||||||
" \"poster_file_id\": po/api/restorster_id,\n",
|
" \"poster_file_id\": poster_id,\n",
|
||||||
" \"poster_orig_id\": poster_id,\n",
|
" \"poster_orig_id\": poster_id,\n",
|
||||||
" \"rules_file_id\": rules_id,\n",
|
" \"rules_file_id\": rules_id,\n",
|
||||||
" \"rules_link\": payload.rules_link,\n",
|
" \"rules_link\": payload.rules_link,\n",
|
||||||
|
|||||||
2
main.py
2
main.py
@ -2608,7 +2608,7 @@ async def post_competition(
|
|||||||
"serviceSocial": payload.serviceSocial,
|
"serviceSocial": payload.serviceSocial,
|
||||||
"userSocial": payload.userSocial,
|
"userSocial": payload.userSocial,
|
||||||
"short_desc": safe_strip(payload.short_desc) if payload.short_desc else None,
|
"short_desc": safe_strip(payload.short_desc) if payload.short_desc else None,
|
||||||
"poster_file_id": po/api/restorster_id,
|
"poster_file_id": poster_id,
|
||||||
"poster_orig_id": poster_id,
|
"poster_orig_id": poster_id,
|
||||||
"rules_file_id": rules_id,
|
"rules_file_id": rules_id,
|
||||||
"rules_link": payload.rules_link,
|
"rules_link": payload.rules_link,
|
||||||
|
|||||||
55
tasks.ipynb
55
tasks.ipynb
@ -38,7 +38,8 @@
|
|||||||
" load_env('env')\n",
|
" load_env('env')\n",
|
||||||
"except:\n",
|
"except:\n",
|
||||||
" load_env('env_example')"
|
" load_env('env_example')"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -57,7 +58,8 @@
|
|||||||
"from models import NotifyItem\n",
|
"from models import NotifyItem\n",
|
||||||
"from auth import token_create\n",
|
"from auth import token_create\n",
|
||||||
"import asyncio\n"
|
"import asyncio\n"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -88,7 +90,8 @@
|
|||||||
" },\n",
|
" },\n",
|
||||||
" upsert=True,\n",
|
" upsert=True,\n",
|
||||||
" )\n"
|
" )\n"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -117,7 +120,8 @@
|
|||||||
" 'login_link': login_link,\n",
|
" 'login_link': login_link,\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" 'Новая картина', 'main.html')\n"
|
" 'Новая картина', 'main.html')\n"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -128,7 +132,8 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"async def update_social_post(post):\n",
|
"async def update_social_post(post):\n",
|
||||||
" pass"
|
" pass"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -167,7 +172,8 @@
|
|||||||
" attachments = [a for a in get_attachments(social) if a is not None]\n",
|
" attachments = [a for a in get_attachments(social) if a is not None]\n",
|
||||||
" \n",
|
" \n",
|
||||||
" client.notify.delay(post_ref, text, attachments, bson_clear(social), sign_avatar)"
|
" client.notify.delay(post_ref, text, attachments, bson_clear(social), sign_avatar)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -183,7 +189,8 @@
|
|||||||
" pass\n",
|
" pass\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" print(competition)"
|
" print(competition)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -411,7 +418,8 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"# async def service_social_news(news: Dict, **kwargs):\n",
|
"# async def service_social_news(news: Dict, **kwargs):\n",
|
||||||
"# return await service_social_publish(\"news\", news, **kwargs)"
|
"# return await service_social_publish(\"news\", news, **kwargs)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -459,7 +467,8 @@
|
|||||||
" if already_sent:\n",
|
" if already_sent:\n",
|
||||||
" print(social)\n",
|
" print(social)\n",
|
||||||
" client.notify.delay(post_ref, text, attachments, bson_clear(social), False)"
|
" client.notify.delay(post_ref, text, attachments, bson_clear(social), False)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -512,7 +521,8 @@
|
|||||||
" if already_sent:\n",
|
" if already_sent:\n",
|
||||||
" print(social)\n",
|
" print(social)\n",
|
||||||
" client.notify.delay(post_ref, text, attachments, bson_clear(social), False)"
|
" client.notify.delay(post_ref, text, attachments, bson_clear(social), False)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -538,7 +548,8 @@
|
|||||||
" 'login_link': login_link\n",
|
" 'login_link': login_link\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" 'Новый пользователь', 'main.html')"
|
" 'Новый пользователь', 'main.html')"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -584,7 +595,8 @@
|
|||||||
" if PROD:\n",
|
" if PROD:\n",
|
||||||
" email_task.notify.delay(user['email'], {'competition': bson_clear(doc), 'login_link': f'{FULL_DOMAIN}/login/{await token_create(str(user['_id']), url=f'/competition/{doc.get(\"id\") or doc.get(\"_id\")}')}'}, 'Конкурс', 'competition.html')\n",
|
" email_task.notify.delay(user['email'], {'competition': bson_clear(doc), 'login_link': f'{FULL_DOMAIN}/login/{await token_create(str(user['_id']), url=f'/competition/{doc.get(\"id\") or doc.get(\"_id\")}')}'}, 'Конкурс', 'competition.html')\n",
|
||||||
" await asyncio.gather(*new_notify)"
|
" await asyncio.gather(*new_notify)"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -606,7 +618,8 @@
|
|||||||
" },\n",
|
" },\n",
|
||||||
" 'Приглашение', 'main.html')\n",
|
" 'Приглашение', 'main.html')\n",
|
||||||
" await notify_in_profile(NotifyItem(user_id=user_id, type_item='invation', title='Приглашение', link='/profile/invitation', text=f'Вы прошли отбор на конкурсе {competition['title']}'))\n"
|
" await notify_in_profile(NotifyItem(user_id=user_id, type_item='invation', title='Приглашение', link='/profile/invitation', text=f'Вы прошли отбор на конкурсе {competition['title']}'))\n"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -627,7 +640,8 @@
|
|||||||
" delivery = await delivery_cursor.limit(1).to_list(length=1)\n",
|
" delivery = await delivery_cursor.limit(1).to_list(length=1)\n",
|
||||||
" delivery = delivery[0] if delivery else {}\n",
|
" delivery = delivery[0] if delivery else {}\n",
|
||||||
" return delivery.get('receiver')"
|
" return delivery.get('receiver')"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -672,7 +686,8 @@
|
|||||||
" link=f'/profile/delivery',\n",
|
" link=f'/profile/delivery',\n",
|
||||||
" text=f'Художник принял условия'\n",
|
" text=f'Художник принял условия'\n",
|
||||||
" ))"
|
" ))"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -774,7 +789,8 @@
|
|||||||
" 'main.html'\n",
|
" 'main.html'\n",
|
||||||
" )\n",
|
" )\n",
|
||||||
" \n"
|
" \n"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -815,6 +831,7 @@
|
|||||||
" },{\n",
|
" },{\n",
|
||||||
" \"$set\":{\n",
|
" \"$set\":{\n",
|
||||||
" \"sender\": sender,\n",
|
" \"sender\": sender,\n",
|
||||||
|
" \"user\": display_user(user),\n",
|
||||||
" \"receiver\": display_user(competition_owner),\n",
|
" \"receiver\": display_user(competition_owner),\n",
|
||||||
" \"competition_id\": competition_id,\n",
|
" \"competition_id\": competition_id,\n",
|
||||||
" \"address\": competition.get('address'),\n",
|
" \"address\": competition.get('address'),\n",
|
||||||
@ -879,7 +896,8 @@
|
|||||||
" 'Обновление статуса заявки на конкурс',\n",
|
" 'Обновление статуса заявки на конкурс',\n",
|
||||||
" 'main.html'\n",
|
" 'main.html'\n",
|
||||||
" )"
|
" )"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@ -913,7 +931,8 @@
|
|||||||
" 'login_link': login_link\n",
|
" 'login_link': login_link\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" 'Новая заявка на конкурс', 'main.html')"
|
" 'Новая заявка на конкурс', 'main.html')"
|
||||||
]
|
],
|
||||||
|
"display_name": ".venv"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
1
tasks.py
1
tasks.py
@ -651,6 +651,7 @@ async def update_competition_req(competition, user, posts):
|
|||||||
},{
|
},{
|
||||||
"$set":{
|
"$set":{
|
||||||
"sender": sender,
|
"sender": sender,
|
||||||
|
"user": display_user(user),
|
||||||
"receiver": display_user(competition_owner),
|
"receiver": display_user(competition_owner),
|
||||||
"competition_id": competition_id,
|
"competition_id": competition_id,
|
||||||
"address": competition.get('address'),
|
"address": competition.get('address'),
|
||||||
|
|||||||
@ -101,7 +101,7 @@
|
|||||||
{{ profile_nav.profile_nav(user, 'delivery') }}
|
{{ profile_nav.profile_nav(user, 'delivery') }}
|
||||||
<div class="c_tihtk" id="main">
|
<div class="c_tihtk" id="main">
|
||||||
{% set statuses = ['Ожидает отправки', 'Возврат художнику'] %}
|
{% set statuses = ['Ожидает отправки', 'Возврат художнику'] %}
|
||||||
{% if data | selectattr('status', 'in', statuses) | list | length > 0 %}
|
|
||||||
<article class="c_9fgdh b_ax8vz">
|
<article class="c_9fgdh b_ax8vz">
|
||||||
<div class="c_z3dpx b_73p10">
|
<div class="c_z3dpx b_73p10">
|
||||||
<header class="c_m876y b_9xtz9">
|
<header class="c_m876y b_9xtz9">
|
||||||
@ -117,7 +117,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<label for="exhibition_id" class="c_z3ybu floating-label">Выставка</label>
|
<label for="exhibition_id" class="c_z3ybu floating-label">Выставка</label>
|
||||||
</div>
|
</div>
|
||||||
|
{% if data | selectattr('status', 'in', statuses) | list | length > 0 %}
|
||||||
<header class="c_m876y b_9xtz9">
|
<header class="c_m876y b_9xtz9">
|
||||||
<h3 class="b_8f3uh">Настройки отправки</h3>
|
<h3 class="b_8f3uh">Настройки отправки</h3>
|
||||||
</header>
|
</header>
|
||||||
@ -136,9 +136,10 @@
|
|||||||
<label for="track" class="c_z3ybu floating-label">Трэк-номер</label>
|
<label for="track" class="c_z3ybu floating-label">Трэк-номер</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for doc in data if doc.status in statuses %}
|
{% for doc in data if doc.status in statuses %}
|
||||||
{{ render_doc(doc) }}
|
{{ render_doc(doc) }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user