archlinuxcn / repo

Arch Linux CN Repository
1.51k stars 291 forks source link

[package request] xray #1996

Closed showgood163 closed 3 years ago

showgood163 commented 3 years ago

问题类型 / Type of issues


xray, v2ray的“进化”版本,二进制需要重新编译

已有AUR

请看AUR

https://github.com/XTLS/Xray-core

xray, v2ray的“进化”版本,二进制需要重新编译

imlonghao commented 3 years ago

这名字我还以为是 https://github.com/chaitin/xray

SilverRainZ commented 3 years ago

这名字我还以为是 https://github.com/chaitin/xray

hhhh 贵司的 xray 应该是不让分发的。

AkinoKaede commented 3 years ago

剛想來提交 PkgReq 就看到了 xray-bin 是直接使用二進制檔的 不應該被打包 另外再提一個 xray-git

AkinoKaede commented 3 years ago

xray-geoip…
我已經在 service 中設定環境變量為 XRAY_LOCATION_ASSET=/usr/share/v2ray

AkinoKaede commented 3 years ago

鄙人認為無需單獨打包 xray-domain-list-community 和 xray-geoip

AkinoKaede commented 3 years ago

鄙人認為無需單獨打包 xray-domain-list-community 和 xray-geoip

一是 Project X 本身沒有類似的項目。
二是 用戶如果同時安裝 v2ray 和 xray 就得同時安裝四個依賴,其中兩兩相同。
三是 資源路徑問題可以通過在 systemd 中設定環境變量解決。
至於,用戶在 Terminal 中執行的情況,其實就算存在 /usr/share/xray,用戶也需要手動設定 XRAY_LOCATION_ASSET 或是在 /usr/bin 中建立軟連接才能正常使用。

dctxmei commented 3 years ago

Hi Akino Kaede,

Sorry, I just saw your message.

Please see: https://github.com/XTLS/Xray-core/blob/main/common/platform/others.go

// GetAssetLocation search for `file` in certain locations
func GetAssetLocation(file string) string {
    const name = "xray.location.asset"
    assetPath := NewEnvFlag(name).GetValue(getExecutableDir)
    defPath := filepath.Join(assetPath, file)
    for _, p := range []string{
        defPath,
        filepath.Join("/usr/local/share/xray/", file),
        filepath.Join("/usr/share/xray/", file),
    } {
        if _, err := os.Stat(p); os.IsNotExist(err) {
            continue
        }

        // asset found
        return p
    }

    // asset not found, let the caller throw out the error
    return defPath
}

I think this is enough to solve the problem, thank you for your contribution, I will continue to pay attention to the development of the project.

:)

On Mon, Nov 30, 2020 at 02:49:27AM -0800, 秋のかえで wrote:

鄙人認為無需單獨打包 xray-domain-list-community 和 xray-geoip

一是 Project X 本身沒有類似的項目。
二是 用戶如果同時安裝 v2ray 和 xray 就得同時安裝四個依賴,其中兩兩相同。
三是 資源路徑問題可以通過在 systemd 中設定環境變量解決。
至於,用戶在 Terminal 中執行的情況,其實就算存在 /usr/share/xray,用戶也需要手動設定 XRAY_LOCATION_ASSET 或是在 /usr/bin 中建立軟連接才能正常使用。

-- You are receiving this because you were assigned. Reply to this email directly or view it on GitHub: https://github.com/archlinuxcn/repo/issues/1996#issuecomment-735709250

-- Dct Mei

