fix: default updater owner & repo to ongtrieuhau/web-giao-ban
This commit is contained in:
+1
-1
@@ -39,6 +39,6 @@
|
|||||||
"owner": "ongtrieuhau",
|
"owner": "ongtrieuhau",
|
||||||
"repo": "web-giao-ban",
|
"repo": "web-giao-ban",
|
||||||
"token": "ENC(abS+Aa/rBa8ydyLgFvGmDrJ5Vc9KOVTFu52PX4rCcA+88edzq5J6yWu05DPTTHWZEw2wKz+8RmXbt+jTTexJi+zATOg=)",
|
"token": "ENC(abS+Aa/rBa8ydyLgFvGmDrJ5Vc9KOVTFu52PX4rCcA+88edzq5J6yWu05DPTTHWZEw2wKz+8RmXbt+jTTexJi+zATOg=)",
|
||||||
"current_version": "v1.0.0"
|
"current_version": "v1.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-2
@@ -149,8 +149,8 @@ func DefaultConfig() *AppConfig {
|
|||||||
Updater: UpdaterConfig{
|
Updater: UpdaterConfig{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
GiteaURL: "https://i.dh-his.com",
|
GiteaURL: "https://i.dh-his.com",
|
||||||
Owner: "hdhiswork",
|
Owner: "ongtrieuhau",
|
||||||
Repo: "DUAN",
|
Repo: "web-giao-ban",
|
||||||
Token: "",
|
Token: "",
|
||||||
CurrentVersion: "v1.0.0",
|
CurrentVersion: "v1.0.0",
|
||||||
},
|
},
|
||||||
@@ -208,6 +208,14 @@ func LoadConfig(path string) (*AppConfig, error) {
|
|||||||
cfg.DecryptedDBPassword = decDB
|
cfg.DecryptedDBPassword = decDB
|
||||||
cfg.DecryptedUpdaterToken = decTok
|
cfg.DecryptedUpdaterToken = decTok
|
||||||
|
|
||||||
|
// Auto-migrate legacy owner & repo
|
||||||
|
if cfg.Updater.Owner == "" || cfg.Updater.Owner == "hdhiswork" {
|
||||||
|
cfg.Updater.Owner = "ongtrieuhau"
|
||||||
|
}
|
||||||
|
if cfg.Updater.Repo == "" || cfg.Updater.Repo == "DUAN" {
|
||||||
|
cfg.Updater.Repo = "web-giao-ban"
|
||||||
|
}
|
||||||
|
|
||||||
currentConfig = cfg
|
currentConfig = cfg
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -206,11 +206,11 @@
|
|||||||
<div class="grid grid-cols-2 gap-3">
|
<div class="grid grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label class="block font-semibold text-slate-700 mb-1">Tổ chức / Owner:</label>
|
<label class="block font-semibold text-slate-700 mb-1">Tổ chức / Owner:</label>
|
||||||
<input type="text" id="cfgGiteaOwner" class="w-full rounded-lg border border-slate-300 px-3 py-2 bg-slate-50 font-mono outline-none focus:ring-2 focus:ring-indigo-500" value="hdhiswork">
|
<input type="text" id="cfgGiteaOwner" class="w-full rounded-lg border border-slate-300 px-3 py-2 bg-slate-50 font-mono outline-none focus:ring-2 focus:ring-indigo-500" value="ongtrieuhau">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block font-semibold text-slate-700 mb-1">Repository:</label>
|
<label class="block font-semibold text-slate-700 mb-1">Repository:</label>
|
||||||
<input type="text" id="cfgGiteaRepo" class="w-full rounded-lg border border-slate-300 px-3 py-2 bg-slate-50 font-mono outline-none focus:ring-2 focus:ring-indigo-500" value="DUAN">
|
<input type="text" id="cfgGiteaRepo" class="w-full rounded-lg border border-slate-300 px-3 py-2 bg-slate-50 font-mono outline-none focus:ring-2 focus:ring-indigo-500" value="web-giao-ban">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -86,8 +86,10 @@ async function loadConfig() {
|
|||||||
|
|
||||||
// Gitea Updater
|
// Gitea Updater
|
||||||
document.getElementById('cfgGiteaUrl').value = cfg.updater.gitea_url || 'https://i.dh-his.com';
|
document.getElementById('cfgGiteaUrl').value = cfg.updater.gitea_url || 'https://i.dh-his.com';
|
||||||
document.getElementById('cfgGiteaOwner').value = cfg.updater.owner || 'hdhiswork';
|
const owner = (cfg.updater.owner && cfg.updater.owner !== 'hdhiswork') ? cfg.updater.owner : 'ongtrieuhau';
|
||||||
document.getElementById('cfgGiteaRepo').value = cfg.updater.repo || 'DUAN';
|
const repo = (cfg.updater.repo && cfg.updater.repo !== 'DUAN') ? cfg.updater.repo : 'web-giao-ban';
|
||||||
|
document.getElementById('cfgGiteaOwner').value = owner;
|
||||||
|
document.getElementById('cfgGiteaRepo').value = repo;
|
||||||
document.getElementById('cfgGiteaToken').value = '';
|
document.getElementById('cfgGiteaToken').value = '';
|
||||||
|
|
||||||
const ver = cfg.updater.current_version || 'v1.0.0';
|
const ver = cfg.updater.current_version || 'v1.0.0';
|
||||||
|
|||||||
+4
-4
@@ -52,12 +52,12 @@ func CheckUpdate() (*CheckResult, error) {
|
|||||||
baseURL = "https://i.dh-his.com"
|
baseURL = "https://i.dh-his.com"
|
||||||
}
|
}
|
||||||
owner := cfg.Updater.Owner
|
owner := cfg.Updater.Owner
|
||||||
if owner == "" {
|
if owner == "" || owner == "hdhiswork" {
|
||||||
owner = "hdhiswork"
|
owner = "ongtrieuhau"
|
||||||
}
|
}
|
||||||
repo := cfg.Updater.Repo
|
repo := cfg.Updater.Repo
|
||||||
if repo == "" {
|
if repo == "" || repo == "DUAN" {
|
||||||
repo = "DUAN"
|
repo = "web-giao-ban"
|
||||||
}
|
}
|
||||||
|
|
||||||
apiURL := fmt.Sprintf("%s/api/v1/repos/%s/%s/releases/latest", baseURL, owner, repo)
|
apiURL := fmt.Sprintf("%s/api/v1/repos/%s/%s/releases/latest", baseURL, owner, repo)
|
||||||
|
|||||||
Reference in New Issue
Block a user