Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit 0031a1e

Browse files
committed
SMC-API v2.1
1 parent bbb7cc3 commit 0031a1e

File tree

16 files changed

+2077
-119
lines changed

16 files changed

+2077
-119
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
JWT_SECRET_KEY=
2-
ANALYTICS_API_KEY=
2+
HIGHLIGHT_PROJECT_ID=
33
TURNSTILE_SECRET_KEY=
44
VERDICTS_DISCORD_WEBHOOK_URL=
55
REPORTS_DISCORD_WEBHOOK_URL=

.github/workflows/docker.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Publish image to Docker Hub
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Login to Docker Hub
11+
uses: docker/login-action@v3
12+
with:
13+
username: ${{ vars.DOCKERHUB_USERNAME }}
14+
password: ${{ secrets.DOCKERHUB_TOKEN }}
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v3
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
- name: Build and push
20+
uses: docker/build-push-action@v6
21+
with:
22+
push: true
23+
tags: nitrrine/stopmalwarecontent-api:latest

.github/workflows/ruff.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Run Ruff check
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Install Python
9+
uses: actions/setup-python@v5
10+
with:
11+
python-version: "3.13"
12+
- name: Install dependencies
13+
run: |
14+
python -m pip install --upgrade pip
15+
pip install ruff
16+
# Update output format to enable automatic inline annotations.
17+
- name: Run Ruff
18+
run: ruff check --output-format=github .

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use a Python image with uv pre-installed
2+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
3+
4+
# Install the project into `/app`
5+
WORKDIR /app
6+
7+
# Enable bytecode compilation
8+
ENV UV_COMPILE_BYTECODE=1
9+
10+
# Copy from the cache instead of linking since it's a mounted volume
11+
ENV UV_LINK_MODE=copy
12+
13+
# Install the project's dependencies using the lockfile and settings
14+
RUN --mount=type=cache,target=/root/.cache/uv \
15+
--mount=type=bind,source=uv.lock,target=uv.lock \
16+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
17+
uv sync --frozen --no-install-project --no-dev
18+
19+
# Then, add the rest of the project source code and install it
20+
# Installing separately from its dependencies allows optimal layer caching
21+
ADD . /app
22+
RUN --mount=type=cache,target=/root/.cache/uv \
23+
uv sync --frozen --no-dev
24+
25+
# Place executables in the environment at the front of the path
26+
ENV PATH="/app/.venv/bin:$PATH"
27+
28+
# Reset the entrypoint, don't invoke `uv`
29+
ENTRYPOINT []
30+
31+
CMD ["fastapi", "run", "src/main.py", "--host", "0.0.0.0"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# StopMalwareContent - API
2+
23
![Uptime](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Flodinesoftware%2Fuptime%2Fmaster%2Fapi%2Fstop-malware-content-api%2Fuptime.json)
34

4-
Powered by FastAPI
5+
An official API for StopMalwareContent Extension, written in Python, using FastAPI.

SECURITY.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Security Notice
2+
3+
The notice explains how vulnerabilities should be reported.
4+
5+
# Reporting a Vulnerability
6+
7+
If you've found a vulnerability, we would like to know so we can fix it before it is released publicly.
8+
**Do not open a GitHub issue for a found vulnerability**.
9+
10+
Send details to [nitrrine@team.lodine.xyz](nitrrine@team.lodine.xyz) or through a Discord direct message to an Admin of this project, including:
11+
12+
- the website, page or repository where the vulnerability can be observed
13+
- a brief description of the vulnerability
14+
- optionally the type of vulnerability and any related [OWASP category](https://www.owasp.org/index.php/Category:OWASP_Top_Ten_2017_Project)
15+
- non-destructive exploitation details
16+
17+
We will do our best to reply as fast as possible.
18+
19+
# Scope
20+
21+
The following vulnerabilities **are not** in scope:
22+
23+
- volumetric vulnerabilities, for example overwhelming a service with a high volume of requests
24+
- reports indicating that our services do not fully align with “best practice”, for example missing security headers
25+
26+
If you aren't sure, you can still reach out via email or direct message.
27+
28+
---
29+
30+
This notice is inspired by the [Python Discord Security Notice](https://github.com/python-discord/site/tree/main/pydis_site/apps/content/resources/security-notice.md).
31+
32+
_Version 2025-01_

config/database.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
name = "stopmalwarecontent-api"
3+
version = "2.1.0"
4+
description = "API for StopMalwareContent Extension."
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"authx>=1.4.2",
9+
"fastapi[standard]>=0.115.12",
10+
"highlight-io>=0.10.1",
11+
"pymongo>=4.12.0",
12+
"python-dotenv>=1.1.0",
13+
"requests>=2.32.3",
14+
"ruff>=0.11.6",
15+
]
16+
17+
[tool.ruff]
18+
indent-width = 2

requirements.txt

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)