Git Product home page Git Product logo

permanent-seeder's Introduction

permanent-seeder

CI Status

npm version

JavaScript Style Guide standard-readme compliant

Made by GEUT

Permanent Seeder logo, a  beautiful seed surrounded with a round and exquisite black border

Install

npm i -g @geut/permanent-seeder

Alternatively you can git clone this repo and build it from source:

# install deps
npm i
npm run bootstrap

# build the dashboard
cd packages/dashboard
cp .env.example .env
npm run build

# start the seeder
cd ../cli
./bin/run stop
./bin/run start

Usage

First, create a base config file, you can tweak it later ;-)

$ permanent-seeder config:init

Then, start the Permanent Seeder daemon

$ permanent-seeder start

πŸš€

Commands

$ permanent-seeder [COMMAND] [--OPTIONS]

Config

$ permanent-seeder config:[init|get]
  • init: creates the base config file for the Permanent Seeder. This is a .toml file that will live in ~/permanent-seeder/settings.toml.
  • get: returns the settings from the CLI. Useful when you are changing values and want to be sure they are pick up by the Permanent Seeder.

Default settings:

## Permanent seeder path (will be completed on config:init)
path = 'permanent-seeder'

## Enable stats recording
save_stats = true

## [optional] Preferred swarm port
# swarm_port =

## [optional] Api service settings
# [api]
# port = 3001

## [optional] HTTPS certificate and key
# [api.https]
# cert = "/path/to/cert.crt"
# key = "/path/to/cert.key"

## keys.endpoints = array of configs per endpoint
[[keys.endpoints]]

  # Where to fetch keys
  url = 'http://localhost:3000'

  # Frequency between fetchs (in minutes)
  frequency = 5

  # Hook to parse response
  hook = 'endpoint-hook.js'

## [optional] To add another endpoint, uncomment and complete next lines:
# [[keys.endpoints]]
#   url =
#   frequency =
#   hook

Start

$ permanent-seeder start

Bootstrap a Permanent Seeder instance that will keep up running in the background. If you change settings, you will need to call start command again.

Status

$ permanent-seeder status

It will return instance status. If it is running and some basic stats.

Stop

$ permanent-seeder stop

Stops the current instance.

Dashboard

$ permanent-seeder dashboard

Opens the dashboard app in a browser. If you want to manually access the dashboard, it can be found in: localhost:3001

⚠️ Note: The dashboard app runs in http://localhost:3001. If you deploy the Permanent Seeder on a server and wants to access the dashboard from the outside, you may need to setup a reverse proxy.

Sample nginx reverse proxy config
upstream dashboard-nodejs {
        server  127.0.0.1:3001;
}

server {
	listen 80 default_server;
	listen [::]:80 default_server;

	server_name _;

        location / {
                proxy_pass              http://dashboard-nodejs;
                proxy_next_upstream     error timeout invalid_header http_500 http_502 http_503 http_504;
                proxy_redirect          off;
                proxy_buffering         off;

                proxy_set_header        Host                    $host;
                proxy_set_header        X-Real-IP               $remote_addr;
                proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto       $scheme;
        }

        location /socket.io/ {
                proxy_pass              http://dashboard-nodejs;
                proxy_redirect          off;

                proxy_http_version      1.1;

                proxy_set_header        Upgrade                 $http_upgrade;
                proxy_set_header        Connection              "upgrade";
                proxy_set_header        Host                    $host;
                proxy_set_header        X-Real-IP               $remote_addr;
                proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
        }
}

Environment Variables

We use the .env.example file as a placeholder for some environment variables that we use internally, like PUBLIC_URL.

If you build the Permanent Seeder from source then you may want to customize some things.

There are two variables that can be used:

  • PUBLIC_URL: used to define the root path of the dashboard app. DEFAULT = '/'
  • REACT_APP_API_VERSION: used to indicate the api version to use. DEFAULT = 'v1'

For development there are a few others variables that you can tweak, like the SOCKET_URL and API_URL. Checkout the full .env.example:

REACT_APP_API_VERSION=v1
PUBLIC_URL=/

## Extend eslint config
EXTEND_ESLINT=true

## Optional ENVs only for development
#REACT_APP_SOCKET_URL=
#REACT_APP_API_URL=

Key Management πŸ”‘

