GithubHelp home page GithubHelp logo

reddit-forward-proxy's Introduction

reddit-forward-proxy

Simple request proxy with Zitadel authentication intended for use in glanceapp/glance

Why

Reddit blocks IP of VPS where the glance app is hosted. With this, the request can be proxied through self-hosted infrastructure while keeping it private.

How

  1. Setup Zitadel

    1. Register and create a project if you don't have one

    2. Open Roles, create new one (ex. reddit-forward-proxy-access)

    3. Go to General, and create an application

      1. Give it a name (ex. reddit-forward-proxy)
      2. Select API
      3. Keep 'Private Key JWT'
      4. Click create (no need to copy clientId)
      5. Add new Key (JSON, you can leave expiration empty) and download it
    4. Go to Users tab > Service Users

      1. Create new one
      2. Fill necessary fields (ex. glance-app)
      3. Keep Access Token Type 'Bearer'
      4. Afterwards, open Personal Access Tokens, generate new one, copy and save the token
      5. Authorizations > New > select your project > add previously created (1.2) role, and save it
  2. Prepare reddit-forward-proxy

    1. (Run the followings in machine with the "safe" IP)

    2. Clone the repo and cd into it

    git clone https://github.com/lastarc/reddit-forward-proxy.git
    cd reddit-forward-proxy
    1. Build the docker image
    docker build . -t reddit-forward-proxy
    1. Copy/move the key file (1.3.5) to this machine

    2. Run the image

    docker run -it -rm \
       -v /path/to/key/xxxxxxxxxxxxxxxxxx.json:/app/key.json
       -p 8089:8089
       reddit-forward-proxy
       /app/server --domain yourdomain.zitadel.cloud --key /app/key.json
    1. (Optional) Setup a reverse proxy (ex. cloudflared)
  3. Add request-url-template: <reddit-forward-proxy access url>/api/proxy?apiKey=<PAT from 1.4.4>&url={REQUEST-URL} to your glance.yml

...
           - type: reddit
             subreddit: selfhosted
+            request-url-template: reddit-forward-proxy.mydomain.com/api/proxy?apiKey=COp...jYI&url={REQUEST-URL}
  1. Done?

To do (possibly)

  • Make auth optional
  • Fix up defaults for docker image (... /app/server --domain yourdomain.zitadel.cloud --key /app/key.json is too verbose)

reddit-forward-proxy's People

Contributors

lastarc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.