Git Product home page Git Product logo

sing-box-install's Introduction

sing-box-install

Bash script for installing sing-box in operating systems such as Arch / CentOS / Debian / OpenSUSE that support systemd.

Filesystem Hierarchy Standard (FHS)

Upstream URL: sing-box

Installed: /usr/local/bin/sing-box
...
# Working Directory
WorkingDirectory=/var/lib/sing-box
##
...
# /etc/systemd/system/sing-box.service
ExecStart=/usr/local/bin/sing-box run -c /usr/local/etc/sing-box/config.json
##
# /etc/systemd/system/[email protected]
ExecStart=/usr/local/bin/sing-box run -c /usr/local/etc/sing-box/%i.json
##
...

Usage

bash -c "$(curl -L sing-box.vercel.app)" @ [ACTION] [OPTION]
Thanks @chika0801.
usage: install.sh [ACTION] [OPTION]...

ACTION:
install                   Install/Update sing-box
compile                   Compile sing-box
remove                    Remove sing-box
help                      Show help
If no action is specified, then help will be selected

OPTION:
  install:
    --beta                    Install latest Pre-release version of sing-box. 
    --go                      If it's specified, the scrpit will use go to compile sing-box then install.
    --version=[Version]       sing-box version tag, if you specified it, the script will install your custom version sing-box. 
    --user=[User]             Install sing-box in specified user, e.g, --user=root

  compile: 
  [shared with install when it is using go &  If theres no `go` in the machine, script will install go to `$HOME/.cache`]
    --tags=[Tags]             sing-box compile tags, the script will use your custom tags to compile sing-box. 
                              Default https://github.com/SagerNet/sing-box/blob/dev-next/Makefile#L5
    --prefix=[Path]           The path of scrpit store sing-box repository and go binary. 
                              Default `$HOME/.cache`
    --branch=[Branch/Tag]     The scrpit will compile your custom `branch` / `release tag` of sing-box.
    --cgo                     Set `CGO_ENABLED` environment variable to 1
    --win                     The scrpit will use go to compile windows version of sing-box. 
    --rm                      Remove temporary files, include sing-box repository and go binary.
  
  remove:
    --purge                   Remove all the sing-box files, include configs, compiletion etc.

Thanks

@chika0801

sing-box-install's People

Contributors

chise0713 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  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  avatar

Watchers

 avatar  avatar

sing-box-install's Issues

Debian12运行 install --go 报错

全新DD的Debian12开始。

使用命令:
bash -c "$(curl -L sing-box.vercel.app)" @ install --go

首次安装报错信息

INFO: No GO found in your machine.
INFO: Upstream GO version = 1.21.5
INFO: Installing GO
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    75  100    75    0     0    231      0 --:--:-- --:--:-- --:--:--   232
100 63.5M  100 63.5M    0     0  63.8M      0 --:--:-- --:--:-- --:--:--  108M
go version go1.21.5 linux/amd64
INFO: go installed PATH: /usr/sbin/go (soft symbolic link) PATH: /usr/lib/go/bin/go
INFO: Current compile "releaseTag / branch" is main-next
Using offcial default Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_clash_api.
environment: line 239: cd: /root/.cache: No such file or directory
ERROR: Failed to clone repository, check your permission.

第2次运行报错信息

root@localhost:~# bash -c "$(curl -L sing-box.vercel.app)" @ install --go
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 26886  100 26886    0     0  48160      0 --:--:-- --:--:-- --:--:-- 48160
build-essential	 Version=12.9 ARCH=amd64
INFO: GO Found, PATH=/usr/sbin/go
INFO: Current compile "releaseTag / branch" is main-next
Using offcial default Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_clash_api.
environment: line 239: cd: /root/.cache: No such file or directory
ERROR: Failed to clone repository, check your permission.
environment: line 555: sing-box: command not found
Installed: "/usr/share/bash-completion/completions/sing-box"
environment: line 565: sing-box: command not found
Installed: "/usr/share/fish/vendor_completions.d/sing-box.fish"
environment: line 575: sing-box: command not found
Installed: "/usr/share/zsh/site-functions/_sing-box"

Debian10运行正常。

CentOS 7 config file not found

[root@racknerd-446a34 ~]# bash -c "$(curl -L https://sing-box.vercel.app)" @ install % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 23760 100 23760 0 0 55782 0 --:--:-- --:--:-- --:--:-- 55782
@: line 489: /usr/lib/sysusers.d/sing-box.conf: No such file or directory
######################################################################## 100.0%
Newest version found: sing-box-1.6.6-linux-amd64
######################################################################## 100.0%
Installed "/usr/local/bin/sing-box"

I have reinstalled 3 times, and met same problem...

获取sing-box源代码关键部分缺失

debian12
使用 bash -c "$(curl -L sing-box.vercel.app)" @ install 出现报错 ERROR: Failed to Install "/usr/local/bin/sing-box" 转而使用编译命令 bash -c "$(curl -L sing-box.vercel.app)" @ compilebash -c "$(curl -L sing-box.vercel.app)" @ install --go,报错 ERROR: Failed to cd /root/.cache/sing-box
手动在 /root/.cache/ 中 git clone sing-box 源代码,再次执行才进入编译安装流程

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.