Coder Social home page Coder Social logo

jelmer / redirect-webfinger Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 36 KB

Simple webfinger redirect implementation (to e.g. another Mastodon server)

License: Apache License 2.0

Dockerfile 3.14% Makefile 2.83% Python 94.03%
mastodon webfinger

redirect-webfinger's Introduction

Simple redirecting webfinger implementation

This simple webfinger implementation just redirects a single webfinger address to another server. I use it to allow people to find my mastodon profile via my personal server.

Example usage:

$ redirect-webfinger [email protected] \
     --mastodon-server=mastodon.cloud \
     --mastodon-user=jelmer

The only URL it exposes is /.well-known/webfinger, which you would probably want to expose via your reverse HTTP proxy.

Or using docker/podman:

$ podman run ghcr.io/jelmer/redirect-webfinger \
     -e [email protected] \
     -e MASTODON_SERVER=mastodon.cloud \
     -e MASTODON_USER=jelmer

redirect-webfinger's People

Contributors

jelmer avatar shuuji3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

shuuji3 fauli1221

redirect-webfinger's Issues

Does not appear to pick up environment variables running on Docker on WSL

It throws this error with the correct account specified:

WARNING:root:Unknown resource: 'acct:[email protected]'

When started with

docker run --name webfinger -p 8080:8080 -e [email protected] -e MASTODON_SERVER=mastodon.social -e MASTODON_USER=user ghcr.io/jelmer/redirect-webfinger:latest

If started with

docker run --name webfinger -p 8080:8080 ghcr.io/jelmer/redirect-webfinger:latest [email protected] --mastodon-server=mastodon.social --mastodon-user=user

It correctly returns the expected JSON response.

It looks like it is failing to pick up the environment variable as specified at https://github.com/jelmer/redirect-webfinger/blob/main/redirect_webfinger/__main__.py#L39

    parser.add_argument(
        '--acct', type=str, help='Example: [email protected]', nargs='*',
        default=os.environ.get('ACCT'))

I confirmed that the environment variables were correctly set.

Docker Desktop 4.13.1 on Ubuntu 22.04.1 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64) on Windows 11 Pro.

Suggested run for Docker on WSL as shown above in second example passing in arguments as command line, rather than setting as environment variables.

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.