This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,658 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
** | ||
!nitro_generator_checker/**/*.py | ||
!poetry.lock | ||
!pyproject.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# hadolint global ignore=DL3008,DL3013,DL4006 | ||
FROM docker.io/python:3.12-slim-bookworm as python-base-stage | ||
|
||
ENV \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | ||
PIP_NO_CACHE_DIR=1 \ | ||
PIP_NO_COLOR=1 \ | ||
PIP_NO_INPUT=1 \ | ||
PIP_PROGRESS_BAR=off \ | ||
PIP_ROOT_USER_ACTION=ignore \ | ||
PIP_UPGRADE=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /app | ||
|
||
|
||
FROM python-base-stage as python-build-stage | ||
|
||
ENV \ | ||
POETRY_NO_ANSI=1 \ | ||
POETRY_NO_CACHE=1 \ | ||
POETRY_NO_INTERACTION=1 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends build-essential \ | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip install poetry poetry-plugin-export | ||
|
||
COPY ./poetry.lock ./pyproject.toml ./ | ||
|
||
RUN poetry export --without-hashes --only=main --extras=non-termux | \ | ||
pip wheel --wheel-dir /usr/src/app/wheels -r /dev/stdin | ||
|
||
|
||
FROM python-base-stage as python-run-stage | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends -y tini \ | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/ | ||
|
||
RUN pip install --no-index --find-links /wheels/ /wheels/* \ | ||
&& rm -rf /wheels/ | ||
|
||
ARG GID UID | ||
|
||
# hadolint ignore=SC3028 | ||
RUN groupadd --gid "${GID}" --system app \ | ||
&& useradd --gid app --no-log-init --system --uid "${UID}" app | ||
|
||
ENV IS_DOCKER=1 | ||
|
||
COPY . . | ||
|
||
USER app | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
|
||
CMD ["python", "-m", "nitro_generator_checker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# How many codes to check concurrently? | ||
# Windows supports maximum of 512. | ||
# On *nix operating systems, this restriction is much looser. | ||
# The limit on *nix can be seen with the command `ulimit -Hn`. | ||
# Try different values and see which ones give you the best performance. | ||
max_connections = 512 | ||
|
||
# Leave blank if you want the nitro codes to be only saved to the file_name. | ||
webhook_url = "" | ||
|
||
# The number of seconds to wait for a request to the Discord API. | ||
timeout = 10 | ||
|
||
# Path to the file where valid codes are to be saved. | ||
file_name = "./nitro_codes.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
services: | ||
app: | ||
image: nitro_generator_checker | ||
build: | ||
context: . | ||
args: | ||
- GID=${GID:-1000} | ||
- UID=${UID:-1000} | ||
tty: true | ||
volumes: | ||
- ./config.toml:/app/config.toml | ||
- ./nitro_codes.txt:/app/nitro_codes.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
project_name="nitro-generator-checker" | ||
base_path="${HOME}" | ||
install_path="${base_path}/${project_name}" | ||
download_path="${TMPDIR}/${project_name}.zip" | ||
|
||
[ -d "${install_path}" ] && rm -rf --interactive=once "${install_path}" | ||
pkg upgrade --yes -o Dpkg::Options::='--force-confdef' | ||
pkg install --yes python python-pip | ||
curl -fsSLo "${download_path}" "https://github.com/monosans/${project_name}/archive/refs/heads/main.zip" | ||
unzip -d "${base_path}" "${download_path}" | ||
rm -f "${download_path}" | ||
mv "${install_path}-main" "${install_path}" | ||
printf "%s installed successfully.\nRun 'cd %s && sh start-termux.sh'.\n" "${project_name}" "${install_path}" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.