refactor!: rename the project from Monitor to MoShiro [CI]
ci/woodpecker/push/main-amd64-build Pipeline was successful

Namespaces, assemblies, solution, binaries, images, systemd units, config paths, environment variables, protocol methods and the Linux user are all renamed. Breaking: existing databases, node identities and installed units must be recreated.
This commit is contained in:
justme committed 2026-10-07 02:03:25 +08:00
1 parent 27ac7fb787
commit 2e146d4da7
309 files changed
+1565 -1572

No files matched your search

+8 -8
View File
@@ -1,17 +1,17 @@
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
ARG APP_VERSION=unknown
LABEL org.opencontainers.image.title="Monitor Agent" \
org.opencontainers.image.description="MyMonitor node agent for Linux" \
LABEL org.opencontainers.image.title="MoShiro Agent" \
org.opencontainers.image.description="MoShiro node agent for Linux" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.version="$APP_VERSION"
COPY --chown=1654:1654 app/monitor-agent /usr/local/bin/monitor-agent
COPY --chown=1654:1654 app/moshiro-agent /usr/local/bin/moshiro-agent
COPY --chown=1654:1654 app/fleet-enroll /usr/local/bin/fleet-enroll
COPY --chown=1654:1654 config/ /etc/monitor/
COPY --chown=1654:1654 config/ /etc/moshiro/
USER 1654:1654
WORKDIR /etc/monitor
VOLUME ["/etc/monitor"]
ENTRYPOINT ["/usr/local/bin/monitor-agent"]
CMD ["--config", "/etc/monitor/agent.json"]
WORKDIR /etc/moshiro
VOLUME ["/etc/moshiro"]
ENTRYPOINT ["/usr/local/bin/moshiro-agent"]
CMD ["--config", "/etc/moshiro/agent.json"]
@@ -3,16 +3,16 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine-aot AS build
WORKDIR /src/backend
COPY restore/backend/ ./
# restore 也要带 PublishAot:不然不会还原 ILCompiler,之后 --no-restore 的发布就悄悄变成「裁剪过的框架依赖程序」
RUN dotnet restore agent/src/Monitor.Agent -r linux-musl-x64 -p:PublishAot=true --artifacts-path /artifacts \
RUN dotnet restore agent/src/MoShiro.Agent -r linux-musl-x64 -p:PublishAot=true --artifacts-path /artifacts \
&& dotnet restore fleet/tools/fleet-enroll -r linux-musl-x64 -p:PublishAot=true --artifacts-path /artifacts
COPY source/backend/ ./
# 构建信息:CI 通过 --build-arg 传入;不传就是空(放在 restore 之后,每次构建都变的时间不会让依赖还原的缓存失效)
ARG MONITOR_TAG=
ARG MONITOR_COMMIT=
ARG MONITOR_BUILT_AT=
ENV MONITOR_TAG=$MONITOR_TAG MONITOR_COMMIT=$MONITOR_COMMIT MONITOR_BUILT_AT=$MONITOR_BUILT_AT
RUN dotnet publish agent/src/Monitor.Agent -m:3 -c Release -r linux-musl-x64 \
ARG MOSHIRO_TAG=
ARG MOSHIRO_COMMIT=
ARG MOSHIRO_BUILT_AT=
ENV MOSHIRO_TAG=$MOSHIRO_TAG MOSHIRO_COMMIT=$MOSHIRO_COMMIT MOSHIRO_BUILT_AT=$MOSHIRO_BUILT_AT
RUN dotnet publish agent/src/MoShiro.Agent -m:3 -c Release -r linux-musl-x64 \
--self-contained true --no-restore -p:PublishAot=true -p:UseAotAnywhere=false \
-p:UseAppHost=true -p:StripSymbols=true \
-p:DebugType=none -p:DebugSymbols=false --artifacts-path /artifacts -o /out/agent \
@@ -21,23 +21,23 @@ RUN dotnet publish agent/src/Monitor.Agent -m:3 -c Release -r linux-musl-x64 \
-p:UseAppHost=true -p:StripSymbols=true \
-p:DebugType=none -p:DebugSymbols=false --artifacts-path /artifacts -o /out/enroll
# 原生程序有几 MB;几十 KB 的是只会去找 .dll 的启动器
RUN test -x /out/agent/monitor-agent && test -x /out/enroll/fleet-enroll \
&& test "$(stat -c%s /out/agent/monitor-agent)" -gt 2000000 && test "$(stat -c%s /out/enroll/fleet-enroll)" -gt 2000000
RUN test -x /out/agent/moshiro-agent && test -x /out/enroll/fleet-enroll \
&& test "$(stat -c%s /out/agent/moshiro-agent)" -gt 2000000 && test "$(stat -c%s /out/enroll/fleet-enroll)" -gt 2000000
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
ARG APP_VERSION=main
LABEL org.opencontainers.image.title="Monitor Agent" \
org.opencontainers.image.description="MyMonitor node agent for Linux" \
LABEL org.opencontainers.image.title="MoShiro Agent" \
org.opencontainers.image.description="MoShiro node agent for Linux" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.version="$APP_VERSION"
COPY --chown=1654:1654 --from=build /out/agent/monitor-agent /usr/local/bin/monitor-agent
COPY --chown=1654:1654 --from=build /out/agent/moshiro-agent /usr/local/bin/moshiro-agent
COPY --chown=1654:1654 --from=build /out/enroll/fleet-enroll /usr/local/bin/fleet-enroll
COPY --chown=1654:1654 config/ /etc/monitor/
COPY --chown=1654:1654 config/ /etc/moshiro/
USER 1654:1654
WORKDIR /etc/monitor
VOLUME ["/etc/monitor"]
ENTRYPOINT ["/usr/local/bin/monitor-agent"]
CMD ["--config", "/etc/monitor/agent.json"]
WORKDIR /etc/moshiro
VOLUME ["/etc/moshiro"]
ENTRYPOINT ["/usr/local/bin/moshiro-agent"]
CMD ["--config", "/etc/moshiro/agent.json"]
+4 -4
View File
@@ -1,20 +1,20 @@
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
ARG APP_VERSION=unknown
LABEL org.opencontainers.image.title="Monitor Backend" \
LABEL org.opencontainers.image.title="MoShiro Backend" \
org.opencontainers.image.description="Self-hosted network path quality monitoring backend" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.version="$APP_VERSION"
WORKDIR /app
COPY --chown=1654:1654 app/monitor-backend /app/monitor-backend
COPY --chown=1654:1654 app/moshiro-backend /app/moshiro-backend
COPY --chown=1654:1654 data/.keep /data/.keep
ENV ASPNETCORE_HTTP_PORTS=8080 \
Monitor__DataDirectory=/data \
MoShiro__DataDirectory=/data \
DOTNET_EnableDiagnostics=0
USER 1654:1654
VOLUME ["/data"]
EXPOSE 8080
ENTRYPOINT ["/app/monitor-backend"]
ENTRYPOINT ["/app/moshiro-backend"]
+8 -8
View File
@@ -1,16 +1,16 @@
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
ARG APP_VERSION=unknown
LABEL org.opencontainers.image.title="Monitor Probe" \
org.opencontainers.image.description="MyMonitor network measurement probe for Linux" \
LABEL org.opencontainers.image.title="MoShiro Probe" \
org.opencontainers.image.description="MoShiro network measurement probe for Linux" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.version="$APP_VERSION"
COPY --chown=1654:1654 app/monitor-probe /usr/local/bin/monitor-probe
COPY --chown=1654:1654 config/ /etc/monitor/
COPY --chown=1654:1654 app/moshiro-probe /usr/local/bin/moshiro-probe
COPY --chown=1654:1654 config/ /etc/moshiro/
USER 1654:1654
WORKDIR /etc/monitor
VOLUME ["/etc/monitor"]
ENTRYPOINT ["/usr/local/bin/monitor-probe"]
CMD ["--config", "/etc/monitor/probe.json"]
WORKDIR /etc/moshiro
VOLUME ["/etc/moshiro"]
ENTRYPOINT ["/usr/local/bin/moshiro-probe"]
CMD ["--config", "/etc/moshiro/probe.json"]
@@ -3,35 +3,35 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine-aot AS build
WORKDIR /src/backend
COPY restore/backend/ ./
# restore 也要带 PublishAot:不然不会还原 ILCompiler,之后 --no-restore 的发布就悄悄变成「裁剪过的框架依赖程序」
RUN dotnet restore probe/src/Monitor.Probe -r linux-musl-x64 -p:PublishAot=true --artifacts-path /artifacts
RUN dotnet restore probe/src/MoShiro.Probe -r linux-musl-x64 -p:PublishAot=true --artifacts-path /artifacts
COPY source/backend/ ./
# 构建信息:CI 通过 --build-arg 传入;不传就是空(放在 restore 之后,每次构建都变的时间不会让依赖还原的缓存失效)
ARG MONITOR_TAG=
ARG MONITOR_COMMIT=
ARG MONITOR_BUILT_AT=
ENV MONITOR_TAG=$MONITOR_TAG MONITOR_COMMIT=$MONITOR_COMMIT MONITOR_BUILT_AT=$MONITOR_BUILT_AT
RUN dotnet publish probe/src/Monitor.Probe -m:3 -c Release -r linux-musl-x64 \
ARG MOSHIRO_TAG=
ARG MOSHIRO_COMMIT=
ARG MOSHIRO_BUILT_AT=
ENV MOSHIRO_TAG=$MOSHIRO_TAG MOSHIRO_COMMIT=$MOSHIRO_COMMIT MOSHIRO_BUILT_AT=$MOSHIRO_BUILT_AT
RUN dotnet publish probe/src/MoShiro.Probe -m:3 -c Release -r linux-musl-x64 \
--self-contained true --no-restore -p:PublishAot=true -p:UseAotAnywhere=false \
-p:UseAppHost=true -p:StripSymbols=true \
-p:DebugType=none -p:DebugSymbols=false --artifacts-path /artifacts -o /out/probe
# 原生程序有几 MB;几十 KB 的是只会去找 .dll 的启动器
RUN test -x /out/probe/monitor-probe \
&& test "$(stat -c%s /out/probe/monitor-probe)" -gt 2000000
RUN test -x /out/probe/moshiro-probe \
&& test "$(stat -c%s /out/probe/moshiro-probe)" -gt 2000000
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
ARG APP_VERSION=main
LABEL org.opencontainers.image.title="Monitor Probe" \
org.opencontainers.image.description="MyMonitor network measurement probe for Linux" \
LABEL org.opencontainers.image.title="MoShiro Probe" \
org.opencontainers.image.description="MoShiro network measurement probe for Linux" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.version="$APP_VERSION"
COPY --chown=1654:1654 --from=build /out/probe/monitor-probe /usr/local/bin/monitor-probe
COPY --chown=1654:1654 config/ /etc/monitor/
COPY --chown=1654:1654 --from=build /out/probe/moshiro-probe /usr/local/bin/moshiro-probe
COPY --chown=1654:1654 config/ /etc/moshiro/
USER 1654:1654
WORKDIR /etc/monitor
VOLUME ["/etc/monitor"]
ENTRYPOINT ["/usr/local/bin/monitor-probe"]
CMD ["--config", "/etc/monitor/probe.json"]
WORKDIR /etc/moshiro
VOLUME ["/etc/moshiro"]
ENTRYPOINT ["/usr/local/bin/moshiro-probe"]
CMD ["--config", "/etc/moshiro/probe.json"]