Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83555dd
Allow switching category automatically to make torrents linked
StirlingMouse Mar 12, 2026
2a7927e
Selected stats error handling
StirlingMouse Mar 13, 2026
f148463
Don't update order only category changes
StirlingMouse Mar 13, 2026
f29407c
Fix dioxus in docker
StirlingMouse Mar 13, 2026
24b3259
Set proper titles
StirlingMouse Mar 13, 2026
d00500c
Set doctype
StirlingMouse Mar 13, 2026
e170b52
Fix missing , between table entities
StirlingMouse Mar 14, 2026
616c707
Fix edit page and add tests
StirlingMouse Mar 14, 2026
271f841
Fix missing combo mappings from MaM
StirlingMouse Mar 14, 2026
6096f2a
Improve edit page
StirlingMouse Mar 14, 2026
f4688e3
Log errors from dioxus
StirlingMouse Mar 14, 2026
888baa3
Fix the dioxus downloaded button
StirlingMouse Mar 18, 2026
6c6fd36
Use standard cargo-chef docker
StirlingMouse Mar 18, 2026
ff9e171
Remove duplicated styles and fetch them normally
StirlingMouse Mar 18, 2026
bae6ba5
First torrent detail style pass
StirlingMouse Mar 18, 2026
ba6a041
Add mam category 63
StirlingMouse Mar 18, 2026
2856baa
Style cleanup
StirlingMouse Mar 18, 2026
c0a1c78
Fix list page crashing
StirlingMouse Mar 18, 2026
a1137f4
Optimize torrents page
StirlingMouse Mar 19, 2026
e9ac197
Fix unused warnings
StirlingMouse Mar 20, 2026
e11c2fa
Paginate selected and list
StirlingMouse Mar 20, 2026
615e4ae
Remove ABS fetch from torrent_detail SSR
StirlingMouse Mar 20, 2026
9b626d9
Remove MAM fetch from torrent_detail
StirlingMouse Mar 20, 2026
7ba8973
Remove refetch on metdata accept
StirlingMouse Mar 21, 2026
c39b275
Make mam into a normal metadata provider
StirlingMouse Mar 21, 2026
63c672c
Review comments
StirlingMouse Mar 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.git
.github
.agents

target
node_modules
test-results

data.db
*.db
*.sqlite
*.sqlite3

.DS_Store

config.toml
finn.json

Comment on lines +1 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider adding .env files to the exclusions.

The current exclusions look comprehensive. If the project uses .env files for secrets or local configuration, consider adding them to prevent accidental inclusion in the Docker build context:

 config.toml
 finn.json
+.env
+.env.*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.git
.github
.agents
target
node_modules
test-results
data.db
*.db
*.sqlite
*.sqlite3
.DS_Store
config.toml
finn.json
.git
.github
.agents
target
node_modules
test-results
data.db
*.db
*.sqlite
*.sqlite3
.DS_Store
config.toml
finn.json
.env
.env.*
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.dockerignore around lines 1 - 18, Update the .dockerignore to exclude
environment files by adding patterns like .env and .env.* so local secret/config
files are not sent to the Docker build context; open the .dockerignore (file
shown in the diff) and append entries for .env and .env.* (and any other local
env filenames your repo uses) to ensure they are ignored during docker builds.

25 changes: 23 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 30 additions & 65 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,76 +1,41 @@
# syntax=docker/dockerfile:1.3-labs
# syntax=docker/dockerfile:1.7-labs

# The above line is so we can use can use heredocs in Dockerfiles. No more && and \!
# https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/

FROM rust:1.91 AS build

RUN <<EOF
set -e
cargo new --lib app/mlm_db
cargo new --lib app/mlm_mam
cargo new --lib app/mlm_parse
cargo new --lib app/mlm_meta
cargo new --lib app/mlm_core
cargo new --lib app/mlm_web_askama
cargo new --bin app/mlm_web_dioxus
cargo new --bin app/server
touch /app/mlm_web_dioxus/src/lib.rs
EOF