$ permanent-seeder key:[add|remove|remove-all]
  • add: Insert a new key Permanent Seeder db, it will start downloading and seeding ASAP.
  • remove: Removes a single key from the seeder db and also stops seeding it (e.g.: no more announcing to other peers)
  • remove-all: Removes and unnanounce all the keys in the db.

Logs

$ permanent-seeder logs --[live|all|error]
  • live: like doing a tail -f of the logs.
  • all: Show all the logs stored.
  • error: Display only error logs.

repl

$ permanent-seeder repl

Useful to inspect the Permanent Seeder under the hood. πŸ”¬

Keys Endpoint

The Permanent Seeder can fetch keys from an external endpoint, i.e: perform a GET request against a particular endpoint. This can be useful if you maintain a service that stores hyperdrive's keys. If that is the case, then the Permament Seeder can fetch those keys regularly. You can think of this like a cron job.

Whilst, we internally expect an Array<{url}>, you can customize and parse the fetch response the way you need it.

To do this, you will need to modify $HOME/permanent-seeder/endpoint-hook.js.

That hook will be called after fetch the response.

You can also tweak the fetch frequency (defined in minutes) and the endpoint url. These options can be found in the settings.toml file:

[[keys.endpoints]]
url = "http://localhost:3000"
frequency = 5
hook = "$HOME/permanent-seeder/endpoint-hook.js"

Delete Keys Endpoint

The Permanent Seeder also allows for another endpoint, this one for deleted keys. With this action the Permanent Seeder can fetch an array of keys similarly to what we defined previously for the keys endpoint (adding).

The setting looks like this:

 [[keys.remove]]
 url = "http://localhost:60620/deletes.json"
 hook = "/Users/deka/permanent-seeder/endpoint-hook.js"

Again, we internally expect an Array<{url}>, but you can customize and parse the fetch response the way you need it.

To do this, you can tweak the hook response. By default the "delete keys endpoint" is using the same default hook used with the keys endpoint.

Finally, the fetch frequency is managed by the keys endpoint frequency. In other words, they run with the same frequency interval.

Update Policy

Here are some rules that we follow to know when to update the keys.

Actions that result in update:

  • add endpoint is defined and returns a list of keys. delete endpoint is not defined. βœ…
  • add endpoint is defined and returns a list of keys. delete endpoint is defined and returns a list of keys. βœ…

Actions that does not result in update:

  • add endpoint is defined and returns an empty list. Does not matter if delete endpoint is defined or not. β›”
  • add endpoint is defined but throws an error β›”
  • add endpoint is defined and returns a list of keys. delete endpoint is defined but throws an error. β›”

Design

The Permanent Seeder is a CLI tool that can starts a daemon which will seed hyperdrive's keys that you pass into it. Using the CLI you can add, remove keys, check the status and inspect logs.

It also contains a dashboard that you can use to have a visual reference of what is going on with your hyperdrives.

As you can see the project does a couple of things. To do this we decided to use a microservices based approach. We choose to use moleculer as the structural framework behind the Permanent Seeder. This enables multiples processes to communicate each other and at the same time each of these will have a single responsibility/scope. This also give us some room to scale things up if needed. :sunglasses:

Routes

Below we define some internal API routes that can be used to obtain some information about the PS running instance as well as some basic drive queries.

GET /api/<API_VERSION>/drives/:key

Returns summary data associated to a specific drive key. Data may contain download information, peers info, seeding status and basic index.json information and version.

GET /api/<API_VERSION>/drives/:key/size

Returns only the download information.

GET /api/<API_VERSION>/drives/:key/peers

Returns only the peers information.

GET /api/<API_VERSION>/drives/:key/stats

Returns only information about the drive's files and its download status.

GET /api/<API_VERSION>/drives/:key/info

Returns only the index.json information part.

GET /api/<API_VERSION>/drives/:key/seedingStatus

Returns only the seeding status label.

GET /api/<API_VERSION>/drives/:key/files/:file

Download the file passed as argument from key drive.

GET /api/v1/stats/host

Returns information about the host. CPU load, memory and directory usage.

GET /api/v1/stats/network

Returns network information. Include things like online status, swarm information (hole-punching, bootstrapping info and network address), along with transferred bytes.

GET /api/<API_VERSION>/raw/:key

Returns the raw data associated with the seeded drive (key). The returned data may include various lifecycle events with their timestamps. This endpoint will return values as long as save_stats config property is enabled. See config.

