Code Monkey home page Code Monkey logo

rcub's Introduction

Raycast Unblock

Version License

Raycast Unblock is currently in heavy development, with frequent code updates, and you need to keep up with the latest developments in this project.

Unblock all features in Raycast Pro Plan.

Warning

This project is for educational purposes only. Please do not use it for commercial purposes.

Quick Start

docker run -d --name raycast-unblock -p 3000:3000 wibuswee/raycast-unblock:latest

More details can be found in Usage.

Warning

There are very many breaking updates in v0.1.0.beta.x -> v0.2.0.beta.0, go to Release for details!

Disclaimer

We only borrowed the operation interface of Raycast, and did not modify the backend server of Raycast.

We just coded a proxy server to forward Raycast's requests to our proxy server, and implemented similar functions in Raycast Pro Plan in other ways.

You can see all the code in the src directory. If you have any questions, please feel free to ask.

See Unblock Features and Unblock Routes for more details.

Unblock Features

  • Pro Plan Logo
  • AI Chat
  • Translations
  • Cloud Sync
    • iCloud Drive (Only for macOS)
    • Local Storage
  • Others
    • Theme Studio

If you have any feature requests, please feel free to ask.

Requirements

  • Node.js 18.x
  • Raycast
  • macOS / Linux (Windows is not maintained)
  • Surge (or other proxy tools) (optional)

Quick Links

Usage

Docker (Recommended)

You can use Docker to run Raycast Unblock.

Run

docker run -d \
  --name raycast-unblock \
  -p 3000:3000 \
  --config /path/to/your/config.toml:/app/config.toml \
  wibuswee/raycast-unblock:latest

You should replace /path/to/your/config.toml with your config.toml file path.

Docker Compose

You can use Docker Compose to run Raycast Unblock.

Download the docker-compose.yml file and modify the environment variables in it. Then run the following command:

docker-compose up -d

If you need to use config.toml file, please uncomment some lines in the docker-compose.yml file (They are commented out by default).

Download dist from actions

You can download the latest dist from GitHub Actions.

The naming format is raycast-unblock-<platform>-<type>.

  • js type is a small package with all dependencies bundled, but requires JS Runtime.
  • app type is a single application, which is larger but does not require JS Runtime.

Set environment variables

Copy / Download the config.example.toml file and rename it to config.toml, then fill in the environment variables.