# Capture dependencies
COPY Cargo.toml Cargo.lock /app/
COPY mlm_db/Cargo.toml /app/mlm_db/
COPY mlm_mam/Cargo.toml /app/mlm_mam/
COPY mlm_parse/Cargo.toml /app/mlm_parse/
COPY mlm_meta/Cargo.toml /app/mlm_meta/
COPY mlm_core/Cargo.toml /app/mlm_core/
COPY mlm_web_askama/Cargo.toml /app/mlm_web_askama/
COPY mlm_web_dioxus/Cargo.toml /app/mlm_web_dioxus/
COPY server/Cargo.toml /app/server/

# This step compiles only our dependencies and saves them in a layer. This is the most impactful time savings
# Note the use of --mount=type=cache. On subsequent runs, we'll have the crates already downloaded
FROM rust:1.91 AS chef
RUN apt update && apt install -y clang mold pkg-config && apt clean
RUN cargo install cargo-chef --locked
WORKDIR /app
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release

# Copy our sources
COPY ./mlm_db /app/mlm_db
COPY ./mlm_mam /app/mlm_mam
COPY ./mlm_parse /app/mlm_parse
COPY ./mlm_meta /app/mlm_meta
COPY ./mlm_core /app/mlm_core
COPY ./mlm_web_askama /app/mlm_web_askama
COPY ./mlm_web_dioxus /app/mlm_web_dioxus
COPY ./server /app/server

# A bit of magic here!
# * We're mounting that cache again to use during the build, otherwise it's not present and we'll have to download those again - bad!
# * EOF syntax is neat but not without its drawbacks. We need to `set -e`, otherwise a failing command is going to continue on
# * Rust here is a bit fiddly, so we'll touch the files (even though we copied over them) to force a new build
RUN --mount=type=cache,target=/usr/local/cargo/registry <<EOF
set -e
# update timestamps to force a new build
touch /app/mlm_db/src/lib.rs
touch /app/mlm_mam/src/lib.rs
touch /app/mlm_parse/src/lib.rs
touch /app/mlm_meta/src/lib.rs
touch /app/mlm_core/src/lib.rs
touch /app/mlm_web_askama/src/lib.rs
touch /app/mlm_web_dioxus/src/lib.rs
touch /app/mlm_web_dioxus/src/main.rs
touch /app/server/src/main.rs
cargo build --release
EOF

CMD ["/app/target/release/mlm"]
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cargo chef cook --release --recipe-path recipe.json

COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cargo build --release
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
cargo install dioxus-cli --version 0.7.3 --locked
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cd /app/mlm_web_dioxus && dx build --release --fullstack --skip-assets

# Again, our final image is the same - a slim base and just our app
FROM debian:trixie-slim AS app
RUN apt update && apt install -y ca-certificates && apt clean
COPY ./server/assets /server/assets
COPY --from=build /app/target/release/mlm /mlm
COPY --from=builder /app/target/release/mlm /mlm
COPY --from=builder /app/target/dx/mlm_web_dioxus/release/web/public /dioxus-public
ENV MLM_LOG_DIR=""
ENV MLM_CONFIG_FILE="/config/config.toml"
ENV MLM_DB_FILE="/data/data.db"
ENV DIOXUS_PUBLIC_PATH="/dioxus-public"
CMD ["/mlm"]
Comment on lines 32 to 41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Run the runtime image as a non-root user.

The final stage never switches away from root, so any compromise in /mlm gets full container privileges by default. Create an unprivileged user/group, make the writable paths accessible to that account, and add USER before CMD.

🧰 Tools
🪛 Checkov (3.2.508)

[low] 1-41: Ensure that HEALTHCHECK instructions have been added to container images

(CKV_DOCKER_2)


[low] 1-41: Ensure that a user for the container has been created

(CKV_DOCKER_3)

🪛 Hadolint (2.14.0)

[info] 33-33: Delete the apt lists (/var/lib/apt/lists) after installing something

(DL3009)


[warning] 33-33: Do not use apt as it is meant to be an end-user tool, use apt-get or apt-cache instead

(DL3027)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` around lines 32 - 41, Create and use an unprivileged user in the
final Docker stage: add a non-root group/user (e.g., mlm:mlm), ensure writable
directories referenced by ENV values or COPY targets (like /data, /config,
/server/assets, /dioxus-public and the /mlm binary location if needed) are
chown'd/chmod'd to that user, then set USER mlm before CMD ["/mlm"] so the
container runs without root privileges; update the Dockerfile's final stage
after the COPY lines to perform these steps.

Loading