Skip to content

Commit

Permalink
[release] v0.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
azukaar committed Oct 24, 2023
1 parent 4d5a148 commit e80b202
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions client/src/pages/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ const HomePage = () => {
</Alert>
)}

{isAdmin && coStatus && (coStatus.backup_status != "") && (
<Alert severity="error">
{coStatus.backup_status}
</Alert>
)}

{isAdmin && coStatus && coStatus.LetsEncryptErrors && coStatus.LetsEncryptErrors.length > 0 && (
<Alert severity="error">
There are errors with your Let's Encrypt configuration or one of your routes, please fix them as soon as possible:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.11.1",
"version": "0.11.2",
"description": "",
"main": "test-server.js",
"bugs": {
Expand Down
19 changes: 14 additions & 5 deletions src/docker/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import (

)

var ExportError = ""

func ExportDocker() {
errD := Connect()
if errD != nil {
ExportError = "Export Docker - cannot connect - " + errD.Error()
utils.Error("ExportDocker - connect - ", errD)
return
}
Expand All @@ -28,6 +31,7 @@ func ExportDocker() {
containers, err := DockerClient.ContainerList(DockerContext, types.ContainerListOptions{})
if err != nil {
utils.Error("ExportDocker - Cannot list containers", err)
ExportError = "Export Docker - Cannot list containers - " + err.Error()
return
}

Expand All @@ -38,7 +42,8 @@ func ExportDocker() {
// Fetch detailed info of each container
detailedInfo, err := DockerClient.ContainerInspect(DockerContext, container.ID)
if err != nil {
utils.Error("Cannot inspect container", err)
utils.Error("Export Docker - Cannot inspect container" + container.Names[0], err)
ExportError = "Export Docker - Cannot inspect container" + container.Names[0] + " - " + err.Error()
return
}

Expand Down Expand Up @@ -168,7 +173,8 @@ func ExportDocker() {
// List networks
networks, err := DockerClient.NetworkList(DockerContext, types.NetworkListOptions{})
if err != nil {
utils.Error("Cannot list networks", err)
utils.Error("Export Docker - Cannot list networks", err)
ExportError = "Export Docker - Cannot list networks - " + err.Error()
return
}

Expand All @@ -183,7 +189,8 @@ func ExportDocker() {
// Fetch detailed info of each network
detailedInfo, err := DockerClient.NetworkInspect(DockerContext, network.ID, types.NetworkInspectOptions{})
if err != nil {
utils.Error("Cannot inspect network", err)
utils.Error("Export Docker - Cannot inspect network", err)
ExportError = "Export Docker - Cannot inspect network - " + err.Error()
return
}

Expand Down Expand Up @@ -225,7 +232,8 @@ func ExportDocker() {
// Use the encoder to write the structured data to the buffer
err = encoder.Encode(finalBackup)
if err != nil {
utils.Error("Cannot marshal docker backup", err)
utils.Error("Export Docker - Cannot marshal docker backup", err)
ExportError = "Export Docker - Cannot marshal docker backup - " + err.Error()
}

// The JSON data is now in buf.Bytes()
Expand All @@ -234,6 +242,7 @@ func ExportDocker() {
// Write the JSON data to a file
err = ioutil.WriteFile(utils.CONFIGFOLDER + "backup.cosmos-compose.json", jsonData, 0644)
if err != nil {
utils.Error("Cannot save docker backup", err)
utils.Error("Export Docker - Cannot save docker backup", err)
ExportError = "Export Docker - Cannot save docker backup - " + err.Error()
}
}
1 change: 1 addition & 0 deletions src/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func StatusRoute(w http.ResponseWriter, req *http.Request) {
},
"database": databaseStatus,
"docker": docker.DockerIsConnected,
"backup_status": docker.ExportError,
"letsencrypt": utils.GetMainConfig().HTTPConfig.HTTPSCertificateMode == "LETSENCRYPT" && utils.GetMainConfig().HTTPConfig.SSLEmail == "",
"domain": utils.GetMainConfig().HTTPConfig.Hostname == "localhost" || utils.GetMainConfig().HTTPConfig.Hostname == "0.0.0.0",
"HTTPSCertificateMode": utils.GetMainConfig().HTTPConfig.HTTPSCertificateMode,
Expand Down

0 comments on commit e80b202

Please sign in to comment.