瀏覽代碼

Merge pull request #133 from meienberger/master [skip ci]

Merge master [skip ci]
Nicolas Meienberger 3 年之前
父節點
當前提交
976e4ab90e
共有 9 個文件被更改,包括 34 次插入20 次删除
  1. 9 0
      .all-contributorsrc
  2. 1 0
      .gitignore
  3. 2 1
      README.md
  4. 1 1
      VERSION
  5. 1 1
      package.json
  6. 1 1
      packages/dashboard/package.json
  7. 2 1
      packages/system-api/.gitignore
  8. 1 1
      packages/system-api/package.json
  9. 16 14
      scripts/configure.sh

+ 9 - 0
.all-contributorsrc

@@ -56,6 +56,15 @@
       "contributions": [
         "code"
       ]
+    },
+    {
+      "login": "Stetsed",
+      "name": "Stetsed",
+      "avatar_url": "https://avatars.githubusercontent.com/u/33891782?v=4",
+      "profile": "https://github.com/Stetsed",
+      "contributions": [
+        "code"
+      ]
     }
   ],
   "contributorsPerLine": 7,

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 .pnpm-debug.log
 .env*
+data/
 github.secrets
 node_modules/
 app-data/*

+ 2 - 1
README.md

@@ -1,6 +1,6 @@
 # ⛺️ Tipi — A personal homeserver for everyone
 <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
-[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
+[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
 <!-- ALL-CONTRIBUTORS-BADGE:END -->
 [![License](https://img.shields.io/github/license/meienberger/runtipi)](https://github.com/meienberger/runtipi/blob/master/LICENSE)
 [![Version](https://img.shields.io/github/v/release/meienberger/runtipi?color=%235351FB&label=version)](https://github.com/meienberger/runtipi/releases)
@@ -116,6 +116,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
     <td align="center"><a href="https://github.com/DrMxrcy"><img src="https://avatars.githubusercontent.com/u/58747968?v=4?s=100" width="100px;" alt=""/><br /><sub><b>DrMxrcy</b></sub></a><br /><a href="https://github.com/meienberger/runtipi/commits?author=DrMxrcy" title="Code">💻</a> <a href="#ideas-DrMxrcy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/meienberger/runtipi/commits?author=DrMxrcy" title="Tests">⚠️</a></td>
     <td align="center"><a href="https://cobre.dev"><img src="https://avatars.githubusercontent.com/u/36574329?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cooper</b></sub></a><br /><a href="https://github.com/meienberger/runtipi/commits?author=CobreDev" title="Code">💻</a></td>
     <td align="center"><a href="https://github.com/JTruj1ll0923"><img src="https://avatars.githubusercontent.com/u/6656643?v=4?s=100" width="100px;" alt=""/><br /><sub><b>JTruj1ll0923</b></sub></a><br /><a href="https://github.com/meienberger/runtipi/commits?author=JTruj1ll0923" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/Stetsed"><img src="https://avatars.githubusercontent.com/u/33891782?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stetsed</b></sub></a><br /><a href="https://github.com/meienberger/runtipi/commits?author=Stetsed" title="Code">💻</a></td>
   </tr>
 </table>
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-0.3.0
+0.3.1

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "runtipi",
-  "version": "0.3.0",
+  "version": "0.3.1",
   "description": "A homeserver for everyone",
   "scripts": {
     "test": "jest",

+ 1 - 1
packages/dashboard/package.json

@@ -1,6 +1,6 @@
 {
   "name": "dashboard",
-  "version": "0.3.0",
+  "version": "0.3.1",
   "private": true,
   "scripts": {
     "test": "jest --colors",

+ 2 - 1
packages/system-api/.gitignore

@@ -2,4 +2,5 @@ node_modules/
 dist/
 
 # testing
-/coverage
+coverage/
+logs/

+ 1 - 1
packages/system-api/package.json

@@ -1,6 +1,6 @@
 {
   "name": "system-api",
-  "version": "0.3.0",
+  "version": "0.3.1",
   "description": "",
   "exports": "./dist/server.js",
   "type": "module",

+ 16 - 14
scripts/configure.sh

@@ -1,6 +1,4 @@
 #!/usr/bin/env bash
-set -e # Exit immediately if a command exits with a non-zero status.
-
 ROOT_FOLDER="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)"
 
 echo
@@ -16,6 +14,7 @@ echo
 
 function install_docker() {
   local os="${1}"
+  echo "Installing docker for os ${os}" >/dev/tty
 
   if [[ "${OS}" == "debian" ]]; then
     sudo apt-get update
@@ -25,7 +24,7 @@ function install_docker() {
     echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
     sudo apt-get update
     sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
-    echo "sucess"
+    return 0
   elif [[ "${OS}" == "ubuntu" ]]; then
     sudo apt-get update
     sudo apt-get install -y ca-certificates curl gnupg jq lsb-release
@@ -34,21 +33,21 @@ function install_docker() {
     echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
     sudo apt-get update
     sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
-    echo "sucess"
+    return 0
   elif [[ "${OS}" == "centos" ]]; then
     sudo yum install -y yum-utils jq
     sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
     sudo yum install -y --allowerasing docker-ce docker-ce-cli containerd.io docker-compose-plugin
     sudo systemctl start docker
     sudo systemctl enable docker
-    echo "sucess"
+    return 0
   elif [[ "${OS}" == "fedora" ]]; then
     sudo dnf -y install dnf-plugins-core jq
     sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
     sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
     sudo systemctl start docker
     sudo systemctl enable docker
-    echo "sucess"
+    return 0
   elif [[ "${OS}" == "arch" ]]; then
     sudo pacman -Sy --noconfirm docker jq
     sudo systemctl start docker.service
@@ -59,9 +58,9 @@ function install_docker() {
       systemctl enable --now cronie.service
     fi
 
-    echo "sucess"
+    return 0
   else
-    echo "error"
+    return 1
   fi
 }
 
@@ -71,17 +70,20 @@ SUB_OS="$(cat /etc/[A-Za-z]*[_-][rv]e[lr]* | grep "^ID_LIKE=" | cut -d= -f2 | un
 if command -v docker >/dev/null; then
   echo "Docker is already installed"
 else
-  echo "Installing Docker"
-  DOCKER_SUCCESS=$(install_docker "${OS}")
-  if [[ "${DOCKER_SUCCESS}" == "sucess" ]]; then
+  install_docker "${OS}"
+  docker_result=$?
+
+  if [[ docker_result -eq 0 ]]; then
     echo "docker installed"
   else
-    DOCKER_SUCCESS=$(install_docker "${SUB_OS}")
+    echo "Your system ${OS} is not supported trying with sub_os ${SUB_OS}"
+    install_docker "${SUB_OS}"
+    docker_sub_result=$?
 
-    if [[ "${DOCKER_SUCCESS}" == "sucess" ]]; then
+    if [[ docker_sub_result -eq 0 ]]; then
       echo "docker installed"
     else
-      echo "Your system ${OS} is not supported please install docker manually"
+      echo "Your system ${SUB_OS} is not supported please install docker manually"
       exit 1
     fi
   fi