-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEXCinkBYJKwYBBAHaRw8BAQdA5H9IxywOaNmJIWhPWmOW373e5qV9B2XX4uaN 8Dj/os60G0RjdCBNZWkgPGRjdHhtZWlAZ21haWwuY29tPoiQBBMWCAA4FiEEezFL 5328og4C3bvAUL+LcS3K1+oFAlwop5ACGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQUL+LcS3K1+pb5AD9Em35W0ACv4sd1wsDLscHUP/9bsso4qz8Jakh49Tc 5MwBALgLJfruyp+waU/TgJNR9bfAntsN59NUvoElC0b/P94LuDgEXCinkBIKKwYB BAGXVQEFAQEHQDGv8eGzsh+tFkh8Yfibp4Mtv94AwyN45x1AguzUVUcjAwEIB4h4 BBgWCAAgFiEEezFL5328og4C3bvAUL+LcS3K1+oFAlwop5ACGwwACgkQUL+LcS3K 1+pHggEA0QzrA6N+72SKchinmmaH1vBk8zcg8EGfxTTMgvttRQUBAL+SqHLwuhfV OHgQi6COC+SQI5jrRAYhjrJoc+KHvHMI =F48x -----END PGP PUBLIC KEY BLOCK-----

AkinoKaede commented 3 years ago

Hi Akino Kaede, Sorry, I just saw your message. Please see: https://github.com/XTLS/Xray-core/blob/main/common/platform/others.go // GetAssetLocation search for `file` in certain locations func GetAssetLocation(file string) string { const name = "xray.location.asset" assetPath := NewEnvFlag(name).GetValue(getExecutableDir) defPath := filepath.Join(assetPath, file) for _, p := range []string{ defPath, filepath.Join("/usr/local/share/xray/", file), filepath.Join("/usr/share/xray/", file), } { if _, err := os.Stat(p); os.IsNotExist(err) { continue } // asset found return p } // asset not found, let the caller throw out the error return defPath } I think this is enough to solve the problem, thank you for your contribution, I will continue to pay attention to the development of the project. :) On Mon, Nov 30, 2020 at 02:49:27AM -0800, 秋のかえで wrote: > 鄙人認為無需單獨打包 xray-domain-list-community 和 xray-geoip 一是 Project X 本身沒有類似的項目。 二是 用戶如果同時安裝 v2ray 和 xray 就得同時安裝四個依賴,其中兩兩相同。 三是 資源路徑問題可以通過在 systemd 中設定環境變量解決。 至於,用戶在 Terminal 中執行的情況,其實就算存在 /usr/share/xray,用戶也需要手動設定 XRAY_LOCATION_ASSET 或是在 /usr/bin 中建立軟連接才能正常使用。 -- You are receiving this because you were assigned. Reply to this email directly or view it on GitHub: #1996 (comment) -- Dct Mei -----BEGIN PGP PUBLIC KEY BLOCK----- mDMEXCinkBYJKwYBBAHaRw8BAQdA5H9IxywOaNmJIWhPWmOW373e5qV9B2XX4uaN 8Dj/os60G0RjdCBNZWkgPGRjdHhtZWlAZ21haWwuY29tPoiQBBMWCAA4FiEEezFL 5328og4C3bvAUL+LcS3K1+oFAlwop5ACGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQUL+LcS3K1+pb5AD9Em35W0ACv4sd1wsDLscHUP/9bsso4qz8Jakh49Tc 5MwBALgLJfruyp+waU/TgJNR9bfAntsN59NUvoElC0b/P94LuDgEXCinkBIKKwYB BAGXVQEFAQEHQDGv8eGzsh+tFkh8Yfibp4Mtv94AwyN45x1AguzUVUcjAwEIB4h4 BBgWCAAgFiEEezFL5328og4C3bvAUL+LcS3K1+oFAlwop5ACGwwACgkQUL+LcS3K 1+pHggEA0QzrA6N+72SKchinmmaH1vBk8zcg8EGfxTTMgvttRQUBAL+SqHLwuhfV OHgQi6COC+SQI5jrRAYhjrJoc+KHvHMI =F48x -----END PGP PUBLIC KEY BLOCK-----

Thx I read the code, I think modifying the code is better than both methods. So I submit a Features Request in XTLS/Xray-core.

My ideas, add the following code.

filepath.Join("/usr/local/share/v2ray/", file),
filepath.Join("/usr/share/v2ray/", file),