Filter by Version

You can also query data using the drive version.

GET /api/<API_VERSION>/drives/:key/versions

Returns all the versions saved for key drive

GET /api/<API_VERSION>/drives/:key/:version/info

Returns only the info field for this specific key and version

GET /api/<API_VERSION>/drives/:key/:version/stats

Returns only the stats (files) field for this specific key and version

GET /api/<API_VERSION>/drives/:key/:version/files/:file

Download the file passed as argument from a specific drive's checkout (key+version).

Release

For releasing new versions we are using GitHub Actions πŸš€ This is the process.

  1. First, we create a new release branch: git co -b username/release-${newVersion}
  2. Then, we need to create the new version. This new version will trigger a changelog update (using chan). To do this just run: npm run release It will prompt you what is the next version.
  3. Create the release pull-request. The title should indicate this: Release: newVersion
    • ⚠️ This is an important step, otherwise the publish workflow won't see the PR.
  4. Finally, when the release PR is approved, a custom action will be triggered publishing the new version to npm, creating a new tag for it and creating a brand new github release πŸ†• πŸ“¦

Issues

πŸ› If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

πŸ‘₯ Ideas and contributions to the project are welcome. You must follow this guideline.

Built in collaboration with Liberate Science

Liberate Science

Acknowledgments

πŸ‘ Many thanks to @nicomanso for offering some basic infrastructure that was used for early testing and @krahser for his outstanding docker contribution (PR)

License

MIT Β© A GEUT project

permanent-seeder's People

Contributors

chartgerink avatar dependabot[bot] avatar dpaez avatar estebanprimost avatar juliangruber avatar nicomanso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

permanent-seeder's Issues

stats api service

Initial work around connecting the dashboard with API stats events.

release: re-visit release process

Automatic release process is not working. We have a problem in the tagging step. We want to tag a previous commit than the one that comes with the action call. To do this we pass the (current_sha ^ 1) to the tag step and this result in an error since adding the valid ^1 triggers a validation error on the input limit (more characters than expected)

Public URL strategy

  • Dashboard should always be deployed in localhost:PORT
  • User should take care of proxy reverse localhost:PORT to his public URL
  • Add nginx or traefik examples

Update: connectivity method is deprecated

It looks like hyperswarm connectivity method is being softly deprecated. Since this was related to some errors (Error: All bootstrap nodes failed ) seen in the past weeks, we are going to stop using it and instead call holepunchable and remoteAddress methods directly.

hook for allowing other endpoints

