1. 19 Oct, 2015 16 commits
    • Stavros Sachtouris's avatar
      Move heartbeat update operations to main session · 0ed942f0
      Stavros Sachtouris authored
      Instead of updating the "heart" database from the context of each
      connection, update it from the context of the helper session.
      The connections will still poll the database to decide whether
      they are going to stay open and still have the authority to empty
      the database when there is a shutdown request.
      0ed942f0
    • Stavros Sachtouris's avatar
      Retry when database is locked · 3a031ec2
      Stavros Sachtouris authored
      3a031ec2
    • Stavros Sachtouris's avatar
      fb628ecc
    • Stavros Sachtouris's avatar
      Implement all CLI commands · 3cc6c0f2
      Stavros Sachtouris authored
      Removed: launch_daemon, stop_daemon
      New: start, shutdown, pause
      
      start: Start syncing. If the daemon is not running, launch it
      shutdown: Cleanly shutdown everything in Agkyra (backend, GUI,
          daemons)
      pause: Set the running Agkyra session to "paused" mode
      3cc6c0f2
    • Stavros Sachtouris's avatar
      Implement clean shutdown with multiple UIs · f0f7db82
      Stavros Sachtouris authored
      To shutdown all UIs, one has to "stop" the heart of the UI session.
      The heart of a UI session is a database relation in the
      "session.db" database. It is emptied when a shutdown message is
      received by a running WebSocketProtocol instance.
      
      All other connections periodically check the heart and update its
      timestamp. When the tupple containing the session id is empty, all
      connections of the same sesion die.
      
      The WSGI server, which is running as a member of a SessionHelper
      instance, is shut down by a simpling threaded method launched by
      the SessionHelper before running the server. This method is called
      _shutdown_daemon and is polling the database every 4 seconds. When
      the database is empty, it sends a shutdown signal to the WSGI
      server.
      
      These changes affect the way an Agkyra daemon is launched, as well
      as the "launch_daemon" and "stop_daemon" CLI commands.
      f0f7db82
    • Stavros Sachtouris's avatar
      Implement "launch" and "stop" CLI commands · 34303d51
      Stavros Sachtouris authored
      These commands can be used to launch and stop the agkyra daemon
      34303d51
    • Stavros Sachtouris's avatar
      f387bc28
    • Stavros Sachtouris's avatar
      76054d6d
    • Stavros Sachtouris's avatar
      Implement the "config" CLI commands · b277f39f
      Stavros Sachtouris authored
      The commands are "config list | set | delete" and can be used to
      manage the agkyra settings, which can also be modified by editing
      the configuration file.
      b277f39f
    • Giorgos Korfiatis's avatar
      move code one level up · 20b13007
      Giorgos Korfiatis authored
      20b13007
    • Stavros Sachtouris's avatar
      Modify helper class to support multiple clients · c8e45554
      Stavros Sachtouris authored
      The class is renamed to "SessionHelper" and moved to
      "agkyra.protocol". It uses the session database to get information
      about the status of the protocol server.
      
      The session database is used to store the address and ui_id of the
      protocol server as well as a time stamp. The helper uses this
      information to resolve if the protocol server is active. If the
      server is active, the helper assumes there is a session running and
      allows the client to use the session credentials to connect to it.
      Otherwise, it generates new session credentials and offers the
      ability to start a protocol server.
      
      The GUI class is also modified to raise an assertion error if
      another GUI is already running. This is resolved by comparing the
      session information stored in the session file with the one
      provided by the helper. If they match, a GUI is running, otherwise
      a new GUI is launched.
      c8e45554
    • Giorgos Korfiatis's avatar
      Add copyright notice · b6dafd0b
      Giorgos Korfiatis authored
      b6dafd0b
    • Stavros Sachtouris's avatar
      Update status in GUI even when paused · 3583a569
      Stavros Sachtouris authored
      3583a569
    • Giorgos Korfiatis's avatar
      Use stop_decide() · 152cc8b0
      Giorgos Korfiatis authored
      152cc8b0
    • Stavros Sachtouris's avatar
      7f3aad51
    • Stavros Sachtouris's avatar
      Implement a config system and a CLI · 07cab2e5
      Stavros Sachtouris authored
      The config system is an extension of the kamaki config system,
      tailored to support configuration files with multiple clouds and
      multiple syncs. A sync contains all the attributes needed to sync
      a local directory with a remote container, included a reference to
      a cloud.
      
      The CLI is interactive and can be used to start, pause and control
      the syncing process.
      07cab2e5