After that, you should put the `config.toml file in the same directory as the executable file.

Run

# Your config.toml file should be in this directory, or you should set the `--config` parameter
node index.js # or ./raycast-unblock-app
# or
node index.js --config /path/to/your/config.toml

# ℹ Raycast Unblock
# ℹ Version: 0.0.0

If you want to run it in the background, you can use pm2 or nohup.

Use it with Surge

Warning

In some cases, if you find that Raycast Unblock is not working properly, please go to the settings of Surge, and uncheck the last line * in Surge -> HTTP -> Capture(捕获) -> Capture MITM Overrides(捕获 MITM 覆写), which is Modify MITM Hostname.

  1. Go to wibus-wee/activation-script and follow the installation instructions.
  2. Run Raycast Unblock and Surge.
  3. Open Raycast and use the features in the Pro Plan.

Note

At present, activation-script will not forward the requests of Translate to Raycast Unblock by default, but will immediately forward the requests to DeepLX in the script. If you need to use the translation function of Raycast Unblock, you need to modify the code manually, please refer to the documentation of activation-script for details.

If you don't have Surge

You need to throw all Raycast requests to the backend built by this project, but make sure that the backend can request Raycast Backend normally, because some functions need to request Raycast Backend once and then do it.

Other Proxy Tools

You can refer to the code in wibus-wee/activation-script and port it to other agent tools to continue using MiTM to hijack.

Hosts

You can modify your hosts file to make Raycast requests go to the backend built by this project.

<Your Backend IP> backend.raycast.com

Caution

This method can only be used when the backend is deployed remotely, and cannot be used when the backend is deployed locally.

For users who use remote deployment, we recommend using reverse proxy to make Raycast Unblock service can be accessed normally, but this method requires you to deploy SSL certificate remotely, otherwise it will be invalid. At the same time, general.host needs to be configured as 0.0.0.0 in the config.toml file.

Note

If you are building the backend locally, please do not let your proxy tool proxy both Raycast's requests and the backend service's requests, as this will cause it to not work properly.

Raycast Unblock adds an x-raycast-unblock header to requests to Raycast Backend. You can determine whether this is a request from Raycast or Raycast Unblock by the presence of this header, and make the backend service work properly through conditional judgment. ( Raycast Unblock has turned off SSL check by default)

Or you can deploy the backend to a remote server, and this will not be a problem.

Related Code

More

Deploy to remote server

Raycast Unblock can be deployed to a remote server, and then you can use it as a proxy server. But you need to modify the code in activator.js to make it work properly (if you are not using Modify Hosts method).

- "http://127.0.0.1:3000"
+ "<Your Remote Server Address>"

You should replace http://127.0.0.1:3000 with your remote server address.

Related Source Code

Use pm2

You can use pm2 to manage the process. You can run npm install -g pm2 to install it.

For example:

# Your config.toml file should be in this directory, or you should set the `--config` parameter
pm2 start index.mjs --name raycast-unblock
pm2 start ./raycast-unblock-app --name raycast-unblock

Features

Azure OpenAI

Assume you have such a azure endpoint link like following:

https://yourAzure.openai.azure.com/openai/deployments/yourDeployment/chat/completions?api-version=2023-07-01-preview

modify [AI.OpenAI] field in config.toml according to the following steps.

  1. set is_azure = true
  2. set base_url = https://yourAzure.openai.azure.com
  3. set azure_deployment_name = yourDeployment

azure_deployment_name is optional and when it isn't provided, using req.body.model as a substitute. It is useful when you want to use multiple models.

GitHub Copilot

Raycast Unblock provides a GitHub Copilot service, which can be used in Raycast feature.

Usage

  1. Open / Download scripts/get_copilot_token.mjs and run it.
  2. Follow the steps displayed in the terminal to get the token.
  3. Terminal will output the token, copy it.

Caution

Please do not leak this token to others, otherwise it may cause the GitHub Copilot service to be abused, resulting in your account being banned.

At the same time, if your backend is shared with others, please pay attention to the usage frequency to avoid deliberate abuse.

More

Or you can use aaamoon/copilot-gpt4-service to convert GitHub Copilot to OpenAI GPT API format, and you can use it to use GitHub Copilot.

Note

You should set AI.default to openai in the config.toml file, and set AI.OpenAI.baseUrl to the address of the copilot-gpt4-service service.

Shortcut Translator

Raycast Unblock provides a shortcut translator, which is only available on macOS. You can use it to translate text in Raycast Translate feature.

Usage

  1. Open iCloud Shortcut - RaycastUnblock.Translate.v1 and add it to your shortcuts.
  2. Modify your config.toml file and set Translate.type to shortcut.
  3. Run Raycast Unblock and use Raycast Translate feature.

Notice

  • This feature is only available on macOS.
  • Some languages may not be recognized, this is because the system's built-in translation engine is used, which may be due to incorrect dictionary settings or encountering languages not supported by the system.
  • If you are sure that it is a problem with the dictionary settings, you can submit an Issue or Pull Request to help us fix this problem.

AI Translator

You can use AI to translate text in Raycast Translate feature. Prompts provided by @zhuozhiyongde.

Notice

  • Pay attention to the request and usage issues, Translator may cause frequent requests to AI services, resulting in overuse or rate limit, so please use it carefully.

Q&A

I don't want to install Node.js, how can I use it?

You can use the app type dist, which is a single application, and does not require JS Runtime. Or use Docker to run it.

I don't buy Surge, how can I use it?

Referring to the relevant code of activation-script and porting it to other agent tools to continue using MiTM to hijack.

You can also use the Hosts file to forward Raycast requests to the backend service of Raycast Unblock.

Credits

Author

raycast-unblock © Wibus, Released under MIT. Created on Feb 2, 2024

Personal Website · Blog · GitHub @wibus-wee · Telegram @wibus✪

rcub's People

Contributors

wibus-wee avatar imsingee avatar renovate[bot] avatar jjaychen1e avatar maooyer avatar wanghanzhen avatar

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.