Currently there is one PR (#77 ) that focus on the vault endpoint from libscie. A collateral result from that PR is the relaxing on things that PS expects from other endpoints (ie: array<{ url }>).

But it might be interesting to allow some parsing mechanism defined by the user that allows any input obtained by fetching ps endpoint_url to become a list of urls that the seed accepts.

Update `api/raw/:key` recorded events

With the recent changes that result in a more clear hyperdrive's life cycle we need to update and reflect this life cycle into the output of api/raw/:key.
It would be good to see the moment when a drive is added to the seeder, when the download starts, finish, peer updates, stats calls and such.

Update readme

We should highlight:

  • install method (npm and/or standalone)
  • usage example
  • commands
  • dashboard
  • how to contribute
  • made in collaboration with Liberate Science
  • sponsoring/donations

Duplicate events

If multiple PS are started and discovered (via current transporter) they all are receiving same events by duplicate.

dashboard: add network indicator

We could do something similar to what hypergraph does here. A simple network indicator, color based with tooltip information.

  • red: no network/offline
  • yellow: limited (not holepunchable)
  • green: everything is good πŸ‘

We can also display the remoteAddress.

Most of this information is currently available under the api/stats/swarm endpoint.

new: metrics service

  • prepare local db for metrics
    • prepare some queries like "get latest metrics". This is going to be used from the dashboard.
  • save metrics
  • emit events

daemonize process

Check different strategies for daemonize-ing the process, should work on multiple platforms.

key-remove: call unseed

On key removal, the seeder service should notice about this and call unseed. We can use some events here.

Bad size

The drive.size() method is returning block size for some directories. We should compute directory content files size instead.

This causes wrong information on Dashboard.

always tries to connect to localhost:3001

I started the services according to the readme, and even tried to change the dashboard/.env to

PUBLIC_URL=http://46.101.192.138:3001/
EXTEND_ESLINT=true

But the dashboard still tries to connect to localhost:3001:

image

I did an npm run build in the dashboard directory after changing the config, and then ran cli/bin/run start --restart.

Rename package names

  package-folder       package-name
------------------------------------------------------
  /cli                 @geut/permanent-seeder
  /seeder              @geut/permanent-seeder-core
  /sdk (services)      @geut/permanent-seeder-sdk
  /database            @geut/permanent-seeder-database

Tweaks for vault api integration

We can start using the modules endpoint and start adjusting the response parse on our end. We are currently expecting the following params:

   "params": {
    "keys": {
      "type": "array",
      "items": {
        "type": "object",
        "props": {
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "empty": "false"
          },
          "id": {
            "type": "number"
          },
          "created_at": {
            "type": "string"
          }
        }
      }
    }

We can relax those as just expect an url. Everything else will be optional for now.

cli/database: should accept keys with proto

For improving dx/ux around how keys are added to the system it would be good to allow prefixed or not prefixed keys. This is, keys should be encoded.

Last, the key:add command should support the version param, as a new parameter passed to key add.

This is related to issue #55

Replication status 0% upon full replication?

While debugging the Hypergraph application, @juliangruber and I stumbled upon something in the permanent seeder.

Specifically, where the Hyperdrive was replicated (only containing an index.json) but the replication state was at 0%. It seemed like the replication was instead at 100%.

This line calculates the download percentage, and we wondered whether the 0% might be an artifact because there are 0 blocks? Here, 0 / (0 || 1) = 0% but in this scenario it could be seen as a complete replication?

This is not a crucial issue; wanted to note it for tracking.

Feed not ready

When adding a key, dashboard is querying information before feed content is ready.

json db

We can use node-json-db or a similar module for keys storage on the cli.

  • Search and evaluate a json db module

Clipboard breaks dashboard

Hi πŸ‘‹

When I try to copy-paste something from liberate science's permanent-seeder instances, the screen turns white and this error pops up in the console: TypeError: navigator.clipboard is undefined

Reporting here in case this wasn't already on the radar ☺️ Happy to provide any additional information I might've forgotten.

dashboard app

Simple dashboard app used to show permanent-seeder metrics. Some of the things that we can display:

  • upload/download per drive
  • machine resources
  • disk usage

Dashboard: show hyperdrive version

This can be added as a small label somewhere that indicates the hyperdrive version. The version can change if the original hyperdrive is updated, so we need to update this value on every update event.

machine stats not displaying

on GET /api/stats/host, this is returned:

top.time is not a function

from the logs:

    TypeError: top.time is not a function
        at Service.handler (/home/ubuntu/.npm-global/lib/node_modules/@geut/permanent-seeder/node_modules/@geut/permanent-seeder-sdk/src/services/metrics.service.js:85:23)
        at async Service.handler (/home/ubuntu/.npm-global/lib/node_modules/@geut/permanent-seeder/node_modules/@geut/permanent-seeder-sdk/src/services/metrics.service.js:112:23)
        at async Service.handler (/home/ubuntu/.npm-global/lib/node_modules/@geut/permanent-seeder/node_modules/@geut/permanent-seeder-sdk/src/services/metrics.service.js:29:9)
        at async Promise.all (index 0)
        at async Promise.all (index 0)

HTTPS integration?

Currently any deployment that is reachable over the web is HTTP.

It might be nice to include a certbot/letsencrypt integration during the setup of the permanent seeder to ensure HTTPS? I am putting up this issue for discussion :)

research: what happens with checkouts

What happens if the user wants to seed a checkouted drive?

The permanent seeder should be able to accept and handle versioned keys: key+version.

A versioned drive won't change, its like a snapshot. Showing the version on the dashboard and that is a checkout is important. We can get that info from the hyperdrive.

CLI: add status command

It would be nice to have a status command like many other services have. This command will output if there is an active permanent-seeder instance running.

metrics: interpretation, hierarchies and organisation

This can include:

  • download
    • interpret the data sources we have (hypercore, hyperdrive.stat and hyperdrive.stats)
    • decide which data source is the more accurate (and when?) and organise it accordingly for display
  • upload
    • interpret the data sources we have (hypercore, hyperdrive.stat and hyperdrive.stats)
    • decide which data source is the more accurate (and when?) and organise it accordingly for display
  • seed ratio
  • disk usage
  • cpu usage
  • uptime
  • peers available
  • network indicator
  • swarm stats

