diff --git a/build.ipynb b/build.ipynb index 9e3b518..3a22959 100644 --- a/build.ipynb +++ b/build.ipynb @@ -429,9 +429,9 @@ "outputs": [], "source": [ "%%bash\n", - "docker pull redis:latest\n", - "docker tag redis:latest $REGISTRY_HOST/redis:latest\n", - "docker push $REGISTRY_HOST/redis:latest" + "docker pull gitea/gitea:1.22\n", + "docker tag gitea/gitea:1.22 $REGISTRY_HOST/gitea/gitea:1.22\n", + "docker push $REGISTRY_HOST/gitea/gitea:1.22" ], "display_name": ".venv" }, diff --git a/k8s/gitea.yaml b/k8s/gitea.yaml index a1cbf04..50434df 100644 --- a/k8s/gitea.yaml +++ b/k8s/gitea.yaml @@ -13,7 +13,7 @@ spec: - ReadWriteOnce resources: requests: - storage: 20Gi + storage: 10Gi --- apiVersion: apps/v1 kind: Deployment @@ -32,7 +32,7 @@ spec: spec: containers: - name: gitea - image: gitea/gitea:1.22 + image: $REGISTRY_HOST/gitea/gitea:1.22 ports: - containerPort: 3000 # HTTP - containerPort: 22 # SSH @@ -70,100 +70,96 @@ spec: targetPort: 22 nodePort: 30022 type: LoadBalancer ---- -kind: Ingress -apiVersion: networking.k8s.io/v1 -metadata: - name: gitea - namespace: gitea - annotations: - cert-manager.io/cluster-issuer: letsencrypt - nginx.ingress.kubernetes.io/proxy-body-size: "0" - nginx.ingress.kubernetes.io/ssl-redirect: "true" - nginx.ingress.kubernetes.io/server-snippet: | - if ($http_user_agent ~* "ClaudeBot") { - return 403; - } -spec: - ingressClassName: public - tls: - - hosts: - - git.spiritofweb.ru - secretName: git-tls-cert - rules: - - host: git.spiritofweb.ru - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: gitea-ssh - port: - number: 80 - - path: /robots.txt - pathType: Exact - backend: - service: - name: robots-static-svc - port: - number: 80 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: gitearobotscm - namespace: gitea -data: - robots.txt: | - User-agent: * - Disallow: / ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: robots-static - namespace: gitea -spec: - replicas: 1 - selector: - matchLabels: - app: robots-static - template: - metadata: - labels: - app: robots-static - spec: - containers: - - name: nginx - image: nginx:alpine - ports: - - containerPort: 80 - volumeMounts: - - name: robots - mountPath: /usr/share/nginx/html - volumes: - - name: robots - configMap: - name: gitearobotscm ---- -apiVersion: v1 -kind: Service -metadata: - name: robots-static-svc - namespace: gitea -spec: - selector: - app: robots-static - ports: - - port: 80 - targetPort: 80 ---- -apiVersion: v1 -kind: Secret -metadata: - name: ssh-creds -type: Opaque -stringData: - username: "root" - password: "$ROOT_PASS" +# --- +# kind: Ingress +# apiVersion: networking.k8s.io/v1 +# metadata: +# name: gitea +# namespace: gitea +# annotations: +# cert-manager.io/cluster-issuer: google-public-ca +# nginx.ingress.kubernetes.io/proxy-body-size: "0" +# nginx.ingress.kubernetes.io/ssl-redirect: "true" +# spec: +# ingressClassName: public +# tls: +# - hosts: +# - git.kultmost.spiritofweb.ru +# secretName: git-tls-cert +# rules: +# - host: git.kultmost.spiritofweb.ru +# http: +# paths: +# - path: / +# pathType: Prefix +# backend: +# service: +# name: gitea-ssh +# port: +# number: 80 +# - path: /robots.txt +# pathType: Exact +# backend: +# service: +# name: robots-static-svc +# port: +# number: 80 +# --- +# apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: gitearobotscm +# namespace: gitea +# data: +# robots.txt: | +# User-agent: * +# Disallow: / +# --- +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: robots-static +# namespace: gitea +# spec: +# replicas: 1 +# selector: +# matchLabels: +# app: robots-static +# template: +# metadata: +# labels: +# app: robots-static +# spec: +# containers: +# - name: nginx +# image: nginx:alpine +# ports: +# - containerPort: 80 +# volumeMounts: +# - name: robots +# mountPath: /usr/share/nginx/html +# volumes: +# - name: robots +# configMap: +# name: gitearobotscm +# --- +# apiVersion: v1 +# kind: Service +# metadata: +# name: robots-static-svc +# namespace: gitea +# spec: +# selector: +# app: robots-static +# ports: +# - port: 80 +# targetPort: 80 +# --- +# apiVersion: v1 +# kind: Secret +# metadata: +# name: ssh-creds +# type: Opaque +# stringData: +# username: "root" +# password: "$ROOT_PASS" diff --git a/main.ipynb b/main.ipynb index d614b06..485c0f6 100644 --- a/main.ipynb +++ b/main.ipynb @@ -3491,7 +3491,7 @@ " \"serviceSocial\": payload.serviceSocial,\n", " \"userSocial\": payload.userSocial,\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", " \"rules_file_id\": rules_id,\n", " \"rules_link\": payload.rules_link,\n", diff --git a/main.py b/main.py index b54cc5a..1f50f5a 100644 --- a/main.py +++ b/main.py @@ -2608,7 +2608,7 @@ async def post_competition( "serviceSocial": payload.serviceSocial, "userSocial": payload.userSocial, "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, "rules_file_id": rules_id, "rules_link": payload.rules_link, diff --git a/tasks.ipynb b/tasks.ipynb index f8b048d..af4ec8d 100644 --- a/tasks.ipynb +++ b/tasks.ipynb @@ -38,7 +38,8 @@ " load_env('env')\n", "except:\n", " load_env('env_example')" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -57,7 +58,8 @@ "from models import NotifyItem\n", "from auth import token_create\n", "import asyncio\n" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -88,7 +90,8 @@ " },\n", " upsert=True,\n", " )\n" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -117,7 +120,8 @@ " 'login_link': login_link,\n", " },\n", " 'Новая картина', 'main.html')\n" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -128,7 +132,8 @@ "source": [ "async def update_social_post(post):\n", " pass" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -167,7 +172,8 @@ " attachments = [a for a in get_attachments(social) if a is not None]\n", " \n", " client.notify.delay(post_ref, text, attachments, bson_clear(social), sign_avatar)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -183,7 +189,8 @@ " pass\n", " else:\n", " print(competition)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -411,7 +418,8 @@ "\n", "# async def service_social_news(news: Dict, **kwargs):\n", "# return await service_social_publish(\"news\", news, **kwargs)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -459,7 +467,8 @@ " if already_sent:\n", " print(social)\n", " client.notify.delay(post_ref, text, attachments, bson_clear(social), False)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -512,7 +521,8 @@ " if already_sent:\n", " print(social)\n", " client.notify.delay(post_ref, text, attachments, bson_clear(social), False)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -538,7 +548,8 @@ " 'login_link': login_link\n", " },\n", " 'Новый пользователь', 'main.html')" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -584,7 +595,8 @@ " 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", " await asyncio.gather(*new_notify)" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -606,7 +618,8 @@ " },\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" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -627,7 +640,8 @@ " delivery = await delivery_cursor.limit(1).to_list(length=1)\n", " delivery = delivery[0] if delivery else {}\n", " return delivery.get('receiver')" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -672,7 +686,8 @@ " link=f'/profile/delivery',\n", " text=f'Художник принял условия'\n", " ))" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -774,7 +789,8 @@ " 'main.html'\n", " )\n", " \n" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -815,6 +831,7 @@ " },{\n", " \"$set\":{\n", " \"sender\": sender,\n", + " \"user\": display_user(user),\n", " \"receiver\": display_user(competition_owner),\n", " \"competition_id\": competition_id,\n", " \"address\": competition.get('address'),\n", @@ -879,7 +896,8 @@ " 'Обновление статуса заявки на конкурс',\n", " 'main.html'\n", " )" - ] + ], + "display_name": ".venv" }, { "cell_type": "code", @@ -913,7 +931,8 @@ " 'login_link': login_link\n", " },\n", " 'Новая заявка на конкурс', 'main.html')" - ] + ], + "display_name": ".venv" } ], "metadata": { diff --git a/tasks.py b/tasks.py index f3e2c97..211e064 100644 --- a/tasks.py +++ b/tasks.py @@ -651,6 +651,7 @@ async def update_competition_req(competition, user, posts): },{ "$set":{ "sender": sender, + "user": display_user(user), "receiver": display_user(competition_owner), "competition_id": competition_id, "address": competition.get('address'), diff --git a/templates/profile/delivery.html b/templates/profile/delivery.html index 55d2928..0194d65 100644 --- a/templates/profile/delivery.html +++ b/templates/profile/delivery.html @@ -101,7 +101,7 @@ {{ profile_nav.profile_nav(user, 'delivery') }}
{% set statuses = ['Ожидает отправки', 'Возврат художнику'] %} -{% if data | selectattr('status', 'in', statuses) | list | length > 0 %} +
@@ -117,7 +117,7 @@
- + {% if data | selectattr('status', 'in', statuses) | list | length > 0 %}

Настройки отправки

@@ -136,9 +136,10 @@
+ {% endif %} -{% endif %} + {% for doc in data if doc.status in statuses %} {{ render_doc(doc) }}