Skip to content

Commit

Permalink
use main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
MXWXZ committed Sep 25, 2024
1 parent 19e2bde commit 4d519bc
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
[submodule "plugin/monitor"]
path = plugin/monitor
url = [email protected]:ministruth/monitor.git
branch = main
[submodule "plugin/common"]
path = plugin/common
url = [email protected]:ministruth/plugin_common.git
branch = main
[submodule "plugin/monitor_api"]
path = plugin/monitor_api
url = [email protected]:ministruth/monitor_api.git
branch = main
[submodule "plugin/agent_api"]
path = plugin/agent_api
url = [email protected]:ministruth/agent_api.git
branch = main
[submodule "plugin/agent"]
path = plugin/agent
url = [email protected]:ministruth/agent.git
branch = main
[submodule "plugin/task_api"]
path = plugin/task_api
url = [email protected]:ministruth/task_api
branch = main
[submodule "plugin/task"]
path = plugin/task
url = [email protected]:ministruth/task
branch = main
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# skynet

![status](https://img.shields.io/badge/status-dev-lightgrey?style=flat-square) ![rustc](https://img.shields.io/badge/rustc-1.56+-red?style=flat-square)
![version](https://img.shields.io/badge/version-0.2.3-blue?style=flat-square) ![api](https://img.shields.io/badge/api-0.1.2-light_green?style=flat-square) ![rustc](https://img.shields.io/badge/rustc-1.56+-red?style=flat-square) ![license](https://img.shields.io/github/license/ministruth/skynet?style=flat-square)

Skynet is a service integration and management system, specially optimized for personal and home-lab use. With plugin support, you can easily embed whatever software you want to satisfy your need.

Expand Down Expand Up @@ -56,7 +56,13 @@ Note that no permission is allowed for these users.

## Plugins

You can find plugins in our [official support plugin](https://github.com/MXWXZ/skynet/plugin) or other user shares.
You can find plugins in our [organization repositories](https://github.com/ministruth) or other user shares.

Use our script to download all official plugins:

```
./get_offical_plugins.sh
```

**!!Please note that all plugins have the same privilege as skynet, use trusted plugins ONLY!!**

Expand Down
141 changes: 141 additions & 0 deletions get_offical_plugins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/bin/bash
success() {
COLOR='\033[0;32m'
RESET='\033[0m'
printf "${COLOR}%s${RESET}\n" "$1"
}

warn() {
COLOR='\033[0;33m'
RESET='\033[0m'
printf "${COLOR}%s${RESET}\n" "$1"
}

error() {
COLOR='\033[0;31m'
RESET='\033[0m'
printf "${COLOR}%s${RESET}\n" "$1"
}

check() {
command -v "$1" >/dev/null 2>&1
}

for cmd in wget tar unzip; do
if ! check "$cmd"; then
error "Error: $cmd is not installed. Please install it and try again."
exit 1
fi
done

OS=$(uname)
case $OS in
'Linux')
OS='linux'
;;
'WindowsNT')
OS='windows'
;;
'Darwin')
OS='darwin'
;;
*)
OS='unknown'
;;
esac

ARCH=$(uname -m)
case $ARCH in
'x86_64')
ARCH='x64'
;;
'i386')
ARCH='i686'
;;
'i686')
ARCH='i686'
;;
'arm64')
ARCH='aarch64'
;;
'aarch64')
ARCH='aarch64'
;;
*)
ARCH='unknown'
;;
esac

echo OS: $OS
if [ $OS == 'unknown' ]; then
warn "Your OS may not be supported"
fi
echo Arch: $ARCH
if [ $ARCH == 'unknown' ]; then
warn "Your architecture may not be supported"
fi

default=1

if [ $OS == 'linux' ]; then
if [ $ARCH == 'x64' ]; then
default=1
elif [ $ARCH == 'i686' ]; then
default=2
elif [ $ARCH == 'aarch64' ]; then
default=3
fi
elif [ $OS == 'windows' ]; then
if [ $ARCH == 'x64' ]; then
default=4
fi
elif [ $OS == 'darwin' ]; then
if [ $ARCH == 'x64' ]; then
default=5
elif [ $ARCH == 'aarch64' ]; then
default=6
fi
fi

extension=.tar.gz
echo
echo "Choose version:"
echo "1) linux-x64"
echo "2) linux-i686"
echo "3) linux-aarch64"
echo "4) windows-x64"
echo "5) darwin-x64"
echo "6) darwin-aarch64"
read -p "Your choice (default: $default): " choice
if [ -z "$choice" ]; then
choice=$default
fi
if [ $choice == '4' ]; then
extension=.zip
fi

read -p "Download path (default: ./plugin): " path
if [ -z "$path" ]; then
path=./plugin
fi

mkdir -p $path && cd $path
plugins=("monitor" "agent" "task")
for plugin in "${plugins[@]}"; do
echo "Downloading $plugin..."
wget https://github.com/ministruth/$plugin/releases/latest/download/plugin-$OS-$ARCH$extension -O plugin-$OS-$ARCH$extension
if [ $extension == '.tar.gz' ]; then
tar -xzf plugin-$OS-$ARCH$extension
else
unzip plugin-$OS-$ARCH$extension
fi
done
mv -f plugin-$OS-$ARCH/* .
rm -rf plugin-$OS-$ARCH$extension plugin-$OS-$ARCH
cd -

echo
success "Download success"
echo Note that you need to put plugin files in your plugin and assets folder:
echo "mv $path/assets/* /path/to/skynet/assets/_plugin && rm -rf $path/assets/"
echo "mv $path/* /path/to/skynet/plugin"
2 changes: 1 addition & 1 deletion plugin/agent

0 comments on commit 4d519bc

Please sign in to comment.