Compare commits

..

No commits in common. "main" and "0.1.0" have entirely different histories.
main ... 0.1.0

358 changed files with 35515 additions and 16591 deletions

View File

@ -1,197 +0,0 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"badgeTemplate": "<a href=\"#credits\"><img alt=\"All Contributors\" src=\"https://img.shields.io/static/v1?label=All%20Contributors&message=<%= contributors.length %>&color=162453&style=flat-square&logo=Handshake&logoColor=fff\" /></a>",
"commit": false,
"contributors": [
{
"login": "jerrykuku",
"name": "老竭力",
"avatar_url": "https://avatars.githubusercontent.com/u/9485680?v=4",
"profile": "https://github.com/jerrykuku",
"contributions": [
"code",
"doc",
"ideas",
"infra",
"maintenance",
"platform",
"question",
"review"
]
},
{
"login": "LinkLeong",
"name": "link",
"avatar_url": "https://avatars.githubusercontent.com/u/13556972?v=4",
"profile": "https://github.com/LinkLeong",
"contributions": [
"code",
"doc",
"ideas",
"infra",
"maintenance",
"question",
"review"
]
},
{
"login": "tigerinus",
"name": "Tiger Wang (王豫)",
"avatar_url": "https://avatars.githubusercontent.com/u/7172560?v=4",
"profile": "https://github.com/tigerinus",
"contributions": [
"code",
"doc",
"ideas",
"infra",
"maintenance",
"mentoring",
"security",
"question",
"review"
]
},
{
"login": "Lauren-ED209",
"name": "Lauren",
"avatar_url": "https://avatars.githubusercontent.com/u/8243355?v=4",
"profile": "https://github.com/Lauren-ED209",
"contributions": [
"ideas",
"fundingFinding",
"projectManagement",
"question",
"test"
]
},
{
"login": "JohnGuan",
"name": "John Guan",
"avatar_url": "https://avatars.githubusercontent.com/u/3358477?v=4",
"profile": "https://JohnGuan.Cn",
"contributions": [
"blog",
"content",
"doc",
"ideas",
"eventOrganizing",
"mentoring",
"question",
"review"
]
},
{
"login": "dtaivpp",
"name": "David Tippett",
"avatar_url": "https://avatars.githubusercontent.com/u/17506770?v=4",
"profile": "https://blog.tippybits.com",
"contributions": [
"doc",
"ideas",
"question"
]
},
{
"login": "zarevskaya",
"name": "Skaya",
"avatar_url": "https://avatars.githubusercontent.com/u/60230221?v=4",
"profile": "https://github.com/zarevskaya",
"contributions": [
"mentoring",
"question",
"tutorial",
"translation"
]
},
{
"login": "AuthorShin",
"name": "AuthorShin",
"avatar_url": "https://avatars.githubusercontent.com/u/4959043?v=4",
"profile": "https://github.com/AuthorShin",
"contributions": [
"test",
"bug",
"question",
"ideas"
]
},
{
"login": "baptiste313",
"name": "baptiste313",
"avatar_url": "https://avatars.githubusercontent.com/u/93325157?v=4",
"profile": "https://github.com/baptiste313",
"contributions": [
"translation"
]
},
{
"login": "DrMxrcy",
"name": "DrMxrcy",
"avatar_url": "https://avatars.githubusercontent.com/u/58747968?v=4",
"profile": "https://github.com/DrMxrcy",
"contributions": [
"test",
"ideas",
"question"
]
},
{
"login": "Joooost",
"name": "Joooost",
"avatar_url": "https://avatars.githubusercontent.com/u/12090673?v=4",
"profile": "https://github.com/Joooost",
"contributions": [
"ideas"
]
},
{
"login": "sio",
"name": "Vitaly Potyarkin",
"avatar_url": "https://avatars.githubusercontent.com/u/334908?v=4",
"profile": "https://potyarkin.ml",
"contributions": [
"ideas"
]
},
{
"login": "bearfrieze",
"name": "Bjørn Friese",
"avatar_url": "https://avatars.githubusercontent.com/u/1023813?v=4",
"profile": "https://github.com/bearfrieze",
"contributions": [
"ideas"
]
},
{
"login": "Protektor-Desura",
"name": "Protektor",
"avatar_url": "https://avatars.githubusercontent.com/u/1195496?v=4",
"profile": "https://github.com/Protektor-Desura",
"contributions": [
"bug",
"ideas",
"question"
]
},
{
"login": "llwaini",
"name": "llwaini",
"avatar_url": "https://avatars.githubusercontent.com/u/59589857?v=4",
"profile": "https://github.com/llwaini",
"contributions": [
"projectManagement",
"test",
"tutorial"
]
}
],
"contributorsPerLine": 7,
"projectName": "CasaOS",
"projectOwner": "IceWhaleTech",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}

View File

@ -1,26 +0,0 @@
name: "[Alpha Only] Bug Report"
description: CasaOS Alpha Testing specific bug report form.
title: "[Alpha][Bug] "
labels: ["alpha", "bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
> If you haven't joined CasaOS Alpha Team yet.
> Please join first on [Discord](https://discord.gg/knqAbbBbeX) to be updated on the Alpha test plan and test scope.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
placeholder: Screenshots would be very helpful!

View File

@ -1,64 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: '[Bug] '
labels: 'bug'
assignees: ''
---
**Describe the bug**
> A clear and concise description of what the bug is.
**To Reproduce**
> Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
> A clear and concise description of what you expected to happen.
**Screenshots**
> If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
```
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
```
**System Time**
> Run `timedatectl` and share the output
```
(timedatectl output here)
```
**Logs**
> Run following command to collect corresponding logs:
```bash
sudo journalctl -xef -u casaos-gateway
sudo journalctl -xef -u casaos-user-service
sudo journalctl -xef -u casaos-local-storage
sudo journalctl -xef -u casaos-app-management
sudo journalctl -xef -u casaos.service
```
**Additional context**
> Add any other context about the problem here.
>
> If you are a Zimaboard user, make it explicit with when you got your Zimaboard.

View File

@ -1,14 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: App Request
url: https://github.com/IceWhaleTech/CasaOS-AppStore/issues/new?assignees=&labels=App+Request&template=app_request.yml&title=%5BApp+Request%5D+AppName
about: Request to add an app to the app store.
- name: Feature/Enhancement Ideas
url: https://github.com/IceWhaleTech/CasaOS/discussions/164
about: Have an idea for a new feature/enhancement?
- name: Questions, Discussions
url: https://github.com/IceWhaleTech/CasaOS/discussions
about: Ask questions, propose ideas, or discuss anything related to CasaOS
- name: Discord
url: https://discord.gg/knqAbbBbeX
about: Get help or share great ideas on Discord!

View File

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -1,19 +0,0 @@
name: Sync OpenAPI
on:
workflow_call:
inputs:
project-name:
required: true
type: string
push:
branches:
- main
jobs:
sync:
uses: IceWhaleTech/github/.github/workflows/sync_openapi.yml@main
with:
project-name: casaos
secrets:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}

View File

@ -1,33 +0,0 @@
name: Add Issues To Projects
on:
issues:
types:
- opened
jobs:
add-issues:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
with:
app_id: ${{ secrets.ALPHA_BOT_ID }}
private_key: ${{ secrets.ALPHA_BOT_PEM }}
- name: Add Alpha Bug Issue To project
uses: actions/add-to-project@v0.3.0
with:
github-token: ${{ steps.generate_token.outputs.token }}
project-url: https://github.com/orgs/IceWhaleTech/projects/5
labeled: alpha, bug
label-operator: AND
- name: Add App Request Issue To project
uses: actions/add-to-project@v0.3.0
with:
github-token: ${{ steps.generate_token.outputs.token }}
project-url: https://github.com/orgs/IceWhaleTech/projects/8
labeled: "App Request"
label-operator: AND

View File

@ -1,148 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Build CasaOS
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
#on:
# push:
# branches:
# - 'main'
# tags:
# - 'v*'
env:
REPO_URL: https://github.com/IceWhaleTech/CasaOS.git
REPO_BRANCH: main
PACK_SH_URL: https://raw.githubusercontent.com/jerrykuku/actions-casa/main/pack.sh
PACK_SH: pack.sh
TZ: Asia/Shanghai
jobs:
xgo:
strategy:
fail-fast: false
matrix:
go_version:
- 1.17.1
runs-on: ubuntu-latest
steps:
# - name: Get release
# id: get_release
# uses: bruceadams/get-release@v1.2.3
# env:
# GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
# - name: Initialization environment
# env:
# DEBIAN_FRONTEND: noninteractive
# run: |
# sudo timedatectl set-timezone "$TZ"
# sudo mkdir -p /workdir
# sudo chown $USER:$GROUPS /workdir
# - name: Clone source code
# working-directory: /workdir
# run: |
# df -hT $PWD
# git clone $REPO_URL -b $REPO_BRANCH --recursive casa
# ln -sf /workdir/casa $GITHUB_WORKSPACE/casa
# ls
- name: Set environment for github-release
run: |
echo "VERSION=$(cat types/system.go | grep CURRENTVERSION | awk '$2 == "CURRENTVERSION"{print $4}' | sed 's/"//g')" >>$GITHUB_ENV
echo "BODY=$(cat types/system.go | grep BODY | awk -F= '{print $2}' | sed 's/"//g')" >>$GITHUB_ENV
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Build frontend with nodejs and yarn
run: |
cd UI
ls
yarn install
yarn build
- name: list work
run: pwd
- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: v0.7.5
go_version: ${{ matrix.go_version }}
dest: build
prefix: casa
targets: linux/amd64,linux/arm64,linux/arm-7
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
#
# - name: List Files
# run: |
# ls
# mkdir build
# ls
# echo "::set-output name=status::success"
- name: Pack builds
run: |
wget $PACK_SH_URL
chmod +x $PACK_SH
./$PACK_SH
echo "::set-output name=status::success"
- name: list work
run: ls
- name: Update release
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: >
linux-amd64-casaos.tar.gz
linux-arm64-casaos.tar.gz
linux-arm-7-casaos.tar.gz
tag: v${{ env.VERSION }}
body: >
${{ env.BODY }}
name: v${{ env.VERSION }}
gzip: false
allow_override: false
prerelease: true
# - name: Upload linux-amd64-casaos.tar.gz
# id: upload_assets_amd64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-amd64-casaos.tar.gz
#
# - name: Upload linux-arm64-casaos.tar.gz
# id: upload_assets_arm64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-arm64-casaos.tar.gz

View File

@ -1,28 +0,0 @@
name: Collect Code Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: generate OPENAPI
run: go generate
- name: Run coverage
run: go test -race -failfast -coverprofile=coverage.txt -covermode=atomic -v ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

View File

@ -1,84 +0,0 @@
name: Demo Reset
# Controls when the workflow will run
on:
schedule:
- cron: "0 * * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# OLD_INSTANCE_SNAPSHOT_NAME=$(aws lightsail get-instance-snapshots | grep '"name": "CasaOS-Demo-Snapshot-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')
# OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')
# NEW_INSTANCE_NAME=CasaOS-Demo-$(date +%s)
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
reset:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Get old instance and snapshot name, create new instance name
run: |
echo "OLD_INSTANCE_SNAPSHOT_NAME=CasaOS-v0.4.4-3-Demo-1700132299" >> $GITHUB_ENV
echo "OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | tail -1 | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
# echo "OLD_INSTANCE_NAME=CasaOS-Demo-1687680295" >> $GITHUB_ENV
echo "NEW_INSTANCE_NAME= CasaOS-Demo-$(date +%s)" >> $GITHUB_ENV
- name: Create instances from snapshot
run: |
aws lightsail create-instances-from-snapshot \
--instance-snapshot-name ${{ env.OLD_INSTANCE_SNAPSHOT_NAME }} \
--instance-names ${{ env.NEW_INSTANCE_NAME }} \
--availability-zone us-west-2a \
--bundle-id medium_2_0
- name: Wait for new instance running
run: |
TIMEOUT=$(($(date +%s)+600))
while [ $TIMEOUT -gt $(date +%s) ]
do
NEW_INSTANCE_STATE=$(aws lightsail get-instance-state --instance-name ${{ env.NEW_INSTANCE_NAME }} | grep '"name":' | sed 's/ //g' | sed 's/"//g' | sed 's/name://g')
if [ $NEW_INSTANCE_STATE == running ]
then
echo "New instance is running now"
sleep 10s
break
fi
done
- name: Put instance public ports
run: |
aws lightsail put-instance-public-ports \
--port-infos fromPort=0,toPort=65535,protocol=all \
--instance-name ${{ env.NEW_INSTANCE_NAME }}
- name: Attach static ip
run: |
aws lightsail attach-static-ip \
--static-ip-name CasaOS-Demo-IP \
--instance-name ${{ env.NEW_INSTANCE_NAME }}
- name: Delete old instance
run: |
aws lightsail delete-instance \
--instance-name ${{ env.OLD_INSTANCE_NAME }}
- name: Demo Reset Error Handling
if: ${{ failure() }}
run: |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"Demo Reset Error"}}' ${{ secrets.SSH_ROBOT_URL }}

View File

@ -1,27 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Move alpha bug to project
on:
issues:
types:
- opened
jobs:
track_issue:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
with:
app_id: ${{ secrets.ALPHA_BOT_ID }}
private_key: ${{ secrets.ALPHA_BOT_PEM }}
- name: Add Issue To GitHub Projects Beta
uses: actions/add-to-project@v0.1.0
with:
project-url: https://github.com/orgs/IceWhaleTech/projects/5
github-token: ${{ steps.generate_token.outputs.token }}
labeled: alpha, bug
label-operator: AND

View File

@ -1,46 +0,0 @@
name: publish npm
on:
push:
tags:
- v*.*.*
workflow_dispatch:
permissions:
contents: write
jobs:
publish-npm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: git tag --sort=-creatordate | head -n 1
- name: Get version
id: get_version
run: echo "VERSION=$(git tag --sort=-creatordate | head -n 1)" >> $GITHUB_OUTPUT
- name: Get commit id
id: get_commit_id
run: echo "COMMIT_ID=$( git rev-parse --short "$GITHUB_SHA" )" >> $GITHUB_OUTPUT
- run: echo "${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"
- name: Set version
run: |
sudo apt-get install jq
jq '.version="${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"' package.json > package.json.new
mv package.json.new package.json
- name: Generate SDK
run: |
npm cache clean --force
npm install @openapitools/openapi-generator-cli -g
- run: npm i
- run: npm run start
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

View File

@ -1,42 +0,0 @@
name: Push Events to Discord
on:
issues:
types:
- opened
issue_comment:
types:
- created
discussion:
types:
- created
- transferred
- answered
discussion_comment:
types:
- created
jobs:
push-events:
runs-on: ubuntu-latest
steps:
- name: General Discussions & Comments
if: ${{ ( github.event_name == 'discussion' || github.event_name == 'discussion_comment' ) && github.event.discussion.category.name == 'General' }}
uses: joseph-montanez/forward-event-action@v3.0.0
with:
webhook: ${{ secrets.Discord_CasaOS_General_Webhook }}
- name: App Request Issues & Comments
if: ${{ ( github.event_name == 'issues' || github.event_name == 'issue_comment' ) && contains(github.event.issue.labels.*.name, 'App Request') }}
uses: joseph-montanez/forward-event-action@v3.0.0
with:
webhook: ${{ secrets.Discord_CasaOS_App_Request_Webhook }}
- name: Bug Issues & Comments
if: ${{ ( github.event_name == 'issues' || github.event_name == 'issue_comment' ) && contains(github.event.issue.labels.*.name, 'bug') && !contains(github.event.issue.labels.*.name, 'alpha') }}
uses: joseph-montanez/forward-event-action@v3.0.0
with:
webhook: ${{ secrets.Discord_CasaOS_Bug_Webhook }}

View File

@ -1,92 +0,0 @@
name: Auto Publish Website
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: isntall git
run: sudo apt install --yes git
- name: git global
run: sudo git config --global --add safe.directory '*'
- name: set version
run: sudo git tag v00.00.00-alpha
- name: Fetch all tags
run: sudo git fetch --force --tags
- name: Get version
id: get_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "VERSION=$(git describe --abbrev=0 --tags | awk -F- '{print $1}')" >> $GITHUB_ENV
- name: show version
id: show_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo ${{env.VERSION}}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: 1.14.1
args: release --rm-dist --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GoogleID: ${{ secrets.GoogleID }}
GoogleSecret: ${{ secrets.GoogleSecret }}
DropboxKey: ${{ secrets.DropboxKey }}
DropboxSecret: ${{ secrets.DropboxSecret }}
OneDriveID: ${{ secrets.OneDriveID }}
OneDriveSecret: ${{ secrets.OneDriveSecret }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: remove migration file
run: sudo find . -type f \( -name '*migration*' \) -delete
- name: install sshpass
run: sudo apt install sshpass --yes
- name: ZeroTier
uses: zerotier/github-action@v1.0.1
with:
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}
- name: ping host
shell: bash
run: |
count=10
while ! ping -c 1 10.147.18.11 ; do
echo "waiting..." ;
sleep 1 ;
let count=count-1
done
echo "ping success"
- name: copy tar to target host
shell: bash
run: |
sshpass -p "${{ secrets.ssh_password }}" scp -r -o StrictHostKeyChecking=no -P 22 ./dist/*.gz root@10.147.18.11:/var/www/download
echo "ping success"
- name: send message
run: |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS updated"}}' ${{ secrets.SSH_ROBOT_URL }}

View File

@ -1,25 +0,0 @@
name: goreleaser
on:
push:
tags:
- v*.*.*
permissions:
contents: write
jobs:
call-workflow-passing-data:
uses: IceWhaleTech/github/.github/workflows/go_release.yml@main
with:
project-name: CasaOS
file-name: casaos
secrets:
GoogleID: ${{ secrets.GoogleID }}
GoogleSecret: ${{ secrets.GoogleSecret }}
DropboxKey: ${{ secrets.DropboxKey }}
DropboxSecret: ${{ secrets.DropboxSecret }}
OneDriveID: ${{ secrets.OneDriveID }}
OneDriveSecret: ${{ secrets.OneDriveSecret }}
OneDrivePublic: ${{ secrets.OneDrivePublic }}
OSS_KEY_ID: ${{ secrets.OSS_KEY_ID }}
OSS_KEY_SECRET: ${{ secrets.OSS_KEY_SECRET }}

View File

@ -1,19 +0,0 @@
name: Sync OpenAPI
on:
workflow_call:
inputs:
project-name:
required: true
type: string
push:
branches:
- main
jobs:
sync:
uses: IceWhaleTech/github/.github/workflows/sync_openapi.yml@main
with:
project-name: casaos
secrets:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}

14
.gitignore vendored
View File

@ -20,7 +20,6 @@
# IntelliJ project files # IntelliJ project files
.idea .idea
.vscode
*.iml *.iml
out out
gen gen
@ -28,16 +27,3 @@ gen
/sql/ /sql/
/out/ /out/
/db/ /db/
/conf/conf.ini
/conf/conf.conf
/conf/conf.json
__debug_bin
main
github.com
.all-contributorsrc
dist
CasaOS
/codegen
# System Files
.DS_Store

3
.gitmodules vendored
View File

@ -1,4 +1,3 @@
[submodule "UI"] [submodule "UI"]
path = UI path = UI
url = https://github.com/IceWhaleTech/CasaOS-UI.git url = https://github.com/ZimaBoard/CasaOS-UI.git
branch = main

View File

@ -1,194 +0,0 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: casaos
before:
hooks:
- go generate
- go run github.com/google/go-licenses@latest check . --disallowed_types=restricted
- go mod tidy
- go test -race -v ./...
builds:
- id: casaos-amd64
binary: build/sysroot/usr/bin/casaos
env:
- CC=x86_64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- amd64
- id: casaos-arm64
binary: build/sysroot/usr/bin/casaos
env:
- CC=aarch64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm64
- id: casaos-arm-7
binary: build/sysroot/usr/bin/casaos
env:
- CC=arm-linux-gnueabihf-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm
goarm:
- "7"
- id: casaos-riscv64
binary: build/sysroot/usr/bin/casaos
env:
- CC=riscv64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- riscv64
- id: casaos-migration-tool-amd64
binary: build/sysroot/usr/bin/casaos-migration-tool
main: ./cmd/migration-tool
env:
- CC=x86_64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- amd64
- id: casaos-migration-tool-arm64
binary: build/sysroot/usr/bin/casaos-migration-tool
main: ./cmd/migration-tool
env:
- CC=aarch64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm64
- id: casaos-migration-tool-arm-7
binary: build/sysroot/usr/bin/casaos-migration-tool
main: ./cmd/migration-tool
env:
- CC=arm-linux-gnueabihf-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm
goarm:
- "7"
- id: casaos-migration-tool-riscv64
binary: build/sysroot/usr/bin/casaos-migration-tool
main: ./cmd/migration-tool
env:
- CC=riscv64-linux-gnu-gcc
gcflags:
- all=-N -l
ldflags:
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- riscv64
archives:
- name_template: >-
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }}
id: casaos
builds:
- casaos-amd64
- casaos-arm64
- casaos-arm-7
- casaos-riscv64
files:
- build/**/*
- name_template: >-
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-migration-tool-v{{ .Version }}
id: casaos-migration-tool
builds:
- casaos-migration-tool-amd64
- casaos-migration-tool-arm64
- casaos-migration-tool-arm-7
- casaos-migration-tool-riscv64
files:
- build/sysroot/etc/**/*
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
# release:
# github:
# owner: IceWhaleTech
# name: CasaOS
# draft: true
# prerelease: auto
# mode: replace
# name_template: "v{{ .Version }}"
release:
github:
owner: IceWhaleTech
name: CasaOS
draft: true
prerelease: auto
mode: replace
name_template: "v{{ .Version }}"

View File

@ -1,252 +0,0 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: casaos
before:
hooks:
- go generate
- go run github.com/google/go-licenses@latest check . --disallowed_types=restricted
- go mod tidy
- go test -race -v ./...
builds:
- id: casaos-amd64
binary: build/sysroot/usr/bin/casaos
hooks:
post:
- upx --best --lzma -v --no-progress "{{ .Path }}"
env:
- CC=x86_64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_id={{.Env.GoogleID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_secret={{.Env.GoogleSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_id={{.Env.OneDriveID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_secret={{.Env.OneDriveSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_key={{.Env.DropboxKey}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_secret={{.Env.DropboxSecret}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- amd64
- id: casaos-arm64
binary: build/sysroot/usr/bin/casaos
# hooks:
# post:
# - upx --best --lzma -v --no-progress "{{ .Path }}"
env:
- CC=aarch64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_id={{.Env.GoogleID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_secret={{.Env.GoogleSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_id={{.Env.OneDriveID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_secret={{.Env.OneDriveSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_key={{.Env.DropboxKey}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_secret={{.Env.DropboxSecret}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm64
- id: casaos-arm-7
binary: build/sysroot/usr/bin/casaos
hooks:
post:
- upx --best --lzma -v --no-progress "{{ .Path }}"
env:
- CC=arm-linux-gnueabihf-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_id={{.Env.GoogleID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_secret={{.Env.GoogleSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_id={{.Env.OneDriveID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_secret={{.Env.OneDriveSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_key={{.Env.DropboxKey}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_secret={{.Env.DropboxSecret}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm
goarm:
- "7"
- id: casaos-riscv64
binary: build/sysroot/usr/bin/casaos
env:
- CC=riscv64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_id={{.Env.GoogleID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_secret={{.Env.GoogleSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_id={{.Env.OneDriveID}}
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_secret={{.Env.OneDriveSecret}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_key={{.Env.DropboxKey}}
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_secret={{.Env.DropboxSecret}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- riscv64
- id: casaos-migration-tool-amd64
binary: build/sysroot/usr/bin/casaos-migration-tool
hooks:
post:
- upx --best --lzma -v --no-progress "{{ .Path }}"
main: ./cmd/migration-tool
env:
- CC=x86_64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- amd64
- id: casaos-migration-tool-arm64
binary: build/sysroot/usr/bin/casaos-migration-tool
# hooks:
# post:
# - upx --best --lzma -v --no-progress "{{ .Path }}"
main: ./cmd/migration-tool
env:
- CC=aarch64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm64
- id: casaos-migration-tool-arm-7
binary: build/sysroot/usr/bin/casaos-migration-tool
hooks:
post:
- upx --best --lzma -v --no-progress "{{ .Path }}"
main: ./cmd/migration-tool
env:
- CC=arm-linux-gnueabihf-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- arm
goarm:
- "7"
- id: casaos-migration-tool-riscv64
binary: build/sysroot/usr/bin/casaos-migration-tool
main: ./cmd/migration-tool
env:
- CC=riscv64-linux-gnu-gcc
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
- osusergo
goos:
- linux
goarch:
- riscv64
archives:
- name_template: >-
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }}
id: casaos
builds:
- casaos-amd64
- casaos-arm64
- casaos-arm-7
- casaos-riscv64
files:
- build/**/*
- name_template: >-
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-migration-tool-v{{ .Version }}
id: casaos-migration-tool
builds:
- casaos-migration-tool-amd64
- casaos-migration-tool-arm64
- casaos-migration-tool-arm-7
- casaos-migration-tool-riscv64
files:
- build/sysroot/etc/**/*
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
# release:
# github:
# owner: IceWhaleTech
# name: CasaOS
# draft: true
# prerelease: auto
# mode: replace
# name_template: "v{{ .Version }}"
release:
github:
owner: IceWhaleTech
name: CasaOS
draft: true
prerelease: auto
mode: replace
name_template: "v{{ .Version }}"

View File

@ -1,616 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
### Changed
### Removed
### Security
## [0.4.3]
### Added
- [Disk] Now usb also supports merging to
### Changed
- [File] Solve the installation dependency problem, make the installation more smoothly
- [File] Change the default permissions of the sharing folder
### Fixed
- [System] Fixed not see wlan iface ([#909](https://github.com/IceWhaleTech/CasaOS/issues/909))
- [System] Terminal font issue fix ([#929](https://github.com/IceWhaleTech/CasaOS/issues/929))
- [File] Fixed the problem of not being able to launch after mounting
### Removed
## [0.4.2]
### Added
- [App] Increase the display of progress during the installation process
- [App] Label whether the current app supports x86 or Pi devices
- [App] Support single app version upgrade
- [File] Support mounting of Google Drive and Dropbox cloud drives
- [System] Support Mint Linux
### Changed
- [File] Optimize the download speed of a single file
### Fixed
- [Share] Fix the samba permission issue
- [Disk] Fix the problem of disk mount point plus 1 after upgrade ([#770](https://github.com/IceWhaleTech/CasaOS/issues/770))
- [File] Fix the problem of file permission change caused by modifying files in casaos ([#829](https://github.com/IceWhaleTech/CasaOS/issues/829))
- [Share] Fix the problem of files being deleted due to samba uninstallation failure ([#843](https://github.com/IceWhaleTech/CasaOS/issues/843))
## [0.4.1] - 2023-1-19
### Added
- [Disk] Added disk merging feature in storage management (beta) that allows for multiple disks to be merged into a single storage space
- [System] Added option for startpage.com search engine
- [APP] Added app cloning feature in the app's context menu.
### Changed
- [APP] Improved app installation process, including display of the installation process, checks for successful installation, and prompts
- [System] Binary sizes are 40%~60% smaller (thanks to upx)
- [App] Optimization of install and update for certain country.
- [All] Lots of bug fixes
## [0.4.0] - 2022-12-13
### Added
- [Developer] Included `casaos-cli` command tool for debugging
- [Developer] Added message bus for events and actions - Use `casaos-cli message-bus` to manage.
- [Disk] Disk notification in Dashboard
- [System] Restart/shutdown directly from CasaOS Dashboard
### Changed
- [General] CasaOS new logo!
- [App] Redesign of Featured App
- [App] Now you can choose to delete userdata along with app uninstallation
### Security
- [System] Fixed a shell injection issue for better security
### Fixed
- [System] Re-instate default zone0 for CPU Temp ([#694](https://github.com/IceWhaleTech/CasaOS/issues/694))
- [Disk] Fixed storage name with extra `-1` after rebooting ([#698](https://github.com/IceWhaleTech/CasaOS/issues/698))
- [Disk] Fixed disk check so it does not impact disk going into idle ([#704](https://github.com/IceWhaleTech/CasaOS/issues/704))
## [0.3.8] 2022-11-21
### Added
- [System] Add system announcement
- [App] Allow to turn off the display of "Existing Docker Apps" in the settings.
### Changed
- [System] Improve the feedback function, you can submit feedback in the bottom right corner of WebUI.
### Fixed
- [System] Fix CPU Temp for other platforms ([#661](https://github.com/IceWhaleTech/CasaOS/issues/661))
## [0.3.7.1] 2022-11-04
### Fixed
- Fix memory leak issue ([#658](https://github.com/IceWhaleTech/CasaOS/issues/658)[#646](https://github.com/IceWhaleTech/CasaOS/issues/646))
- Solve the problem of local application import failure ([#490](https://github.com/IceWhaleTech/CasaOS/issues/490))
## [0.3.7] 2022-10-28
### Added
- [Storage] Disk merge (Beta), you can merge multiple disks into a single storage space (currently you need to enable this feature from the command line)
### Changed
- [Files] Changed the cache file storage location, now the file upload size is not limited by the system disk capacity.
- [Scripts] Updated installation and upgrade scripts to support more Debian-based Linux distributions.
- [Engineering] Refactored Local Storage into a standalone service as part of CasaOS modularization.
### Fixed
- [Apps] App list update mechanism improved, now you can see the latest apps in App Store immediately.
- [Storage] Fixed a lot of known issues
### Added
- [Storage] Disk merge (Beta), you can merge multiple disks into a single storage space (currently you need to enable this feature from the command line)
### Changed
- [Files] Changed the cache file storage location, now the file upload size is not limited by the system disk capacity.
- [Scripts] Updated installation and upgrade scripts to support more Debian-based Linux distributions.
- [Engineering] Refactored Local Storage into a standalone service as part of CasaOS modularization.
### Fixed
- [Apps] App list update mechanism improved, now you can see the latest apps in App Store immediately.
- [Storage] Fixed a lot of known issues
## [0.3.6] - 2022-09-06
### Added
- [System] Added power and temperature info to performance widget (Intel)
- [Apps] Custom links can be added to Apps section
### Fixed
- [Apps] Fixed the problem of not being able to modify some App settings ([#510](https://github.com/IceWhaleTech/CasaOS/issues/510))
### Changed
- [System] Architecture optimization. Improved performance.
## [0.3.5] - 2022-08-23
### Added
- [File] Mount the shared samba
- [File] File sharing via Samba
- [System] You can share casaos on Twitter, facebook, reddit
### Changed
- [Disk] Support for mounting existing data disks
### Fixed
- [App] fixed uninstalling imported docker container apps results in wiping ALL your config data from them ([#360](https://github.com/IceWhaleTech/CasaOS/issues/360))
## [0.3.4] - 2022-07-29(UTC)
### Added
- SSH adds port-side options and prompts for connection status. ([#286](https://github.com/IceWhaleTech/CasaOS/issues/286))
### Changed
- Normalize all routes
- Application names now support spaces ([#211](https://github.com/IceWhaleTech/CasaOS/issues/211))
### Removed
- Removed casaos connect
### Security
- Adjustment of authentication method
### Fixed
- Fixed storage format and remove password error issues ([#344](https://github.com/IceWhaleTech/CasaOS/issues/344) [#357](https://github.com/IceWhaleTech/CasaOS/issues/357))
## [0.3.3] - 2022-07-08(UTC)
### Added
- [System]Add interface call log
- Adding Developing file ([#311](https://github.com/IceWhaleTech/CasaOS/pull/311))
- [App] add new tips for app section.
- [System] UI Configurable function modules: support turning off the search bar and recommended apps module in the settings.
- [System] Custom wallpapers: two new preset wallpapers, support for custom uploads, support for setting images from Files as wallpapers, Also support right click on dashboard to change wallpaper.
### Changed
- [App] Cache app store index and category data
- [System] casaos master program adapted to FHS standards
- [App] Update casaos icons.
- [System] Update translation.
### Removed
- [System] Remove upnp function module
- [System] Remove ddns function module
- [System] Remove search function module
- [System] Remove zerotier function module
- [System] Remove task function module
- [System] Remove file share function module
### Fixed
- [Disk] Fixed hard drive won't hibernate problem ([#202](https://github.com/IceWhaleTech/CasaOS/issues/202))
- [File] Fixed the backspace key that causes the folder to rewind ([#252](https://github.com/IceWhaleTech/CasaOS/issues/252))
- [App] Fixed app logo is not loading when imported. ([#320](https://github.com/IceWhaleTech/CasaOS/issues/320))
## [0.3.2.1] - 2022-06-16(UTC)
### Changed
- [System] Adjusted the display style.
### Fixed
- [System] Fixed the issue of widgets displaying wrongly on mobile devices.
- [App] Fix the problem of application opening failure on non-80 ports ([#283](https://github.com/IceWhaleTech/CasaOS/issues/283) [#280](https://github.com/IceWhaleTech/CasaOS/issues/280))
- [System] Modify port failure problem ([#282](https://github.com/IceWhaleTech/CasaOS/issues/282))
- [App]Modify environment variables disappearing problem([#284](https://github.com/IceWhaleTech/CasaOS/issues/284))
- [System]Fix no update alert([#278](https://github.com/IceWhaleTech/CasaOS/issues/278))
- [System] Fixed some bugs of application cpu usage and memory staging([#272](https://github.com/IceWhaleTech/CasaOS/issues/272))
- [App] Fixed plex and HA network mode error issues ([#299](https://github.com/IceWhaleTech/CasaOS/issues/299))
- [App] Fix application terminal not working ([#266](https://github.com/IceWhaleTech/CasaOS/issues/266))
## [0.3.2] - 2022-06-10
### Added
- [Files] Files can now be selected multiple files and downloaded, deleted, moved, etc.
- [Apps] Support to modify the application opening address.([#204](https://github.com/IceWhaleTech/CasaOS/issues/204))
### Changed
- [Apps] Hide the display of non-essential environment variables in the application.([#196](https://github.com/IceWhaleTech/CasaOS/issues/196))
- [System] Network, disk, cpu, memory, etc. information is modified to be pushed via socket.
- [System] Optimize opening speed.([#214](https://github.com/IceWhaleTech/CasaOS/issues/214))
- [Language] Update language pack [zarevskaya](https://github.com/zarevskaya) [patrickhilker](https://github.com/patrickhilker)
- [System] Interface path adjustment
### Removed
- [Files] Remove the online preview function of PDF files
### Fixed
- [System] Fixed the problem that sync data cannot submit the device ID ([#68](https://github.com/IceWhaleTech/CasaOS/issues/68))
- [Files] Fixed the code editor center alignment display problem.([#210](https://github.com/IceWhaleTech/CasaOS/issues/210))
- [Files] Fixed the problem of wrong name when downloading files.([#240](https://github.com/IceWhaleTech/CasaOS/issues/240))
- [System] Fixed the network display as a negative number problem.([#224](https://github.com/IceWhaleTech/CasaOS/issues/224))
- [System] Fixed the problem of wireless network card traffic display.([#222](https://github.com/IceWhaleTech/CasaOS/issues/222))
## [0.3.1.1] - 2022-05-17
### Fixed
- Fix the data loss problem when importing local applications
## [0.3.1] - 2022-05-16
### Added
- CasaConnect and file add image thumbnail function
- Import of docker applications
- List support custom sorting function
- CasaConnect gives priority to LAN connections
- USB auto-mount switch (Raspberry Pi is off by default)
- Application custom installation supports Docker Compose configuration import in YAML format
- You will see the new version changelog from the next version
- Added live preview for icons in custom installed applications
### Changed
- Application data is no longer saved to the database
- Optimize app store speed issues
- Optimize the way WebUI is filled in
- Image preview has been completely upgraded and now supports switching between all images in the same folder, as well as dragging, zooming, rotating and resetting.
- Added color levels to the CPU and RAM charts
- Optimized the display of the Connect friends list right-click menu
- Change the initial display directory to /DATA
### Removed
- Historical Application Data
### Fixed
- Fixed the problem that some Docker CLI commands failed to import
- Fix the problem that the application is not easily recognized in /DATA/AppData directory and docker command line after installation, it will be shown as application name
- Fix Pi-hole installation failure
- Fixed the issue that the app could not be updated using WatchTower
- Fixed the problem that the task status was lost after closing Files when there was an upload task
## [0.3.0] - 2022-04-08
### Added
- Add CasaConnect function, now you can share private files peer-to-peer with your friends.
- Add a widget for network traffic monitoring.
- 12 new popular apps added to App Center
### Changed
- Updated the sidebar of Files.
- Updated the initial directory of Files to the Root directory.
- Armbian 22.02 armhf/arm64/amd64 platform tests passed [@igorpecovnik ](https://github.com/igorpecovnik)
- Elementary OS 6.1 Jólnir amd64 platform tests passed [@alvarosamudio ](https://github.com/alvarosamudio)
### Fixed
- Fix an issue in Files where the backspace button would trigger a return to the previous level of the directory when creating a folder.
- Fix the display problem of application list in CPU widget.
- Fix the problem that the ipv6 of the application cannot be opened
### Removed
- Interfaces related to "zerotier"
## [0.2.10] - 2022-03-10
### Added
- Added CasaOS own file manager, now you can browse, upload, download files from the system, even edit code online, preview photos and videos through it. It will appear in the first position of Apps.
- Added CPU core count display and memory capacity display.
### Changed
- Optimized the rendering performance of the home page.
- Optimized the internationalization display of the time widget.
- Show the icon of the stopped application as gray.
- Unify the animation of the drop-down menu.
- Optimize the display of the application drop-down menu.
- Replaced the default font to optimize the display.
### Fixed
- Fix the problem of failed to create storage space
## [0.2.9] - 2022-02-18
### Added
- Add a simple notification function
### Changed
- Custom installation of new parameters(Capabilities,Hostname,Privileged)
- Update front-end translation [@SemVer](https://github.com/zarevskaya) [@koboldMaki](https://github.com/koboldMaki) [@sgastol](https://github.com/sgastol) [@delki8](https://github.com/delki8)
- Modify the default location and name of the usb mount
### Fixed
- Fix the problem of being indexed by search engines
- Fix some style display issues
- Solve hard drive can't be formatted, can't finish adding storage
## [0.2.8] - 2022-01-30
### Added
- Add USB disk device display
### Changed
- Update translation [@baptiste313](https://github.com/baptiste313) [@thueske](https://github.com/thueske)
- Compatible with more types of drives
### Fixed
- Fix the language initialization bug
- Fix the problem that the login page could not be displayed
- Fix missing translated content
## [0.2.7] - 2022.01.26
### Changed
- Apply multilingual support
### Security
- Fix an injectable execution bug
## [0.2.6] - 2022.01.26
### Added
- Add a bug report panel.
- App Store apps start supporting multiple languages
### Fixed
- Fix a disk that cannot be formatted under certain circumstances
## [0.2.5] - 2022.01.24
### Added
- Storage Manager
### Changed
- Update Disk widget
- Update language files [@ImOstrovskiy](https://github.com/ImOstrovskiy) [@baptiste313](https://github.com/baptiste313)
### Fixed
- File synchronization issues
- Fix the app store classification problem
## [0.2.4] - 2021.12.30
### Changed
- Brand new App Store
- Optimize request method
### Fixed
- Fix Sync panel width display error.
- Fix App panel width display error.
## [0.2.3] - 2021.12.11
### Added
- Add detailed CPU and memory statistics.
- Add the multi-language function and add Chinese translation.
- Add the function to modify the search engine.
- Add the function of modifying the WebUI port
### Changed
- Update update script
- Preprocessing usb automounting
### Fixed
- Volume path problem when customizing the installation of applications
- Fix Cpu and Ram usage display error
- Fix translation errors
- Fixed an error when importing and exporting appfile.
## [0.2.2] - 2021.12.02
### Changed
- UI adjustment
### Fixed
- Fix the problem of data display error when manually installing apps
- Fix some spelling problems
- Fix the bug of synchronization module
## [0.2.1] - 2021.11.25
### Fixed
- Fix Sync display error
- Fix Sync Downoad url error
- Fix Smart Block display error
- Fix widgets settings dispaly error
- Fix application installation path error
## [0.2.0] - 2021.11.25
### Added
- Add sync function
## [0.1.11] - 2021.11.10
### Changed
- Adaptation of cell phone terminals
- Optimize user experience
- Replaced the default background
- Optimized the display performance and fixed some bugs
### Fixed
- Resolve application installation path errors
## [0.1.10] - 2021.11.04
### Added
- Add application terminal
- Add application logs
- Add system logs
- Add App Store for installation
## [0.1.9] - 2021.11.01 [YANKED]
## [0.1.8] - 2021.10.27
### Added
- Add system terminal
- Add the ability to modify the user name and password
### Changed
- Experience optimization
- Improve single user management function
- Fixed Disk widget display error
- Fixed Username display error after change
- Adaptation for mobile access
## [0.1.7] - 2021.10.22
### Added
- Add user authentication module, Login page and initialization page.
### Fixed
- Fix the problem that the application could not start after the system restarted.
- Home storage space data display exception
- Script override causes application loss after installation
- Fix docker network error
## [0.1.6] - 2021.10.19
### Added
- Add app icon auto-fill via docker image name.
- Add a file selector for app install.
### Changed
- Modify import reminder.
- Optimize the application installation process
### Fixed
- Fixed an issue with the app were it would disappear when the app was modified.
- Fixed device selector default dir to /dev
## [0.1.5] - 2021.10.15
### Added
- Add CPU RAM Status with widget
- Add Disk Info with widget
- Realize automatic loading of widgets
### Changed
- Enhance the Docker cli import experience and automatically fill in the folders that need to be mounted
### Removed
- Remove Weather widget.
### Fixed
- AppFile upload does not pass verification
- The setting menu of the app is displayed abnormally when the browser window is too narrow
- The port is occupied and the program cannot start
- Fix display bugs when windows size less than 1024px
## [0.1.4] - 2021.09.30
### Added
- Import and export of application configuration files
- Automatic parsing of docker commands
### Changed
- Improve the program release process
- Application installation process UX/UI optimization
### Fixed
- Authentication failure during the operation, resulting in the need to re-login
## [0.1.3] - 2021.09.29 [YANKED]
## [0.1.2] - 2021.09.28
### Fixed
- Application modification and new creation failure issues
## [0.1.1] - 2021.09.27
## [0.1.0] - 2021.09.26
### Added
- Application Center

View File

@ -1,128 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
wiki@casaos.io.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@ -1,33 +0,0 @@
# CasaOS Development
Here we will describe the steps required to setup a development environment with CasaOS.
- [Setting up development environment](#setting-up-development-environment)
- [Pre-requisites](#pre-requisites)
- [1. Fork the Repo](#1.-fork-the-repo)
- [2. Clone the repo down](#2.-clone-the-repo-down)
- [3. Install dependencies](#3.-install-dependencies)
## Setting up a development environment
In this section we will walk you through the general process of setting up your development environment to get started.
### Pre-requisites
The following must be installed in order to get started. The details of how to install them is outside the scope of this doc, but generally they should be able to be installed with your systems package manager (apt, yum, brew, choco, etc).
- Go > v1.17.0
- yarn
- node.js
### 1. Fork the Repo
[Fork the repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) onto your own GitHub account for developing.
### 2. Clone the repo down
1. Navigate into your go workspace (check with `go env GOPATH`).
2. Navigate to the appropriate path for github. It should look something like this: `<path from GOPATH>/github.com/<GitHub Username>/`. If it doesn't exist create it.
3. Clone down the repo with the following: `git clone --recurse-submodules --remote-submodules https://github.com/<your GitHub Username>/CasaOS.git`
### 3. Install dependencies
1. `cd UI`
2. `yarn install`
3. `yarn build`
4. `cd ..`
5. `go get`

201
LICENSE
View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -4,10 +4,10 @@ build: build-ui build-backend
build-ui: build-ui:
cd CasaOS-UI && yarn install && yarn build cd UI && yarn install && yarn build
build-backend: build-backend:
export CGO_ENABLED=1;export CGO_LDFLAGS=-static;go build -o ./casa main.go;upx --lzma --best casa export CGO_ENABLED=1;export CGO_LDFLAGS=-static;go mod tidy;go build -o ./casa main.go;upx --lzma --best casa
help: help:
@echo "call john" @echo "call john"

7
README-ZH.md Normal file
View File

@ -0,0 +1,7 @@
## 目录结构
- conf 配置文件
- route 路由
- service 方法的具体实现
- utils 工具
- main.go 入口

257
README.md
View File

@ -1,257 +1,2 @@
# CasaOS - Your Personal Cloud # Oasis
<!-- Readme i18n links -->
<!-- > English | [中文](#) | [Français](#) -->
<p align="center">
<!-- CasaOS Banner -->
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_dark_night_800x300.png">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_twilight_blue_800x300.png">
<img alt="CasaOS" src="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_twilight_blue_800x300.png">
</picture>
<br/>
<i>Connect with the community, establish autonomy, reduce the cost of SaaS, and MAXIMIZE the potential for a personalized copilot.</i>
<br/>
<br/>
<!-- CasaOS Badges -->
<a href="https://github.com/IceWhaleTech/CasaOS" target="_blank">
<img alt="CasaOS Version" src="https://img.shields.io/github/v/release/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=CasaOS" />
</a>
<a href="https://github.com/IceWhaleTech/CasaOS/blob/main/LICENSE" target="_blank">
<img alt="CasaOS License" src="https://img.shields.io/github/license/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=License" />
</a>
<a href="https://github.com/IceWhaleTech/CasaOS/pulls" target="_blank">
<img alt="CasaOS Pull Requests" src="https://img.shields.io/github/issues-pr/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=PRs" />
</a>
<a href="https://github.com/IceWhaleTech/CasaOS/issues" target="_blank">
<img alt="CasaOS Issues" src="https://img.shields.io/github/issues/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=Issues" />
</a>
<a href="https://codecov.io/gh/IceWhaleTech/CasaOS" >
<img src="https://codecov.io/gh/IceWhaleTech/CasaOS/branch/main/graph/badge.svg?token=l9uMKGlkxM"/>
</a>
<a href="https://github.com/IceWhaleTech/CasaOS/stargazers" target="_blank">
<img alt="CasaOS Stargazers" src="https://img.shields.io/github/stars/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=Stars" />
</a>
<!-- <a href="https://github.com/IceWhaleTech/CasaOS/releases" target="_blank">
<img alt="CasaOS Downloads" src="https://img.shields.io/github/downloads/IceWhaleTech/CasaOS/total?color=162453&style=flat-square" />
</a> -->
<br/>
<!-- CasaOS Community -->
<a href="https://discord.gg/knqAbbBbeX" target="_blank">
<img alt="IceWhale Discord" src="https://img.shields.io/discord/884667213326463016?color=162453&style=flat-square&label=Discord&logo=discord&logoColor=fff" />
</a>
<a href="https://github.com/IceWhaleTech/CasaOS/discussions" target="_blank">
<img alt="CasaOS GitHub Discussions" src="https://img.shields.io/github/discussions/IceWhaleTech/CasaOS?color=162453&style=flat-square&label=Discussions&logo=github" />
</a>
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#credits">
<img alt="All Contributors" src="https://img.shields.io/static/v1?label=All%20Contributors&message=15&color=162453&style=flat-square&logo=Handshake&logoColor=fff" />
</a>
<!-- CasaOS YouTube -->
<a href="https://www.youtube.com/channel/UC2zMrUYT17AJhIl9XWZzT8g" target="_blank">
<img alt="YouTube Tutorial Views" src="https://img.shields.io/youtube/channel/views/UC2zMrUYT17AJhIl9XWZzT8g?style=flat-square&logo=youtube&logoColor=red&label=YouTube%20Tutorial%20Views" />
</a>
<br/>
<a href="http://bit.ly/45JQIiL" target="_blank">
<img alt="twitter ZimaSpace" src="https://img.shields.io/twitter/follow/ZimaSpace?style=flat-square&logo=X&label=Contact%20Us%20%40%20ZimaSpace&labelColor=555&color=555" />
</a>
<a href="http://bit.ly/4lgHj7V" target="_blank">
<img alt="facebook ZimaSpace" src="https://img.shields.io/badge/ZimaSpace-1877F2?style=flat-square&logo=Facebook&logoColor=fff&label=Contact%20Us&labelColor=555&color=162453" />
</a>
<br/>
<!-- CasaOS Links -->
<a href="https://www.casaos.io" target="_blank">Website</a> |
<a href="http://demo.casaos.io" target="_blank">Demo</a> |
<a href="https://github.com/IceWhaleTech/CasaOS" target="_blank">GitHub</a>
<br/>
<br/>
<!-- CasaOS Snapshots -->
<kbd>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="snapshot-dark.jpg">
<source media="(prefers-color-scheme: light)" srcset="snapshot-light.jpg">
<img alt="CasaOS Snapshot" src="snapshot-light.jpg">
</picture>
</kbd>
</p>
## Why do you need Personal Cloud?
In 2020, the team noticed three important trends:
- The cost of computing power and storage was decreasing fast.
- A part of cloud computing was moving towards edge computing.
- The issue of consumer data asset ownership and attribution had been ignored.
Based on these trends, the team proposed a thought experiment internally: what if personal clouds were available under $100 in next five years? This personal cloud would provide a low-cost data collaboration solution as a personal data center, storing and managing data for creators and small organizations. A distributed collaborative computing network can be formed by personal servers located around the world. It could also control and connect all smart devices, providing cross-ecosystem local intelligent services.
Furthermore, the personal cloud could combine personal data to train personalized AI assistants. The idea is that this technology would be an effective way to solve the issue of consumer data asset ownership and , as well as provide a more affordable and efficient computing solution for individuals and small organizations.
> If you think what we are doing is valuable. Please **give us a star ⭐** and **fork it 🤞**!
## Features
- Friendly UI designed for home scenarios
- No code, no forms, intuitive, design for humanity
- Multiple hardware and base system support
- ZimaBoard, NUC, RPi, old computers, whatever is available.
- Selected apps in the app store, one-click installation
- Nextcloud, HomeAssistant, AdGuard, Jellyfin, *arr and more!
- Easily install numerous Docker apps
- Over 100,000 apps from the Docker ecosystem can be easily installed
- Elegant drive and file management
- What you see is what you get. No technical background required.
- Well-designed system/app widgets
- What you care about, at a glance. Resource usage, app status, and more!
## Getting Started
CasaOS fully supports ZimaBoard, Intel NUC, and Raspberry Pi. Also, more computers and development boards and fully compatible with Ubuntu, Debian, Raspberry Pi OS, and CentOS with one-liner installation.
### Hardware Compatibility
- amd64 / x86-64
- arm64
- armv7
### System Compatibility
Official Support
- Debian 12 (✅ Tested, Recommended)
- Ubuntu Server 20.04 (✅ Tested)
- Raspberry Pi OS (✅ Tested)
Community Support
- Elementary 6.1 (✅ Tested)
- Armbian 22.04 (✅ Tested)
- Alpine (🚧 Not Fully Tested Yet)
- OpenWrt (🚧 Not Fully Tested Yet)
- ArchLinux (🚧 Not Fully Tested Yet)
### Quick Setup CasaOS
Freshly install a system from the list above and run this command:
```sh
wget -qO- https://get.casaos.io | sudo bash
```
or
```sh
curl -fsSL https://get.casaos.io | sudo bash
```
### Update CasaOS
CasaOS can be updated from the User Interface (UI), via `Settings ... Update`.
Alternatively it can be updated from a terminal session. To update from a terminal session, it must be done either from a secure shell (ssh) session to the device or from a directly attached terminal and keyboard to the device running CasaOS, this cannot be done from the terminal via the CasaOS User Interface (UI). To update to the latest release of CasaOS from a terminal session run this command:
```sh
wget -qO- https://get.casaos.io/update | sudo bash
```
or
```sh
curl -fsSL https://get.casaos.io/update | sudo bash
```
To determine version of CasaOS from a terminal session run this command:
```sh
casaos -v
```
### Uninstall CasaOS
v0.3.3 or newer
```sh
casaos-uninstall
```
Before v0.3.3
```sh
curl -fsSL https://get.icewhale.io/casaos-uninstall.sh | sudo bash
```
## Community
The word Casa comes from the Spanish word for "home". Project CasaOS originated as a pre-installed system for the crowdfunded product [ZimaBoard](https://www.zimaboard.com) on Kickstarter.
After looking at many systems and software on the market, the team found no server system designed for home scenarios, sadly true.
So, we set out to build this open-source project to develop CasaOS with our own hands, everyone in the community, and you.
We believe that through community-driven collaborative innovation and open communication with global developers, we can reshape the digital home experience like never before.
**A warm welcome for you to get help or share great ideas in the [Discord](https://discord.gg/knqAbbBbeX)!**
[![Discord Card](https://discordapp.com/api/guilds/884667213326463016/widget.png?style=banner2)](https://discord.gg/knqAbbBbeX)
## Contributing
CasaOS is a community-driven open source project and the people involved are CasaOS users. That means CasaOS will always need contributions from community members just like you!
- See <https://wiki.casaos.io/en/contribute> for ways of contributing to CasaOS
- See <https://wiki.casaos.io/en/contribute/development> if you want to be involved in code contribution specifically
## Credits
Many thanks to everyone who has helped CasaOS so far!
Everyone's contribution is greatly appreciated. ([Emoji Key](https://allcontributors.org/docs/en/emoji-key))
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/jerrykuku"><img src="https://avatars.githubusercontent.com/u/9485680?v=4?s=100" width="100px;" alt=""/><br /><sub><b>老竭力</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=jerrykuku" title="Code">💻</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=jerrykuku" title="Documentation">📖</a> <a href="#ideas-jerrykuku" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-jerrykuku" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-jerrykuku" title="Maintenance">🚧</a> <a href="#platform-jerrykuku" title="Packaging/porting to new platform">📦</a> <a href="#question-jerrykuku" title="Answering Questions">💬</a> <a href="https://github.com/IceWhaleTech/CasaOS/pulls?q=is%3Apr+reviewed-by%3Ajerrykuku" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/LinkLeong"><img src="https://avatars.githubusercontent.com/u/13556972?v=4?s=100" width="100px;" alt=""/><br /><sub><b>link</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=LinkLeong" title="Code">💻</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=LinkLeong" title="Documentation">📖</a> <a href="#ideas-LinkLeong" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-LinkLeong" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-LinkLeong" title="Maintenance">🚧</a> <a href="#question-LinkLeong" title="Answering Questions">💬</a> <a href="https://github.com/IceWhaleTech/CasaOS/pulls?q=is%3Apr+reviewed-by%3ALinkLeong" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/tigerinus"><img src="https://avatars.githubusercontent.com/u/7172560?v=4?s=100" width="100px;" alt=""/><br /><sub><b>太戈</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=tigerinus" title="Code">💻</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=tigerinus" title="Documentation">📖</a> <a href="#ideas-tigerinus" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-tigerinus" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-tigerinus" title="Maintenance">🚧</a> <a href="#mentoring-tigerinus" title="Mentoring">🧑‍🏫</a> <a href="#security-tigerinus" title="Security">🛡️</a> <a href="#question-tigerinus" title="Answering Questions">💬</a> <a href="https://github.com/IceWhaleTech/CasaOS/pulls?q=is%3Apr+reviewed-by%3Atigerinus" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/Lauren-ED209"><img src="https://avatars.githubusercontent.com/u/8243355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lauren</b></sub></a><br /><a href="#ideas-Lauren-ED209" title="Ideas, Planning, & Feedback">🤔</a> <a href="#fundingFinding-Lauren-ED209" title="Funding Finding">🔍</a> <a href="#projectManagement-Lauren-ED209" title="Project Management">📆</a> <a href="#question-Lauren-ED209" title="Answering Questions">💬</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=Lauren-ED209" title="Tests">⚠️</a></td>
<td align="center"><a href="https://JohnGuan.Cn"><img src="https://avatars.githubusercontent.com/u/3358477?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Guan</b></sub></a><br /><a href="#blog-JohnGuan" title="Blogposts">📝</a> <a href="#content-JohnGuan" title="Content">🖋</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=JohnGuan" title="Documentation">📖</a> <a href="#ideas-JohnGuan" title="Ideas, Planning, & Feedback">🤔</a> <a href="#eventOrganizing-JohnGuan" title="Event Organizing">📋</a> <a href="#mentoring-JohnGuan" title="Mentoring">🧑‍🏫</a> <a href="#question-JohnGuan" title="Answering Questions">💬</a> <a href="https://github.com/IceWhaleTech/CasaOS/pulls?q=is%3Apr+reviewed-by%3AJohnGuan" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://blog.tippybits.com"><img src="https://avatars.githubusercontent.com/u/17506770?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Tippett</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=dtaivpp" title="Documentation">📖</a> <a href="#ideas-dtaivpp" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-dtaivpp" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/zarevskaya"><img src="https://avatars.githubusercontent.com/u/60230221?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Skaya</b></sub></a><br /><a href="#mentoring-zarevskaya" title="Mentoring">🧑‍🏫</a> <a href="#question-zarevskaya" title="Answering Questions">💬</a> <a href="#tutorial-zarevskaya" title="Tutorials"></a> <a href="#translation-zarevskaya" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/AuthorShin"><img src="https://avatars.githubusercontent.com/u/4959043?v=4?s=100" width="100px;" alt=""/><br /><sub><b>AuthorShin</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=AuthorShin" title="Tests">⚠️</a> <a href="https://github.com/IceWhaleTech/CasaOS/issues?q=author%3AAuthorShin" title="Bug reports">🐛</a> <a href="#question-AuthorShin" title="Answering Questions">💬</a> <a href="#ideas-AuthorShin" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/baptiste313"><img src="https://avatars.githubusercontent.com/u/93325157?v=4?s=100" width="100px;" alt=""/><br /><sub><b>baptiste313</b></sub></a><br /><a href="#translation-baptiste313" title="Translation">🌍</a></td>
<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/IceWhaleTech/CasaOS/commits?author=DrMxrcy" title="Tests">⚠️</a> <a href="#ideas-DrMxrcy" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-DrMxrcy" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/Joooost"><img src="https://avatars.githubusercontent.com/u/12090673?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joooost</b></sub></a><br /><a href="#ideas-Joooost" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://potyarkin.ml"><img src="https://avatars.githubusercontent.com/u/334908?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vitaly Potyarkin</b></sub></a><br /><a href="#ideas-sio" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/bearfrieze"><img src="https://avatars.githubusercontent.com/u/1023813?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bjørn Friese</b></sub></a><br /><a href="#ideas-bearfrieze" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/Protektor-Desura"><img src="https://avatars.githubusercontent.com/u/1195496?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Protektor</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/issues?q=author%3AProtektor-Desura" title="Bug reports">🐛</a> <a href="#ideas-Protektor-Desura" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-Protektor-Desura" title="Answering Questions">💬</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/llwaini"><img src="https://avatars.githubusercontent.com/u/59589857?v=4?s=100" width="100px;" alt=""/><br /><sub><b>llwaini</b></sub></a><br /><a href="#projectManagement-llwaini" title="Project Management">📆</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=llwaini" title="Tests">⚠️</a> <a href="#tutorial-llwaini" title="Tutorials"></a></td>
<td align="center"><a href="https://github.com/CorrectRoadH"><img src="https://avatars.githubusercontent.com/u/29306285?v=4?s=100" width="100px;" alt=""/><br /><sub><b>CorrectRoadH</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=correctroadh" title="Code">💻</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=correctroadh" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/zhanghengxin"><img src="https://avatars.githubusercontent.com/u/24197448?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zhanghengxin</b></sub></a><br /><a href="https://github.com/IceWhaleTech/CasaOS/commits?author=zhanghengxin" title="Code">💻</a> <a href="https://github.com/IceWhaleTech/CasaOS/commits?author=zhanghengxin" title="Documentation">📖</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!
## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/IceWhaleTech/CasaOS/releases).
---
<p align="center">
<a href="https://dashboard.trackgit.com/token/l5q8egi92tfhlxd70l2l">
<img src="https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/l5q8egi92tfhlxd70l2l" alt="trackgit-views" />
</a>
</p>

View File

@ -1,9 +0,0 @@
# Security Policy
## Supported Versions
CasaOS is currently under active development. Support is limited before CasaOS reaches v1.0.
## Reporting a Vulnerability
If you see any vulnerabiility, email us at wiki@casaos.io

3
UI/.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

2
UI/.env.dev Normal file
View File

@ -0,0 +1,2 @@
// .env.dev
NODE_ENV='dev'

2
UI/.env.production Normal file
View File

@ -0,0 +1,2 @@
// .env.production
NODE_ENV='prod'

18
UI/.eslintrc.js Normal file
View File

@ -0,0 +1,18 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-unused-vars':'off'
}
}

23
UI/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

32
UI/README.md Normal file
View File

@ -0,0 +1,32 @@
<!--
* @Author: JerryK
* @Date: 2021-09-22 14:24:43
* @LastEditors: JerryK
* @LastEditTime: 2021-09-22 14:44:31
* @Description:
* @FilePath: /CasaOS-UI/README.md
-->
# CasaOS-UI
The front-end of CasaOs,build with VueJS
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
Will be output to the ../web folder
### Lints and fixes files
```
yarn lint
```

5
UI/babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

43
UI/package.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "CasaOS",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode dev",
"build": "vue-cli-service build --no-clean --dest ../web --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.4",
"buefy": "^0.9.0",
"core-js": "^3.6.5",
"easy-affix": "^1.0.8",
"lodash.debounce": "^4.0.8",
"lottie-vuejs": "^0.4.0",
"moment": "^2.29.1",
"nth-check": "^2.0.1",
"qs": "^6.10.1",
"vee-validate": "^3.4.12",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-slider-component": "^3.2.14",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.0.0",
"yargs-parser": "^20.2.9"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^9.0.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-cli-plugin-buefy": "~0.3.8",
"vue-template-compiler": "^2.6.11"
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/ui/img/icon/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
UI/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="200.000000pt" height="200.000000pt" viewBox="0 0 200.000000 200.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M875 1894 c-11 -2 -51 -11 -88 -20 -341 -78 -610 -364 -673 -714 -82
-459 197 -902 647 -1030 94 -27 277 -37 378 -21 303 47 575 261 690 540 55
133 66 192 65 361 -1 136 -4 165 -27 235 -36 116 -62 170 -123 261 -123 186
-347 336 -566 379 -42 8 -276 15 -303 9z m250 -168 c11 -2 42 -9 70 -16 131
-30 288 -135 387 -260 160 -201 198 -506 93 -745 l-22 -50 2 80 c3 180 -64
351 -184 476 -209 216 -544 260 -807 105 -201 -117 -326 -347 -319 -587 l2
-74 -19 44 c-63 140 -80 332 -44 476 24 94 87 219 147 292 109 133 290 238
448 259 25 3 47 7 49 9 5 4 173 -3 197 -9z m8 -501 c33 -8 85 -31 116 -50 227
-137 305 -418 183 -651 l-21 -39 -1 35 c-9 251 -245 439 -490 389 -186 -38
-323 -200 -330 -389 l-1 -35 -23 45 c-101 194 -61 429 99 578 130 122 292 162
468 117z m-27 -499 c182 -85 183 -345 1 -438 -53 -27 -161 -26 -215 1 -146 75
-180 267 -69 390 63 69 190 90 283 47z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

42
UI/public/index.html Normal file
View File

@ -0,0 +1,42 @@
<!--
* @Author: JerryK
* @Date: 2021-09-22 14:24:43
* @LastEditors: JerryK
* @LastEditTime: 2021-09-24 18:03:02
* @Description:
* @FilePath: /CasaOS-UI/public/index.html
-->
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="<%= BASE_URL %>img/icon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<%= BASE_URL %>img/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<%= BASE_URL %>img/icon/favicon-16x16.png">
<link rel="manifest" href="<%= BASE_URL %>site.webmanifest">
<link rel="mask-icon" href="<%= BASE_URL %>img/icon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css">
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/js/all.js"
integrity="sha256-GaerX2a/DuOnPrxn/4vH13dobiFUe/27LO6gCZDNauA=" crossorigin="anonymous"></script>
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -0,0 +1,14 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/ui/img/icon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

110
UI/src/App.vue Normal file
View File

@ -0,0 +1,110 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-23 16:42:14
* @Description: Main entry of application
* @FilePath: /CasaOS-UI/src/App.vue
-->
<template>
<!-- <div id="app" class="is-flex is-flex-direction-column" :style="{'background-image': 'url(' + require('./assets/background/AbstractShapes.jpg') + ')'}"> -->
<div id="app" class="is-flex is-flex-direction-column" :style="{'background-image': 'url(https://www.bing.com/th?id=OHR.Aldeyjarfoss_ZH-CN0106567013_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp)'}">
<!-- NavBar Start -->
<top-bar></top-bar>
<!-- NavBar End -->
<!-- Content Start -->
<div class="contents pt-55 pb-6">
<div class="container">
<div class="is-flex">
<!-- SideBar Start -->
<side-bar></side-bar>
<!-- SideBar End -->
<!-- MainContent Start -->
<div class="main-content">
<!-- SearchBar Start -->
<section>
<search-bar></search-bar>
</section>
<!-- SearchBar End -->
<!-- Suggestions For You Start -->
<section>
<suggestion></suggestion>
</section>
<!-- Suggestions For You End -->
<!-- Apps Start -->
<section>
<apps></apps>
</section>
<!-- Apps End -->
<!-- Shortcuts Start -->
<!-- <section>
<shortcuts></shortcuts>
</section> -->
<!-- Shortcuts End -->
</div>
<!-- MainContent End -->
</div>
</div>
</div>
<!-- Content End -->
<!-- BrandBar Start -->
<brand-bar></brand-bar>
<!-- BrandBar End -->
<!-- ContactBar Start -->
<contact-bar></contact-bar>
<!-- ContactBar End -->
</div>
</template>
<script>
import Apps from './components/Apps.vue'
import BrandBar from './components/BrandBar.vue'
import ContactBar from './components/ContactBar.vue'
import SearchBar from './components/SearchBar.vue'
import SideBar from './components/SideBar.vue'
import Suggestion from './components/Suggestion.vue'
import TopBar from './components/TopBar.vue'
//import Shortcuts from './components/Shortcuts.vue'
export default {
components: {
BrandBar,
ContactBar,
SideBar,
SearchBar,
Suggestion,
Apps,
TopBar,
//Shortcuts
},
created() {
// Check if not login then login and get token
if (!localStorage.getItem("user_token")) {
this.login()
}
},
methods: {
login() {
/**
* @description: Login
* @return void
*/
// this.$api.user.login({
// username: "admin",
// pwd: "admin"
// }).then((res) => {
// if (res.data.success == 200) {
// localStorage.setItem("user_token", res.data.data)
// }
// })
}
},
}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
</style>
<path class="st0" d="M12,22c5.5,0,10-4.5,10-10S17.5,2,12,2S2,6.5,2,12S6.5,22,12,22z"/>
<path class="st0" d="M12,22c3.9,0,7-3.1,7-7s-3.1-7-7-7s-7,3.1-7,7S8.1,22,12,22z"/>
<path class="st0" d="M12,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S9.8,22,12,22z"/>
</svg>

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
UI/src/assets/img/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 44C31.732 44 38 37.732 38 30C38 22.268 31.732 16 24 16C16.268 16 10 22.268 10 30C10 37.732 16.268 44 24 44Z" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 44C28.4183 44 32 40.4183 32 36C32 31.5817 28.4183 28 24 28C19.5817 28 16 31.5817 16 36C16 40.4183 19.5817 44 24 44Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 758 B

BIN
UI/src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -0,0 +1,152 @@
// Included below are all the defined variables from Bulma
// Modify as needed, removing the !default attribute.
// Colors
$black: hsl(0, 0%, 4%) !default;
$black-bis: hsl(0, 0%, 7%) !default;
$black-ter: hsl(0, 0%, 14%) !default;
$grey-darker: hsl(0, 0%, 21%) !default;
$grey-dark: hsl(0, 0%, 29%) !default;
$grey: hsl(0, 0%, 48%) !default;
$grey-light: hsl(0, 0%, 71%) !default;
$grey-lighter: hsl(0, 0%, 86%) !default;
$white-ter: hsl(0, 0%, 96%) !default;
$white-bis: hsl(0, 0%, 98%) !default;
$white: hsl(0, 0%, 100%) !default;
$orange: hsl(14, 100%, 53%) !default;
$yellow: hsl(48, 100%, 67%) !default;
$green: hsl(141, 71%, 48%) !default;
$turquoise: hsl(171, 100%, 41%) !default;
$cyan: hsl(204, 86%, 53%) !default;
$blue: hsl(217, 71%, 53%) !default;
$purple: hsl(271, 100%, 71%) !default;
$red: hsl(348, 100%, 61%) !default;
// Typography
$family-sans-serif: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif !default;
$family-monospace: monospace !default;
$render-mode: optimizeLegibility !default;
$size-1: 3rem !default;
$size-2: 2.5rem !default;
$size-3: 2rem !default;
$size-4: 1.5rem !default;
$size-5: 1.25rem !default;
$size-6: 1rem !default;
$size-7: 0.75rem !default;
$weight-light: 300 !default;
$weight-normal: 400 !default;
$weight-medium: 500 !default;
$weight-semibold: 600 !default;
$weight-bold: 700 !default;
// Responsiveness
// The container horizontal gap, which acts as the offset for breakpoints
$gap: 32px !default;
// 960, 1152, and 1344 have been chosen because they are divisible by both 12 and 16
$tablet: 769px !default;
// 960px container + 4rem
$desktop: 960px + (2 * $gap) !default;
// 1152px container + 4rem
$widescreen: 1152px + (2 * $gap) !default;
// 1344px container + 4rem;
$fullhd: 1344px + (2 * $gap) !default;
// Miscellaneous
$easing: ease-out !default;
$radius-small: 2px !default;
$radius: 3px !default;
$radius-large: 5px !default;
$radius-rounded: 290486px !default;
$speed: 86ms !default;
// Flags
$variable-columns: true !default;
// The default Bulma derived variables are declared below
$primary: $turquoise !default;
$info: $cyan !default;
$success: $green !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $white-ter !default;
$dark: $grey-darker !default;
// Invert colors
$orange-invert: findColorInvert($orange) !default;
$yellow-invert: findColorInvert($yellow) !default;
$green-invert: findColorInvert($green) !default;
$turquoise-invert: findColorInvert($turquoise) !default;
$cyan-invert: findColorInvert($cyan) !default;
$blue-invert: findColorInvert($blue) !default;
$purple-invert: findColorInvert($purple) !default;
$red-invert: findColorInvert($red) !default;
$primary-invert: $turquoise-invert !default;
$info-invert: $cyan-invert !default;
$success-invert: $green-invert !default;
$warning-invert: $yellow-invert !default;
$danger-invert: $red-invert !default;
$light-invert: $dark !default;
$dark-invert: $light !default;
// General colors
$background: $white-ter !default;
$border: $grey-lighter !default;
$border-hover: $grey-light !default;
// Text colors
$text: $grey-dark !default;
$text-invert: findColorInvert($text) !default;
$text-light: $grey !default;
$text-strong: $grey-darker !default;
// Code colors
$code: $red !default;
$code-background: $background !default;
$pre: $text !default;
$pre-background: $background !default;
// Link colors
$link: $blue !default;
$link-invert: $blue-invert !default;
$link-visited: $purple !default;
$link-hover: $grey-darker !default;
$link-hover-border: $grey-light !default;
$link-focus: $grey-darker !default;
$link-focus-border: $blue !default;
$link-active: $grey-darker !default;
$link-active-border: $grey-dark !default;
// Typography
$family-primary: $family-sans-serif !default;
$family-code: $family-monospace !default;
$size-small: $size-7 !default;
$size-normal: $size-6 !default;
$size-medium: $size-5 !default;
$size-large: $size-4 !default;

429
UI/src/assets/scss/app.scss Normal file
View File

@ -0,0 +1,429 @@
@import "~bulma/sass/utilities/initial-variables";
@import "~bulma/sass/utilities/functions";
// 1. Set your own initial variables and derived
// variables in _variables.scss
@import "variables";
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&display=swap");
// 2. Setup your Custom Colors
$linkedin: #0077b5;
$linkedin-invert: findColorInvert($linkedin);
$twitter: #55acee;
$twitter-invert: findColorInvert($twitter);
$github: #333;
$github-invert: findColorInvert($github);
@import "~bulma/sass/utilities/derived-variables";
// 3. Add new color variables to the color map.
$addColors: (
"twitter": (
$twitter,
$twitter-invert,
),
"linkedin": (
$linkedin,
$linkedin-invert,
),
"github": (
$github,
$github-invert,
),
);
$colors: map-merge($colors, $addColors);
@import "~bulma";
@import "~buefy/src/scss/buefy";
$backDropColor: rgba(123, 123, 123, 0.16);
$backDropBlur: blur(1rem);
$backDropBorderRadius: 0.5rem;
// 4. Provide custom buefy overrides and site styles here
body,
html {
overflow: hidden;
font-family: "Roboto", sans-serif;
}
#app {
width: 100vw;
height: 100vh;
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
.top-bar {
position: relative;
z-index: 10;
height: 3rem;
background: rgba(255, 255, 255, 0.22);
backdrop-filter: blur(180.282px);
.navbar-brand {
.dropdown-menu {
margin-top: 0.5rem;
min-width: 20rem;
.dropdown-content {
.dropdown-item {
padding: 1.25rem;
text-align: left;
.item {
height: 2rem;
}
}
}
}
}
.field {
line-height: 1rem;
}
.switch {
&.is-flex-direction-row-reverse {
.control-label {
padding-left: 0;
padding-right: calc(0.75em - 1px);
}
}
}
.update-container {
.button.is-rounded {
border-radius: 9999px !important;
padding-left: calc(1em + 0.25em);
padding-right: calc(1em + 0.25em);
}
}
.button{
&.is-small{
height: 2em;
}
}
}
.brand-bar {
position: fixed;
left: 2rem;
bottom: 2rem;
}
.contact-bar {
position: fixed;
right: 2rem;
bottom: 2rem;
height: 3.5rem;
background: rgba(0, 0, 0, 0.16);
backdrop-filter: blur(24px);
border-radius: 4px;
font-size: 1.5rem;
a {
color: $white;
margin: 0.5rem;
display: flex;
align-items: center;
&:hover {
color: #0077b5;
}
}
}
.contents {
flex: 1;
overflow: auto;
}
.side-bar {
width: 16rem;
position: fixed;
}
.main-content {
flex: 1;
margin-left: 17.5rem;
}
.pt-7 {
padding-top: 4rem;
}
.pt-55 {
padding-top: 2rem;
}
.p-55 {
padding: 2rem !important;
}
.button.is-light {
background-color: #a6afb9;
color: white;
}
.label {
font-size: 0.875rem;
margin-bottom: 0.5rem;
}
.button,
.input,
.textarea,
.taginput .taginput-container.is-focusable,
.select select,
.file-cta,
.file-name,
.pagination-previous,
.pagination-next,
.pagination-link,
.pagination-ellipsis {
&:focus {
box-shadow: none;
}
}
.image.is-72x72 {
height: 72px;
width: 72px;
}
// widgets
.widget {
background: $backDropColor;
backdrop-filter: $backDropBlur;
border-radius: $backDropBorderRadius;
padding: 0.875rem 1.5rem;
margin-bottom: 0.75rem;
}
// Cards
.wuji-card {
background: $backDropColor;
backdrop-filter: $backDropBlur;
border-radius: $backDropBorderRadius;
padding: 1.5rem;
color: $white;
position: relative;
.info {
flex: 1;
margin-right: 1rem;
color: white;
}
.simg {
img {
border-radius: 4px;
}
}
.icon-img {
position: relative;
&.stop::after {
position: absolute;
content: "";
width: 0.75rem;
height: 0.75rem;
background-color: #ff1616;
border-radius: 50%;
right: -0.375rem;
top: -0.375rem;
}
img {
border-radius: 8px;
margin: 0 auto;
}
}
.b-image-wrapper {
position: relative;
display: flex;
align-items: center;
justify-content: center;
&.stop::after {
position: absolute;
content: "";
width: 0.75rem;
height: 0.75rem;
background-color: #ff1616;
border-radius: 50%;
right: -0.375rem;
top: -0.375rem;
}
img {
border-radius: 8px;
margin: 0 auto;
}
}
.action-btn {
position: absolute;
right: 0.5rem;
top: 1rem;
visibility: hidden;
opacity: 0;
transition: all 0.2s;
}
p {
font-weight: 500;
}
.one-line {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.two-line {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
&:hover {
.action-btn {
visibility: visible;
opacity: 1;
}
}
a {
color: white;
p {
color: white;
}
}
}
.flex1 {
flex: 1;
}
.title-bar {
margin-bottom: 1.5rem;
.title {
flex: 1;
margin-bottom: 0;
}
}
.ii {
.dropdown-menu {
background: rgba(255, 255, 255, 0.88);
backdrop-filter: $backDropBlur;
border-radius: $backDropBorderRadius;
overflow: hidden;
padding-top: 0;
.dropdown-content {
background: none;
padding: 0;
.button {
border-radius: 0;
padding-left: 1.5rem;
padding-right: 1.5rem;
&.is-text {
text-decoration: none;
justify-content: flex-start;
outline: none;
transition: all 0.2s;
border: none !important;
&.running {
color: #779e2a !important;
}
&.exited {
color: #ff1616 !important;
}
}
&:active {
background: none;
outline: none;
}
&:focus {
background: none;
box-shadow: none;
outline: none;
}
}
.bbor {
overflow: hidden;
border-top: #2c3e50 1px solid;
.is-text {
text-decoration: none;
justify-content: center !important ;
}
.column:first-child {
border-right: #2c3e50 1px solid;
}
}
}
}
}
//Panel
.modal-background {
background: rgba(0, 0, 0, 0.8);
}
.modal-card {
background: rgba(255, 255, 255, 0.88);
backdrop-filter: $backDropBlur;
border-radius: $backDropBorderRadius;
.modal-card-head,
.modal-card-body,
.modal-card-foot {
background-color: transparent;
border: none;
}
.modal-card-head {
padding: 3rem;
}
.modal-card-body {
padding: 0 3rem;
.button.is-static,
.input,
.textarea,
.taginput .taginput-container.is-focusable,
.select select,
.file-cta,
.file-name,
.pagination-previous,
.pagination-next,
.pagination-link,
.pagination-ellipsis {
font-size: 0.875rem;
height: 2.714em;
border: 1px solid #cfcfcf !important;
border-radius: 4px;
&:focus {
box-shadow: none;
}
}
.media {
padding: 0rem;
}
.field:last-child {
margin-bottom: 0.5rem;
}
.field-body {
.field:last-child {
margin-bottom: 0rem;
}
}
.port-item:not(:last-child) {
.field {
margin-bottom: 0;
}
}
}
.modal-card-foot {
padding: 1rem 3rem 2rem 3rem;
.button {
border-radius: 9999px;
padding-left: calc(1em + 0.25em);
padding-right: calc(1em + 0.25em);
}
}
}
.import-area .textarea {
max-height: 40em;
min-height: 16em;
}
.app-card {
.loading-background {
background: none !important;
border-radius: $backDropBorderRadius;
}
}

View File

@ -0,0 +1,53 @@
<template>
<div class="widget has-text-white clock">
<div class="time">{{timeText}}</div>
<div class="data">{{dateText}}</div>
</div>
</template>
<script>
import moment from 'moment'
export default {
data() {
return {
timer: 0,
timeText:"",
dateText:""
}
},
mounted() {
if (this.timer) {
clearInterval(this.timer)
}
this.updateClock()
this.timer = setInterval(() => {
this.updateClock()
}, 1000)
},
methods: {
updateClock() {
this.timeText = moment().format('LT');
this.dateText = moment().format('dddd, MMMM Do')
}
},
}
</script>
<style lang="scss">
.clock {
font-family: Roboto;
font-style: normal;
font-weight: 300;
text-align: left;
.time {
font-size: 2.75rem;
line-height: 4.25rem;
opacity: 0.9;
}
.data {
line-height: 1.5rem;
opacity: 0.9;
}
}
</style>

View File

@ -0,0 +1,16 @@
<template>
<div class="widget has-text-white clock">
<div class="time">09:40</div>
<div class="data">WednesdaySeptember 15</div>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

128
UI/src/components/Apps.vue Normal file
View File

@ -0,0 +1,128 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:01:19
* @Description: App module
* @FilePath: \CasaOS-UI\src\components\Apps.vue
-->
<template>
<div class="has-text-left mt-6">
<!-- Title Bar Start -->
<div class="title-bar is-flex is-align-items-center">
<h1 class="title is-4 has-text-white is-flex-shrink-1">Apps</h1>
<div class="buttons ">
<b-button icon-left="plus" type="is-dark" size="is-small" rounded @click="showInstall">New App</b-button>
</div>
</div>
<!-- Title Bar End -->
<!-- App List Start -->
<div class="columns is-variable is-2 is-multiline ">
<div class="column is-narrow is-3" v-for="(item,index) in appList" :key="'app-'+index">
<app-card :item="item" @updateState="getList" @configApp="showConfigPanel"></app-card>
</div>
</div>
<!-- Title Bar End -->
</div>
</template>
<script>
import AppCard from './Apps/AppCard.vue'
import Panel from './Panel.vue'
export default {
data() {
return {
appList: [],
appConfig: {}
}
},
components: {
AppCard,
},
created() {
this.getList();
},
methods: {
/**
* @description: Fetch the list of installed apps
* @return {*} void
*/
getList() {
this.$api.app.myAppList().then(res => {
this.appList = res.data.data;
})
},
/**
* @description: Show Install Panel Programmatic
* @return {*} void
*/
showInstall() {
this.$api.app.appConfig().then(res => {
if (res.data.success == 200) {
this.$buefy.modal.open({
parent: this,
component: Panel,
hasModalCard: true,
customClass: '',
trapFocus: true,
canCancel: ['escape'],
scroll: "keep",
animation: "zoom-out",
events: {
'updateState': () => {
this.getList()
}
},
props: {
id: "0",
state: "install",
configData: res.data.data
}
})
}
})
},
/**
* @description: Show Settings Panel Programmatic
* @return {*} void
*/
showConfigPanel(id) {
this.$api.app.getContainerSettingdata(id).then(ret => {
this.$api.app.appConfig().then(res => {
if (res.data.success == 200) {
this.$buefy.modal.open({
parent: this,
component: Panel,
hasModalCard: true,
customClass: '',
trapFocus: true,
canCancel: ['escape'],
scroll: "keep",
animation: "zoom-out",
events: {
'updateState': () => {
this.getList()
}
},
props: {
id: id,
state: "update",
configData: res.data.data,
initDatas: ret.data.data
}
})
}
})
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:12:57
* @Description: App Card item
* @FilePath: \CasaOS-UI\src\components\Apps\AppCard.vue
-->
<template>
<div class="wuji-card is-flex is-align-items-center is-justify-content-center p-55 app-card" @mouseover="hover = true" @mouseleave="hover = false">
<!-- Action Button Start -->
<div class="action-btn">
<b-dropdown aria-role="list" position="is-bottom-left" class="ii" ref="dro" @active-change="setDropState">
<template #trigger>
<p role="button">
<b-icon pack="fas" icon="ellipsis-v" size="is-small">
</b-icon>
</p>
</template>
<b-dropdown-item aria-role="menu-item" :focusable="false" custom paddingless>
<b-button type="is-text" tag="a" :target="(item.state == 'running') ?'_blank':'_self'" :href="(item.state == 'running') ? siteUrl(item.port,item.index) :'javascript:void(0)'" expanded>Open</b-button>
<b-button type="is-text" @click="configApp" expanded>Setting</b-button>
<b-button type="is-text" expanded @click="uninstallConfirm" :loading="isUninstalling">Unistall</b-button>
<div class="columns is-gapless bbor">
<div class="column is-flex is-justify-content-center is-align-items-center">
<b-button icon-pack="fas" icon-left="sync" type="is-text" expanded :loading="isRestarting" @click="restartApp"></b-button>
</div>
<div class="column is-flex is-justify-content-center is-align-items-center">
<b-button icon-pack="fas" icon-left="power-off" type="is-text" expanded @click="toggle(item)" :loading="isStarting" :class="item.state"></b-button>
</div>
</div>
</b-dropdown-item>
</b-dropdown>
</div>
<!-- Action Button End -->
<!-- Card Content Start -->
<div class="has-text-centered is-flex is-justify-content-center is-flex-direction-column pt-3 pb-3">
<a :target="(item.state == 'running') ?'_blank':'_self'" class="is-flex is-justify-content-center" :href="(item.state == 'running') ? siteUrl(item.port,item.index) :'javascript:void(0)'">
<b-image :src="item.icon" :src-fallback="require('@/assets/img/default.png')" webp-fallback=".jpg" class="is-72x72" :class="item.state | dotClass"></b-image>
</a>
<p class="mt-4 one-line">
<a class="one-line" :target="(item.state == 'running') ?'_blank':'_self'" :href="(item.state == 'running') ? siteUrl(item.port,item.index) :'javascript:void(0)'">
{{item.name}}
</a>
</p>
</div>
<!-- Card Content End -->
<!-- Loading Bar Start -->
<b-loading :is-full-page="false" v-model="isUninstalling" :can-cancel="false"></b-loading>
<!-- Loading Bar End -->
</div>
</template>
<script>
export default {
name: "app-card",
data() {
return {
hover: false,
dropState: false,
isUninstalling: false,
isRestarting: false,
isStarting: false,
isStoping: false,
isSaving: false,
}
},
props: {
item: {
type: Object
},
},
methods: {
/**
* @description: Create application access link
* @param {String} port App access port
* @param {String} index App access index page
* @return {String}
*/
siteUrl(port, index) {
return (process.env.NODE_ENV === "'dev'") ? `http://${this.$store.state.devIp}:${port}${index}` : `http://${document.domain}:${port}${index}`
},
/**
* @description: Set drop-down menu status
* @param {Boolean} e
* @return {*} void
*/
setDropState(e) {
this.dropState = e
},
/**
* @description: Restart Application
* @return {*} void
*/
restartApp() {
this.isRestarting = true
this.$api.app.startContainer(this.item.custom_id, { state: "restart" }).then((res) => {
console.log(res.data);
if (res.data.success == 200) {
this.updateState()
}
this.isRestarting = false;
})
},
/**
* @description: Confirm before uninstall
* @return {*} void
*/
uninstallConfirm() {
let _this = this
this.$buefy.dialog.confirm({
title: 'Attention',
message: 'Data cannot be recovered after deletion! <br>Continue on to uninstall this application?',
type: 'is-dark',
confirmText: 'Uninstall',
onConfirm: () => {
_this.isUninstalling = true
_this.uninstallApp()
}
})
},
/**
* @description: Uninstall app
* @return {*} void
*/
uninstallApp() {
this.isUninstalling = true
this.$api.app.uninstall(this.item.custom_id).then((res) => {
if (res.data.success == 200) {
console.log(res.data.data);
this.updateState()
}
this.isUninstalling = false;
})
},
/**
* @description: Emit the event that the app has been updated
* @return {*} void
*/
updateState() {
this.$emit("updateState")
},
/**
* @description: Emit the event that the app has been updated with custom_id
* @return {*} void
*/
configApp() {
this.$emit("configApp", this.item.custom_id)
},
/**
* @description: Start or Stop a App
* @param {Object} item the app info object
* @return {*} void
*/
toggle(item) {
this.isStarting = true;
let data = {
state: item.state == "running" ? "stop" : "start"
}
this.$api.app.startContainer(item.custom_id, data).then((res) => {
console.log(res.data);
item.state = res.data.data
this.isStarting = false
this.updateState()
})
},
},
watch: {
hover(val) {
if (!val && this.dropState)
this.$refs.dro.toggle();
}
},
filters: {
/**
* @description: Format Dot Class
* @param {String} state
* @return {String}
*/
dotClass(state) {
return state == 'running' ? 'start' : 'stop'
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,27 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:13:58
* @Description: The left bottom brand bar
* @FilePath: \CasaOS-UI\src\components\BrandBar.vue
-->
<template>
<div class="brand-bar is-flex is-align-items-center has-text-white">
<figure class="image is-32x32">
<img :src="require('@/assets/img/casa.svg')">
</figure>
<span class="is-size-4 mr-3 ml-3">CasaOS</span>
<span>Made by IceWhale with and you !</span>
</div>
</template>
<script>
export default {
name: "brand-bar"
}
</script>
<style>
</style>

View File

@ -0,0 +1,28 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:14:33
* @Description: The right bottom contact bar
* @FilePath: \CasaOS-UI\src\components\ContactBar.vue
-->
<template>
<div class="contact-bar is-flex is-align-items-center has-text-white pl-3 pr-3">
<a href="#">
<b-icon pack="fas" icon="map-signs" size=""></b-icon>
</a>
<a href="https://discord.gg/Gx4BCEtHjx" target="_blank">
<b-icon pack="fab" icon="discord" size=""></b-icon>
</a>
<a href="https://github.com/ZimaBoard/CasaOS" target="_blank">
<b-icon pack="fab" icon="github" size=""></b-icon>
</a>
</div>
</template>
<script>
export default {
name: "contact-bar"
}
</script>

453
UI/src/components/Panel.vue Normal file
View File

@ -0,0 +1,453 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-22 16:27:00
* @Description: Install Panel of Docker
* @FilePath: /CasaOS-UI/src/components/Panel.vue
-->
<template>
<div class="modal-card">
<!-- Modal-Card Header Start -->
<header class="modal-card-head">
<div class="flex1">
<h3 class="title is-4 has-text-weight-normal">Create a new App manually</h3>
</div>
<b-button icon-left="file-import" type="is-dark" size="is-small" rounded @click="showImportPanel" v-if="currentSlide == 1 && state == 'install'">Import</b-button>
</header>
<!-- Modal-Card Header End -->
<!-- Modal-Card Body Start -->
<section class="modal-card-body">
<section v-show="currentSlide == 1">
<ValidationObserver ref="ob1">
<ValidationProvider rules="required" name="Image" v-slot="{ errors, valid }">
<b-field label="Docker Image *" :type="{ 'is-danger': errors[0], 'is-success': valid }" :message="errors">
<b-input v-model="initData.image" placeholder="e.g.,hello-world:latest" :readonly="state == 'update'"></b-input>
<!-- <b-autocomplete :data="data" placeholder="e.g. hello-world:latest" field="image" :loading="isFetching" @typing="getAsyncData" @select="option => selected = option" v-model="initData.image" :readonly="state == 'update'"></b-autocomplete> -->
</b-field>
</ValidationProvider>
<ValidationProvider rules="required" name="Name" v-slot="{ errors, valid }">
<b-field label="App name *" :type="{ 'is-danger': errors[0], 'is-success': valid }" :message="errors">
<b-input value="" v-model="initData.label" placeholder="Your custom App Name"></b-input>
</b-field>
</ValidationProvider>
<b-field label="Icon URL">
<b-input value="" v-model="initData.icon" placeholder="Your custom icon URL"></b-input>
</b-field>
<b-field label="Web UI">
<p class="control">
<span class="button is-static">{{baseUrl}}</span>
</p>
<b-input v-model="webui" placeholder="8080/web/index.html" expanded></b-input>
</b-field>
<b-field label="Network">
<b-select v-model="initData.network_model" placeholder="Select" expanded>
<optgroup v-for="net in networks" :key="net.driver" :label="net.driver">
<option v-for="(option,index) in net.networks" :value="option.id" :key="option.name+index">
{{ option.name}}
</option>
</optgroup>
</b-select>
</b-field>
<ports v-model="initData.ports" :showHostPost="showHostPort" v-if="showPorts"></ports>
<input-group v-model="initData.volumes" label="Data Volumes" message="No App Data Volumes now, Click “+” to add one."></input-group>
<input-group v-model="initData.envs" label="Environment Variables" message="No environment variables now, Click “+” to add one." name1="Key" name2="Value"></input-group>
<input-group v-model="initData.devices" label="Devices" message="No devices now, Click “+” to add one."></input-group>
<b-field label="Memory Limit">
<vue-slider :min="256" :max="totalMemory" v-model="initData.memory"></vue-slider>
</b-field>
<b-field label="CPU Shares">
<b-select v-model="initData.cpu_shares" placeholder="Select" expanded>
<option value="10">Low</option>
<option value="50">Medium</option>
<option value="90">High</option>
</b-select>
</b-field>
<b-field label="Restart Policy">
<b-select v-model="initData.restart" placeholder="Select" expanded>
<option value="on-failure">on-failure</option>
<option value="always">always</option>
<option value="unless-stopped">unless-stopped</option>
</b-select>
</b-field>
<b-field label="App Description">
<b-input v-model="initData.description"></b-input>
</b-field>
<b-loading :is-full-page="false" v-model="isLoading" :can-cancel="false"></b-loading>
</ValidationObserver>
</section>
<section v-show="currentSlide == 2">
<div class="installing-warpper">
<lottie-animation path="./ui/img/ani/rocket-launching.json" :autoPlay="true" :width="200" :height="200"></lottie-animation>
<h3 class="title is-6 has-text-centered" :class="{'has-text-danger':errorType == 3,'has-text-black':errorType != 3}" v-html="installText"></h3>
</div>
</section>
</section>
<!-- Modal-Card Body End -->
<!-- Modal-Card Footer Start-->
<footer class="modal-card-foot is-flex is-align-items-center">
<div class="flex1"></div>
<div>
<b-button v-if="currentSlide == 1" :label="cancelButtonText" @click="$emit('close')" rounded />
<b-button v-if="currentSlide == 2 && errorType == 3 " label="Back" @click="prevStep" rounded />
<b-button v-if="currentSlide == 1 && state == 'install'" label="Install" type="is-dark" @click="installApp()" rounded />
<b-button v-if="currentSlide == 1 && state == 'update'" label="Update" type="is-dark" @click="updateApp()" rounded />
<b-button v-if="currentSlide == 2" :label="cancelButtonText" type="is-dark" @click="$emit('close')" rounded />
</div>
</footer>
<!-- Modal-Card Footer End -->
</div>
</template>
<script>
import axios from 'axios'
import InputGroup from './forms/InputGroup.vue';
import Ports from './forms/Ports.vue'
import ImportPanel from './forms/ImportPanel.vue'
import LottieAnimation from "lottie-vuejs/src/LottieAnimation.vue";
import VueSlider from 'vue-slider-component'
import 'vue-slider-component/theme/default.css'
import { ValidationObserver, ValidationProvider } from "vee-validate";
import "@/plugins/vee-validate";
import debounce from 'lodash/debounce'
export default {
components: {
Ports,
InputGroup,
ValidationObserver,
ValidationProvider,
LottieAnimation,
VueSlider
},
data() {
return {
timer: 0,
data: [],
isLoading: false,
isFetching: false,
errorType: 1,
currentSlide: 1,
cancelButtonText: "Cancel",
webui: "",
baseUrl: "",
totalMemory: 0,
networks: [],
tempNetworks: [],
networkModes: [],
installPercent: 0,
installText: "",
initData: {
port_map: "",
cpu_shares: 10,
memory: 300,
restart: "always",
label: "",
position: true,
index: "",
icon: "",
network_model: "",
image: "",
description: "",
origin: "custom",
ports: [],
volumes: [],
envs: [],
devices: [],
}
}
},
props: {
id: String,
state: String,
configData: Object,
initDatas: {
type: Object
}
},
created() {
//If it is edit, Init data
if (this.initDatas != undefined) {
this.initData = this.initDatas
this.webui = this.initDatas.port_map + this.initDatas.index
}
//Get Max memory info form device
this.totalMemory = Math.floor(this.configData.memory.total / 1048576);
this.initData.memory = this.totalMemory
//Handling network types
this.tempNetworks = this.configData.networks;
this.networkModes = this.unique(this.tempNetworks.map(item => {
return item.driver
}))
this.networks = this.networkModes.map(item => {
let tempitem = {}
tempitem.driver = item
tempitem.networks = this.tempNetworks.filter(net => {
return net.driver == item
})
return tempitem
})
let gg = this.tempNetworks.filter(item => {
if (item.driver == "bridge") {
return item
}
})
this.initData.network_model = gg[0].id
// Set Front-end base url
this.baseUrl = `${window.location.protocol}//${document.domain}:`;
},
computed: {
showPorts() {
if (this.initData.network_model.indexOf("macvlan") > -1) {
return false
} else {
return true
}
},
showHostPort() {
if (this.initData.network_model.indexOf("host") > -1) {
return false
} else {
return true
}
}
},
methods: {
/**
* @description: Process the datas before submit
* @param {*}
* @return {*} void
*/
processData() {
// GET port map and index
if (this.webui != "") {
let slashArr = this.webui.split("/")
this.initData.port_map = slashArr[0]
this.initData.index = "/" + slashArr.slice(1).join("/");
}
let model = this.initData.network_model.split("-");
this.initData.network_model = model[0]
},
/**
* @description: Array deduplication
* @param {Array} arr
* @return {Array}
*/
unique(arr) {
for (var i = 0; i < arr.length; i++) {
for (var j = i + 1; j < arr.length; j++) {
if (arr[i] == arr[j]) {
arr.splice(j, 1);
j--;
}
}
}
return arr;
},
/**
* @description: Back to prev Step
* @param {*}
* @return {*} void
*/
prevStep() {
this.currentSlide--;
},
/**
* @description: Validate form async
* @param {Object} ref ref of component
* @return {Boolean}
*/
async checkStep(ref) {
let isValid = await ref.validate()
return isValid
},
/**
* @description: Submit datas after valid
* @param {*}
* @return {*} void
*/
installApp() {
this.checkStep(this.$refs.ob1).then(val => {
if (val) {
this.processData();
this.isLoading = true;
this.$api.app.install(this.id, this.initData).then((res) => {
this.isLoading = false;
if (res.data.success == 200) {
this.currentSlide = 2;
this.cancelButtonText = "Continue in background"
this.checkInstallState(res.data.data)
} else {
//this.currentSlide = 1;
this.$buefy.toast.open({
message: res.data.message,
type: 'is-warning'
})
}
})
}
})
},
/**
* @description: Check the installation process every 250 milliseconds
* @param {String} appId
* @return {*} void
*/
checkInstallState(appId) {
this.timer = setInterval(() => {
this.updateInstallState(appId)
}, 250)
},
/**
* @description: Update the installation status to the UI
* @param {String} appId
* @return {*} void
*/
updateInstallState(appId) {
this.$api.app.state(appId).then((res) => {
let resData = res.data.data;
this.installPercent = resData.speed;
this.errorType = resData.type;
if (this.errorType == 4) {
try {
let info = JSON.parse(resData.message)
let id = (info.id != undefined) ? info.id : "";
let progress = ""
if (info.progressDetail != undefined) {
let progressDetail = info.progressDetail
if (!isNaN(progressDetail.current / progressDetail.total)) {
progress = "<br>Progress:" + String(Math.floor((progressDetail.current / progressDetail.total) * 100)) + "%"
}
}
let status = info.status
this.installText = status + ":" + id + " " + progress
} catch (error) {
console.log(error);
}
} else {
this.installText = resData.message
}
if (resData.speed == 100 || this.errorType == 3) {
clearInterval(this.timer)
}
let _this = this
if (resData.speed == 100) {
setTimeout(() => {
_this.$emit('updateState')
_this.$emit('close')
}, 1000)
}
})
},
/**
* @description: Save edit update
* @return {*} void
*/
updateApp() {
this.processData();
this.isLoading = true;
this.$api.app.updateContainerSetting(this.id, this.initData).then((res) => {
if (res.data.success == 200) {
this.isLoading = false;
this.$emit('updateState')
} else {
this.$buefy.toast.open({
message: res.data.message,
type: 'is-warning'
})
}
this.$emit('close')
})
},
/**
* @description: Show import panel
* @return {*} void
*/
showImportPanel() {
this.$buefy.modal.open({
parent: this,
component: ImportPanel,
hasModalCard: true,
customClass: '',
trapFocus: true,
canCancel: ['escape'],
scroll: "keep",
animation: "zoom-out",
events: {
'update': (e) => {
this.initData = e
this.$buefy.dialog.alert({
title: 'Attention',
message: 'AutoFill only helps you to complete most of the configuration. Some of the configuration information still needs to be confirmed by you.',
type: 'is-dark'
})
}
},
props: {
initData: this.initData,
netWorks: this.networks
}
})
},
/**
* @description: Get remote synchronization information
* @param {*} function
* @return {*} void
*/
getAsyncData: debounce(function (name) {
if (!name.length) {
this.data = []
return
}
this.isFetching = true
axios.get(`https://hub.docker.com/api/content/v1/products/search?source=community&q=${name}&page=1&page_size=4`)
.then(({ data }) => {
this.data = []
data.summaries.forEach((item) => this.data.push(item.name))
})
.catch((error) => {
this.data = []
throw error
})
.finally(() => {
this.isFetching = false
})
}, 500)
},
destroyed() {
clearInterval(this.timer)
},
}
</script>

View File

@ -0,0 +1,105 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:23:01
* @Description: Top Search bar
* @FilePath: \CasaOS-UI\src\components\SearchBar.vue
-->
<template>
<b-field position="is-centered " class="search-bar has-text-white">
<b-input placeholder="Google Search..." v-model="keyText" icon="magnify" icon-right="magnify" icon-right-clickable @icon-right-click="gotoSearch" @keyup.enter.native="gotoSearch" size="is-large" :class="['ovh',isFocus?'fo':'']" expanded @focus="onFocus" @blur="onBlur">
</b-input>
</b-field>
</template>
<script>
export default {
name: "search-bar",
data() {
return {
isFocus: false,
keyText: ""
}
},
methods: {
/**
* @description: Handle Focus event
* @return {*} void
*/
onFocus() {
this.isFocus = true;
},
/**
* @description: Handle Blur event
* @return {*} void
*/
onBlur() {
if (this.keyText == "")
this.isFocus = false;
},
/**
* @description: Pop up a new window and jump to google search
* @return {*} void
*/
gotoSearch() {
window.open("https://www.google.com/search?q=" + this.keyText, '_blank')
}
},
}
</script>
<style lang="scss">
.search-bar {
input {
transition: all 0.2s;
appearance: none;
background: rgba(123, 123, 123, 0.16);
backdrop-filter: blur(0.875rem);
border-radius: 8px;
border: none;
outline: none;
font-size: 1.5rem;
color: white;
&:focus {
border: none;
box-shadow: none;
}
&::placeholder {
color: white;
}
}
.ovh {
overflow: hidden;
.icon.is-left {
transition: all 0.2s;
left: 0;
}
.icon.is-right {
transition: all 0.2s;
right: -3rem !important;
color: white !important;
}
input {
padding-left: 2.5em !important;
padding-right: 1em !important;
}
}
.fo {
.icon.is-left {
left: -3rem !important;
}
.icon.is-right {
transition: all 0.2s;
right: 0 !important;
}
input {
padding-right: 2.5em !important;
padding-left: 1em !important;
}
}
}
</style>

View File

@ -0,0 +1,56 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:23:49
* @Description:
* @FilePath: \CasaOS-UI\src\components\Shortcuts.vue
-->
<template>
<div class="has-text-left mt-6">
<div class="title-bar is-flex is-align-items-center">
<h1 class="title is-4 has-text-white is-flex-shrink-1">Shortcuts</h1>
<div class="buttons ">
<b-button icon-left="plus" type="is-dark" size="is-small" rounded>Add shortcut</b-button>
</div>
</div>
<div class="columns is-variable is-2 is-multiline ">
<div class="column is-narrow is-3" v-for="n in 10" :key="n">
<div class="wuji-card is-flex is-align-items-center ">
<figure class="image is-32x32 simg">
<img :src="require('@/assets/img/icon.png')">
</figure>
<p class="ml-4 flex1 one-line">Test</p>
<div class="action-btn1">
<b-dropdown aria-role="list" position="is-bottom-left" append-to-body>
<template #trigger>
<p role="button">
<b-icon pack="fas" icon="ellipsis-v" size="is-small">
</b-icon>
</p>
</template>
<b-dropdown-item aria-role="listitem">Action</b-dropdown-item>
<b-dropdown-item aria-role="listitem">Another action</b-dropdown-item>
<b-dropdown-item aria-role="listitem">Something else</b-dropdown-item>
</b-dropdown>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'shortcuts'
}
</script>
<style>
</style>

View File

@ -0,0 +1,27 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:20:56
* @Description:
* @FilePath: \CasaOS-UI\src\components\SideBar.vue
-->
<template>
<div class="side-bar mr-5">
<clock></clock>
</div>
</template>
<script>
import Clock from '../assets/widgets/Clock.vue'
export default {
name: 'side-bar',
components: { Clock },
}
</script>
<style>
</style>

View File

@ -0,0 +1,55 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:20:19
* @Description:
* @FilePath: \CasaOS-UI\src\components\Suggestion.vue
-->
<template>
<div class="has-text-left ">
<h1 class="title is-4 mt-6 has-text-white">Suggestions</h1>
<div class="columns is-variable is-2 is-multiline">
<div class="column is-one-third" v-for="(item,index) in list" :key="'ss'+index">
<a :href="item.url" target="_blank">
<div class="wuji-card is-flex is-align-items-center">
<div class="info ">
<div class="two-line ">
{{item.title}}
</div>
<div class="des two-line">
{{item.content}}
</div>
</div>
<figure class="image is-48x48 simg is-flex">
<img :src="item.image_url">
</figure>
</div>
</a>
</div>
</div>
</div>
</template>
<script>
export default {
name:'suggestion',
data() {
return {
list: []
}
},
mounted() {
this.$api.task.list().then(res => {
if (res.data.success == 200) {
this.list = res.data.data
}
})
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,161 @@
<!--
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-23 18:21:13
* @Description: Top bar
* @FilePath: /CasaOS-UI/src/components/TopBar.vue
-->
<template>
<div class="navbar top-bar is-flex is-align-items-center">
<div class="navbar-brand ml-3">
<b-dropdown aria-role="list" class="navbar-item" @active-change="onOpen">
<template #trigger>
<p role="button">
<b-icon pack="fas" icon="sliders-h">
</b-icon>
</p>
</template>
<b-dropdown-item aria-role="menu-item" :focusable="false" custom>
<h2 class="title is-4">CasaOS Setting</h2>
<div class="is-flex is-align-items-center item">
<div class="is-flex is-align-items-center flex1">
<b-icon pack="fas" icon="sync-alt" class="mr-1"></b-icon> <b>Update</b>
</div>
<div>
v{{updateInfo.current_version}}
</div>
<!-- <b-field>
<b-switch v-model="barData.auto_update" type="is-dark" size="is-small" class="is-flex-direction-row-reverse mr-0" @input="saveData">
Auto-Check
</b-switch>
</b-field> -->
</div>
<div class="is-flex is-align-items-center pl-5" v-if="!updateInfo.is_need">
{{latestText}}
<b-icon type="is-success" pack="fas" icon="check" class="ml-1"></b-icon>
</div>
<div class="is-flex is-align-items-center is-justify-content-end update-container pl-5" v-if="updateInfo.is_need">
<div class="flex1">{{updateText}}</div>
<b-button type="is-dark" size="is-small" class="ml-2" :loading="isUpdating" rounded @click="updateSystem">Update</b-button>
</div>
</b-dropdown-item>
</b-dropdown>
</div>
<div class="navbar-menu">
<div class="navbar-end mr-3">
<!-- <b-icon pack="far" icon="comment-alt"></b-icon> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: "top-bar",
data() {
return {
timer: 0,
barData: {
auto_update: false,
background: "",
background_type: "d",
search_engine: "google",
search_switch: false,
shortcuts_switch: false,
widgets_switch: false
},
updateInfo: {
current_version: '0',
is_need: false,
version: Object
},
isUpdating: false,
latestText: "Currently the latest version",
updateText: "A new version is available!"
}
},
created() {
this.getConfig();
},
methods: {
/**
* @description: Get CasaOs Configs
* @return {*} void
*/
getConfig() {
this.$api.info.systemConfig().then(res => {
if (res.data.success == 200) {
this.barData = res.data.data
}
})
},
/**
* @description: Save CasaOs Configs
* @return {*} void
*/
saveData() {
this.$api.info.saveSystemConfig(this.barData).then(res => {
if (res.data.success == 200) {
console.log(res);
}
})
},
/**
* @description: Handle Dropmenu state
* @param {Boolean} isOpen
* @return {*} void
*/
onOpen(isOpen) {
if (isOpen) {
this.$api.info.checkVersion().then(res => {
if (res.data.success == 200) {
this.updateInfo = res.data.data
}
})
}
},
/**
* @description: Update System Version and check update state
* @return {*} void
*/
updateSystem() {
this.isUpdating = true;
this.$api.info.updateSystem().then(res => {
if (res.data.success == 200) {
console.log(res.data.data);
}
});
this.checkUpdateState();
},
/**
* @description: check update state if is_need is false then reload page
* @return {*} void
*/
checkUpdateState() {
this.timer = setInterval(() => {
this.$api.info.checkVersion().then(res => {
if (res.data.success == 200) {
if (!res.data.data.is_need) {
clearInterval(this.timer);
location.reload();
}
}
})
}, 3000)
}
},
}
</script>

View File

@ -0,0 +1,154 @@
<template>
<div class="modal-card">
<!-- Modal-Card Header Start -->
<header class="modal-card-head">
<div class="flex1">
<h3 class="title is-4 has-text-weight-normal">Import From Docker CLI</h3>
</div>
</header>
<!-- Modal-Card Header End -->
<!-- Modal-Card Body Start -->
<section class="modal-card-body">
<b-field label="Command Line" :type="{ 'is-danger': parseError}" :message="errors">
<b-input maxlength="800" type="textarea" class="import-area" v-model="dockerCliCommands"></b-input>
</b-field>
</section>
<!-- Modal-Card Body End -->
<!-- Modal-Card Footer Start-->
<footer class="modal-card-foot is-flex is-align-items-center">
<div class="flex1"></div>
<div>
<b-button label="Cancel" @click="$emit('close')" rounded />
<b-button label="Sumbit" type="is-dark" @click="emitSubmit" rounded />
</div>
</footer>
<!-- Modal-Card Footer End -->
</div>
</template>
<script>
import parser from 'yargs-parser'
export default {
data() {
return {
dockerCliCommands: "",
parseError: false,
errors: "",
}
},
props: {
initData: Object,
netWorks: Array
},
created() {
console.log(this.netWorks);
},
methods: {
/**
* @description: Emit Event to tell parent Update
* @param {*}
* @return {*} void
*/
emitSubmit() {
if (this.parseCli()) {
this.errors = ""
this.$emit('update', this.initData)
this.$emit('close')
} else {
this.errors = "Please fill correct command line"
this.parseError = true;
}
},
/**
* @description: Parse Import Docker Cli Commands
* @return {Boolean}
*/
parseCli() {
const formattedInput = this.dockerCliCommands.replace(/\<[^\>]*\>/g, 'Custom_data').replace(/[\r\n]/g, "").replace(/\\/g, "\\ ").trim();
const parsedInput = parser(formattedInput)
console.log(parsedInput);
const { _: command, ...params } = parsedInput;
if (command[0] !== 'docker' || (command[1] !== 'run' && command[1] !== 'create')) {
return false
} else {
//Envs
this.initData.envs = this.makeArray(parsedInput.e).map(item => {
let ii = item.split("=");
return {
container: ii[0],
host: ii[1]
}
})
//Ports
this.initData.ports = this.makeArray(parsedInput.p).map(item => {
let pArray = item.split(":")
let endArray = pArray[1].split("/")
let protocol = (endArray[1]) ? endArray[1] : 'tcp';
return {
container: endArray[0],
host: pArray[0],
protocol: protocol
}
})
//Volume
this.initData.volumes = this.makeArray(parsedInput.v).map(item => {
let ii = item.split(":");
return {
container: ii[1],
host: ii[0]
}
})
// Devices
this.initData.devices = this.makeArray(parsedInput.device).map(item => {
let ii = item.split(":");
return {
container: ii[1],
host: ii[0]
}
})
//Network
if (parsedInput.network != undefined) {
let network = (parsedInput.network == 'physical') ? 'macvlan' : parsedInput.network;
let seletNetworks = this.netWorks.filter(item => {
if (item.driver == network) {
return true
}
})
if (seletNetworks.length > 0) {
this.initData.network_model = seletNetworks[0].networks[0].id;
}
}
//Image
this.initData.image = [...command].pop()
//Label
if (parsedInput.name != undefined) {
this.initData.label = parsedInput.name.replace(/^\S/, s => s.toUpperCase())
}
//Restart
if (parsedInput.restart != undefined) {
this.initData.restart = parsedInput.restart
}
return true
}
},
/**
* @description: Make String to Array
* @param {*}
* @return {Array}
*/
makeArray(foo) {
let newArray = (typeof (foo) == "string") ? [foo] : foo
return (newArray == undefined) ? [] : newArray
}
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,108 @@
<template>
<div class="mb-5">
<div class="field is-flex is-align-items-center mb-2">
<label class="label mb-0 flex1">{{label}}</label>
<b-button icon-left="plus" type="is-dark" size="is-small" rounded @click="addItem">Add</b-button>
</div>
<div class="is-flex is-align-items-center mb-5 info" v-if="vdata.length == 0">
<b-icon pack="fas" icon="info-circle" size="is-small" class="mr-2 "></b-icon>
<span>
{{message}}
</span>
</div>
<div class="port-item" v-for="(item,index) in vdata" :key="'port'+index">
<b-icon pack="fas" icon="times" size="is-small" class="is-clickable" @click.native="removeItem(index)"></b-icon>
<template v-if="index < 1">
<b-field grouped>
<b-field :label="name1" expanded>
<b-input :placeholder="name1" v-model="item.container" expanded @input="handleInput"></b-input>
</b-field>
<b-field :label="name2" expanded>
<b-input :placeholder="name2" v-model="item.host" expanded @input="handleInput"></b-input>
</b-field>
</b-field>
</template>
<template v-else>
<b-field grouped>
<b-input :placeholder="name1" v-model="item.container" expanded @input="handleInput"></b-input>
<b-input :placeholder="name2" v-model="item.host" expanded @input="handleInput"></b-input>
</b-field>
</template>
</div>
</div>
</template>
<script>
export default {
name:'input-group',
data() {
return {
isLoading: false,
items: [],
min: 0
}
},
model: {
prop: 'vdata',
event: 'change'
},
props: {
vdata: Array,
label: String,
message: String,
name1: {
type: String,
default: "Container"
},
name2: {
type: String,
default: "Host"
},
},
created() {
//this.items = this.vdata;
},
watch: {
},
mounted() {
//this.addItem()
},
methods: {
addItem() {
let itemObj = {
container: "",
host: ""
}
this.vdata.push(itemObj)
},
removeItem(index) {
this.vdata.splice(index, 1)
this.filterArray()
},
handleInput() {
this.filterArray()
},
filterArray() {
// let newArray = this.items.filter(item => {
// if (item.container != "" && item.host != "") {
// return true
// } else {
// return false
// }
// })
this.$emit('change', this.vdata)
}
},
}
</script>

View File

@ -0,0 +1,134 @@
<template>
<div class="mb-5">
<div class="field is-flex is-align-items-center mb-2">
<label class="label mb-0 flex1">Ports</label>
<b-button icon-left="plus" type="is-dark" size="is-small" rounded @click="addItem">Add</b-button>
</div>
<div class="is-flex is-align-items-center mb-5 info" v-if="vdata.length == 0">
<b-icon pack="fas" icon="info-circle" size="is-small" class="mr-2 "></b-icon>
<span>
No App Ports now, Click + to add one.
</span>
</div>
<div class="port-item" v-for="(item,index) in vdata" :key="'port'+index">
<b-icon pack="fas" icon="times" size="is-small" class="is-clickable" @click.native="removeItem(index)"></b-icon>
<template v-if="index < 1">
<b-field grouped>
<b-field label="Container" expanded>
<b-input placeholder="Container" type="number" v-model="item.container" expanded @input="handleInput"></b-input>
</b-field>
<b-field label="Host" expanded>
<b-input placeholder="Host" type="number" v-model="item.host" expanded @input="handleInput" v-if="showHostPost"></b-input>
</b-field>
<b-field label="Protocol" expanded>
<b-select placeholder="Protocol" v-model="item.protocol" expanded @input="handleInput">
<option value="tcp">TCP</option>
<option value="udp">UDP</option>
<option value="both">TCP + UDP</option>
</b-select>
</b-field>
</b-field>
</template>
<template v-else>
<b-field grouped>
<b-input placeholder="Container" type="number" v-model="item.container" expanded @input="handleInput"></b-input>
<b-input placeholder="Host" type="number" v-model="item.host" expanded @input="handleInput" v-if="showHostPost"></b-input>
<b-select placeholder="Protocol" v-model="item.protocol" expanded @input="handleInput">
<option value="tcp">TCP</option>
<option value="udp">UDP</option>
<option value="both">TCP + UDP</option>
</b-select>
</b-field>
</template>
</div>
</div>
</template>
<script>
export default {
name: 'ports',
data() {
return {
isLoading: false,
items: [],
min: 0
}
},
model: {
prop: 'vdata',
event: 'change'
},
props: {
vdata: Array,
showHostPost: Boolean
},
created() {
//this.items = this.vdata;
},
mounted() {
if (this.vdata.length == 0) {
//this.addItem()
}
},
methods: {
addItem() {
let itemObj = {
container: "",
host: "",
protocol: "tcp"
}
this.vdata.push(itemObj)
},
removeItem(index) {
this.vdata.splice(index, 1)
this.filterArray()
},
handleInput() {
this.filterArray()
},
filterArray() {
// let newArray = this.items.filter(item => {
// if (item.container != "" && item.host != "") {
// return true
// } else {
// return false
// }
// })
this.$emit('change', this.vdata)
}
},
}
</script>
<style lang="scss">
.info {
font-size: 0.875rem;
color: #5a5a5a;
}
.port-item {
position: relative;
.icon {
position: absolute;
right: -1.5rem;
bottom: 0.825rem;
}
&:not(:last-child) {
margin-bottom: 0.5rem;
}
.field.is-expanded {
.label {
text-align: center;
font-weight: normal;
}
}
}
</style>

17
UI/src/main.js Normal file
View File

@ -0,0 +1,17 @@
import Vue from 'vue'
import App from '@/App.vue'
import router from '@/router'
import store from '@/store'
import api from '@/service/api.js'
import Buefy from 'buefy'
import '@/assets/scss/app.scss'
Vue.use(Buefy)
Vue.config.productionTip = false
Vue.prototype.$api = api;
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@ -0,0 +1,28 @@
import { required, confirmed, length, email, min } from "vee-validate/dist/rules";
import { extend } from "vee-validate";
extend("required", {
...required,
message: "This field is required"
});
extend("email", {
...email,
message: "This field must be a valid email"
});
extend("confirmed", {
...confirmed,
message: "This field confirmation does not match"
});
extend("length", {
...length,
message: "This field must have 2 options"
});
extend("min", {
...min,
message: "This field must have more than {length} characters"
});

24
UI/src/router/index.js Normal file
View File

@ -0,0 +1,24 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-18 23:19:27
* @Description:
* @FilePath: \CasaOS-UI\src\router\index.js
*/
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router

19
UI/src/service/api.js Normal file
View File

@ -0,0 +1,19 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-23 15:59:52
* @Description:
* @FilePath: /CasaOS-UI/src/service/api.js
*/
import user from "./user.js";
import app from './app.js';
import task from './task.js';
import info from './info.js';
export default {
app,
info,
user,
task
}

79
UI/src/service/app.js Normal file
View File

@ -0,0 +1,79 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:20
* @Description: Application API
* @FilePath: \CasaOS-UI\src\service\app.js
*/
import { api } from "./service.js";
const app = {
//Get Install Info
appConfig() {
return api.get("/app/install/config");
},
//Store List
storeList(data) {
return api.get("/app/list", data);
},
//Store App Info
storeAppInfo(id) {
return api.get("/app/appinfo/" + id);
},
//Store Category List
storeCategoryList() {
return api.get("/app/category");
},
//Check Port
checkPort(port, type) {
let data = {
type: type
}
return api.get('/app/check/' + port, data);
},
// Get a free port
getPort() {
return api.get('/app/getport');
},
// Get app Running State
getState(id, data) {
return api.get('/app/state/' + id, data);
},
//Install App
install(id, data) {
return api.post('/app/install/' + id, data);
},
//Install Info
state(id) {
return api.get('/app/speed/' + id);
},
// Uninstall App
uninstall(id) {
return api.delete('/app/uninstall/' + id);
},
//My App List
myAppList(data) {
return api.get('/app/mylist', data);
},
//Container info
getContainerInfo(id) {
return api.get('/app/info/' + id);
},
//Container Log
getContainerLogs(id) {
return api.get('/app/logs/' + id)
},
//Start Or Stop Or Restart A Container with ID
startContainer(id, data) {
return api.put('/app/state/' + id, data)
},
getContainerSettingdata(id) {
return api.get(`/app/update/${id}/info`)
},
//Update Container Settings
updateContainerSetting(id, data) {
return api.put(`/app/update/${id}/setting`, data);
}
}
export default app;

37
UI/src/service/ddns.js Normal file
View File

@ -0,0 +1,37 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:08
* @Description: DDNS Service API
* @FilePath: \CasaOS-UI\src\service\ddns.js
*/
import { api } from "./service.js";
const ddns = {
//Add New DDNS
add(data) {
return api.post("/ddns/set", data);
},
//Delete a DDNS Item
delete(id) {
return api.delete("/ddns/delete/" + id);
},
//Get DDNS List
get_list() {
return api.get('/ddns/list');
},
//Ger DDNS Provider List
get_provider_list() {
return api.get('/ddns/getlist');
},
//Get Public Internet IP address (IPv4)
get_ipv4() {
return api.get('/ddns/ip');
},
// Ping Host
ping(host) {
return api.get('/ddns/ping/' + host);
}
}
export default ddns;

35
UI/src/service/disk.js Normal file
View File

@ -0,0 +1,35 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:02
* @Description: Disk API
* @FilePath: \CasaOS-UI\src\service\disk.js
*/
import { api } from "./service.js";
const disk = {
// get Path list
diskInfo() {
return api.get('/disk/info');
},
diskList() {
return api.get('/disk/list');
},
// System path
renamePath(oldpath, path) {
let data = {
oldpath: oldpath,
newpath: path
}
return api.get('/zima/rename', data);
},
// Make a new Dir
mkdir(path) {
let data = {
path: path
}
return api.get('/zima/mkdir', data)
}
}
export default disk;

36
UI/src/service/file.js Normal file
View File

@ -0,0 +1,36 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:25:53
* @Description: File API
* @FilePath: \CasaOS-UI\src\service\file.js
*/
import { api } from "./service.js";
const file = {
// get Path list
dirPath(path) {
let data = {
path: path
}
return api.get('/file/dirpath', data);
},
// System path
renamePath(oldpath, path) {
let data = {
oldpath: oldpath,
newpath: path
}
return api.get('/file/rename', data);
},
// Make a new Dir
mkdir(path) {
let data = {
path: path
}
return api.post('/file/mkdir', data)
}
}
export default file;

53
UI/src/service/info.js Normal file
View File

@ -0,0 +1,53 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-23 17:41:01
* @Description: System HardWare Info API
* @FilePath: /CasaOS-UI/src/service/info.js
*/
import { api } from "./service.js";
const info = {
//CPU info
cpuInfo() {
return api.get("/zima/getcpuinfo");
},
//Memory Info
memoryInfo() {
return api.get("/zima/getmeminfo");
},
//Network Info
networkInfo() {
return api.get('/zima/getnetinfo');
},
//Disk Info
diskInfo() {
return api.get('/zima/getdiskinfo');
},
//All Info
allInfo() {
return api.get('/zima/getinfo');
},
// System Info
systemInfo() {
return api.get('/zima/sysinfo');
},
//Get CasaOS Config
systemConfig() {
return api.get('/sys/config')
},
//Save CasaOs Config
saveSystemConfig(data) {
return api.post('/sys/config', data)
},
// Check Verison
checkVersion() {
return api.get('/sys/check');
},
//Update System
updateSystem(){
return api.post('/sys/update');
}
}
export default info;

138
UI/src/service/service.js Normal file
View File

@ -0,0 +1,138 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-23 17:26:31
* @Description:
* @FilePath: /CasaOS-UI/src/service/service.js
*/
import axios from 'axios'
import qs from 'qs'
import router from '@/router'
import store from '@/store'
// Set Post Headers
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
axios.defaults.withCredentials = false;
if (process.env.NODE_ENV === "'dev'") {
axios.defaults.baseURL = `http://${store.state.devIp}:8089/v1`;
} else {
axios.defaults.baseURL = `${document.location.protocol}//${document.location.host}/v1`
}
//Create a axios instance, And set timeout to 30s
const instance = axios.create({
timeout: 10000,
});
window.isRefreshing = false
let refreshSubscribers = []
function subscribeTokenRefresh(cb) {
refreshSubscribers.push(cb)
}
function onRrefreshed(token) {
refreshSubscribers.map(cb => cb(token))
}
// Request interceptors
instance.interceptors.request.use((config) => {
let token = ''
if (sessionStorage.getItem("user_token")) {
token = sessionStorage.getItem("user_token")
}
if (localStorage.getItem("user_token")) {
token = localStorage.getItem("user_token")
}
config.headers.Authorization = token
if (token === "" && config.url !== "user/login") {
if (!window.isRefreshing) {
window.isRefreshing = true;
axios.post('user/login', qs.stringify({
username: "admin",
pwd: "admin"
})).then(res => {
token = res.data.data;
store.commit('setToken', token)
localStorage.setItem("user_token", token)
onRrefreshed(token);
})
}
let retry = new Promise((resolve) => {
/* (token) => {...}这个函数就是回调函数 */
subscribeTokenRefresh((token) => {
config.headers.Authorization = token
/* 将请求挂起 */
resolve(config)
})
})
return retry
} else {
return config;
}
}, (error) => {
// Do something with request error
return Promise.reject(error)
})
// 响应拦截(请求返回后拦截)
instance.interceptors.response.use(response => {
//console.log("响应拦截", response);
return response;
}, error => {
console.log('catch', error)
if (error.response) {
switch (error.response.status) {
case 401:
sessionStorage.removeItem('user_token') //可能是token过期清除它
router.replace({ //跳转到登录页面
path: '/',
query: { redirect: router.currentRoute.fullPath } // 将跳转的路由path作为参数登录成功后跳转到该路由
})
break;
case 404:
store.commit('setServiceError', true);
break;
case 500:
break;
}
} else {
store.commit('setServiceError', true);
}
return Promise.reject(error)
})
//按照请求类型对axios进行封装
const api = {
get(url, data) {
return instance.get(url, { params: data })
},
post(url, data) {
let newData = (url.indexOf("install") > 0 || url.indexOf("sys") > 0) ? JSON.stringify(data) : qs.stringify(data)
if (url.indexOf("install") > 0) {
axios.defaults.headers.post['Content-Type'] = 'application/json';
} else {
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
}
return instance.post(url, newData)
},
put(url, data) {
let newData = (url.indexOf("setting") > 0) ? JSON.stringify(data) : qs.stringify(data)
if (url.indexOf("setting") > 0) {
axios.defaults.headers.post['Content-Type'] = 'application/json';
} else {
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
}
return instance.put(url, newData)
},
delete(url, data) {
return instance.delete(url, { params: data })
}
}
export { api }

21
UI/src/service/task.js Normal file
View File

@ -0,0 +1,21 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:45
* @Description: Task API
* @FilePath: \CasaOS-UI\src\service\task.js
*/
import { api } from "./service.js";
const task = {
//List
list() {
return api.get("/task/list");
},
//Mark
completion(id) {
return api.put(`/task/completion/${id}`);
}
}
export default task;

47
UI/src/service/user.js Normal file
View File

@ -0,0 +1,47 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:47
* @Description: User API
* @FilePath: \CasaOS-UI\src\service\user.js
*/
import { api } from "./service.js";
const user = {
//login
login(data) {
return api.post("user/login", data);
},
// Create UserName and Password
createUsernameAndPaword(data) {
return api.post("/user/setusernamepwd", data);
},
// Change User Avatar
changeAvatar(data) {
return api.post("/user/changhead", data);
},
// Change UserName
changeUserName(data) {
return api.put("/user/changusername", data);
},
// Change User Password
changePassword(data) {
return api.put("/user/changuserpwd", data);
},
// Get user info
getUserInfo() {
return api.get("/user/info");
},
// Change User Info
changeUserInfo(data) {
return api.post('/user/changuserinfo', data)
}
}
export default user;

View File

@ -0,0 +1,64 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-19 09:26:50
* @Description: Zerotier API
* @FilePath: \CasaOS-UI\src\service\zerotier.js
*/
import { api } from "./service.js";
const zerotier = {
//Check if Need login to zerotier
isLogin() {
return api.get("/zerotier/islogin");
},
//Login
login(data) {
return api.post("/zerotier/login", data);
},
//Register
register(data) {
return api.post('/zerotier/register', data);
},
//networklist
networkLits() {
return api.get('/zerotier/list');
},
//joinNetwork
joinNetwork(id) {
return api.post(`/zerotier/join/${id}`);
},
// leaveNetwork
leaveNetwork(id) {
return api.post(`/zerotier/leave/${id}`);
},
// Get Network detial
networkDetail(id) {
return api.get(`/zerotier/info/${id}`);
},
// Edit Network
editNetwork(id, data) {
return api.put(`/zerotier/edit/${id}`, data)
},
// Delete A Network
delNetwork(id) {
return api.delete(`/zerotier/network/${id}/del`)
},
createNetwork() {
return api.post('/zerotier/create')
},
// Get Network member list
getMembers(id) {
return api.get(`/zerotier/member/${id}`)
},
// Edit Member
editMember(id, mId, data) {
return api.put(`/zerotier/member/${id}/edit/${mId}`, data)
},
// Delete Member
delMemeber(id, mId) {
return api.delete(`/zerotier/member/${id}/del/${mId}`)
}
}
export default zerotier;

34
UI/src/store/index.js Normal file
View File

@ -0,0 +1,34 @@
/*
* @Author: JerryK
* @Date: 2021-09-18 21:32:13
* @LastEditors: JerryK
* @LastEditTime: 2021-09-22 16:28:16
* @Description:
* @FilePath: /CasaOS-UI/src/store/index.js
*/
import Vue from 'vue'
import Vuex from 'vuex'
//import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)
export default new Vuex.Store({
//plugins: [createPersistedState()],
state: {
token: "",
devIp: "192.168.2.217",
serviceError: false
},
mutations: {
setToken(state, val) {
state.token = val
},
setServiceError(state, val) {
state.serviceError = val
}
},
actions: {
},
modules: {
}
})

23
UI/vue.config.js Normal file
View File

@ -0,0 +1,23 @@
/*
* @Author: JerryK
* @Date: 2021-09-22 10:10:10
* @LastEditors: JerryK
* @LastEditTime: 2021-09-22 15:26:47
* @Description:
* @FilePath: /CasaOS-UI/vue.config.js
*/
const webpack = require('webpack')
module.exports = {
publicPath: '/ui/',
runtimeCompiler: true,
lintOnSave: false,
productionSourceMap: false,
pluginOptions: {
},
chainWebpack: config => {
config.plugin('ignore')
.use(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
}
}

9172
UI/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,359 +0,0 @@
openapi: 3.0.3
info:
title: CasaOS API
version: v2
description: |
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_dark_night_800px.png">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_twilight_blue_800px.png">
<img alt="CasaOS" src="https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_twilight_blue_800px.png">
</picture>
CasaOS API provides miscellaneous methods for different scenarios.
For issues and discussions, please visit the [GitHub repository](https://github.com/IceWhaleTech/CasaOS) or join [our Discord](https://discord.gg/knqAbbBbeX).
servers:
- url: /v2/casaos
tags:
- name: Health methods
description: |-
These methods are used to check the health and status of the CasaOS API and associated services.
- name: File methods
description: |-
The File methods allow you to interact with files and directories on the CasaOS system.
x-tagGroups:
- name: Methods
tags:
- Health methods
security:
- access_token: []
paths:
/health/services:
get:
tags:
- Health methods
summary: Get service status
description: |-
Get running status of each `casaos-*` service.
operationId: getHealthServices
responses:
"200":
$ref: "#/components/responses/GetHealthServicesOK"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/health/ports:
get:
tags:
- Health methods
summary: Get port in use
operationId: getHealthPorts
responses:
"200":
$ref: "#/components/responses/GetHealthPortsOK"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/health/logs:
get:
tags:
- Health methods
summary: Get log
operationId: getHealthlogs
responses:
"200":
description: OK
content:
application/octet-stream:
schema:
type: string
format: binary
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/file/test:
get:
tags:
- File methods
summary: Test file methods
description: |-
Test file methods.
operationId: getFileTest
responses:
"200":
$ref: "#/components/responses/ResponseOK"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/file/upload:
get:
tags:
- File
summary: Check upload chunk
parameters:
- name: path
in: query
description: File path
required: true
example: "/DATA/test.log"
schema:
type: string
- name: relativePath
in: query
description: File path
required: true
example: "/DATA/test.log"
schema:
type: string
- name: filename
in: query
description: File name
required: true
example: "test.log"
schema:
type: string
- name: chunkNumber
in: query
description: chunk number
required: true
example: 1
schema:
type: string
- name: totalChunks
in: query
description: total chunks
example: 2
required: true
schema:
type: integer
description: Check if the file block has been uploaded (needs to be modified later)
operationId: checkUploadChunk
responses:
"200":
$ref: "#/components/responses/ResponseStringOK"
"400":
$ref: "#/components/responses/ResponseClientError"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
post:
tags:
- File
summary: Upload file
description: Upload file
operationId: postUploadFile
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
relativePath:
type: string
example: "/DATA/test.log"
filename:
type: string
example: "/DATA/test2.log"
totalChunks:
type: string
example: "2"
chunkNumber:
type: string
example: "20"
path:
type: string
example: "/DATA"
file:
type: string
format: binary
chunkSize:
type: string
example: "1024"
currentChunkSize:
type: string
example: "1024"
totalSize:
type: string
example: "1024"
identifier:
type: string
example: "test.log"
responses:
"200":
$ref: "#/components/responses/ResponseStringOK"
"400":
$ref: "#/components/responses/ResponseClientError"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/zt/info:
get:
tags:
- Zerotier methods
summary: Get Zerotier info
description: |-
Get Zerotier info.
operationId: getZerotierInfo
responses:
"200":
$ref: "#/components/responses/GetZTInfoOK"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
/zt/{network_id}/status:
put:
tags:
- Zerotier methods
summary: Set Zerotier network status
description: |-
Set Zerotier network status.
operationId: setZerotierNetworkStatus
parameters:
- name: network_id
in: path
description: network id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
status:
enum:
- online
- offline
type: string
example: "online"
responses:
"200":
$ref: "#/components/responses/GetZTInfoOK"
"500":
$ref: "#/components/responses/ResponseInternalServerError"
components:
securitySchemes:
access_token:
type: apiKey
in: header
name: Authorization
responses:
ResponseOK:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/BaseResponse"
ResponseStringOK:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponseString"
ResponseClientError:
description: Client Error
content:
application/json:
schema:
$ref: "#/components/schemas/BaseResponse"
ResponseInternalServerError:
description: Internal Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/BaseResponse"
GetHealthServicesOK:
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/BaseResponse"
- properties:
data:
$ref: "#/components/schemas/HealthServices"
GetHealthPortsOK:
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/BaseResponse"
- properties:
data:
$ref: "#/components/schemas/HealthPorts"
GetZTInfoOK:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ZTInfo"
schemas:
BaseResponse:
properties:
message:
readOnly: true
description: message returned by server side if there is any
type: string
example: ""
SuccessResponseString:
allOf:
- $ref: "#/components/schemas/BaseResponse"
- properties:
data:
type: string
description: When the interface returns success, this field is the specific success information
HealthServices:
properties:
running:
type: array
items:
type: string
example: "casaos-gateway.service"
not_running:
type: array
items:
type: string
example: "casaos.service"
HealthPorts:
properties:
tcp:
type: array
items:
type: integer
example: 80
x-go-name: TCP
udp:
type: array
items:
type: integer
example: 53
x-go-name: UDP
ZTInfo:
properties:
id:
type: string
example: "1234567890"
name:
type: string
example: "CasaOS"
status:
type: string
example: "online"

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>CasaOS | Developers</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='casaos/openapi.yaml' expandResponses='all' jsonSampleExpandLevel='all'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
</body>
</html>

View File

@ -1,197 +0,0 @@
#!/bin/bash
set -e
# functions
__info() {
echo -e "🟩 ${1}"
}
__info_done() {
echo -e "${1}"
}
__warning() {
echo -e "🟨 ${1}"
}
__error() {
echo "🟥 ${1}"
exit 1
}
__is_version_gt() {
test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"
}
__normalize_version() {
local version
if [ "${1::1}" = "v" ]; then
version="${1:1}"
else
version="${1}"
fi
echo "$version"
}
__is_migration_needed() {
local version1
local version2
version1=$(__normalize_version "${1}")
version2=$(__normalize_version "${2}")
if [ "${version1}" = "${version2}" ]; then
return 1
fi
if [ "CURRENT_VERSION_NOT_FOUND" = "${version1}" ]; then
return 1
fi
if [ "LEGACY_WITHOUT_VERSION" = "${version1}" ]; then
return 0
fi
__is_version_gt "${version2}" "${version1}"
}
__get_download_domain(){
local region
# Use ipconfig.io/country and https://ifconfig.io/country_code to get the country code
region=$(curl --connect-timeout 2 -s ipconfig.io/country || echo "")
if [ "${region}" = "" ]; then
region=$(curl --connect-timeout 2 -s https://ifconfig.io/country_code || echo "")
fi
if [[ "${region}" = "China" ]] || [[ "${region}" = "CN" ]]; then
echo "https://casaos.oss-cn-shanghai.aliyuncs.com/"
else
echo "https://github.com/"
fi
}
DOWNLOAD_DOMAIN=$(__get_download_domain)
BUILD_PATH=$(dirname "${BASH_SOURCE[0]}")/../../..
SOURCE_ROOT=${BUILD_PATH}/sysroot
APP_NAME="casaos"
# check if migration is needed
SOURCE_BIN_PATH=${SOURCE_ROOT}/usr/bin
SOURCE_BIN_FILE=${SOURCE_BIN_PATH}/${APP_NAME}
CURRENT_BIN_PATH=/usr/bin
CURRENT_BIN_PATH_LEGACY=/usr/local/bin
CURRENT_BIN_FILE=${CURRENT_BIN_PATH}/${APP_NAME}
CURRENT_BIN_FILE_LEGACY=$(realpath -e ${CURRENT_BIN_PATH_LEGACY}/${APP_NAME} || which ${APP_NAME} || echo CURRENT_BIN_FILE_LEGACY_NOT_FOUND)
SOURCE_VERSION="$(${SOURCE_BIN_FILE} -v)"
CURRENT_VERSION="$(${CURRENT_BIN_FILE} -v || ${CURRENT_BIN_FILE_LEGACY} -v || (stat "${CURRENT_BIN_FILE_LEGACY}" >/dev/null && echo LEGACY_WITHOUT_VERSION) || echo CURRENT_VERSION_NOT_FOUND)"
__info_done "CURRENT_VERSION: ${CURRENT_VERSION}"
__info_done "SOURCE_VERSION: ${SOURCE_VERSION}"
NEED_MIGRATION=$(__is_migration_needed "${CURRENT_VERSION}" "${SOURCE_VERSION}" && echo "true" || echo "false")
if [ "${NEED_MIGRATION}" = "false" ]; then
__info_done "Migration is not needed."
exit 0
fi
ARCH="unknown"
case $(uname -m) in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
;;
armv7l)
ARCH="arm-7"
;;
riscv64)
ARCH="riscv64"
;;
*)
__error "Unsupported architecture"
;;
esac
__info "ARCH: ${ARCH}"
MIGRATION_SERVICE_DIR=${1}
if [ -z "${MIGRATION_SERVICE_DIR}" ]; then
MIGRATION_SERVICE_DIR=${BUILD_PATH}/scripts/migration/service.d/${APP_NAME}
fi
MIGRATION_LIST_FILE=${MIGRATION_SERVICE_DIR}/migration.list
MIGRATION_PATH=()
CURRENT_VERSION_FOUND="false"
# a VERSION_PAIR looks like "v0.3.5 <url>"
#
# - "v0.3.5" is the current version installed on this host
# - "<url>" is the url of the migration tool
while read -r VERSION_PAIR; do
if [ -z "${VERSION_PAIR}" ]; then
continue
fi
# obtain "v0.3.5" from "v0.3.5 v0.3.6-alpha2"
VER1=$(echo "${VERSION_PAIR}" | cut -d' ' -f1)
# obtain "<url>" from "v0.3.5 <url>"
URL=$(eval echo "${VERSION_PAIR}" | cut -d' ' -f2)
if [ "${CURRENT_VERSION}" = "${VER1// /}" ] || [ "${CURRENT_VERSION}" = "LEGACY_WITHOUT_VERSION" ]; then
CURRENT_VERSION_FOUND="true"
fi
if [ "${CURRENT_VERSION_FOUND}" = "true" ]; then
MIGRATION_PATH+=("${URL// /}")
fi
done <"${MIGRATION_LIST_FILE}"
if [ ${#MIGRATION_PATH[@]} -eq 0 ]; then
__warning "No migration path found from ${CURRENT_VERSION} to ${SOURCE_VERSION}"
exit 0
fi
pushd "${MIGRATION_SERVICE_DIR}"
{
for URL in "${MIGRATION_PATH[@]}"; do
MIGRATION_TOOL_FILE=$(basename "${URL}")
if [ -f "${MIGRATION_TOOL_FILE}" ]; then
__info "Migration tool ${MIGRATION_TOOL_FILE} exists. Skip downloading."
continue
fi
__info "Dowloading ${URL}..."
curl -fsSL -o "${MIGRATION_TOOL_FILE}" -O "${URL}"
done
} || {
popd
__error "Failed to download migration tools"
}
{
for URL in "${MIGRATION_PATH[@]}"; do
MIGRATION_TOOL_FILE=$(basename "${URL}")
__info "Extracting ${MIGRATION_TOOL_FILE}..."
tar zxvf "${MIGRATION_TOOL_FILE}" || __error "Failed to extract ${MIGRATION_TOOL_FILE}"
MIGRATION_TOOL_PATH=build/sysroot/usr/bin/${APP_NAME}-migration-tool
__info "Running ${MIGRATION_TOOL_PATH}..."
${MIGRATION_TOOL_PATH}
done
} || {
popd
__error "Failed to extract and run migration tools"
}
popd

View File

@ -1,3 +0,0 @@
LEGACY_WITHOUT_VERSION ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
v0.3.5 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
v0.3.5.1 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz

View File

@ -1,56 +0,0 @@
#!/bin/bash
set -e
BUILD_PATH=$(dirname "${BASH_SOURCE[0]}")/../../..
APP_NAME_SHORT=casaos
__get_setup_script_directory_by_os_release() {
pushd "$(dirname "${BASH_SOURCE[0]}")/../service.d/${APP_NAME_SHORT}" >/dev/null
{
# shellcheck source=/dev/null
{
source /etc/os-release
{
pushd "${ID}"/"${VERSION_CODENAME}" >/dev/null
} || {
pushd "${ID}" >/dev/null
} || {
[[ -n ${ID_LIKE} ]] && for ID in ${ID_LIKE}; do
pushd "${ID}" >/dev/null && break
done
} || {
echo "Unsupported OS: ${ID} ${VERSION_CODENAME} (${ID_LIKE})"
exit 1
}
pwd
popd >/dev/null
} || {
echo "Unsupported OS: unknown"
exit 1
}
}
popd >/dev/null
}
SETUP_SCRIPT_DIRECTORY=$(__get_setup_script_directory_by_os_release)
SETUP_SCRIPT_FILENAME="setup-${APP_NAME_SHORT}.sh"
SETUP_SCRIPT_FILEPATH="${SETUP_SCRIPT_DIRECTORY}/${SETUP_SCRIPT_FILENAME}"
{
echo "🟩 Running ${SETUP_SCRIPT_FILENAME}..."
$BASH "${SETUP_SCRIPT_FILEPATH}" "${BUILD_PATH}"
} || {
echo "🟥 ${SETUP_SCRIPT_FILENAME} failed."
exit 1
}
echo "${SETUP_SCRIPT_FILENAME} finished."

View File

@ -1,40 +0,0 @@
#!/bin/bash
###
# @Author: LinkLeong link@icewhale.org
# @Date: 2022-08-25 11:41:22
# @LastEditors: LinkLeong
# @LastEditTime: 2022-08-31 17:54:17
# @FilePath: /CasaOS/build/scripts/setup/service.d/casaos/debian/setup-casaos.sh
# @Description:
# @Website: https://www.casaos.io
# Copyright (c) 2022 by icewhale, All Rights Reserved.
###
set -e
APP_NAME="casaos"
# copy config files
CONF_PATH=/etc/casaos
OLD_CONF_PATH=/etc/casaos.conf
CONF_FILE=${CONF_PATH}/${APP_NAME}.conf
CONF_FILE_SAMPLE=${CONF_PATH}/${APP_NAME}.conf.sample
if [ -f "${OLD_CONF_PATH}" ]; then
echo "copy old conf"
cp "${OLD_CONF_PATH}" "${CONF_FILE}"
fi
if [ ! -f "${CONF_FILE}" ]; then
echo "Initializing config file..."
cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"
fi
rm -rf /etc/systemd/system/casaos.service # remove old service file
systemctl daemon-reload
# enable service (without starting)
echo "Enabling service..."
systemctl enable --force --no-ask-password "${APP_NAME}.service"

View File

@ -1 +0,0 @@
../setup-casaos.sh

View File

@ -1,40 +0,0 @@
#!/bin/bash
###
# @Author: LinkLeong link@icewhale.org
# @Date: 2022-08-25 11:41:22
# @LastEditors: LinkLeong
# @LastEditTime: 2022-08-31 17:54:17
# @FilePath: /CasaOS/build/scripts/setup/service.d/casaos/debian/setup-casaos.sh
# @Description:
# @Website: https://www.casaos.io
# Copyright (c) 2022 by icewhale, All Rights Reserved.
###
set -e
APP_NAME="casaos"
# copy config files
CONF_PATH=/etc/casaos
OLD_CONF_PATH=/etc/casaos.conf
CONF_FILE=${CONF_PATH}/${APP_NAME}.conf
CONF_FILE_SAMPLE=${CONF_PATH}/${APP_NAME}.conf.sample
if [ -f "${OLD_CONF_PATH}" ]; then
echo "copy old conf"
cp "${OLD_CONF_PATH}" "${CONF_FILE}"
fi
if [ ! -f "${CONF_FILE}" ]; then
echo "Initializing config file..."
cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"
fi
rm -rf /etc/systemd/system/casaos.service # remove old service file
systemctl daemon-reload
# enable service (without starting)
echo "Enabling service..."
systemctl enable --force --no-ask-password "${APP_NAME}.service"

View File

@ -1 +0,0 @@
../setup-casaos.sh

View File

@ -1 +0,0 @@
../debian/setup-casaos.sh

View File

@ -1,22 +0,0 @@
[app]
PAGE_SIZE = 10
RuntimeRootPath = runtime/
LogPath = /var/log/casaos/
LogSaveName = log
LogFileExt = log
DateStrFormat = 20060102
DateTimeFormat = 2006-01-02 15:04:05
TimeFormat = 15:04:05
DateFormat = 2006-01-02
DBPath = /var/lib/casaos
ShellPath = /usr/share/casaos/shell
UserDataPath = /var/lib/casaos/conf
[server]
RunMode = release
ServerApi = https://api.casaos.io/casaos-api
Handshake = socket.casaos.io
Token =
USBAutoMount =
[system]

View File

@ -1,13 +0,0 @@
[Unit]
After=casaos-message-bus.service
After=rclone.service
Description=CasaOS Main Service
[Service]
ExecStart=/usr/bin/casaos -c /etc/casaos/casaos.conf
PIDFile=/var/run/casaos/casaos.pid
Restart=always
Type=notify
[Install]
WantedBy=multi-user.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=rclone
[Service]
ExecStartPre=/usr/bin/mkdir -p /var/run/rclone
ExecStartPre=/usr/bin/rm -f /var/run/rclone/rclone.sock
ExecStart=/usr/bin/rclone rcd --rc-addr unix:///var/run/rclone/rclone.sock --rc-no-auth --rc-allow-origin "*"
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

Some files were not shown because too many files have changed in this diff Show More