discord-photo-reaper

command module
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: MIT Imports: 22 Imported by: 0

README

dicsord-photo-reaper

Find & Download all files on a discord server and upload them to Google Drive.

This application holds all files in memory to preserve the OS' disk and speed (thanks Gabe for teaching me that one!)

Usage

Google Drive Setup

This application requires Google Developer credentials.

  1. Create a project in the Google Cloud Console.
  2. Enable Google Drive API: Enable the Google Drive API for your project.
  3. OAuth 2.0 Credentials: Create OAuth 2.0 credentials (client ID and secret), set up a consent screen, and download the credentials.json file.
Running the app

First time run, check stdout for

Docker

Container is published as alex4108/discord_photo_reaper:latest-release

mkdir -p container-volume/
export DISCORD_BOT_TOKEN=""
export DISCORD_GUILD_ID=""

Place your client_secret.json from Google in ./container-volume/

Then ./docker-run.sh

docker-compose

Ensure you replace the values as appropriate before docker-compose up

Ensure you place client_secret.json as noted above.

Kubernetes

Example manifest at kube-manifest.yml

Prometheus scraper endpoint is available on http://app_server:8889/metrics

Example prom scrape config:

- job_name: discord_photo_reaper
  scrape_interval: 1m
  metrics_path: /metrics
  static_configs:
  - targets:
    - discord-photo-reaper-metrics.discord-photo-reaper.svc.cluster.local:8889

Features

  • Stateful runs won't download the same file >1 times
  • Rate limit observation / backoff for downloading from discord.

Development

make build

make test (no tests?! Look at E2E in this repo)

make run

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL