{"id":13579882,"url":"https://github.com/valeriansaliou/raider","last_synced_at":"2025-05-15T17:07:59.156Z","repository":{"id":43728284,"uuid":"116808032","full_name":"valeriansaliou/raider","owner":"valeriansaliou","description":"🐎 Affiliates dashboard. Used by affiliates to generate tracking codes and review their balance.","archived":false,"fork":false,"pushed_at":"2025-01-06T21:19:07.000Z","size":1913,"stargazers_count":193,"open_issues_count":5,"forks_count":37,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-07T23:04:51.919Z","etag":null,"topics":["affiliates","dashboard","sales","tracker","web"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/raider-server","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valeriansaliou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-09T11:34:17.000Z","updated_at":"2025-04-03T07:52:35.000Z","dependencies_parsed_at":"2024-08-01T15:31:33.853Z","dependency_job_id":"a469d1c0-9e3a-4124-88c0-f8664e3a3d14","html_url":"https://github.com/valeriansaliou/raider","commit_stats":{"total_commits":145,"total_committers":4,"mean_commits":36.25,"dds":0.02758620689655178,"last_synced_commit":"7afc884a96661eb93b18093e52279fa3366223d1"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fraider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fraider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fraider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fraider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valeriansaliou","download_url":"https://codeload.github.com/valeriansaliou/raider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affiliates","dashboard","sales","tracker","web"],"created_at":"2024-08-01T15:01:44.348Z","updated_at":"2025-05-15T17:07:54.146Z","avatar_url":"https://github.com/valeriansaliou.png","language":"Rust","funding_links":["https://www.buymeacoffee.com/valeriansaliou"],"categories":["Rust"],"sub_categories":[],"readme":"Raider\n======\n\n[![Test and Build](https://github.com/valeriansaliou/raider/workflows/Test%20and%20Build/badge.svg?branch=master)](https://github.com/valeriansaliou/raider/actions?query=workflow%3A%22Test+and+Build%22) [![Build and Release](https://github.com/valeriansaliou/raider/workflows/Build%20and%20Release/badge.svg)](https://github.com/valeriansaliou/raider/actions?query=workflow%3A%22Build+and+Release%22) [![dependency status](https://deps.rs/repo/github/valeriansaliou/raider/status.svg)](https://deps.rs/repo/github/valeriansaliou/raider) [![Buy Me A Coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/valeriansaliou)\n\n**Affiliates dashboard. Used by affiliates to generate tracking codes and review their balance.**\n\nRaider is easy to integrate in your existing system. You can also customize the dashboard look \u0026 feel with templates and styles. It can be used as a self-service affiliates system, for your affiliate users to manage their account, create tracking URLs, review their balance and request for payouts.\n\n_Tested at Rust version: `rustc 1.51.0-nightly (c8915eebe 2021-01-07)`_\n\n**🇭🇺 Crafted in Budapest, Hungary.**\n\n![Raider](https://valeriansaliou.github.io/raider/images/raider.png)\n\n## Who uses it?\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://crisp.chat/\"\u003e\u003cimg src=\"https://valeriansaliou.github.io/raider/images/crisp-icon.png\" width=\"64\" /\u003e\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd align=\"center\"\u003eCrisp\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n_👋 You use Raider and you want to be listed there? [Contact me](https://valeriansaliou.name/)._\n\n## Features\n\n* **Self-service affiliates dashboard**\n* **Users can generate affiliates tracking codes**\n* **Users can see their affiliates statistics** (eg. how much money they made)\n* **Users can request for payouts** (you then receive a notification email)\n* **Your backend reports referred customer payments to Raider**\n\n## How does it work?\n\nRaider provides a self-service affiliates dashboard on which users can sign up, login, and manage their account (eg. create tracking codes, request for payouts, etc.). Your backend can report referred customer payments to Raider, so that the affiliates can cash out their commission and request for a payout at any point.\n\n**Raider provides two services:**\n\n* **Self-service dashboard**: Used by your affiliates users\n* **Payment reporting API**: Called by your backend once a payment is made (ie. to credit due commission money to an affiliate)\n\n## How to use it?\n\n### Installation\n\n**Install from releases:**\n\nThe best way to install Raider is to pull the latest release from the [Raider releases](https://github.com/valeriansaliou/raider/releases) page.\n\nMake sure to pick the correct server architecture (eg. Intel 32 bits).\n\n👉 _Each release binary comes with an `.asc` signature file, which can be verified using [@valeriansaliou](https://github.com/valeriansaliou) GPG public key: [:key:valeriansaliou.gpg.pub.asc](https://valeriansaliou.name/files/keys/valeriansaliou.gpg.pub.asc)._\n\n**Install from packages:**\n\nRaider provides [pre-built packages](https://packagecloud.io/valeriansaliou/raider) for Debian-based systems (Debian, Ubuntu, etc.).\n\n**Important: Raider only provides 64 bits packages targeting Debian 12 for now (codename: `bookworm`). You might still be able to use them on other Debian versions, as well as Ubuntu (although they rely on a specific `glibc` version that might not be available on older or newer systems).**\n\nFirst, add the Raider APT repository (eg. for Debian `bookworm`):\n\n```bash\necho \"deb [signed-by=/usr/share/keyrings/valeriansaliou_raider.gpg] https://packagecloud.io/valeriansaliou/raider/debian/ bookworm main\" \u003e /etc/apt/sources.list.d/valeriansaliou_raider.list\n```\n\n```bash\ncurl -fsSL https://packagecloud.io/valeriansaliou/raider/gpgkey | gpg --dearmor -o /usr/share/keyrings/valeriansaliou_raider.gpg\n```\n\n```bash\napt-get update\n```\n\nThen, install the Raider package:\n\n```bash\napt-get install raider\n```\n\nThen, edit the pre-filled Raider configuration file:\n\n```bash\nnano /etc/raider/raider.cfg\n```\n\nFinally, restart Raider:\n\n```\nservice raider restart\n```\n\n**Install from Cargo:**\n\nIf you prefer managing `raider` via Rust's Cargo, install it directly via `cargo install`:\n\n```bash\ncargo install raider-server\n```\n\nEnsure that your `$PATH` is properly configured to source the Crates binaries, and then run Raider using the `raider` command.\n\n**Install from source:**\n\nThe last option is to pull the source code from Git and compile Raider via `cargo`:\n\n```bash\ncargo build --release\n```\n\nYou can find the built binaries in the `./target/release` directory.\n\n_Install the `libssl-dev` (ie. OpenSSL headers) and `libmysqlclient-dev` (ie. MySQL client headers) before you compile Raider. SSL dependencies are required for email notifications, and MySQL dependencies are required to connect to your database._\n\n**Install from Docker Hub:**\n\nYou might find it convenient to run Raider via Docker. You can find the pre-built Raider image on Docker Hub as [valeriansaliou/raider](https://hub.docker.com/r/valeriansaliou/raider/).\n\nFirst, pull the `valeriansaliou/raider` image:\n\n```bash\ndocker pull valeriansaliou/raider:v1.2.3\n```\n\nThen, seed it a configuration file and run it (replace `/path/to/your/raider/config.cfg` with the path to your configuration file):\n\n```bash\ndocker run -p 8080:8080 -v /path/to/your/raider/config.cfg:/etc/raider.cfg valeriansaliou/raider:v1.2.3\n```\n\nIn the configuration file, ensure that:\n\n* `server.inet` is set to `0.0.0.0:8080` (this lets Raider be reached from outside the container)\n* `assets.path` is set to `./res/assets/` (this refers to an internal path in the container, as the assets are contained there)\n\nRaider will be reachable from `http://localhost:8080`.\n\n### Database\n\nRaider requires a MySQL to be running on your host (it is unfortunately not compatible with PostgreSQL and others, _at the moment_).\n\nThe Raider SQL schema should be imported in the Raider database you created, which you can find at [raider.sql](https://github.com/valeriansaliou/raider/blob/master/doc/fixtures/raider.sql).\n\n### Configuration\n\nUse the sample [config.cfg](https://github.com/valeriansaliou/raider/blob/master/config.cfg) configuration file and adjust it to your own environment.\n\n---\n\n**⚠️ Important: Make sure to change the default `server.secret_key`, `server.track_token` and `server.management_token` configuration values with secret keys you generated. Also, generate a random arbitrary length string for `database.password_salt`. Failing to change any of those values will make your Raider instance insecure. You can easily create these tokens by running `openssl rand -base64 32`.**\n\n---\n\n**Available configuration options are commented below, with allowed values:**\n\n**[server]**\n\n* `log_level` (type: _string_, allowed: `debug`, `info`, `warn`, `error`, default: `error`) — Verbosity of logging, set it to `error` in production\n* `inet` (type: _string_, allowed: IPv4 / IPv6 + port, default: `[::1]:8080`) — Host and TCP port the Raider service should listen on\n* `workers` (type: _integer_, allowed: any number, default: `4`) — Number of workers for the Raider service to run on\n* `track_token` (type: _string_, allowed: secret token, default: no default) — Track API secret token (ie. secret password)\n* `management_token` (type: _string_, allowed: secret token, default: no default) — Management API secret token (ie. secret password)\n* `secret_key` (type: _string_, allowed: 192-bit base64 encoded secret key, default: no default) — Secret key for cookie encryption (see [Rocket docs](https://api.rocket.rs/rocket/struct.Config.html#method.set_secret_key) for details)\n\n**[database]**\n\n* `url` (type: _string_, allowed: MySQL URL, no default) — URL of the MySQL database to connect to\n* `pool_size` (type: _integer_, allowed: any number, default: `4`) — Number of connections to maintain to MySQL\n* `idle_timeout` (type: _integer_, allowed: seconds, default: `300`) — Idle timeout in seconds to MySQL\n* `connection_timeout` (type: _integer_, allowed: seconds, default: `10`) — Connection timeout in seconds to MySQL\n* `password_salt` (type: _string_, allowed: any string, no default) — Password salt (preferably strong and long; do not change this after accounts got created as it will make them unusable)\n* `account_create_allow` (type: _boolean_, allowed: `true`, `false`, default: `true`) — Whether to allow accounts to be created or not\n\n**[exchange]**\n\n**[exchange.fixer]**\n\n* `endpoint` (type: _string_, allowed: any string, default: `https://api.apilayer.com/fixer`) — Fixer API endpoint (on APILayer)\n* `api_key` (type: _string_, allowed: any string, no default) — APILayer API key (for Fixer)\n\n**[email]**\n\n* `from` (type: _string_, allowed: email address, no default) — Email address from which to send emails\n* `smtp_host` (type: _string_, allowed: hostname, IPv4, IPv6, default: `localhost`) — SMTP host to connect to\n* `smtp_port` (type: _integer_, allowed: TCP port, default: `587`) — SMTP TCP port to connect to\n* `smtp_username` (type: _string_, allowed: any string, no default) — SMTP username to use for authentication (if any)\n* `smtp_password` (type: _string_, allowed: any string, no default) — SMTP password to use for authentication (if any)\n* `smtp_encrypt` (type: _boolean_, allowed: `true`, `false`, default: `true`) — Whether to encrypt SMTP connection with `STARTTLS` or not\n\n**[assets]**\n\n* `path` (type: _string_, allowed: UNIX path, default: `./res/assets/`) — Path to Raider assets directory\n\n**[branding]**\n\n* `page_title` (type: _string_, allowed: any string, default: `Affiliates`) — Affiliates system title\n* `page_url` (type: _string_, allowed: URL, no default) — Affiliates system URL\n* `help_url` (type: _string_, allowed: URL, no default) — Help URL to be used in dashboard (ie. knowledge base where users can search for help)\n* `support_url` (type: _string_, allowed: URL, no default) — Support URL to be used in dashboard (ie. where users can contact you if something is wrong)\n* `icon_color` (type: _string_, allowed: hexadecimal color code, no default) — Icon color (ie. your icon background color)\n* `icon_url` (type: _string_, allowed: URL, no default) — Icon URL, the icon should be your squared logo, used as favicon (PNG format recommended)\n* `logo_white_url` (type: _string_, allowed: URL, no default) — Logo URL, the logo should be your full-width logo, used as login, signup \u0026 account recover form logo (whiter logo, SVG format recommended)\n* `logo_dark_url` (type: _string_, allowed: URL, no default) — Logo URL, the logo should be your full-width logo, used as dashboard header logo (darker logo, SVG format recommended)\n* `custom_html` (type: _string_, allowed: HTML, default: empty) — Custom HTML to include in affiliates system `head` (optional)\n\n**[tracker]**\n\n* `track_url` (type: _string_, allowed: tracker URL, no default) — Tracker URL, to which tracker links will point to\n* `track_parameter` (type: _string_, allowed: tracker query parameter, default: `t`) — Tracker query parameter used in URL (eg. `?t=xDJSas10`)\n* `commission_default` (type: _float_, allowed: percentage from `0.00` to `1.00`, default: `0.20`) — Default commission percentage (for new accounts)\n\n**[[tracker.banner]]**\n\n* `banner_url` (type: _string_, allowed: image URL, no default) — URL to the banner image\n* `size_width` (type: _integer_, allowed: image size in pixels, no default) — Width of the banner (in pixels)\n* `size_height` (type: _integer_, allowed: image size in pixels, no default) — Height of the banner (in pixels)\n\n**[payout]**\n\n* `currency` (type: _string_, allowed: currency code, default: `EUR`) — Currency to be used for payouts (and balances in general)\n* `amount_minimum` (type: _float_, allowed: any number, default: `100.00`) — Minimum amount for payout requests\n* `administrator_email` (type: _string_, allowed: email address, no default) — Email address of the affiliates system administrator (payout request emails will be sent there)\n\n### Run Raider\n\nRaider can be run as such:\n\n`./raider -c /path/to/config.cfg`\n\n## How can I integrate Raider reporting in my code?\n\nWhen a payment for which you have a `tracking_id` is made on your platform (ie. a payment for a customer that was referred by an affiliate); your backend needs to submit this payment to the Raider tracking API. The full payment amount needs to be submitted, as the commission percentage is applied by Raider itself.\n\n### Raider reporting libraries\n\n* **Python**: **[py-raider-reporter](https://pypi.org/project/py-raider-reporter/)**\n\n👉 Cannot find the library for your programming language? Build your own and be referenced here! ([contact me](https://valeriansaliou.name/))\n\n## How can I use Raider HTTP APIs?\n\n### 1️⃣ Track API\n\n#### Payment tracking\n\nIn case you need to manually report tracked payments to the Raider endpoint, use the following HTTP configuration (adjust it to yours):\n\n**Endpoint URL:**\n\n`HTTP POST https://affiliates.example.com/track/payment/\u003ctracking_id\u003e/`\n\nWhere:\n\n* `tracking_id`: The tracking identifier associated to customer who paid\n\n**Request headers:**\n\n* Add an `Authorization` header with a `Basic` authentication where the password is your configured `server.track_token`.\n\n**Request data:**\n\nAdjust the request data to your payment context and send it as `HTTP POST`:\n\n```json\n{\n  \"amount\": 95.00,\n  \"currency\": \"EUR\",\n  \"trace\": \"Plan: Unlimited; Customer: valerian@crisp.chat; Website: crisp.chat\"\n}\n```\n\nWhere:\n\n* `amount`: The full amount of the payment (Raider process the commission amount itself, eg. with `20%` commission you send `100.00` and Raider processes it as `20.00`)\n* `currency`: The payment currency code (if the currency is different than the default currency configured with `payout.currency`, a conversion is applied using current day market rates)\n* `trace`: An optional trace value which is logged in the database (may be used for your own records; this is never visible to your affiliate users)\n\n#### Signup tracking\n\nIn case you need to manually report tracked signups to the Raider endpoint, use the following HTTP configuration (adjust it to yours):\n\n**Endpoint URL:**\n\n`HTTP POST https://affiliates.example.com/track/signup/\u003ctracking_id\u003e/`\n\nWhere:\n\n* `tracking_id`: The tracking identifier associated to customer who signed up\n\n**Request headers:**\n\n* Add an `Authorization` header with a `Basic` authentication where the password is your configured `server.track_token`.\n\n### 2️⃣ Management API\n\n#### Account creation\n\nIn case you need to create accounts in Raider database from a third-party system in your infrastructure (eg. if regular signups are disabled), you may us create new accounts via the Raider endpoint, use the following HTTP configuration (adjust it to yours):\n\n**Endpoint URL:**\n\n`HTTP POST https://affiliates.example.com/management/account/`\n\n**Request headers:**\n\n* Add an `Authorization` header with a `Basic` authentication where the password is your configured `server.management_token`.\n\n**Request data:**\n\nAdjust the request data to your payment context and send it as `HTTP POST`:\n\n```json\n{\n  \"email\": \"john.doe@gmail.com\",\n  \"full_name\": \"John Doe\",\n  \"address\": \"1 Market Street, San Francisco, CA\",\n  \"country\": \"US\"\n}\n```\n\nWhere:\n\n* `email`: The email address for the new account (an auto-generated password will be sent to this email)\n* `full_name`: An optional full name value to preconfigure in the created account\n* `address`: An optional address value to preconfigure in the created account\n* `country`: An optional country value to preconfigure in the created account\n\n## :fire: Report A Vulnerability\n\nIf you find a vulnerability in Raider, you are more than welcome to report it directly to [@valeriansaliou](https://github.com/valeriansaliou) by sending an encrypted email to [valerian@valeriansaliou.name](mailto:valerian@valeriansaliou.name). Do not report vulnerabilities in public GitHub issues, as they may be exploited by malicious people to target production servers running an unpatched Raider server.\n\n**:warning: You must encrypt your email using [@valeriansaliou](https://github.com/valeriansaliou) GPG public key: [:key:valeriansaliou.gpg.pub.asc](https://valeriansaliou.name/files/keys/valeriansaliou.gpg.pub.asc).**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleriansaliou%2Fraider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaleriansaliou%2Fraider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleriansaliou%2Fraider/lists"}