Git Product home page Git Product logo

clashup's Introduction

This is felinae98

  • 🌱 learning Rust
  • βš’οΈ Go / Python / Typescript / Docker / Kubernetes
  • 🍻 Member of BITNP
  • πŸ“ Arch Linux / Neovim / Zsh / Tmux
  • πŸ‘¨ Pronouns: he/him
  • πŸ“« [email protected]
  • 🎻 Epicore / Score / Musical & Opera

Metrics

clashup's People

Contributors

felinae98 avatar lisuke avatar sep2 avatar wjwoffline 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

clashup's Issues

Start Failed

clash.service - A rule based proxy in Go.
     Loaded: loaded (/usr/lib/systemd/user/clash.service; disabled; vendor preset: enabled)
    Drop-In: /etc/systemd/user/clash.service.d
             └─clashup.conf
     Active: failed (Result: exit-code) since Mon 2021-04-19 10:04:06 CST; 6s ago
    Process: 19317 ExecStartPre=/usr/bin/clashup --pre (code=exited, status=1/FAILURE)

4月 19 10:04:06 king-pc clashup[19317]:   File "/usr/bin/clashup", line 95, in update
4月 19 10:04:06 king-pc clashup[19317]:     parsed_clash_conf = self.parse_config(raw_clash_conf)
4月 19 10:04:06 king-pc clashup[19317]:   File "/usr/bin/clashup", line 76, in parse_config
4月 19 10:04:06 king-pc clashup[19317]:     self._load_conf(config, 'http_port', 'port')
4月 19 10:04:06 king-pc clashup[19317]:   File "/usr/bin/clashup", line 73, in _load_conf
4月 19 10:04:06 king-pc clashup[19317]:     config[config_key] = self.config[local_config_key]
4月 19 10:04:06 king-pc clashup[19317]: TypeError: 'str' object does not support item assignment
4月 19 10:04:06 king-pc systemd[1610]: clash.service: Control process exited, code=exited, status=1/FAILURE
4月 19 10:04:06 king-pc systemd[1610]: clash.service: Failed with result 'exit-code'.
4月 19 10:04:06 king-pc systemd[1610]: Failed to start A rule based proxy in Go..

I don't know why this line of code reports an error, is the python version reason?

 config[config_key] = self.config[local_config_key]
~ >>> python --version                                                                                                   [2]
Python 3.9.3

example config wrong format

    EXAMPLE_CONF = '''{
    "http_port": 7890,
    "socks5_port": 7891,
    "redir_port": 7892,
    "mixed_port": 7893,
    "allow_lan": true,
    "external_controller": "127.0.0.1:9090",
    "subscribe_url": "",
    "is_subscribe_banned": false,
    "custom_rules": [],
    "mmdb_file_url": "http://www.ideame.top/mmdb/Country.mmdb",
    "mmdb_version_url: "http://www.ideame.top/mmdb/version",
    "periodically_update": false
}
'''

"mmdb_version_url: "http://www.ideame.top/mmdb/version", missing a right double quote

clashr start fail

~ >>> systemctl --user start clash [1]
Job for clash.service failed because the control process exited with error code.
See "systemctl --user status clash.service" and "journalctl --user -xe" for details.
~ >>> systemctl --user status clash.service [1]
● clash.service - A rule based proxy in Go.
Loaded: loaded (/usr/lib/systemd/user/clash.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/user/clash.service.d
└─clashup.conf
Active: failed (Result: exit-code) since Fri 2020-12-11 22:44:22 CST; 9s ago
Process: 20731 ExecStartPre=/usr/bin/clashup --pre (code=exited, status=1/FAILURE)

12月 11 22:44:22 liuhjhj-pc clashup[20731]: File "/usr/lib/python3.8/json/init.py", line 357, in loads
12月 11 22:44:22 liuhjhj-pc clashup[20731]: return _default_decoder.decode(s)
12月 11 22:44:22 liuhjhj-pc clashup[20731]: File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
12月 11 22:44:22 liuhjhj-pc clashup[20731]: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
12月 11 22:44:22 liuhjhj-pc clashup[20731]: File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
12月 11 22:44:22 liuhjhj-pc clashup[20731]: obj, end = self.scan_once(s, idx)
12月 11 22:44:22 liuhjhj-pc clashup[20731]: json.decoder.JSONDecodeError: Expecting ':' delimiter: line 12 column 25 (char 584)
12月 11 22:44:22 liuhjhj-pc systemd[3548]: clash.service: Control process exited, code=exited, status=1/FAILURE
12月 11 22:44:22 liuhjhj-pc systemd[3548]: clash.service: Failed with result 'exit-code'.
12月 11 22:44:22 liuhjhj-pc systemd[3548]: Failed to start A rule based proxy in Go..
~ >>>

PKGBUILD issue

I think that python-yaml should be added to depends to make it works……

not use sub process to fetch mmdb

I find some warning log when i run systemctl --user start clash

clash.service: Found left-over process 2868 (python3) in control group while starting unit. Ignoring.
This usually indicates unclean termination of a previous run, or service implementation deficiencies

The clash server config ExecStartPre=/usr/bin/clashup --pre
and I find clashup script which use daemon to fetch mmdb. It will create a sub process.

if self.config.get('mmdb_version_url') and self.config.get('mmdb_file_url'):
    with daemon.DaemonContext():
        self.update_mmdb()

When I removed the mmdb configuration, it was just fine. And I find
https://www.freedesktop.org/software/systemd/man/systemd.service.html

Note that ExecStartPre= may not be used to start long-running processes. All processes forked off by processes invoked via ExecStartPre= will be killed before the next service process is run.

Maybe it should be deleted here.

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.