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

[Subscription] Support decoding after fetching config. #162

Closed
Pairman opened this issue Jul 21, 2024 · 1 comment · Fixed by #163
Closed

[Subscription] Support decoding after fetching config. #162

Pairman opened this issue Jul 21, 2024 · 1 comment · Fixed by #163
Labels
enhancement New feature or request

Comments

@Pairman
Copy link

Pairman commented Jul 21, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

My subscription links returns a base64 encoded file, rather than plain text. This is causing mihoro setup, or mihomo test to fail.

Describe the solution you'd like

Add a config entry like remote_config_encoding or something. If it's base64, I can manually set it to base64 and mihoro will decode that for me ,automatically.

Describe alternatives you've considered
Currently I'm manually doing curl <sub_url> | base64 -d -.

Additional context

[pairman@fedora Downloads]$ mihoro setup
mihoro: Setting up mihomo's binary, config, and systemd service...
mihoro: Assuming mihomo binary already installed at /home/pairman/.local/bin/mihomo, skipping setup
download: Downloaded to /home/pairman/.config/mihomo/config.yaml
          00:00:00 - Download speed 0 B/s                                                               
error: invalid type: string "<br /> <b>Warning</b>", expected struct MihomoYamlConfig
[pairman@fedora Downloads]$ mihomo test
FATA[2024-07-21T14:53:05.364926708+08:00] Parse config error: yaml: line 2: mapping values are not allowed in this context 

@Pairman Pairman added the enhancement New feature or request label Jul 21, 2024
@spencerwooo
Copy link
Owner

Noted, the base64 crate should suffice. Would appreciate a PR if possible ;)

spencerwooo added a commit that referenced this issue Sep 19, 2024
Added support for base64 encoded remote config, fixes #162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants