diff --git a/.gitea/workflows/builder.yaml b/.gitea/workflows/builder.yaml
index 71d14cdd..c00f173e 100644
--- a/.gitea/workflows/builder.yaml
+++ b/.gitea/workflows/builder.yaml
@@ -26,59 +26,59 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Build futureporn/aquatic
- uses: docker/build-push-action@v6
- with:
- context: ./apps/aquatic
- file: ./apps/aquatic/docker/aquatic_udp_futureporn.Dockerfile
- push: true
- tags: gitea.futureporn.net/futureporn/aquatic:latest
-
- - name: Build futureporn/tracker-helper
- uses: docker/build-push-action@v6
- with:
- context: ./services/tracker-helper
- push: true
- tags: gitea.futureporn.net/futureporn/tracker-helper:latest
- labels: |
- org.opencontainers.image.description=Custom Aquatic helper service, adding info_hash accesslist operations via HTTP
- org.opencontainers.image.title=tracker-helper
- org.opencontainers.image.licenses=unlicense
- org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
- org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/tracker-helper
- secrets: |
- TRACKER_HELPER_USERNAME=${{ secrets.TRACKER_HELPER_USERNAME }}
- TRACKER_HELPER_PASSWORD=${{ secrets.TRACKER_HELPER_PASSWORD }}
-
- - name: Build futureporn/tracker
- uses: docker/build-push-action@v6
- with:
- context: ./apps/tracker
- push: true
- tags: gitea.futureporn.net/futureporn/tracker:latest
- labels: |
- org.opencontainers.image.description=Aquatic tracker with custom helper service, adding info_hash accesslist operations via HTTP
- org.opencontainers.image.title=tracker
- org.opencontainers.image.licenses=unlicense
- org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
- org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/tracker
- secrets: |
- TRACKER_HELPER_USERNAME=${{ secrets.TRACKER_HELPER_USERNAME }}
- TRACKER_HELPER_PASSWORD=${{ secrets.TRACKER_HELPER_PASSWORD }}
-
- # - name: Build futureporn/bright
+ # - name: Build futureporn/aquatic
# uses: docker/build-push-action@v6
# with:
- # context: ./apps/bright
+ # context: ./apps/aquatic
+ # file: ./apps/aquatic/docker/aquatic_udp_futureporn.Dockerfile
# push: true
- # tags: gitea.futureporn.net/futureporn/bright:latest
- # build-args: |
- # MIX_ENV=prod
+ # tags: gitea.futureporn.net/futureporn/aquatic:latest
+
+ # - name: Build futureporn/tracker-helper
+ # uses: docker/build-push-action@v6
+ # with:
+ # context: ./services/tracker-helper
+ # push: true
+ # tags: gitea.futureporn.net/futureporn/tracker-helper:latest
# labels: |
- # org.opencontainers.image.description=The Galaxy's Best VTuber hentai site
- # org.opencontainers.image.title=bright
- # org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
- # org.opencontainers.image.version={{version}}
+ # org.opencontainers.image.description=Custom Aquatic helper service, adding info_hash accesslist operations via HTTP
+ # org.opencontainers.image.title=tracker-helper
# org.opencontainers.image.licenses=unlicense
# org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
- # org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/bright
+ # org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/tracker-helper
+ # secrets: |
+ # TRACKER_HELPER_USERNAME=${{ secrets.TRACKER_HELPER_USERNAME }}
+ # TRACKER_HELPER_PASSWORD=${{ secrets.TRACKER_HELPER_PASSWORD }}
+
+ # - name: Build futureporn/tracker
+ # uses: docker/build-push-action@v6
+ # with:
+ # context: ./apps/tracker
+ # push: true
+ # tags: gitea.futureporn.net/futureporn/tracker:latest
+ # labels: |
+ # org.opencontainers.image.description=Aquatic tracker with custom helper service, adding info_hash accesslist operations via HTTP
+ # org.opencontainers.image.title=tracker
+ # org.opencontainers.image.licenses=unlicense
+ # org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
+ # org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/tracker
+ # secrets: |
+ # TRACKER_HELPER_USERNAME=${{ secrets.TRACKER_HELPER_USERNAME }}
+ # TRACKER_HELPER_PASSWORD=${{ secrets.TRACKER_HELPER_PASSWORD }}
+
+ - name: Build futureporn/bright
+ uses: docker/build-push-action@v6
+ with:
+ context: ./apps/bright
+ push: true
+ tags: gitea.futureporn.net/futureporn/bright:latest
+ build-args: |
+ MIX_ENV=prod
+ labels: |
+ org.opencontainers.image.description=The Galaxy's Best VTuber hentai site
+ org.opencontainers.image.title=bright
+ org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
+ org.opencontainers.image.version={{version}}
+ org.opencontainers.image.licenses=unlicense
+ org.opencontainers.image.source=https://gitea.futureporn.net/futureporn/fp
+ org.opencontainers.image.url=https://gitea.futureporn.net/futureporn/-/packages/container/bright
diff --git a/README.md b/README.md
index 1746a255..49725835 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,8 @@ The main gist is as follows.
devbox install
-3. Run `docker compose up --watch`
+3. Run database and other accessories with `docker compose up --watch`
+4. In another terminal, run the phoenix "bright" app with `devbox run bright:dev`
4. Visit http://localhost:4000
If all went well, editing source code will automatically affect the website running in your browser.
diff --git a/apps/bright/Dockerfile b/apps/bright/Dockerfile
index ced7f6fd..92215ecd 100644
--- a/apps/bright/Dockerfile
+++ b/apps/bright/Dockerfile
@@ -27,6 +27,7 @@ RUN apt-get update -y && apt-get install -y build-essential git inotify-tools ff
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
+
# prepare build dir
WORKDIR /app
@@ -93,11 +94,17 @@ CMD [ "mix", "phx.server" ]
# start a new build stage so that the final image will only contain
# the compiled release and other runtime necessities
FROM ${RUNNER_IMAGE} AS prod
-RUN mkdir -p ~/.config/futureporn
+RUN mkdir -p /mnt/vfs/futureporn
-RUN apt-get update -y && \
- apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates \
- && apt-get clean && rm -f /var/lib/apt/lists/*_*
+RUN apt-get update -y \
+ && apt-get install -y libstdc++6 openssl libncurses5 locales inotify-tools ffmpeg python3 python3-pip ca-certificates \
+ && pip install torrentfile \
+ && apt-get clean && rm -f /var/lib/apt/lists/*_* \
+ && groupadd bright \
+ && useradd bright \
+ --gid bright \
+ --shell /bin/sh \
+ --create-home
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
@@ -105,7 +112,7 @@ RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
WORKDIR "/app"
-RUN chown nobody /app
+RUN chown bright /app
# set runner ENV
ARG MIX_ENV=prod
@@ -113,13 +120,12 @@ ENV MIX_ENV=$MIX_ENV
RUN echo MIX_ENV=$MIX_ENV
# Only copy the final release from the build stage
-COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/bright ./
+COPY --from=builder --chown=bright:root /app/_build/${MIX_ENV}/rel/bright ./
-USER nobody
+USER bright
# If using an environment that doesn't automatically reap zombie processes, it is
# advised to add an init process such as tini via `apt-get install`
# above and adding an entrypoint. See https://github.com/krallin/tini for details
# ENTRYPOINT ["/tini", "--"]
-
CMD ["/app/bin/server"]
diff --git a/apps/bright/config/runtime.exs b/apps/bright/config/runtime.exs
index 08db3dbd..47a2915f 100644
--- a/apps/bright/config/runtime.exs
+++ b/apps/bright/config/runtime.exs
@@ -94,12 +94,19 @@ if config_env() == :prod do
# We need to stop the program from running if OAuth client IDs and client secrets are not present in env.
# We also do this in config.exs, but we wait to raise until here otherwise mix wouldn't be able to run ecto migrations
- # System.get_env("GITHUB_CLIENT_ID") || raise("environment variable GITHUB_CLIENT_ID is missing.")
- # System.get_env("GITHUB_CLIENT_SECRET") || raise("environment variable GITHUB_CLIENT_SECRET is missing.")
+ System.get_env("PATREON_CLIENT_ID") ||
+ raise("environment variable PATREON_CLIENT_ID is missing.")
- # config :ueberauth, Ueberauth.Strategy.Patreon.OAuth,
- # client_id: {:system, "PATREON_CLIENT_ID"},
- # client_secret: {:system, "PATREON_CLIENT_SECRET"}
+ System.get_env("PATREON_CLIENT_SECRET") ||
+ raise("environment variable PATREON_CLIENT_SECRET is missing.")
+
+ System.get_env("PATREON_REDIRECT_URI") ||
+ raise("environment variable PATREON_REDIRECT_URI is missing.")
+
+ config :ueberauth, Ueberauth.Strategy.Patreon.OAuth,
+ client_id: System.get_env("PATREON_CLIENT_ID"),
+ client_secret: System.get_env("PATREON_CLIENT_SECRET"),
+ redirect_uri: System.get_env("PATREON_REDIRECT_URI")
# config :ueberauth, Ueberauth.Strategy.Github.OAuth,
# client_id: {:system, "GITHUB_CLIENT_ID"},
diff --git a/apps/bright/lib/bright/cache.ex b/apps/bright/lib/bright/cache.ex
index 9ccfc99a..11a865ba 100644
--- a/apps/bright/lib/bright/cache.ex
+++ b/apps/bright/lib/bright/cache.ex
@@ -3,7 +3,8 @@ defmodule Bright.Cache do
A simple caching module that saves files to the `/tmp` directory.
"""
- @cache_dir Path.join(System.user_home!(), ".cache/futureporn")
+ # we use Vultr File System to share cache among all Phoenix instances
+ @cache_dir "/mnt/vfs/futureporn"
require Logger
diff --git a/apps/bright/lib/bright_web/live/profile/profile_live.ex b/apps/bright/lib/bright_web/live/profile/profile_live.ex
index 91b5c627..6d3d8a5f 100644
--- a/apps/bright/lib/bright_web/live/profile/profile_live.ex
+++ b/apps/bright/lib/bright_web/live/profile/profile_live.ex
@@ -61,7 +61,7 @@ defmodule BrightWeb.ProfileLive do
Care to upgrade your Patron Tier? Patron Tiers & Perks