Il programma si chiama Mimante, con le convenzioni di Febe (#23)
Il prodotto prende il nome del repository, come chiesto per allineare la struttura agli altri progetti: soluzione Mimante.slnx, progetti src/Mimante, tests/Mimante.Tests e tools/Mimante.Schermate, spazi dei nomi Mimante.*, immagine alby96/mimante, modello docker/unraid/mimante.xml, compose in docker/, documenti in minuscolo (stato.md, architettura.md, come-funziona.md, schermate/), versioni dei pacchetti in Directory.Packages.props. Versione 2.0.0. Non cambiano database, tabelle, variabili d'ambiente, /config, chiave della sessione e riferimenti del sito: bidoo.default.json è identico e i nomi logici delle risorse incorporate restano quelli che le migrazioni cercano. divSaldoBidBottom è l'id di Bidoo. Compatibilità: il cookie dell'interfaccia diventa mimante_sessione (un accesso in più per browser dopo l'aggiornamento); le preferenze del browser passano da bidbot.* a mimante.* con una copia una tantum. Corretto anche il tema della pagina d'accesso, che leggeva il valore salvato senza togliere le virgolette del JSON. Tolto il codice non compilato: il riferimento del riscatto (lo sostituisce il riscatto nuovo) e il formato SQLite della versione desktop (ora la issue #31); sono leggibili al tag v1.2.0. Nuovi docs/processo.md, docs/decisioni.md, docs/docker.md (con i passi per sostituire il container su Unraid) e ADR 0014. Il Dockerfile copia Directory.Packages.props e .dockerignore esclude dati/. Build con gli avvisi come errori; 288 test verdi, i 14 sul database saltati perché Docker Desktop su questo PC non parte: girano nella CI con il suo PostgreSQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
650ccea844
commit
9d89624434
216 files changed
+884
-6493
No files matched your search
+15
-15
@@ -1,9 +1,9 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
#
|
||||
# Bidoo BidBot: un solo container con motore, interfaccia web e Chromium per l'accesso
|
||||
# Mimante: un solo container con motore, interfaccia web e Chromium per l'accesso
|
||||
# assistito a Bidoo.
|
||||
#
|
||||
# docker build -f docker/Dockerfile --build-arg VERSION=1.0.0 --build-arg GIT_COMMIT=$(git rev-parse --short=12 HEAD) -t bidoo-bidbot:1.0.0 .
|
||||
# docker build -f docker/Dockerfile --build-arg VERSION=2.0.0 --build-arg GIT_COMMIT=$(git rev-parse --short=12 HEAD) -t mimante:2.0.0 .
|
||||
#
|
||||
# Stadi: build (restore + compilazione), test (i test di logica pura; quelli su PostgreSQL
|
||||
# saltano da soli senza TEST_DB_HOST), publish (ReadyToRun per linux-x64), runtime.
|
||||
@@ -19,26 +19,26 @@ ARG DOTNET_VERSION=10.0
|
||||
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY Directory.Build.props BidooBidBot.sln ./
|
||||
COPY src/BidooBidBot/BidooBidBot.csproj src/BidooBidBot/
|
||||
COPY tests/BidooBidBot.Tests/BidooBidBot.Tests.csproj tests/BidooBidBot.Tests/
|
||||
RUN dotnet restore src/BidooBidBot/BidooBidBot.csproj -r linux-x64 \
|
||||
&& dotnet restore tests/BidooBidBot.Tests/BidooBidBot.Tests.csproj
|
||||
COPY Directory.Build.props Directory.Packages.props Mimante.slnx ./
|
||||
COPY src/Mimante/Mimante.csproj src/Mimante/
|
||||
COPY tests/Mimante.Tests/Mimante.Tests.csproj tests/Mimante.Tests/
|
||||
RUN dotnet restore src/Mimante/Mimante.csproj -r linux-x64 \
|
||||
&& dotnet restore tests/Mimante.Tests/Mimante.Tests.csproj
|
||||
|
||||
COPY src/ src/
|
||||
COPY tests/ tests/
|
||||
RUN dotnet build tests/BidooBidBot.Tests/BidooBidBot.Tests.csproj -c Release --no-restore -nologo
|
||||
RUN dotnet build tests/Mimante.Tests/Mimante.Tests.csproj -c Release --no-restore -nologo
|
||||
|
||||
# ─────────────────────────────────────────────────────────────── test
|
||||
FROM build AS test
|
||||
RUN dotnet test tests/BidooBidBot.Tests/BidooBidBot.Tests.csproj -c Release --no-build --nologo -v q \
|
||||
RUN dotnet test tests/Mimante.Tests/Mimante.Tests.csproj -c Release --no-build --nologo -v q \
|
||||
&& touch /tmp/test-ok
|
||||
|
||||
# ─────────────────────────────────────────────────────────────── publish
|
||||
FROM build AS publish
|
||||
# La publish parte solo con i test verdi.
|
||||
COPY --from=test /tmp/test-ok /tmp/test-ok
|
||||
RUN dotnet publish src/BidooBidBot/BidooBidBot.csproj -c Release -r linux-x64 --self-contained false \
|
||||
RUN dotnet publish src/Mimante/Mimante.csproj -c Release -r linux-x64 --self-contained false \
|
||||
-p:PublishReadyToRun=true -nologo -o /app
|
||||
|
||||
# ─────────────────────────────────────────────────────────────── runtime ASP.NET
|
||||
@@ -49,12 +49,12 @@ FROM debian:trixie-slim AS runtime
|
||||
ARG VERSION=dev
|
||||
ARG GIT_COMMIT=n/d
|
||||
|
||||
LABEL org.opencontainers.image.title="bidoo-bidbot" \
|
||||
org.opencontainers.image.description="Bidoo BidBot: segue le aste al centesimo di Bidoo, decide con un modello appreso se puntare. Parte in modalità OSSERVA." \
|
||||
LABEL org.opencontainers.image.title="mimante" \
|
||||
org.opencontainers.image.description="Mimante: segue le aste al centesimo di Bidoo, decide con un modello appreso se puntare. Le aste entrano in Osserva." \
|
||||
org.opencontainers.image.version="${VERSION}" \
|
||||
org.opencontainers.image.revision="${GIT_COMMIT}" \
|
||||
org.opencontainers.image.authors="Alberto Balbo" \
|
||||
org.opencontainers.image.source="http://192.168.30.23:3000/Alby96/bidoo-bidbot"
|
||||
org.opencontainers.image.source="http://192.168.30.23:3000/Alby96/Mimante"
|
||||
|
||||
# Dipendenze del runtime .NET (ICU, OpenSSL, zlib), fuso orario, certificati, Chromium con
|
||||
# i caratteri per l'accesso assistito, setpriv (util-linux) per scendere a PUID/PGID.
|
||||
@@ -89,9 +89,9 @@ EXPOSE 8080
|
||||
# /salute risponde 200 solo con configurazione e database a posto. Nell'immagine non c'è
|
||||
# curl: la sonda è il programma stesso con --salute.
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||
CMD ["dotnet", "/app/BidooBidBot.dll", "--salute"]
|
||||
CMD ["dotnet", "/app/Mimante.dll", "--salute"]
|
||||
|
||||
# SIGTERM arriva al processo dotnet (exec nell'entrypoint): spegnimento ordinato in 10 s.
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["dotnet", "/app/BidooBidBot.dll"]
|
||||
CMD ["dotnet", "/app/Mimante.dll"]
|
||||
@@ -0,0 +1,72 @@
|
||||
# Sviluppo locale di Mimante: PostgreSQL 18 come su Unraid, e il bot dal Dockerfile.
|
||||
#
|
||||
# docker compose -f docker/compose.yml up -d postgres # solo il database
|
||||
# docker compose -f docker/compose.yml up -d --build # database + bot
|
||||
# docker compose -f docker/compose.yml --profile simulatore up -d --build
|
||||
#
|
||||
# Il bot legge /config da tools/dev/config (ignorata da git). Interfaccia: http://localhost:8080,
|
||||
# password «dev». Fuori da Docker: DB_HOST=localhost DB_PASSWORD=dev UI_PASSWORD=dev
|
||||
# dotnet run --project src/Mimante -- --config tools/dev/config
|
||||
name: mimante-dev
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:18
|
||||
environment:
|
||||
POSTGRES_USER: admin
|
||||
POSTGRES_PASSWORD: dev
|
||||
POSTGRES_DB: autobidder
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U admin -d autobidder"]
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
bot:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
args:
|
||||
VERSION: dev
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DB_HOST: postgres:5432
|
||||
DB_PASSWORD: dev
|
||||
UI_PASSWORD: dev
|
||||
TZ: Europe/Rome
|
||||
PUID: "1000"
|
||||
PGID: "1000"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- ../tools/dev/config:/config
|
||||
|
||||
# Lo stesso bot, senza sessione Bidoo: parte in modalità simulatore (banner in alto).
|
||||
bot-simulatore:
|
||||
profiles: ["simulatore"]
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
args:
|
||||
VERSION: dev
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DB_HOST: postgres:5432
|
||||
DB_NAME: mimante_simulatore
|
||||
DB_PASSWORD: dev
|
||||
UI_PASSWORD: dev
|
||||
TZ: Europe/Rome
|
||||
ports:
|
||||
- "8081:8080"
|
||||
volumes:
|
||||
- ../tools/dev/config-simulatore:/config
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Bidoo BidBot: entrypoint del container.
|
||||
# Mimante: entrypoint del container.
|
||||
#
|
||||
# 1. Fuso orario da TZ (tzdata è nell'immagine).
|
||||
# 2. Utente e gruppo da PUID/PGID (predefiniti 99/100, «nobody:users» di Unraid): /config
|
||||
@@ -20,17 +20,17 @@ fi
|
||||
mkdir -p /config
|
||||
|
||||
if [ "${PUID}" = "0" ]; then
|
||||
echo "bidoo-bidbot: avvio come root (PUID=0), fuso ${TZ:-UTC}"
|
||||
echo "mimante: avvio come root (PUID=0), fuso ${TZ:-UTC}"
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
if ! getent group "${PGID}" >/dev/null 2>&1; then
|
||||
groupadd -g "${PGID}" bidbot
|
||||
groupadd -g "${PGID}" mimante
|
||||
fi
|
||||
GROUP_NAME="$(getent group "${PGID}" | cut -d: -f1)"
|
||||
|
||||
if ! getent passwd "${PUID}" >/dev/null 2>&1; then
|
||||
useradd -r -o -u "${PUID}" -g "${PGID}" -M -d /config -s /usr/sbin/nologin bidbot
|
||||
useradd -r -o -u "${PUID}" -g "${PGID}" -M -d /config -s /usr/sbin/nologin mimante
|
||||
fi
|
||||
|
||||
chown -R "${PUID}:${PGID}" /config
|
||||
@@ -38,5 +38,5 @@ chown -R "${PUID}:${PGID}" /config
|
||||
# Chromium vuole una home scrivibile per la cache: la sua sta dentro /config/browser.
|
||||
export HOME=/config
|
||||
|
||||
echo "bidoo-bidbot: avvio come uid ${PUID} gid ${PGID} (${GROUP_NAME}), fuso ${TZ:-UTC}"
|
||||
echo "mimante: avvio come uid ${PUID} gid ${PGID} (${GROUP_NAME}), fuso ${TZ:-UTC}"
|
||||
exec setpriv --reuid="${PUID}" --regid="${PGID}" --init-groups "$@"
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<Container version="2">
|
||||
<Name>mimante</Name>
|
||||
<Repository>192.168.30.23:3000/alby96/mimante:latest</Repository>
|
||||
<Registry>http://192.168.30.23:3000/Alby96/-/packages/container/mimante</Registry>
|
||||
<Network>bridge</Network>
|
||||
<MyIP/>
|
||||
<Shell>bash</Shell>
|
||||
<Privileged>false</Privileged>
|
||||
<Support>http://192.168.30.23:3000/Alby96/Mimante/issues</Support>
|
||||
<Project>http://192.168.30.23:3000/Alby96/Mimante</Project>
|
||||
<Overview>Mimante: segue le aste al centesimo di Bidoo, decide con un modello appreso se puntare e punta negli ultimi millisecondi. Le aste entrano in Osserva (nessuna puntata reale); puntano solo quelle messe in Attiva, con un utente Bidoo collegato. Richiede il container PostgreSQL (postgresql18) e una password per l'interfaccia. Interfaccia web sulla porta 8080, notifiche Telegram. Registry in HTTP: aggiungi --insecure-registry 192.168.30.23:3000 in DOCKER_OPTS (/boot/config/docker.cfg). Uso personale: rispetta i Termini di Bidoo, un solo account.</Overview>
|
||||
<Category>Tools: Productivity:</Category>
|
||||
<WebUI>http://[IP]:[PORT:8080]/</WebUI>
|
||||
<TemplateURL>http://192.168.30.23:3000/Alby96/Mimante/raw/branch/main/docker/unraid/mimante.xml</TemplateURL>
|
||||
<Icon>http://192.168.30.23:3000/Alby96/Mimante/raw/branch/main/docs/icona.png</Icon>
|
||||
<ExtraParams>--memory=1g --restart=unless-stopped --stop-timeout 15</ExtraParams>
|
||||
<PostArgs/>
|
||||
<CPUset/>
|
||||
<DateInstalled/>
|
||||
<DonateText/>
|
||||
<DonateLink/>
|
||||
<Requires>Il container PostgreSQL (postgresql18, utente admin, database autobidder) raggiungibile dal bot.</Requires>
|
||||
<Config Name="Interfaccia web" Target="8080" Default="8080" Mode="tcp" Description="Porta dell'interfaccia" Type="Port" Display="always" Required="true" Mask="false">8080</Config>
|
||||
<Config Name="Cartella dati (/config)" Target="/config" Default="/mnt/user/appdata/mimante" Mode="rw" Description="Sessione, riferimenti, registri, esportazioni, profilo browser, backup" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/mimante</Config>
|
||||
<Config Name="DB_HOST" Target="DB_HOST" Default="192.168.30.23:5432" Mode="" Description="Indirizzo del container PostgreSQL (IP o nome, con :porta se non e' 5432)" Type="Variable" Display="always" Required="true" Mask="false">192.168.30.23:5432</Config>
|
||||
<Config Name="DB_PASSWORD" Target="DB_PASSWORD" Default="" Mode="" Description="Password dell'utente PostgreSQL" Type="Variable" Display="always" Required="true" Mask="true"></Config>
|
||||
<Config Name="UI_PASSWORD" Target="UI_PASSWORD" Default="" Mode="" Description="Password per entrare nell'interfaccia web (comanda puntate vere)" Type="Variable" Display="always" Required="true" Mask="true"></Config>
|
||||
<Config Name="DB_USER" Target="DB_USER" Default="admin" Mode="" Description="Utente PostgreSQL" Type="Variable" Display="advanced" Required="false" Mask="false">admin</Config>
|
||||
<Config Name="DB_NAME" Target="DB_NAME" Default="autobidder" Mode="" Description="Nome del database (creato se manca e l'utente puo')" Type="Variable" Display="advanced" Required="false" Mask="false">autobidder</Config>
|
||||
<Config Name="TZ" Target="TZ" Default="Europe/Rome" Mode="" Description="Fuso orario" Type="Variable" Display="advanced" Required="false" Mask="false">Europe/Rome</Config>
|
||||
<Config Name="PUID" Target="PUID" Default="99" Mode="" Description="Utente per i file in /config" Type="Variable" Display="advanced" Required="false" Mask="false">99</Config>
|
||||
<Config Name="PGID" Target="PGID" Default="100" Mode="" Description="Gruppo per i file in /config" Type="Variable" Display="advanced" Required="false" Mask="false">100</Config>
|
||||
</Container>
|
||||
Reference in new issue
Block a user