Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Index settings to follow changes in the Index configuration #18

Closed
josecelano opened this issue Jun 13, 2024 · 0 comments · Fixed by #19
Closed

Update Index settings to follow changes in the Index configuration #18

josecelano opened this issue Jun 13, 2024 · 0 comments · Fixed by #19
Assignees
Milestone

Comments

@josecelano
Copy link
Member

josecelano commented Jun 13, 2024

Relates to: torrust/torrust-index#591

The Index configuration has been changed (breaking changes). The new settings object:

{
  "data": {
    "logging": {
      "log_level": "info"
    },
    "website": {
      "name": "Torrust"
    },
    "tracker": {
      "api_url": "http://localhost:1212/",
      "mode": "public",
      "token": "***",
      "token_valid_seconds": 7257600,
      "url": "udp://localhost:6969"
    },
    "net": {
      "base_url": null,
      "bind_address": "0.0.0.0:3001",
      "tsl": null
    },
    "auth": {
      "email_on_signup": "optional",
      "secret_key": "***",
      "password_constraints": {
        "max_password_length": 64,
        "min_password_length": 6
      }
    },
    "database": {
      "connect_url": "sqlite://data.db?mode=rwc"
    },
    "mail": {
      "email_verification_enabled": false,
      "from": "example@email.com",
      "reply_to": "noreply@email.com",
      "smtp": {
        "port": 25,
        "server": "",
        "credentials": {
          "password": "***",
          "username": ""
        }
      }
    },
    "image_cache": {
      "capacity": 128000000,
      "entry_size_limit": 4000000,
      "max_request_timeout_ms": 1000,
      "user_quota_bytes": 64000000,
      "user_quota_period_seconds": 3600
    },
    "api": {
      "default_torrent_page_size": 10,
      "max_torrent_page_size": 30
    },
    "tracker_statistics_importer": {
      "port": 3002,
      "torrent_info_update_interval": 3600
    }
  }
}

For example:

Tracker:

pub enum TrackerMode {
    /// Will track every new info hash and serve every peer.
    #[serde(rename = "public")]
    Public,

    /// Will only track whitelisted info hashes.
    #[serde(rename = "listed")]
    Listed,

    /// Will only serve authenticated peers
    #[serde(rename = "private")]
    Private,

    /// Will only track whitelisted info hashes and serve authenticated peers
    #[serde(rename = "private_listed")]
    PrivateListed,
}

Index:

pub enum TrackerMode {
    /// Will track every new info hash and serve every peer.
    #[serde(rename = "public")]
    Public,

    /// Will only track whitelisted info hashes.
    #[serde(rename = "listed")]
    Listed,

    /// Will only serve authenticated peers
    #[serde(rename = "private")]
    Private,

    /// Will only track whitelisted info hashes and serve authenticated peers
    #[serde(rename = "private_listed")]
    PrivateListed,
}

This repo:

export enum TrackerMode {
    Public,
    Private,
    Whitelisted,
    PrivateWhitelisted
}

It should be:

export enum TrackerMode {
    Public,
    Listed,
    Private,
    PrivateListed
}

And we should add a serialization/deserialization from lowercase strings: public, listed, private, private_listed.

@josecelano josecelano added this to the v3.0.0 milestone Jun 13, 2024
@josecelano josecelano self-assigned this Jun 13, 2024
@josecelano josecelano changed the title Update TrackerMode enum to match TrackerMode enum in Tracker Update Index settings to follow changes in the Index configuration Jun 13, 2024
josecelano added a commit to josecelano/torrust-index-types-lib that referenced this issue Jun 13, 2024
josecelano added a commit to josecelano/torrust-index-types-lib that referenced this issue Jun 13, 2024
@josecelano josecelano linked a pull request Jun 14, 2024 that will close this issue
josecelano added a commit that referenced this issue Jun 14, 2024
5596fea feat!: [#18] udpate settings type to follow changes in API (Jose Celano)

Pull request description:

  Update settings type to follow changes in API.

ACKs for top commit:
  josecelano:
    ACK 5596fea

Tree-SHA512: 3e69deeace43852a9501628c9822de7c87d8dbbcc6d39a092b615cd85235e33b1e33f7d800b32e53c0e7f9bff2e04df0eddb51506af5972c1fa8026be8271f58
josecelano added a commit to torrust/torrust-index-gui that referenced this issue Jun 14, 2024
570c46e chore(deps): update torrust-index-types-lib (Jose Celano)

Pull request description:

  [Index settings have changed](torrust/torrust-index-types-lib#18).

Top commit has no ACKs.

Tree-SHA512: 76ded3da25a5e77a1400c1d8406eb656d1ec95304149d0d05e1a4acf2e16cda0a577e4900107f49a6fa840c2c80b14d2962559596d2c297cf13dca704fbc3f60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant