mirror of
https://github.com/snoups/remnashop.git
synced 2026-04-18 00:44:01 +00:00
- renamed gateway settings DTOs to proper casing (YooKassa, YooMoney, CryptoPay, RoboKassa) - added migration 0019: remove CryptoPay secret_key field and set owner role - added separate SubscriptionExpiredAgoEvent, fixed EXPIRED_24_HOURS_AGO handling - fixed UserFirstConnectionEvent event key and added as_payload method with user redirect keyboard - added MenuEditorInvalidPayloadError with validation in ConfirmMenuButtonChanges - added rules_getter and channel_getter with current values display in access dialog - added back-to-plans button on payment method and confirm screens - fixed subscription getter: null check for raw_plan before retort.load - fixed has_device_limit: now accounts for device_limit == 0 (to show devices button when device limit is unlimited) - fixed broadcast preview check for empty content - fixed error middleware: handle TelegramForbiddenError and show unknown error notification - fixed plan-not-found: use i18n notifier instead of raw message.answer - fixed currency serialization via .value in MulenPay, UrlPay, Wata, PayMaster, CryptoPay - fixed MulenPay amount formatting via Decimal.quantize - fixed duplicate update available notification - refactored Makefile: split run/migration/migrate targets into local and prod variants - bumped version to 0.7.2
84 lines
2.7 KiB
Makefile
84 lines
2.7 KiB
Makefile
ALEMBIC_INI=src/infrastructure/database/alembic.ini
|
|
DATABASE_HOST ?= 0.0.0.0
|
|
DATABASE_PORT ?= 6767
|
|
|
|
LOCAL_DB_ENV := DATABASE_HOST=$(DATABASE_HOST) DATABASE_PORT=$(DATABASE_PORT)
|
|
|
|
RESET := $(filter reset,$(MAKECMDGOALS))
|
|
|
|
.PHONY: setup-env
|
|
setup-env:
|
|
@sed -i '' "s|^APP_CRYPT_KEY=.*|APP_CRYPT_KEY=$(shell openssl rand -base64 32 | tr -d '\n')|" .env
|
|
@sed -i '' "s|^BOT_SECRET_TOKEN=.*|BOT_SECRET_TOKEN=$(shell openssl rand -hex 64 | tr -d '\n')|" .env
|
|
@sed -i '' "s|^DATABASE_PASSWORD=.*|DATABASE_PASSWORD=$(shell openssl rand -hex 24 | tr -d '\n')|" .env
|
|
@sed -i '' "s|^REDIS_PASSWORD=.*|REDIS_PASSWORD=$(shell openssl rand -hex 24 | tr -d '\n')|" .env
|
|
@echo "Secrets updated. Check your .env file"
|
|
|
|
# ── Run ────────────────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: run
|
|
run: _run_local
|
|
|
|
.PHONY: run-local
|
|
run-local: _run_local
|
|
|
|
.PHONY: run-prod
|
|
run-prod: _run_prod
|
|
|
|
.PHONY: _run_local
|
|
_run_local:
|
|
ifneq ($(RESET),)
|
|
@docker compose -f docker-compose.local.yml down -v
|
|
endif
|
|
@docker compose -f docker-compose.local.yml up --build
|
|
@docker compose logs -f
|
|
|
|
.PHONY: _run_prod
|
|
_run_prod:
|
|
ifneq ($(RESET),)
|
|
@docker compose -f docker-compose.prod.external.yml down -v
|
|
endif
|
|
@docker compose -f docker-compose.prod.external.yml up --build
|
|
@docker compose logs -f
|
|
|
|
# ── Migrations ─────────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: migration
|
|
migration:
|
|
alembic -c $(ALEMBIC_INI) revision --autogenerate
|
|
|
|
.PHONY: migration-local
|
|
migration-local:
|
|
$(LOCAL_DB_ENV) alembic -c $(ALEMBIC_INI) revision --autogenerate
|
|
|
|
.PHONY: migrate
|
|
migrate:
|
|
alembic -c $(ALEMBIC_INI) upgrade head
|
|
|
|
.PHONY: migrate-local
|
|
migrate-local:
|
|
$(LOCAL_DB_ENV) alembic -c $(ALEMBIC_INI) upgrade head
|
|
|
|
.PHONY: downgrade
|
|
downgrade:
|
|
@if [ -z "$(rev)" ]; then \
|
|
echo "No revision specified. Downgrading by 1 step."; \
|
|
alembic -c $(ALEMBIC_INI) downgrade -1; \
|
|
else \
|
|
alembic -c $(ALEMBIC_INI) downgrade $(rev); \
|
|
fi
|
|
|
|
.PHONY: downgrade-local
|
|
downgrade-local:
|
|
@if [ -z "$(rev)" ]; then \
|
|
echo "No revision specified. Downgrading by 1 step."; \
|
|
$(LOCAL_DB_ENV) alembic -c $(ALEMBIC_INI) downgrade -1; \
|
|
else \
|
|
$(LOCAL_DB_ENV) alembic -c $(ALEMBIC_INI) downgrade $(rev); \
|
|
fi
|
|
|
|
# ── Misc ───────────────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: reset
|
|
reset:
|
|
@:
|