GithubHelp home page GithubHelp logo

ursar-bot's People

Contributors

chalx avatar vrachieru avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ursar-bot's Issues

Token expires after 24h and is not renewed

The Skype token is valid for 24h after its creation and it is not properly renewed via SkypeConnection#refreshSkypeToken.
More info can be found in this and this issue.

As a temporary solution, the container can be restarted as follows:

*/5 * * * * /srv/ursar-bot/restart.sh
skype_username='username'
skype_password='password'
container_name='ursar'

is_running=$(docker exec ursar echo true 2>/dev/null || echo false)

echo "Is running: $is_running"

if [ "$is_running" = "true" ]
then
  start=$(docker inspect -f {{.State.StartedAt}} "$container_name")
  start_ts=$(date -d "$start" '+%s')
  now_ts=$(date '+%s')
  running_hours=$(( ( now_ts - start_ts ) / (60*60) ))
  echo "Running hours: $running_hours"
fi

if [ "$is_running" = "false" ]
then
  echo "Starting $container_name container"
  docker run --rm -t -e URSAR_SKYPE_USERNAME="$skype_username" -e URSAR_SKYPE_PASSWORD="$skype_password" --name "$container_name" academiadeursarie/ursar-bot
fi

if [ "$is_running" = "true" ] && [ "$running_hours" -ge "24" ]
then
  echo "Restarting $container_name container"
  docker stop "$container_name" && docker run --rm -t -e URSAR_SKYPE_USERNAME="$skype_username" -e URSAR_SKYPE_PASSWORD="$skype_password" --name "$container_name" academiadeursarie/ursar-bot
fi

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.