fix: use gitea.fp-will.xyz instead of raw IP:3000
This commit is contained in:
+11
-3
@@ -30,7 +30,8 @@ const (
|
|||||||
serviceName = "xboard-node.service"
|
serviceName = "xboard-node.service"
|
||||||
serviceFilePath = "/etc/systemd/system/xboard-node.service"
|
serviceFilePath = "/etc/systemd/system/xboard-node.service"
|
||||||
defaultInstallRoot = "/etc/xboard-node"
|
defaultInstallRoot = "/etc/xboard-node"
|
||||||
downloadBase = "http://103.112.1.141:3000/will/xboard-node"
|
downloadBase = "https://gitea.fp-will.xyz/will/xboard-node"
|
||||||
|
downloadToken = "cf6634b57d2c60c66030dbb29d77c4ed25370e94"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -599,7 +600,14 @@ func resolveDownloadURL(artifact, version string) string {
|
|||||||
|
|
||||||
func downloadFile(url, dest string) error {
|
func downloadFile(url, dest string) error {
|
||||||
client := &http.Client{Timeout: 120 * time.Second}
|
client := &http.Client{Timeout: 120 * time.Second}
|
||||||
resp, err := client.Get(url)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if downloadToken != "" {
|
||||||
|
req.Header.Set("Authorization", "token "+downloadToken)
|
||||||
|
}
|
||||||
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -1155,7 +1163,7 @@ func latestInstanceID(instances []*config.Config) string {
|
|||||||
func regenerateServiceFile() error {
|
func regenerateServiceFile() error {
|
||||||
unit := fmt.Sprintf(`[Unit]
|
unit := fmt.Sprintf(`[Unit]
|
||||||
Description=Xboard Node Backend
|
Description=Xboard Node Backend
|
||||||
Documentation=https://github.com/cedar2025/xboard-node
|
Documentation=https://gitea.fp-will.xyz/will/xboard-node
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ DEFAULT_ACTION="install"
|
|||||||
DEFAULT_RELEASE_VERSION="latest"
|
DEFAULT_RELEASE_VERSION="latest"
|
||||||
DEFAULT_LOG_LEVEL="info"
|
DEFAULT_LOG_LEVEL="info"
|
||||||
DEFAULT_KERNEL_LOG_LEVEL="warn"
|
DEFAULT_KERNEL_LOG_LEVEL="warn"
|
||||||
DEFAULT_DOWNLOAD_BASE="http://103.112.1.141:3000/will/xboard-node/releases/download"
|
DEFAULT_DOWNLOAD_BASE="https://gitea.fp-will.xyz/will/xboard-node/releases/download"
|
||||||
|
|
||||||
ACTION="${DEFAULT_ACTION}"
|
ACTION="${DEFAULT_ACTION}"
|
||||||
MODE=""
|
MODE=""
|
||||||
@@ -589,7 +589,7 @@ render_service() {
|
|||||||
cat >"$TMP_DIR/${SERVICE_NAME}" <<EOF_UNIT
|
cat >"$TMP_DIR/${SERVICE_NAME}" <<EOF_UNIT
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Xboard Node Backend
|
Description=Xboard Node Backend
|
||||||
Documentation=https://github.com/cedar2025/xboard-node
|
Documentation=https://gitea.fp-will.xyz/will/xboard-node
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user