Minotar - The Miner's Avatar

Discussion in 'Bukkit Tools' started by clone1018, Aug 18, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    obscurehero

    IF you want to run this locally and not use the super easy API. Then yeah...so this wasn't here before, or I couldn't find it, so here are better instructions than on github...

    To install and run...
    Code:
    # aptitude install golang
    $ mkdir $HOME/go
    $ export GOPATH=$HOME/go
    $ go get github.com/Axxim/Minotar/minotard
    $ cp -Rf $GOPATH/src/github.com/Axxim/Minotar/minotard/static $GOPATH/bin
    $ $GOPATH/bin/minotard
    To setup reverse proxy with nginx.
    Code:
    location /minotar/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://localhost:9999/;
        proxy_redirect http://localhost:9999/ http://$server_name/;
    }
    Obviously you can change things here. I built using lukegb's repo, for example. You also don't have to redirect calls to the subdirectory /minotar/. You could set location to '/' in a virtual server under a subdomain. Say minotar.example.com/helm/[username]. I also set my GOPATH to $HOME/go. You could set this to be anything, just make sure you set it.

    If you want it to run at startup, you might consider creating astartup script. If anyone can hook me up, that'd be awesome, otherwise I'll teach myself... I suppose I should learn.
     
  2. Offline

    clone1018

    Over at minotar.net we use
    Code:
    #!/bin/sh
    SERVICE='minotard'
     
    if ps ax | grep -v grep | grep $SERVICE > /dev/null
    then
        echo "$SERVICE service running, everything is fine"
    else
        echo "$SERVICE is not running"
        cd /home/minotar/go/bin/
        screen -dmS minotard ./minotard
    fi
    
    along with a cron, this starts the service back up when it crashes.
     
    obscurehero likes this.
  3. Offline

    obscurehero

    I created a script to run it as a daemon. Is this bad? :/

    Here's what I created.
    Code:
    #!/bin/sh
     
    ### BEGIN INIT INFO
    # Provides:          minotard
    # Required-Start:    $local_fs $remote_fs $network $syslog
    # Required-Stop:    $local_fs $remote_fs $network $syslog
    # Default-Start:    2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: starts the minotard server
    # Description:      starts minotard using start-stop-daemon
    ### END INIT INFO
     
    NAME=minotard
    DESC=minotard
    DAEMON=/path/to/minotar/$NAME
    PID_FILE=/var/run/$NAME.pid
    RUN_AS=nobody
     
    test -x $DAEMON || exit 0
     
    set -e
     
    #. /lib/lsb/init-functions
     
    case "$1" in
            start)
                    echo -n "Starting $DESC: "
                    start-stop-daemon -c $RUN_AS --start --quiet --background \
                        --pidfile $PID_FILE  --make-pidfile --exec $DAEMON
                    echo "$NAME."
                    ;;
     
            stop)
                    echo -n "Stopping $DESC: "
                    start-stop-daemon --stop --quiet --pidfile $PID_FILE \
                        --exec $DAEMON
                    echo "$NAME."
                    ;;
     
            restart|force-reload)
                    echo -n "Restarting $DESC: "
                    start-stop-daemon --stop --quiet --pidfile $PID_FILE \
                        --exec $DAEMON || true
                    #Wait
                    sleep 2
     
                    start-stop-daemon -c $RUN_AS --start --quiet --background \
                        --pidfile $PID_FILE  --make-pidfile --exec $DAEMON
                    echo "$NAME."
                    ;;
     
            *)
                    echo "Usage: $NAME {start|stop|restart|reload|force-reload}" >&2
                    exit 1
                    ;;
    esac
     
    exit 0
    
    then you run '# insserv minotard' and you're golden. It auto adds it to the right /etc/rc#.d files.

    EDIT: clone1018 - Super grateful for this tool! Thanks for making it open source. I have my scripts fail over to minotar (and fishbans actually) should my own service fail. I just liked having it sourced locally.
     
  4. Offline

    clone1018

    Hey guys, just an update. Minotar now supports invalidly cased usernames, so CLONE1018 will translate to clone1018 (and show clone1018's avatar!). I've also improved the service a bit and made a modular Go minecraft library you can find here: https://github.com/minotar/minecraft

    Let me know if you have any issues or want a feature added or something.
     
    lmc likes this.
  5. Awesome stuff! This fixes up a lot of issue with @buycraft customers using incorrect cases on their name and it pulling the incorrect avatar.
     
    ivan111 and lmc like this.

  6. Great work as usual, your service has been brilliant for the years we've used it.
     
  7. Offline

    Adriani6

    It's currently down for me ? CloudFlare says so at least.
     
  8. Offline

    clone1018

  9. Offline

    Adriani6

    This is what I get,


    It works, loads two faces, and leaves two not working, any idea ?
     
  10. Offline

    clone1018

  11. Offline

    Adriani6

  12. Offline

    clone1018

    Read the cloudflare.com question again :p

    Also try the static link, what do you get?
     
  13. Offline

    Adriani6

  14. Offline

    clone1018

    Ah, it's this specific skin, checking it out now.
     
  15. Offline

    Adriani6

    It's not only that one. It happens to quite a few.
     
  16. Offline

    clone1018

  17. Offline

    Mister_Fix

  18. Offline

    clone1018

    That's fine, Minotar in the public domain for a reason.

    Although stealing my skin too is a bit weird.

    Your issue has been patched :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
    Adriani6 likes this.
  19. Offline

    Adriani6

    Much appreciated.
     
  20. Offline

    Mister_Fix

    now worries, it was just a test, probably gonna change it some when today or tomorrow
    by the way, when i changed my skin it took minotar some time to update, would you be able to fix that?
     
  21. Offline

    clone1018

    That's a feature not a bug :). URL's are cached for a day.
     
  22. Offline

    Mister_Fix

    MCHeads only caches the avatars themselves, not the URL's ._.
    but why would you cache the url for a day?

    By the way, do you think it would be possible for you to add a 3D head feature like in http://cravatar.eu/ pretty please?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  23. Offline

    clone1018

    Performance & stability reasons. It's part of the reason we're able to serve millions of unique avatars daily.
     
  24. Offline

    Mister_Fix

    I get it, so do you think you could make something like cravatar's 3D heads?
     
  25. Offline

    clone1018

    Don't think so, haven't tried, you're welcome to contribute the code though and I'll merge it in.
     
  26. Offline

    Mister_Fix

    well i need to cut the head and hat from the skin image, but i have no idea what are the coords, i have tried to search in google but got no help.
    also, if i contribute my code it will be only in PHP, i dont know any other server side languages so you will have to transform in into GO yourself, and it will help me alot of you give me my script back in GO :)

    plus i work on alot of features for that 3D heads if i make it, so it could take quite alot of time.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  27. Offline

    Mister_Fix

  28. Offline

    TNTUP


    Oi if you make it open source, im sure ill take it if frdmn request doesn't fill my request, though..
     
  29. Offline

    Mister_Fix

    it's like 10% done though..
     
  30. Offline

    tyzoid

    clone1018
    Any interest in adding full avatars? This is similar to what I do with s.mclist.me:
    [​IMG][​IMG][​IMG]
     
Thread Status:
Not open for further replies.

Share This Page