stop command fails

root@permanent-seeder-ubuntu-s-1vcpu-1gb-fra1-01:~/permanent-seeder# ./packages/cli/bin/run stop
(node:327285) Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-update' }
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
(node:327285) Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-warn-if-update-available' }
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
root@permanent-seeder-ubuntu-s-1vcpu-1gb-fra1-01:~/permanent-seeder# DEBUG=* ./packages/cli/bin/run stop
  @oclif/config reading core plugin /root/permanent-seeder/packages/cli +0ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/package.json +0ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/oclif.manifest.json +4ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/.oclif.manifest.json +1ms
  @oclif/config:@geut/permanent-seeder loading IDs from /root/permanent-seeder/packages/cli/src/commands +0ms
  @oclif/config:@geut/permanent-seeder found commands [ 'dashboard',
  'logs',
  'repl',
  'start',
  'status',
  'stop',
  'config:get',
  'config',
  'config:init',
  'key:add',
  'key:get',
  'key',
  'key:remove-all',
  'key:remove' ] +19ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/dashboard.js +5ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/logs.js +172ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/repl.js +9ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/start.js +232ms
  pm2:paths pm2 home resolved to /root/.pm2 /root +0ms
  pm2:conf Using 2 parallelism (CONCURRENT_ACTIONS) +0ms
  pm2:client Using RPC file /root/.pm2/rpc.sock +0ms
  pm2:client Using PUB file /root/.pm2/pub.sock +0ms
  interactor:client [PING INTERACTOR] Trying to connect to Interactor daemon +0ms
  axon:sock connect attempt null:/root/.pm2/interactor.sock +0ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/status.js +181ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/stop.js +16ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/config/get.js +2ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/config/index.js +2ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/config/init.js +1ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/key/add.js +2ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/key/get.js +173ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/key/index.js +3ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/key/remove-all.js +1ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/key/remove.js +3ms
  @oclif/config reading user plugins pjson /root/.local/share/@geut/permanent-seeder/package.json +0ms
  @oclif/config loadJSON /root/.local/share/@geut/permanent-seeder/package.json +897ms
  axon:sock error ENOENT +213ms
  axon:sock ignored ENOENT +1ms
  @oclif/config loading plugins [ '@oclif/plugin-autocomplete',
  '@oclif/plugin-help',
  '@oclif/plugin-update',
  '@oclif/plugin-warn-if-update-available' ] +6ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/package.json +7ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/package.json +1ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/package.json +0ms
  @oclif/config loadJSON /root/permanent-seeder/packages/cli/package.json +0ms
  @oclif/config loadJSON /root/permanent-seeder/packages/package.json +19ms
  @oclif/config loadJSON /root/permanent-seeder/packages/package.json +1ms
  @oclif/config loadJSON /root/permanent-seeder/packages/package.json +1ms
  @oclif/config loadJSON /root/permanent-seeder/packages/package.json +0ms
  @oclif/config reading core plugin /root/permanent-seeder/node_modules/@oclif/plugin-autocomplete +0ms
  @oclif/config loadJSON /root/permanent-seeder/node_modules/@oclif/plugin-autocomplete/package.json +1ms
  @oclif/config reading core plugin /root/permanent-seeder/node_modules/@oclif/plugin-help +0ms
  @oclif/config loadJSON /root/permanent-seeder/node_modules/@oclif/plugin-help/package.json +0ms
  @oclif/config loadJSON /root/permanent-seeder/package.json +1ms
  @oclif/config loadJSON /root/permanent-seeder/package.json +0ms
  @oclif/config loadJSON /root/permanent-seeder/node_modules/@oclif/plugin-autocomplete/oclif.manifest.json +2ms
  @oclif/config loadJSON /root/permanent-seeder/node_modules/@oclif/plugin-help/oclif.manifest.json +1ms
  @oclif/config loadJSON /root/package.json +1ms
  @oclif/config loadJSON /root/package.json +0ms
  @oclif/config loadJSON /package.json +0ms
  @oclif/config loadJSON /package.json +1ms
(node:327324) Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-update' }
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-update' }
    at Plugin.load (/root/permanent-seeder/node_modules/@oclif/config/lib/plugin.js:91:19)
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
(node:327324) Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-warn-if-update-available' }
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
Error Plugin: @geut/permanent-seeder: could not find package.json with { type: 'core',
  root: '/root/permanent-seeder/packages/cli',
  name: '@oclif/plugin-warn-if-update-available' }
    at Plugin.load (/root/permanent-seeder/node_modules/@oclif/config/lib/plugin.js:91:19)
module: @oclif/[email protected]
task: loadPlugins
plugin: @geut/permanent-seeder
root: /root/permanent-seeder/packages/cli
See more details with DEBUG=*
  @oclif/config:@oclif/plugin-autocomplete using manifest from /root/permanent-seeder/node_modules/@oclif/plugin-autocomplete/oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-help using manifest from /root/permanent-seeder/node_modules/@oclif/plugin-help/oclif.manifest.json +0ms
  @oclif/config config done +39ms
  @oclif/config start init hook +1ms
  @oclif/config init hook done +1ms
  permanent-seeder init version: @oclif/[email protected] argv: [ 'stop' ] +0ms
  @oclif/config runCommand stop [] +6ms
  @oclif/config:@geut/permanent-seeder require /root/permanent-seeder/packages/cli/src/commands/stop.js +57ms
  @oclif/config start prerun hook +1ms
  @oclif/config prerun hook done +0ms
  permanent-seeder:stop init version: @oclif/[email protected] argv: [] +0ms
  pm2:client [PING PM2] Trying to connect to server +269ms
  axon:sock connect attempt null:/root/.pm2/rpc.sock +51ms
  axon:sock connect +2ms
  axon:sock add socket 0 +0ms
  axon:queue flush 0 messages +0ms
  axon:sock closing +1ms
  axon:sock closing 1 connections +1ms
  pm2:client Daemon alive +4ms
  axon:sock remove socket 0 +1ms
  pm2:client Launching RPC client on socket file /root/.pm2/rpc.sock +2ms
  axon:sock connect attempt null:/root/.pm2/rpc.sock +1ms
  axon:sock connect +1ms
  axon:sock add socket 0 +0ms
  axon:queue flush 0 messages +4ms
  pm2:client RPC Connected to Daemon +1ms
  pm2:client Calling daemon method pm2:getMonitorData on rpc socket:/root/.pm2/rpc.sock +14ms
  pm2:client Calling stopWatch +6ms
  pm2:client Calling daemon method pm2:stopProcessId on rpc socket:/root/.pm2/rpc.sock +1ms
  pm2:client Calling daemon method pm2:notifyByProcessId on rpc socket:/root/.pm2/rpc.sock +2ms
  axon:sock closing +25ms
  axon:sock closing 1 connections +0ms
  axon:sock remove socket 0 +1ms
  pm2:client PM2 RPC cleanly closed +4ms
  pm2:cli The session lasted 0.035s +0ms
  @oclif/config start postrun hook +38ms
  @oclif/config postrun hook done +1ms
  axon:sock attempting reconnect +24ms
  axon:sock closing +0ms
  axon:sock closing 0 connections +1ms
  interactor:client Interactor Daemon not launched +325ms
  axon:sock connect attempt null:/root/.pm2/interactor.sock +0ms
  axon:sock error ENOENT +1ms
  axon:sock ignored ENOENT +0ms

config package

Move config base api out of cli package.

I think is better to have core config things on a separate package. Specially this module and some deps that are being required.

What do you think @dpaez ?

Route documentation

It seems like the route documentation in the README is incomplete. I know that there is at least an api/drives route that currently is not included.

Are there any other routes that are not documented but included in the permanent-seeder?

I'm happy to make a pull request to add the doc for the routes I know, if desired.

re-enable stats storage and expose raw api for db access/listing

We would like to persist stats (this could be optional and enabled by default, so you can opt out). For improving stats management in the dashboard we disabled temporarily the stats storage. This task involves:

  • listening to some events emitted from the seeder.service on metrics.service
  • save stats. We may possibly add the event name as part of the key for some future filtering.
  • add api endpoint api/raw/:key

Cli

  • cli package

Show drive title if possible

Now that we fetch the index.json and that we relaxed the need for a title on key add, it would be best to display the title from the index.json. If there is no index.json nor title, we can auto generate the following title: Drive-${key.substring(0,6)}

This is only for the drive listing on the dashboard.

key retrieval

Add a mechanism for key retrieval from the vault. This should be configurable if we need to do some long polling action (interval). The result can be merged with the keys.json (local db)

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.